]> git.street.me.uk Git - andy/viking.git/blobdiff - configure.ac
Make the find best zoom level function reusable.
[andy/viking.git] / configure.ac
index 6591cc9bade85e75517a3f5a5d2ab047f99cea84..87c2dbb4a418a77c862050c8d4533ece328d6c23 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.64)
-AC_INIT(viking, 1.6, , viking, http://viking.sf.net/)
+AC_INIT(viking, 1.6.1, , viking, http://viking.sf.net/)
 AM_INIT_AUTOMAKE([dist-bzip2 dist-zip subdir-objects])
 dnl AC_CONFIG_SRCDIR([src/main.c])
 AC_CONFIG_HEADERS([src/config.h])
@@ -333,6 +333,31 @@ case $ac_cv_enable_mbtiles in
 esac
 AM_CONDITIONAL([SQLITE], [test x$ac_cv_enable_mbtiles = xyes])
 
+# Standard compression is handled by libz
+# libzip enables a friendlier file based interface
+# libzip itself depends on libz (which is required in the Viking build ATM)
+# ZIP
+AC_ARG_ENABLE(zip, AC_HELP_STRING([--enable-zip],
+              [enable zip support (default is enable).]),
+              [ac_cv_enable_zip=$enableval],
+              [ac_cv_enable_zip=yes])
+AC_CACHE_CHECK([whether to enable zip Support],
+               [ac_cv_enable_zip], [ac_cv_enable_zip=yes])
+case $ac_cv_enable_zip in
+  yes)
+    # NB As far as I can tell libzip doesn't provide any versioning info within the header code itself
+    # Thus supporting old versions via simple #if #else #endif directives is seemingly not possible
+    # Resort to checking versioning only via pkgconfig
+    PKG_CHECK_MODULES([LIBZIP], [libzip >= 0.11],
+      [ AC_CHECK_HEADERS([zip.h],[],[AC_MSG_ERROR([zip.h is needed but not found - you will need to install package 'libzip-dev' or similar. The feature can be disabled with --disable-zip])]) 
+        AC_CHECK_LIB(zip, [main], [], [AC_MSG_ERROR([libzip is needed but not found.])]) ],
+      [ AC_MSG_WARN([libzip version needs to be at least 0.11, use of libzip is disabled])
+        ac_cv_enable_zip=no ]
+  )
+    ;;
+esac
+AM_CONDITIONAL([ZIP], [test x$ac_cv_enable_zip = xyes])
+
 # Mapnik rendering layer
 AC_ARG_ENABLE(mapnik, AC_HELP_STRING([--enable-mapnik],
               [enable Mapnik (default is enable)]),
@@ -408,6 +433,9 @@ AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
 AC_CHECK_PROG([HAVE_SCROLLKEEPER],scrollkeeper-config,"yes")
 AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"] && test "${HAVE_SCROLLKEEPER}" == "yes" )
 
+ISODATE=`date +%Y-%m-%d`
+AC_SUBST(ISODATE)
+
 # Configuration
 AC_CONFIG_FILES([
                Makefile
@@ -450,6 +478,7 @@ echo "Realtime GPS Tracking            : $ac_cv_enable_realtimegpstracking"
 echo "bzip2 Support                    : $ac_cv_enable_bzip2"
 echo "File Magic Support               : $ac_cv_enable_magic"
 echo "MBTiles Support (SQLite3)        : $ac_cv_enable_mbtiles"
+echo "Zip File Support (with libzip)   : $ac_cv_enable_zip"
 echo "Mapnik Rendering Support (C++)   : $ac_cv_enable_mapnik"
 echo "Size of map cache (in memory)    : ${VIK_CONFIG_MAPCACHE_SIZE}"
 echo "Age of tiles (in seconds)        : ${VIK_CONFIG_DEFAULT_TILE_AGE}"