gmpc version 0.17.96
[gmpc.git] / configure.ac
blobb93ba5950b6917f91e64887ae0970bc41a5572be
1 #Define the version
2 m4_define([package_major_version], [0])
3 m4_define([package_minor_version], [17])
4 m4_define([package_micro_version], [96])
5 m4_define([package_version], [package_major_version.package_minor_version.package_micro_version])
7 AC_INIT([gmpc], [0.17.96], [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 AM_INIT_AUTOMAKE
21 #Make version and variables available in config.h
22 AC_DEFINE(GMPC_MAJOR_VERSION,   package_major_version,  ["Major version of gmpc"])
23 AC_DEFINE(GMPC_MINOR_VERSION,   package_minor_version,  ["Minor version of gmpc"])
24 AC_DEFINE(GMPC_MICRO_VERSION,   package_micro_version,  ["Micro version of gmpc"])
25 AC_DEFINE(GMPC_TAGLINE,         package_tagline,        ["Gmpc's tagline"])
26 AC_DEFINE(GMPC_WEBSITE,         package_website,        ["Gmpc's website"])
27 AC_DEFINE(GMPC_BUGTRACKER,      package_bugtracker,     ["Gmpc's bugtracker"])
28 AC_DEFINE(GMPC_COPYRIGHT,       package_copyright,      ["Gmpc's Copyright"])
31 AC_PREREQ(2.59)
33 # Remove the check for c++ and fortran compiler
34 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
35 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
38 #intltool, libtool. Check for CC compiler
39 AC_PROG_INTLTOOL([0.21])
41 # Check for intltool version, needed for make dist. 
42 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
45 AC_PROG_CC
46 LT_AC_PROG_RC
47 AC_LIBTOOL_WIN32_DLL
48 AC_LIBTOOL_RC
49 AC_PROG_LIBTOOL
50 # test for zlib
51 zlib=0
52 AC_CHECK_LIB(z, inflate,zlib=1,zlib=0)
53 AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1)
54 if test "x$zlib" != "x1"
55 then
56  AC_MSG_ERROR([Jamendo plugin requires zlib])
59 PKG_PROG_PKG_CONFIG
62 # Checks for header files.
63 AC_HEADER_STDC
64 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
66 # Checks for typedefs, structures, and compiler characteristics.
67 AC_C_CONST
69 # Checks for libraries.
70 AC_SUBST(GLIB_REQUIRED)
71 AC_SUBST(GTK_REQUIRED)
74 # User params 
77 # Config dir support
78 AC_ARG_ENABLE(configdir,
79         [  --enable-configdir           Use .config instead of .gmpc or .covers.],
80         [ case "${enableval}" in
81             yes)    enable_configdir=yes;;
82              no)    enable_configdir=no;;
83               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-configdir]);;
84           esac],
85         [enable_configdir=no])
87 if test x${enable_configdir} = xyes; then
88         AC_DEFINE(USE_CONFIG_DIR,1, [Use Config Dir])
93 # Maintainer mode
94 AC_ARG_ENABLE([timing],
95               [--enable-timing Print timing debug output.],
96                   [case "${enableval}" in
97                             yes)    enable_timing=true;;
98                              no)    enable_timing=false;;
99                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-timing]);;
100                esac],
101                [enable_timing=false])
103 if test x${enable_timing} = xtrue; then
104 # Add DEBUG_ENABLE define to config.h
105     AC_DEFINE(DEBUG_TIMING, 1, [Enable timing output])
108 # Maintainer mode
109 AC_ARG_ENABLE([maintainermode],
110         [--enable-maintainermode Enable maintainer mode.],
111         [case "${enableval}" in
112                 yes) maintainer_mode=true;;
113                 no)  maintainer_mode=false;;
114                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-maintainermode]);;
115          esac],
116         [maintainer_mode=false])
118 AM_CONDITIONAL([MAINTAINER_MODE], [test x$maintainer_mode = xtrue])
119 if test x$maintainer_mode = xtrue; then
120     AC_DEFINE(MAINTAINER_MODE, 1, [Enable maintainer mode])
124 # Egg Status Icon 
125 AC_ARG_ENABLE([eggtrayicon],
126         [--enable-eggtrayicon Use eggtrayicon instead of GtkStatusIcon.],
127         [case "${enableval}" in
128                 yes) eggtrayicon=true;;
129                 no)  eggtrayicon=false;;
130                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-eggtrayicon]);;
131          esac],
132         [eggtrayicon=false])
134 AM_CONDITIONAL([EGGTRAYICON], [test x$eggtrayicon = xtrue])
135 if test x${eggtrayicon} = xtrue; then
136 AC_DEFINE(EGGTRAYICON,1,["Use or don't use eggtrayicon"])
140 # Split this out, because pkgconfig macro doesn't return nicely what is missing
142 # glib
143 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.10)
144 AC_SUBST(glib_LIBS)
145 AC_SUBST(glib_CFLAGS)
147 # gobject
148 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
149 AC_SUBST(gobject_LIBS)
150 AC_SUBST(gobject_CFLAGS)
152 #gtk
153 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.12)
154 AC_SUBST(gtk_LIBS)
155 AC_SUBST(gtk_CFLAGS)
157 #gmodule
158 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
159 AC_SUBST(gmodule_LIBS)
160 AC_SUBST(gmodule_CFLAGS)
162 # libmpd
163 PKG_CHECK_MODULES([libmpd], libmpd >= 0.17.1)
164 AC_SUBST(libmpd_LIBS)
165 AC_SUBST(libmpd_CFLAGS)
167 # libglade
168 PKG_CHECK_MODULES([libglade], libglade-2.0)
169 AC_SUBST(libglade_LIBS)
170 AC_SUBST(libglade_CFLAGS)
172 # gthread
173 PKG_CHECK_MODULES([gthread], gthread-2.0)
174 AC_SUBST(gthread_LIBS)
175 AC_SUBST(gthread_CFLAGS)
177 #libsoup
178 PKG_CHECK_MODULES([libsoup], libsoup-2.4)
179 AC_SUBST(libsoup_LIBS)
180 AC_SUBST(libsoup_CFLAGS)
182 # libsexy 
183 AC_ARG_ENABLE([system-libsexy],
184               [--enable-system-libsexy Use system libsexy instead of bundles.], 
185                   [case "${enableval}" in
186                             yes)    system_libsexy=true;;
187                              no)    system_libsexy=false;;
188                               *)    AC_MSG_ERROR([bad value ${enableval} for --enable-system-libsexy]);;
189                esac],
190                [system_libsexy=detect])
191 if test "x$system_libsexy" = "xdetect"; then
192         PKG_CHECK_MODULES([libsexy], libsexy, system_libsexy=true, system_libsexy=false)
194 if test "x$system_libsexy" = "xtrue"; then
195         PKG_CHECK_MODULES([libsexy], libsexy)
196         AC_SUBST(libsexy_LIBS)
197         AC_SUBST(libsexy_CFLAGS)
198         AC_DEFINE([USE_SYSTEM_LIBSEXY], 1, [Use system libsexy instead of bundled])
201 AM_CONDITIONAL(USE_SYSTEM_LIBSEXY, [test x$system_libsexy = xtrue])
203 # installation paths
204 AC_MSG_CHECKING(prefix)
206 if test "x${prefix}" = "xNONE"; then
207         PACKAGE_PREFIX="${ac_default_prefix}"
208 else
209         PACKAGE_PREFIX="${prefix}"
211 AC_MSG_RESULT($PACKAGE_PREFIX)
213 # i18n support
214 dnl please keep them in alphabetical order
215 ALL_LINGUAS="bg bn bs cs de es fi fr gl he hi hu id it jv lv nb nl pl pt pt_BR ro ru sv tr zh_CN zh_TW"
217 GETTEXT_PACKAGE=gmpc
218 AC_SUBST(GETTEXT_PACKAGE)
219 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
220 AM_GLIB_GNU_GETTEXT
223 #AM_GNU_GETTEXT([external])
224 # setting correct paths
225 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
226 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
229 AC_SUBST(PACKAGE_LOCALE_DIR)
230 AC_SUBST(PACKAGE_LIBS)
233 #Win32 compile support
235 EXTRA_CFLAGS=
236 EXTRA_LDFLAGS=
237 case "$CC" in
238 *gcc*)
239         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
240         ;;
241 esac
243 win32=no
244 macosx=no
245 macige=no
246 case $host in
247   *-*-mingw32* | *-*-windows)
248     win32=yes
249     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
250     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
251   *-*-cygwin*)
252     win32=yes
253     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
254   *-apple-darwin*)
255     macosx=yes;;
256 esac
257 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
258 AM_CONDITIONAL(OSX, test x$macosx = xyes)
261 AC_ARG_ENABLE(macige,
262               [  --enable-macige      Enable Mac integration on mac.],
263               [ case "${enableval}" in
264                     yes)    macige=yes;;
265                      no)    macige=no;;
266                       *)    AC_MSG_ERROR([bad value ${enableval} for --enable-macige]);;
267                 esac],
268               [macige=no])
270 if test x$macosx = xyes && test x$macige = xyes; then
271 # mac integration 
272 PKG_CHECK_MODULES([macint],ige-mac-integration)
273 AC_SUBST(macint_CFLAGS)
274 AC_SUBST(macint_LIBS)
275 AC_DEFINE(ENABLE_IGE, 1, [Enable Mac integration Support])
279 # These depend on if we are or are not on windows or osX
282 # Session support             
283 if test x$macosx = xno && test x$win32 = xno ; then
284 AC_ARG_ENABLE(sm,
285               [  --disable-sm                           Disable Session Support.],
286               [ case "${enableval}" in
287                     yes)    enable_sm=yes;;
288                      no)    enable_sm=no;;
289                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable-dm]);;
290                 esac],
291               [enable_sm=yes])
293 # sm
294 if test x${enable_sm} = xyes; then
295         PKG_CHECK_MODULES([sm], sm)
296         AC_SUBST(sm_LIBS)
297         AC_SUBST(sm_CFLAGS)
298         AC_DEFINE(ENABLE_SM, 1, [Enable Session Support])
301 # Multimedia keys
302 AC_ARG_ENABLE([mmkeys],
303               [  --disable-mmkeys                       Disable multimedia keys support.],
304               [ case "${enableval}" in
305                     yes)    enable_mmkeys=yes;;
306                      no)    enable_mmkeys=no;;
307                       *)    AC_MSG_ERROR([bad value ${enableval} for --disable--mmkeys]);;
308                 esac],
309               [enable_mmkeys=yes])
310 if test x${enable_mmkeys} = xyes; then
311         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
313 else
314 # force them off
315 enable_mmkeys=no;
316 enable_sm=no;
318 AC_SUBST(EXTRA_CFLAGS)
319 AC_SUBST(EXTRA_LDFLAGS)
321 # Check for gob2
322 GOB2_CHECK(2.0.0)
323 # Make the gob2 check fatal
324 if test x${GOB2} = x""; then
325         exit 0;
329 # libcurl settings
330 AC_PATH_PROG(CURL_CONFIG,curl-config)
331 AC_ARG_WITH(curl,
332             AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed]),
333             [CURL_CONFIG="${with_curl}/bin/curl-config"])
334 if test -f "${CURL_CONFIG}"; then
335     LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
336     CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
337 else
338     AC_MSG_WARN([curl-config not found, guessing at libcurl build settings])
340 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
341 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
345 AC_OUTPUT([
346 Makefile
347 src/Makefile
348 src/gob/Makefile
349 glade/Makefile
350 data/Makefile
351 po/Makefile.in
352 po/Makefile
353 data/gmpc.pc
354 remote/Makefile
355 doc/Makefile
356 pixmaps/Makefile
357 pixmaps/icons/Makefile
358 pixmaps/icons/16x16/Makefile
359 pixmaps/icons/16x16/actions/Makefile
360 pixmaps/icons/16x16/status/Makefile
361 pixmaps/icons/16x16/apps/Makefile
362 pixmaps/icons/22x22/Makefile
363 pixmaps/icons/22x22/actions/Makefile
364 pixmaps/icons/22x22/status/Makefile
365 pixmaps/icons/22x22/apps/Makefile
366 pixmaps/icons/32x32/Makefile
367 pixmaps/icons/32x32/actions/Makefile
368 pixmaps/icons/32x32/status/Makefile
369 pixmaps/icons/32x32/apps/Makefile
370 pixmaps/icons/48x48/Makefile
371 pixmaps/icons/48x48/actions/Makefile
372 pixmaps/icons/48x48/apps/Makefile
373 pixmaps/icons/48x48/status/Makefile
374 pixmaps/icons/64x64/Makefile
375 pixmaps/icons/64x64/status/Makefile
376 pixmaps/icons/72x72/Makefile
377 pixmaps/icons/72x72/status/Makefile
378 pixmaps/icons/96x96/Makefile
379 pixmaps/icons/96x96/status/Makefile
380 pixmaps/icons/128x128/Makefile
381 pixmaps/icons/128x128/status/Makefile
382 pixmaps/icons/128x128/categories/Makefile
383 pixmaps/icons/scalable/Makefile
384 pixmaps/icons/scalable/actions/Makefile
385 pixmaps/icons/scalable/status/Makefile
386 pixmaps/icons/scalable/apps/Makefile
387 pixmaps/icons/scalable/categories/Makefile
389 echo ""
390 echo ""
391 echo "------------------ Status ------------------"
392 if test x$eggtrayicon = xtrue; then
393         echo "Eggtrayicon mode is:              enabled"
394 else
395         echo "Eggtrayicon mode is:              disabled"
397 if test x$maintainer_mode = xtrue; then
398         echo "Maintainer mode is:               enabled"
399 else
400         echo "Maintainer mode is:               disabled"
402 if test x$enable_timing = xtrue; then
403         echo "Debug timing output is:           enabled"
404 else
405         echo "Debug timing output is:           disabled"
407 if test x${enable_mmkeys} = xyes; then
408         echo "Multimedia keys support is:       enabled"
409 else
410         echo "Multimedia keys support is:       disabled"
412 if test x${enable_sm} = xyes; then
413         echo "Session Manager support is:       enabled"
414 else
415         echo "Session Manager support is:       disabled"
417 if test x${enable_configdir} = xyes; then
418         echo "Use ~/.config/ for config files:  enabled"
419 else
420         echo "Use ~/.config/ for config files:  disabled"
422 if test "x$system_libsexy" = "xtrue"; then 
423         echo "Use system libsexy:               enabled"
424 else
425         echo "Use system libsexy:               disabled"
427 if test "x$macige" = "xyes"; then 
428         echo "Use mac integration library:      enabled"
429 else
430         echo "Use mac integration library:      disabled"
432 echo "Now type make to build"