AutoMPD: Add simple configuration dialog
[gmpc.git] / configure.ac
blob5fa5e5907236c8d58288d260289a8eafc31cf217
1 #Define the version
2 # micro version (aka day) is 90+ means developers release
3 m4_define([package_major_version], [11])
4 m4_define([package_minor_version], [8])
5 m4_define([package_micro_version], [90])
6 m4_define([package_version], [package_major_version.package_minor_version.package_micro_version])
8 AC_INIT([gmpc], [11.8.90], [qball@gmpclient.org])
10 #Define variable
11 m4_define([package_tagline],       "All hail the Greg")
12 m4_define([package_website],       "http://gmpclient.org")
13 m4_define([package_copyright],     "Copyright 2003-2011 Qball Cow")
14 m4_define([package_bugtracker],    "http://gmpc.wikia.com/wiki/GMPC_HELP")
18 AM_CONFIG_HEADER([config.h])
19 AC_CONFIG_MACRO_DIR([m4])
20 AM_INIT_AUTOMAKE
22 AM_MAINTAINER_MODE
25 #Make version and variables available in config.h
26 #AC_DEFINE(GMPC_MAJOR_VERSION,   package_major_version, ["Major version of gmpc"])
27 #AC_DEFINE(GMPC_MINOR_VERSION,   package_minor_version, ["Minor version of gmpc"])
28 #AC_DEFINE(GMPC_MICRO_VERSION,   package_micro_version, ["Micro version of gmpc"])
29 # This makes sure the right substitution is done
30 [GMPC_MAJOR_VERSION]=package_major_version
31 [GMPC_MINOR_VERSION]=package_minor_version
32 [GMPC_MICRO_VERSION]=package_micro_version
33 AC_SUBST([GMPC_MAJOR_VERSION])
34 AC_SUBST([GMPC_MINOR_VERSION])
35 AC_SUBST([GMPC_MICRO_VERSION])
36 AC_DEFINE(GMPC_TAGLINE,         package_tagline,        ["Gmpc's tagline"])
37 AC_DEFINE(GMPC_WEBSITE,         package_website,        ["Gmpc's website"])
38 AC_DEFINE(GMPC_BUGTRACKER,      package_bugtracker,     ["Gmpc's bugtracker"])
39 AC_DEFINE(GMPC_COPYRIGHT,       package_copyright,      ["Gmpc's Copyright"])
42 AC_PREREQ(2.59)
44 # Remove the check for c++ and fortran compiler
45 LT_INIT
46 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
47 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
48 AC_REPLACE_FUNCS(strndup)
51 #intltool, libtool. Check for CC compiler
52 AC_PROG_INTLTOOL([0.21])
54 # Check for intltool version, needed for make dist.
55 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
58 AC_PROG_CC
59 AM_PROG_CC_C_O
60 LT_AC_PROG_RC
61 AC_LIBTOOL_WIN32_DLL
62 AC_LIBTOOL_RC
63 AC_PROG_LIBTOOL
64 # test for zlib
65 zlib=0
66 AC_CHECK_LIB(z, inflate,zlib=1,zlib=0)
67 AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1)
68 if test "x$zlib" != "x1"
69 then
70  AC_MSG_ERROR([GMPC plugin requires zlib])
75 PKG_PROG_PKG_CONFIG
76 unique=0;
77 AC_ARG_ENABLE([unique],
78               [--enable-unique Use unique.],
79                   [case "${enableval}" in
80                             yes)    enable_unique=true;;
81                              no)    enable_unique=false;;
82                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-unique]);;
83                esac],
84                [enable_unique=true])
85 # libxspf
86 libxspf=0;
87 libspiff=0;
90 AC_ARG_ENABLE([libxspf],
91               [--enable-libxspf Use libxspf.],
92                   [case "${enableval}" in
93                             yes)    enable_libxspf=true;;
94                              no)    enable_libxspf=false;;
95                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libxspf]);;
96                esac],
97                [enable_libxspf=detect])
98 if test "x$enable_libxspf" = "xdetect"; then
99         PKG_CHECK_MODULES([libxspf], xspf, enable_libxspf=true, enable_libxspf=false)
101 if test "x$enable_libxspf" = "xtrue"; then
102         PKG_CHECK_MODULES([libxspf], xspf)
103         AC_SUBST(libxspf_LIBS)
104         AC_SUBST(libxspf_CFLAGS)
105     libxspf=1;
106         AC_DEFINE([XSPF], 1, [Use xspf])
107 else
109 AC_ARG_ENABLE(libspiff,
110     [   --enable-libspiff      Use libspiff to parse spiff playlists.],
111     [ case "${enableval}" in
112         yes)    enable_libspiff=yes;;
113          no)    enable_libspiff=no;;
114           *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libspiff]);;
115      esac],
116      [enable_libspiff=auto])
118 if test "x${enable_libspiff}" != xno; then
119     AC_CHECK_HEADER(spiff/spiff_c.h, AC_CHECK_LIB(spiff, spiff_parse,libspiff=1,libspiff=0),libspiff=0)
120     if test "x${libspiff}" = "x1";
121     then
122         AC_DEFINE(SPIFF,1,["Use or don't use libspiff"])
123         SPIFF_LIBS=-lspiff
124         AC_SUBST(SPIFF_LIBS)
125     else
126         if test "x${enable_libspiff}" = "xyes"; then
127             AC_MSG_ERROR([libspiff not found])
128         fi
129     fi
133 # Checking for libunique.
134 if test "x$enable_unique" = "xtrue"; then
135         PKG_CHECK_MODULES([unique], unique-1.0)
136         AC_SUBST(unique_LIBS)
137         AC_SUBST(unique_CFLAGS)
138     unique=true;
139         AC_DEFINE([HAVE_UNIQUE], 1, [Use libunique])
141 AM_CONDITIONAL(HAVE_UNIQUE, test "x$unique" = "xtrue")
142 # Checks for header files.
143 AC_HEADER_STDC
144 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
146 # Checks for typedefs, structures, and compiler characteristics.
147 AC_C_CONST
149 # Checks for libraries.
150 AC_SUBST(GLIB_REQUIRED)
151 AC_SUBST(GTK_REQUIRED)
154 # User params
157 # Maintainer mode
158 AC_ARG_ENABLE([timing],
159               [--enable-timing Print timing debug output.],
160                   [case "${enableval}" in
161                             yes)    enable_timing=true;;
162                              no)    enable_timing=false;;
163                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-timing]);;
164                esac],
165                [enable_timing=false])
167 if test x${enable_timing} = xtrue; then
168 # Add DEBUG_ENABLE define to config.h
169     AC_DEFINE(DEBUG_TIMING, 1, [Enable timing output])
172 # Maintainer mode
173 AC_ARG_ENABLE([test],
174         [--enable-test Enable tests],
175         [case "${enableval}" in
176                 yes) test_mode=true;;
177                 no)  test_mode=false;;
178                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-test]);;
179          esac],
180         [test_mode=false])
182 AM_CONDITIONAL([ENABLE_TEST], [test x$test_mode = xtrue])
184 # EXTRA VERSION
185 AC_ARG_WITH([extra-version],
186         [--with-extra-version=revision Specify extra version.],
187         with_extra_version=${withval})
188 if test x"${with_extra_version}" != x; then
189     AM_CONDITIONAL([EXTRA_VERSION], [true])
190     EXTRA_VERSION="${with_extra_version}";
191     AC_SUBST(EXTRA_VERSION)
192 else
193     AM_CONDITIONAL([EXTRA_VERSION], [false])
198 # Split this out, because pkgconfig macro doesn't return nicely what is missing
200 # glib
201 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.16)
202 AC_SUBST(glib_LIBS)
203 AC_SUBST(glib_CFLAGS)
205 # gobject
206 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
207 AC_SUBST(gobject_LIBS)
208 AC_SUBST(gobject_CFLAGS)
210 #gtk
211 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.18)
212 AC_SUBST(gtk_LIBS)
213 AC_SUBST(gtk_CFLAGS)
215 #gmodule
216 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
217 AC_SUBST(gmodule_LIBS)
218 AC_SUBST(gmodule_CFLAGS)
220 # libmpd
221 PKG_CHECK_MODULES([libmpd], libmpd >= 0.20.95)
222 AC_SUBST(libmpd_LIBS)
223 AC_SUBST(libmpd_CFLAGS)
226 # gthread
227 PKG_CHECK_MODULES([gthread], gthread-2.0)
228 AC_SUBST(gthread_LIBS)
229 AC_SUBST(gthread_CFLAGS)
231 #libsoup
232 PKG_CHECK_MODULES([libsoup], libsoup-2.4)
233 AC_SUBST(libsoup_LIBS)
234 AC_SUBST(libsoup_CFLAGS)
236 #libgio
237 PKG_CHECK_MODULES([libgio], gio-2.0)
238 AC_SUBST(libgio_LIBS)
239 AC_SUBST(libgio_CFLAGS)
242 #sqlite3
243 PKG_CHECK_MODULES([sqlite3], sqlite3)
244 AC_SUBST(sqlite3_LIBS)
245 AC_SUBST(sqlite3_CFLAGS)
248 #libxml2
249 PKG_CHECK_MODULES([libxml2], libxml-2.0)
250 AC_SUBST(libxml2_LIBS)
251 AC_SUBST(libxml2_CFLAGS)
254 # installation paths
255 AC_MSG_CHECKING(prefix)
257 if test "x${prefix}" = "xNONE"; then
258         PACKAGE_PREFIX="${ac_default_prefix}"
259 else
260         PACKAGE_PREFIX="${prefix}"
262 AC_MSG_RESULT($PACKAGE_PREFIX)
264 # i18n support
265 dnl please keep them in alphabetical order
266 ALL_LINGUAS="ar bg bn bs cs da de el et en_CA en_GB es fi fr gl he hi hu hy id it ja jv lv ml ms nb ne nl oc pl pt pt_BR ro ru sq sv th tr zh_CN zh_TW"
269 AM_GLIB_GNU_GETTEXT
270 GETTEXT_PACKAGE=gmpc
271 AC_SUBST(GETTEXT_PACKAGE)
272 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
274 if test x$gt_cv_have_gettext != "xyes"; then
276         echo "Translations support is required."
277         exit 1;
280 #AM_GNU_GETTEXT([external])
281 # setting correct paths
282 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
283 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
286 AC_SUBST(PACKAGE_LOCALE_DIR)
287 AC_SUBST(PACKAGE_LIBS)
291 #Win32 compile support
293 EXTRA_CFLAGS=
294 EXTRA_LDFLAGS=
295 case "$CC" in
296 *gcc*)
297         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
298         ;;
299 esac
301 win32=no
302 macosx=no
303 case $host in
304   *-*-mingw32* | *-*-windows)
305     win32=yes
306     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
307     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
308   *-*-cygwin*)
309     win32=yes
310     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
311   *-apple-darwin*)
312     EXTRA_LDFLAGS="-framework Carbon"
313     macosx=yes;;
314 esac
315 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
316 AM_CONDITIONAL(OSX, test x$macosx = xyes)
317 # for smclient
318 AM_CONDITIONAL(PLATFORM_WIN32, test x$win32 = xyes)
319 AM_CONDITIONAL(PLATFORM_OSX, test x$macosx = xyes)
322 # These depend on if we are or are not on windows or osX
325 # Session support
326 if test x$macosx = xno && test x$win32 = xno ; then
327 # Multimedia keys
328 AC_ARG_ENABLE([mmkeys],
329               [  --disable-mmkeys                       Disable multimedia keys support.],
330               [ case "${enableval}" in
331                     yes)    enable_mmkeys=yes;;
332                      no)    enable_mmkeys=no;;
333                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable--mmkeys]);;
334                 esac],
335               [enable_mmkeys=yes])
336 if test x${enable_mmkeys} = xyes; then
337         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
340 #libx11
341 PKG_CHECK_MODULES([libx11], x11)
342 AC_SUBST(libx11_LIBS)
343 AC_SUBST(libx11_CFLAGS)
345 else
346 # force them off
347 enable_mmkeys=no;
349 AC_SUBST(EXTRA_CFLAGS)
350 AC_SUBST(EXTRA_LDFLAGS)
352 # Check for gob2
353 GOB2_CHECK(2.0.0)
354 # Make the gob2 check fatal
355 if test x${GOB2} = x""; then
356         exit 1;
359 AM_PROG_VALAC([0.11.0])
361 if test x${VALAC} = x""; then
362     exit 1;
365 APPINDICATOR_REQUIRED=0.3
367 AC_ARG_ENABLE(appindicator,
368                         AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators ]),
369                         [enable_appindicator=$enableval],
370                         [enable_appindicator="auto"])
372 if test x$enable_appindicator = xauto ; then
373         PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],
374                          enable_appindicator="yes",
375                          enable_appindicator="no")
378 if test x$enable_appindicator = xyes ; then
379         PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],,
380                          AC_MSG_ERROR([appindicator-0.1 is not installed]))
381         PKG_CHECK_MODULES(APP_INDICATOR,
382                         appindicator-0.1 >= $APPINDICATOR_REQUIRED)
383         AC_SUBST(APP_INDICATOR_CFLAGS)
384         AC_SUBST(APP_INDICATOR_LIBS)
385         AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator])
387 AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes)
389 AC_ARG_ENABLE([shave],
390             [  --disable-shave                  Use shave output cleaner when building.],
391               [ case "${enableval}" in
392                     yes)    enable_shave=yes;;
393                      no)    enable_shave=no;;
394                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable-shave]);;
395                 esac],
396               [enable_shave=no])
397 if test x$enable_shave = xyes; then
398 SHAVE_INIT([./])
401 GNOME_DOC_INIT([0.18.0], [have_gdu=yes], [have_gdu=no])
403 AC_OUTPUT([
404 shave
405 shave-libtool
406 Makefile
407 src/Makefile
408 src/gmpc-version.h
409 glade/Makefile
410 data/Makefile
411 po/Makefile.in
412 po/Makefile
413 data/gmpc.pc
414 remote/Makefile
415 doc/Makefile
416 doc/Mallard/Makefile
417 pixmaps/Makefile
418 pixmaps/icons/Makefile
419 pixmaps/icons/hicolor/Makefile
420 pixmaps/icons/hicolor/16x16/Makefile
421 pixmaps/icons/hicolor/16x16/actions/Makefile
422 pixmaps/icons/hicolor/16x16/status/Makefile
423 pixmaps/icons/hicolor/16x16/apps/Makefile
424 pixmaps/icons/hicolor/22x22/Makefile
425 pixmaps/icons/hicolor/22x22/actions/Makefile
426 pixmaps/icons/hicolor/22x22/status/Makefile
427 pixmaps/icons/hicolor/22x22/apps/Makefile
428 pixmaps/icons/hicolor/32x32/Makefile
429 pixmaps/icons/hicolor/32x32/actions/Makefile
430 pixmaps/icons/hicolor/32x32/status/Makefile
431 pixmaps/icons/hicolor/32x32/apps/Makefile
432 pixmaps/icons/hicolor/48x48/Makefile
433 pixmaps/icons/hicolor/48x48/actions/Makefile
434 pixmaps/icons/hicolor/48x48/apps/Makefile
435 pixmaps/icons/hicolor/48x48/status/Makefile
436 pixmaps/icons/hicolor/64x64/Makefile
437 pixmaps/icons/hicolor/64x64/apps/Makefile
438 pixmaps/icons/hicolor/64x64/status/Makefile
439 pixmaps/icons/hicolor/72x72/Makefile
440 pixmaps/icons/hicolor/72x72/apps/Makefile
441 pixmaps/icons/hicolor/72x72/status/Makefile
442 pixmaps/icons/hicolor/96x96/Makefile
443 pixmaps/icons/hicolor/96x96/apps/Makefile
444 pixmaps/icons/hicolor/96x96/status/Makefile
445 pixmaps/icons/hicolor/128x128/Makefile
446 pixmaps/icons/hicolor/128x128/apps/Makefile
447 pixmaps/icons/hicolor/128x128/status/Makefile
448 pixmaps/icons/hicolor/128x128/categories/Makefile
449 pixmaps/icons/hicolor/scalable/Makefile
450 pixmaps/icons/hicolor/scalable/actions/Makefile
451 pixmaps/icons/hicolor/scalable/status/Makefile
452 pixmaps/icons/hicolor/scalable/apps/Makefile
453 pixmaps/icons/hicolor/scalable/categories/Makefile
454 pixmaps/icons/Humanity/16x16/Makefile
455 pixmaps/icons/Humanity/16x16/actions/Makefile
456 pixmaps/icons/Humanity/16x16/status/Makefile
457 pixmaps/icons/Humanity/16x16/apps/Makefile
458 pixmaps/icons/Humanity/22x22/Makefile
459 pixmaps/icons/Humanity/22x22/actions/Makefile
460 pixmaps/icons/Humanity/22x22/status/Makefile
461 pixmaps/icons/Humanity/22x22/apps/Makefile
462 pixmaps/icons/Humanity/24x24/Makefile
463 pixmaps/icons/Humanity/24x24/actions/Makefile
464 pixmaps/icons/Humanity/24x24/status/Makefile
465 pixmaps/icons/Humanity/24x24/categories/Makefile
466 pixmaps/icons/Humanity/24x24/apps/Makefile
467 pixmaps/icons/Humanity/32x32/Makefile
468 pixmaps/icons/Humanity/32x32/actions/Makefile
469 pixmaps/icons/Humanity/32x32/status/Makefile
470 pixmaps/icons/Humanity/32x32/apps/Makefile
471 pixmaps/icons/Humanity/48x48/Makefile
472 pixmaps/icons/Humanity/48x48/actions/Makefile
473 pixmaps/icons/Humanity/48x48/apps/Makefile
474 pixmaps/icons/Humanity/48x48/status/Makefile
475 pixmaps/icons/Humanity/64x64/Makefile
476 pixmaps/icons/Humanity/64x64/apps/Makefile
477 pixmaps/icons/Humanity/64x64/status/Makefile
478 pixmaps/icons/Humanity/64x64/actions/Makefile
479 pixmaps/icons/Humanity/72x72/Makefile
480 pixmaps/icons/Humanity/72x72/apps/Makefile
481 pixmaps/icons/Humanity/72x72/status/Makefile
482 pixmaps/icons/Humanity/72x72/actions/Makefile
483 pixmaps/icons/Humanity/96x96/Makefile
484 pixmaps/icons/Humanity/96x96/apps/Makefile
485 pixmaps/icons/Humanity/96x96/status/Makefile
486 pixmaps/icons/Humanity/96x96/actions/Makefile
487 pixmaps/icons/Humanity/128x128/Makefile
488 pixmaps/icons/Humanity/128x128/apps/Makefile
489 pixmaps/icons/Humanity/128x128/status/Makefile
490 pixmaps/icons/Humanity/128x128/categories/Makefile
491 pixmaps/icons/Humanity/128x128/actions/Makefile
492 pixmaps/icons/Humanity/Makefile
493 pixmaps/icons/Humanity/scalable/Makefile
494 pixmaps/icons/Humanity/scalable/actions/Makefile
495 pixmaps/icons/Humanity/scalable/status/Makefile
496 pixmaps/icons/Humanity/scalable/apps/Makefile
497 pixmaps/icons/Humanity/scalable/categories/Makefile
498 test/Makefile
499 test/config/Makefile
500 test/MpdDataModel/Makefile
501 test/GmpcEasyDownload/Makefile
502 test/MetaDataCache/Makefile
503 test/PixbufCache/Makefile
504 test/AsyncImage/Makefile
505 test/Misc/Makefile
506 test/DiscoGS/Makefile
507 test/LastFM/Makefile
509 echo ""
510 echo ""
511 echo "------------------ Status ------------------"
512 if test x$enable_timing = xtrue; then
513         echo "Debug timing output is:           enabled"
514 else
515         echo "Debug timing output is:           disabled"
517 if test x${enable_mmkeys} = xyes; then
518         echo "Multimedia keys support is:       enabled"
519 else
520         echo "Multimedia keys support is:       disabled"
522 if test x"$enable_appindicator" = xyes; then
523     echo "AppIndicator Support is:          enabled"
524 else
525     echo "AppIndicator Support is:          disabled"
527 if test "x$libspiff" = "x1"; then
528         echo "Use libspiff library:             enabled"
529 else
530         echo "Use libspiff library:             disabled"
532 if test "x$libxspf" = "x1"; then
533         echo "Use libxspf library:              enabled"
534 else
535         echo "Use libxspf library:              disabled"
537 if test "x$unique" = "xtrue"; then
538         echo "Use unique library:               enabled"
539 else
540         echo "Use unique library:               disabled"
542 if test "x$have_gdu" = "xyes"; then
543         echo "Use Gnome Documentation:          enabled"
544 else
545         echo "Use Gnome Documentation:          disabled"
547 echo "";
548 echo "Now type make to build"
549 if test x$enable_shave = xyes; then
550     echo "Building is done with reduced output. (shave";
551     echo "use --disable-shave to get all (old) output back";