]> err.no Git - mapper/blob - configure.ac
Merge branch 'master' of git+ssh://tal.org/home/git/mapper
[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
24 AC_PROG_CPP
25 AC_CONFIG_HEADERS(src/config.h)
26 AC_PROG_INSTALL
27 AC_PROG_LIBTOOL
28
29 dnl Debugging options to enable debug macros
30 DEBUG_FLAGS=
31 AC_ARG_ENABLE(debug,     [  --enable-debug                compile with DEBUG],,enable_debug=no)
32
33 if test "x$enable_debug" = "xyes"; then
34     DEBUG_FLAGS="$DEBUG_FLAGS -DDEBUG -g -fno-omit-frame-pointer"
35 else
36     DEBUG_FLAGS="$DEBUG_FLAGS -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT"
37 fi
38
39 CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall -Wmissing-prototypes -Wmissing-declarations"
40
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)
44
45 dnl Ckeck for hildon-libs
46 PKG_CHECK_MODULES(HILDON, hildon-libs libosso, HAVE_HILDON=yes, HAVE_HILDON=no)
47
48 if test "x$HAVE_HILDON" = "xyes"; then
49   AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
50 else
51   AC_MSG_RESULT(no)
52 fi
53
54 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
55
56 dnl make HILDON_CFLAGS and HILDON_LIBS available
57 if test "x$HAVE_HILDON" = "xyes"; then
58  AC_SUBST(HILDON_CFLAGS)
59  AC_SUBST(HILDON_LIBS)
60
61  PKG_CHECK_MODULES(OSSO, libosso >= 1 libossohelp osso-ic)
62  AC_SUBST(OSSO_LIBS)
63  AC_SUBST(OSSO_CFLAGS)
64
65  PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.9.50 hildon-fm)
66  AC_SUBST(HILDON_LIBS)
67  AC_SUBST(HILDON_CFLAGS)
68 fi
69
70 PKG_CHECK_MODULES(BLUEZ, bluez)
71 AC_SUBST(BLUEZ_LIBS)
72 AC_SUBST(BLUEZ_CFLAGS)
73
74 AC_CHECK_HEADERS([gps.h], [ac_cv_gps_h=yes])
75 AC_CHECK_LIB(gps, gps_open,[ac_cv_libgps=yes] )
76 if test "x$ac_cv_libgps" != xyes; then
77         AC_DEFINE(WITH_LIBGPS, 1, [build with gpsd])
78 fi
79
80 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
81
82 PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no)
83
84 if test "x$HAVE_GEOCLUE" = "xyes"; then
85  AC_DEFINE(WITH_GEOCLUE, 1, [build with Geoclue])
86  AC_SUBST(GEOCLUE_CFLAGS)
87  AC_SUBST(GEOCLUE_LIBS)
88 fi
89
90 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
91 AC_SUBST(GNOME_VFS_LIBS)
92 AC_SUBST(GNOME_VFS_CFLAGS)
93
94 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
95 AC_SUBST(LIBXML2_LIBS)
96 AC_SUBST(LIBXML2_CFLAGS)
97
98 PKG_CHECK_MODULES(LIBCURL, libcurl)
99 AC_SUBST(LIBCURL_LIBS)
100 AC_SUBST(LIBCURL_CFLAGS)
101
102 PKG_CHECK_MODULES(SQLITE, sqlite3)
103 AC_SUBST(SQLITE_LIBS)
104 AC_SUBST(SQLITE_CFLAGS)
105
106 PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10, HAVE_GST=yes, HAVE_GST=no)
107 if test "x$HAVE_GST" = "xyes"; then
108  AC_DEFINE(WITH_GST, 1, [build with Gstreamer])
109  AC_SUBST(GSTREAMER_LIBS)
110  AC_SUBST(GSTREAMER_CFLAGS)
111 fi
112
113 # XXX: Check for expat
114 AC_CHECK_HEADER(expat.h)
115 EXPAT_LIBS="-lexpat"
116 EXPAT_CFLAGS="-I/usr/include"
117 AC_SUBST(EXPAT_CFLAGS)
118 AC_SUBST(EXPAT_LIBS)
119
120 AC_CHECK_LIB([expat], [XML_ParserCreate],
121   AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
122   AC_SUBST(EXPAT_LIB)
123 )
124
125 AC_CHECK_HEADER(espeak/speak_lib.h)
126 ESPEAK_LIBS="-lespeak"
127 ESPEAK_CFLAGS="-I/usr/include/espeak"
128 AC_CHECK_LIB([espeak], [espeak_Initialize],
129   AC_DEFINE(HAVE_ESPEAK, 1, [Defined if you have espeak])
130   AC_SUBST(ESPEAK_CFLAGS)
131   AC_SUBST(ESPEAK_LIB)
132 )
133
134 # Localisation
135 if test "x$HAVE_HILDON" = "xyes"; then
136  localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
137 else
138  localedir=
139 fi
140 AC_PROG_INTLTOOL([0.23])
141 GETTEXT_PACKAGE=$PACKAGE
142 AC_SUBST(GETTEXT_PACKAGE)
143 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "${GETTEXT_PACKAGE}", [Name of gettext package])
144 ALL_LINGUAS="en_US en_GB nl_NL it_IT bg_BG fi_FI"
145 AM_GLIB_GNU_GETTEXT
146
147 if test "x$HAVE_HILDON" = "xyes"; then
148 # To make application visible in maemo Task Navigator it needs a Desktop
149 # file for the application.
150 # D-BUS service file is needed to be able to launch the maemo application
151 # and connect it to D-BUS services.
152 # The following line defines install directories for these files.
153  desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
154  serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`
155
156 # Application pixmaps install directory
157  pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
158
159 # Help file install directory
160  helpfile_engbdir=$datadir/osso-help/en_US
161
162 # Hildon control panel plugin install directories
163  pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
164  plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
165
166 else
167  desktopentrydir=
168  serviceentrydir=
169  pixmapdir=
170  pluginlibdir=
171  plugindesktopentrydir=
172 fi
173
174 # Application icon install directories
175 icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
176 icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
177 icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
178 icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
179 icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
180
181 # Help file install directory
182 helpfile_enusdir=$datadir/osso-help/en_US
183 AC_SUBST(helpfile_enusdir)
184 helpfile_engbdir=$datadir/osso-help/en_GB
185 AC_SUBST(helpfile_engbdir)
186
187 # Define as variables in Makefiles
188 AC_SUBST(desktopentrydir)
189 AC_SUBST(serviceentrydir)
190 AC_SUBST(localedir)
191 AC_SUBST(pixmapdir)
192 AC_SUBST(icon_26x26dir)
193 AC_SUBST(icon_34x34dir)
194 AC_SUBST(icon_40x40dir)
195 AC_SUBST(icon_50x50dir)
196 AC_SUBST(icon_scalabledir)
197 AC_SUBST(pluginlibdir)
198 AC_SUBST(plugindesktopentrydir)
199
200 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
201 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
202
203 # Produce output files
204 AC_OUTPUT(
205           Makefile \
206           src/Makefile \
207           data/Makefile \
208           data/help/Makefile \
209           po/Makefile.in \
210           po/Makefile
211 )
212