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

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:29:31 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:29:31 -0700 (Fri, 26 Aug 2011)
New Revision: 12470

Modified:
   trunk/mapserver/mapcache/configure.in
   trunk/mapserver/mapcache/src/configuration.c
   trunk/mapserver/mapcache/src/configuration_json.c
   trunk/mapserver/mapcache/src/core.c
   trunk/mapserver/mapcache/src/geocache_seed.c
   trunk/mapserver/mapcache/src/tileset.c
Log:


Modified: trunk/mapserver/mapcache/configure.in
===================================================================
--- trunk/mapserver/mapcache/configure.in	2011-08-26 11:29:19 UTC (rev 12469)
+++ trunk/mapserver/mapcache/configure.in	2011-08-26 11:29:31 UTC (rev 12470)
@@ -239,6 +239,44 @@
 ])
 
 
+AC_DEFUN([MEMCACHE_CHECK],[
+   AC_ARG_ENABLE(memcache,
+       AC_HELP_STRING([--enable-memcache],[Enable memcache backend]),
+       ,
+       [enable_memcache=yes]
+   )
+   AC_SUBST(MEMCACHE_ENABLED)
+   if test "$enable_memcache" == "yes"; then
+      AC_SUBST(MEMCACHE_ENABLED)
+      if test -z "$APUCONFIG"; then
+         AC_MSG_ERROR(memcache check failed: apu-config utility not found)
+      fi
+      OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS `$APUCONFIG --ldflags --libs --link-ld`"
+      OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS `$APUCONFIG --includes`"
+
+      #check we can link against the memcache functions (i.e. is apr-util recent enough)
+      AC_CHECK_LIB(aprutil-1, apr_memcache_hash,[MEMCACHE_ENABLED=[-DUSE_MEMCACHE]],)
+      if test -z "$APU_LIBS"; then
+         AC_CHECK_LIB(aprutil, apr_memcache_hash,[MEMCACHE_ENABLED=[-DUSE_MEMCACHE]],)
+      fi
+
+
+      if test -n "$MEMCACHE_ENABLED"; then
+         #we managed to link against the memcache functions. are the headers available?
+            AC_CHECK_HEADER([apr_memcache.h],,
+               [
+                  AC_MSG_WARN([apr-util contains memcache functions, but the headers where not found. memcache cache backend disabled])
+                  MEMCACHE_ENABLED=""
+               ])
+      else
+         AC_MSG_WARN([supplied apr-util does not contain memcache functions. memcache cache backend disabled])
+      fi
+      CPPFLAGS="$OLDCPPFLAGS"
+      LDFLAGS="$OLDLDFLAGS"
+      AC_SUBST(MEMCACHE_ENABLED)
+   fi
+])
+
 AC_DEFUN([APU_CHECK],[
   AC_SUBST(APUCONFIG)
   AC_SUBST(MEMCACHE_ENABLED)
@@ -287,27 +325,12 @@
         fi
     fi
     if test -z "$APUCONFIG"; then
-        AC_MSG_ERROR(apu-config utility not found)
+      AC_MSG_ERROR(apu-config utility not found)
     else
-       OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS `$APUCONFIG --ldflags --libs --link-ld`"
-       OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS `$APUCONFIG --includes`"
-       AC_CHECK_LIB(aprutil-1, apr_memcache_hash,[APU_LIBS=`$APUCONFIG --link-libtool`],)
-       if test -z "$APU_LIBS"; then
-          AC_CHECK_LIB(aprutil, apr_memcache_hash,[APU_LIBS=`$APUCONFIG --link-libtool`],
-                    [AC_MSG_ERROR([unable to link to apr-util])])
-       fi
-       if test -n "$APU_LIBS"; then
-          AC_CHECK_HEADER([apr_memcache.h],[
-                          MEMCACHE_ENABLED=[-DUSE_MEMCACHE]
-                          APU_INC=`$APUCONFIG --includes`
-                          ],
-                         [AC_MSG_WARN([apr_memcache.h not found, memcache cache backend disabled])])
-       fi
-       CPPFLAGS="$OLDCPPFLAGS"
-       LDFLAGS="$OLDLDFLAGS"
+      APU_LIBS=`$APUCONFIG --link-libtool`
+      APU_INC=`$APUCONFIG --includes`
     fi
     AC_SUBST(APUCONFIG)
-    AC_SUBST(MEMCACHE_ENABLED)
     AC_SUBST(APU_INC) 
     AC_SUBST(APU_LIBS)
 ])
@@ -789,6 +812,7 @@
 
 APR_CHECK
 APU_CHECK
+MEMCACHE_CHECK
 SQLITE_CHECK
 PKGCONFIG_CHECK
 # CAIRO_CHECK

Modified: trunk/mapserver/mapcache/src/configuration.c
===================================================================
--- trunk/mapserver/mapcache/src/configuration.c	2011-08-26 11:29:19 UTC (rev 12469)
+++ trunk/mapserver/mapcache/src/configuration.c	2011-08-26 11:29:31 UTC (rev 12470)
@@ -15,6 +15,9 @@
  */
 
 #include "geocache.h"
+#include <apr_file_info.h>
+#include <apr_strings.h>
+#include <apr_file_io.h>
 
 void geocache_configuration_parse(geocache_context *ctx, const char *filename, geocache_cfg *config) {
    int len = strlen(filename);

Modified: trunk/mapserver/mapcache/src/configuration_json.c
===================================================================
--- trunk/mapserver/mapcache/src/configuration_json.c	2011-08-26 11:29:19 UTC (rev 12469)
+++ trunk/mapserver/mapcache/src/configuration_json.c	2011-08-26 11:29:31 UTC (rev 12470)
@@ -1,7 +1,7 @@
 #include "geocache.h"
 #include <errno.h>
+#include <apr_strings.h>
 
-
 static void parse_extent_json(geocache_context *ctx, cJSON *node, double *extent) {
    int i = cJSON_GetArraySize(node);
    if(i != 4) {

Modified: trunk/mapserver/mapcache/src/core.c
===================================================================
--- trunk/mapserver/mapcache/src/core.c	2011-08-26 11:29:19 UTC (rev 12469)
+++ trunk/mapserver/mapcache/src/core.c	2011-08-26 11:29:31 UTC (rev 12470)
@@ -14,6 +14,7 @@
  *  limitations under the License.
  */
 
+#include <apr_strings.h>
 #include "geocache.h"
 
 geocache_tile *geocache_core_get_tile(geocache_context *ctx, geocache_request_get_tile *req_tile) {

Modified: trunk/mapserver/mapcache/src/geocache_seed.c
===================================================================
--- trunk/mapserver/mapcache/src/geocache_seed.c	2011-08-26 11:29:19 UTC (rev 12469)
+++ trunk/mapserver/mapcache/src/geocache_seed.c	2011-08-26 11:29:31 UTC (rev 12470)
@@ -7,6 +7,7 @@
 #include <sys/time.h>
 #include <apr_time.h>
 #include <apr_queue.h>
+#include <apr_strings.h>
 
 #if defined(USE_OGR) && defined(USE_GEOS)
 #define USE_CLIPPERS

Modified: trunk/mapserver/mapcache/src/tileset.c
===================================================================
--- trunk/mapserver/mapcache/src/tileset.c	2011-08-26 11:29:19 UTC (rev 12469)
+++ trunk/mapserver/mapcache/src/tileset.c	2011-08-26 11:29:31 UTC (rev 12470)
@@ -16,6 +16,8 @@
 
 #include "geocache.h"
 #include <apr_strings.h>
+#include <apr_file_info.h>
+#include <apr_file_io.h>
 #include <math.h>
 
 void geocache_tileset_configuration_check(geocache_context *ctx, geocache_tileset *tileset) {



More information about the mapserver-commits mailing list