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