2 # This file is part of maemo-mapper
4 # Copyright (C) 2006 John Costigan.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 AM_INIT_AUTOMAKE(mapper, 1.0.3.95)
26 AC_CONFIG_HEADERS(src/config.h)
30 # ^That should do it but for some reason it won't so hack it:
31 # CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
33 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Enable LFS])
34 AC_DEFINE(_GNU_SOURCE, 1, [Enable GNU Extensions])
36 dnl PKG_PROG_PKG_CONFIG
38 dnl Debugging options to enable debug macros
40 AC_ARG_ENABLE(debug, [ --enable-debug compile with DEBUG],,enable_debug=no)
42 if test "x$enable_debug" = "xyes"; then
43 DEBUG_FLAGS="$DEBUG_FLAGS -DDEBUG -g -fno-omit-frame-pointer"
45 DEBUG_FLAGS="$DEBUG_FLAGS -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT"
48 CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall -Wmissing-prototypes -Wmissing-declarations"
50 PKG_CHECK_MODULES(GLIBGTK, glib-2.0 gconf-2.0 dbus-glib-1 gtk+-2.0)
51 AC_SUBST(GLIBGTK_LIBS)
52 AC_SUBST(GLIBGTK_CFLAGS)
54 AC_PATH_PROG(GCONFTOOL, gconftool-2)
57 dnl Maemo has 3.8, but prefer new version in case it's available
58 PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.14, HAVE_GTKHTML=yes, HAVE_GTKHTML=no)
59 if test "x$HAVE_GTKHTML" = "xno"; then
60 PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.8)
62 AC_SUBST(GTKHTML_LIBS)
63 AC_SUBST(GTKHTML_CFLAGS)
65 AC_ARG_ENABLE([770],AS_HELP_STRING([--enable-770],[Build for Nokia 770/N800]),
66 [enable_770=$enableval], [enable_770=no])
68 AC_ARG_ENABLE([hildon],AS_HELP_STRING([--enable-hildon],[Build for Hildon]),
69 [enable_hildon=$enableval], [enable_hildon=no])
71 AC_ARG_ENABLE([itbtdbus],AS_HELP_STRING([--enable-itbtdbus],[Use IT D-Bus Bluetooth interface]),
72 [enable_itbtdbus=$enableval], [enable_itbtdbus=no])
74 AC_ARG_ENABLE([btdbus],AS_HELP_STRING([--enable-btdbus],[Use D-Bus bluez interface]),
75 [enable_btdbus=$enableval], [enable_btdbus=no])
77 AC_ARG_ENABLE([gpsd],AS_HELP_STRING([--enable-gpsd],[Use gpsd]),
78 [enable_gpsd=$enableval], [enable_gpsd=no])
80 AC_ARG_ENABLE([gypsy],AS_HELP_STRING([--enable-gypsy],[Use gypsy]),
81 [enable_gypsy=$enableval], [enable_gypsy=no])
83 AC_ARG_ENABLE([geoclue],AS_HELP_STRING([--enable-geoclue],[Use geoclue]),
84 [enable_geoclue=$enableval], [enable_geoclue=no])
86 if test "x$enable_770" = "xno" ; then
91 AC_DEFINE([WITH_DEVICE_770], 1, [With 770/N800 specific code])
94 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
96 if test "x$enable_itbtdbus" = "xno" ; then
97 WITH_HILDON_DBUS_BT=no
100 WITH_HILDON_DBUS_BT=yes
101 AC_CHECK_HEADERS([bt-dbus.h], [ac_cv_btdbus_h=yes])
102 AC_DEFINE([WITH_HILDON_DBUS_BT], 1, [IT D-Bus bluetooth])
105 if test "x$enable_btdbus" = "xno" ; then
106 WITH_BLUEZ_DBUS_BT=no
108 WITH_BLUEZ_DBUS_BT=yes
109 PKG_CHECK_MODULES(BLUEZ, bluez)
111 AC_SUBST(BLUEZ_CFLAGS)
112 AC_DEFINE([WITH_BLUEZ_DBUS_BT], 1, [bluez D-Bus bluetooth])
115 if test "x$enable_hildon" = "xyes" ; then
116 dnl Ckeck for hildon-libs
117 PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
119 if test "x$HAVE_HILDON" = "xno"; then
120 PKG_CHECK_MODULES(HILDON, hildon-1, HAVE_HILDON1=yes, HAVE_HILDON1=no)
123 if test "x$HAVE_HILDON" = "xyes"; then
124 AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
133 if test "x$HAVE_HILDON1" = "xyes"; then
134 AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
135 AC_DEFINE(WITH_HILDON_NEW, 1, [build with new Hildon libs])
141 dnl make HILDON_CFLAGS and HILDON_LIBS available
142 if test "x$HAVE_HILDON" = "xyes"; then
143 AC_SUBST(HILDON_CFLAGS)
144 AC_SUBST(HILDON_LIBS)
146 PKG_CHECK_MODULES(OSSO, libosso >= 1, HAVE_OSSO=yes, HAVE_OSSO=no)
147 if test "x$HAVE_OSSO" = "xyes"; then
148 AC_DEFINE(WITH_OSSO, 1, [build with Nokia osso])
150 AC_SUBST(OSSO_CFLAGS)
155 if test "x$HAVE_OSSO" = "xyes"; then
157 PKG_CHECK_MODULES(CONIC, conic, CONIC=yes, CONIC=no)
158 if test "x$CONIC" = "xyes"; then
159 AC_DEFINE(WITH_CONIC, 1, [build with Nokia Internet Connectivity library])
161 AC_SUBST(CONIC_CFLAGS)
164 PKG_CHECK_MODULES(OSSO_IC, osso-ic, HAVE_OSSO_IC=yes, HAVE_OSSO_IC=no)
165 if test "x$HAVE_OSSO_IC" = "xyes"; then
166 AC_DEFINE(WITH_OSSO_IC, 1, [build with Nokia osso ic])
167 AC_SUBST(OSSO_IC_LIBS)
168 AC_SUBST(OSSO_IC_CFLAGS)
174 PKG_CHECK_MODULES(HILDON_HELP, hildon-help, HAVE_HILDON_HELP=yes, HAVE_HILDON_HELP=no)
175 if test "x$HAVE_HILDON_HELP" = "xyes"; then
176 AC_DEFINE(WITH_HILDON_HELP, 1, [build with Nokia hildon help (new)])
177 AC_SUBST(HILDON_HELP_LIBS)
178 AC_SUBST(HILDON_HELP_CFLAGS)
181 PKG_CHECK_MODULES(OSSO_HELP, libossohelp, HAVE_OSSO_HELP=yes, HAVE_OSSO_HELP=no)
182 if test "x$HAVE_OSSO_HELP" = "xyes"; then
183 AC_DEFINE(WITH_OSSO_HELP, 1, [build with Nokia osso help (old)])
184 AC_SUBST(OSSO_HELP_LIBS)
185 AC_SUBST(OSSO_HELP_CFLAGS)
194 PKG_CHECK_MODULES(HILDONFM, hildon-fm, HAVE_HILDONFM=yes, HAVE_HILDONFM=no)
195 if test "x$HAVE_HILDONFM" = "xyes"; then
196 AC_DEFINE(WITH_HILDONFM, 1, [build with Hildon Filemanager 1])
197 AC_SUBST(HILDONFM_LIBS)
198 AC_SUBST(HILDONFM_CFLAGS)
201 PKG_CHECK_MODULES(HILDONFM, hildon-fm-2, HAVE_HILDONFM=yes, HAVE_HILDONFM=no)
202 if test "x$HAVE_HILDONFM" = "xyes"; then
203 AC_DEFINE(WITH_HILDONFM, 1, [build with Hildon Filemanager 2])
204 AC_SUBST(HILDONFM_LIBS)
205 AC_SUBST(HILDONFM_CFLAGS)
213 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
214 AM_CONDITIONAL(WITH_OSSO, test "x$HAVE_OSSO" = "xyes")
216 if test "x$enable_gpsd" = "xyes" ; then
217 AC_CHECK_HEADERS([gps.h], [ac_cv_gps_h=yes])
218 AC_CHECK_LIB(gps, gps_open,[ac_cv_libgps=yes] )
219 if test "x$ac_cv_libgps" = xyes; then
220 AC_DEFINE(WITH_LIBGPS, 1, [build with gpsd])
224 if test "x$enable_gypsy" = "xyes" ; then
225 PKG_CHECK_MODULES(GYPSY, [gypsy]) AC_SUBST(GYPSY_CFLAGS) AC_SUBST(GYPSY_LIBS)
226 AC_DEFINE(WITH_GYPSY, 1, [build with gypsy])
229 if test "x$enable_geoclue" = "xyes" ; then
230 PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no)
231 if test "x$HAVE_GEOCLUE" = "xyes"; then
232 AC_DEFINE(WITH_GEOCLUE, 1, [build with Geoclue])
233 AC_SUBST(GEOCLUE_CFLAGS)
234 AC_SUBST(GEOCLUE_LIBS)
238 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
239 AC_SUBST(GNOME_VFS_LIBS)
240 AC_SUBST(GNOME_VFS_CFLAGS)
242 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
243 AC_SUBST(LIBXML2_LIBS)
244 AC_SUBST(LIBXML2_CFLAGS)
246 PKG_CHECK_MODULES(LIBCURL, libcurl)
247 AC_SUBST(LIBCURL_LIBS)
248 AC_SUBST(LIBCURL_CFLAGS)
250 PKG_CHECK_MODULES(SQLITE, sqlite3)
251 AC_SUBST(SQLITE_LIBS)
252 AC_SUBST(SQLITE_CFLAGS)
254 PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10, HAVE_GST=yes, HAVE_GST=no)
255 if test "x$HAVE_GST" = "xyes"; then
256 AC_DEFINE(WITH_GST, 1, [build with Gstreamer])
257 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstapp-0.10"
258 AC_SUBST(GSTREAMER_LIBS)
259 AC_SUBST(GSTREAMER_CFLAGS)
261 AC_MSG_ERROR([Mapper requires gstreamer.])
264 AC_CHECK_HEADERS(bzlib.h,
265 BZ2_LIBS="$BZ2_LIBS -lbz2",
266 AC_MSG_ERROR([Mapper requires libbz2.])
270 AC_CHECK_LIB([expat], [XML_ParserCreate],
271 AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
275 AC_CHECK_HEADERS(expat.h,
276 EXPAT_LIBS="-lexpat",
277 AC_MSG_ERROR([Mapper requires libexpat.])
281 AC_CHECK_HEADER(espeak/speak_lib.h, HAVE_ESPEAK=yes, HAVE_ESPEAK=no)
282 if test "x$HAVE_GST" = "xyes"; then
283 ESPEAK_LIBS="-lespeak"
284 ESPEAK_CFLAGS="-I/usr/include/espeak"
285 AC_CHECK_LIB([espeak], [espeak_Initialize],
286 AC_DEFINE(WITH_ESPEAK, 1, [Defined if you have espeak])
287 AC_SUBST(ESPEAK_CFLAGS)
288 AC_SUBST(ESPEAK_LIBS)
293 if test "x$HAVE_HILDON" = "xyes"; then
294 localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
298 AC_PROG_INTLTOOL([0.23])
299 GETTEXT_PACKAGE=$PACKAGE
300 AC_SUBST(GETTEXT_PACKAGE)
301 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "${GETTEXT_PACKAGE}", [Name of gettext package])
302 ALL_LINGUAS="en_US en_GB nl_NL it_IT bg_BG fi_FI"
305 if test "x$HAVE_HILDON" = "xyes"; then
306 # To make application visible in maemo Task Navigator it needs a Desktop
307 # file for the application.
308 # D-BUS service file is needed to be able to launch the maemo application
309 # and connect it to D-BUS services.
310 # The following line defines install directories for these files.
311 desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
312 serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`
314 # Application pixmaps install directory
315 pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
317 # Help file install directory
318 helpfile_engbdir=$datadir/osso-help/en_US
320 # Hildon control panel plugin install directories
321 pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
322 plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
324 # Application icon install directories
325 icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
326 icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
327 icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
328 icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
329 icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
331 # Help file install directory
332 helpfile_enusdir=$datadir/osso-help/en_US
333 helpfile_engbdir=$datadir/osso-help/en_GB
335 AC_SUBST(helpfile_enusdir)
336 AC_SUBST(helpfile_engbdir)
339 desktopentrydir=$datadir/applications
341 pixmapdir=$datadir/pixmaps
343 plugindesktopentrydir=
345 # Application icon install directories
346 icon_26x26dir=$datadir/icons/hicolor/26x26
347 icon_34x34dir=$datadir/icons/hicolor/34x34
348 icon_40x40dir=$datadir/icons/hicolor/40x40
349 icon_50x50dir=$datadir/icons/hicolor/50x50
350 icon_scalabledir=$datadir/icons/hicolor/scalable
354 # Define as variables in Makefiles
355 AC_SUBST(desktopentrydir)
356 AC_SUBST(serviceentrydir)
359 AC_SUBST(icon_26x26dir)
360 AC_SUBST(icon_34x34dir)
361 AC_SUBST(icon_40x40dir)
362 AC_SUBST(icon_50x50dir)
363 AC_SUBST(icon_scalabledir)
364 AC_SUBST(pluginlibdir)
365 AC_SUBST(plugindesktopentrydir)
367 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
368 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
370 # Produce output files
380 if test x$enable_hildon = xyes; then
381 AC_MSG_NOTICE([** Hildon support enabled])
384 if test x$enable_770 = xyes; then
385 AC_MSG_NOTICE([** Tablet support enabled])
388 if test x$enable_itbtdbus = xyes; then
389 AC_MSG_NOTICE([** Tablet bluetooth D-Bus support enabled])
392 if test x$enable_btdbus = xyes; then
393 AC_MSG_NOTICE([** Bluez D-Bus support enabled])
396 if test x$enable_gpsd = xyes; then
397 AC_MSG_NOTICE([** GPSD support enabled])
400 if test x$enable_gypsy = xyes; then
401 AC_MSG_NOTICE([** Gypsy D-Bus GPS support enabled])