2 # Process this file with autoconf to produce a configure script.
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])
38 # Checks for typedefs, structures, and compiler characteristics.
42 # Checks for library functions.
45 AC_CHECK_FUNCS([floor gethostbyname memset mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
47 AC_CHECK_LIB(z, inflate)
53 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
56 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
57 if test $GDK_PIXBUF_CSOURCE != "yes"
59 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
62 dnl ------------------
63 dnl | Pkgconfig checks |---------------------------------------
64 dnl ------------------
66 PKG_CHECK_MODULES(PACKAGE, [
73 AC_SUBST(PACKAGE_CFLAGS)
74 AC_SUBST(PACKAGE_LIBS)
77 dnl | User Manual |---------------------------------------
81 dnl ---------------------------------------------------------------------------
82 dnl - Use deprecated options (default enabled for devs, disabled in releases)
83 dnl ---------------------------------------------------------------------------
85 AC_ARG_ENABLE(deprecations,
86 [AC_HELP_STRING([--enable-deprecations],
87 [warn about deprecated usages [default=no]])],
88 [ac_cv_enable_deprecations=$enableval],
89 [ac_cv_enable_deprecations=no])
90 AC_CACHE_CHECK([whether to enable deprecated features],
91 [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
93 if test "x$ac_cv_enable_deprecations" = "xyes"; then
94 DISABLE_DEPRECATED_CFLAGS="\
95 -DG_DISABLE_SINGLE_INCLUDES \
97 -DG_DISABLE_DEPRECATED \
98 -DGDK_DISABLE_DEPRECATED \
99 -DGDK_PIXBUF_DISABLE_DEPRECATED \
100 -DGTK_DISABLE_SINGLE_INCLUDES \
101 -DGTK_DISABLE_DEPRECATED"
102 CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
106 AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
107 [enable alphabetized track & waypoints (default is enable)]),
108 [ac_cv_enable_alpha_trw=$enableval],
109 [ac_cv_enable_alpha_trw=yes])
110 AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
111 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
112 case $ac_cv_enable_alpha_trw in
114 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
118 AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
119 [enable Google stuff (default is enable)]),
120 [ac_cv_enable_google=$enableval],
121 [ac_cv_enable_google=yes])
122 AC_CACHE_CHECK([whether to enable Google stuff],
123 [ac_cv_enable_google], [ac_cv_enable_google=yes])
124 case $ac_cv_enable_google in
126 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
129 AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
131 AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
132 [enable Terraserver stuff (default is enable)]),
133 [ac_cv_enable_terraserver=$enableval],
134 [ac_cv_enable_terraserver=yes])
135 AC_CACHE_CHECK([whether to enable Terraserver stuff],
136 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
137 case $ac_cv_enable_terraserver in
139 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
142 AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
144 AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
145 [enable Expedia stuff (default is disable)]),
146 [ac_cv_enable_expedia=$enableval],
147 [ac_cv_enable_expedia=no])
148 AC_CACHE_CHECK([whether to enable Expedia stuff],
149 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
150 case $ac_cv_enable_expedia in
152 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
155 AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
157 # OpenStreetMap http://www.openstreetmap.org/
158 AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
159 [enable OpenStreetMap stuff (default is enable)]),
160 [ac_cv_enable_openstreetmap=$enableval],
161 [ac_cv_enable_openstreetmap=yes])
162 AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
163 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
164 case $ac_cv_enable_openstreetmap in
166 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
169 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
172 AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
173 [enable BlueMarble stuff (default is enable)]),
174 [ac_cv_enable_bluemarble=$enableval],
175 [ac_cv_enable_bluemarble=yes])
176 AC_CACHE_CHECK([whether to enable BlueMarble stuff],
177 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
178 case $ac_cv_enable_bluemarble in
180 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
183 AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
185 # GeoNames http://www.geonames.org/
186 AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
187 [enable Geonames stuff (default is enable)]),
188 [ac_cv_enable_geonames=$enableval],
189 [ac_cv_enable_geonames=yes])
190 AC_CACHE_CHECK([whether to enable Geonames stuff],
191 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
192 case $ac_cv_enable_geonames in
194 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
197 AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
199 AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
200 [enable Geocaches Acquire (default is disable).]),
201 [ac_cv_enable_geocaches=$enableval],
202 [ac_cv_enable_geocaches=no])
203 AC_CACHE_CHECK([whether to enable Geocaches Acquire],
204 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
205 case $ac_cv_enable_geocaches in
207 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
210 AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
212 AC_ARG_ENABLE(spotmaps, AC_HELP_STRING([--enable-spotmaps],
213 [enable SPOTMaps map (default is enable).]),
214 [ac_cv_enable_spotmaps=$enableval],
215 [ac_cv_enable_spotmaps=yes])
216 AC_CACHE_CHECK([whether to enable SPOTMaps map],
217 [ac_cv_enable_spotmaps], [ac_cv_enable_spotmaps=yes])
218 case $ac_cv_enable_spotmaps in
220 AC_DEFINE(VIK_CONFIG_SPOTMAPS, [], [SPOTMAPS STUFF])
223 AM_CONDITIONAL([SPOTMAPS], [test x$ac_cv_enable_spotmaps = xyes])
226 AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
227 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
228 [ac_cv_enable_dem24k=$enableval],
229 [ac_cv_enable_dem24k=no])
230 AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
231 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
232 case $ac_cv_enable_dem24k in
234 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
237 AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
239 # Realtime GPS tracking
240 AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
241 [enable realtime GPS tracking (default is enable)]),
242 [ac_cv_enable_realtimegpstracking=$enableval],
243 [ac_cv_enable_realtimegpstracking=yes])
244 AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
245 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
246 case $ac_cv_enable_realtimegpstracking in
248 AC_CHECK_LIB(gps,gps_poll,,AC_MSG_ERROR([libgps is needed for Realtime GPS Tracking feature[,] but not found. The feature can be disable with --disable-realtime-gps-tracking]))
249 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
252 AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
253 # Viking supports two incompatibles versions of GPSd: 2.39 and 2.90
254 # But GPSd does not provides easy way to test features.
255 if test x$ac_cv_enable_realtimegpstracking = xyes
257 AC_CHECK_FUNCS(gps_stream)
258 AC_CHECK_FUNCS(gps_open_r)
262 [AC_HELP_STRING([--with-search],
263 [specify google or geonames for searching (default is google)])],
266 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
269 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
272 AC_MSG_ERROR([Please, set a value for search method])
274 [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
275 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
276 [Id. for searching via GOOGLE])
277 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
278 [Id. for searching via GEONAMES])
279 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
280 [Method for the search])
283 AC_ARG_WITH(mapcache,
284 [AC_HELP_STRING([--with-mapcache],
285 [specify the size of the map cache (default is 50331648)])],
286 [if test "x$withval" = "xno"; then
287 VIK_CONFIG_MAPCACHE_SIZE=0;
288 elif test "x$withval" = "xyes"; then
289 AC_MSG_ERROR([Please, set a value for size of the map cache])
291 VIK_CONFIG_MAPCACHE_SIZE=${withval}
293 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
294 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
295 [Size of the map cache])
299 [AC_HELP_STRING([--with-tileage],
300 [specify the age of a tile before checking it (default is 30 s)])],
301 [if test "x$withval" = "xno"; then
302 VIK_CONFIG_DEFAULT_TILE_AGE=0;
303 elif test "x$withval" = "xyes"; then
304 AC_MSG_ERROR([Please, set a value for age of tiles])
306 VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
308 [VIK_CONFIG_DEFAULT_TILE_AGE=30])
309 AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
310 [Age of tiles before cheking it (in seconds)])
312 dnl man pages processing
313 DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
315 AC_PATH_PROG(XP,xsltproc)
316 AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
317 AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
319 dnl This will cause the automake generated makefiles to pass the
320 dnl correct flags to aclocal.
321 ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
322 AC_SUBST(ACLOCAL_AMFLAGS)
325 AC_CONFIG_FILES([Makefile
332 doc/reference/Makefile
333 doc/examples/Makefile
339 dnl Output the configuration summary
341 echo "==========================================="
342 echo "$PACKAGE $VERSION"
343 echo "-------------------------------------------"
344 echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
345 echo "Google Maps : $ac_cv_enable_google"
346 echo "Terraserver Maps : $ac_cv_enable_terraserver"
347 echo "Expedia Maps : $ac_cv_enable_expedia"
348 echo "Open Street Map : $ac_cv_enable_openstreetmap"
349 echo "BlueMarble : $ac_cv_enable_bluemarble"
350 echo "SPOTMaps : $ac_cv_enable_spotmaps"
351 echo "Geonames : $ac_cv_enable_geonames"
352 #echo "Geocaches Acquire : $ac_cv_enable_geocaches"
353 echo "USGS 24k DEM : $ac_cv_enable_dem24k"
354 echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
355 echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
356 echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
357 echo "-------------------------------------------"
359 echo "Configure finished, type 'make' to build."