]> err.no Git - mapper/blob - configure.ac
Add speach output using espeak+gstreamer.
[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.0)
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 if test "x$enable_770" = "xno" ; then
55   WITH_DEVICE_770=no
56 else
57   WITH_DEVICE_770=yes
58   enable_hildon=yes
59   AC_DEFINE([WITH_DEVICE_770], 1, [With 770/N800 specific code])
60 fi
61
62 if test "x$enable_hildon" = "xyes" ; then
63  dnl Ckeck for hildon-libs
64  PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
65
66  if test "x$HAVE_HILDON" = "xno"; then
67   PKG_CHECK_MODULES(HILDON, hildon-1, HAVE_HILDON1=yes, HAVE_HILDON1=no)
68  fi
69
70  if test "x$HAVE_HILDON" = "xyes"; then
71   AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
72  else
73   AC_MSG_RESULT(no)
74  fi
75 else
76  HAVE_HILDON=no
77  HAVE_HILDON1=no
78 fi
79
80 if test "x$HAVE_HILDON1" = "xyes"; then
81   AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
82   AC_DEFINE(WITH_HILDON_NEW, 1, [build with new Hildon libs])
83   HAVE_HILDON=yes
84 else
85   AC_MSG_RESULT(no)
86 fi
87
88 dnl make HILDON_CFLAGS and HILDON_LIBS available
89 if test "x$HAVE_HILDON" = "xyes"; then
90  AC_SUBST(HILDON_CFLAGS)
91  AC_SUBST(HILDON_LIBS)
92
93  PKG_CHECK_MODULES(OSSO, libosso >= 1 libossohelp osso-ic, HAVE_OSSO=yes, HAVE_OSSO=no)
94  if test "x$HAVE_OSSO" = "xyes"; then
95   AC_DEFINE(WITH_OSSO, 1, [build with Nokia osso])
96   AC_SUBST(OSSO_LIBS)
97   AC_SUBST(OSSO_CFLAGS)
98  else
99   AC_MSG_RESULT(no)
100  fi
101
102  PKG_CHECK_MODULES(HILDONFM, hildon-fm, HAVE_HILDONFM=yes, HAVE_HILDONFM=no)
103  if test "x$HAVE_OSSO" = "xyes"; then
104   AC_DEFINE(WITH_HILDONFM, 1, [build with Hildon filemanager])
105   AC_SUBST(HILDONFM_LIBS)
106   AC_SUBST(HILDONFM_CFLAGS)
107  else
108   AC_MSG_RESULT(no)
109  fi
110 fi
111
112 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
113 AM_CONDITIONAL(WITH_OSSO, test "x$HAVE_OSSO" = "xyes")
114
115 PKG_CHECK_MODULES(BLUEZ, bluez)
116 AC_SUBST(BLUEZ_LIBS)
117 AC_SUBST(BLUEZ_CFLAGS)
118
119 AC_CHECK_HEADERS([gps.h], [ac_cv_gps_h=yes])
120 AC_CHECK_LIB(gps, gps_open,[ac_cv_libgps=yes] )
121 if test "x$ac_cv_libgps" = xyes; then
122         AC_DEFINE(WITH_LIBGPS, 1, [build with gpsd])
123 fi
124
125 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
126
127 PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no)
128
129 if test "x$HAVE_GEOCLUE" = "xyes"; then
130  AC_DEFINE(WITH_GEOCLUE, 1, [build with Geoclue])
131  AC_SUBST(GEOCLUE_CFLAGS)
132  AC_SUBST(GEOCLUE_LIBS)
133 fi
134
135 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
136 AC_SUBST(GNOME_VFS_LIBS)
137 AC_SUBST(GNOME_VFS_CFLAGS)
138
139 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
140 AC_SUBST(LIBXML2_LIBS)
141 AC_SUBST(LIBXML2_CFLAGS)
142
143 PKG_CHECK_MODULES(LIBCURL, libcurl)
144 AC_SUBST(LIBCURL_LIBS)
145 AC_SUBST(LIBCURL_CFLAGS)
146
147 PKG_CHECK_MODULES(SQLITE, sqlite3)
148 AC_SUBST(SQLITE_LIBS)
149 AC_SUBST(SQLITE_CFLAGS)
150
151 PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10, HAVE_GST=yes, HAVE_GST=no)
152 if test "x$HAVE_GST" = "xyes"; then
153  AC_DEFINE(WITH_GST, 1, [build with Gstreamer])
154  GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstapp-0.10"
155  AC_SUBST(GSTREAMER_LIBS)
156  AC_SUBST(GSTREAMER_CFLAGS)
157 fi
158
159 # XXX: Check for expat
160 AC_CHECK_HEADER(expat.h)
161 EXPAT_LIBS="-lexpat"
162 EXPAT_CFLAGS="-I/usr/include"
163 AC_SUBST(EXPAT_CFLAGS)
164 AC_SUBST(EXPAT_LIBS)
165
166 AC_CHECK_LIB([expat], [XML_ParserCreate],
167   AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
168   AC_SUBST(EXPAT_LIB)
169 )
170
171 AC_CHECK_HEADER(espeak/speak_lib.h)
172 ESPEAK_LIBS="-lespeak"
173 ESPEAK_CFLAGS="-I/usr/include/espeak"
174 AC_CHECK_LIB([espeak], [espeak_Initialize],
175   AC_DEFINE(WITH_ESPEAK, 1, [Defined if you have espeak])
176   AC_SUBST(ESPEAK_CFLAGS)
177   AC_SUBST(ESPEAK_LIBS)
178 )
179
180 # Localisation
181 if test "x$HAVE_HILDON" = "xyes"; then
182  localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
183 else
184  localedir=
185 fi
186 AC_PROG_INTLTOOL([0.23])
187 GETTEXT_PACKAGE=$PACKAGE
188 AC_SUBST(GETTEXT_PACKAGE)
189 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "${GETTEXT_PACKAGE}", [Name of gettext package])
190 ALL_LINGUAS="en_US en_GB nl_NL it_IT bg_BG fi_FI"
191 AM_GLIB_GNU_GETTEXT
192
193 if test "x$HAVE_HILDON" = "xyes"; then
194 # To make application visible in maemo Task Navigator it needs a Desktop
195 # file for the application.
196 # D-BUS service file is needed to be able to launch the maemo application
197 # and connect it to D-BUS services.
198 # The following line defines install directories for these files.
199  desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
200  serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`
201
202 # Application pixmaps install directory
203  pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
204
205 # Help file install directory
206  helpfile_engbdir=$datadir/osso-help/en_US
207
208 # Hildon control panel plugin install directories
209  pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
210  plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
211
212 else
213  desktopentrydir=
214  serviceentrydir=
215  pixmapdir=
216  pluginlibdir=
217  plugindesktopentrydir=
218 fi
219
220 # Application icon install directories
221 icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
222 icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
223 icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
224 icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
225 icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
226
227 # Help file install directory
228 helpfile_enusdir=$datadir/osso-help/en_US
229 AC_SUBST(helpfile_enusdir)
230 helpfile_engbdir=$datadir/osso-help/en_GB
231 AC_SUBST(helpfile_engbdir)
232
233 # Define as variables in Makefiles
234 AC_SUBST(desktopentrydir)
235 AC_SUBST(serviceentrydir)
236 AC_SUBST(localedir)
237 AC_SUBST(pixmapdir)
238 AC_SUBST(icon_26x26dir)
239 AC_SUBST(icon_34x34dir)
240 AC_SUBST(icon_40x40dir)
241 AC_SUBST(icon_50x50dir)
242 AC_SUBST(icon_scalabledir)
243 AC_SUBST(pluginlibdir)
244 AC_SUBST(plugindesktopentrydir)
245
246 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
247 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
248
249 # Produce output files
250 AC_OUTPUT(
251           Makefile \
252           src/Makefile \
253           data/Makefile \
254           data/help/Makefile \
255           po/Makefile.in \
256           po/Makefile
257 )
258
259 echo "Hildon:   ${enable_hildon}"
260 echo "770/N800: ${enable_770}"
261