]> err.no Git - mapper/blob - configure.ac
50c51b96095cf1ca652b12811e09f5f4e0b84cff
[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, 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 dnl make HILDON_CFLAGS and HILDON_LIBS available
55 if test "x$HAVE_HILDON" = "xyes"; then
56  AC_SUBST(HILDON_CFLAGS)
57  AC_SUBST(HILDON_LIBS)
58
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])
62   AC_SUBST(OSSO_LIBS)
63   AC_SUBST(OSSO_CFLAGS)
64  else
65   AC_MSG_RESULT(no)
66  fi
67
68  PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.9.50 hildon-fm)
69  AC_SUBST(HILDON_LIBS)
70  AC_SUBST(HILDON_CFLAGS)
71 fi
72
73 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
74 AM_CONDITIONAL(WITH_OSSO, test "x$HAVE_OSSO" = "xyes")
75
76 PKG_CHECK_MODULES(BLUEZ, bluez)
77 AC_SUBST(BLUEZ_LIBS)
78 AC_SUBST(BLUEZ_CFLAGS)
79
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])
84 fi
85
86 AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
87
88 PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no)
89
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)
94 fi
95
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)
99
100 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
101 AC_SUBST(LIBXML2_LIBS)
102 AC_SUBST(LIBXML2_CFLAGS)
103
104 PKG_CHECK_MODULES(LIBCURL, libcurl)
105 AC_SUBST(LIBCURL_LIBS)
106 AC_SUBST(LIBCURL_CFLAGS)
107
108 PKG_CHECK_MODULES(SQLITE, sqlite3)
109 AC_SUBST(SQLITE_LIBS)
110 AC_SUBST(SQLITE_CFLAGS)
111
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)
117 fi
118
119 # XXX: Check for expat
120 AC_CHECK_HEADER(expat.h)
121 EXPAT_LIBS="-lexpat"
122 EXPAT_CFLAGS="-I/usr/include"
123 AC_SUBST(EXPAT_CFLAGS)
124 AC_SUBST(EXPAT_LIBS)
125
126 AC_CHECK_LIB([expat], [XML_ParserCreate],
127   AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
128   AC_SUBST(EXPAT_LIB)
129 )
130
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)
137   AC_SUBST(ESPEAK_LIB)
138 )
139
140 # Localisation
141 if test "x$HAVE_HILDON" = "xyes"; then
142  localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
143 else
144  localedir=
145 fi
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"
151 AM_GLIB_GNU_GETTEXT
152
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`
161
162 # Application pixmaps install directory
163  pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
164
165 # Help file install directory
166  helpfile_engbdir=$datadir/osso-help/en_US
167
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`
171
172 else
173  desktopentrydir=
174  serviceentrydir=
175  pixmapdir=
176  pluginlibdir=
177  plugindesktopentrydir=
178 fi
179
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
186
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)
192
193 # Define as variables in Makefiles
194 AC_SUBST(desktopentrydir)
195 AC_SUBST(serviceentrydir)
196 AC_SUBST(localedir)
197 AC_SUBST(pixmapdir)
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)
205
206 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
207 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
208
209 # Produce output files
210 AC_OUTPUT(
211           Makefile \
212           src/Makefile \
213           data/Makefile \
214           data/help/Makefile \
215           po/Makefile.in \
216           po/Makefile
217 )
218