]> git.street.me.uk Git - andy/viking.git/blobdiff - configure.ac
Add "version" option
[andy/viking.git] / configure.ac
index 51da31195355c1387b22d213ebee9acfd5fd9ae6..71ce4cc09acf48975d8b82119f35efb9867c0c28 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT(viking, modular.1)
+AC_INIT(viking, 0.9.2)
 AM_INIT_AUTOMAKE()
 dnl AC_CONFIG_SRCDIR([src/main.c])
 AC_CONFIG_HEADERS([src/config.h])
@@ -13,7 +13,7 @@ AC_PROG_MAKE_SET
 
 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([malloc.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h unistd.h])
+AC_CHECK_HEADERS([malloc.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h unistd.h math.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -22,11 +22,18 @@ AC_TYPE_MODE_T
 # Checks for library functions.
 AC_FUNC_STAT
 AC_FUNC_STRTOD
-AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
+AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
 
 # Expat
 AM_WITH_EXPAT
 
+# Curl
+LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
+
+# libgps
+#AC_CHECK_LIB(gps,gps_poll,AC_DEFINE(HAVE_LIBGPS,[],[libgps to connect to gpsd]),)
+#AM_CONDITIONAL([LIBGPS], [test x$ac_cv_lib_gps_gps_poll = xyes])
+
 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
 if test $GDK_PIXBUF_CSOURCE != "yes"
 then
@@ -62,6 +69,19 @@ case $ac_cv_enable_google in
 esac
 AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
 
+AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
+              [enable old Google stuff (default is disable)]),
+              [ac_cv_enable_old_google=$enableval],
+              [ac_cv_enable_old_google=no])
+AC_CACHE_CHECK([whether to enable Old Google stuff],
+               [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
+case $ac_cv_enable_google in
+  yes)
+    AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
+    ;;
+esac
+AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
+
 AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
               [enable Terraserver stuff (default is enable)]),
               [ac_cv_enable_terraserver=$enableval],
@@ -76,9 +96,9 @@ 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 enable)]),
+              [enable Expedia stuff (default is disable)]),
               [ac_cv_enable_expedia=$enableval],
-              [ac_cv_enable_expedia=yes])
+              [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
@@ -88,6 +108,62 @@ case $ac_cv_enable_expedia in
 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])
+
+AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
+             [enable Geocaches Acquire (default is disable). WARNING: Broken, do not enable]),
+              [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(mapcache,
             [AC_HELP_STRING([--with-mapcache],
                             [specify the size of the map cache (default is 50331648)])],
@@ -109,4 +185,26 @@ AC_CONFIG_FILES([Makefile
                  test/Makefile
                  doc/Makefile
                  doc/dev/Makefile])
-AC_OUTPUT
+AC_OUTPUT([
+          viking.spec
+          ])
+
+dnl Output the configuration summary
+echo ""
+echo "==========================================="
+echo "$PACKAGE $VERSION"
+echo "-------------------------------------------"
+echo "Alphabetized track & waypoints   : $ac_cv_enable_alpha_trw"
+echo "Google Maps                      : $ac_cv_enable_google"
+#echo "Old Google Maps                  : $ac_cv_enable_old_google"
+echo "Terraserver Maps                 : $ac_cv_enable_terraserver"
+#echo "Expedia Maps                     : $ac_cv_enable_expedia"
+echo "Open Street Map                  : $ac_cv_enable_openstreetmap"
+#echo "Geocaches Acquire                : $ac_cv_enable_geocaches"
+echo "USGS 24k DEM                     : $ac_cv_enable_dem24k"
+echo "Realtime GPS Tracking            : $ac_cv_enable_realtimegpstracking"
+echo "Size of map cache (in memory)    : ${VIK_CONFIG_MAPCACHE_SIZE}"
+echo "-------------------------------------------"
+echo ""
+echo "Configure finished, type 'make' to build."
+