Bump version
[gmpc.git] / configure.ac
blob71395fbaffaf8874f61efa7d7835c9948e2cc46e
1 # Process this file with autoconf to produce a configure script.
2 m4_define([gmpc_major_version], [0])
3 m4_define([gmpc_minor_version], [15])
4 m4_define([gmpc_micro_version], [98])
5 m4_define([gmpc_version],
6           [gmpc_major_version.gmpc_minor_version.gmpc_micro_version])
8 AC_INIT(src)
9 AM_CONFIG_HEADER([config.h])
10 AM_INIT_AUTOMAKE([gmpc], [gmpc_version],qball@sarine.nl)
13 GMPC_MAJOR_VERSION=gmpc_major_version
14 GMPC_MINOR_VERSION=gmpc_minor_version
15 GMPC_MICRO_VERSION=gmpc_micro_version
16 AC_DEFINE(GMPC_MAJOR_VERSION, gmpc_major_version, ["Major version of gmpc"])
17 AC_DEFINE(GMPC_MINOR_VERSION, gmpc_minor_version, ["Minor version of gmpc"])
18 AC_DEFINE(GMPC_MICRO_VERSION, gmpc_micro_version, ["Micro version of gmpc"])
21 # Checks for programs.
23 AC_PREREQ(2.59)
24 AC_PROG_INTLTOOL([0.21])
25 AC_PROG_LIBTOOL
26 AC_PROG_CC
27 AC_LIBTOOL_RC
31 AM_CONDITIONAL([INTLTOOL_HIGHER_04000], [test ${INTLTOOL_APPLIED_VERSION_AS_INT} -ge 4000])
33 AM_CONDITIONAL(HAVE_RC, test "x$RC" != "xno")
35 AC_ARG_ENABLE(configdir,
36               [  --enable-configdir             Use .config instead of .gmpc or .covers.],
37                [ if test "x$enableval" = "xyes"; then
38                 enable_configdir=yes
39             else
40                 enable_configdir=no
41             fi],
42               enable_configdir=no)
43 AC_ARG_ENABLE(trayicon,
44               [  --disable-trayicon  Disable the tray icon.],
45               [ if test "x$enableval" = "xyes"; then
46                enable_trayicon=yes
47            else
48                enable_trayicon=no
49            fi],
50               enable_trayicon=yes)
51 AC_ARG_ENABLE(sm,
52               [  --disable-sm                           Disable Session Support.],
53               [ if test "x$enableval" = "xyes"; then
54                enable_sm=yes
55            else
56                enable_sm=no
57            fi],
58               enable_sm=yes)
59 AC_ARG_ENABLE(mmkeys,
60               [  --disable-mmkeys                       Disable multimedia keys support.],
61               [ if test "x$enableval" = "xyes"; then
62                     enable_mmkeys=yes
63                 else
64                     enable_mmkeys=no
65                 fi],
66               enable_mmkeys=yes)
69 # Checks for libraries.
71 # Checks for header files.
72 AC_HEADER_STDC
73 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
75 # Checks for typedefs, structures, and compiler characteristics.
76 AC_C_CONST
78 AC_SUBST(GLIB_REQUIRED)
79 AC_SUBST(GTK_REQUIRED)
81 # Split this out, because pkgconfig macro doesn't return nicely what is missing
83 # glib
84 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.10)
85 AC_SUBST(glib_LIBS)
86 AC_SUBST(glib_CFLAGS)
88 # gobject
89 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
90 AC_SUBST(gobject_LIBS)
91 AC_SUBST(gobject_CFLAGS)
93 #gtk
94 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.12)
95 AC_SUBST(gtk_LIBS)
96 AC_SUBST(gtk_CFLAGS)
98 #gmodule
99 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
100 AC_SUBST(gmodule_LIBS)
101 AC_SUBST(gmodule_CFLAGS)
103 # libmpd
104 PKG_CHECK_MODULES([libmpd], libmpd >= 0.15.3)
105 AC_SUBST(libmpd_LIBS)
106 AC_SUBST(libmpd_CFLAGS)
108 # libglade
109 PKG_CHECK_MODULES([libglade], libglade-2.0)
110 AC_SUBST(libglade_LIBS)
111 AC_SUBST(libglade_CFLAGS)
113 # gthread
114 PKG_CHECK_MODULES([gthread], gthread-2.0)
115 AC_SUBST(gthread_LIBS)
116 AC_SUBST(gthread_CFLAGS)
119 # sm
120 if test x${enable_sm} = xyes; then
121         PKG_CHECK_MODULES([sm], sm)
122         AC_SUBST(sm_LIBS)
123         AC_SUBST(sm_CFLAGS)
124         AC_DEFINE(ENABLE_SM, 1, [Enable Session Support])
128 if test x${enable_mmkeys} = xyes; then
129         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
131 if test x${enable_configdir} = xyes; then
132         AC_DEFINE(USE_CONFIG_DIR,1, [Use Config Dir])
134 if test x${enable_trayicon} = xyes; then
135         AC_DEFINE(ENABLE_TRAYICON,1, [Disable Tray Icon])
137 # installation paths
138 AC_MSG_CHECKING(prefix)
140 if test "x${prefix}" = "xNONE"; then
141         PACKAGE_PREFIX="${ac_default_prefix}"
142 else
143         PACKAGE_PREFIX="${prefix}"
145 AC_MSG_RESULT($PACKAGE_PREFIX)
147 # i18n support
148 dnl please keep them in alphabetical order
149 ALL_LINGUAS="de es fr gl it nl nb_NO pl ru sv zh_CN"
151 GETTEXT_PACKAGE=gmpc
152 AC_SUBST(GETTEXT_PACKAGE)
153 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
154 AM_GLIB_GNU_GETTEXT
157 #AM_GNU_GETTEXT([external])
158 # setting correct paths
159 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
160 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
163 AC_SUBST(PACKAGE_LOCALE_DIR)
164 AC_SUBST(PACKAGE_LIBS)
167 EXTRA_CFLAGS=
168 EXTRA_LDFLAGS=
169 case "$CC" in
170 *gcc*)
171         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
172         ;;
173 esac
175 win32=no
176 case $host in
177   *-*-mingw32* | *-*-windows)
178     win32=yes
179     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
180     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
181   *-*-cygwin*)
182     win32=yes
183     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
184 esac
185 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
187 AC_SUBST(EXTRA_CFLAGS)
188 AC_SUBST(EXTRA_LDFLAGS)
189 GOB2_CHECK(2.0.0)
192 # libcurl settings
193 AC_PATH_PROG(CURL_CONFIG,curl-config)
194 AC_ARG_WITH(curl,
195             AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed]),
196             [CURL_CONFIG="${with_curl}/bin/curl-config"])
197 if test -f "${CURL_CONFIG}"; then
198     LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
199     CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
200 else
201     AC_MSG_WARN([curl-config not found, guessing at libcurl build settings])
203 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
204 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
206 # Maintainer mode
207 AC_ARG_ENABLE([maintainermode],
208         [--enable-maintainermode Enable maintainer mode.],
209         [case "${enableval}" in
210                 yes) maintainer_mode=true;;
211                 no)  maintainer_mode=false;;
212                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-maintainermode]);;
213          esac],
214         [maintainer_mode=false])
216 AM_CONDITIONAL([MAINTAINER_MODE], [test x$maintainer_mode = xtrue])
218 AC_OUTPUT([
219 Makefile
220 src/Makefile
221 src/gob/Makefile
222 glade/Makefile
223 data/Makefile
224 po/Makefile.in
225 po/Makefile
226 data/gmpc.pc
227 doc/Makefile
228 remote/Makefile
229 pixmaps/Makefile
230 pixmaps/icons/Makefile
231 pixmaps/icons/16x16/Makefile
232 pixmaps/icons/16x16/actions/Makefile
233 pixmaps/icons/16x16/status/Makefile
234 pixmaps/icons/16x16/apps/Makefile
235 pixmaps/icons/22x22/Makefile
236 pixmaps/icons/22x22/actions/Makefile
237 pixmaps/icons/22x22/status/Makefile
238 pixmaps/icons/22x22/apps/Makefile
239 pixmaps/icons/32x32/Makefile
240 pixmaps/icons/32x32/actions/Makefile
241 pixmaps/icons/32x32/status/Makefile
242 pixmaps/icons/32x32/apps/Makefile
243 pixmaps/icons/48x48/Makefile
244 pixmaps/icons/48x48/actions/Makefile
245 pixmaps/icons/48x48/apps/Makefile
246 pixmaps/icons/scalable/Makefile
247 pixmaps/icons/scalable/actions/Makefile
248 pixmaps/icons/scalable/status/Makefile
249 pixmaps/icons/scalable/apps/Makefile
251 echo ""
252 echo ""
253 echo "-------------- Status --------------"
254 if test x$maintainer_mode = xtrue; then
255         echo "Maintainer mode is:                       enabled"
256 else
257         echo "Maintainer mode is:                       disabled"
259 if test x${enable_mmkeys} = xyes; then
260         echo "Multimedia keys support is:               enabled"
261 else
262         echo "Multimedia keys support is:               disabled"
264 if test x${enable_sm} = xyes; then
265         echo "Session Manager support is:               enabled"
266 else
267         echo "Session Manager support is:               disabled"
269 if test x${enable_trayicon} = xyes; then
270         echo "Trayicon support is:                      enabled"
271 else
272         echo "Trayicon support is:                      disabled"
274 if test x${enable_configdir} = xyes; then
275         echo "Use ~/.config/ for config files:  enabled"
276 else
277         echo "Use ~/.config/ for config files:  disabled"
281 echo "Now type make to build"