gmpc version 0.19.100
[gmpc.git] / configure.ac
blobb706c5e07502ce8eafa587261fe7261f568fb798
1 #Define the version
2 m4_define([package_major_version], [0])
3 m4_define([package_minor_version], [19])
4 m4_define([package_micro_version], [100])
5 m4_define([package_version], [package_major_version.package_minor_version.package_micro_version])
7 AC_INIT([gmpc], [0.19.100], [qball@sarine.nl])
9 #Define variable
10 m4_define([package_tagline],       "♯♪ + ♭♪ = ☺")
11 m4_define([package_website],       "http://gmpc.wikia.com")
12 m4_define([package_copyright],     "Copyright 2003-2009 Qball Cow")
13 m4_define([package_bugtracker],    "http://gmpc.wikia.com/wiki/GMPC_HELP")
17 AM_CONFIG_HEADER([config.h])
18 AC_CONFIG_MACRO_DIR([m4])
19 AM_INIT_AUTOMAKE
21 AM_MAINTAINER_MODE
24 #Make version and variables available in config.h
25 #AC_DEFINE(GMPC_MAJOR_VERSION,   package_major_version, ["Major version of gmpc"])
26 #AC_DEFINE(GMPC_MINOR_VERSION,   package_minor_version, ["Minor version of gmpc"])
27 #AC_DEFINE(GMPC_MICRO_VERSION,   package_micro_version, ["Micro version of gmpc"])
28 # This makes sure the right substitution is done
29 [GMPC_MAJOR_VERSION]=package_major_version
30 [GMPC_MINOR_VERSION]=package_minor_version
31 [GMPC_MICRO_VERSION]=package_micro_version
32 AC_SUBST([GMPC_MAJOR_VERSION])
33 AC_SUBST([GMPC_MINOR_VERSION])
34 AC_SUBST([GMPC_MICRO_VERSION])
35 AC_DEFINE(GMPC_TAGLINE,         package_tagline,        ["Gmpc's tagline"])
36 AC_DEFINE(GMPC_WEBSITE,         package_website,        ["Gmpc's website"])
37 AC_DEFINE(GMPC_BUGTRACKER,      package_bugtracker,     ["Gmpc's bugtracker"])
38 AC_DEFINE(GMPC_COPYRIGHT,       package_copyright,      ["Gmpc's Copyright"])
41 AC_PREREQ(2.59)
43 # Remove the check for c++ and fortran compiler
44 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
45 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
46 AC_REPLACE_FUNCS(strndup)
49 #intltool, libtool. Check for CC compiler
50 AC_PROG_INTLTOOL([0.21])
52 # Check for intltool version, needed for make dist. 
53 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
56 AC_PROG_CC
57 AM_PROG_CC_C_O
58 LT_AC_PROG_RC
59 AC_LIBTOOL_WIN32_DLL
60 AC_LIBTOOL_RC
61 AC_PROG_LIBTOOL
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
74 # libxspf 
75 libxspf=0;
76 libspiff=0;
78 AC_ARG_ENABLE([libxspf],
79               [--enable-libxspf Use libxspf.], 
80                   [case "${enableval}" in
81                             yes)    enable_libxspf=true;;
82                              no)    enable_libxspf=false;;
83                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libxspf]);;
84                esac],
85                [enable_libxspf=detect])
86 if test "x$enable_libxspf" = "xdetect"; then
87         PKG_CHECK_MODULES([libxspf], xspf, enable_libxspf=true, enable_libxspf=false)
89 if test "x$enable_libxspf" = "xtrue"; then
90         PKG_CHECK_MODULES([libxspf], xspf)
91         AC_SUBST(libxspf_LIBS)
92         AC_SUBST(libxspf_CFLAGS)
93     libxspf=1;
94         AC_DEFINE([XSPF], 1, [Use xspf])
95 else
97 AC_ARG_ENABLE(libspiff,
98     [   --enable-libspiff      Use libspiff to parse spiff playlists.],
99     [ case "${enableval}" in
100         yes)    enable_libspiff=yes;;
101          no)    enable_libspiff=no;;
102           *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libspiff]);;
103      esac],
104      [enable_libspiff=auto])
106 if test "x${enable_libspiff}" != xno; then 
107     AC_CHECK_HEADER(spiff/spiff_c.h, AC_CHECK_LIB(spiff, spiff_parse,libspiff=1,libspiff=0),libspiff=0)
108     if test "x${libspiff}" = "x1";
109     then
110         AC_DEFINE(SPIFF,1,["Use or don't use libspiff"])
111         SPIFF_LIBS=-lspiff
112         AC_SUBST(SPIFF_LIBS)
113     else 
114         if test "x${enable_libspiff}" = "xyes"; then
115             AC_MSG_ERROR([libspiff not found])
116         fi
117     fi
121 # Checks for header files.
122 AC_HEADER_STDC
123 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
125 # Checks for typedefs, structures, and compiler characteristics.
126 AC_C_CONST
128 # Checks for libraries.
129 AC_SUBST(GLIB_REQUIRED)
130 AC_SUBST(GTK_REQUIRED)
133 # User params 
136 # Maintainer mode
137 AC_ARG_ENABLE([timing],
138               [--enable-timing Print timing debug output.],
139                   [case "${enableval}" in
140                             yes)    enable_timing=true;;
141                              no)    enable_timing=false;;
142                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-timing]);;
143                esac],
144                [enable_timing=false])
146 if test x${enable_timing} = xtrue; then
147 # Add DEBUG_ENABLE define to config.h
148     AC_DEFINE(DEBUG_TIMING, 1, [Enable timing output])
151 # Maintainer mode
152 AC_ARG_ENABLE([test],
153         [--enable-test Enable tests],
154         [case "${enableval}" in
155                 yes) test_mode=true;;
156                 no)  test_mode=false;;
157                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-test]);;
158          esac],
159         [test_mode=false])
161 AM_CONDITIONAL([ENABLE_TEST], [test x$test_mode = xtrue])
163 # EXTRA VERSION
164 AC_ARG_WITH([extra-version],
165         [--with-extra-version=revision Specify extra version.],
166         with_extra_version=${withval})
167 if test x"${with_extra_version}" != x; then
168     AM_CONDITIONAL([EXTRA_VERSION], [true])
169     EXTRA_VERSION="${with_extra_version}";
170     AC_SUBST(EXTRA_VERSION)
171 else
172     AM_CONDITIONAL([EXTRA_VERSION], [false])
177 # Split this out, because pkgconfig macro doesn't return nicely what is missing
179 # glib
180 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.16)
181 AC_SUBST(glib_LIBS)
182 AC_SUBST(glib_CFLAGS)
184 # gobject
185 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
186 AC_SUBST(gobject_LIBS)
187 AC_SUBST(gobject_CFLAGS)
189 #gtk
190 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.12)
191 AC_SUBST(gtk_LIBS)
192 AC_SUBST(gtk_CFLAGS)
194 #gmodule
195 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
196 AC_SUBST(gmodule_LIBS)
197 AC_SUBST(gmodule_CFLAGS)
199 # libmpd
200 PKG_CHECK_MODULES([libmpd], libmpd >= 0.19.2)
201 AC_SUBST(libmpd_LIBS)
202 AC_SUBST(libmpd_CFLAGS)
204 # libglade
205 PKG_CHECK_MODULES([libglade], libglade-2.0)
206 AC_SUBST(libglade_LIBS)
207 AC_SUBST(libglade_CFLAGS)
209 # gthread
210 PKG_CHECK_MODULES([gthread], gthread-2.0)
211 AC_SUBST(gthread_LIBS)
212 AC_SUBST(gthread_CFLAGS)
214 #libsoup
215 PKG_CHECK_MODULES([libsoup], libsoup-2.4)
216 AC_SUBST(libsoup_LIBS)
217 AC_SUBST(libsoup_CFLAGS)
219 #libgio
220 PKG_CHECK_MODULES([libgio], gio-2.0)
221 AC_SUBST(libgio_LIBS)
222 AC_SUBST(libgio_CFLAGS)
225 #sqlite3
226 PKG_CHECK_MODULES([sqlite3], sqlite3)
227 AC_SUBST(sqlite3_LIBS)
228 AC_SUBST(sqlite3_CFLAGS)
230 # libsexy 
231 AC_ARG_ENABLE([system-libsexy],
232               [--enable-system-libsexy Use system libsexy instead of bundles.], 
233                   [case "${enableval}" in
234                             yes)    system_libsexy=true;;
235                              no)    system_libsexy=false;;
236                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-system-libsexy]);;
237                esac],
238                [system_libsexy=detect])
239 if test "x$system_libsexy" = "xdetect"; then
240         PKG_CHECK_MODULES([libsexy], libsexy, system_libsexy=true, system_libsexy=false)
242 if test "x$system_libsexy" = "xtrue"; then
243         PKG_CHECK_MODULES([libsexy], libsexy)
244         AC_SUBST(libsexy_LIBS)
245         AC_SUBST(libsexy_CFLAGS)
246         AC_DEFINE([USE_SYSTEM_LIBSEXY], 1, [Use system libsexy instead of bundled])
249 AM_CONDITIONAL(USE_SYSTEM_LIBSEXY, [test x$system_libsexy = xtrue])
251 # installation paths
252 AC_MSG_CHECKING(prefix)
254 if test "x${prefix}" = "xNONE"; then
255         PACKAGE_PREFIX="${ac_default_prefix}"
256 else
257         PACKAGE_PREFIX="${prefix}"
259 AC_MSG_RESULT($PACKAGE_PREFIX)
261 # i18n support
262 dnl please keep them in alphabetical order
263 ALL_LINGUAS="ar bg bn bs cs da de en_CA en_GB es fi fr gl he hi hu hy id it ja jv lv ml ms nb ne nl pl pt pt_BR ro ru sq sv th tr zh_CN zh_TW"
266 AM_GLIB_GNU_GETTEXT
267 GETTEXT_PACKAGE=gmpc
268 AC_SUBST(GETTEXT_PACKAGE)
269 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
271 if test x$gt_cv_have_gettext != "xyes"; then
273         echo "Translations support is required."
274         exit 1;
277 #AM_GNU_GETTEXT([external])
278 # setting correct paths
279 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
280 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
283 AC_SUBST(PACKAGE_LOCALE_DIR)
284 AC_SUBST(PACKAGE_LIBS)
286 #Win32 compile support
288 EXTRA_CFLAGS=
289 EXTRA_LDFLAGS=
290 case "$CC" in
291 *gcc*)
292         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
293         ;;
294 esac
296 win32=no
297 macosx=no
298 macige=no
299 case $host in
300   *-*-mingw32* | *-*-windows)
301     win32=yes
302     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
303     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
304   *-*-cygwin*)
305     win32=yes
306     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
307   *-apple-darwin*)
308     EXTRA_LDFLAGS="-framework Carbon" 
309     macosx=yes;;
310 esac
311 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
312 AM_CONDITIONAL(OSX, test x$macosx = xyes)
313 # for smclient 
314 AM_CONDITIONAL(PLATFORM_WIN32, test x$win32 = xyes) 
315 AM_CONDITIONAL(PLATFORM_OSX, test x$macosx = xyes) 
318 AC_ARG_ENABLE(macige,
319               [  --enable-macige      Enable Mac integration on mac.],
320               [ case "${enableval}" in
321                     yes)    macige=yes;;
322                      no)    macige=no;;
323                       *)    AC_MSG_ERROR([bad value ${enableval} for --enable-macige]);;
324                 esac],
325               [macige=no])
327 if test x$macosx = xyes && test x$macige = xyes; then
328 # mac integration 
329 PKG_CHECK_MODULES([macint],ige-mac-integration)
330 AC_SUBST(macint_CFLAGS)
331 AC_SUBST(macint_LIBS)
332 AC_DEFINE(ENABLE_IGE, 1, [Enable Mac integration Support])
336 # These depend on if we are or are not on windows or osX
339 # Session support             
340 if test x$macosx = xno && test x$win32 = xno ; then
341 # Multimedia keys
342 AC_ARG_ENABLE([mmkeys],
343               [  --disable-mmkeys                       Disable multimedia keys support.],
344               [ case "${enableval}" in
345                     yes)    enable_mmkeys=yes;;
346                      no)    enable_mmkeys=no;;
347                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable--mmkeys]);;
348                 esac],
349               [enable_mmkeys=yes])
350 if test x${enable_mmkeys} = xyes; then
351         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
353 else
354 # force them off
355 enable_mmkeys=no;
357 AC_SUBST(EXTRA_CFLAGS)
358 AC_SUBST(EXTRA_LDFLAGS)
360 # Check for gob2
361 GOB2_CHECK(2.0.0)
362 # Make the gob2 check fatal
363 if test x${GOB2} = x""; then
364         exit 0;
367 AM_PROG_VALAC([0.7.9])
369 if test x${VALAC} = x""; then
370     exit 0;
374 AC_ARG_ENABLE([shave],
375             [  --disable-shave                  Use shave output cleaner when building.],
376               [ case "${enableval}" in
377                     yes)    enable_shave=yes;;
378                      no)    enable_shave=no;;
379                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable-shave]);;
380                 esac],
381               [enable_shave=no])
382 if test x$enable_shave = xyes; then
383 SHAVE_INIT([./]) 
386 AC_OUTPUT([
387 shave
388 shave-libtool
389 Makefile
390 src/Makefile
391 src/gmpc-version.h
392 glade/Makefile
393 data/Makefile
394 po/Makefile.in
395 po/Makefile
396 data/gmpc.pc
397 remote/Makefile
398 doc/Makefile
399 pixmaps/Makefile
400 pixmaps/icons/Makefile
401 pixmaps/icons/hicolor/Makefile
402 pixmaps/icons/hicolor/16x16/Makefile
403 pixmaps/icons/hicolor/16x16/actions/Makefile
404 pixmaps/icons/hicolor/16x16/status/Makefile
405 pixmaps/icons/hicolor/16x16/apps/Makefile
406 pixmaps/icons/hicolor/22x22/Makefile
407 pixmaps/icons/hicolor/22x22/actions/Makefile
408 pixmaps/icons/hicolor/22x22/status/Makefile
409 pixmaps/icons/hicolor/22x22/apps/Makefile
410 pixmaps/icons/hicolor/32x32/Makefile
411 pixmaps/icons/hicolor/32x32/actions/Makefile
412 pixmaps/icons/hicolor/32x32/status/Makefile
413 pixmaps/icons/hicolor/32x32/apps/Makefile
414 pixmaps/icons/hicolor/48x48/Makefile
415 pixmaps/icons/hicolor/48x48/actions/Makefile
416 pixmaps/icons/hicolor/48x48/apps/Makefile
417 pixmaps/icons/hicolor/48x48/status/Makefile
418 pixmaps/icons/hicolor/64x64/Makefile
419 pixmaps/icons/hicolor/64x64/apps/Makefile
420 pixmaps/icons/hicolor/64x64/status/Makefile
421 pixmaps/icons/hicolor/72x72/Makefile
422 pixmaps/icons/hicolor/72x72/apps/Makefile
423 pixmaps/icons/hicolor/72x72/status/Makefile
424 pixmaps/icons/hicolor/96x96/Makefile
425 pixmaps/icons/hicolor/96x96/apps/Makefile
426 pixmaps/icons/hicolor/96x96/status/Makefile
427 pixmaps/icons/hicolor/128x128/Makefile
428 pixmaps/icons/hicolor/128x128/apps/Makefile
429 pixmaps/icons/hicolor/128x128/status/Makefile
430 pixmaps/icons/hicolor/128x128/categories/Makefile
431 pixmaps/icons/hicolor/scalable/Makefile
432 pixmaps/icons/hicolor/scalable/actions/Makefile
433 pixmaps/icons/hicolor/scalable/status/Makefile
434 pixmaps/icons/hicolor/scalable/apps/Makefile
435 pixmaps/icons/hicolor/scalable/categories/Makefile
436 pixmaps/icons/Humanity/16x16/Makefile
437 pixmaps/icons/Humanity/16x16/actions/Makefile
438 pixmaps/icons/Humanity/16x16/status/Makefile
439 pixmaps/icons/Humanity/16x16/apps/Makefile
440 pixmaps/icons/Humanity/22x22/Makefile
441 pixmaps/icons/Humanity/22x22/actions/Makefile
442 pixmaps/icons/Humanity/22x22/status/Makefile
443 pixmaps/icons/Humanity/22x22/apps/Makefile
444 pixmaps/icons/Humanity/24x24/Makefile
445 pixmaps/icons/Humanity/24x24/actions/Makefile
446 pixmaps/icons/Humanity/24x24/status/Makefile
447 pixmaps/icons/Humanity/24x24/categories/Makefile
448 pixmaps/icons/Humanity/24x24/apps/Makefile
449 pixmaps/icons/Humanity/32x32/Makefile
450 pixmaps/icons/Humanity/32x32/actions/Makefile
451 pixmaps/icons/Humanity/32x32/status/Makefile
452 pixmaps/icons/Humanity/32x32/apps/Makefile
453 pixmaps/icons/Humanity/48x48/Makefile
454 pixmaps/icons/Humanity/48x48/actions/Makefile
455 pixmaps/icons/Humanity/48x48/apps/Makefile
456 pixmaps/icons/Humanity/48x48/status/Makefile
457 pixmaps/icons/Humanity/64x64/Makefile
458 pixmaps/icons/Humanity/64x64/apps/Makefile
459 pixmaps/icons/Humanity/64x64/status/Makefile
460 pixmaps/icons/Humanity/64x64/actions/Makefile
461 pixmaps/icons/Humanity/72x72/Makefile
462 pixmaps/icons/Humanity/72x72/apps/Makefile
463 pixmaps/icons/Humanity/72x72/status/Makefile
464 pixmaps/icons/Humanity/72x72/actions/Makefile
465 pixmaps/icons/Humanity/96x96/Makefile
466 pixmaps/icons/Humanity/96x96/apps/Makefile
467 pixmaps/icons/Humanity/96x96/status/Makefile
468 pixmaps/icons/Humanity/96x96/actions/Makefile
469 pixmaps/icons/Humanity/128x128/Makefile
470 pixmaps/icons/Humanity/128x128/apps/Makefile
471 pixmaps/icons/Humanity/128x128/status/Makefile
472 pixmaps/icons/Humanity/128x128/categories/Makefile
473 pixmaps/icons/Humanity/128x128/actions/Makefile
474 pixmaps/icons/Humanity/Makefile
475 pixmaps/icons/Humanity/scalable/Makefile
476 pixmaps/icons/Humanity/scalable/actions/Makefile
477 pixmaps/icons/Humanity/scalable/status/Makefile
478 pixmaps/icons/Humanity/scalable/apps/Makefile
479 pixmaps/icons/Humanity/scalable/categories/Makefile
480 test/Makefile
481 test/config/Makefile
482 test/MpdDataModel/Makefile
483 test/GmpcEasyDownload/Makefile
484 test/MetaDataCache/Makefile
485 test/PixbufCache/Makefile
487 echo ""
488 echo ""
489 echo "------------------ Status ------------------"
490 if test x$enable_timing = xtrue; then
491         echo "Debug timing output is:           enabled"
492 else
493         echo "Debug timing output is:           disabled"
495 if test x${enable_mmkeys} = xyes; then
496         echo "Multimedia keys support is:       enabled"
497 else
498         echo "Multimedia keys support is:       disabled"
500 if test "x$system_libsexy" = "xtrue"; then 
501         echo "Use system libsexy:               enabled"
502 else
503         echo "Use system libsexy:               disabled"
505 if test "x$macige" = "xyes"; then 
506         echo "Use mac integration library:      enabled"
507 else
508         echo "Use mac integration library:      disabled"
510 if test "x$libspiff" = "x1"; then
511         echo "Use libspiff library:             enabled"
512 else
513         echo "Use libspiff library:             disabled"
515 if test "x$libxspf" = "x1"; then
516         echo "Use libxspf library:              enabled"
517 else
518         echo "Use libxspf library:              disabled"
520 echo "";
521 echo "Now type make to build"
522 if test x$enable_shave = xyes; then
523     echo "Building is done with reduced output. (shave";
524     echo "use --disable-shave to get all (old) output back";