Update translations.
[gmpc.git] / configure.ac
blobc3864fa8b0bf787a9344b2a2c87c95b4d825eac5
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], [102])
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(sm,
53               [  --disable-sm                           Disable Session Support.],
54               [ if test "x$enableval" = "xyes"; then
55                enable_sm=yes
56            else
57                enable_sm=no
58            fi],
59               enable_sm=yes)
60 AC_ARG_ENABLE(mmkeys,
61               [  --disable-mmkeys                       Disable multimedia keys support.],
62               [ if test "x$enableval" = "xyes"; then
63                     enable_mmkeys=yes
64                 else
65                     enable_mmkeys=no
66                 fi],
67               enable_mmkeys=yes)
70 # Checks for libraries.
72 # Checks for header files.
73 AC_HEADER_STDC
74 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
76 # Checks for typedefs, structures, and compiler characteristics.
77 AC_C_CONST
79 AC_SUBST(GLIB_REQUIRED)
80 AC_SUBST(GTK_REQUIRED)
82 # Split this out, because pkgconfig macro doesn't return nicely what is missing
84 # glib
85 PKG_CHECK_MODULES([glib], glib-2.0 >= 2.10)
86 AC_SUBST(glib_LIBS)
87 AC_SUBST(glib_CFLAGS)
89 # gobject
90 PKG_CHECK_MODULES([gobject], gobject-2.0 >= 2.4)
91 AC_SUBST(gobject_LIBS)
92 AC_SUBST(gobject_CFLAGS)
94 #gtk
95 PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.12)
96 AC_SUBST(gtk_LIBS)
97 AC_SUBST(gtk_CFLAGS)
99 #gmodule
100 PKG_CHECK_MODULES([gmodule], gmodule-2.0 >= 2.4)
101 AC_SUBST(gmodule_LIBS)
102 AC_SUBST(gmodule_CFLAGS)
104 # libmpd
105 PKG_CHECK_MODULES([libmpd], libmpd >= 0.15.98)
106 AC_SUBST(libmpd_LIBS)
107 AC_SUBST(libmpd_CFLAGS)
109 # libglade
110 PKG_CHECK_MODULES([libglade], libglade-2.0)
111 AC_SUBST(libglade_LIBS)
112 AC_SUBST(libglade_CFLAGS)
114 # gthread
115 PKG_CHECK_MODULES([gthread], gthread-2.0)
116 AC_SUBST(gthread_LIBS)
117 AC_SUBST(gthread_CFLAGS)
120 # sm
121 if test x${enable_sm} = xyes; then
122         PKG_CHECK_MODULES([sm], sm)
123         AC_SUBST(sm_LIBS)
124         AC_SUBST(sm_CFLAGS)
125         AC_DEFINE(ENABLE_SM, 1, [Enable Session Support])
129 if test x${enable_mmkeys} = xyes; then
130         AC_DEFINE(ENABLE_MMKEYS, 1, [Enable multimedia support])
132 if test x${enable_configdir} = xyes; then
133         AC_DEFINE(USE_CONFIG_DIR,1, [Use Config Dir])
135 # installation paths
136 AC_MSG_CHECKING(prefix)
138 if test "x${prefix}" = "xNONE"; then
139         PACKAGE_PREFIX="${ac_default_prefix}"
140 else
141         PACKAGE_PREFIX="${prefix}"
143 AC_MSG_RESULT($PACKAGE_PREFIX)
145 # i18n support
146 dnl please keep them in alphabetical order
147 ALL_LINGUAS="de es fr gl hu it nl nb pl ru sv zh_CN"
149 GETTEXT_PACKAGE=gmpc
150 AC_SUBST(GETTEXT_PACKAGE)
151 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[GMPC gettext package])
152 AM_GLIB_GNU_GETTEXT
155 #AM_GNU_GETTEXT([external])
156 # setting correct paths
157 PACKAGE_LOCALE_DIR="${PACKAGE_PREFIX}/${DATADIRNAME}/locale"
158 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"$PACKAGE_LOCALE_DIR",[The package's locale path for gettext])
161 AC_SUBST(PACKAGE_LOCALE_DIR)
162 AC_SUBST(PACKAGE_LIBS)
165 EXTRA_CFLAGS=
166 EXTRA_LDFLAGS=
167 case "$CC" in
168 *gcc*)
169         EXTRA_CFLAGS="-Wmissing-prototypes -Wmissing-declarations"
170         ;;
171 esac
173 win32=no
174 case $host in
175   *-*-mingw32* | *-*-windows)
176     win32=yes
177     EXTRA_CFLAGS="$EXTRA_CFLAGS -mno-cygwin -mwindows -mms-bitfields"
178     EXTRA_LDFLAGS="-export-all-symbols -mwindows -mms-bitfields" ;;
179   *-*-cygwin*)
180     win32=yes
181     EXTRA_LDFLAGS="-export-all-symbols -mms-bitfields" ;;
182 esac
183 AM_CONDITIONAL(WIN32, test x$win32 = xyes)
185 AC_SUBST(EXTRA_CFLAGS)
186 AC_SUBST(EXTRA_LDFLAGS)
187 GOB2_CHECK(2.0.0)
188 if test x${GOB2} = x""; then
189         exit 0;
193 # libcurl settings
194 AC_PATH_PROG(CURL_CONFIG,curl-config)
195 AC_ARG_WITH(curl,
196             AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed]),
197             [CURL_CONFIG="${with_curl}/bin/curl-config"])
198 if test -f "${CURL_CONFIG}"; then
199     LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
200     CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
201 else
202     AC_MSG_WARN([curl-config not found, guessing at libcurl build settings])
204 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
205 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
207 # Maintainer mode
208 AC_ARG_ENABLE([maintainermode],
209         [--enable-maintainermode Enable maintainer mode.],
210         [case "${enableval}" in
211                 yes) maintainer_mode=true;;
212                 no)  maintainer_mode=false;;
213                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-maintainermode]);;
214          esac],
215         [maintainer_mode=false])
217 AM_CONDITIONAL([MAINTAINER_MODE], [test x$maintainer_mode = xtrue])
219 AC_OUTPUT([
220 Makefile
221 src/Makefile
222 src/gob/Makefile
223 glade/Makefile
224 data/Makefile
225 po/Makefile.in
226 po/Makefile
227 data/gmpc.pc
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_configdir} = xyes; then
270         echo "Use ~/.config/ for config files:  enabled"
271 else
272         echo "Use ~/.config/ for config files:  disabled"
276 echo "Now type make to build"