Reduce memory usage a little by avoiding the cover-art array to be initialized in...
[gmpc.git] / configure.ac
blob0e26c393531c800c7e0e82ac18302dedd15bbda3
1 # Process this file with autoconf to produce a configure script.
4 m4_define([gmpc_major_version], [0])
5 m4_define([gmpc_minor_version], [16])
6 m4_define([gmpc_micro_version], [0])
8 m4_define([gmpc_tagline], "Still 100% gnome free.")
9 m4_define([gmpc_website], "http://gmpcwiki.sarine.nl")
10 m4_define([gmpc_copyright], "Copyright 2003-2008 Qball Cow")
11 m4_define([gmpc_bugtracker],  "http://gmpcwiki.sarine.nl/index.php/Help:Contents")
13 m4_define([gmpc_version], [gmpc_major_version.gmpc_minor_version.gmpc_micro_version])
15 AC_INIT(src)
16 AM_CONFIG_HEADER([config.h])
17 AM_INIT_AUTOMAKE([gmpc], [gmpc_version],qball@sarine.nl)
20 GMPC_MAJOR_VERSION=gmpc_major_version
21 GMPC_MINOR_VERSION=gmpc_minor_version
22 GMPC_MICRO_VERSION=gmpc_micro_version
24 AC_DEFINE(GMPC_MAJOR_VERSION, gmpc_major_version, ["Major version of gmpc"])
25 AC_DEFINE(GMPC_MINOR_VERSION, gmpc_minor_version, ["Minor version of gmpc"])
26 AC_DEFINE(GMPC_MICRO_VERSION, gmpc_micro_version, ["Micro version of gmpc"])
28 AC_DEFINE(GMPC_TAGLINE,                 gmpc_tagline,   ["Gmpc's tagline"])
29 AC_DEFINE(GMPC_WEBSITE,                 gmpc_website,   ["Gmpc's website"])
30 AC_DEFINE(GMPC_BUGTRACKER,       gmpc_bugtracker,   ["Gmpc's bugtracker"])
31 AC_DEFINE(GMPC_COPYRIGHT,     gmpc_copyright,   ["Gmpc's Copyright"])
32 # Checks for programs.
34 AC_PREREQ(2.59)
35 AC_PROG_INTLTOOL([0.21])
36 AC_PROG_LIBTOOL
37 AC_PROG_CC
38 AC_LIBTOOL_RC
42 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
44 AM_CONDITIONAL(HAVE_RC, test "x$RC" != "xno")
46 AC_ARG_ENABLE(configdir,
47               [  --enable-configdir             Use .config instead of .gmpc or .covers.],
48                [ if test "x$enableval" = "xyes"; then
49                 enable_configdir=yes
50             else
51                 enable_configdir=no
52             fi],
53               enable_configdir=no)
54 AC_ARG_ENABLE(sm,
55               [  --disable-sm                           Disable Session Support.],
56               [ if test "x$enableval" = "xyes"; then
57                enable_sm=yes
58            else
59                enable_sm=no
60            fi],
61               enable_sm=yes)
62 AC_ARG_ENABLE(mmkeys,
63               [  --disable-mmkeys                       Disable multimedia keys support.],
64               [ if test "x$enableval" = "xyes"; then
65                     enable_mmkeys=yes
66                 else
67                     enable_mmkeys=no
68                 fi],
69               enable_mmkeys=yes)
71 # Maintainer mode
72 AC_ARG_ENABLE([timing],
73         [--enable-timing Print timing debug output.],
74         [case "${enableval}" in
75                 yes) enable_timing=true;;
76                 no)  enable_timing=false;;
77                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-timing]);;
78          esac],
79         [enable_timing=false])
80 if test x${enable_timing} = xtrue;
81 then
82     AC_DEFINE(DEBUG_TIMING, 1, [Enable timing output])
84 # Checks for libraries.
86 # Checks for header files.
87 AC_HEADER_STDC
88 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
90 # Checks for typedefs, structures, and compiler characteristics.
91 AC_C_CONST
93 AC_SUBST(GLIB_REQUIRED)
94 AC_SUBST(GTK_REQUIRED)
96 # Split this out, because pkgconfig macro doesn't return nicely what is missing
98 # glib
99 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.10)
100 AC_SUBST(glib_LIBS)
101 AC_SUBST(glib_CFLAGS)
103 # gobject
104 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
105 AC_SUBST(gobject_LIBS)
106 AC_SUBST(gobject_CFLAGS)
108 #gtk
109 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.12)
110 AC_SUBST(gtk_LIBS)
111 AC_SUBST(gtk_CFLAGS)
113 #gmodule
114 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
115 AC_SUBST(gmodule_LIBS)
116 AC_SUBST(gmodule_CFLAGS)
118 # libmpd
119 PKG_CHECK_MODULES([libmpd], libmpd >= 0.16.1)
120 AC_SUBST(libmpd_LIBS)
121 AC_SUBST(libmpd_CFLAGS)
123 # libglade
124 PKG_CHECK_MODULES([libglade], libglade-2.0)
125 AC_SUBST(libglade_LIBS)
126 AC_SUBST(libglade_CFLAGS)
128 # gthread
129 PKG_CHECK_MODULES([gthread], gthread-2.0)
130 AC_SUBST(gthread_LIBS)
131 AC_SUBST(gthread_CFLAGS)
134 # sm
135 if test x${enable_sm} = xyes; then
136         PKG_CHECK_MODULES([sm], sm)
137         AC_SUBST(sm_LIBS)
138         AC_SUBST(sm_CFLAGS)
139         AC_DEFINE(ENABLE_SM, 1, [Enable Session Support])
143 if test x${enable_mmkeys} = xyes; then
144         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
146 if test x${enable_configdir} = xyes; then
147         AC_DEFINE(USE_CONFIG_DIR,1, [Use Config Dir])
149 # installation paths
150 AC_MSG_CHECKING(prefix)
152 if test "x${prefix}" = "xNONE"; then
153         PACKAGE_PREFIX="${ac_default_prefix}"
154 else
155         PACKAGE_PREFIX="${prefix}"
157 AC_MSG_RESULT($PACKAGE_PREFIX)
159 # i18n support
160 dnl please keep them in alphabetical order
161 ALL_LINGUAS="bg cs de es fr gl hu it nl nb pl ru sv zh_CN"
163 GETTEXT_PACKAGE=gmpc
164 AC_SUBST(GETTEXT_PACKAGE)
165 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
166 AM_GLIB_GNU_GETTEXT
169 #AM_GNU_GETTEXT([external])
170 # setting correct paths
171 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
172 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
175 AC_SUBST(PACKAGE_LOCALE_DIR)
176 AC_SUBST(PACKAGE_LIBS)
179 EXTRA_CFLAGS=
180 EXTRA_LDFLAGS=
181 case "$CC" in
182 *gcc*)
183         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
184         ;;
185 esac
187 win32=no
188 case $host in
189   *-*-mingw32* | *-*-windows)
190     win32=yes
191     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
192     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields -lregex" ;;
193   *-*-cygwin*)
194     win32=yes
195     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
196 esac
197 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
199 AC_SUBST(EXTRA_CFLAGS)
200 AC_SUBST(EXTRA_LDFLAGS)
201 GOB2_CHECK(2.0.0)
202 if test x${GOB2} = x""; then
203         exit 0;
207 # libcurl settings
208 AC_PATH_PROG(CURL_CONFIG,curl-config)
209 AC_ARG_WITH(curl,
210             AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed]),
211             [CURL_CONFIG="${with_curl}/bin/curl-config"])
212 if test -f "${CURL_CONFIG}"; then
213     LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
214     CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
215 else
216     AC_MSG_WARN([curl-config not found, guessing at libcurl build settings])
218 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
219 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
221 # Maintainer mode
222 AC_ARG_ENABLE([maintainermode],
223         [--enable-maintainermode Enable maintainer mode.],
224         [case "${enableval}" in
225                 yes) maintainer_mode=true;;
226                 no)  maintainer_mode=false;;
227                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-maintainermode]);;
228          esac],
229         [maintainer_mode=false])
231 AM_CONDITIONAL([MAINTAINER_MODE], [test x$maintainer_mode = xtrue])
233 AC_OUTPUT([
234 Makefile
235 src/Makefile
236 src/gob/Makefile
237 glade/Makefile
238 data/Makefile
239 po/Makefile.in
240 po/Makefile
241 data/gmpc.pc
242 remote/Makefile
243 pixmaps/Makefile
244 pixmaps/icons/Makefile
245 pixmaps/icons/16x16/Makefile
246 pixmaps/icons/16x16/actions/Makefile
247 pixmaps/icons/16x16/status/Makefile
248 pixmaps/icons/16x16/apps/Makefile
249 pixmaps/icons/22x22/Makefile
250 pixmaps/icons/22x22/actions/Makefile
251 pixmaps/icons/22x22/status/Makefile
252 pixmaps/icons/22x22/apps/Makefile
253 pixmaps/icons/32x32/Makefile
254 pixmaps/icons/32x32/actions/Makefile
255 pixmaps/icons/32x32/status/Makefile
256 pixmaps/icons/32x32/apps/Makefile
257 pixmaps/icons/48x48/Makefile
258 pixmaps/icons/48x48/actions/Makefile
259 pixmaps/icons/48x48/apps/Makefile
260 pixmaps/icons/scalable/Makefile
261 pixmaps/icons/scalable/actions/Makefile
262 pixmaps/icons/scalable/status/Makefile
263 pixmaps/icons/scalable/apps/Makefile
265 echo ""
266 echo ""
267 echo "-------------- Status --------------"
268 if test x$maintainer_mode = xtrue; then
269         echo "Maintainer mode is:               enabled"
270 else
271         echo "Maintainer mode is:               disabled"
273 if test x$enable_timing = xtrue; then
274         echo "Debug timing output is:           enabled"
275 else
276         echo "Debug timing output is:           disabled"
278 if test x${enable_mmkeys} = xyes; then
279         echo "Multimedia keys support is:       enabled"
280 else
281         echo "Multimedia keys support is:       disabled"
283 if test x${enable_sm} = xyes; then
284         echo "Session Manager support is:       enabled"
285 else
286         echo "Session Manager support is:       disabled"
288 if test x${enable_configdir} = xyes; then
289         echo "Use ~/.config/ for config files:  enabled"
290 else
291         echo "Use ~/.config/ for config files:  disabled"
295 echo "Now type make to build"