+AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
+ [enable Google stuff (default is enable)]),
+ [ac_cv_enable_google=$enableval],
+ [ac_cv_enable_google=yes])
+AC_CACHE_CHECK([whether to enable Google stuff],
+ [ac_cv_enable_google], [ac_cv_enable_google=yes])
+case $ac_cv_enable_google in
+ yes)
+ AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
+ ;;
+esac
+AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
+
+AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
+ [enable Terraserver stuff (default is enable)]),
+ [ac_cv_enable_terraserver=$enableval],
+ [ac_cv_enable_terraserver=yes])
+AC_CACHE_CHECK([whether to enable Terraserver stuff],
+ [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
+case $ac_cv_enable_terraserver in
+ yes)
+ AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
+ ;;
+esac
+AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
+
+AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
+ [enable Expedia stuff (default is disable)]),
+ [ac_cv_enable_expedia=$enableval],
+ [ac_cv_enable_expedia=no])
+AC_CACHE_CHECK([whether to enable Expedia stuff],
+ [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
+case $ac_cv_enable_expedia in
+ yes)
+ AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
+ ;;
+esac
+AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
+
+# OpenStreetMap http://www.openstreetmap.org/
+AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
+ [enable OpenStreetMap stuff (default is enable)]),
+ [ac_cv_enable_openstreetmap=$enableval],
+ [ac_cv_enable_openstreetmap=yes])
+AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
+ [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
+case $ac_cv_enable_openstreetmap in
+ yes)
+ AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
+ ;;
+esac
+AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
+
+# BlueMarble
+AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
+ [enable BlueMarble stuff (default is enable)]),
+ [ac_cv_enable_bluemarble=$enableval],
+ [ac_cv_enable_bluemarble=yes])
+AC_CACHE_CHECK([whether to enable BlueMarble stuff],
+ [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
+case $ac_cv_enable_bluemarble in
+ yes)
+ AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
+ ;;
+esac
+AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
+
+# OpenAerial
+AC_ARG_ENABLE(openaerial, AC_HELP_STRING([--enable-openaerial],
+ [enable OpenAerial stuff (default is enable)]),
+ [ac_cv_enable_openaerial=$enableval],
+ [ac_cv_enable_openaerial=yes])
+AC_CACHE_CHECK([whether to enable OpenAerial stuff],
+ [ac_cv_enable_openaerial], [ac_cv_enable_openaerial=yes])
+case $ac_cv_enable_openaerial in
+ yes)
+ AC_DEFINE(VIK_CONFIG_OPENAERIAL, [], [OPENAERIAL STUFF])
+ ;;
+esac
+AM_CONDITIONAL([OPENAERIAL], [test x$ac_cv_enable_openaerial = xyes])
+
+# GeoNames http://www.geonames.org/
+AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
+ [enable Geonames stuff (default is enable)]),
+ [ac_cv_enable_geonames=$enableval],
+ [ac_cv_enable_geonames=yes])
+AC_CACHE_CHECK([whether to enable Geonames stuff],
+ [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
+case $ac_cv_enable_geonames in
+ yes)
+ AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
+ ;;
+esac
+AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
+
+AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
+ [enable Geocaches Acquire (default is disable).]),
+ [ac_cv_enable_geocaches=$enableval],
+ [ac_cv_enable_geocaches=no])
+AC_CACHE_CHECK([whether to enable Geocaches Acquire],
+ [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
+case $ac_cv_enable_geocaches in
+ yes)
+ AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
+ ;;
+esac
+AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
+
+
+AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
+ [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
+ [ac_cv_enable_dem24k=$enableval],
+ [ac_cv_enable_dem24k=no])
+AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
+ [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
+case $ac_cv_enable_dem24k in
+ yes)
+ AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
+ ;;
+esac
+AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
+
+# Realtime GPS tracking
+AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
+ [enable realtime GPS tracking (default is enable)]),
+ [ac_cv_enable_realtimegpstracking=$enableval],
+ [ac_cv_enable_realtimegpstracking=yes])
+AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
+ [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
+case $ac_cv_enable_realtimegpstracking in
+ yes)
+ 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]))
+ AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
+ ;;
+esac
+AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
+
+AC_ARG_WITH(search,
+ [AC_HELP_STRING([--with-search],
+ [specify google or geonames for searching (default is google)])],
+ [case "x$withval" in
+ "xgoogle")
+ VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
+ ;;
+ "xgeonames")
+ VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
+ ;;
+ *)
+ AC_MSG_ERROR([Please, set a value for search method])
+ esac],
+ [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
+AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
+ [Id. for searching via GOOGLE])
+AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
+ [Id. for searching via GEONAMES])
+AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
+ [Method for the search])
+
+
+AC_ARG_WITH(mapcache,
+ [AC_HELP_STRING([--with-mapcache],
+ [specify the size of the map cache (default is 50331648)])],
+ [if test "x$withval" = "xno"; then
+ VIK_CONFIG_MAPCACHE_SIZE=0;
+ elif test "x$withval" = "xyes"; then
+ AC_MSG_ERROR([Please, set a value for size of the map cache])
+ else
+ VIK_CONFIG_MAPCACHE_SIZE=${withval}
+ fi],
+ [VIK_CONFIG_MAPCACHE_SIZE=50331648])
+AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
+ [Size of the map cache])
+
+dnl man pages processing
+DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
+AC_SUBST(DB2MAN_XSL)
+AC_PATH_PROG(XP,xsltproc)
+AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
+
+dnl This will cause the automake generated makefiles to pass the
+dnl correct flags to aclocal.
+ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
+AC_SUBST(ACLOCAL_AMFLAGS)
+