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