]> git.street.me.uk Git - andy/viking.git/blobdiff - configure.ac
Allow opening of files via Drag and Drop onto the Viewport.
[andy/viking.git] / configure.ac
index 04cee8f5957624e7a79b3454ec375fe2e7258866..e85c004149bd03c77086e0a8ad90ec020950c050 100644 (file)
@@ -2,15 +2,17 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT(viking, 0.9.7)
-AM_INIT_AUTOMAKE()
+AC_INIT(viking, 1.4.1, , viking, http://viking.sf.net/)
+AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
 dnl AC_CONFIG_SRCDIR([src/main.c])
 AC_CONFIG_HEADERS([src/config.h])
+GTK_DOC_CHECK(1.0)
 
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_MAKE_SET
 AC_PROG_RANLIB
+AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
 
 # I18N
 GETTEXT_PACKAGE=viking
@@ -31,16 +33,19 @@ AC_SUBST(ACLOCAL_AMFLAGS)
 
 # 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 sys/types.h sys/wait.h unistd.h math.h])
+AC_CHECK_HEADERS([malloc.h stdlib.h string.h sys/param.h sys/types.h unistd.h math.h utime.h X11/Xlib.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_MODE_T
 
-# Checks for library functions.
+# Checks for library functions or symbols
 AC_FUNC_STAT
 AC_FUNC_STRTOD
-AC_CHECK_FUNCS([floor gethostbyname memset mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
+AC_CHECK_FUNCS([floor memset mkdtemp pow realpath sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
+AC_CHECK_LIB(m, tan)
+AC_CHECK_LIB(z, inflate)
+AC_CHECK_LIB(X11, XSetErrorHandler)
 
 # Expat
 AM_WITH_EXPAT
@@ -48,14 +53,55 @@ AM_WITH_EXPAT
 # Curl
 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
 
+# gdk-pixbuf-csource
 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
-if test $GDK_PIXBUF_CSOURCE != "yes"
+if test "x$GDK_PIXBUF_CSOURCE" != "xyes"
 then
   AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
 fi
 
-# Checks for libraries.
-AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
+dnl  ------------------
+dnl | Pkgconfig checks |---------------------------------------
+dnl  ------------------
+
+PKG_CHECK_MODULES(PACKAGE, [
+        glib-2.0          >= 2.16
+        gthread-2.0       >= 2.2
+        gtk+-2.0          >= 2.14
+        gio-2.0           >= 2.12
+])
+
+AC_SUBST(PACKAGE_CFLAGS)
+AC_SUBST(PACKAGE_LIBS)
+
+dnl  -------------
+dnl | User Manual |---------------------------------------
+dnl  -------------
+GNOME_DOC_INIT
+
+dnl ---------------------------------------------------------------------------
+dnl - Use deprecated options (default enabled for devs, disabled in releases) 
+dnl ---------------------------------------------------------------------------
+
+AC_ARG_ENABLE(deprecations,
+              [AC_HELP_STRING([--enable-deprecations],
+                              [warn about deprecated usages [default=no]])],
+                              [ac_cv_enable_deprecations=$enableval],
+                              [ac_cv_enable_deprecations=no])
+AC_CACHE_CHECK([whether to enable deprecated features],
+               [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
+
+if test "x$ac_cv_enable_deprecations" = "xyes"; then
+   DISABLE_DEPRECATED_CFLAGS="\
+-DG_DISABLE_SINGLE_INCLUDES \
+-DGSEAL_ENABLE \
+-DG_DISABLE_DEPRECATED \
+-DGDK_DISABLE_DEPRECATED \
+-DGDK_PIXBUF_DISABLE_DEPRECATED \
+-DGTK_DISABLE_SINGLE_INCLUDES \
+-DGTK_DISABLE_DEPRECATED"
+   CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
+fi
 
 # Options
 AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
@@ -70,6 +116,19 @@ case $ac_cv_enable_alpha_trw in
     ;;
 esac
 
+AC_ARG_ENABLE(bing, AC_HELP_STRING([--enable-bing],
+              [enable Bing stuff (default is enable)]),
+              [ac_cv_enable_bing=$enableval],
+              [ac_cv_enable_bing=yes])
+AC_CACHE_CHECK([whether to enable Bing stuff],
+               [ac_cv_enable_bing], [ac_cv_enable_bing=yes])
+case $ac_cv_enable_bing in
+  yes)
+    AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
+    ;;
+esac
+AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
+
 AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
               [enable Google stuff (default is enable)]),
               [ac_cv_enable_google=$enableval],
@@ -137,20 +196,6 @@ case $ac_cv_enable_bluemarble in
 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)]),
@@ -178,6 +223,33 @@ case $ac_cv_enable_geocaches in
 esac
 AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
 
+AC_ARG_ENABLE(geotag, AC_HELP_STRING([--enable-geotag],
+             [enable Geotag Support (default is enable).]),
+              [ac_cv_enable_geotag=$enableval],
+              [ac_cv_enable_geotag=yes])
+AC_CACHE_CHECK([whether to enable Geotag Support],
+               [ac_cv_enable_geotag], [ac_cv_enable_geotag=yes])
+case $ac_cv_enable_geotag in
+  yes)
+    AC_CHECK_LIB(exif,exif_loader_new,,AC_MSG_ERROR([libexif is needed for Geotag features[,] but is not found. The feature can be disabled with --disable-geotag]))
+    AC_DEFINE(VIK_CONFIG_GEOTAG, [], [GEOTAG STUFF])
+    ;;
+esac
+AM_CONDITIONAL([GEOTAG], [test x$ac_cv_enable_geotag = xyes])
+
+AC_ARG_ENABLE(spotmaps, AC_HELP_STRING([--enable-spotmaps],
+             [enable SPOTMaps map (default is enable).]),
+              [ac_cv_enable_spotmaps=$enableval],
+              [ac_cv_enable_spotmaps=yes])
+AC_CACHE_CHECK([whether to enable SPOTMaps map],
+               [ac_cv_enable_spotmaps], [ac_cv_enable_spotmaps=yes])
+case $ac_cv_enable_spotmaps in
+  yes)
+    AC_DEFINE(VIK_CONFIG_SPOTMAPS, [], [SPOTMAPS STUFF])
+    ;;
+esac
+AM_CONDITIONAL([SPOTMAPS], [test x$ac_cv_enable_spotmaps = 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.]),
@@ -201,7 +273,7 @@ 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_CHECK_LIB(gps,gps_close,,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
@@ -231,22 +303,38 @@ AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
 
 AC_ARG_WITH(mapcache,
             [AC_HELP_STRING([--with-mapcache],
-                            [specify the size of the map cache (default is 50331648)])],
+                            [specify the size of the map cache in MB (default is 128)])],
             [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])
+                AC_MSG_ERROR([Please, set a value for size of the map cache in MB])
              else
                 VIK_CONFIG_MAPCACHE_SIZE=${withval}
              fi],
-             [VIK_CONFIG_MAPCACHE_SIZE=50331648])
+             [VIK_CONFIG_MAPCACHE_SIZE=128])
 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
                    [Size of the map cache])
 
+
+AC_ARG_WITH(tileage,
+            [AC_HELP_STRING([--with-tileage],
+                            [specify the age of a tile before checking it (default is 7 days)])],
+            [if test "x$withval" = "xno"; then
+                VIK_CONFIG_DEFAULT_TILE_AGE=0;
+             elif test "x$withval" = "xyes"; then
+                AC_MSG_ERROR([Please, set a value for age of tiles])
+             else
+                VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
+             fi],
+             [VIK_CONFIG_DEFAULT_TILE_AGE=604800])
+AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
+                   [Age of tiles before checking it (in seconds)])
+
 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([HAVE_XSLTPROC],[test "x$XP" != "x"])
 AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
 
 dnl This will cause the automake generated makefiles to pass the
@@ -254,14 +342,27 @@ dnl correct flags to aclocal.
 ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
 AC_SUBST(ACLOCAL_AMFLAGS)
 
+AM_CONDITIONAL([VIKING_DOC], test x${enable_gtk_doc} = xyes)
+
 # Configuration
-AC_CONFIG_FILES([Makefile
-                 src/Makefile
-                 src/icons/Makefile
-                po/Makefile.in
-                 test/Makefile
-                 doc/Makefile
-                 doc/dev/Makefile])
+AC_CONFIG_FILES([
+               Makefile
+               src/Makefile
+               src/icons/Makefile
+               po/Makefile.in
+               data/Makefile
+               test/Makefile
+               help/Makefile
+               win32/Makefile
+               win32/installer/Makefile
+               win32/installer/pixmaps/Makefile
+               win32/installer/translations/Makefile])
+AM_COND_IF([VIKING_DOC],
+       [AC_CONFIG_FILES([
+               doc/Makefile
+               doc/reference/Makefile
+               doc/examples/Makefile])])
+
 AC_OUTPUT([
           viking.spec
           ])
@@ -272,15 +373,21 @@ echo "==========================================="
 echo "$PACKAGE $VERSION"
 echo "-------------------------------------------"
 echo "Alphabetized track & waypoints   : $ac_cv_enable_alpha_trw"
-echo "Google Maps                      : $ac_cv_enable_google"
+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 "Expedia Maps                     : $ac_cv_enable_expedia"
 echo "Open Street Map                  : $ac_cv_enable_openstreetmap"
+echo "BlueMarble                       : $ac_cv_enable_bluemarble"
+echo "SPOTMaps                         : $ac_cv_enable_spotmaps"
 echo "Geonames                         : $ac_cv_enable_geonames"
-#echo "Geocaches Acquire                : $ac_cv_enable_geocaches"
+echo "Geocaches Acquire                : $ac_cv_enable_geocaches"
+echo "Geotag Support                   : $ac_cv_enable_geotag"
 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 "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."