Converted final two m4 files into macros. No more direce sincludes! Yay!
authorMonty Taylor <mordred@inaugust.com>
Mon, 15 Jun 2009 00:30:12 +0000 (17:30 -0700)
committerMonty Taylor <mordred@inaugust.com>
Mon, 15 Jun 2009 00:30:12 +0000 (17:30 -0700)
configure.ac
m4/memcached.m4
m4/protocol_binary.m4

index 249289a3b8dd72eb0933c3273c88b780689cb611..422a41d19f1b8709cf2a3028045a6ad08f725c9a 100644 (file)
@@ -148,15 +148,15 @@ LIBS="$save_LIBS"
 
 AC_SEARCH_LIBS(floorf, m)
 
+dnl Specialty checks
 DETECT_BYTEORDER
 ENABLE_UTILLIB
 ENABLE_DTRACE
 SETSOCKOPT_SANITY
 ENABLE_HSIEH_HASH
 REQUIRE_POD2MAN
-
-sinclude(m4/protocol_binary.m4)
-sinclude(m4/memcached.m4)
+PROTOCOL_BINARY_TEST
+WITH_MEMCACHED
 
 dnl TODO: Remove this define once we are using 2.61 across the board.
 # AX_HEADER_ASSERT
index 0916bb69e51a4e802f7fac6be8d4cf0ddaaa9079..0efa589d7bfc8caf80cccd2d0414fe450509b77f 100644 (file)
@@ -1,32 +1,20 @@
-AC_ARG_WITH(memcached,
-[[  --with-memcached[=memcached binary]
-                          Memcached binary to use for make test]],
-[
-  if test -n "$withval"
-  then
-    MEMC_BINARY="$withval"
-  fi
-
-  if test x$withval = xyes
-  then
-    MEMC_BINARY=memcached
-  fi
+AC_DEFUN([WITH_MEMCACHED],
+  [AC_ARG_WITH([memcached],
+    [AS_HELP_STRING([--with-memcached],
+      [Memcached binary to use for make test])],
+    [ac_cv_with_memcached="$withval"],
+    [ac_cv_with_memcached=memcached])
 
   # just ignore the user if --without-memcached is passed.. it is
   # only used by make test
-  if test x$withval = xno
-  then
-    MEMC_BINARY=memcached
-  fi
-],
-[
-   AC_PATH_PROG([MEMC_BINARY], [memcached], "no", [$PATH])
-])
+  AS_IF([test "x$withval" = "xno"],
+    [ac_cv_with_memcached=memcached])
 
-if test x$MEMC_BINARY = "xno"
-then
-  AC_MSG_ERROR(["could not find memcached binary"])
-fi
+  AC_PATH_PROG([MEMC_BINARY], [$ac_cv_with_memcached], "no")
 
-AC_DEFINE_UNQUOTED([MEMCACHED_BINARY], "$MEMC_BINARY", 
+  AS_IF([test "x$MEMC_BINARY" = "xno"],
+        AC_MSG_ERROR(["could not find memcached binary"]))
+
+  AC_DEFINE_UNQUOTED([MEMCACHED_BINARY], "$MEMC_BINARY", 
             [Name of the memcached binary used in make test])
+])
index 8b8f3f98b2edc018fd8e66bca728f4283c94597f..d31bcb04a2a06c1ca2ab9af82e3b76f090ac9b39 100644 (file)
@@ -1,19 +1,22 @@
 dnl ---------------------------------------------------------------------------
 dnl Macro: PROTOCOL_BINARY_TEST
 dnl ---------------------------------------------------------------------------
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -I${srcdir}"
-AC_RUN_IFELSE([ 
-   AC_LANG_PROGRAM([
-      #include "libmemcached/memcached/protocol_binary.h"
-   ], [
+AC_DEFUN([PROTOCOL_BINARY_TEST],
+  [AC_LANG_PUSH([C])
+   save_CFLAGS="$CFLAGS"
+   CFLAGS="$CFLAGS -I${srcdir}"
+   AC_RUN_IFELSE([ 
+      AC_LANG_PROGRAM([[
+#include "libmemcached/memcached/protocol_binary.h"
+   ]],[[
       protocol_binary_request_set request;
       if (sizeof(request) != sizeof(request.bytes)) {
          return 1;
       }
-   ])
-],, AC_MSG_ERROR([Unsupported struct padding done by compiler.])) 
-CFLAGS="$save_CFLAGS"
+   ]])],, AC_MSG_ERROR([Unsupported struct padding done by compiler.])) 
+   CFLAGS="$save_CFLAGS"
+   AC_LANG_POP
+])
 
 dnl ---------------------------------------------------------------------------
 dnl End Macro: PROTOCOL_BINARY_TEST