]> err.no Git - mapper/blob - configure.ac
POI Code cleanups:
[mapper] / configure.ac
1 #
2 # This file is part of maemo-mapper
3 #
4 # Copyright (C) 2006 John Costigan.
5 #
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.
10 #
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.
15 #
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.
19 #
20
21 AC_INIT(Makefile.am)
22 AM_INIT_AUTOMAKE(mapper, 1.0.3.91)
23 AM_MAINTAINER_MODE
24
25 AC_PROG_CPP
26 AC_CONFIG_HEADERS(src/config.h)
27 AC_PROG_INSTALL
28 AC_PROG_LIBTOOL
29 AC_SYS_LARGEFILE
30 dnl PKG_PROG_PKG_CONFIG
31
32 dnl Debugging options to enable debug macros
33 DEBUG_FLAGS=
34 AC_ARG_ENABLE(debug,     [  --enable-debug                compile with DEBUG],,enable_debug=no)
35
36 if test "x$enable_debug" = "xyes"; then
37     DEBUG_FLAGS="$DEBUG_FLAGS -DDEBUG -g -fno-omit-frame-pointer"
38 else
39     DEBUG_FLAGS="$DEBUG_FLAGS -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT"
40 fi
41
42 CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall -Wmissing-prototypes -Wmissing-declarations"
43
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)
47
48 AC_ARG_ENABLE([770],AS_HELP_STRING([--enable-770],[Build for Nokia 770/N800]),
49               [enable_770=$enableval], [enable_770=no])
50
51 AC_ARG_ENABLE([hildon],AS_HELP_STRING([--enable-hildon],[Build for Hildon]),
52               [enable_hildon=$enableval], [enable_hildon=no])
53
54 AC_ARG_ENABLE([itbtdbus],AS_HELP_STRING([--enable-itbtdbus],[Use IT D-Bus Bluetooth interface]),
55               [enable_itbtdbus=$enableval], [enable_itbtdbus=no])
56
57 AC_ARG_ENABLE([btdbus],AS_HELP_STRING([--enable-btdbus],[Use D-Bus bluez interface]),
58               [enable_btdbus=$enableval], [enable_btdbus=no])
59
60 AC_ARG_ENABLE([gpsd],AS_HELP_STRING([--enable-gpsd],[Use gpsd]),
61               [enable_gpsd=$enableval], [enable_gpsd=no])
62
63 AC_ARG_ENABLE([geoclue],AS_HELP_STRING([--enable-geoclue],[Use geoclue]),
64               [enable_geoclue=$enableval], [enable_geoclue=no])
65
66 if test "x$enable_770" = "xno" ; then
67   WITH_DEVICE_770=no
68 else
69   WITH_DEVICE_770=yes
70   enable_hildon=yes
71   AC_DEFINE([WITH_DEVICE_770], 1, [With 770/N800 specific code])
72 fi
73
74 if test "x$enable_itbtdbus" = "xno" ; then
75   WITH_HILDON_DBUS_BT=no
76   enable_btdbus=yes
77 else
78   WITH_HILDON_DBUS_BT=yes
79   AC_CHECK_HEADERS([bt-dbus.h], [ac_cv_btdbus_h=yes])
80   AC_DEFINE([WITH_HILDON_DBUS_BT], 1, [IT D-Bus bluetooth])
81 fi
82
83 if test "x$enable_btdbus" = "xno" ; then
84   WITH_BLUEZ_DBUS_BT=no
85 else
86   WITH_BLUEZ_DBUS_BT=yes
87   PKG_CHECK_MODULES(BLUEZ, bluez)
88   AC_SUBST(BLUEZ_LIBS)
89   AC_SUBST(BLUEZ_CFLAGS)
90   AC_DEFINE([WITH_BLUEZ_DBUS_BT], 1, [bluez D-Bus bluetooth])
91 fi
92
93 if test "x$enable_hildon" = "xyes" ; then
94  dnl Ckeck for hildon-libs
95  PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
96
97  if test "x$HAVE_HILDON" = "xno"; then
98   PKG_CHECK_MODULES(HILDON, hildon-1, HAVE_HILDON1=yes, HAVE_HILDON1=no)
99  fi
100
101  if test "x$HAVE_HILDON" = "xyes"; then
102   AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
103  else
104   AC_MSG_RESULT(no)
105  fi
106 else
107  HAVE_HILDON=no
108  HAVE_HILDON1=no
109 fi
110
111 if test "x$HAVE_HILDON1" = "xyes"; then
112   AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
113   AC_DEFINE(WITH_HILDON_NEW, 1, [build with new Hildon libs])
114   HAVE_HILDON=yes
115 else
116   AC_MSG_RESULT(no)
117 fi
118
119 dnl make HILDON_CFLAGS and HILDON_LIBS available
120 if test "x$HAVE_HILDON" = "xyes"; then
121  AC_SUBST(HILDON_CFLAGS)
122  AC_SUBST(HILDON_LIBS)
123
124  PKG_CHECK_MODULES(OSSO, libosso >= 1, HAVE_OSSO=yes, HAVE_OSSO=no)
125  if test "x$HAVE_OSSO" = "xyes"; then
126   AC_DEFINE(WITH_OSSO, 1, [build with Nokia osso])
127   AC_SUBST(OSSO_LIBS)
128   AC_SUBST(OSSO_CFLAGS)
129  else
130   AC_MSG_RESULT(no)
131  fi
132
133  if test "x$HAVE_OSSO" = "xyes"; then
134
135  PKG_CHECK_MODULES(CONIC, conic, CONIC=yes, CONIC=no)
136  if test "x$CONIC" = "xyes"; then
137   AC_DEFINE(WITH_CONIC, 1, [build with Nokia Internet Connectivity library])
138   AC_SUBST(CONIC_LIBS)
139   AC_SUBST(CONIC_CFLAGS)
140  else
141   AC_MSG_RESULT(no)
142   PKG_CHECK_MODULES(OSSO_IC, osso-ic, HAVE_OSSO_IC=yes, HAVE_OSSO_IC=no)
143   if test "x$HAVE_OSSO_IC" = "xyes"; then
144    AC_DEFINE(WITH_OSSO_IC, 1, [build with Nokia osso ic])
145    AC_SUBST(OSSO_IC_LIBS)
146    AC_SUBST(OSSO_IC_CFLAGS)
147   else
148    AC_MSG_RESULT(no)
149   fi
150  fi
151
152  PKG_CHECK_MODULES(HILDON_HELP, hildon-help, HAVE_HILDON_HELP=yes, HAVE_HILDON_HELP=no)
153  if test "x$HAVE_HILDON_HELP" = "xyes"; then
154   AC_DEFINE(WITH_HILDON_HELP, 1, [build with Nokia hildon help (new)])
155   AC_SUBST(HILDON_HELP_LIBS)
156   AC_SUBST(HILDON_HELP_CFLAGS)
157  else
158   AC_MSG_RESULT(no)
159   PKG_CHECK_MODULES(OSSO_HELP, libossohelp, HAVE_OSSO_HELP=yes, HAVE_OSSO_HELP=no)
160   if test "x$HAVE_OSSO_HELP" = "xyes"; then
161    AC_DEFINE(WITH_OSSO_HELP, 1, [build with Nokia osso help (old)])
162    AC_SUBST(OSSO_HELP_LIBS)
163    AC_SUBST(OSSO_HELP_CFLAGS)
164   else
165    AC_MSG_RESULT(no)
166   fi
167  fi
168
169  # libosso
170  fi
171
172  PKG_CHECK_MODULES(HILDONFM, hildon-fm, HAVE_HILDONFM=yes, HAVE_HILDONFM=no)
173  if test "x$HAVE_HILDONFM" = "xyes"; then
174   AC_DEFINE(WITH_HILDONFM, 1, [build with Hildon Filemanager 1])
175   AC_SUBST(HILDONFM_LIBS)
176   AC_SUBST(HILDONFM_CFLAGS)
177  else
178   AC_MSG_RESULT(no)
179   PKG_CHECK_MODULES(HILDONFM, hildon-fm-2, HAVE_HILDONFM=yes, HAVE_HILDONFM=no)
180   if test "x$HAVE_HILDONFM" = "xyes"; then
181    AC_DEFINE(WITH_HILDONFM, 1, [build with Hildon Filemanager 2])
182    AC_SUBST(HILDONFM_LIBS)
183    AC_SUBST(HILDONFM_CFLAGS)
184   else
185    AC_MSG_RESULT(no)
186   fi
187  fi
188
189 fi
190
191 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
192 AM_CONDITIONAL(WITH_OSSO, test "x$HAVE_OSSO" = "xyes")
193
194 if test "x$enable_gpsd" = "xyes" ; then
195 AC_CHECK_HEADERS([gps.h], [ac_cv_gps_h=yes])
196 AC_CHECK_LIB(gps, gps_open,[ac_cv_libgps=yes] )
197 if test "x$ac_cv_libgps" = xyes; then
198         AC_DEFINE(WITH_LIBGPS, 1, [build with gpsd])
199 fi
200 fi
201
202 if test "x$enable_geoclue" = "xyes" ; then
203 PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no)
204 if test "x$HAVE_GEOCLUE" = "xyes"; then
205  AC_DEFINE(WITH_GEOCLUE, 1, [build with Geoclue])
206  AC_SUBST(GEOCLUE_CFLAGS)
207  AC_SUBST(GEOCLUE_LIBS)
208 fi
209 fi
210
211 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
212 AC_SUBST(GNOME_VFS_LIBS)
213 AC_SUBST(GNOME_VFS_CFLAGS)
214
215 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
216 AC_SUBST(LIBXML2_LIBS)
217 AC_SUBST(LIBXML2_CFLAGS)
218
219 PKG_CHECK_MODULES(LIBCURL, libcurl)
220 AC_SUBST(LIBCURL_LIBS)
221 AC_SUBST(LIBCURL_CFLAGS)
222
223 PKG_CHECK_MODULES(SQLITE, sqlite3)
224 AC_SUBST(SQLITE_LIBS)
225 AC_SUBST(SQLITE_CFLAGS)
226
227 PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10, HAVE_GST=yes, HAVE_GST=no)
228 if test "x$HAVE_GST" = "xyes"; then
229  AC_DEFINE(WITH_GST, 1, [build with Gstreamer])
230  GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstapp-0.10"
231  AC_SUBST(GSTREAMER_LIBS)
232  AC_SUBST(GSTREAMER_CFLAGS)
233 else
234  AC_MSG_ERROR([Mapper requires gstreamer.])
235 fi
236
237 AC_CHECK_HEADERS(bzlib.h,
238     BZ2_LIBS="$BZ2_LIBS -lbz2",
239     AC_MSG_ERROR([Mapper requires libbz2.])
240     )
241 AC_SUBST(BZ2_LIBS)
242
243 AC_CHECK_LIB([expat], [XML_ParserCreate],
244   AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
245   AC_SUBST(EXPAT_LIBS)
246 )
247
248 AC_CHECK_HEADERS(expat.h,
249         EXPAT_LIBS="-lexpat",
250         AC_MSG_ERROR([Mapper requires libexpat.])
251         )
252 AC_SUBST(EXPAT_LIBS)
253
254 AC_CHECK_HEADER(espeak/speak_lib.h, HAVE_ESPEAK=yes, HAVE_ESPEAK=no)
255 if test "x$HAVE_GST" = "xyes"; then
256 ESPEAK_LIBS="-lespeak"
257 ESPEAK_CFLAGS="-I/usr/include/espeak"
258 AC_CHECK_LIB([espeak], [espeak_Initialize],
259   AC_DEFINE(WITH_ESPEAK, 1, [Defined if you have espeak])
260   AC_SUBST(ESPEAK_CFLAGS)
261   AC_SUBST(ESPEAK_LIBS)
262 )
263 fi
264
265 # Localisation
266 if test "x$HAVE_HILDON" = "xyes"; then
267  localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
268 else
269  localedir=
270 fi
271 AC_PROG_INTLTOOL([0.23])
272 GETTEXT_PACKAGE=$PACKAGE
273 AC_SUBST(GETTEXT_PACKAGE)
274 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "${GETTEXT_PACKAGE}", [Name of gettext package])
275 ALL_LINGUAS="en_US en_GB nl_NL it_IT bg_BG fi_FI"
276 AM_GLIB_GNU_GETTEXT
277
278 if test "x$HAVE_HILDON" = "xyes"; then
279 # To make application visible in maemo Task Navigator it needs a Desktop
280 # file for the application.
281 # D-BUS service file is needed to be able to launch the maemo application
282 # and connect it to D-BUS services.
283 # The following line defines install directories for these files.
284  desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
285  serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`
286
287 # Application pixmaps install directory
288  pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
289
290 # Help file install directory
291  helpfile_engbdir=$datadir/osso-help/en_US
292
293 # Hildon control panel plugin install directories
294  pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
295  plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
296
297  # Application icon install directories
298  icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
299  icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
300  icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
301  icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
302  icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
303
304  # Help file install directory
305  helpfile_enusdir=$datadir/osso-help/en_US
306  helpfile_engbdir=$datadir/osso-help/en_GB
307
308  AC_SUBST(helpfile_enusdir)
309  AC_SUBST(helpfile_engbdir)
310
311 else
312  desktopentrydir=$datadir/applications
313  serviceentrydir=
314  pixmapdir=$datadir/pixmaps
315  pluginlibdir=
316  plugindesktopentrydir=
317
318  # Application icon install directories
319  icon_26x26dir=$datadir/icons/hicolor/26x26
320  icon_34x34dir=$datadir/icons/hicolor/34x34
321  icon_40x40dir=$datadir/icons/hicolor/40x40
322  icon_50x50dir=$datadir/icons/hicolor/50x50
323  icon_scalabledir=$datadir/icons/hicolor/scalable
324
325 fi
326
327 # Define as variables in Makefiles
328 AC_SUBST(desktopentrydir)
329 AC_SUBST(serviceentrydir)
330 AC_SUBST(localedir)
331 AC_SUBST(pixmapdir)
332 AC_SUBST(icon_26x26dir)
333 AC_SUBST(icon_34x34dir)
334 AC_SUBST(icon_40x40dir)
335 AC_SUBST(icon_50x50dir)
336 AC_SUBST(icon_scalabledir)
337 AC_SUBST(pluginlibdir)
338 AC_SUBST(plugindesktopentrydir)
339
340 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
341 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
342
343 # Produce output files
344 AC_OUTPUT(
345           Makefile \
346           src/Makefile \
347           data/Makefile \
348           data/help/Makefile \
349           po/Makefile.in \
350           po/Makefile
351 )
352
353 echo "Hildon:                     ${enable_hildon}"
354 echo "IT specials (770/N800):     ${enable_770}"
355 echo "IT D-Bus Bluetooth:         ${enable_itbtdbus}"
356 echo "Bluez D-Bus:                ${enable_btdbus}"