Fix image background in now-playing browser.
[gmpc.git] / configure.ac
blob130f4af406d45191f8f09ea4fd440ec4217404cb
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 # 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 # Checks for header files.
134 AC_HEADER_STDC
135 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
137 # Checks for typedefs, structures, and compiler characteristics.
138 AC_C_CONST
140 # Checks for libraries.
141 AC_SUBST(GLIB_REQUIRED)
142 AC_SUBST(GTK_REQUIRED)
145 # User params
149 # Maintainer mode
150 AC_ARG_ENABLE([timing],
151               [--enable-timing Print timing debug output.],
152                   [case "${enableval}" in
153                             yes)    enable_timing=true;;
154                              no)    enable_timing=false;;
155                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-timing]);;
156                esac],
157                [enable_timing=false])
159 if test x${enable_timing} = xtrue; then
160 # Add DEBUG_ENABLE define to config.h
161     AC_DEFINE(DEBUG_TIMING, 1, [Enable timing output])
164 # Maintainer mode
165 AC_ARG_ENABLE([test],
166         [--enable-test Enable tests],
167         [case "${enableval}" in
168                 yes) test_mode=true;;
169                 no)  test_mode=false;;
170                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-test]);;
171          esac],
172         [test_mode=false])
174 AM_CONDITIONAL([ENABLE_TEST], [test x$test_mode = xtrue])
176 # EXTRA VERSION
177 AC_ARG_WITH([extra-version],
178         [--with-extra-version=revision Specify extra version.],
179         with_extra_version=${withval})
180 if test x"${with_extra_version}" != x; then
181     AM_CONDITIONAL([EXTRA_VERSION], [true])
182     EXTRA_VERSION="${with_extra_version}";
183     AC_SUBST(EXTRA_VERSION)
184 else
185     AM_CONDITIONAL([EXTRA_VERSION], [false])
190 # Split this out, because pkgconfig macro doesn't return nicely what is missing
192 # glib
193 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.16)
194 AC_SUBST(glib_LIBS)
195 AC_SUBST(glib_CFLAGS)
197 # gobject
198 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
199 AC_SUBST(gobject_LIBS)
200 AC_SUBST(gobject_CFLAGS)
202 #gtk
203 PKG_CHECK_MODULES([gtk], gtk+-3.0 >= 3.0)
204 AC_SUBST(gtk_LIBS)
205 AC_SUBST(gtk_CFLAGS)
207 #gmodule
208 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
209 AC_SUBST(gmodule_LIBS)
210 AC_SUBST(gmodule_CFLAGS)
212 # libmpd
213 PKG_CHECK_MODULES([libmpd], libmpd >= 0.20.95)
214 AC_SUBST(libmpd_LIBS)
215 AC_SUBST(libmpd_CFLAGS)
218 # gthread
219 PKG_CHECK_MODULES([gthread], gthread-2.0)
220 AC_SUBST(gthread_LIBS)
221 AC_SUBST(gthread_CFLAGS)
223 #libsoup
224 PKG_CHECK_MODULES([libsoup], libsoup-2.4)
225 AC_SUBST(libsoup_LIBS)
226 AC_SUBST(libsoup_CFLAGS)
228 #libgio
229 PKG_CHECK_MODULES([libgio], gio-2.0)
230 AC_SUBST(libgio_LIBS)
231 AC_SUBST(libgio_CFLAGS)
234 #sqlite3
235 PKG_CHECK_MODULES([sqlite3], sqlite3)
236 AC_SUBST(sqlite3_LIBS)
237 AC_SUBST(sqlite3_CFLAGS)
240 #libxml2
241 PKG_CHECK_MODULES([libxml2], libxml-2.0)
242 AC_SUBST(libxml2_LIBS)
243 AC_SUBST(libxml2_CFLAGS)
246 # installation paths
247 AC_MSG_CHECKING(prefix)
249 if test "x${prefix}" = "xNONE"; then
250         PACKAGE_PREFIX="${ac_default_prefix}"
251 else
252         PACKAGE_PREFIX="${prefix}"
254 AC_MSG_RESULT($PACKAGE_PREFIX)
256 # i18n support
257 dnl please keep them in alphabetical order
258 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"
261 AM_GLIB_GNU_GETTEXT
262 GETTEXT_PACKAGE=gmpc
263 AC_SUBST(GETTEXT_PACKAGE)
264 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
266 if test x$gt_cv_have_gettext != "xyes"; then
268         echo "Translations support is required."
269         exit 1;
272 #AM_GNU_GETTEXT([external])
273 # setting correct paths
274 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
275 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
278 AC_SUBST(PACKAGE_LOCALE_DIR)
279 AC_SUBST(PACKAGE_LIBS)
283 #Win32 compile support
285 EXTRA_CFLAGS=
286 EXTRA_LDFLAGS=
287 case "$CC" in
288 *gcc*)
289         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
290         ;;
291 esac
293 win32=no
294 macosx=no
295 case $host in
296   *-*-mingw32* | *-*-windows)
297     win32=yes
298     EXTRA_CFLAGS="$EXTRA_CFLAGS -mwindows -mms-bitfields"
299     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
300   *-*-cygwin*)
301     win32=yes
302     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
303   *-apple-darwin*)
304     EXTRA_LDFLAGS="-framework Carbon"
305     macosx=yes;;
306 esac
307 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
308 AM_CONDITIONAL(OSX, test x$macosx = xyes)
309 # for smclient
310 AM_CONDITIONAL(PLATFORM_WIN32, test x$win32 = xyes)
311 AM_CONDITIONAL(PLATFORM_OSX, test x$macosx = xyes)
314 # These depend on if we are or are not on windows or osX
317 # Session support
318 if test x$macosx = xno && test x$win32 = xno ; then
319 # Multimedia keys
320 AC_ARG_ENABLE([mmkeys],
321               [  --disable-mmkeys                       Disable multimedia keys support.],
322               [ case "${enableval}" in
323                     yes)    enable_mmkeys=yes;;
324                      no)    enable_mmkeys=no;;
325                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable--mmkeys]);;
326                 esac],
327               [enable_mmkeys=yes])
328 if test x${enable_mmkeys} = xyes; then
329         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
332 #libx11
333 PKG_CHECK_MODULES([libx11], x11)
334 AC_SUBST(libx11_LIBS)
335 AC_SUBST(libx11_CFLAGS)
337 else
338 # force them off
339 enable_mmkeys=no;
341 AC_SUBST(EXTRA_CFLAGS)
342 AC_SUBST(EXTRA_LDFLAGS)
344 # Check for gob2
345 GOB2_CHECK(2.0.0)
346 # Make the gob2 check fatal
347 if test x${GOB2} = x""; then
348         exit 1;
351 AM_PROG_VALAC([0.14.0])
353 if test x${VALAC} = x""; then
354     exit 1;
357 APPINDICATOR_REQUIRED=0.3
359 AC_ARG_ENABLE(appindicator,
360                         AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators ]),
361                         [enable_appindicator=$enableval],
362                         [enable_appindicator="no"])
364 if test x$enable_appindicator = xauto ; then
365         PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],
366                          enable_appindicator="yes",
367                          enable_appindicator="no")
370 if test x$enable_appindicator = xyes ; then
371         PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],,
372                          AC_MSG_ERROR([appindicator-0.1 is not installed]))
373         PKG_CHECK_MODULES(APP_INDICATOR,
374                         appindicator-0.1 >= $APPINDICATOR_REQUIRED)
375         AC_SUBST(APP_INDICATOR_CFLAGS)
376         AC_SUBST(APP_INDICATOR_LIBS)
377         AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator])
379 AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes)
381 AC_ARG_ENABLE([shave],
382             [  --disable-shave                  Use shave output cleaner when building.],
383               [ case "${enableval}" in
384                     yes)    enable_shave=yes;;
385                      no)    enable_shave=no;;
386                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable-shave]);;
387                 esac],
388               [enable_shave=no])
389 if test x$enable_shave = xyes; then
390 SHAVE_INIT([./])
393 GNOME_DOC_INIT([0.18.0], [have_gdu=yes], [have_gdu=no])
395 AC_CONFIG_FILES([
396 shave
397 shave-libtool
398 Makefile
399 src/Makefile
400 src/gmpc-version.h
401 src/gmpc-win32.rc
402 glade/Makefile
403 data/Makefile
404 po/Makefile.in
405 po/Makefile
406 data/gmpc.pc
407 doc/Makefile
408 doc/Mallard/Makefile
409 pixmaps/Makefile
410 pixmaps/icons/Makefile
411 pixmaps/icons/hicolor/Makefile
412 pixmaps/icons/hicolor/16x16/Makefile
413 pixmaps/icons/hicolor/16x16/actions/Makefile
414 pixmaps/icons/hicolor/16x16/status/Makefile
415 pixmaps/icons/hicolor/16x16/apps/Makefile
416 pixmaps/icons/hicolor/22x22/Makefile
417 pixmaps/icons/hicolor/22x22/actions/Makefile
418 pixmaps/icons/hicolor/22x22/status/Makefile
419 pixmaps/icons/hicolor/22x22/apps/Makefile
420 pixmaps/icons/hicolor/32x32/Makefile
421 pixmaps/icons/hicolor/32x32/actions/Makefile
422 pixmaps/icons/hicolor/32x32/status/Makefile
423 pixmaps/icons/hicolor/32x32/apps/Makefile
424 pixmaps/icons/hicolor/48x48/Makefile
425 pixmaps/icons/hicolor/48x48/actions/Makefile
426 pixmaps/icons/hicolor/48x48/apps/Makefile
427 pixmaps/icons/hicolor/48x48/status/Makefile
428 pixmaps/icons/hicolor/64x64/Makefile
429 pixmaps/icons/hicolor/64x64/apps/Makefile
430 pixmaps/icons/hicolor/64x64/status/Makefile
431 pixmaps/icons/hicolor/72x72/Makefile
432 pixmaps/icons/hicolor/72x72/apps/Makefile
433 pixmaps/icons/hicolor/72x72/status/Makefile
434 pixmaps/icons/hicolor/96x96/Makefile
435 pixmaps/icons/hicolor/96x96/apps/Makefile
436 pixmaps/icons/hicolor/96x96/status/Makefile
437 pixmaps/icons/hicolor/128x128/Makefile
438 pixmaps/icons/hicolor/128x128/apps/Makefile
439 pixmaps/icons/hicolor/128x128/status/Makefile
440 pixmaps/icons/hicolor/128x128/categories/Makefile
441 pixmaps/icons/hicolor/scalable/Makefile
442 pixmaps/icons/hicolor/scalable/actions/Makefile
443 pixmaps/icons/hicolor/scalable/status/Makefile
444 pixmaps/icons/hicolor/scalable/apps/Makefile
445 pixmaps/icons/hicolor/scalable/categories/Makefile
446 pixmaps/icons/Humanity/16x16/Makefile
447 pixmaps/icons/Humanity/16x16/actions/Makefile
448 pixmaps/icons/Humanity/16x16/status/Makefile
449 pixmaps/icons/Humanity/16x16/apps/Makefile
450 pixmaps/icons/Humanity/22x22/Makefile
451 pixmaps/icons/Humanity/22x22/actions/Makefile
452 pixmaps/icons/Humanity/22x22/status/Makefile
453 pixmaps/icons/Humanity/22x22/apps/Makefile
454 pixmaps/icons/Humanity/24x24/Makefile
455 pixmaps/icons/Humanity/24x24/actions/Makefile
456 pixmaps/icons/Humanity/24x24/status/Makefile
457 pixmaps/icons/Humanity/24x24/categories/Makefile
458 pixmaps/icons/Humanity/24x24/apps/Makefile
459 pixmaps/icons/Humanity/32x32/Makefile
460 pixmaps/icons/Humanity/32x32/actions/Makefile
461 pixmaps/icons/Humanity/32x32/status/Makefile
462 pixmaps/icons/Humanity/32x32/apps/Makefile
463 pixmaps/icons/Humanity/48x48/Makefile
464 pixmaps/icons/Humanity/48x48/actions/Makefile
465 pixmaps/icons/Humanity/48x48/apps/Makefile
466 pixmaps/icons/Humanity/48x48/status/Makefile
467 pixmaps/icons/Humanity/64x64/Makefile
468 pixmaps/icons/Humanity/64x64/apps/Makefile
469 pixmaps/icons/Humanity/64x64/status/Makefile
470 pixmaps/icons/Humanity/64x64/actions/Makefile
471 pixmaps/icons/Humanity/72x72/Makefile
472 pixmaps/icons/Humanity/72x72/apps/Makefile
473 pixmaps/icons/Humanity/72x72/status/Makefile
474 pixmaps/icons/Humanity/72x72/actions/Makefile
475 pixmaps/icons/Humanity/96x96/Makefile
476 pixmaps/icons/Humanity/96x96/apps/Makefile
477 pixmaps/icons/Humanity/96x96/status/Makefile
478 pixmaps/icons/Humanity/96x96/actions/Makefile
479 pixmaps/icons/Humanity/128x128/Makefile
480 pixmaps/icons/Humanity/128x128/apps/Makefile
481 pixmaps/icons/Humanity/128x128/status/Makefile
482 pixmaps/icons/Humanity/128x128/categories/Makefile
483 pixmaps/icons/Humanity/128x128/actions/Makefile
484 pixmaps/icons/Humanity/Makefile
485 pixmaps/icons/Humanity/scalable/Makefile
486 pixmaps/icons/Humanity/scalable/actions/Makefile
487 pixmaps/icons/Humanity/scalable/status/Makefile
488 pixmaps/icons/Humanity/scalable/apps/Makefile
489 pixmaps/icons/Humanity/scalable/categories/Makefile
490 test/Makefile
491 test/config/Makefile
492 test/MpdDataModel/Makefile
493 test/GmpcEasyDownload/Makefile
494 test/MetaDataCache/Makefile
495 test/PixbufCache/Makefile
496 test/AsyncImage/Makefile
497 test/Misc/Makefile
498 test/DiscoGS/Makefile
499 test/LastFM/Makefile
501 AC_OUTPUT
502 echo ""
503 echo ""
504 echo "------------------ Status ------------------"
505 if test x$enable_timing = xtrue; then
506         echo "Debug timing output is:           enabled"
507 else
508         echo "Debug timing output is:           disabled"
510 if test x${enable_mmkeys} = xyes; then
511         echo "Multimedia keys support is:       enabled"
512 else
513         echo "Multimedia keys support is:       disabled"
515 if test x"$enable_appindicator" = xyes; then
516     echo "AppIndicator Support is:          enabled"
517 else
518     echo "AppIndicator Support is:          disabled"
520 if test "x$libspiff" = "x1"; then
521         echo "Use libspiff library:             enabled"
522 else
523         echo "Use libspiff library:             disabled"
525 if test "x$libxspf" = "x1"; then
526         echo "Use libxspf library:              enabled"
527 else
528         echo "Use libxspf library:              disabled"
530 if test "x$have_gdu" = "xyes"; then
531         echo "Use Gnome Documentation:          enabled"
532 else
533         echo "Use Gnome Documentation:          disabled"
535 echo "";
536 echo "Now type make to build"
537 if test x$enable_shave = xyes; then
538     echo "Building is done with reduced output. (shave";
539     echo "use --disable-shave to get all (old) output back";