Try something2
[gmpc.git] / configure.ac
blobb149c4f6dab495d9e46d7f0311aef4a226e08750
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 AC_CONFIG_HEADERS([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"])
41 AC_PREREQ([2.67])
43 # Remove the check for c++ and fortran compiler
44 LT_INIT([win32-dll])
45 LT_LANG([Windows Resource])
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 IT_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_PROG_RC
62 # test for zlib
63 zlib=0
64 AC_CHECK_LIB(z, inflate,zlib=1,zlib=0)
65 AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1)
66 if test "x$zlib" != "x1"
67 then
68  AC_MSG_ERROR([GMPC plugin requires zlib])
73 PKG_PROG_PKG_CONFIG
75 #glyr
76 PKG_CHECK_MODULES([libglyr], libglyr)
77 AC_SUBST(libglyr_LIBS)
78 AC_SUBST(libglyr_CFLAGS)
80 unique=0;
81 AC_ARG_ENABLE([unique],
82               [--enable-unique Use unique.],
83                   [case "${enableval}" in
84                             yes)    enable_unique=true;;
85                              no)    enable_unique=false;;
86                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-unique]);;
87                esac],
88                [enable_unique=true])
89 # libxspf
90 libxspf=0;
91 libspiff=0;
94 AC_ARG_ENABLE([libxspf],
95               [--enable-libxspf Use libxspf.],
96                   [case "${enableval}" in
97                             yes)    enable_libxspf=true;;
98                              no)    enable_libxspf=false;;
99                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libxspf]);;
100                esac],
101                [enable_libxspf=detect])
102 if test "x$enable_libxspf" = "xdetect"; then
103         PKG_CHECK_MODULES([libxspf], xspf, enable_libxspf=true, enable_libxspf=false)
105 if test "x$enable_libxspf" = "xtrue"; then
106         PKG_CHECK_MODULES([libxspf], xspf)
107         AC_SUBST(libxspf_LIBS)
108         AC_SUBST(libxspf_CFLAGS)
109     libxspf=1;
110         AC_DEFINE([XSPF], 1, [Use xspf])
111 else
113 AC_ARG_ENABLE(libspiff,
114     [   --enable-libspiff      Use libspiff to parse spiff playlists.],
115     [ case "${enableval}" in
116         yes)    enable_libspiff=yes;;
117          no)    enable_libspiff=no;;
118           *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libspiff]);;
119      esac],
120      [enable_libspiff=auto])
122 if test "x${enable_libspiff}" != xno; then
123     AC_CHECK_HEADER(spiff/spiff_c.h, AC_CHECK_LIB(spiff, spiff_parse,libspiff=1,libspiff=0),libspiff=0)
124     if test "x${libspiff}" = "x1";
125     then
126         AC_DEFINE(SPIFF,1,["Use or don't use libspiff"])
127         SPIFF_LIBS=-lspiff
128         AC_SUBST(SPIFF_LIBS)
129     else
130         if test "x${enable_libspiff}" = "xyes"; then
131             AC_MSG_ERROR([libspiff not found])
132         fi
133     fi
137 # Checking for libunique.
138 if test "x$enable_unique" = "xtrue"; then
139         PKG_CHECK_MODULES([unique], unique-1.0)
140         AC_SUBST(unique_LIBS)
141         AC_SUBST(unique_CFLAGS)
142     unique=true;
143         AC_DEFINE([HAVE_UNIQUE], 1, [Use libunique])
145 AM_CONDITIONAL(HAVE_UNIQUE, test "x$unique" = "xtrue")
146 # Checks for header files.
147 AC_HEADER_STDC
148 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
150 # Checks for typedefs, structures, and compiler characteristics.
151 AC_C_CONST
153 # Checks for libraries.
154 AC_SUBST(GLIB_REQUIRED)
155 AC_SUBST(GTK_REQUIRED)
158 # User params
162 # Maintainer mode
163 AC_ARG_ENABLE([timing],
164               [--enable-timing Print timing debug output.],
165                   [case "${enableval}" in
166                             yes)    enable_timing=true;;
167                              no)    enable_timing=false;;
168                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-timing]);;
169                esac],
170                [enable_timing=false])
172 if test x${enable_timing} = xtrue; then
173 # Add DEBUG_ENABLE define to config.h
174     AC_DEFINE(DEBUG_TIMING, 1, [Enable timing output])
177 # Maintainer mode
178 AC_ARG_ENABLE([test],
179         [--enable-test Enable tests],
180         [case "${enableval}" in
181                 yes) test_mode=true;;
182                 no)  test_mode=false;;
183                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-test]);;
184          esac],
185         [test_mode=false])
187 AM_CONDITIONAL([ENABLE_TEST], [test x$test_mode = xtrue])
189 # EXTRA VERSION
190 AC_ARG_WITH([extra-version],
191         [--with-extra-version=revision Specify extra version.],
192         with_extra_version=${withval})
193 if test x"${with_extra_version}" != x; then
194     AM_CONDITIONAL([EXTRA_VERSION], [true])
195     EXTRA_VERSION="${with_extra_version}";
196     AC_SUBST(EXTRA_VERSION)
197 else
198     AM_CONDITIONAL([EXTRA_VERSION], [false])
203 # Split this out, because pkgconfig macro doesn't return nicely what is missing
205 # glib
206 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.16)
207 AC_SUBST(glib_LIBS)
208 AC_SUBST(glib_CFLAGS)
210 # gobject
211 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
212 AC_SUBST(gobject_LIBS)
213 AC_SUBST(gobject_CFLAGS)
215 #gtk
216 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.18)
217 AC_SUBST(gtk_LIBS)
218 AC_SUBST(gtk_CFLAGS)
220 #gmodule
221 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
222 AC_SUBST(gmodule_LIBS)
223 AC_SUBST(gmodule_CFLAGS)
225 # libmpd
226 PKG_CHECK_MODULES([libmpd], libmpd >= 0.20.95)
227 AC_SUBST(libmpd_LIBS)
228 AC_SUBST(libmpd_CFLAGS)
231 # gthread
232 PKG_CHECK_MODULES([gthread], gthread-2.0)
233 AC_SUBST(gthread_LIBS)
234 AC_SUBST(gthread_CFLAGS)
236 #libsoup
237 PKG_CHECK_MODULES([libsoup], libsoup-2.4)
238 AC_SUBST(libsoup_LIBS)
239 AC_SUBST(libsoup_CFLAGS)
241 #libgio
242 PKG_CHECK_MODULES([libgio], gio-2.0)
243 AC_SUBST(libgio_LIBS)
244 AC_SUBST(libgio_CFLAGS)
247 #sqlite3
248 PKG_CHECK_MODULES([sqlite3], sqlite3)
249 AC_SUBST(sqlite3_LIBS)
250 AC_SUBST(sqlite3_CFLAGS)
253 #libxml2
254 PKG_CHECK_MODULES([libxml2], libxml-2.0)
255 AC_SUBST(libxml2_LIBS)
256 AC_SUBST(libxml2_CFLAGS)
259 # installation paths
260 AC_MSG_CHECKING(prefix)
262 if test "x${prefix}" = "xNONE"; then
263         PACKAGE_PREFIX="${ac_default_prefix}"
264 else
265         PACKAGE_PREFIX="${prefix}"
267 AC_MSG_RESULT($PACKAGE_PREFIX)
269 # i18n support
270 dnl please keep them in alphabetical order
271 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"
274 AM_GLIB_GNU_GETTEXT
275 GETTEXT_PACKAGE=gmpc
276 AC_SUBST(GETTEXT_PACKAGE)
277 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
279 if test x$gt_cv_have_gettext != "xyes"; then
281         echo "Translations support is required."
282         exit 1;
285 #AM_GNU_GETTEXT([external])
286 # setting correct paths
287 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
288 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
291 AC_SUBST(PACKAGE_LOCALE_DIR)
292 AC_SUBST(PACKAGE_LIBS)
296 #Win32 compile support
298 EXTRA_CFLAGS=
299 EXTRA_LDFLAGS=
300 case "$CC" in
301 *gcc*)
302         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
303         ;;
304 esac
306 win32=no
307 macosx=no
308 case $host in
309   *-*-mingw32* | *-*-windows)
310     win32=yes
311     EXTRA_CFLAGS="$EXTRA_CFLAGS -mwindows -mms-bitfields"
312     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
313   *-*-cygwin*)
314     win32=yes
315     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
316   *-apple-darwin*)
317     EXTRA_LDFLAGS="-framework Carbon"
318     macosx=yes;;
319 esac
320 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
321 AM_CONDITIONAL(OSX, test x$macosx = xyes)
322 # for smclient
323 AM_CONDITIONAL(PLATFORM_WIN32, test x$win32 = xyes)
324 AM_CONDITIONAL(PLATFORM_OSX, test x$macosx = xyes)
327 # These depend on if we are or are not on windows or osX
330 # Session support
331 if test x$macosx = xno && test x$win32 = xno ; then
332 # Multimedia keys
333 AC_ARG_ENABLE([mmkeys],
334               [  --disable-mmkeys                       Disable multimedia keys support.],
335               [ case "${enableval}" in
336                     yes)    enable_mmkeys=yes;;
337                      no)    enable_mmkeys=no;;
338                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable--mmkeys]);;
339                 esac],
340               [enable_mmkeys=yes])
341 if test x${enable_mmkeys} = xyes; then
342         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
345 #libx11
346 PKG_CHECK_MODULES([libx11], x11)
347 AC_SUBST(libx11_LIBS)
348 AC_SUBST(libx11_CFLAGS)
350 else
351 # force them off
352 enable_mmkeys=no;
354 AC_SUBST(EXTRA_CFLAGS)
355 AC_SUBST(EXTRA_LDFLAGS)
357 # Check for gob2
358 GOB2_CHECK(2.0.0)
359 # Make the gob2 check fatal
360 if test x${GOB2} = x""; then
361         exit 1;
364 AM_PROG_VALAC([0.14.0])
366 if test x${VALAC} = x""; then
367     exit 1;
370 APPINDICATOR_REQUIRED=0.3
372 AC_ARG_ENABLE(appindicator,
373                         AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators ]),
374                         [enable_appindicator=$enableval],
375                         [enable_appindicator="auto"])
377 if test x$enable_appindicator = xauto ; then
378         PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],
379                          enable_appindicator="yes",
380                          enable_appindicator="no")
383 if test x$enable_appindicator = xyes ; then
384         PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],,
385                          AC_MSG_ERROR([appindicator-0.1 is not installed]))
386         PKG_CHECK_MODULES(APP_INDICATOR,
387                         appindicator-0.1 >= $APPINDICATOR_REQUIRED)
388         AC_SUBST(APP_INDICATOR_CFLAGS)
389         AC_SUBST(APP_INDICATOR_LIBS)
390         AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator])
392 AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes)
394 AC_ARG_ENABLE([shave],
395             [  --disable-shave                  Use shave output cleaner when building.],
396               [ case "${enableval}" in
397                     yes)    enable_shave=yes;;
398                      no)    enable_shave=no;;
399                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable-shave]);;
400                 esac],
401               [enable_shave=no])
402 if test x$enable_shave = xyes; then
403 SHAVE_INIT([./])
406 GNOME_DOC_INIT([0.18.0], [have_gdu=yes], [have_gdu=no])
408 AC_CONFIG_FILES([
409 shave
410 shave-libtool
411 Makefile
412 src/Makefile
413 src/gmpc-version.h
414 glade/Makefile
415 data/Makefile
416 po/Makefile.in
417 po/Makefile
418 data/gmpc.pc
419 remote/Makefile
420 doc/Makefile
421 doc/Mallard/Makefile
422 pixmaps/Makefile
423 pixmaps/icons/Makefile
424 pixmaps/icons/hicolor/Makefile
425 pixmaps/icons/hicolor/16x16/Makefile
426 pixmaps/icons/hicolor/16x16/actions/Makefile
427 pixmaps/icons/hicolor/16x16/status/Makefile
428 pixmaps/icons/hicolor/16x16/apps/Makefile
429 pixmaps/icons/hicolor/22x22/Makefile
430 pixmaps/icons/hicolor/22x22/actions/Makefile
431 pixmaps/icons/hicolor/22x22/status/Makefile
432 pixmaps/icons/hicolor/22x22/apps/Makefile
433 pixmaps/icons/hicolor/32x32/Makefile
434 pixmaps/icons/hicolor/32x32/actions/Makefile
435 pixmaps/icons/hicolor/32x32/status/Makefile
436 pixmaps/icons/hicolor/32x32/apps/Makefile
437 pixmaps/icons/hicolor/48x48/Makefile
438 pixmaps/icons/hicolor/48x48/actions/Makefile
439 pixmaps/icons/hicolor/48x48/apps/Makefile
440 pixmaps/icons/hicolor/48x48/status/Makefile
441 pixmaps/icons/hicolor/64x64/Makefile
442 pixmaps/icons/hicolor/64x64/apps/Makefile
443 pixmaps/icons/hicolor/64x64/status/Makefile
444 pixmaps/icons/hicolor/72x72/Makefile
445 pixmaps/icons/hicolor/72x72/apps/Makefile
446 pixmaps/icons/hicolor/72x72/status/Makefile
447 pixmaps/icons/hicolor/96x96/Makefile
448 pixmaps/icons/hicolor/96x96/apps/Makefile
449 pixmaps/icons/hicolor/96x96/status/Makefile
450 pixmaps/icons/hicolor/128x128/Makefile
451 pixmaps/icons/hicolor/128x128/apps/Makefile
452 pixmaps/icons/hicolor/128x128/status/Makefile
453 pixmaps/icons/hicolor/128x128/categories/Makefile
454 pixmaps/icons/hicolor/scalable/Makefile
455 pixmaps/icons/hicolor/scalable/actions/Makefile
456 pixmaps/icons/hicolor/scalable/status/Makefile
457 pixmaps/icons/hicolor/scalable/apps/Makefile
458 pixmaps/icons/hicolor/scalable/categories/Makefile
459 pixmaps/icons/Humanity/16x16/Makefile
460 pixmaps/icons/Humanity/16x16/actions/Makefile
461 pixmaps/icons/Humanity/16x16/status/Makefile
462 pixmaps/icons/Humanity/16x16/apps/Makefile
463 pixmaps/icons/Humanity/22x22/Makefile
464 pixmaps/icons/Humanity/22x22/actions/Makefile
465 pixmaps/icons/Humanity/22x22/status/Makefile
466 pixmaps/icons/Humanity/22x22/apps/Makefile
467 pixmaps/icons/Humanity/24x24/Makefile
468 pixmaps/icons/Humanity/24x24/actions/Makefile
469 pixmaps/icons/Humanity/24x24/status/Makefile
470 pixmaps/icons/Humanity/24x24/categories/Makefile
471 pixmaps/icons/Humanity/24x24/apps/Makefile
472 pixmaps/icons/Humanity/32x32/Makefile
473 pixmaps/icons/Humanity/32x32/actions/Makefile
474 pixmaps/icons/Humanity/32x32/status/Makefile
475 pixmaps/icons/Humanity/32x32/apps/Makefile
476 pixmaps/icons/Humanity/48x48/Makefile
477 pixmaps/icons/Humanity/48x48/actions/Makefile
478 pixmaps/icons/Humanity/48x48/apps/Makefile
479 pixmaps/icons/Humanity/48x48/status/Makefile
480 pixmaps/icons/Humanity/64x64/Makefile
481 pixmaps/icons/Humanity/64x64/apps/Makefile
482 pixmaps/icons/Humanity/64x64/status/Makefile
483 pixmaps/icons/Humanity/64x64/actions/Makefile
484 pixmaps/icons/Humanity/72x72/Makefile
485 pixmaps/icons/Humanity/72x72/apps/Makefile
486 pixmaps/icons/Humanity/72x72/status/Makefile
487 pixmaps/icons/Humanity/72x72/actions/Makefile
488 pixmaps/icons/Humanity/96x96/Makefile
489 pixmaps/icons/Humanity/96x96/apps/Makefile
490 pixmaps/icons/Humanity/96x96/status/Makefile
491 pixmaps/icons/Humanity/96x96/actions/Makefile
492 pixmaps/icons/Humanity/128x128/Makefile
493 pixmaps/icons/Humanity/128x128/apps/Makefile
494 pixmaps/icons/Humanity/128x128/status/Makefile
495 pixmaps/icons/Humanity/128x128/categories/Makefile
496 pixmaps/icons/Humanity/128x128/actions/Makefile
497 pixmaps/icons/Humanity/Makefile
498 pixmaps/icons/Humanity/scalable/Makefile
499 pixmaps/icons/Humanity/scalable/actions/Makefile
500 pixmaps/icons/Humanity/scalable/status/Makefile
501 pixmaps/icons/Humanity/scalable/apps/Makefile
502 pixmaps/icons/Humanity/scalable/categories/Makefile
503 test/Makefile
504 test/config/Makefile
505 test/MpdDataModel/Makefile
506 test/GmpcEasyDownload/Makefile
507 test/MetaDataCache/Makefile
508 test/PixbufCache/Makefile
509 test/AsyncImage/Makefile
510 test/Misc/Makefile
511 test/DiscoGS/Makefile
512 test/LastFM/Makefile
514 AC_OUTPUT
515 echo ""
516 echo ""
517 echo "------------------ Status ------------------"
518 if test x$enable_timing = xtrue; then
519         echo "Debug timing output is:           enabled"
520 else
521         echo "Debug timing output is:           disabled"
523 if test x${enable_mmkeys} = xyes; then
524         echo "Multimedia keys support is:       enabled"
525 else
526         echo "Multimedia keys support is:       disabled"
528 if test x"$enable_appindicator" = xyes; then
529     echo "AppIndicator Support is:          enabled"
530 else
531     echo "AppIndicator Support is:          disabled"
533 if test "x$libspiff" = "x1"; then
534         echo "Use libspiff library:             enabled"
535 else
536         echo "Use libspiff library:             disabled"
538 if test "x$libxspf" = "x1"; then
539         echo "Use libxspf library:              enabled"
540 else
541         echo "Use libxspf library:              disabled"
543 if test "x$unique" = "xtrue"; then
544         echo "Use unique library:               enabled"
545 else
546         echo "Use unique library:               disabled"
548 if test "x$have_gdu" = "xyes"; then
549         echo "Use Gnome Documentation:          enabled"
550 else
551         echo "Use Gnome Documentation:          disabled"
553 echo "";
554 echo "Now type make to build"
555 if test x$enable_shave = xyes; then
556     echo "Building is done with reduced output. (shave";
557     echo "use --disable-shave to get all (old) output back";