]> git.street.me.uk Git - andy/viking.git/blobdiff - configure.ac
Remove as OSRM routing option as it no longer supports GPX output.
[andy/viking.git] / configure.ac
index 66fa53baa25acfb634cb89b9e98003278a70a4ac..93a474326b787368a3970c80e7796e537a804673 100644 (file)
@@ -2,11 +2,21 @@
 # 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/)
+
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
 AM_INIT_AUTOMAKE([dist-bzip2 dist-zip subdir-objects])
 dnl AC_CONFIG_SRCDIR([src/main.c])
 AC_CONFIG_HEADERS([src/config.h])
-GTK_DOC_CHECK(1.0)
+
+# check for gtk-doc
+m4_ifdef([GTK_DOC_CHECK], [
+GTK_DOC_CHECK([1.0],[--flavour no-tmpl])
+],[
+AM_CONDITIONAL([ENABLE_GTK_DOC], false)
+])
 
 AC_PROG_CC
 AC_PROG_CC_STDC
@@ -15,6 +25,15 @@ AC_PROG_MAKE_SET
 AC_PROG_RANLIB
 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
 
+ac_mingw32=no
+case $target_os in
+  *mingw32*)
+    ac_mingw32=yes
+  ;;
+  *)
+  ;;
+esac
+
 # I18N
 GETTEXT_PACKAGE=viking
 AC_SUBST(GETTEXT_PACKAGE)
@@ -292,7 +311,16 @@ AC_CACHE_CHECK([whether to enable bzip2 Support],
 case $ac_cv_enable_bzip2 in
   yes)
     AC_CHECK_HEADERS([bzlib.h],[],[AC_MSG_ERROR([bzlib.h is needed but not found - you will need to install package 'libbz2-dev' or similar. The feature can be disabled with --disable-bzip2])])
-    AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffDecompress, [], [AC_MSG_ERROR([libbz2 is needed but not found.])])
+    if test "$ac_mingw32" = "yes"; then
+      # Using the cross compiler it bizarrely fails to detect BZ2_bzRead during the configure stage
+      # I SWEAR THIS WORKED AT SOME POINT - BUT ON A DIFFERENT DAY IT DOESN'T = MORE SWEARING
+      BZ2FUNC=main
+      AC_CHECK_LIB(bz2, [$BZ2FUNC], [], [LIBS="-lbz2 $LIBS"
+                                         AC_MSG_WARN([libbz2 not found! Forcing it anyway!])])
+    else
+      BZ2FUNC=BZ2_bzRead
+      AC_CHECK_LIB(bz2, [$BZ2FUNC], [], [AC_MSG_ERROR([libbz2 is needed but not found.])])
+    fi
     ;;
 esac
 AM_CONDITIONAL([BZIP2], [test x$ac_cv_enable_bzip2 = xyes])
@@ -327,6 +355,46 @@ 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])
+
+# ATM only for MD5 Hashing which is currently only used for filename of image thumbnails
+AC_ARG_ENABLE(nettle, AC_HELP_STRING([--enable-nettle],
+              [enable MD5 Hash support (default is enable)]),
+              [ac_cv_enable_nettle=$enableval],
+              [ac_cv_enable_nettle=yes])
+AC_CACHE_CHECK([whether to enable MD5 Hash support],
+               [ac_cv_enable_nettle], [ac_cv_enable_nettle=yes])
+case $ac_cv_enable_nettle in
+  yes)
+    AC_CHECK_HEADER([nettle/md5-compat.h],[],[AC_MSG_ERROR([nettle/md5-compat.h is needed but not found - you will need to install package 'nettle-dev' or similar. The feature can be disabled with --disable-nettle])])
+    AC_CHECK_LIB([nettle], [main], [], [AC_MSG_ERROR([libnettle is needed but not found.])])
+    ;;
+esac
+AM_CONDITIONAL([MD5_HASH], [test x$ac_cv_enable_nettle = xyes])
+
 # Mapnik rendering layer
 AC_ARG_ENABLE(mapnik, AC_HELP_STRING([--enable-mapnik],
               [enable Mapnik (default is enable)]),
@@ -363,27 +431,6 @@ AC_PROG_CXX
 m4_popdef([AC_MSG_ERROR])
 ##
 
-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],
@@ -420,17 +467,20 @@ DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
 AC_SUBST(DB2MAN_XSL)
 AC_PATH_PROG(XP,xsltproc)
 AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
-AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
+AC_CHECK_PROG([HAVE_SCROLLKEEPER],scrollkeeper-config,"yes")
+AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"] && test "${HAVE_SCROLLKEEPER}" = "yes" )
+AM_COND_IF([GEN_MANPAGES], [ac_cv_enable_man=yes], [ac_cv_enable_man=no])
 
-dnl This will cause the automake generated makefiles to pass the
-dnl correct flags to aclocal.
-ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
-AC_SUBST(ACLOCAL_AMFLAGS)
+ISODATE=`date +%Y-%m-%d`
+AC_SUBST(ISODATE)
 
-AM_CONDITIONAL([VIKING_DOC], test x${enable_gtk_doc} = xyes)
+AC_DEFINE_UNQUOTED(THEYEAR, "`date +%Y`", [The Year])
 
 # Configuration
 AC_CONFIG_FILES([
+               viking.spec
+               mingw-viking.spec
+               mingw64-viking.spec
                Makefile
                src/Makefile
                src/icons/Makefile
@@ -439,43 +489,44 @@ AC_CONFIG_FILES([
                tools/Makefile
                test/Makefile
                help/Makefile
+               help/viking.xml
                win32/Makefile
                win32/installer/Makefile
                win32/installer/pixmaps/Makefile
-               win32/installer/translations/Makefile])
-AM_COND_IF([VIKING_DOC],
-       [AC_CONFIG_FILES([
+               win32/installer/translations/Makefile
                doc/Makefile
                doc/reference/Makefile
-               doc/examples/Makefile])])
+               doc/examples/Makefile])
 
-AC_OUTPUT([
-          viking.spec
-          ])
+AC_OUTPUT
 
 dnl Output the configuration summary
-echo ""
-echo "==========================================="
-echo "$PACKAGE $PACKAGE_URL $VERSION"
-echo "-------------------------------------------"
-echo "Bing Maps                        : $ac_cv_enable_bing"
-echo "Google                           : $ac_cv_enable_google"
-echo "Terraserver Maps                 : $ac_cv_enable_terraserver"
-echo "Expedia Maps                     : $ac_cv_enable_expedia"
-echo "Open Street Map                  : $ac_cv_enable_openstreetmap"
-echo "BlueMarble                       : $ac_cv_enable_bluemarble"
-echo "Geonames                         : $ac_cv_enable_geonames"
-echo "Geocaches Acquire                : $ac_cv_enable_geocaches"
-echo "Geotag Support                   : $ac_cv_enable_geotag (libgexiv2=$ac_cv_lib_gexiv2_gexiv2_metadata_new libexif=$ac_cv_lib_exif_exif_loader_new)"
-echo "USGS 24k DEM                     : $ac_cv_enable_dem24k"
-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 "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}"
-echo "Documentation (+HTML)            : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})"
-echo "-------------------------------------------"
-echo ""
-echo "Configure finished, type 'make' to build."
+AC_MSG_NOTICE(["
+===========================================
+$PACKAGE $PACKAGE_URL $VERSION
+-------------------------------------------
+Bing Maps                        : $ac_cv_enable_bing
+Google                           : $ac_cv_enable_google
+Terraserver Maps                 : $ac_cv_enable_terraserver
+Expedia Maps                     : $ac_cv_enable_expedia
+Open Street Map                  : $ac_cv_enable_openstreetmap
+BlueMarble                       : $ac_cv_enable_bluemarble
+Geonames                         : $ac_cv_enable_geonames
+Geocaches Acquire                : $ac_cv_enable_geocaches
+Geotag Support                   : $ac_cv_enable_geotag (libgexiv2=$ac_cv_lib_gexiv2_gexiv2_metadata_new libexif=$ac_cv_lib_exif_exif_loader_new)
+USGS 24k DEM                     : $ac_cv_enable_dem24k
+Realtime GPS Tracking            : $ac_cv_enable_realtimegpstracking
+bzip2 Support                    : $ac_cv_enable_bzip2
+File Magic Support               : $ac_cv_enable_magic
+MBTiles Support (SQLite3)        : $ac_cv_enable_mbtiles
+Zip File Support (with libzip)   : $ac_cv_enable_zip
+MD5 Hash Support (with libnettle): $ac_cv_enable_nettle
+Mapnik Rendering Support (C++)   : $ac_cv_enable_mapnik
+Size of map cache (in memory)    : ${VIK_CONFIG_MAPCACHE_SIZE}
+Age of tiles (in seconds)        : ${VIK_CONFIG_DEFAULT_TILE_AGE}
+Man page generation              : $ac_cv_enable_man
+Documentation (+HTML)            : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})
+-------------------------------------------
+
+Configure finished, type 'make' to build.
+"])