]> git.street.me.uk Git - andy/viking.git/blame_incremental - configure.ac
[WINDOWS] Update to compile with GCC4.8.1
[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 subdir-objects])
7dnl AC_CONFIG_SRCDIR([src/main.c])
8AC_CONFIG_HEADERS([src/config.h])
9GTK_DOC_CHECK(1.0)
10
11AC_PROG_CC
12AC_PROG_CC_STDC
13# Checks for programs.
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# ATM not running automake under Windows
54#AC_CHECK_PROG(USE_WINDOWS, cmd.exe, yes, no)
55#AM_CONDITIONAL([WINDOWS], [test x$USE_WINDOWS = xyes])
56# So pass in as an option instead
57# This is only to perform slightly different build steps
58# (the code uses standard WINDOWS defines for any specific different behaviour)
59AC_ARG_ENABLE(windows, AC_HELP_STRING([--enable-windows],
60 [Perform specific Windows build steps (default is no)]),
61 [ac_cv_enable_windows=$enableval],
62 [ac_cv_enable_windows=no])
63AC_CACHE_CHECK([whether to enable Windows build steps],
64 [ac_cv_enable_windows], [ac_cv_enable_windows=no])
65AM_CONDITIONAL([WINDOWS], [test x$ac_cv_enable_windows = xyes])
66
67# Expat
68AM_WITH_EXPAT
69
70# Curl
71LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
72
73# gdk-pixbuf-csource
74AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
75if test "x$GDK_PIXBUF_CSOURCE" != "xyes"
76then
77 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
78fi
79
80dnl ------------------
81dnl | Pkgconfig checks |---------------------------------------
82dnl ------------------
83
84PKG_CHECK_MODULES(PACKAGE, [
85 glib-2.0 >= 2.16
86 gthread-2.0 >= 2.2
87 gtk+-2.0 >= 2.16
88 gio-2.0 >= 2.12
89])
90
91AC_SUBST(PACKAGE_CFLAGS)
92AC_SUBST(PACKAGE_LIBS)
93
94dnl -------------
95dnl | User Manual |---------------------------------------
96dnl -------------
97GNOME_DOC_INIT
98
99dnl ---------------------------------------------------------------------------
100dnl - Use deprecated options (default enabled for devs, disabled in releases)
101dnl ---------------------------------------------------------------------------
102
103AC_ARG_ENABLE(deprecations,
104 [AC_HELP_STRING([--enable-deprecations],
105 [warn about deprecated usages [default=no]])],
106 [ac_cv_enable_deprecations=$enableval],
107 [ac_cv_enable_deprecations=no])
108AC_CACHE_CHECK([whether to enable deprecated features],
109 [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
110
111if test "x$ac_cv_enable_deprecations" = "xyes"; then
112 DISABLE_DEPRECATED_CFLAGS="\
113-DG_DISABLE_SINGLE_INCLUDES \
114-DGSEAL_ENABLE \
115-DG_DISABLE_DEPRECATED \
116-DGDK_DISABLE_DEPRECATED \
117-DGDK_PIXBUF_DISABLE_DEPRECATED \
118-DGTK_DISABLE_SINGLE_INCLUDES \
119-DGTK_DISABLE_DEPRECATED"
120 CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
121fi
122
123# Options
124AC_ARG_ENABLE(bing, AC_HELP_STRING([--enable-bing],
125 [enable Bing stuff (default is enable)]),
126 [ac_cv_enable_bing=$enableval],
127 [ac_cv_enable_bing=yes])
128AC_CACHE_CHECK([whether to enable Bing stuff],
129 [ac_cv_enable_bing], [ac_cv_enable_bing=yes])
130case $ac_cv_enable_bing in
131 yes)
132 AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
133 ;;
134esac
135AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
136
137AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
138 [enable Google stuff (default is enable)]),
139 [ac_cv_enable_google=$enableval],
140 [ac_cv_enable_google=yes])
141AC_CACHE_CHECK([whether to enable Google stuff],
142 [ac_cv_enable_google], [ac_cv_enable_google=yes])
143case $ac_cv_enable_google in
144 yes)
145 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
146 ;;
147esac
148AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
149
150AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
151 [enable Terraserver stuff (default is disabled as the tileserver is no longer available)]),
152 [ac_cv_enable_terraserver=$enableval],
153 [ac_cv_enable_terraserver=no])
154AC_CACHE_CHECK([whether to enable Terraserver stuff],
155 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
156case $ac_cv_enable_terraserver in
157 yes)
158 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
159 ;;
160esac
161AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
162
163AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
164 [enable Expedia stuff (default is disable)]),
165 [ac_cv_enable_expedia=$enableval],
166 [ac_cv_enable_expedia=no])
167AC_CACHE_CHECK([whether to enable Expedia stuff],
168 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
169case $ac_cv_enable_expedia in
170 yes)
171 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
172 ;;
173esac
174AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
175
176# OpenStreetMap http://www.openstreetmap.org/
177AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
178 [enable OpenStreetMap stuff (default is enable)]),
179 [ac_cv_enable_openstreetmap=$enableval],
180 [ac_cv_enable_openstreetmap=yes])
181AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
182 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
183case $ac_cv_enable_openstreetmap in
184 yes)
185 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
186 ;;
187esac
188AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
189
190# BlueMarble
191AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
192 [enable BlueMarble stuff (default is enable)]),
193 [ac_cv_enable_bluemarble=$enableval],
194 [ac_cv_enable_bluemarble=yes])
195AC_CACHE_CHECK([whether to enable BlueMarble stuff],
196 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
197case $ac_cv_enable_bluemarble in
198 yes)
199 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
200 ;;
201esac
202AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
203
204# GeoNames http://www.geonames.org/
205AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
206 [enable Geonames stuff (default is enable)]),
207 [ac_cv_enable_geonames=$enableval],
208 [ac_cv_enable_geonames=yes])
209AC_CACHE_CHECK([whether to enable Geonames stuff],
210 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
211case $ac_cv_enable_geonames in
212 yes)
213 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
214 ;;
215esac
216AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
217
218AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
219 [enable Geocaches Acquire (default is disable).]),
220 [ac_cv_enable_geocaches=$enableval],
221 [ac_cv_enable_geocaches=no])
222AC_CACHE_CHECK([whether to enable Geocaches Acquire],
223 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
224case $ac_cv_enable_geocaches in
225 yes)
226 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
227 ;;
228esac
229AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
230
231AC_ARG_ENABLE(geotag, AC_HELP_STRING([--enable-geotag],
232 [enable Geotag Support (default is enable).]),
233 [ac_cv_enable_geotag=$enableval],
234 [ac_cv_enable_geotag=yes])
235AC_CACHE_CHECK([whether to enable Geotag Support],
236 [ac_cv_enable_geotag], [ac_cv_enable_geotag=yes])
237case $ac_cv_enable_geotag in
238 yes)
239 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]))
240 AC_DEFINE(VIK_CONFIG_GEOTAG, [], [GEOTAG STUFF])
241 ;;
242esac
243AM_CONDITIONAL([GEOTAG], [test x$ac_cv_enable_geotag = xyes])
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)])
370AC_DEFINE(HAVE_VIKING, 1, [Enable Viking specifics in otherwise reusable code])
371
372dnl man pages processing
373DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
374AC_SUBST(DB2MAN_XSL)
375AC_PATH_PROG(XP,xsltproc)
376AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
377AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
378
379dnl This will cause the automake generated makefiles to pass the
380dnl correct flags to aclocal.
381ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
382AC_SUBST(ACLOCAL_AMFLAGS)
383
384AM_CONDITIONAL([VIKING_DOC], test x${enable_gtk_doc} = xyes)
385
386# Configuration
387AC_CONFIG_FILES([
388 Makefile
389 src/Makefile
390 src/icons/Makefile
391 po/Makefile.in
392 data/Makefile
393 tools/Makefile
394 test/Makefile
395 help/Makefile
396 win32/Makefile
397 win32/installer/Makefile
398 win32/installer/pixmaps/Makefile
399 win32/installer/translations/Makefile])
400AM_COND_IF([VIKING_DOC],
401 [AC_CONFIG_FILES([
402 doc/Makefile
403 doc/reference/Makefile
404 doc/examples/Makefile])])
405
406AC_OUTPUT([
407 viking.spec
408 ])
409
410dnl Output the configuration summary
411echo ""
412echo "==========================================="
413echo "$PACKAGE $VERSION"
414echo "-------------------------------------------"
415echo "Bing Maps : $ac_cv_enable_bing"
416echo "Google : $ac_cv_enable_google"
417echo "Terraserver Maps : $ac_cv_enable_terraserver"
418echo "Expedia Maps : $ac_cv_enable_expedia"
419echo "Open Street Map : $ac_cv_enable_openstreetmap"
420echo "BlueMarble : $ac_cv_enable_bluemarble"
421echo "Geonames : $ac_cv_enable_geonames"
422echo "Geocaches Acquire : $ac_cv_enable_geocaches"
423echo "Geotag Support : $ac_cv_enable_geotag"
424echo "USGS 24k DEM : $ac_cv_enable_dem24k"
425echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
426echo "bzip2 Support : $ac_cv_enable_bzip2"
427echo "File Magic Support : $ac_cv_enable_magic"
428echo "MBTiles Support (SQLite3) : $ac_cv_enable_mbtiles"
429echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
430echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
431echo "Documentation (+HTML) : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})"
432echo "-------------------------------------------"
433echo ""
434echo "Configure finished, type 'make' to build."
435