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.90)
26 AC_CONFIG_HEADERS(src/config.h)
30 dnl PKG_PROG_PKG_CONFIG
32 dnl Debugging options to enable debug macros
34 AC_ARG_ENABLE(debug, [ --enable-debug compile with DEBUG],,enable_debug=no)
36 if test "x$enable_debug" = "xyes"; then
37 DEBUG_FLAGS="$DEBUG_FLAGS -DDEBUG -g -fno-omit-frame-pointer"
39 DEBUG_FLAGS="$DEBUG_FLAGS -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT"
42 CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall -Wmissing-prototypes -Wmissing-declarations"
44 PKG_CHECK_MODULES(GLIBGTK, glib-2.0 gconf-2.0 dbus-glib-1 gtk+-2.0)
45 AC_SUBST(GLIBGTK_LIBS)
46 AC_SUBST(GLIBGTK_CFLAGS)
48 AC_ARG_ENABLE([770],AS_HELP_STRING([--enable-770],[Build for Nokia 770/N800]),
49 [enable_770=$enableval], [enable_770=no])
51 AC_ARG_ENABLE([hildon],AS_HELP_STRING([--enable-hildon],[Build for Hildon]),
52 [enable_hildon=$enableval], [enable_hildon=no])
54 AC_ARG_ENABLE([itbtdbus],AS_HELP_STRING([--enable-itbtdbus],[Use IT D-Bus Bluetooth interface]),
55 [enable_itbtdbus=$enableval], [enable_itbtdbus=no])
57 AC_ARG_ENABLE([btdbus],AS_HELP_STRING([--enable-btdbus],[Use D-Bus bluez interface]),
58 [enable_btdbus=$enableval], [enable_btdbus=no])
60 if test "x$enable_770" = "xno" ; then
65 AC_DEFINE([WITH_DEVICE_770], 1, [With 770/N800 specific code])
68 if test "x$enable_itbtdbus" = "xno" ; then
69 WITH_HILDON_DBUS_BT=no
72 WITH_HILDON_DBUS_BT=yes
73 AC_CHECK_HEADERS([bt-dbus.h], [ac_cv_btdbus_h=yes])
74 AC_DEFINE([WITH_HILDON_DBUS_BT], 1, [IT D-Bus bluetooth])
77 if test "x$enable_btdbus" = "xno" ; then
80 WITH_BLUEZ_DBUS_BT=yes
81 PKG_CHECK_MODULES(BLUEZ, bluez)
83 AC_SUBST(BLUEZ_CFLAGS)
84 AC_DEFINE([WITH_BLUEZ_DBUS_BT], 1, [bluez D-Bus bluetooth])
87 if test "x$enable_hildon" = "xyes" ; then
88 dnl Ckeck for hildon-libs
89 PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
91 if test "x$HAVE_HILDON" = "xno"; then
92 PKG_CHECK_MODULES(HILDON, hildon-1, HAVE_HILDON1=yes, HAVE_HILDON1=no)
95 if test "x$HAVE_HILDON" = "xyes"; then
96 AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
105 if test "x$HAVE_HILDON1" = "xyes"; then
106 AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
107 AC_DEFINE(WITH_HILDON_NEW, 1, [build with new Hildon libs])
113 dnl make HILDON_CFLAGS and HILDON_LIBS available
114 if test "x$HAVE_HILDON" = "xyes"; then
115 AC_SUBST(HILDON_CFLAGS)
116 AC_SUBST(HILDON_LIBS)
118 PKG_CHECK_MODULES(OSSO, libosso >= 1 osso-ic, HAVE_OSSO=yes, HAVE_OSSO=no)
119 if test "x$HAVE_OSSO" = "xyes"; then
120 AC_DEFINE(WITH_OSSO, 1, [build with Nokia osso])
122 AC_SUBST(OSSO_CFLAGS)
127 PKG_CHECK_MODULES(OSSO_IC, osso-ic, HAVE_OSSO_IC=yes, HAVE_OSSO_IC=no)
128 if test "x$HAVE_OSSO_IC" = "xyes"; then
129 AC_DEFINE(WITH_OSSO_IC, 1, [build with Nokia osso ic])
130 AC_SUBST(OSSO_IC_LIBS)
131 AC_SUBST(OSSO_IC_CFLAGS)
136 PKG_CHECK_MODULES(OSSO_HELP, libossohelp, HAVE_OSSO_HELP=yes, HAVE_OSSO_HELP=no)
137 if test "x$HAVE_OSSO" = "xyes"; then
138 AC_DEFINE(WITH_OSSO_HELP, 1, [build with Nokia osso help])
139 AC_SUBST(OSSO_HELP_LIBS)
140 AC_SUBST(OSSO_HELP_CFLAGS)
145 PKG_CHECK_MODULES(HILDONFM, hildon-fm, HAVE_HILDONFM=yes, HAVE_HILDONFM=no)
146 if test "x$HAVE_OSSO" = "xyes"; then
147 AC_DEFINE(WITH_HILDONFM, 1, [build with Hildon filemanager])
148 AC_SUBST(HILDONFM_LIBS)
149 AC_SUBST(HILDONFM_CFLAGS)
155 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
156 AM_CONDITIONAL(WITH_OSSO, test "x$HAVE_OSSO" = "xyes")
158 AC_CHECK_HEADERS([gps.h], [ac_cv_gps_h=yes])
159 AC_CHECK_LIB(gps, gps_open,[ac_cv_libgps=yes] )
160 if test "x$ac_cv_libgps" = xyes; then
161 AC_DEFINE(WITH_LIBGPS, 1, [build with gpsd])
164 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
166 PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no)
168 if test "x$HAVE_GEOCLUE" = "xyes"; then
169 AC_DEFINE(WITH_GEOCLUE, 1, [build with Geoclue])
170 AC_SUBST(GEOCLUE_CFLAGS)
171 AC_SUBST(GEOCLUE_LIBS)
174 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
175 AC_SUBST(GNOME_VFS_LIBS)
176 AC_SUBST(GNOME_VFS_CFLAGS)
178 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
179 AC_SUBST(LIBXML2_LIBS)
180 AC_SUBST(LIBXML2_CFLAGS)
182 PKG_CHECK_MODULES(LIBCURL, libcurl)
183 AC_SUBST(LIBCURL_LIBS)
184 AC_SUBST(LIBCURL_CFLAGS)
186 PKG_CHECK_MODULES(SQLITE, sqlite3)
187 AC_SUBST(SQLITE_LIBS)
188 AC_SUBST(SQLITE_CFLAGS)
190 PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10, HAVE_GST=yes, HAVE_GST=no)
191 if test "x$HAVE_GST" = "xyes"; then
192 AC_DEFINE(WITH_GST, 1, [build with Gstreamer])
193 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstapp-0.10"
194 AC_SUBST(GSTREAMER_LIBS)
195 AC_SUBST(GSTREAMER_CFLAGS)
197 AC_MSG_ERROR([Mapper requires gstreamer.])
200 AC_CHECK_HEADERS(bzlib.h,
201 BZ2_LIBS="$BZ2_LIBS -lbz2",
202 AC_MSG_ERROR([Mapper requires libbz2.])
206 AC_CHECK_LIB([expat], [XML_ParserCreate],
207 AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
211 AC_CHECK_HEADERS(expat.h,
212 EXPAT_LIBS="-lexpat",
213 AC_MSG_ERROR([Mapper requires libexpat.])
217 AC_CHECK_HEADER(espeak/speak_lib.h)
218 ESPEAK_LIBS="-lespeak"
219 ESPEAK_CFLAGS="-I/usr/include/espeak"
220 AC_CHECK_LIB([espeak], [espeak_Initialize],
221 AC_DEFINE(WITH_ESPEAK, 1, [Defined if you have espeak])
222 AC_SUBST(ESPEAK_CFLAGS)
223 AC_SUBST(ESPEAK_LIBS)
227 if test "x$HAVE_HILDON" = "xyes"; then
228 localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
232 AC_PROG_INTLTOOL([0.23])
233 GETTEXT_PACKAGE=$PACKAGE
234 AC_SUBST(GETTEXT_PACKAGE)
235 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "${GETTEXT_PACKAGE}", [Name of gettext package])
236 ALL_LINGUAS="en_US en_GB nl_NL it_IT bg_BG fi_FI"
239 if test "x$HAVE_HILDON" = "xyes"; then
240 # To make application visible in maemo Task Navigator it needs a Desktop
241 # file for the application.
242 # D-BUS service file is needed to be able to launch the maemo application
243 # and connect it to D-BUS services.
244 # The following line defines install directories for these files.
245 desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
246 serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`
248 # Application pixmaps install directory
249 pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
251 # Help file install directory
252 helpfile_engbdir=$datadir/osso-help/en_US
254 # Hildon control panel plugin install directories
255 pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
256 plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
258 # Application icon install directories
259 icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
260 icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
261 icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
262 icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
263 icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
265 # Help file install directory
266 helpfile_enusdir=$datadir/osso-help/en_US
267 helpfile_engbdir=$datadir/osso-help/en_GB
269 AC_SUBST(helpfile_enusdir)
270 AC_SUBST(helpfile_engbdir)
273 desktopentrydir=$datadir/applications
275 pixmapdir=$datadir/pixmaps
277 plugindesktopentrydir=
279 # Application icon install directories
280 icon_26x26dir=$datadir/icons/hicolor/26x26
281 icon_34x34dir=$datadir/icons/hicolor/34x34
282 icon_40x40dir=$datadir/icons/hicolor/40x40
283 icon_50x50dir=$datadir/icons/hicolor/50x50
284 icon_scalabledir=$datadir/icons/hicolor/scalable
288 # Define as variables in Makefiles
289 AC_SUBST(desktopentrydir)
290 AC_SUBST(serviceentrydir)
293 AC_SUBST(icon_26x26dir)
294 AC_SUBST(icon_34x34dir)
295 AC_SUBST(icon_40x40dir)
296 AC_SUBST(icon_50x50dir)
297 AC_SUBST(icon_scalabledir)
298 AC_SUBST(pluginlibdir)
299 AC_SUBST(plugindesktopentrydir)
301 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
302 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
304 # Produce output files
314 echo "Hildon: ${enable_hildon}"
315 echo "IT specials (770/N800): ${enable_770}"
316 echo "IT D-Bus Bluetooth: ${enable_itbtdbus}"
317 echo "Bluez D-Bus: ${enable_btdbus}"