pandora-build v0.74
[m6w6/libmemcached] / m4 / pandora_with_memcached.m4
index 8797393b258519eb736f901e49951554848b7fa7..4aa1f2a02fe06e94296e83870ae2595e2686d1d0 100644 (file)
@@ -3,7 +3,7 @@ dnl This file is free software; Sun Microsystems
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([PANDORA_WITH_MEMCACHED],[
+AC_DEFUN([_PANDORA_SEARCH_MEMCACHED],[
 
   AC_ARG_WITH([memcached],
     [AS_HELP_STRING([--with-memcached],
@@ -13,21 +13,28 @@ AC_DEFUN([PANDORA_WITH_MEMCACHED],[
 
   # just ignore the user if --without-memcached is passed.. it is
   # only used by make test
-  AS_IF([test "x$withval" = "xno"],[
+  AS_IF([test "x$ac_cv_with_memcached" = "xno"],[
     ac_cv_with_memcached=memcached
     MEMCACHED_BINARY=memcached
   ],[
-    AS_IF([test -f "$withval"],[
-      ac_cv_with_memcached=$withval
-      MEMCACHED_BINARY=$withval
+    AS_IF([test -f "$ac_cv_with_memcached"],[
+      MEMCACHED_BINARY=$ac_cv_with_memcached
     ],[
       AC_PATH_PROG([MEMCACHED_BINARY], [$ac_cv_with_memcached], "no")
-      AS_IF([test "x$MEMCACHED_BINARY" = "xno"],[
-        AC_MSG_ERROR(["could not find memcached binary"])
-      ])
     ])
   ])
   AC_DEFINE_UNQUOTED([MEMCACHED_BINARY], "$MEMCACHED_BINARY", 
             [Name of the memcached binary used in make test])
+])
 
+AC_DEFUN([PANDORA_HAVE_MEMCACHED],[
+  AC_REQUIRE([_PANDORA_SEARCH_MEMCACHED])
 ])
+
+AC_DEFUN([PANDORA_REQUIRE_MEMCACHED],[
+  AC_REQUIRE([PANDORA_HAVE_MEMCACHED])
+  AS_IF([test "x$MEMCACHED_BINARY" = "xno"],[
+    AC_MSG_ERROR(["could not find memcached binary"])
+  ])
+])
+