]> git.street.me.uk Git - andy/viking.git/blame_incremental - configure.ac
Sometimes gnome-autogen.sh does not support the most recent automake versions.
[andy/viking.git] / configure.ac
... / ...
CommitLineData
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT(viking, 1.5, , viking, http://viking.sf.net/)
6AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
7dnl AC_CONFIG_SRCDIR([src/main.c])
8AC_CONFIG_HEADERS([src/config.h])
9GTK_DOC_CHECK(1.0)
10
11AC_PROG_CC_STDC
12# Checks for programs.
13AC_PROG_CC
14AC_PROG_MAKE_SET
15AC_PROG_RANLIB
16AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
17
18# I18N
19GETTEXT_PACKAGE=viking
20AC_SUBST(GETTEXT_PACKAGE)
21AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
22
23AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
24
25AM_GNU_GETTEXT_VERSION([0.17])
26AM_GNU_GETTEXT([external])
27
28IT_PROG_INTLTOOL([0.35.0])
29
30AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
31
32dnl This will cause the automake generated makefiles to pass the
33dnl correct flags to aclocal.
34ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
35AC_SUBST(ACLOCAL_AMFLAGS)
36
37# Checks for header files.
38AC_HEADER_STDC
39AC_CHECK_HEADERS([malloc.h stdlib.h string.h sys/param.h sys/types.h unistd.h math.h utime.h X11/Xlib.h])
40
41# Checks for typedefs, structures, and compiler characteristics.
42AC_C_CONST
43AC_TYPE_MODE_T
44
45# Checks for library functions or symbols
46AC_FUNC_STAT
47AC_FUNC_STRTOD
48AC_CHECK_FUNCS([floor memset mkdtemp pow realpath sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
49AC_CHECK_LIB(m, tan)
50AC_CHECK_LIB(z, inflate)
51AC_CHECK_LIB(X11, XSetErrorHandler)
52
53# Expat
54AM_WITH_EXPAT
55
56# Curl
57LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
58
59# gdk-pixbuf-csource
60AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
61if test "x$GDK_PIXBUF_CSOURCE" != "xyes"
62then
63 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
64fi
65
66dnl ------------------
67dnl | Pkgconfig checks |---------------------------------------
68dnl ------------------
69
70PKG_CHECK_MODULES(PACKAGE, [
71 glib-2.0 >= 2.16
72 gthread-2.0 >= 2.2
73 gtk+-2.0 >= 2.16
74 gio-2.0 >= 2.12
75])
76
77AC_SUBST(PACKAGE_CFLAGS)
78AC_SUBST(PACKAGE_LIBS)
79
80dnl -------------
81dnl | User Manual |---------------------------------------
82dnl -------------
83GNOME_DOC_INIT
84
85dnl ---------------------------------------------------------------------------
86dnl - Use deprecated options (default enabled for devs, disabled in releases)
87dnl ---------------------------------------------------------------------------
88
89AC_ARG_ENABLE(deprecations,
90 [AC_HELP_STRING([--enable-deprecations],
91 [warn about deprecated usages [default=no]])],
92 [ac_cv_enable_deprecations=$enableval],
93 [ac_cv_enable_deprecations=no])
94AC_CACHE_CHECK([whether to enable deprecated features],
95 [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
96
97if test "x$ac_cv_enable_deprecations" = "xyes"; then
98 DISABLE_DEPRECATED_CFLAGS="\
99-DG_DISABLE_SINGLE_INCLUDES \
100-DGSEAL_ENABLE \
101-DG_DISABLE_DEPRECATED \
102-DGDK_DISABLE_DEPRECATED \
103-DGDK_PIXBUF_DISABLE_DEPRECATED \
104-DGTK_DISABLE_SINGLE_INCLUDES \
105-DGTK_DISABLE_DEPRECATED"
106 CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
107fi
108
109# Options
110AC_ARG_ENABLE(bing, AC_HELP_STRING([--enable-bing],
111 [enable Bing stuff (default is enable)]),
112 [ac_cv_enable_bing=$enableval],
113 [ac_cv_enable_bing=yes])
114AC_CACHE_CHECK([whether to enable Bing stuff],
115 [ac_cv_enable_bing], [ac_cv_enable_bing=yes])
116case $ac_cv_enable_bing in
117 yes)
118 AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
119 ;;
120esac
121AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
122
123AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
124 [enable Google stuff (default is enable)]),
125 [ac_cv_enable_google=$enableval],
126 [ac_cv_enable_google=yes])
127AC_CACHE_CHECK([whether to enable Google stuff],
128 [ac_cv_enable_google], [ac_cv_enable_google=yes])
129case $ac_cv_enable_google in
130 yes)
131 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
132 ;;
133esac
134AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
135
136AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
137 [enable Terraserver stuff (default is enable)]),
138 [ac_cv_enable_terraserver=$enableval],
139 [ac_cv_enable_terraserver=yes])
140AC_CACHE_CHECK([whether to enable Terraserver stuff],
141 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
142case $ac_cv_enable_terraserver in
143 yes)
144 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
145 ;;
146esac
147AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
148
149AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
150 [enable Expedia stuff (default is disable)]),
151 [ac_cv_enable_expedia=$enableval],
152 [ac_cv_enable_expedia=no])
153AC_CACHE_CHECK([whether to enable Expedia stuff],
154 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
155case $ac_cv_enable_expedia in
156 yes)
157 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
158 ;;
159esac
160AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
161
162# OpenStreetMap http://www.openstreetmap.org/
163AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
164 [enable OpenStreetMap stuff (default is enable)]),
165 [ac_cv_enable_openstreetmap=$enableval],
166 [ac_cv_enable_openstreetmap=yes])
167AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
168 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
169case $ac_cv_enable_openstreetmap in
170 yes)
171 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
172 ;;
173esac
174AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
175
176# BlueMarble
177AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
178 [enable BlueMarble stuff (default is enable)]),
179 [ac_cv_enable_bluemarble=$enableval],
180 [ac_cv_enable_bluemarble=yes])
181AC_CACHE_CHECK([whether to enable BlueMarble stuff],
182 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
183case $ac_cv_enable_bluemarble in
184 yes)
185 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
186 ;;
187esac
188AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
189
190# GeoNames http://www.geonames.org/
191AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
192 [enable Geonames stuff (default is enable)]),
193 [ac_cv_enable_geonames=$enableval],
194 [ac_cv_enable_geonames=yes])
195AC_CACHE_CHECK([whether to enable Geonames stuff],
196 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
197case $ac_cv_enable_geonames in
198 yes)
199 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
200 ;;
201esac
202AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
203
204AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
205 [enable Geocaches Acquire (default is disable).]),
206 [ac_cv_enable_geocaches=$enableval],
207 [ac_cv_enable_geocaches=no])
208AC_CACHE_CHECK([whether to enable Geocaches Acquire],
209 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
210case $ac_cv_enable_geocaches in
211 yes)
212 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
213 ;;
214esac
215AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
216
217AC_ARG_ENABLE(geotag, AC_HELP_STRING([--enable-geotag],
218 [enable Geotag Support (default is enable).]),
219 [ac_cv_enable_geotag=$enableval],
220 [ac_cv_enable_geotag=yes])
221AC_CACHE_CHECK([whether to enable Geotag Support],
222 [ac_cv_enable_geotag], [ac_cv_enable_geotag=yes])
223case $ac_cv_enable_geotag in
224 yes)
225 AC_CHECK_LIB(exif,exif_loader_new,,AC_MSG_ERROR([libexif is needed for Geotag features[,] but is not found. The feature can be disabled with --disable-geotag]))
226 AC_DEFINE(VIK_CONFIG_GEOTAG, [], [GEOTAG STUFF])
227 ;;
228esac
229AM_CONDITIONAL([GEOTAG], [test x$ac_cv_enable_geotag = xyes])
230
231AC_ARG_ENABLE(spotmaps, AC_HELP_STRING([--enable-spotmaps],
232 [enable SPOTMaps map (default is enable).]),
233 [ac_cv_enable_spotmaps=$enableval],
234 [ac_cv_enable_spotmaps=yes])
235AC_CACHE_CHECK([whether to enable SPOTMaps map],
236 [ac_cv_enable_spotmaps], [ac_cv_enable_spotmaps=yes])
237case $ac_cv_enable_spotmaps in
238 yes)
239 AC_DEFINE(VIK_CONFIG_SPOTMAPS, [], [SPOTMAPS STUFF])
240 ;;
241esac
242AM_CONDITIONAL([SPOTMAPS], [test x$ac_cv_enable_spotmaps = xyes])
243
244
245AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
246 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
247 [ac_cv_enable_dem24k=$enableval],
248 [ac_cv_enable_dem24k=no])
249AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
250 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
251case $ac_cv_enable_dem24k in
252 yes)
253 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
254 ;;
255esac
256AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
257
258# Realtime GPS tracking
259AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
260 [enable realtime GPS tracking (default is enable)]),
261 [ac_cv_enable_realtimegpstracking=$enableval],
262 [ac_cv_enable_realtimegpstracking=yes])
263AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
264 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
265case $ac_cv_enable_realtimegpstracking in
266 yes)
267 AC_CHECK_LIB(gps,gps_close,,AC_MSG_ERROR([libgps is needed for Realtime GPS Tracking feature[,] but not found. The feature can be disable with --disable-realtime-gps-tracking]))
268 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
269 ;;
270esac
271AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
272
273# BZIP2
274AC_ARG_ENABLE(bz2, AC_HELP_STRING([--enable-bzip2],
275 [enable bzip2 Support (default is enable).]),
276 [ac_cv_enable_bzip2=$enableval],
277 [ac_cv_enable_bzip2=yes])
278AC_CACHE_CHECK([whether to enable bzip2 Support],
279 [ac_cv_enable_bzip2], [ac_cv_enable_bzip2=yes])
280case $ac_cv_enable_bzip2 in
281 yes)
282 AC_CHECK_HEADERS([bzlib.h],[],[AC_MSG_ERROR([bzlib.h is needed but not found - you will need to install package 'libbz2-dev' or similar. The feature can be disabled with --disable-bzip2])])
283 AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffDecompress, [], [AC_MSG_ERROR([libbz2 is needed but not found.])])
284 ;;
285esac
286AM_CONDITIONAL([BZIP2], [test x$ac_cv_enable_bzip2 = xyes])
287
288# FILE MAGIC
289AC_ARG_ENABLE(magic, AC_HELP_STRING([--enable-magic],
290 [enable File Magic support via libmagic (default is enable).]),
291 [ac_cv_enable_magic=$enableval],
292 [ac_cv_enable_magic=yes])
293AC_CACHE_CHECK([whether to enable Magic Support],
294 [ac_cv_enable_magic], [ac_cv_enable_magic=yes])
295case $ac_cv_enable_magic in
296 yes)
297 AC_CHECK_HEADERS([magic.h],[],[AC_MSG_ERROR([magic.h is needed but not found - you will need to install package 'libmagic-dev' or similar. The feature can be disabled with --disable-magic])])
298 AC_CHECK_LIB(magic, magic_open, [], [AC_MSG_ERROR([libmagic is needed but not found.])])
299 ;;
300esac
301AM_CONDITIONAL([MAGIC], [test x$ac_cv_enable_magic = xyes])
302
303# SQL for MBTiles
304AC_ARG_ENABLE(mbtiles, AC_HELP_STRING([--enable-mbtiles],
305 [enable MBTiles support via libsqlite3 (default is enable).]),
306 [ac_cv_enable_mbtiles=$enableval],
307 [ac_cv_enable_mbtiles=yes])
308AC_CACHE_CHECK([whether to enable MBTiles Support],
309 [ac_cv_enable_mbtiles], [ac_cv_enable_mbtiles=yes])
310case $ac_cv_enable_mbtiles in
311 yes)
312 AC_CHECK_HEADERS([sqlite3.h],[],[AC_MSG_ERROR([sqlite3.h is needed but not found - you will need to install package 'libsqlite3-dev' or similar. The feature can be disabled with --disable-mbtiles])])
313 AC_CHECK_LIB(sqlite3, sqlite3_open, [], [AC_MSG_ERROR([libsqlite3 is needed but not found.])])
314 ;;
315esac
316AM_CONDITIONAL([SQLITE], [test x$ac_cv_enable_mbtiles = xyes])
317
318###
319
320AC_ARG_WITH(search,
321 [AC_HELP_STRING([--with-search],
322 [specify google or geonames for searching (default is google)])],
323 [case "x$withval" in
324 "xgoogle")
325 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
326 ;;
327 "xgeonames")
328 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
329 ;;
330 *)
331 AC_MSG_ERROR([Please, set a value for search method])
332 esac],
333 [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
334AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
335 [Id. for searching via GOOGLE])
336AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
337 [Id. for searching via GEONAMES])
338AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
339 [Method for the search])
340
341
342AC_ARG_WITH(mapcache,
343 [AC_HELP_STRING([--with-mapcache],
344 [specify the size of the map cache in MB (default is 128)])],
345 [if test "x$withval" = "xno"; then
346 VIK_CONFIG_MAPCACHE_SIZE=0;
347 elif test "x$withval" = "xyes"; then
348 AC_MSG_ERROR([Please, set a value for size of the map cache in MB])
349 else
350 VIK_CONFIG_MAPCACHE_SIZE=${withval}
351 fi],
352 [VIK_CONFIG_MAPCACHE_SIZE=128])
353AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
354 [Size of the map cache])
355
356
357AC_ARG_WITH(tileage,
358 [AC_HELP_STRING([--with-tileage],
359 [specify the age of a tile before checking it (default is 7 days)])],
360 [if test "x$withval" = "xno"; then
361 VIK_CONFIG_DEFAULT_TILE_AGE=0;
362 elif test "x$withval" = "xyes"; then
363 AC_MSG_ERROR([Please, set a value for age of tiles])
364 else
365 VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
366 fi],
367 [VIK_CONFIG_DEFAULT_TILE_AGE=604800])
368AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
369 [Age of tiles before checking it (in seconds)])
370
371dnl man pages processing
372DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
373AC_SUBST(DB2MAN_XSL)
374AC_PATH_PROG(XP,xsltproc)
375AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
376AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
377
378dnl This will cause the automake generated makefiles to pass the
379dnl correct flags to aclocal.
380ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
381AC_SUBST(ACLOCAL_AMFLAGS)
382
383AM_CONDITIONAL([VIKING_DOC], test x${enable_gtk_doc} = xyes)
384
385# Configuration
386AC_CONFIG_FILES([
387 Makefile
388 src/Makefile
389 src/icons/Makefile
390 po/Makefile.in
391 data/Makefile
392 test/Makefile
393 help/Makefile
394 win32/Makefile
395 win32/installer/Makefile
396 win32/installer/pixmaps/Makefile
397 win32/installer/translations/Makefile])
398AM_COND_IF([VIKING_DOC],
399 [AC_CONFIG_FILES([
400 doc/Makefile
401 doc/reference/Makefile
402 doc/examples/Makefile])])
403
404AC_OUTPUT([
405 viking.spec
406 ])
407
408dnl Output the configuration summary
409echo ""
410echo "==========================================="
411echo "$PACKAGE $VERSION"
412echo "-------------------------------------------"
413echo "Bing Maps : $ac_cv_enable_bing"
414echo "Google : $ac_cv_enable_google"
415echo "Terraserver Maps : $ac_cv_enable_terraserver"
416echo "Expedia Maps : $ac_cv_enable_expedia"
417echo "Open Street Map : $ac_cv_enable_openstreetmap"
418echo "BlueMarble : $ac_cv_enable_bluemarble"
419echo "SPOTMaps : $ac_cv_enable_spotmaps"
420echo "Geonames : $ac_cv_enable_geonames"
421echo "Geocaches Acquire : $ac_cv_enable_geocaches"
422echo "Geotag Support : $ac_cv_enable_geotag"
423echo "USGS 24k DEM : $ac_cv_enable_dem24k"
424echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
425echo "bzip2 Support : $ac_cv_enable_bzip2"
426echo "File Magic Support : $ac_cv_enable_magic"
427echo "MBTiles Support (SQLite3) : $ac_cv_enable_mbtiles"
428echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
429echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
430echo "Documentation (+HTML) : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})"
431echo "-------------------------------------------"
432echo ""
433echo "Configure finished, type 'make' to build."
434