2 # Process this file with autoconf to produce a configure script.
6 AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
7 dnl AC_CONFIG_SRCDIR([src/main.c])
8 AC_CONFIG_HEADERS([src/config.h])
11 # Checks for programs.
15 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
18 GETTEXT_PACKAGE=viking
19 AC_SUBST(GETTEXT_PACKAGE)
20 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
22 AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
25 IT_PROG_INTLTOOL([0.35.0])
27 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
29 dnl This will cause the automake generated makefiles to pass the
30 dnl correct flags to aclocal.
31 ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
32 AC_SUBST(ACLOCAL_AMFLAGS)
34 # Checks for header files.
36 AC_CHECK_HEADERS([malloc.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h sys/types.h sys/wait.h unistd.h math.h utime.h X11/Xlib.h])
38 # Checks for typedefs, structures, and compiler characteristics.
42 # Checks for library functions or symbols
45 AC_CHECK_FUNCS([floor gethostbyname memset mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
47 AC_CHECK_LIB(z, inflate)
48 AC_CHECK_LIB(X11, XSetErrorHandler)
54 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
57 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
58 if test "x$GDK_PIXBUF_CSOURCE" != "xyes"
60 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
63 dnl ------------------
64 dnl | Pkgconfig checks |---------------------------------------
65 dnl ------------------
67 PKG_CHECK_MODULES(PACKAGE, [
74 AC_SUBST(PACKAGE_CFLAGS)
75 AC_SUBST(PACKAGE_LIBS)
78 dnl | User Manual |---------------------------------------
82 dnl ---------------------------------------------------------------------------
83 dnl - Use deprecated options (default enabled for devs, disabled in releases)
84 dnl ---------------------------------------------------------------------------
86 AC_ARG_ENABLE(deprecations,
87 [AC_HELP_STRING([--enable-deprecations],
88 [warn about deprecated usages [default=no]])],
89 [ac_cv_enable_deprecations=$enableval],
90 [ac_cv_enable_deprecations=no])
91 AC_CACHE_CHECK([whether to enable deprecated features],
92 [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
94 if test "x$ac_cv_enable_deprecations" = "xyes"; then
95 DISABLE_DEPRECATED_CFLAGS="\
96 -DG_DISABLE_SINGLE_INCLUDES \
98 -DG_DISABLE_DEPRECATED \
99 -DGDK_DISABLE_DEPRECATED \
100 -DGDK_PIXBUF_DISABLE_DEPRECATED \
101 -DGTK_DISABLE_SINGLE_INCLUDES \
102 -DGTK_DISABLE_DEPRECATED"
103 CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
107 AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
108 [enable alphabetized track & waypoints (default is enable)]),
109 [ac_cv_enable_alpha_trw=$enableval],
110 [ac_cv_enable_alpha_trw=yes])
111 AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
112 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
113 case $ac_cv_enable_alpha_trw in
115 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
119 AC_ARG_ENABLE(bing, AC_HELP_STRING([--enable-bing],
120 [enable Bing stuff (default is enable)]),
121 [ac_cv_enable_bing=$enableval],
122 [ac_cv_enable_bing=yes])
123 AC_CACHE_CHECK([whether to enable Bing stuff],
124 [ac_cv_enable_bing], [ac_cv_enable_bing=yes])
125 case $ac_cv_enable_bing in
127 AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
130 AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
132 AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
133 [enable Google stuff (default is enable)]),
134 [ac_cv_enable_google=$enableval],
135 [ac_cv_enable_google=yes])
136 AC_CACHE_CHECK([whether to enable Google stuff],
137 [ac_cv_enable_google], [ac_cv_enable_google=yes])
138 case $ac_cv_enable_google in
140 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
143 AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
145 AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
146 [enable Terraserver stuff (default is enable)]),
147 [ac_cv_enable_terraserver=$enableval],
148 [ac_cv_enable_terraserver=yes])
149 AC_CACHE_CHECK([whether to enable Terraserver stuff],
150 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
151 case $ac_cv_enable_terraserver in
153 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
156 AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
158 AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
159 [enable Expedia stuff (default is disable)]),
160 [ac_cv_enable_expedia=$enableval],
161 [ac_cv_enable_expedia=no])
162 AC_CACHE_CHECK([whether to enable Expedia stuff],
163 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
164 case $ac_cv_enable_expedia in
166 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
169 AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
171 # OpenStreetMap http://www.openstreetmap.org/
172 AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
173 [enable OpenStreetMap stuff (default is enable)]),
174 [ac_cv_enable_openstreetmap=$enableval],
175 [ac_cv_enable_openstreetmap=yes])
176 AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
177 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
178 case $ac_cv_enable_openstreetmap in
180 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
183 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
186 AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
187 [enable BlueMarble stuff (default is enable)]),
188 [ac_cv_enable_bluemarble=$enableval],
189 [ac_cv_enable_bluemarble=yes])
190 AC_CACHE_CHECK([whether to enable BlueMarble stuff],
191 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
192 case $ac_cv_enable_bluemarble in
194 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
197 AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
199 # GeoNames http://www.geonames.org/
200 AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
201 [enable Geonames stuff (default is enable)]),
202 [ac_cv_enable_geonames=$enableval],
203 [ac_cv_enable_geonames=yes])
204 AC_CACHE_CHECK([whether to enable Geonames stuff],
205 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
206 case $ac_cv_enable_geonames in
208 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
211 AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
213 AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
214 [enable Geocaches Acquire (default is disable).]),
215 [ac_cv_enable_geocaches=$enableval],
216 [ac_cv_enable_geocaches=no])
217 AC_CACHE_CHECK([whether to enable Geocaches Acquire],
218 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
219 case $ac_cv_enable_geocaches in
221 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
224 AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
226 AC_ARG_ENABLE(geotag, AC_HELP_STRING([--enable-geotag],
227 [enable Geotag Support (default is enable).]),
228 [ac_cv_enable_geotag=$enableval],
229 [ac_cv_enable_geotag=yes])
230 AC_CACHE_CHECK([whether to enable Geotag Support],
231 [ac_cv_enable_geotag], [ac_cv_enable_geotag=yes])
232 case $ac_cv_enable_geotag in
234 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]))
235 AC_DEFINE(VIK_CONFIG_GEOTAG, [], [GEOTAG STUFF])
238 AM_CONDITIONAL([GEOTAG], [test x$ac_cv_enable_geotag = xyes])
240 AC_ARG_ENABLE(spotmaps, AC_HELP_STRING([--enable-spotmaps],
241 [enable SPOTMaps map (default is enable).]),
242 [ac_cv_enable_spotmaps=$enableval],
243 [ac_cv_enable_spotmaps=yes])
244 AC_CACHE_CHECK([whether to enable SPOTMaps map],
245 [ac_cv_enable_spotmaps], [ac_cv_enable_spotmaps=yes])
246 case $ac_cv_enable_spotmaps in
248 AC_DEFINE(VIK_CONFIG_SPOTMAPS, [], [SPOTMAPS STUFF])
251 AM_CONDITIONAL([SPOTMAPS], [test x$ac_cv_enable_spotmaps = xyes])
254 AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
255 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
256 [ac_cv_enable_dem24k=$enableval],
257 [ac_cv_enable_dem24k=no])
258 AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
259 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
260 case $ac_cv_enable_dem24k in
262 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
265 AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
267 # Realtime GPS tracking
268 AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
269 [enable realtime GPS tracking (default is enable)]),
270 [ac_cv_enable_realtimegpstracking=$enableval],
271 [ac_cv_enable_realtimegpstracking=yes])
272 AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
273 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
274 case $ac_cv_enable_realtimegpstracking in
276 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]))
277 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
280 AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
283 [AC_HELP_STRING([--with-search],
284 [specify google or geonames for searching (default is google)])],
287 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
290 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
293 AC_MSG_ERROR([Please, set a value for search method])
295 [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
296 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
297 [Id. for searching via GOOGLE])
298 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
299 [Id. for searching via GEONAMES])
300 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
301 [Method for the search])
304 AC_ARG_WITH(mapcache,
305 [AC_HELP_STRING([--with-mapcache],
306 [specify the size of the map cache in MB (default is 128)])],
307 [if test "x$withval" = "xno"; then
308 VIK_CONFIG_MAPCACHE_SIZE=0;
309 elif test "x$withval" = "xyes"; then
310 AC_MSG_ERROR([Please, set a value for size of the map cache in MB])
312 VIK_CONFIG_MAPCACHE_SIZE=${withval}
314 [VIK_CONFIG_MAPCACHE_SIZE=128])
315 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
316 [Size of the map cache])
320 [AC_HELP_STRING([--with-tileage],
321 [specify the age of a tile before checking it (default is 7 days)])],
322 [if test "x$withval" = "xno"; then
323 VIK_CONFIG_DEFAULT_TILE_AGE=0;
324 elif test "x$withval" = "xyes"; then
325 AC_MSG_ERROR([Please, set a value for age of tiles])
327 VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
329 [VIK_CONFIG_DEFAULT_TILE_AGE=604800])
330 AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
331 [Age of tiles before checking it (in seconds)])
333 dnl man pages processing
334 DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
336 AC_PATH_PROG(XP,xsltproc)
337 AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
338 AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
340 dnl This will cause the automake generated makefiles to pass the
341 dnl correct flags to aclocal.
342 ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
343 AC_SUBST(ACLOCAL_AMFLAGS)
345 AM_CONDITIONAL([VIKING_DOC], test x${enable_gtk_doc} = xyes)
355 AM_COND_IF([VIKING_DOC],
359 doc/reference/Makefile
360 doc/examples/Makefile])])
366 dnl Output the configuration summary
368 echo "==========================================="
369 echo "$PACKAGE $VERSION"
370 echo "-------------------------------------------"
371 echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
372 echo "Bing Maps : $ac_cv_enable_bing"
373 echo "Google : $ac_cv_enable_google"
374 echo "Terraserver Maps : $ac_cv_enable_terraserver"
375 echo "Expedia Maps : $ac_cv_enable_expedia"
376 echo "Open Street Map : $ac_cv_enable_openstreetmap"
377 echo "BlueMarble : $ac_cv_enable_bluemarble"
378 echo "SPOTMaps : $ac_cv_enable_spotmaps"
379 echo "Geonames : $ac_cv_enable_geonames"
380 echo "Geocaches Acquire : $ac_cv_enable_geocaches"
381 echo "Geotag Support : $ac_cv_enable_geotag"
382 echo "USGS 24k DEM : $ac_cv_enable_dem24k"
383 echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
384 echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
385 echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
386 echo "Documentation (+HTML) : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})"
387 echo "-------------------------------------------"
389 echo "Configure finished, type 'make' to build."