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