Update translations
[gmpc.git] / configure.ac
blob8804163d12b0291103cbbc1e5fe36f7c09309da3
1 # Process this file with autoconf to produce a configure script.
2 m4_define([gmpc_major_version], [0])
3 m4_define([gmpc_minor_version], [15])
4 m4_define([gmpc_micro_version], [6])
5 m4_define([gmpc_version],
6           [gmpc_major_version.gmpc_minor_version.gmpc_micro_version])
8 AC_INIT(src)
9 AM_CONFIG_HEADER([config.h])
10 AM_INIT_AUTOMAKE([gmpc], [gmpc_version],qball@sarine.nl)
13 GMPC_MAJOR_VERSION=gmpc_major_version
14 GMPC_MINOR_VERSION=gmpc_minor_version
15 GMPC_MICRO_VERSION=gmpc_micro_version
16 AC_DEFINE(GMPC_MAJOR_VERSION, gmpc_major_version, ["Major version of gmpc"])
17 AC_DEFINE(GMPC_MINOR_VERSION, gmpc_minor_version, ["Minor version of gmpc"])
18 AC_DEFINE(GMPC_MICRO_VERSION, gmpc_micro_version, ["Micro version of gmpc"])
21 # Checks for programs.
23 AC_PREREQ(2.59)
24 AC_PROG_INTLTOOL([0.21])
25 AC_PROG_LIBTOOL
26 AC_PROG_CC
27 AC_LIBTOOL_RC
31 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
33 AM_CONDITIONAL(HAVE_RC, test "x$RC" != "xno")
35 AC_ARG_ENABLE(configdir,
36               [  --enable-configdir             Use .config instead of .gmpc or .covers.],
37                [ if test "x$enableval" = "xyes"; then
38                 enable_configdir=yes
39             else
40                 enable_configdir=no
41             fi],
42               enable_configdir=no)
43 AC_ARG_ENABLE(trayicon,
44               [  --disable-trayicon  Disable the tray icon.],
45               [ if test "x$enableval" = "xyes"; then
46                enable_trayicon=yes
47            else
48                enable_trayicon=no
49            fi],
50               enable_trayicon=yes)
51 AC_ARG_ENABLE(sm,
52               [  --disable-sm                           Disable Session Support.],
53               [ if test "x$enableval" = "xyes"; then
54                enable_sm=yes
55            else
56                enable_sm=no
57            fi],
58               enable_sm=yes)
59 AC_ARG_ENABLE(mmkeys,
60               [  --disable-mmkeys                       Disable multimedia keys support.],
61               [ if test "x$enableval" = "xyes"; then
62                     enable_mmkeys=yes
63                 else
64                     enable_mmkeys=no
65                 fi],
66               enable_mmkeys=yes)
69 # Checks for libraries.
71 # Checks for header files.
72 AC_HEADER_STDC
73 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
74 AC_CHECK_HEADER([regex.h], [],
75                 [AC_MSG_ERROR([Required header regex.h not found.])])
77 # Checks for typedefs, structures, and compiler characteristics.
78 AC_C_CONST
80 AC_SUBST(GLIB_REQUIRED)
81 AC_SUBST(GTK_REQUIRED)
83 # Split this out, because pkgconfig macro doesn't return nicely what is missing
85 # glib
86 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.10)
87 AC_SUBST(glib_LIBS)
88 AC_SUBST(glib_CFLAGS)
90 # gobject
91 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
92 AC_SUBST(gobject_LIBS)
93 AC_SUBST(gobject_CFLAGS)
95 #gtk
96 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.12)
97 AC_SUBST(gtk_LIBS)
98 AC_SUBST(gtk_CFLAGS)
100 #gmodule
101 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
102 AC_SUBST(gmodule_LIBS)
103 AC_SUBST(gmodule_CFLAGS)
105 # libmpd
106 PKG_CHECK_MODULES([libmpd], libmpd >= 0.15.3)
107 AC_SUBST(libmpd_LIBS)
108 AC_SUBST(libmpd_CFLAGS)
110 # libglade
111 PKG_CHECK_MODULES([libglade], libglade-2.0)
112 AC_SUBST(libglade_LIBS)
113 AC_SUBST(libglade_CFLAGS)
115 # gthread
116 PKG_CHECK_MODULES([gthread], gthread-2.0)
117 AC_SUBST(gthread_LIBS)
118 AC_SUBST(gthread_CFLAGS)
121 # sm
122 if test x${enable_sm} = xyes; then
123         PKG_CHECK_MODULES([sm], sm)
124         AC_SUBST(sm_LIBS)
125         AC_SUBST(sm_CFLAGS)
126         AC_DEFINE(ENABLE_SM, 1, [Enable Session Support])
130 if test x${enable_mmkeys} = xyes; then
131         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
133 if test x${enable_configdir} = xyes; then
134         AC_DEFINE(USE_CONFIG_DIR,1, [Use Config Dir])
136 if test x${enable_trayicon} = xyes; then
137         AC_DEFINE(ENABLE_TRAYICON,1, [Disable Tray Icon])
139 # installation paths
140 AC_MSG_CHECKING(prefix)
142 if test "x${prefix}" = "xNONE"; then
143         PACKAGE_PREFIX="${ac_default_prefix}"
144 else
145         PACKAGE_PREFIX="${prefix}"
147 AC_MSG_RESULT($PACKAGE_PREFIX)
149 # i18n support
150 dnl please keep them in alphabetical order
151 ALL_LINGUAS="de es fr gl it nl nb_NO pl ru sv zh_CN"
153 GETTEXT_PACKAGE=gmpc
154 AC_SUBST(GETTEXT_PACKAGE)
155 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
156 AM_GLIB_GNU_GETTEXT
159 #AM_GNU_GETTEXT([external])
160 # setting correct paths
161 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
162 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
165 AC_SUBST(PACKAGE_LOCALE_DIR)
166 AC_SUBST(PACKAGE_LIBS)
169 EXTRA_CFLAGS=
170 EXTRA_LDFLAGS=
171 case "$CC" in
172 *gcc*)
173         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
174         ;;
175 esac
177 win32=no
178 case $host in
179   *-*-mingw32* | *-*-windows)
180     win32=yes
181     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
182     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
183   *-*-cygwin*)
184     win32=yes
185     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
186 esac
187 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
189 AC_SUBST(EXTRA_CFLAGS)
190 AC_SUBST(EXTRA_LDFLAGS)
191 GOB2_CHECK(2.0.0)
194 # libcurl settings
195 AC_PATH_PROG(CURL_CONFIG,curl-config)
196 AC_ARG_WITH(curl,
197             AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed]),
198             [CURL_CONFIG="${with_curl}/bin/curl-config"])
199 if test -f "${CURL_CONFIG}"; then
200     LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
201     CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
202 else
203     AC_MSG_WARN([curl-config not found, guessing at libcurl build settings])
205 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
206 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
208 # Maintainer mode
209 AC_ARG_ENABLE([maintainermode],
210         [--enable-maintainermode Enable maintainer mode.],
211         [case "${enableval}" in
212                 yes) maintainer_mode=true;;
213                 no)  maintainer_mode=false;;
214                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-maintainermode]);;
215          esac],
216         [maintainer_mode=false])
218 AM_CONDITIONAL([MAINTAINER_MODE], [test x$maintainer_mode = xtrue])
220 AC_OUTPUT([
221 Makefile
222 src/Makefile
223 src/gob/Makefile
224 glade/Makefile
225 data/Makefile
226 po/Makefile.in
227 po/Makefile
228 data/gmpc.pc
229 doc/Makefile
230 remote/Makefile
231 pixmaps/Makefile
232 pixmaps/icons/Makefile
233 pixmaps/icons/16x16/Makefile
234 pixmaps/icons/16x16/actions/Makefile
235 pixmaps/icons/16x16/status/Makefile
236 pixmaps/icons/16x16/apps/Makefile
237 pixmaps/icons/22x22/Makefile
238 pixmaps/icons/22x22/actions/Makefile
239 pixmaps/icons/22x22/status/Makefile
240 pixmaps/icons/22x22/apps/Makefile
241 pixmaps/icons/32x32/Makefile
242 pixmaps/icons/32x32/actions/Makefile
243 pixmaps/icons/32x32/status/Makefile
244 pixmaps/icons/32x32/apps/Makefile
245 pixmaps/icons/48x48/Makefile
246 pixmaps/icons/48x48/actions/Makefile
247 pixmaps/icons/48x48/apps/Makefile
248 pixmaps/icons/scalable/Makefile
249 pixmaps/icons/scalable/actions/Makefile
250 pixmaps/icons/scalable/status/Makefile
251 pixmaps/icons/scalable/apps/Makefile
253 echo ""
254 echo ""
255 echo "-------------- Status --------------"
256 if test x$maintainer_mode = xtrue; then
257         echo "Maintainer mode is:                       enabled"
258 else
259         echo "Maintainer mode is:                       disabled"
261 if test x${enable_mmkeys} = xyes; then
262         echo "Multimedia keys support is:               enabled"
263 else
264         echo "Multimedia keys support is:               disabled"
266 if test x${enable_sm} = xyes; then
267         echo "Session Manager support is:               enabled"
268 else
269         echo "Session Manager support is:               disabled"
271 if test x${enable_trayicon} = xyes; then
272         echo "Trayicon support is:                      enabled"
273 else
274         echo "Trayicon support is:                      disabled"
276 if test x${enable_configdir} = xyes; then
277         echo "Use ~/.config/ for config files:  enabled"
278 else
279         echo "Use ~/.config/ for config files:  disabled"
283 echo "Now type make to build"