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 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
66 AC_SUBST(GNOME_VFS_LIBS)
67 AC_SUBST(GNOME_VFS_CFLAGS)
69 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
70 AC_SUBST(LIBXML2_LIBS)
71 AC_SUBST(LIBXML2_CFLAGS)
73 PKG_CHECK_MODULES(LIBCURL, libcurl)
74 AC_SUBST(LIBCURL_LIBS)
75 AC_SUBST(LIBCURL_CFLAGS)
77 PKG_CHECK_MODULES(SQLITE, sqlite3)
79 AC_SUBST(SQLITE_CFLAGS)
81 AC_ARG_ENABLE([770],AS_HELP_STRING([--enable-770],[Build for Nokia 770/N800]),
82 [enable_770=$enableval], [enable_770=no])
84 AC_ARG_ENABLE([gst],AS_HELP_STRING([--enable-gst],[Enable support for gstreamer]),
85 [enable_gst=$enableval], [enable_gst=no])
87 AC_ARG_ENABLE([hildon],AS_HELP_STRING([--enable-hildon],[Build for Hildon]),
88 [enable_hildon=$enableval], [enable_hildon=no])
90 AC_ARG_ENABLE([itbtdbus],AS_HELP_STRING([--enable-itbtdbus],[Use IT D-Bus Bluetooth interface]),
91 [enable_itbtdbus=$enableval], [enable_itbtdbus=no])
93 AC_ARG_ENABLE([btdbus],AS_HELP_STRING([--enable-btdbus],[Use D-Bus bluez interface]),
94 [enable_btdbus=$enableval], [enable_btdbus=no])
96 AC_ARG_ENABLE([gpsd],AS_HELP_STRING([--enable-gpsd],[Use gpsd]),
97 [enable_gpsd=$enableval], [enable_gpsd=no])
99 AC_ARG_ENABLE([gypsy],AS_HELP_STRING([--enable-gypsy],[Use gypsy]),
100 [enable_gypsy=$enableval], [enable_gypsy=no])
102 AC_ARG_ENABLE([geoclue],AS_HELP_STRING([--enable-geoclue],[Use geoclue]),
103 [enable_geoclue=$enableval], [enable_geoclue=no])
105 AC_ARG_ENABLE([cairo],AS_HELP_STRING([--enable-cairo],[Use cairo]),
106 [enable_cairo=$enableval], [enable_cairo=no])
108 AC_ARG_ENABLE([opengl],AS_HELP_STRING([--enable-opengl],[Use OpenGL (gtkglext]),
109 [enable_opengl=$enableval], [enable_opengl=no])
111 if test "x$enable_cairo" = "xyes" ; then
112 PKG_CHECK_MODULES(CAIRO, cairo)
114 AC_SUBST(CAIRO_CFLAGS)
115 AC_DEFINE([WITH_CAIRO], 1, [Draw using cairo])
118 if test "x$enable_opengl" = "xyes" ; then
119 PKG_CHECK_MODULES(GTKGLEXT, gtkglext-x11-1.0)
120 AC_SUBST(GTKGLEXT_LIBS)
121 AC_SUBST(GTKGLEXT_CFLAGS)
122 AC_DEFINE([WITH_GL], 1, [Draw using OpenGL])
125 if test "x$enable_770" = "xno" ; then
130 AC_DEFINE([WITH_DEVICE_770], 1, [With 770/N800 specific code])
133 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
135 if test "x$enable_itbtdbus" = "xno" ; then
136 WITH_HILDON_DBUS_BT=no
139 WITH_HILDON_DBUS_BT=yes
140 AC_CHECK_HEADERS([bt-dbus.h], [ac_cv_btdbus_h=yes])
141 AC_DEFINE([WITH_HILDON_DBUS_BT], 1, [IT D-Bus bluetooth])
144 PKG_CHECK_MODULES(BLUEZ, bluez, HAVE_BLUEZ=yes, HAVE_BLUEZ=no)
145 if test "x$HAVE_BLUEZ" = "xyes"; then
147 AC_SUBST(BLUEZ_CFLAGS)
149 AC_DEFINE([WITH_BLUEZ], 1, [Bluez RFCOMM])
152 if test "x$enable_btdbus" = "xno" ; then
153 WITH_BLUEZ_DBUS_BT=no
155 WITH_BLUEZ_DBUS_BT=yes
156 AC_DEFINE([WITH_BLUEZ_DBUS_BT], 1, [bluez D-Bus bluetooth])
159 AM_CONDITIONAL(HAVE_HILDON_DBUS_BT, [test "$enable_itbtdbus" = "yes"])
160 AM_CONDITIONAL(HAVE_BLUEZ_DBUS_BT, [test "$enable_btdbus" = "yes"])
162 if test "x$enable_hildon" = "xyes" ; then
163 dnl Ckeck for hildon-libs
164 PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
166 if test "x$HAVE_HILDON" = "xno"; then
167 PKG_CHECK_MODULES(HILDON, hildon-1, HAVE_HILDON1=yes, HAVE_HILDON1=no)
170 if test "x$HAVE_HILDON" = "xyes"; then
171 AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
180 if test "x$HAVE_HILDON1" = "xyes"; then
181 AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
182 AC_DEFINE(WITH_HILDON_NEW, 1, [build with new Hildon libs])
188 dnl make HILDON_CFLAGS and HILDON_LIBS available
189 if test "x$HAVE_HILDON" = "xyes"; then
190 AC_SUBST(HILDON_CFLAGS)
191 AC_SUBST(HILDON_LIBS)
193 PKG_CHECK_MODULES(OSSO, libosso >= 1, HAVE_OSSO=yes, HAVE_OSSO=no)
194 if test "x$HAVE_OSSO" = "xyes"; then
195 AC_DEFINE(WITH_OSSO, 1, [build with Nokia osso])
197 AC_SUBST(OSSO_CFLAGS)
202 if test "x$HAVE_OSSO" = "xyes"; then
204 PKG_CHECK_MODULES(CONIC, conic, CONIC=yes, CONIC=no)
205 if test "x$CONIC" = "xyes"; then
206 AC_DEFINE(WITH_CONIC, 1, [build with Nokia Internet Connectivity library])
208 AC_SUBST(CONIC_CFLAGS)
211 PKG_CHECK_MODULES(OSSO_IC, osso-ic, HAVE_OSSO_IC=yes, HAVE_OSSO_IC=no)
212 if test "x$HAVE_OSSO_IC" = "xyes"; then
213 AC_DEFINE(WITH_OSSO_IC, 1, [build with Nokia osso ic])
214 AC_SUBST(OSSO_IC_LIBS)
215 AC_SUBST(OSSO_IC_CFLAGS)
221 PKG_CHECK_MODULES(HILDON_HELP, hildon-help, HAVE_HILDON_HELP=yes, HAVE_HILDON_HELP=no)
222 if test "x$HAVE_HILDON_HELP" = "xyes"; then
223 AC_DEFINE(WITH_HILDON_HELP, 1, [build with Nokia hildon help (new)])
224 AC_SUBST(HILDON_HELP_LIBS)
225 AC_SUBST(HILDON_HELP_CFLAGS)
228 PKG_CHECK_MODULES(OSSO_HELP, libossohelp, HAVE_OSSO_HELP=yes, HAVE_OSSO_HELP=no)
229 if test "x$HAVE_OSSO_HELP" = "xyes"; then
230 AC_DEFINE(WITH_OSSO_HELP, 1, [build with Nokia osso help (old)])
231 AC_SUBST(OSSO_HELP_LIBS)
232 AC_SUBST(OSSO_HELP_CFLAGS)
241 PKG_CHECK_MODULES(HILDONFM, hildon-fm, HAVE_HILDONFM=yes, HAVE_HILDONFM=no)
242 if test "x$HAVE_HILDONFM" = "xyes"; then
243 AC_DEFINE(WITH_HILDONFM, 1, [build with Hildon Filemanager 1])
244 AC_SUBST(HILDONFM_LIBS)
245 AC_SUBST(HILDONFM_CFLAGS)
248 PKG_CHECK_MODULES(HILDONFM, hildon-fm-2, HAVE_HILDONFM=yes, HAVE_HILDONFM=no)
249 if test "x$HAVE_HILDONFM" = "xyes"; then
250 AC_DEFINE(WITH_HILDONFM, 1, [build with Hildon Filemanager 2])
251 AC_SUBST(HILDONFM_LIBS)
252 AC_SUBST(HILDONFM_CFLAGS)
260 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
261 AM_CONDITIONAL(WITH_OSSO, test "x$HAVE_OSSO" = "xyes")
263 if test "x$enable_gpsd" = "xyes" ; then
264 AC_CHECK_HEADERS([gps.h], [ac_cv_gps_h=yes])
265 AC_CHECK_LIB(gps, gps_open,[ac_cv_libgps=yes] )
267 PKG_CHECK_MODULES(LIBGPSBT, gpsbt, HAVE_GPSBT=yes, HAVE_GPSBT=no)
268 if test "x$HAVE_GPSBT" = "xyes"; then
269 AC_DEFINE(WITH_GPSBT, 1, [Support gpsbt])
270 AC_SUBST(LIBGPSBT_CFLAGS)
271 AC_SUBST(LIBGPSBT_LIBS)
274 PKG_CHECK_MODULES(LIBGPSMGR, gpsmgr, HAVE_GPSMGR=yes, HAVE_GPSMGR=no)
275 if test "x$HAVE_GPSMGR" = "xyes"; then
276 AC_DEFINE(WITH_GPSMGR, 1, [Support gpsmgr])
277 AC_SUBST(LIBGPSMGR_CFLAGS)
278 AC_SUBST(LIBGPSMGR_LIBS)
281 if test "x$ac_cv_libgps" = xyes; then
282 AC_DEFINE(WITH_LIBGPS, 1, [build with gpsd])
285 AM_CONDITIONAL(HAVE_GPSD, [test "$enable_gpsd" = "yes"])
287 if test "x$enable_gypsy" = "xyes" ; then
288 PKG_CHECK_MODULES(GYPSY, gypsy, HAVE_GYPSY=yes, HAVE_GYPSY=no)
289 if test "x$HAVE_GEOCLUE" = "xyes"; then
290 AC_DEFINE(WITH_GYPSY, 1, [build with gypsy])
291 AC_SUBST(GYPSY_CFLAGS)
295 AM_CONDITIONAL(HAVE_GYPSY, [test "$enable_gypsy" = "yes"])
297 if test "x$enable_geoclue" = "xyes" ; then
298 PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no)
299 if test "x$HAVE_GEOCLUE" = "xyes"; then
300 AC_DEFINE(WITH_GEOCLUE, 1, [build with Geoclue])
301 AC_SUBST(GEOCLUE_CFLAGS)
302 AC_SUBST(GEOCLUE_LIBS)
305 AM_CONDITIONAL(HAVE_GEOCLUE, [test "$enable_geoclue" = "yes"])
307 if test "x$enable_gst" = "xyes" ; then
308 PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10, HAVE_GST=yes, HAVE_GST=no)
309 if test "x$HAVE_GST" = "xyes"; then
310 AC_DEFINE(WITH_GST, 1, [build with Gstreamer])
311 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstapp-0.10"
312 AC_SUBST(GSTREAMER_LIBS)
313 AC_SUBST(GSTREAMER_CFLAGS)
315 AC_MSG_ERROR([Gstreamer requested but can not be found.])
318 AM_CONDITIONAL(HAVE_GST, [test "$enable_gst" = "yes"])
320 AC_CHECK_HEADERS(bzlib.h,
321 BZ2_LIBS="$BZ2_LIBS -lbz2",
322 AC_MSG_ERROR([Mapper requires libbz2.])
326 AC_CHECK_LIB([expat], [XML_ParserCreate],
327 AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
331 AC_CHECK_HEADERS(expat.h,
332 EXPAT_LIBS="-lexpat",
333 AC_MSG_ERROR([Mapper requires libexpat.])
337 if test "x$HAVE_GST" = "xyes"; then
338 AC_CHECK_HEADER(espeak/speak_lib.h, HAVE_ESPEAK=yes, HAVE_ESPEAK=no)
339 if test "x$HAVE_ESPEAK" = "xyes"; then
340 ESPEAK_LIBS="-lespeak"
341 ESPEAK_CFLAGS="-I/usr/include/espeak"
342 AC_CHECK_LIB([espeak], [espeak_Initialize],
343 AC_DEFINE(WITH_ESPEAK, 1, [Defined if you have espeak])
344 AC_SUBST(ESPEAK_CFLAGS)
345 AC_SUBST(ESPEAK_LIBS))
347 AC_MSG_ERROR([Speech output requires espeak.])
352 if test "x$HAVE_HILDON" = "xyes"; then
353 localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
357 AC_PROG_INTLTOOL([0.23])
358 GETTEXT_PACKAGE=$PACKAGE
359 AC_SUBST(GETTEXT_PACKAGE)
360 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "${GETTEXT_PACKAGE}", [Name of gettext package])
361 ALL_LINGUAS="en_US en_GB nl_NL it_IT bg_BG fi_FI"
364 if test "x$HAVE_HILDON" = "xyes"; then
365 # To make application visible in maemo Task Navigator it needs a Desktop
366 # file for the application.
367 # D-BUS service file is needed to be able to launch the maemo application
368 # and connect it to D-BUS services.
369 # The following line defines install directories for these files.
370 desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
371 serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`
373 # Application pixmaps install directory
374 pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
376 # Help file install directory
377 helpfile_engbdir=$datadir/osso-help/en_US
379 # Hildon control panel plugin install directories
380 pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
381 plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
383 # Application icon install directories
384 icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
385 icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
386 icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
387 icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
388 icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
390 # Help file install directory
391 helpfile_enusdir=$datadir/osso-help/en_US
392 helpfile_engbdir=$datadir/osso-help/en_GB
394 AC_SUBST(helpfile_enusdir)
395 AC_SUBST(helpfile_engbdir)
398 desktopentrydir=$datadir/applications
399 serviceentrydir=`$PKG_CONFIG dbus-1 --variable=session_bus_services_dir`
400 pixmapdir=$datadir/pixmaps
402 # Application icon install directories
403 icon_26x26dir=$datadir/icons/hicolor/26x26
404 icon_34x34dir=$datadir/icons/hicolor/34x34
405 icon_40x40dir=$datadir/icons/hicolor/40x40
406 icon_50x50dir=$datadir/icons/hicolor/50x50
407 icon_scalabledir=$datadir/icons/hicolor/scalable
411 # Define as variables in Makefiles
412 AC_SUBST(desktopentrydir)
413 AC_SUBST(serviceentrydir)
416 AC_SUBST(icon_26x26dir)
417 AC_SUBST(icon_34x34dir)
418 AC_SUBST(icon_40x40dir)
419 AC_SUBST(icon_50x50dir)
420 AC_SUBST(icon_scalabledir)
421 AC_SUBST(pluginlibdir)
422 AC_SUBST(plugindesktopentrydir)
424 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
425 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
427 # Produce output files
437 if test x$enable_hildon = xyes; then
438 AC_MSG_NOTICE([** Hildon support enabled])
441 if test x$enable_770 = xyes; then
442 AC_MSG_NOTICE([** Tablet support enabled])
445 if test x$enable_itbtdbus = xyes; then
446 AC_MSG_NOTICE([** Tablet bluetooth D-Bus support enabled])
449 if test x$HAVE_BLUEZ = xyes; then
450 AC_MSG_NOTICE([** Bluez support enabled])
453 if test x$enable_btdbus = xyes; then
454 AC_MSG_NOTICE([** Bluez D-Bus support enabled])
457 if test x$enable_gpsd = xyes; then
458 AC_MSG_NOTICE([** GPSD support enabled])
461 if test x$enable_gypsy = xyes; then
462 AC_MSG_NOTICE([** Gypsy D-Bus GPS support enabled])
465 if test x$enable_gst = xyes; then
466 AC_MSG_NOTICE([** Gstreamer support enabled])
469 if test x$enable_cairo = xyes; then
470 AC_MSG_NOTICE([** Using cairo for graphics])
473 if test x$enable_opengl = xyes; then
474 AC_MSG_NOTICE([** Using OpenGL])