]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
[DOC] Mention map tilesize configuration.
[andy/viking.git] / configure.ac
CommitLineData
9903c388
EB
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
e817bcf6 4AC_PREREQ(2.64)
51d6704c 5AC_INIT(viking, 1.6.1, , viking, http://viking.sf.net/)
0edf62b8
RN
6
7AC_CANONICAL_HOST
8AC_CANONICAL_TARGET
9
5b65af92 10AM_INIT_AUTOMAKE([dist-bzip2 dist-zip subdir-objects])
9903c388 11dnl AC_CONFIG_SRCDIR([src/main.c])
8fe95819 12AC_CONFIG_HEADERS([src/config.h])
306ab474
GB
13
14# check for gtk-doc
15m4_ifdef([GTK_DOC_CHECK], [
16GTK_DOC_CHECK([1.0],[--flavour no-tmpl])
17],[
18AM_CONDITIONAL([ENABLE_GTK_DOC], false)
19])
9903c388 20
d605e023 21AC_PROG_CC
dbebd375 22AC_PROG_CC_STDC
9903c388 23# Checks for programs.
9903c388 24AC_PROG_MAKE_SET
b6e6dfbd 25AC_PROG_RANLIB
8f661d80 26AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
9903c388 27
0edf62b8
RN
28ac_mingw32=no
29case $target_os in
30 *mingw32*)
31 ac_mingw32=yes
32 ;;
33 *)
34 ;;
35esac
36
a5daec1c
GB
37# I18N
38GETTEXT_PACKAGE=viking
39AC_SUBST(GETTEXT_PACKAGE)
40AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
41
42AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
43
316407e2
GB
44AM_GNU_GETTEXT_VERSION([0.17])
45AM_GNU_GETTEXT([external])
46
d44b1562 47IT_PROG_INTLTOOL([0.35.0])
a5daec1c
GB
48
49AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
50
51dnl This will cause the automake generated makefiles to pass the
52dnl correct flags to aclocal.
53ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
54AC_SUBST(ACLOCAL_AMFLAGS)
55
9903c388
EB
56# Checks for header files.
57AC_HEADER_STDC
db7fa5f6 58AC_CHECK_HEADERS([malloc.h stdlib.h string.h sys/param.h sys/types.h unistd.h math.h utime.h X11/Xlib.h])
9903c388
EB
59
60# Checks for typedefs, structures, and compiler characteristics.
61AC_C_CONST
62AC_TYPE_MODE_T
63
fa3eb9d6 64# Checks for library functions or symbols
c72092ea 65AC_CHECK_FUNCS([floor memset mkdtemp pow realpath sqrt strcasecmp strchr strncasecmp strtol strtoul])
fabfa349
JB
66AC_CHECK_LIB(m, tan)
67AC_CHECK_LIB(z, inflate)
fa3eb9d6 68AC_CHECK_LIB(X11, XSetErrorHandler)
9903c388 69
d07deb3f
RN
70# ATM not running automake under Windows
71#AC_CHECK_PROG(USE_WINDOWS, cmd.exe, yes, no)
72#AM_CONDITIONAL([WINDOWS], [test x$USE_WINDOWS = xyes])
73# So pass in as an option instead
74# This is only to perform slightly different build steps
75# (the code uses standard WINDOWS defines for any specific different behaviour)
76AC_ARG_ENABLE(windows, AC_HELP_STRING([--enable-windows],
77 [Perform specific Windows build steps (default is no)]),
78 [ac_cv_enable_windows=$enableval],
79 [ac_cv_enable_windows=no])
80AC_CACHE_CHECK([whether to enable Windows build steps],
81 [ac_cv_enable_windows], [ac_cv_enable_windows=no])
82AM_CONDITIONAL([WINDOWS], [test x$ac_cv_enable_windows = xyes])
83
dad55b79 84# Expat
fa1b5a5f
GB
85AM_WITH_EXPAT
86
3292ba8b 87# Curl
f901dcdf 88LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
3292ba8b 89
bf0922c7 90# gdk-pixbuf-csource
fa1b5a5f 91AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
4dc7f2cc 92if test "x$GDK_PIXBUF_CSOURCE" != "xyes"
fa1b5a5f
GB
93then
94 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
95fi
96
bf0922c7
GB
97dnl ------------------
98dnl | Pkgconfig checks |---------------------------------------
99dnl ------------------
100
101PKG_CHECK_MODULES(PACKAGE, [
e817bcf6 102 glib-2.0 >= 2.26
bf0922c7 103 gthread-2.0 >= 2.2
90ba111c 104 gtk+-2.0 >= 2.16
314084b8 105 gio-2.0 >= 2.12
bf0922c7
GB
106])
107
108AC_SUBST(PACKAGE_CFLAGS)
109AC_SUBST(PACKAGE_LIBS)
110
f8b8a0b5
GB
111dnl -------------
112dnl | User Manual |---------------------------------------
113dnl -------------
114GNOME_DOC_INIT
dad55b79 115
bca29d33
GB
116dnl ---------------------------------------------------------------------------
117dnl - Use deprecated options (default enabled for devs, disabled in releases)
118dnl ---------------------------------------------------------------------------
119
79452f0e
GB
120AC_ARG_ENABLE(deprecations,
121 [AC_HELP_STRING([--enable-deprecations],
bca29d33
GB
122 [warn about deprecated usages [default=no]])],
123 [ac_cv_enable_deprecations=$enableval],
124 [ac_cv_enable_deprecations=no])
125AC_CACHE_CHECK([whether to enable deprecated features],
126 [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
79452f0e 127
bca29d33 128if test "x$ac_cv_enable_deprecations" = "xyes"; then
79452f0e 129 DISABLE_DEPRECATED_CFLAGS="\
bca29d33
GB
130-DG_DISABLE_SINGLE_INCLUDES \
131-DGSEAL_ENABLE \
79452f0e
GB
132-DG_DISABLE_DEPRECATED \
133-DGDK_DISABLE_DEPRECATED \
bca29d33
GB
134-DGDK_PIXBUF_DISABLE_DEPRECATED \
135-DGTK_DISABLE_SINGLE_INCLUDES \
136-DGTK_DISABLE_DEPRECATED"
137 CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
79452f0e 138fi
dad55b79 139
734652bf 140# Options
9f58c4b4
GB
141AC_ARG_ENABLE(bing, AC_HELP_STRING([--enable-bing],
142 [enable Bing stuff (default is enable)]),
143 [ac_cv_enable_bing=$enableval],
144 [ac_cv_enable_bing=yes])
145AC_CACHE_CHECK([whether to enable Bing stuff],
146 [ac_cv_enable_bing], [ac_cv_enable_bing=yes])
147case $ac_cv_enable_bing in
148 yes)
149 AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
150 ;;
151esac
152AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
153
cdcaf41c 154AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
55340efa 155 [enable Google stuff (default is enable)]),
cdcaf41c
QT
156 [ac_cv_enable_google=$enableval],
157 [ac_cv_enable_google=yes])
158AC_CACHE_CHECK([whether to enable Google stuff],
159 [ac_cv_enable_google], [ac_cv_enable_google=yes])
160case $ac_cv_enable_google in
161 yes)
162 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
163 ;;
164esac
165AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
166
167AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
2a8ecaba 168 [enable Terraserver stuff (default is disabled as the tileserver is no longer available)]),
cdcaf41c 169 [ac_cv_enable_terraserver=$enableval],
2a8ecaba 170 [ac_cv_enable_terraserver=no])
cdcaf41c
QT
171AC_CACHE_CHECK([whether to enable Terraserver stuff],
172 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
173case $ac_cv_enable_terraserver in
174 yes)
175 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
176 ;;
177esac
178AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
179
180AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 181 [enable Expedia stuff (default is disable)]),
cdcaf41c 182 [ac_cv_enable_expedia=$enableval],
06f31fd5 183 [ac_cv_enable_expedia=no])
cdcaf41c
QT
184AC_CACHE_CHECK([whether to enable Expedia stuff],
185 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
186case $ac_cv_enable_expedia in
187 yes)
188 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
189 ;;
190esac
191AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
192
ca9eb04a
GB
193# OpenStreetMap http://www.openstreetmap.org/
194AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
195 [enable OpenStreetMap stuff (default is enable)]),
196 [ac_cv_enable_openstreetmap=$enableval],
197 [ac_cv_enable_openstreetmap=yes])
198AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
199 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
200case $ac_cv_enable_openstreetmap in
201 yes)
202 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
203 ;;
204esac
205AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
206
96c3f0d5
GB
207# BlueMarble
208AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
209 [enable BlueMarble stuff (default is enable)]),
210 [ac_cv_enable_bluemarble=$enableval],
211 [ac_cv_enable_bluemarble=yes])
212AC_CACHE_CHECK([whether to enable BlueMarble stuff],
213 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
214case $ac_cv_enable_bluemarble in
215 yes)
216 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
217 ;;
218esac
219AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
220
da03b29d
GB
221# GeoNames http://www.geonames.org/
222AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
223 [enable Geonames stuff (default is enable)]),
224 [ac_cv_enable_geonames=$enableval],
225 [ac_cv_enable_geonames=yes])
226AC_CACHE_CHECK([whether to enable Geonames stuff],
227 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
228case $ac_cv_enable_geonames in
229 yes)
230 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
231 ;;
232esac
233AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
234
1ef9e637 235AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
a0d39f7e 236 [enable Geocaches Acquire (default is disable).]),
1ef9e637
QT
237 [ac_cv_enable_geocaches=$enableval],
238 [ac_cv_enable_geocaches=no])
239AC_CACHE_CHECK([whether to enable Geocaches Acquire],
240 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
241case $ac_cv_enable_geocaches in
242 yes)
243 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
244 ;;
245esac
246AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
247
72bbd562
RN
248# Geotagging
249AC_ARG_WITH(libexif, AC_HELP_STRING([--with-libexif], [Force usage of libexif instead of libgexiv2]))
f75d0233
RN
250AC_ARG_ENABLE(geotag, AC_HELP_STRING([--enable-geotag],
251 [enable Geotag Support (default is enable).]),
252 [ac_cv_enable_geotag=$enableval],
253 [ac_cv_enable_geotag=yes])
254AC_CACHE_CHECK([whether to enable Geotag Support],
255 [ac_cv_enable_geotag], [ac_cv_enable_geotag=yes])
256case $ac_cv_enable_geotag in
257 yes)
72bbd562
RN
258 AS_IF([test x$with_libexif = xyes],
259 AC_CHECK_HEADER([libexif/exif-data.h],[],AC_MSG_ERROR([exif-data.h is needed but not found - you will need to install package 'libexif-dev' or similar]))
260 AC_CHECK_LIB(exif,exif_loader_new,, AC_MSG_ERROR([libexif is not found but it has been forcibly required])),
261 # gexiv2.h relies on glib so a simple compile check fails.
262 #AC_CHECK_HEADER([gexiv2/gexiv2.h],,AC_MSG_ERROR([Error msg...]))
263 AC_CHECK_LIB(gexiv2,gexiv2_metadata_new,, AC_MSG_ERROR([libgexiv2 is needed but not found - you will need to install package 'libgexiv2-dev' or similar. The feature can be disabled with --disable-geotag]))
264 )
f75d0233
RN
265 AC_DEFINE(VIK_CONFIG_GEOTAG, [], [GEOTAG STUFF])
266 ;;
267esac
268AM_CONDITIONAL([GEOTAG], [test x$ac_cv_enable_geotag = xyes])
72bbd562
RN
269AM_CONDITIONAL([GEXIV2], [test x$ac_cv_lib_gexiv2_gexiv2_metadata_new = xyes] )
270# Tested with gexiv2 0.10.2, but probably would work with older versions; may be all of them...
271#AM_COND_IF([GEXIV2], [PKG_CHECK_MODULES([GEXIV2], [gexiv2 >= 0.6.1])])
272AM_CONDITIONAL([LIBEXIF], [test x$ac_cv_lib_exif_exif_loader_new = xyes] )
f75d0233 273
8c721f83
EB
274AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
275 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
276 [ac_cv_enable_dem24k=$enableval],
277 [ac_cv_enable_dem24k=no])
278AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
279 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
280case $ac_cv_enable_dem24k in
281 yes)
282 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
283 ;;
284esac
285AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
286
001a86db
QT
287# Realtime GPS tracking
288AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
289 [enable realtime GPS tracking (default is enable)]),
290 [ac_cv_enable_realtimegpstracking=$enableval],
291 [ac_cv_enable_realtimegpstracking=yes])
292AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
293 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
294case $ac_cv_enable_realtimegpstracking in
295 yes)
975e9067 296 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]))
8956d2ef 297 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
001a86db
QT
298 ;;
299esac
300AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
301
a3697549 302# BZIP2
b1db5b51 303AC_ARG_ENABLE(bzip2, AC_HELP_STRING([--enable-bzip2],
a3697549
RN
304 [enable bzip2 Support (default is enable).]),
305 [ac_cv_enable_bzip2=$enableval],
306 [ac_cv_enable_bzip2=yes])
307AC_CACHE_CHECK([whether to enable bzip2 Support],
308 [ac_cv_enable_bzip2], [ac_cv_enable_bzip2=yes])
309case $ac_cv_enable_bzip2 in
310 yes)
311 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])])
0edf62b8
RN
312 if test "$ac_mingw32" = "yes"; then
313 # Using the cross compiler it bizarrely fails to detect BZ2_bzRead during the configure stage
314 # I SWEAR THIS WORKED AT SOME POINT - BUT ON A DIFFERENT DAY IT DOESN'T = MORE SWEARING
315 BZ2FUNC=main
316 AC_CHECK_LIB(bz2, [$BZ2FUNC], [], [LIBS="-lbz2 $LIBS"
317 AC_MSG_WARN([libbz2 not found! Forcing it anyway!])])
318 else
319 BZ2FUNC=BZ2_bzRead
320 AC_CHECK_LIB(bz2, [$BZ2FUNC], [], [AC_MSG_ERROR([libbz2 is needed but not found.])])
321 fi
a3697549
RN
322 ;;
323esac
324AM_CONDITIONAL([BZIP2], [test x$ac_cv_enable_bzip2 = xyes])
325
326# FILE MAGIC
327AC_ARG_ENABLE(magic, AC_HELP_STRING([--enable-magic],
328 [enable File Magic support via libmagic (default is enable).]),
329 [ac_cv_enable_magic=$enableval],
330 [ac_cv_enable_magic=yes])
331AC_CACHE_CHECK([whether to enable Magic Support],
332 [ac_cv_enable_magic], [ac_cv_enable_magic=yes])
333case $ac_cv_enable_magic in
334 yes)
335 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])])
336 AC_CHECK_LIB(magic, magic_open, [], [AC_MSG_ERROR([libmagic is needed but not found.])])
337 ;;
338esac
339AM_CONDITIONAL([MAGIC], [test x$ac_cv_enable_magic = xyes])
340
0fb11294
RN
341# SQL for MBTiles
342AC_ARG_ENABLE(mbtiles, AC_HELP_STRING([--enable-mbtiles],
343 [enable MBTiles support via libsqlite3 (default is enable).]),
344 [ac_cv_enable_mbtiles=$enableval],
345 [ac_cv_enable_mbtiles=yes])
346AC_CACHE_CHECK([whether to enable MBTiles Support],
347 [ac_cv_enable_mbtiles], [ac_cv_enable_mbtiles=yes])
348case $ac_cv_enable_mbtiles in
349 yes)
9324e651 350 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])])
0fb11294
RN
351 AC_CHECK_LIB(sqlite3, sqlite3_open, [], [AC_MSG_ERROR([libsqlite3 is needed but not found.])])
352 ;;
353esac
354AM_CONDITIONAL([SQLITE], [test x$ac_cv_enable_mbtiles = xyes])
355
49d43d14
RN
356# Standard compression is handled by libz
357# libzip enables a friendlier file based interface
358# libzip itself depends on libz (which is required in the Viking build ATM)
359# ZIP
360AC_ARG_ENABLE(zip, AC_HELP_STRING([--enable-zip],
361 [enable zip support (default is enable).]),
362 [ac_cv_enable_zip=$enableval],
363 [ac_cv_enable_zip=yes])
364AC_CACHE_CHECK([whether to enable zip Support],
365 [ac_cv_enable_zip], [ac_cv_enable_zip=yes])
366case $ac_cv_enable_zip in
367 yes)
368 # NB As far as I can tell libzip doesn't provide any versioning info within the header code itself
369 # Thus supporting old versions via simple #if #else #endif directives is seemingly not possible
370 # Resort to checking versioning only via pkgconfig
371 PKG_CHECK_MODULES([LIBZIP], [libzip >= 0.11],
ab922442 372 [ AC_CHECK_HEADERS([zip.h],[],[AC_MSG_ERROR([zip.h is needed but not found - you will need to install package 'libzip-dev' or similar. The feature can be disabled with --disable-zip])])
49d43d14
RN
373 AC_CHECK_LIB(zip, [main], [], [AC_MSG_ERROR([libzip is needed but not found.])]) ],
374 [ AC_MSG_WARN([libzip version needs to be at least 0.11, use of libzip is disabled])
375 ac_cv_enable_zip=no ]
376 )
377 ;;
378esac
379AM_CONDITIONAL([ZIP], [test x$ac_cv_enable_zip = xyes])
380
bd27baa4
RN
381# ATM only for MD5 Hashing which is currently only used for filename of image thumbnails
382AC_ARG_ENABLE(nettle, AC_HELP_STRING([--enable-nettle],
383 [enable MD5 Hash support (default is enable)]),
384 [ac_cv_enable_nettle=$enableval],
385 [ac_cv_enable_nettle=yes])
386AC_CACHE_CHECK([whether to enable MD5 Hash support],
387 [ac_cv_enable_nettle], [ac_cv_enable_nettle=yes])
388case $ac_cv_enable_nettle in
389 yes)
390 AC_CHECK_HEADER([nettle/md5-compat.h],[],[AC_MSG_ERROR([nettle/md5-compat.h is needed but not found - you will need to install package 'nettle-dev' or similar. The feature can be disabled with --disable-nettle])])
391 AC_CHECK_LIB([nettle], [main], [], [AC_MSG_ERROR([libnettle is needed but not found.])])
392 ;;
393esac
394AM_CONDITIONAL([MD5_HASH], [test x$ac_cv_enable_nettle = xyes])
395
5fa4fe86
RN
396# Mapnik rendering layer
397AC_ARG_ENABLE(mapnik, AC_HELP_STRING([--enable-mapnik],
398 [enable Mapnik (default is enable)]),
399 [ac_cv_enable_mapnik=$enableval],
400 [ac_cv_enable_mapnik=yes])
401AC_CACHE_CHECK([whether to enable Mapnik],
402 [ac_cv_enable_mapnik], [ac_cv_enable_mapnik=yes])
403case $ac_cv_enable_mapnik in
404 yes)
405 # C++
406 AC_LANG_CPLUSPLUS
407 AC_LANG_SAVE
408 AC_PROG_CXX
616812b7
RN
409 # Mapnik3 requires C++11. Viking will use C++11 as well.
410 CXXFLAGS="$CXXFLAGS -std=c++11"
5fa4fe86
RN
411 # Too difficult to get check working under Windows (extra dependencies needed probably Boost)- so just skip it
412 if test "x$ac_cv_enable_windows" = "xno"; then
413 AC_CHECK_HEADER([mapnik/map.hpp],[],[AC_MSG_ERROR([mapnik/map.hpp is needed but not found - you will need to install package 'libmapnik-dev' or similar. The feature can be disabled with --disable-mapnik])])
414 fi
415 AC_CHECK_LIB([mapnik], [main], [], [AC_MSG_ERROR([libmapnik is needed but not found.])])
416 AC_CHECK_LIB([stdc++], [main], [], [AC_MSG_ERROR([libstdc++ is needed but not found.])])
616812b7
RN
417 # Required for Mapnik3 build (it's also in Mapnik2 but does not need to be specified for some reason)
418 # it's part of libmapnik install dependencies
419 AC_CHECK_LIB([icuuc], [main], [], [AC_MSG_ERROR([libicuuc is needed but not found.])])
5fa4fe86
RN
420 AC_LANG_RESTORE
421 ;;
422esac
423AM_CONDITIONAL([MAPNIK], [test x$ac_cv_enable_mapnik = xyes])
a3697549
RN
424###
425
5fa4fe86
RN
426## WORK AROUND BROKEN autoconf - see http://lists.gnu.org/archive/html/bug-automake/2002-11/msg00020.html
427m4_pushdef([AC_MSG_ERROR])
428AC_PROG_CXX
429m4_popdef([AC_MSG_ERROR])
430##
431
ad8b1593
RN
432dnl Compile time defined access token
433AC_ARG_WITH(mapbox_access_token,
434 [AC_HELP_STRING([--with-mapbox_access_token],
435 [Access token for MapBox tiles.
436 Please register your own if you're going to distribute the
437 package, as requests are limited per token.])],
438 [VIK_CONFIG_MAPBOX_TOKEN="\"${withval}\""],
439 [VIK_CONFIG_MAPBOX_TOKEN="\"pk.eyJ1Ijoicndub3JyaXMiLCJhIjoiY2lxc294anN2MDA5bWhzbWFseWsxMW1ydiJ9.HcybKtZsiG6RVuOHg481Kg\""])
440AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPBOX_TOKEN, ${VIK_CONFIG_MAPBOX_TOKEN}, [geonames username])
441
ba4a5e11 442
e5019c19
RN
443AC_ARG_WITH(geonames_username,
444 [AC_HELP_STRING([--with-geonames_username],
445 [Username for the GeoNames webservice.
446 Please register your own if you're going to distribute the
447 package, as requests are limited per username.])],
448 [VIK_CONFIG_GEONAMES_USERNAME="\"${withval}\""],
449 [VIK_CONFIG_GEONAMES_USERNAME="\"$PACKAGE\""])
450AC_DEFINE_UNQUOTED(VIK_CONFIG_GEONAMES_USERNAME, ${VIK_CONFIG_GEONAMES_USERNAME}, [geonames username])
451
452
1bc9b120
GB
453AC_ARG_WITH(mapcache,
454 [AC_HELP_STRING([--with-mapcache],
e6e277a8 455 [specify the size of the map cache in MB (default is 128)])],
1bc9b120
GB
456 [if test "x$withval" = "xno"; then
457 VIK_CONFIG_MAPCACHE_SIZE=0;
458 elif test "x$withval" = "xyes"; then
e6e277a8 459 AC_MSG_ERROR([Please, set a value for size of the map cache in MB])
1bc9b120
GB
460 else
461 VIK_CONFIG_MAPCACHE_SIZE=${withval}
462 fi],
e6e277a8 463 [VIK_CONFIG_MAPCACHE_SIZE=128])
1bc9b120
GB
464AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
465 [Size of the map cache])
466
5e108809
GB
467
468AC_ARG_WITH(tileage,
469 [AC_HELP_STRING([--with-tileage],
7965485d 470 [specify the age of a tile before checking it (default is 7 days)])],
5e108809
GB
471 [if test "x$withval" = "xno"; then
472 VIK_CONFIG_DEFAULT_TILE_AGE=0;
473 elif test "x$withval" = "xyes"; then
474 AC_MSG_ERROR([Please, set a value for age of tiles])
475 else
476 VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
477 fi],
7965485d 478 [VIK_CONFIG_DEFAULT_TILE_AGE=604800])
5e108809 479AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
8276d332 480 [Age of tiles before checking it (in seconds)])
aea7a8a3 481AC_DEFINE(HAVE_VIKING, 1, [Enable Viking specifics in otherwise reusable code])
5e108809 482
e5140ce8
GB
483dnl man pages processing
484DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
485AC_SUBST(DB2MAN_XSL)
486AC_PATH_PROG(XP,xsltproc)
eb6a42c9 487AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
ba22c385 488AC_CHECK_PROG([HAVE_SCROLLKEEPER],scrollkeeper-config,"yes")
8bfd3407 489AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"] && test "${HAVE_SCROLLKEEPER}" = "yes" )
22f6e7ee 490AM_COND_IF([GEN_MANPAGES], [ac_cv_enable_man=yes], [ac_cv_enable_man=no])
e5140ce8 491
146e6a79
RN
492ISODATE=`date +%Y-%m-%d`
493AC_SUBST(ISODATE)
494
02468bf1
RN
495AC_DEFINE_UNQUOTED(THEYEAR, "`date +%Y`", [The Year])
496
734652bf 497# Configuration
a07e9f61 498AC_CONFIG_FILES([
42d71b24 499 viking.spec
0edf62b8 500 mingw-viking.spec
b0678771 501 mingw64-viking.spec
a07e9f61
RN
502 Makefile
503 src/Makefile
504 src/icons/Makefile
505 po/Makefile.in
506 data/Makefile
69e5d475 507 tools/Makefile
763f5c56 508 test/Makefile
d7603eb2 509 help/Makefile
47179fe3 510 help/viking.xml
763f5c56
RN
511 win32/Makefile
512 win32/installer/Makefile
513 win32/installer/pixmaps/Makefile
306ab474 514 win32/installer/translations/Makefile
a07e9f61
RN
515 doc/Makefile
516 doc/reference/Makefile
306ab474 517 doc/examples/Makefile])
a07e9f61 518
42d71b24 519AC_OUTPUT
001a86db
QT
520
521dnl Output the configuration summary
22f6e7ee
RN
522AC_MSG_NOTICE(["
523===========================================
524$PACKAGE $PACKAGE_URL $VERSION
525-------------------------------------------
526Bing Maps : $ac_cv_enable_bing
527Google : $ac_cv_enable_google
528Terraserver Maps : $ac_cv_enable_terraserver
529Expedia Maps : $ac_cv_enable_expedia
530Open Street Map : $ac_cv_enable_openstreetmap
531BlueMarble : $ac_cv_enable_bluemarble
532Geonames : $ac_cv_enable_geonames
533Geocaches Acquire : $ac_cv_enable_geocaches
534Geotag Support : $ac_cv_enable_geotag (libgexiv2=$ac_cv_lib_gexiv2_gexiv2_metadata_new libexif=$ac_cv_lib_exif_exif_loader_new)
535USGS 24k DEM : $ac_cv_enable_dem24k
536Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking
537bzip2 Support : $ac_cv_enable_bzip2
538File Magic Support : $ac_cv_enable_magic
539MBTiles Support (SQLite3) : $ac_cv_enable_mbtiles
540Zip File Support (with libzip) : $ac_cv_enable_zip
bd27baa4 541MD5 Hash Support (with libnettle): $ac_cv_enable_nettle
22f6e7ee
RN
542Mapnik Rendering Support (C++) : $ac_cv_enable_mapnik
543Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}
544Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}
e5019c19 545GeoNames user : ${VIK_CONFIG_GEONAMES_USERNAME}
22f6e7ee
RN
546Man page generation : $ac_cv_enable_man
547Documentation (+HTML) : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})
548-------------------------------------------
549
550Configure finished, type 'make' to build.
551"])