https://issues.shibboleth.net/jira/browse/SSPCPP-94
[shibboleth/cpp-sp.git] / configure.ac
index ef10e95..75de698 100644 (file)
@@ -436,6 +436,39 @@ if test ! "$WANT_FASTCGI" = "no" ; then
     WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
 fi
 
+#
+# Build Memcached support?
+#
+AC_MSG_CHECKING(for Memcached support)
+AC_ARG_WITH(memcached,
+    AC_HELP_STRING([--with-memcached=DIR], [Build Memcached support]),
+    [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
+AC_MSG_RESULT($WANT_MEMCACHED)
+
+if test "$WANT_MEMCACHED" != "no"; then
+    if test "$WANT_MEMCACHED" != "yes"; then
+        if test x_$WANT_MEMCACHED != x_/usr; then
+            MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
+            MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
+        fi
+    fi
+    AC_CHECK_HEADER([libmemcached/memcached.h],,
+        AC_MSG_ERROR([unable to find Memcached header files]))
+    MEMCACHED_LIBS="-lmemcached"
+fi
+
+AC_SUBST(MEMCACHED_INCLUDE)
+AC_SUBST(MEMCACHED_LDFLAGS)
+AC_SUBST(MEMCACHED_LIBS)
+
+# always output the Makefile, even if you don't use it
+AC_CONFIG_FILES([memcache-store/Makefile])
+AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
+
+if test ! "$WANT_MEMCACHED" = "no" ; then
+    WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
+fi
+
 
 #
 # If no --enable-apache-xx specified