[mapserver-commits] r12425 - in trunk/mapserver/mapcache: . src

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:24:39 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:24:39 -0700 (Fri, 26 Aug 2011)
New Revision: 12425

Modified:
   trunk/mapserver/mapcache/Makefile.inc.in
   trunk/mapserver/mapcache/configure.in
   trunk/mapserver/mapcache/src/geocache_seed.c
Log:
factor out memcache check from apr-util check in autoconf script
add missing include statements in a couple of files
thomas.bonfort | 2011-08-11 09:52:03 +0200 (Thu, 11 Aug 2011)

Modified: trunk/mapserver/mapcache/Makefile.inc.in
===================================================================
--- trunk/mapserver/mapcache/Makefile.inc.in	2011-08-26 11:24:34 UTC (rev 12424)
+++ trunk/mapserver/mapcache/Makefile.inc.in	2011-08-26 11:24:39 UTC (rev 12425)
@@ -40,14 +40,18 @@
 GDAL_ENABLED=@GDAL_ENABLED@
 OGR_ENABLED=@OGR_ENABLED@
 
+GEOS_INC=@GEOS_INC@
+GEOS_LIB=@GEOS_LIB@
+GEOS_ENABLED=@GEOS_ENABLED@
+
 CAIRO_INC=@CAIRO_INC@
 CAIRO_LIB=@CAIRO_LIB@
 CAIRO_ENABLED=@CAIRO_ENABLED@
 
 MISC_ENABLED=@MISC_ENABLED@ -DTHREADED_MPM=$(shell $(HTTPD) -V | grep "Server MPM" | grep -q "Prefork"; echo $$?)
 
-INCLUDES=-I../include $(MISC_ENABLED) $(CAIRO_ENABLED) $(CAIRO_INC) $(CURL_CFLAGS) $(PNG_INC) $(JPEG_INC) $(GDAL_INC) $(APR_INC) $(APU_INC) $(MEMCACHE_ENABLED) $(PCRE_CFLAGS) $(PCRE_ENABLED) $(OGR_ENABLED)
-LIBS=$(CURL_LIBS) $(CAIRO_LIB) $(PNG_LIB) $(JPEG_LIB) $(GDAL_LIB) $(APR_LIBS) $(APU_LIBS) $(PCRE_LIBS)
+INCLUDES=-I../include $(MISC_ENABLED) $(CAIRO_ENABLED) $(CAIRO_INC) $(CURL_CFLAGS) $(PNG_INC) $(JPEG_INC) $(GDAL_INC) $(GEOS_INC) $(APR_INC) $(APU_INC) $(MEMCACHE_ENABLED) $(PCRE_CFLAGS) $(PCRE_ENABLED) $(OGR_ENABLED) $(GEOS_ENABLED)
+LIBS=$(CURL_LIBS) $(CAIRO_LIB) $(PNG_LIB) $(JPEG_LIB) $(GDAL_LIB) $(GEOS_LIB) $(APR_LIBS) $(APU_LIBS) $(PCRE_LIBS)
 
 
 OBJS=$(shell find . -regex '^.*\.c$$' -print | grep -v geocache_seed.c | grep -v mod_geocache.c | grep -v fastcgi_geocache.c |sed "s/^\(.*\)\.c$$/\1.o/") 

Modified: trunk/mapserver/mapcache/configure.in
===================================================================
--- trunk/mapserver/mapcache/configure.in	2011-08-26 11:24:34 UTC (rev 12424)
+++ trunk/mapserver/mapcache/configure.in	2011-08-26 11:24:39 UTC (rev 12425)
@@ -381,7 +381,7 @@
               )
   GDALCONFIG=""
   if test "$with_gdal" = "no"; then
-      AC_MSG_WARN("gdal support disabled by request")
+      AC_MSG_WARN("gdal support disabled by request: advanced seeding options will not be available")
   else
       if test "$with_gdal" = "yes"; then
           AC_PATH_PROG(GDALCONFIG, gdal-config)
@@ -410,6 +410,39 @@
   AC_SUBST(GDAL_LIB,$GDAL_LIBS)
 ])
 
+
+AC_DEFUN([GEOS_CHECK],[
+  AC_ARG_WITH(geos,
+              AC_HELP_STRING([--with-geos], [path to geos-config program]),
+              ,
+              [with_geos=yes]
+              )
+  GEOSCONFIG=""
+  if test "$with_geos" = "no"; then
+      AC_MSG_WARN("geos support disabled by request: advanced seeding options will not be available")
+  else
+      if test "$with_geos" = "yes"; then
+          AC_PATH_PROG(GEOSCONFIG, geos-config)
+      else
+          AC_MSG_CHECKING(for geos-config usability in $with_geos)
+          if test -x "$with_geos"; then
+             GEOSCONFIG=$with_geos
+             AC_MSG_RESULT(yes)
+          else
+             AC_MSG_ERROR($with_geos not found or not executable)
+          fi
+      fi
+      if test -n "$GEOSCONFIG"; then
+          GEOS_CFLAGS=`$GEOSCONFIG --cflags`
+          GEOS_LIBS="`$GEOSCONFIG --ldflags` -lgeos_c"
+          GEOS_ENABLED="-DUSE_GEOS"
+      fi
+  fi
+  AC_SUBST(GEOS_ENABLED,$GEOS_ENABLED)
+  AC_SUBST(GEOS_INC,$GEOS_CFLAGS)
+  AC_SUBST(GEOS_LIB,$GEOS_LIBS)
+])
+
 AC_DEFUN([FASTCGI_CHECK],[
     AC_ARG_WITH(fastcgi,
         AC_HELP_STRING([--with-fastcgi=DIR],[Specify where FASTCGI is installed]),
@@ -625,6 +658,7 @@
 PCRE_CHECK
 
 GDAL_CHECK
+GEOS_CHECK
 
 AC_SUBST(MISC_ENABLED,$MISC_ENABLED)
 

Modified: trunk/mapserver/mapcache/src/geocache_seed.c
===================================================================
--- trunk/mapserver/mapcache/src/geocache_seed.c	2011-08-26 11:24:34 UTC (rev 12424)
+++ trunk/mapserver/mapcache/src/geocache_seed.c	2011-08-26 11:24:39 UTC (rev 12425)
@@ -8,7 +8,11 @@
 #include <apr_time.h>
 #include <apr_queue.h>
 
-#ifdef USE_OGR
+#if defined(USE_OGR) && defined(USE_GEOS)
+#define USE_CLIPPERS
+#endif
+
+#ifdef USE_CLIPPERS
 #include "ogr_api.h"
 #include "geos_c.h"
 int nClippers = 0;
@@ -55,7 +59,7 @@
     { "nthreads", 'n', TRUE, "number of parallel threads to use" },
     { "older", 'o', TRUE, "reseed tiles older than supplied date (format: year/month/day hour:minute, eg: 2011/01/31 20:45" },
     { "dimension", 'D', TRUE, "set the value of a dimension (format DIMENSIONNAME=VALUE). Can be used multiple times for multiple dimensions" },
-#ifdef USE_OGR
+#ifdef USE_CLIPPERS
     { "ogr-datasource", 'd', TRUE, "ogr datasource to get features from"},
     { "ogr-layer", 'l', TRUE, "layer inside datasource"},
     { "ogr-sql", 's', TRUE, "sql to filter inside layer"},
@@ -88,7 +92,7 @@
     va_end(args);
 }
 
-#ifdef USE_OGR
+#ifdef USE_CLIPPERS
 int ogr_features_intersect_tile(geocache_context *ctx, geocache_tile *tile) {
    geocache_metatile *mt = geocache_tileset_metatile_get(ctx,tile);
    GEOSCoordSequence *mtbboxls = GEOSCoordSeq_create(5,2);
@@ -191,7 +195,7 @@
          if(age_limit) {
             if(tileset->cache->tile_get(&cmd_ctx,tile) == GEOCACHE_SUCCESS) {
                if(tile->mtime && tile->mtime<age_limit) {
-#ifdef USE_OGR
+#ifdef USE_CLIPPERS
                   /* check we are in the requested features before deleting the tile */
                   if(nClippers > 0) {
                      intersects = ogr_features_intersect_tile(&cmd_ctx,tile);
@@ -210,7 +214,7 @@
          }
       } else {
          // the tile does not exist
-#ifdef USE_OGR
+#ifdef USE_CLIPPERS
          /* check we are in the requested features before deleting the tile */
          if(nClippers > 0) {
             if(ogr_features_intersect_tile(&cmd_ctx,tile)) {
@@ -346,7 +350,7 @@
     const char *old = NULL;
     const char *optarg;
 
-#ifdef USE_OGR
+#ifdef USE_CLIPPERS
     const char *ogr_where = NULL;
     const char *ogr_layer = NULL;
     const char *ogr_sql = NULL;
@@ -427,7 +431,7 @@
                 }
                 apr_table_set(dimensions,dimkey,dimvalue);
                 break;
-#ifdef USE_OGR
+#ifdef USE_CLIPPERS
             case 'd':
                 ogr_datasource = optarg;
                 break;
@@ -456,7 +460,7 @@
             return usage(argv[0],ctx.get_error_message(&ctx));
     }
 
-#ifdef USE_OGR
+#ifdef USE_CLIPPERS
     if(extent && ogr_datasource) {
        return usage(argv[0], "cannot specify both extent and ogr-datasource");
     }



More information about the mapserver-commits mailing list