Fix build check for gob2, it now exits when not found
[gmpc.git] / configure.ac
blobfcd33e66746895831ee90af77b34a544a00bc634
1 # Process this file with autoconf to produce a configure script.
4 m4_define([gmpc_major_version], [0])
5 m4_define([gmpc_minor_version], [15])
6 m4_define([gmpc_micro_version], [99])
8 m4_define([gmpc_tagline], "Still 100% gnome free.")
9 m4_define([gmpc_website], "http://gmpcwiki.sarine.nl")
10 m4_define([gmpc_bugtracker],  "http://gmpcwiki.sarine.nl/index.php/Help:Contents")
12 m4_define([gmpc_version], [gmpc_major_version.gmpc_minor_version.gmpc_micro_version])
14 AC_INIT(src)
15 AM_CONFIG_HEADER([config.h])
16 AM_INIT_AUTOMAKE([gmpc], [gmpc_version],qball@sarine.nl)
19 GMPC_MAJOR_VERSION=gmpc_major_version
20 GMPC_MINOR_VERSION=gmpc_minor_version
21 GMPC_MICRO_VERSION=gmpc_micro_version
22 AC_DEFINE(GMPC_MAJOR_VERSION, gmpc_major_version, ["Major version of gmpc"])
23 AC_DEFINE(GMPC_MINOR_VERSION, gmpc_minor_version, ["Minor version of gmpc"])
24 AC_DEFINE(GMPC_MICRO_VERSION, gmpc_micro_version, ["Micro version of gmpc"])
26 AC_DEFINE(GMPC_TAGLINE,                 gmpc_tagline,    ["Gmpc's tagline"])
27 AC_DEFINE(GMPC_WEBSITE,                 gmpc_website,    ["Gmpc's website"])
28 AC_DEFINE(GMPC_BUGTRACKER,      gmpc_bugtracker, ["Gmpc's bugtracker"])
30 # Checks for programs.
32 AC_PREREQ(2.59)
33 AC_PROG_INTLTOOL([0.21])
34 AC_PROG_LIBTOOL
35 AC_PROG_CC
36 AC_LIBTOOL_RC
40 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
42 AM_CONDITIONAL(HAVE_RC, test "x$RC" != "xno")
44 AC_ARG_ENABLE(configdir,
45               [  --enable-configdir             Use .config instead of .gmpc or .covers.],
46                [ if test "x$enableval" = "xyes"; then
47                 enable_configdir=yes
48             else
49                 enable_configdir=no
50             fi],
51               enable_configdir=no)
52 AC_ARG_ENABLE(trayicon,
53               [  --disable-trayicon  Disable the tray icon.],
54               [ if test "x$enableval" = "xyes"; then
55                enable_trayicon=yes
56            else
57                enable_trayicon=no
58            fi],
59               enable_trayicon=yes)
60 AC_ARG_ENABLE(sm,
61               [  --disable-sm                           Disable Session Support.],
62               [ if test "x$enableval" = "xyes"; then
63                enable_sm=yes
64            else
65                enable_sm=no
66            fi],
67               enable_sm=yes)
68 AC_ARG_ENABLE(mmkeys,
69               [  --disable-mmkeys                       Disable multimedia keys support.],
70               [ if test "x$enableval" = "xyes"; then
71                     enable_mmkeys=yes
72                 else
73                     enable_mmkeys=no
74                 fi],
75               enable_mmkeys=yes)
78 # Checks for libraries.
80 # Checks for header files.
81 AC_HEADER_STDC
82 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
84 # Checks for typedefs, structures, and compiler characteristics.
85 AC_C_CONST
87 AC_SUBST(GLIB_REQUIRED)
88 AC_SUBST(GTK_REQUIRED)
90 # Split this out, because pkgconfig macro doesn't return nicely what is missing
92 # glib
93 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.10)
94 AC_SUBST(glib_LIBS)
95 AC_SUBST(glib_CFLAGS)
97 # gobject
98 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
99 AC_SUBST(gobject_LIBS)
100 AC_SUBST(gobject_CFLAGS)
102 #gtk
103 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.12)
104 AC_SUBST(gtk_LIBS)
105 AC_SUBST(gtk_CFLAGS)
107 #gmodule
108 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
109 AC_SUBST(gmodule_LIBS)
110 AC_SUBST(gmodule_CFLAGS)
112 # libmpd
113 PKG_CHECK_MODULES([libmpd], libmpd >= 0.15.98)
114 AC_SUBST(libmpd_LIBS)
115 AC_SUBST(libmpd_CFLAGS)
117 # libglade
118 PKG_CHECK_MODULES([libglade], libglade-2.0)
119 AC_SUBST(libglade_LIBS)
120 AC_SUBST(libglade_CFLAGS)
122 # gthread
123 PKG_CHECK_MODULES([gthread], gthread-2.0)
124 AC_SUBST(gthread_LIBS)
125 AC_SUBST(gthread_CFLAGS)
128 # sm
129 if test x${enable_sm} = xyes; then
130         PKG_CHECK_MODULES([sm], sm)
131         AC_SUBST(sm_LIBS)
132         AC_SUBST(sm_CFLAGS)
133         AC_DEFINE(ENABLE_SM, 1, [Enable Session Support])
137 if test x${enable_mmkeys} = xyes; then
138         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
140 if test x${enable_configdir} = xyes; then
141         AC_DEFINE(USE_CONFIG_DIR,1, [Use Config Dir])
143 if test x${enable_trayicon} = xyes; then
144         AC_DEFINE(ENABLE_TRAYICON,1, [Disable Tray Icon])
146 # installation paths
147 AC_MSG_CHECKING(prefix)
149 if test "x${prefix}" = "xNONE"; then
150         PACKAGE_PREFIX="${ac_default_prefix}"
151 else
152         PACKAGE_PREFIX="${prefix}"
154 AC_MSG_RESULT($PACKAGE_PREFIX)
156 # i18n support
157 dnl please keep them in alphabetical order
158 ALL_LINGUAS="de es fr gl it nl nb_NO pl ru sv zh_CN"
160 GETTEXT_PACKAGE=gmpc
161 AC_SUBST(GETTEXT_PACKAGE)
162 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
163 AM_GLIB_GNU_GETTEXT
166 #AM_GNU_GETTEXT([external])
167 # setting correct paths
168 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
169 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
172 AC_SUBST(PACKAGE_LOCALE_DIR)
173 AC_SUBST(PACKAGE_LIBS)
176 EXTRA_CFLAGS=
177 EXTRA_LDFLAGS=
178 case "$CC" in
179 *gcc*)
180         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
181         ;;
182 esac
184 win32=no
185 case $host in
186   *-*-mingw32* | *-*-windows)
187     win32=yes
188     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
189     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
190   *-*-cygwin*)
191     win32=yes
192     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
193 esac
194 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
196 AC_SUBST(EXTRA_CFLAGS)
197 AC_SUBST(EXTRA_LDFLAGS)
198 GOB2_CHECK(2.0.0)
199 if test x${GOB2} = x""; then
200         exit 0;
204 # libcurl settings
205 AC_PATH_PROG(CURL_CONFIG,curl-config)
206 AC_ARG_WITH(curl,
207             AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed]),
208             [CURL_CONFIG="${with_curl}/bin/curl-config"])
209 if test -f "${CURL_CONFIG}"; then
210     LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
211     CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
212 else
213     AC_MSG_WARN([curl-config not found, guessing at libcurl build settings])
215 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
216 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
218 # Maintainer mode
219 AC_ARG_ENABLE([maintainermode],
220         [--enable-maintainermode Enable maintainer mode.],
221         [case "${enableval}" in
222                 yes) maintainer_mode=true;;
223                 no)  maintainer_mode=false;;
224                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-maintainermode]);;
225          esac],
226         [maintainer_mode=false])
228 AM_CONDITIONAL([MAINTAINER_MODE], [test x$maintainer_mode = xtrue])
230 AC_OUTPUT([
231 Makefile
232 src/Makefile
233 src/gob/Makefile
234 glade/Makefile
235 data/Makefile
236 po/Makefile.in
237 po/Makefile
238 data/gmpc.pc
239 doc/Makefile
240 remote/Makefile
241 pixmaps/Makefile
242 pixmaps/icons/Makefile
243 pixmaps/icons/16x16/Makefile
244 pixmaps/icons/16x16/actions/Makefile
245 pixmaps/icons/16x16/status/Makefile
246 pixmaps/icons/16x16/apps/Makefile
247 pixmaps/icons/22x22/Makefile
248 pixmaps/icons/22x22/actions/Makefile
249 pixmaps/icons/22x22/status/Makefile
250 pixmaps/icons/22x22/apps/Makefile
251 pixmaps/icons/32x32/Makefile
252 pixmaps/icons/32x32/actions/Makefile
253 pixmaps/icons/32x32/status/Makefile
254 pixmaps/icons/32x32/apps/Makefile
255 pixmaps/icons/48x48/Makefile
256 pixmaps/icons/48x48/actions/Makefile
257 pixmaps/icons/48x48/apps/Makefile
258 pixmaps/icons/scalable/Makefile
259 pixmaps/icons/scalable/actions/Makefile
260 pixmaps/icons/scalable/status/Makefile
261 pixmaps/icons/scalable/apps/Makefile
263 echo ""
264 echo ""
265 echo "-------------- Status --------------"
266 if test x$maintainer_mode = xtrue; then
267         echo "Maintainer mode is:                       enabled"
268 else
269         echo "Maintainer mode is:                       disabled"
271 if test x${enable_mmkeys} = xyes; then
272         echo "Multimedia keys support is:               enabled"
273 else
274         echo "Multimedia keys support is:               disabled"
276 if test x${enable_sm} = xyes; then
277         echo "Session Manager support is:               enabled"
278 else
279         echo "Session Manager support is:               disabled"
281 if test x${enable_trayicon} = xyes; then
282         echo "Trayicon support is:                      enabled"
283 else
284         echo "Trayicon support is:                      disabled"
286 if test x${enable_configdir} = xyes; then
287         echo "Use ~/.config/ for config files:  enabled"
288 else
289         echo "Use ~/.config/ for config files:  disabled"
293 echo "Now type make to build"