gmpc version 0.18.102
[gmpc.git] / configure.ac
blob734092bd729f2d7096e0232defbfe7f377d679f2
1 #Define the version
2 m4_define([package_major_version], [0])
3 m4_define([package_minor_version], [18])
4 m4_define([package_micro_version], [102])
5 m4_define([package_version], [package_major_version.package_minor_version.package_micro_version])
7 AC_INIT([gmpc], [0.18.102], [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], [:])
48 #intltool, libtool. Check for CC compiler
49 AC_PROG_INTLTOOL([0.21])
51 # Check for intltool version, needed for make dist. 
52 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
55 AC_PROG_CC
56 AM_PROG_CC_C_O
57 LT_AC_PROG_RC
58 AC_LIBTOOL_WIN32_DLL
59 AC_LIBTOOL_RC
60 AC_PROG_LIBTOOL
61 # test for zlib
62 zlib=0
63 AC_CHECK_LIB(z, inflate,zlib=1,zlib=0)
64 AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1)
65 if test "x$zlib" != "x1"
66 then
67  AC_MSG_ERROR([GMPC plugin requires zlib])
72 PKG_PROG_PKG_CONFIG
73 # libxspf 
74 libxspf=0;
75 libspiff=0;
77 AC_ARG_ENABLE([libxspf],
78               [--enable-libxspf Use libxspf.], 
79                   [case "${enableval}" in
80                             yes)    enable_libxspf=true;;
81                              no)    enable_libxspf=false;;
82                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libxspf]);;
83                esac],
84                [enable_libxspf=detect])
85 if test "x$enable_libxspf" = "xdetect"; then
86         PKG_CHECK_MODULES([libxspf], xspf, enable_libxspf=true, enable_libxspf=false)
88 if test "x$enable_libxspf" = "xtrue"; then
89         PKG_CHECK_MODULES([libxspf], xspf)
90         AC_SUBST(libxspf_LIBS)
91         AC_SUBST(libxspf_CFLAGS)
92     libxspf=1;
93         AC_DEFINE([XSPF], 1, [Use xspf])
94 else
96 AC_ARG_ENABLE(libspiff,
97     [   --enable-libspiff      Use libspiff to parse spiff playlists.],
98     [ case "${enableval}" in
99         yes)    enable_libspiff=yes;;
100          no)    enable_libspiff=no;;
101           *)    AC_MSG_ERROR([bad value ${enableval} for --enable-libspiff]);;
102      esac],
103      [enable_libspiff=auto])
105 if test "x${enable_libspiff}" != xno; then 
106     AC_CHECK_HEADER(spiff/spiff_c.h, AC_CHECK_LIB(spiff, spiff_parse,libspiff=1,libspiff=0),libspiff=0)
107     if test "x${libspiff}" = "x1";
108     then
109         AC_DEFINE(SPIFF,1,["Use or don't use libspiff"])
110         SPIFF_LIBS=-lspiff
111         AC_SUBST(SPIFF_LIBS)
112     else 
113         if test "x${enable_libspiff}" = "xyes"; then
114             AC_MSG_ERROR([libspiff not found])
115         fi
116     fi
120 # Checks for header files.
121 AC_HEADER_STDC
122 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
124 # Checks for typedefs, structures, and compiler characteristics.
125 AC_C_CONST
127 # Checks for libraries.
128 AC_SUBST(GLIB_REQUIRED)
129 AC_SUBST(GTK_REQUIRED)
132 # User params 
135 # Config dir support
136 AC_ARG_ENABLE(configdir,
137         [  --enable-configdir           Use .config instead of .gmpc or .covers.],
138         [ case "${enableval}" in
139             yes)    enable_configdir=yes;;
140              no)    enable_configdir=no;;
141               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-configdir]);;
142           esac],
143         [enable_configdir=no])
145 if test x${enable_configdir} = xyes; then
146         AC_DEFINE(USE_CONFIG_DIR,1, [Use Config Dir])
151 # Maintainer mode
152 AC_ARG_ENABLE([timing],
153               [--enable-timing Print timing debug output.],
154                   [case "${enableval}" in
155                             yes)    enable_timing=true;;
156                              no)    enable_timing=false;;
157                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-timing]);;
158                esac],
159                [enable_timing=false])
161 if test x${enable_timing} = xtrue; then
162 # Add DEBUG_ENABLE define to config.h
163     AC_DEFINE(DEBUG_TIMING, 1, [Enable timing output])
166 # Maintainer mode
167 AC_ARG_ENABLE([test],
168         [--enable-test Enable tests],
169         [case "${enableval}" in
170                 yes) test_mode=true;;
171                 no)  test_mode=false;;
172                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-test]);;
173          esac],
174         [test_mode=false])
176 AM_CONDITIONAL([ENABLE_TEST], [test x$test_mode = xtrue])
178 # EXTRA VERSION
179 AC_ARG_WITH([extra-version],
180         [--with-extra-version=revision Specify extra version.],
181         with_extra_version=${withval})
182 if test x"${with_extra_version}" != x; then
183     AM_CONDITIONAL([EXTRA_VERSION], [true])
184     EXTRA_VERSION="${with_extra_version}";
185     AC_SUBST(EXTRA_VERSION)
186 else
187     AM_CONDITIONAL([EXTRA_VERSION], [false])
192 # Split this out, because pkgconfig macro doesn't return nicely what is missing
194 # glib
195 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.16)
196 AC_SUBST(glib_LIBS)
197 AC_SUBST(glib_CFLAGS)
199 # gobject
200 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
201 AC_SUBST(gobject_LIBS)
202 AC_SUBST(gobject_CFLAGS)
204 #gtk
205 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.12)
206 AC_SUBST(gtk_LIBS)
207 AC_SUBST(gtk_CFLAGS)
209 #gmodule
210 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
211 AC_SUBST(gmodule_LIBS)
212 AC_SUBST(gmodule_CFLAGS)
214 # libmpd
215 PKG_CHECK_MODULES([libmpd], libmpd >= 0.18.1)
216 AC_SUBST(libmpd_LIBS)
217 AC_SUBST(libmpd_CFLAGS)
219 # libglade
220 PKG_CHECK_MODULES([libglade], libglade-2.0)
221 AC_SUBST(libglade_LIBS)
222 AC_SUBST(libglade_CFLAGS)
224 # gthread
225 PKG_CHECK_MODULES([gthread], gthread-2.0)
226 AC_SUBST(gthread_LIBS)
227 AC_SUBST(gthread_CFLAGS)
229 #libsoup
230 PKG_CHECK_MODULES([libsoup], libsoup-2.4)
231 AC_SUBST(libsoup_LIBS)
232 AC_SUBST(libsoup_CFLAGS)
235 #sqlite3
236 PKG_CHECK_MODULES([sqlite3], sqlite3)
237 AC_SUBST(sqlite3_LIBS)
238 AC_SUBST(sqlite3_CFLAGS)
240 # libsexy 
241 AC_ARG_ENABLE([system-libsexy],
242               [--enable-system-libsexy Use system libsexy instead of bundles.], 
243                   [case "${enableval}" in
244                             yes)    system_libsexy=true;;
245                              no)    system_libsexy=false;;
246                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-system-libsexy]);;
247                esac],
248                [system_libsexy=detect])
249 if test "x$system_libsexy" = "xdetect"; then
250         PKG_CHECK_MODULES([libsexy], libsexy, system_libsexy=true, system_libsexy=false)
252 if test "x$system_libsexy" = "xtrue"; then
253         PKG_CHECK_MODULES([libsexy], libsexy)
254         AC_SUBST(libsexy_LIBS)
255         AC_SUBST(libsexy_CFLAGS)
256         AC_DEFINE([USE_SYSTEM_LIBSEXY], 1, [Use system libsexy instead of bundled])
259 AM_CONDITIONAL(USE_SYSTEM_LIBSEXY, [test x$system_libsexy = xtrue])
261 # installation paths
262 AC_MSG_CHECKING(prefix)
264 if test "x${prefix}" = "xNONE"; then
265         PACKAGE_PREFIX="${ac_default_prefix}"
266 else
267         PACKAGE_PREFIX="${prefix}"
269 AC_MSG_RESULT($PACKAGE_PREFIX)
271 # i18n support
272 dnl please keep them in alphabetical order
273 ALL_LINGUAS="ar bg bn bs cs da de es fi fr gl he hi hu hy id it jv lv ml ms nb ne nl pl pt pt_BR ro ru sq sv th tr zh_CN zh_TW"
276 AM_GLIB_GNU_GETTEXT
277 GETTEXT_PACKAGE=gmpc
278 AC_SUBST(GETTEXT_PACKAGE)
279 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
281 if test x$gt_cv_have_gettext != "xyes"; then
283         echo "Translations support is required."
284         exit 1;
287 #AM_GNU_GETTEXT([external])
288 # setting correct paths
289 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
290 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
293 AC_SUBST(PACKAGE_LOCALE_DIR)
294 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 macige=no
309 case $host in
310   *-*-mingw32* | *-*-windows)
311     win32=yes
312     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
313     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
314   *-*-cygwin*)
315     win32=yes
316     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
317   *-apple-darwin*)
318     EXTRA_LDFLAGS="-framework Carbon" 
319     macosx=yes;;
320 esac
321 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
322 AM_CONDITIONAL(OSX, test x$macosx = xyes)
323 # for smclient 
324 AM_CONDITIONAL(PLATFORM_WIN32, test x$win32 = xyes) 
325 AM_CONDITIONAL(PLATFORM_OSX, test x$macosx = xyes) 
328 AC_ARG_ENABLE(macige,
329               [  --enable-macige      Enable Mac integration on mac.],
330               [ case "${enableval}" in
331                     yes)    macige=yes;;
332                      no)    macige=no;;
333                       *)    AC_MSG_ERROR([bad value ${enableval} for --enable-macige]);;
334                 esac],
335               [macige=no])
337 if test x$macosx = xyes && test x$macige = xyes; then
338 # mac integration 
339 PKG_CHECK_MODULES([macint],ige-mac-integration)
340 AC_SUBST(macint_CFLAGS)
341 AC_SUBST(macint_LIBS)
342 AC_DEFINE(ENABLE_IGE, 1, [Enable Mac integration Support])
346 # These depend on if we are or are not on windows or osX
349 # Session support             
350 if test x$macosx = xno && test x$win32 = xno ; then
351 # Multimedia keys
352 AC_ARG_ENABLE([mmkeys],
353               [  --disable-mmkeys                       Disable multimedia keys support.],
354               [ case "${enableval}" in
355                     yes)    enable_mmkeys=yes;;
356                      no)    enable_mmkeys=no;;
357                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable--mmkeys]);;
358                 esac],
359               [enable_mmkeys=yes])
360 if test x${enable_mmkeys} = xyes; then
361         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
363 else
364 # force them off
365 enable_mmkeys=no;
367 AC_SUBST(EXTRA_CFLAGS)
368 AC_SUBST(EXTRA_LDFLAGS)
370 # Check for gob2
371 GOB2_CHECK(2.0.0)
372 # Make the gob2 check fatal
373 if test x${GOB2} = x""; then
374         exit 0;
378 AC_ARG_ENABLE([shave],
379             [  --disable-shave                  Use shave output cleaner when building.],
380               [ case "${enableval}" in
381                     yes)    enable_shave=yes;;
382                      no)    enable_shave=no;;
383                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable-shave]);;
384                 esac],
385               [enable_shave=no])
386 if test x$enable_shave = xyes; then
387 SHAVE_INIT([./]) 
390 AC_OUTPUT([
391 shave
392 shave-libtool
393 Makefile
394 src/Makefile
395 src/gmpc-version.h
396 glade/Makefile
397 data/Makefile
398 po/Makefile.in
399 po/Makefile
400 data/gmpc.pc
401 remote/Makefile
402 doc/Makefile
403 pixmaps/Makefile
404 pixmaps/icons/Makefile
405 pixmaps/icons/16x16/Makefile
406 pixmaps/icons/16x16/actions/Makefile
407 pixmaps/icons/16x16/status/Makefile
408 pixmaps/icons/16x16/apps/Makefile
409 pixmaps/icons/22x22/Makefile
410 pixmaps/icons/22x22/actions/Makefile
411 pixmaps/icons/22x22/status/Makefile
412 pixmaps/icons/22x22/apps/Makefile
413 pixmaps/icons/32x32/Makefile
414 pixmaps/icons/32x32/actions/Makefile
415 pixmaps/icons/32x32/status/Makefile
416 pixmaps/icons/32x32/apps/Makefile
417 pixmaps/icons/48x48/Makefile
418 pixmaps/icons/48x48/actions/Makefile
419 pixmaps/icons/48x48/apps/Makefile
420 pixmaps/icons/48x48/status/Makefile
421 pixmaps/icons/64x64/Makefile
422 pixmaps/icons/64x64/apps/Makefile
423 pixmaps/icons/64x64/status/Makefile
424 pixmaps/icons/72x72/Makefile
425 pixmaps/icons/72x72/apps/Makefile
426 pixmaps/icons/72x72/status/Makefile
427 pixmaps/icons/96x96/Makefile
428 pixmaps/icons/96x96/apps/Makefile
429 pixmaps/icons/96x96/status/Makefile
430 pixmaps/icons/128x128/Makefile
431 pixmaps/icons/128x128/apps/Makefile
432 pixmaps/icons/128x128/status/Makefile
433 pixmaps/icons/128x128/categories/Makefile
434 pixmaps/icons/scalable/Makefile
435 pixmaps/icons/scalable/actions/Makefile
436 pixmaps/icons/scalable/status/Makefile
437 pixmaps/icons/scalable/apps/Makefile
438 pixmaps/icons/scalable/categories/Makefile
439 test/Makefile
440 test/config/Makefile
441 test/MpdDataModel/Makefile
442 test/GmpcEasyDownload/Makefile
443 test/MetaDataCache/Makefile
445 echo ""
446 echo ""
447 echo "------------------ Status ------------------"
448 if test x$enable_timing = xtrue; then
449         echo "Debug timing output is:           enabled"
450 else
451         echo "Debug timing output is:           disabled"
453 if test x${enable_mmkeys} = xyes; then
454         echo "Multimedia keys support is:       enabled"
455 else
456         echo "Multimedia keys support is:       disabled"
458 if test x${enable_configdir} = xyes; then
459         echo "Use ~/.config/ for config files:  enabled"
460 else
461         echo "Use ~/.config/ for config files:  disabled"
463 if test "x$system_libsexy" = "xtrue"; then 
464         echo "Use system libsexy:               enabled"
465 else
466         echo "Use system libsexy:               disabled"
468 if test "x$macige" = "xyes"; then 
469         echo "Use mac integration library:      enabled"
470 else
471         echo "Use mac integration library:      disabled"
473 if test "x$libspiff" = "x1"; then
474         echo "Use libspiff library:             enabled"
475 else
476         echo "Use libspiff library:             disabled"
478 if test "x$libxspf" = "x1"; then
479         echo "Use libxspf library:              enabled"
480 else
481         echo "Use libxspf library:              disabled"
483 echo "";
484 echo "Now type make to build"
485 if test x$enable_shave = xyes; then
486     echo "Building is done with reduced output. (shave";
487     echo "use --disable-shave to get all (old) output back";