Move first stuff to gtk3
[gmpc.git] / configure.ac
blobc8e574d22a33a310c3c2f390c6d7aba27640138c
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-2012 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 [GMPC_COPYRIGHT]=package_copyright
34 AC_SUBST([GMPC_MAJOR_VERSION])
35 AC_SUBST([GMPC_MINOR_VERSION])
36 AC_SUBST([GMPC_MICRO_VERSION])
37 AC_SUBST([GMPC_COPYRIGHT])
38 AC_DEFINE(GMPC_TAGLINE,         package_tagline,        ["Gmpc's tagline"])
39 AC_DEFINE(GMPC_WEBSITE,         package_website,        ["Gmpc's website"])
40 AC_DEFINE(GMPC_BUGTRACKER,      package_bugtracker,     ["Gmpc's bugtracker"])
41 AC_DEFINE(GMPC_COPYRIGHT,       package_copyright,      ["Gmpc's Copyright"])
43 AC_PREREQ([2.67])
45 # Remove the check for c++ and fortran compiler
46 LT_INIT([win32-dll])
47 LT_LANG([Windows Resource])
48 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
49 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
50 AC_REPLACE_FUNCS(strndup)
53 #intltool, libtool. Check for CC compiler
54 IT_PROG_INTLTOOL([0.21])
56 # Check for intltool version, needed for make dist.
57 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
60 AC_PROG_CC
61 AM_PROG_CC_C_O
62 LT_PROG_RC
64 dnl Checks for libm 
65 AC_CHECK_LIB([m],[floor])
67 # test for zlib
68 zlib=0
69 AC_CHECK_LIB(z, inflate,zlib=1,zlib=0)
70 AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1)
71 if test "x$zlib" != "x1"
72 then
73  AC_MSG_ERROR([GMPC plugin requires zlib])
78 PKG_PROG_PKG_CONFIG
80 #glyr
81 PKG_CHECK_MODULES([libglyr], libglyr)
82 AC_SUBST(libglyr_LIBS)
83 AC_SUBST(libglyr_CFLAGS)
85 unique=0;
86 AC_ARG_ENABLE([unique],
87               [--enable-unique Use unique.],
88                   [case "${enableval}" in
89                             yes)    enable_unique=true;;
90                              no)    enable_unique=false;;
91                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-unique]);;
92                esac],
93                [enable_unique=true])
94 # libxspf
95 libxspf=0;
96 libspiff=0;
99 AC_ARG_ENABLE([libxspf],
100               [--enable-libxspf Use libxspf.],
101                   [case "${enableval}" in
102                             yes)    enable_libxspf=true;;
103                              no)    enable_libxspf=false;;
104                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libxspf]);;
105                esac],
106                [enable_libxspf=detect])
107 if test "x$enable_libxspf" = "xdetect"; then
108         PKG_CHECK_MODULES([libxspf], xspf, enable_libxspf=true, enable_libxspf=false)
110 if test "x$enable_libxspf" = "xtrue"; then
111         PKG_CHECK_MODULES([libxspf], xspf)
112         AC_SUBST(libxspf_LIBS)
113         AC_SUBST(libxspf_CFLAGS)
114     libxspf=1;
115         AC_DEFINE([XSPF], 1, [Use xspf])
116 else
118 AC_ARG_ENABLE(libspiff,
119     [   --enable-libspiff      Use libspiff to parse spiff playlists.],
120     [ case "${enableval}" in
121         yes)    enable_libspiff=yes;;
122          no)    enable_libspiff=no;;
123           *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libspiff]);;
124      esac],
125      [enable_libspiff=auto])
127 if test "x${enable_libspiff}" != xno; then
128     AC_CHECK_HEADER(spiff/spiff_c.h, AC_CHECK_LIB(spiff, spiff_parse,libspiff=1,libspiff=0),libspiff=0)
129     if test "x${libspiff}" = "x1";
130     then
131         AC_DEFINE(SPIFF,1,["Use or don't use libspiff"])
132         SPIFF_LIBS=-lspiff
133         AC_SUBST(SPIFF_LIBS)
134     else
135         if test "x${enable_libspiff}" = "xyes"; then
136             AC_MSG_ERROR([libspiff not found])
137         fi
138     fi
142 # Checking for libunique.
143 if test "x$enable_unique" = "xtrue"; then
144         PKG_CHECK_MODULES([unique], unique-1.0)
145         AC_SUBST(unique_LIBS)
146         AC_SUBST(unique_CFLAGS)
147     unique=true;
148         AC_DEFINE([HAVE_UNIQUE], 1, [Use libunique])
150 AM_CONDITIONAL(HAVE_UNIQUE, test "x$unique" = "xtrue")
151 # Checks for header files.
152 AC_HEADER_STDC
153 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
155 # Checks for typedefs, structures, and compiler characteristics.
156 AC_C_CONST
158 # Checks for libraries.
159 AC_SUBST(GLIB_REQUIRED)
160 AC_SUBST(GTK_REQUIRED)
163 # User params
167 # Maintainer mode
168 AC_ARG_ENABLE([timing],
169               [--enable-timing Print timing debug output.],
170                   [case "${enableval}" in
171                             yes)    enable_timing=true;;
172                              no)    enable_timing=false;;
173                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-timing]);;
174                esac],
175                [enable_timing=false])
177 if test x${enable_timing} = xtrue; then
178 # Add DEBUG_ENABLE define to config.h
179     AC_DEFINE(DEBUG_TIMING, 1, [Enable timing output])
182 # Maintainer mode
183 AC_ARG_ENABLE([test],
184         [--enable-test Enable tests],
185         [case "${enableval}" in
186                 yes) test_mode=true;;
187                 no)  test_mode=false;;
188                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-test]);;
189          esac],
190         [test_mode=false])
192 AM_CONDITIONAL([ENABLE_TEST], [test x$test_mode = xtrue])
194 # EXTRA VERSION
195 AC_ARG_WITH([extra-version],
196         [--with-extra-version=revision Specify extra version.],
197         with_extra_version=${withval})
198 if test x"${with_extra_version}" != x; then
199     AM_CONDITIONAL([EXTRA_VERSION], [true])
200     EXTRA_VERSION="${with_extra_version}";
201     AC_SUBST(EXTRA_VERSION)
202 else
203     AM_CONDITIONAL([EXTRA_VERSION], [false])
208 # Split this out, because pkgconfig macro doesn't return nicely what is missing
210 # glib
211 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.16)
212 AC_SUBST(glib_LIBS)
213 AC_SUBST(glib_CFLAGS)
215 # gobject
216 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
217 AC_SUBST(gobject_LIBS)
218 AC_SUBST(gobject_CFLAGS)
220 #gtk
221 PKG_CHECK_MODULES([gtk], gtk+-3.0 >= 3.0)
222 AC_SUBST(gtk_LIBS)
223 AC_SUBST(gtk_CFLAGS)
225 #gmodule
226 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
227 AC_SUBST(gmodule_LIBS)
228 AC_SUBST(gmodule_CFLAGS)
230 # libmpd
231 PKG_CHECK_MODULES([libmpd], libmpd >= 0.20.95)
232 AC_SUBST(libmpd_LIBS)
233 AC_SUBST(libmpd_CFLAGS)
236 # gthread
237 PKG_CHECK_MODULES([gthread], gthread-2.0)
238 AC_SUBST(gthread_LIBS)
239 AC_SUBST(gthread_CFLAGS)
241 #libsoup
242 PKG_CHECK_MODULES([libsoup], libsoup-2.4)
243 AC_SUBST(libsoup_LIBS)
244 AC_SUBST(libsoup_CFLAGS)
246 #libgio
247 PKG_CHECK_MODULES([libgio], gio-2.0)
248 AC_SUBST(libgio_LIBS)
249 AC_SUBST(libgio_CFLAGS)
252 #sqlite3
253 PKG_CHECK_MODULES([sqlite3], sqlite3)
254 AC_SUBST(sqlite3_LIBS)
255 AC_SUBST(sqlite3_CFLAGS)
258 #libxml2
259 PKG_CHECK_MODULES([libxml2], libxml-2.0)
260 AC_SUBST(libxml2_LIBS)
261 AC_SUBST(libxml2_CFLAGS)
264 # installation paths
265 AC_MSG_CHECKING(prefix)
267 if test "x${prefix}" = "xNONE"; then
268         PACKAGE_PREFIX="${ac_default_prefix}"
269 else
270         PACKAGE_PREFIX="${prefix}"
272 AC_MSG_RESULT($PACKAGE_PREFIX)
274 # i18n support
275 dnl please keep them in alphabetical order
276 ALL_LINGUAS="ar bg bn bs ca 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"
279 AM_GLIB_GNU_GETTEXT
280 GETTEXT_PACKAGE=gmpc
281 AC_SUBST(GETTEXT_PACKAGE)
282 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
284 if test x$gt_cv_have_gettext != "xyes"; then
286         echo "Translations support is required."
287         exit 1;
290 #AM_GNU_GETTEXT([external])
291 # setting correct paths
292 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
293 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
296 AC_SUBST(PACKAGE_LOCALE_DIR)
297 AC_SUBST(PACKAGE_LIBS)
301 #Win32 compile support
303 EXTRA_CFLAGS=
304 EXTRA_LDFLAGS=
305 case "$CC" in
306 *gcc*)
307         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
308         ;;
309 esac
311 win32=no
312 macosx=no
313 case $host in
314   *-*-mingw32* | *-*-windows)
315     win32=yes
316     EXTRA_CFLAGS="$EXTRA_CFLAGS -mwindows -mms-bitfields"
317     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
318   *-*-cygwin*)
319     win32=yes
320     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
321   *-apple-darwin*)
322     EXTRA_LDFLAGS="-framework Carbon"
323     macosx=yes;;
324 esac
325 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
326 AM_CONDITIONAL(OSX, test x$macosx = xyes)
327 # for smclient
328 AM_CONDITIONAL(PLATFORM_WIN32, test x$win32 = xyes)
329 AM_CONDITIONAL(PLATFORM_OSX, test x$macosx = xyes)
332 # These depend on if we are or are not on windows or osX
335 # Session support
336 if test x$macosx = xno && test x$win32 = xno ; then
337 # Multimedia keys
338 AC_ARG_ENABLE([mmkeys],
339               [  --disable-mmkeys                       Disable multimedia keys support.],
340               [ case "${enableval}" in
341                     yes)    enable_mmkeys=yes;;
342                      no)    enable_mmkeys=no;;
343                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable--mmkeys]);;
344                 esac],
345               [enable_mmkeys=yes])
346 if test x${enable_mmkeys} = xyes; then
347         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
350 #libx11
351 PKG_CHECK_MODULES([libx11], x11)
352 AC_SUBST(libx11_LIBS)
353 AC_SUBST(libx11_CFLAGS)
355 else
356 # force them off
357 enable_mmkeys=no;
359 AC_SUBST(EXTRA_CFLAGS)
360 AC_SUBST(EXTRA_LDFLAGS)
362 # Check for gob2
363 GOB2_CHECK(2.0.0)
364 # Make the gob2 check fatal
365 if test x${GOB2} = x""; then
366         exit 1;
369 AM_PROG_VALAC([0.14.0])
371 if test x${VALAC} = x""; then
372     exit 1;
375 APPINDICATOR_REQUIRED=0.3
377 AC_ARG_ENABLE(appindicator,
378                         AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators ]),
379                         [enable_appindicator=$enableval],
380                         [enable_appindicator="auto"])
382 if test x$enable_appindicator = xauto ; then
383         PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],
384                          enable_appindicator="yes",
385                          enable_appindicator="no")
388 if test x$enable_appindicator = xyes ; then
389         PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],,
390                          AC_MSG_ERROR([appindicator-0.1 is not installed]))
391         PKG_CHECK_MODULES(APP_INDICATOR,
392                         appindicator-0.1 >= $APPINDICATOR_REQUIRED)
393         AC_SUBST(APP_INDICATOR_CFLAGS)
394         AC_SUBST(APP_INDICATOR_LIBS)
395         AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator])
397 AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes)
399 AC_ARG_ENABLE([shave],
400             [  --disable-shave                  Use shave output cleaner when building.],
401               [ case "${enableval}" in
402                     yes)    enable_shave=yes;;
403                      no)    enable_shave=no;;
404                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable-shave]);;
405                 esac],
406               [enable_shave=no])
407 if test x$enable_shave = xyes; then
408 SHAVE_INIT([./])
411 GNOME_DOC_INIT([0.18.0], [have_gdu=yes], [have_gdu=no])
413 AC_CONFIG_FILES([
414 shave
415 shave-libtool
416 Makefile
417 src/Makefile
418 src/gmpc-version.h
419 src/gmpc-win32.rc
420 glade/Makefile
421 data/Makefile
422 po/Makefile.in
423 po/Makefile
424 data/gmpc.pc
425 remote/Makefile
426 doc/Makefile
427 doc/Mallard/Makefile
428 pixmaps/Makefile
429 pixmaps/icons/Makefile
430 pixmaps/icons/hicolor/Makefile
431 pixmaps/icons/hicolor/16x16/Makefile
432 pixmaps/icons/hicolor/16x16/actions/Makefile
433 pixmaps/icons/hicolor/16x16/status/Makefile
434 pixmaps/icons/hicolor/16x16/apps/Makefile
435 pixmaps/icons/hicolor/22x22/Makefile
436 pixmaps/icons/hicolor/22x22/actions/Makefile
437 pixmaps/icons/hicolor/22x22/status/Makefile
438 pixmaps/icons/hicolor/22x22/apps/Makefile
439 pixmaps/icons/hicolor/32x32/Makefile
440 pixmaps/icons/hicolor/32x32/actions/Makefile
441 pixmaps/icons/hicolor/32x32/status/Makefile
442 pixmaps/icons/hicolor/32x32/apps/Makefile
443 pixmaps/icons/hicolor/48x48/Makefile
444 pixmaps/icons/hicolor/48x48/actions/Makefile
445 pixmaps/icons/hicolor/48x48/apps/Makefile
446 pixmaps/icons/hicolor/48x48/status/Makefile
447 pixmaps/icons/hicolor/64x64/Makefile
448 pixmaps/icons/hicolor/64x64/apps/Makefile
449 pixmaps/icons/hicolor/64x64/status/Makefile
450 pixmaps/icons/hicolor/72x72/Makefile
451 pixmaps/icons/hicolor/72x72/apps/Makefile
452 pixmaps/icons/hicolor/72x72/status/Makefile
453 pixmaps/icons/hicolor/96x96/Makefile
454 pixmaps/icons/hicolor/96x96/apps/Makefile
455 pixmaps/icons/hicolor/96x96/status/Makefile
456 pixmaps/icons/hicolor/128x128/Makefile
457 pixmaps/icons/hicolor/128x128/apps/Makefile
458 pixmaps/icons/hicolor/128x128/status/Makefile
459 pixmaps/icons/hicolor/128x128/categories/Makefile
460 pixmaps/icons/hicolor/scalable/Makefile
461 pixmaps/icons/hicolor/scalable/actions/Makefile
462 pixmaps/icons/hicolor/scalable/status/Makefile
463 pixmaps/icons/hicolor/scalable/apps/Makefile
464 pixmaps/icons/hicolor/scalable/categories/Makefile
465 pixmaps/icons/Humanity/16x16/Makefile
466 pixmaps/icons/Humanity/16x16/actions/Makefile
467 pixmaps/icons/Humanity/16x16/status/Makefile
468 pixmaps/icons/Humanity/16x16/apps/Makefile
469 pixmaps/icons/Humanity/22x22/Makefile
470 pixmaps/icons/Humanity/22x22/actions/Makefile
471 pixmaps/icons/Humanity/22x22/status/Makefile
472 pixmaps/icons/Humanity/22x22/apps/Makefile
473 pixmaps/icons/Humanity/24x24/Makefile
474 pixmaps/icons/Humanity/24x24/actions/Makefile
475 pixmaps/icons/Humanity/24x24/status/Makefile
476 pixmaps/icons/Humanity/24x24/categories/Makefile
477 pixmaps/icons/Humanity/24x24/apps/Makefile
478 pixmaps/icons/Humanity/32x32/Makefile
479 pixmaps/icons/Humanity/32x32/actions/Makefile
480 pixmaps/icons/Humanity/32x32/status/Makefile
481 pixmaps/icons/Humanity/32x32/apps/Makefile
482 pixmaps/icons/Humanity/48x48/Makefile
483 pixmaps/icons/Humanity/48x48/actions/Makefile
484 pixmaps/icons/Humanity/48x48/apps/Makefile
485 pixmaps/icons/Humanity/48x48/status/Makefile
486 pixmaps/icons/Humanity/64x64/Makefile
487 pixmaps/icons/Humanity/64x64/apps/Makefile
488 pixmaps/icons/Humanity/64x64/status/Makefile
489 pixmaps/icons/Humanity/64x64/actions/Makefile
490 pixmaps/icons/Humanity/72x72/Makefile
491 pixmaps/icons/Humanity/72x72/apps/Makefile
492 pixmaps/icons/Humanity/72x72/status/Makefile
493 pixmaps/icons/Humanity/72x72/actions/Makefile
494 pixmaps/icons/Humanity/96x96/Makefile
495 pixmaps/icons/Humanity/96x96/apps/Makefile
496 pixmaps/icons/Humanity/96x96/status/Makefile
497 pixmaps/icons/Humanity/96x96/actions/Makefile
498 pixmaps/icons/Humanity/128x128/Makefile
499 pixmaps/icons/Humanity/128x128/apps/Makefile
500 pixmaps/icons/Humanity/128x128/status/Makefile
501 pixmaps/icons/Humanity/128x128/categories/Makefile
502 pixmaps/icons/Humanity/128x128/actions/Makefile
503 pixmaps/icons/Humanity/Makefile
504 pixmaps/icons/Humanity/scalable/Makefile
505 pixmaps/icons/Humanity/scalable/actions/Makefile
506 pixmaps/icons/Humanity/scalable/status/Makefile
507 pixmaps/icons/Humanity/scalable/apps/Makefile
508 pixmaps/icons/Humanity/scalable/categories/Makefile
509 test/Makefile
510 test/config/Makefile
511 test/MpdDataModel/Makefile
512 test/GmpcEasyDownload/Makefile
513 test/MetaDataCache/Makefile
514 test/PixbufCache/Makefile
515 test/AsyncImage/Makefile
516 test/Misc/Makefile
517 test/DiscoGS/Makefile
518 test/LastFM/Makefile
520 AC_OUTPUT
521 echo ""
522 echo ""
523 echo "------------------ Status ------------------"
524 if test x$enable_timing = xtrue; then
525         echo "Debug timing output is:           enabled"
526 else
527         echo "Debug timing output is:           disabled"
529 if test x${enable_mmkeys} = xyes; then
530         echo "Multimedia keys support is:       enabled"
531 else
532         echo "Multimedia keys support is:       disabled"
534 if test x"$enable_appindicator" = xyes; then
535     echo "AppIndicator Support is:          enabled"
536 else
537     echo "AppIndicator Support is:          disabled"
539 if test "x$libspiff" = "x1"; then
540         echo "Use libspiff library:             enabled"
541 else
542         echo "Use libspiff library:             disabled"
544 if test "x$libxspf" = "x1"; then
545         echo "Use libxspf library:              enabled"
546 else
547         echo "Use libxspf library:              disabled"
549 if test "x$unique" = "xtrue"; then
550         echo "Use unique library:               enabled"
551 else
552         echo "Use unique library:               disabled"
554 if test "x$have_gdu" = "xyes"; then
555         echo "Use Gnome Documentation:          enabled"
556 else
557         echo "Use Gnome Documentation:          disabled"
559 echo "";
560 echo "Now type make to build"
561 if test x$enable_shave = xyes; then
562     echo "Building is done with reduced output. (shave";
563     echo "use --disable-shave to get all (old) output back";