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.0)
25 AC_CONFIG_HEADERS(src/config.h)
29 dnl Debugging options to enable debug macros
31 AC_ARG_ENABLE(debug, [ --enable-debug compile with DEBUG],,enable_debug=no)
33 if test "x$enable_debug" = "xyes"; then
34 DEBUG_FLAGS="$DEBUG_FLAGS -DDEBUG -g -fno-omit-frame-pointer"
36 DEBUG_FLAGS="$DEBUG_FLAGS -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT"
39 CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall -Wmissing-prototypes -Wmissing-declarations"
41 PKG_CHECK_MODULES(GLIBGTK, glib-2.0 gconf-2.0 dbus-glib-1 gtk+-2.0)
42 AC_SUBST(GLIBGTK_LIBS)
43 AC_SUBST(GLIBGTK_CFLAGS)
45 dnl Ckeck for hildon-libs
46 PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
48 if test "x$HAVE_HILDON" = "xyes"; then
49 AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
54 dnl make HILDON_CFLAGS and HILDON_LIBS available
55 if test "x$HAVE_HILDON" = "xyes"; then
56 AC_SUBST(HILDON_CFLAGS)
59 PKG_CHECK_MODULES(OSSO, libosso >= 1 libossohelp osso-ic, HAVE_OSSO=yes, HAVE_OSSO=no)
60 if test "x$HAVE_OSSO" = "xyes"; then
61 AC_DEFINE(WITH_OSSO, 1, [build with Nokia osso])
68 PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.9.50 hildon-fm)
70 AC_SUBST(HILDON_CFLAGS)
73 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
74 AM_CONDITIONAL(WITH_OSSO, test "x$HAVE_OSSO" = "xyes")
76 PKG_CHECK_MODULES(BLUEZ, bluez)
78 AC_SUBST(BLUEZ_CFLAGS)
80 AC_CHECK_HEADERS([gps.h], [ac_cv_gps_h=yes])
81 AC_CHECK_LIB(gps, gps_open,[ac_cv_libgps=yes] )
82 if test "x$ac_cv_libgps" != xyes; then
83 AC_DEFINE(WITH_LIBGPS, 1, [build with gpsd])
86 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
88 PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no)
90 if test "x$HAVE_GEOCLUE" = "xyes"; then
91 AC_DEFINE(WITH_GEOCLUE, 1, [build with Geoclue])
92 AC_SUBST(GEOCLUE_CFLAGS)
93 AC_SUBST(GEOCLUE_LIBS)
96 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
97 AC_SUBST(GNOME_VFS_LIBS)
98 AC_SUBST(GNOME_VFS_CFLAGS)
100 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
101 AC_SUBST(LIBXML2_LIBS)
102 AC_SUBST(LIBXML2_CFLAGS)
104 PKG_CHECK_MODULES(LIBCURL, libcurl)
105 AC_SUBST(LIBCURL_LIBS)
106 AC_SUBST(LIBCURL_CFLAGS)
108 PKG_CHECK_MODULES(SQLITE, sqlite3)
109 AC_SUBST(SQLITE_LIBS)
110 AC_SUBST(SQLITE_CFLAGS)
112 PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10, HAVE_GST=yes, HAVE_GST=no)
113 if test "x$HAVE_GST" = "xyes"; then
114 AC_DEFINE(WITH_GST, 1, [build with Gstreamer])
115 AC_SUBST(GSTREAMER_LIBS)
116 AC_SUBST(GSTREAMER_CFLAGS)
119 # XXX: Check for expat
120 AC_CHECK_HEADER(expat.h)
122 EXPAT_CFLAGS="-I/usr/include"
123 AC_SUBST(EXPAT_CFLAGS)
126 AC_CHECK_LIB([expat], [XML_ParserCreate],
127 AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
131 AC_CHECK_HEADER(espeak/speak_lib.h)
132 ESPEAK_LIBS="-lespeak"
133 ESPEAK_CFLAGS="-I/usr/include/espeak"
134 AC_CHECK_LIB([espeak], [espeak_Initialize],
135 AC_DEFINE(HAVE_ESPEAK, 1, [Defined if you have espeak])
136 AC_SUBST(ESPEAK_CFLAGS)
141 if test "x$HAVE_HILDON" = "xyes"; then
142 localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
146 AC_PROG_INTLTOOL([0.23])
147 GETTEXT_PACKAGE=$PACKAGE
148 AC_SUBST(GETTEXT_PACKAGE)
149 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "${GETTEXT_PACKAGE}", [Name of gettext package])
150 ALL_LINGUAS="en_US en_GB nl_NL it_IT bg_BG fi_FI"
153 if test "x$HAVE_HILDON" = "xyes"; then
154 # To make application visible in maemo Task Navigator it needs a Desktop
155 # file for the application.
156 # D-BUS service file is needed to be able to launch the maemo application
157 # and connect it to D-BUS services.
158 # The following line defines install directories for these files.
159 desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
160 serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`
162 # Application pixmaps install directory
163 pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
165 # Help file install directory
166 helpfile_engbdir=$datadir/osso-help/en_US
168 # Hildon control panel plugin install directories
169 pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
170 plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
177 plugindesktopentrydir=
180 # Application icon install directories
181 icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
182 icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
183 icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
184 icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
185 icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
187 # Help file install directory
188 helpfile_enusdir=$datadir/osso-help/en_US
189 AC_SUBST(helpfile_enusdir)
190 helpfile_engbdir=$datadir/osso-help/en_GB
191 AC_SUBST(helpfile_engbdir)
193 # Define as variables in Makefiles
194 AC_SUBST(desktopentrydir)
195 AC_SUBST(serviceentrydir)
198 AC_SUBST(icon_26x26dir)
199 AC_SUBST(icon_34x34dir)
200 AC_SUBST(icon_40x40dir)
201 AC_SUBST(icon_50x50dir)
202 AC_SUBST(icon_scalabledir)
203 AC_SUBST(pluginlibdir)
204 AC_SUBST(plugindesktopentrydir)
206 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
207 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
209 # Produce output files