-ACLOCAL_AMFLAGS = -I config
+ACLOCAL_AMFLAGS = -I m4
SUBDIRS = docs libmemcached libmemcachedutil tests support clients
EXTRA_dist = README.FIRST
+++ /dev/null
-dnl ---------------------------------------------------------------------------
-dnl Macro: 64BIT
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(64bit,
- [ --enable-64bit Build 64bit library.],
- [
- org_cflags=$CFLAGS
- CFLAGS=-m64
- AC_LANG(C)
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([], [ if (sizeof(void*) != 8) return 1;])
- ],[
- CFLAGS="$CFLAGS $org_cflags"
- ],[
- AC_MSG_ERROR([Don't know how to build a 64-bit object.])
- ])
- org_cxxflags=$CXXFLAGS
- CXXFLAGS=-m64
- AC_LANG(C++)
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([], [ if (sizeof(void*) != 8) return 1;])
- ],[
- CXXFLAGS="$CXXFLAGS $org_cxxflags"
- ],[
- AC_MSG_ERROR([Don't know how to build a 64-bit object.])
- ])
-
- ])
-dnl ---------------------------------------------------------------------------
-dnl End Macro: 64BIT
-dnl ---------------------------------------------------------------------------
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
LIBTOOLIZE_FLAGS=" --automake --copy --force"
# ACLOCAL=${ACLOCAL:-aclocal}
-ACLOCAL_FLAGS="-I config"
+ACLOCAL_FLAGS="-I m4"
# AUTOHEADER=${AUTOHEADER:-autoheader}
# AUTOMAKE=${AUTOMAKE:-automake}
AUTOMAKE_FLAGS="--add-missing --copy --force"
+++ /dev/null
-AC_DEFUN([DETECT_BYTEORDER],
-[
- AC_MSG_CHECKING([for htonll])
- have_htoll="no"
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <inttypes.h>
- ], [
- return htonll(0);
- ])
- ], [
- have_htoll="yes"
- AC_DEFINE([HAVE_HTONLL], [1], [Have ntohll])
- ])
-
- AC_MSG_RESULT([$have_htoll])
- AM_CONDITIONAL([BUILD_BYTEORDER],[test "x$have_htoll" == "xno"])
- AC_MSG_CHECKING([byteorder])
- have_htoll="no"
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <inttypes.h>
- ], [
-if (htonl(5) != 5) {
- return 1;
-}
- ])
- ], [
- AC_MSG_RESULT([big endian])
- AC_DEFINE([BYTEORDER_BIG_ENDIAN], [1], [Enable big endian byteorder])
- ], [
- AC_MSG_RESULT([little endian])
- AC_DEFINE([BYTEORDER_LITTLE_ENDIAN], [1], [Enable little endian byteorder])
- ])
-])
-
-DETECT_BYTEORDER
+++ /dev/null
-dnl ---------------------------------------------------------------------------
-dnl Macro: DEBUG_TEST
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(debug,
- [ --enable-debug Build with support for the DEBUG.],
- [
- AC_DEFINE([HAVE_DEBUG], [1], [Enables DEBUG Support])
- AC_CHECK_PROGS(DEBUG, debug)
- ENABLE_DEBUG="yes"
- AC_SUBST(DEBUGFLAGS)
- AC_SUBST(HAVE_DEBUG)
- ],
- [
- ENABLE_DEBUG="no"
- ]
- )
-AM_CONDITIONAL([HAVE_DEBUG], [ test "$ENABLE_DEBUG" = "yes" ])
-dnl ---------------------------------------------------------------------------
-dnl End Macro: DEBUG_TEST
-dnl ---------------------------------------------------------------------------
+++ /dev/null
-dnl ---------------------------------------------------------------------------
-dnl Macro: DTRACE_TEST
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(dtrace,
- [ --enable-dtrace Build with support for the DTRACE.],
- [
- AC_PATH_PROG([DTRACE], [dtrace], "no", [/usr/sbin:$PATH])
- if test "x$DTRACE" != "xno"; then
- AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
- DTRACE_HEADER=dtrace_probes.h
-
- # DTrace on MacOSX does not use -G option
- $DTRACE -G -o conftest.$$ -s libmemcached/libmemcached_probes.d 2>/dev/zero
- if test $? -eq 0
- then
- DTRACE_OBJ=libmemcached_probes.lo
- rm conftest.$$
- fi
-
- ENABLE_DTRACE="yes"
- AC_SUBST(HAVE_DTRACE)
- else
- AC_MSG_ERROR([Need dtrace binary and OS support.])
- fi
- ],
- [
- ENABLE_DTRACE="no"
- ]
- )
-
-AC_SUBST(DTRACEFLAGS)
-AC_SUBST(DTRACE_HEADER)
-AC_SUBST(DTRACE_OBJ)
-AM_CONDITIONAL([HAVE_DTRACE], [ test "$ENABLE_DTRACE" = "yes" ])
-dnl ---------------------------------------------------------------------------
-dnl End Macro: DTRACE_TEST
-dnl ---------------------------------------------------------------------------
+++ /dev/null
-# serial 6 -*- Autoconf -*-
-# Enable extensions on systems that normally disable them.
-
-# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
-# Autoconf. Perhaps we can remove this once we can assume Autoconf
-# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
-# enough in this area it's likely we'll need to redefine
-# AC_USE_SYSTEM_EXTENSIONS for quite some time.
-
-# AC_USE_SYSTEM_EXTENSIONS
-# ------------------------
-# Enable extensions on systems that normally disable them,
-# typically due to standards-conformance issues.
-# Remember that #undef in AH_VERBATIM gets replaced with #define by
-# AC_DEFINE. The goal here is to define all known feature-enabling
-# macros, then, if reports of conflicts are made, disable macros that
-# cause problems on some platforms (such as __EXTENSIONS__).
-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
-[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
-AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
-
- AC_REQUIRE([AC_CANONICAL_HOST])
-
- AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
- if test "$MINIX" = yes; then
- AC_DEFINE([_POSIX_SOURCE], [1],
- [Define to 1 if you need to in order for `stat' and other
- things to work.])
- AC_DEFINE([_POSIX_1_SOURCE], [2],
- [Define to 2 if the system does not provide POSIX.1 features
- except with this defined.])
- AC_DEFINE([_MINIX], [1],
- [Define to 1 if on MINIX.])
- fi
-
- dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
- dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
- dnl provided.
- case "$host_os" in
- hpux*)
- AC_DEFINE([_XOPEN_SOURCE], [500],
- [Define to 500 only on HP-UX.])
- ;;
- esac
-
- AH_VERBATIM([__EXTENSIONS__],
-[/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-])
- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
- [ac_cv_safe_to_define___extensions__],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
-# define __EXTENSIONS__ 1
- ]AC_INCLUDES_DEFAULT])],
- [ac_cv_safe_to_define___extensions__=yes],
- [ac_cv_safe_to_define___extensions__=no])])
- test $ac_cv_safe_to_define___extensions__ = yes &&
- AC_DEFINE([__EXTENSIONS__])
- AC_DEFINE([_ALL_SOURCE])
- AC_DEFINE([_GNU_SOURCE])
- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
- AC_DEFINE([_TANDEM_SOURCE])
-])# AC_USE_SYSTEM_EXTENSIONS
-
-# gl_USE_SYSTEM_EXTENSIONS
-# ------------------------
-# Enable extensions on systems that normally disable them,
-# typically due to standards-conformance issues.
-AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
+++ /dev/null
-dnl ---------------------------------------------------------------------------
-dnl Macro: HSIEH_HASH
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(hsieh_hash,
- [ --enable-hsieh_hash build with support for hsieh hashing.],
- [
- if test "x$enableval" != "xno"; then
- ENABLE_HSIEH="true"
- AC_DEFINE([HAVE_HSIEH_HASH], [1], [Enables hsieh hashing support])
- else
- ENABLE_HSIEH="false"
- fi
- ],
- [
- ENABLE_HSIEH="false"
- ]
-)
-
-AM_CONDITIONAL([INCLUDE_HSIEH_SRC], [test "x$ENABLE_HSIEH" = "xtrue"])
-dnl ---------------------------------------------------------------------------
-dnl End Macro: HSIEH_HASH
-dnl ---------------------------------------------------------------------------
+++ /dev/null
-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
-
- # 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])
-])
-
-if test x$MEMC_BINARY == "xno"
-then
- AC_MSG_ERROR(["could not find memcached binary"])
-fi
-
-AC_DEFINE_UNQUOTED([MEMCACHED_BINARY], "$MEMC_BINARY",
- [Name of the memcached binary used in make test])
+++ /dev/null
-AC_PATH_PROG([POD2MAN], [pod2man], "no", [$PATH:/usr/bin:/usr/local/bin])
-if test "x$POD2MAN" == "xno"; then
- AC_MSG_ERROR(["Could not find pod2man anywhere in path"])
-fi
-AC_SUBST(POD2MAN)
+++ /dev/null
-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"
- ], [
- 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"
-
-dnl ---------------------------------------------------------------------------
-dnl End Macro: PROTOCOL_BINARY_TEST
-dnl ---------------------------------------------------------------------------
+++ /dev/null
-dnl ---------------------------------------------------------------------------
-dnl Macro: SETSOCKOPT_TEST
-dnl ---------------------------------------------------------------------------
-AC_LANG(C)
-AC_RUN_IFELSE([
- AC_LANG_PROGRAM([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <time.h>
-#include <sys/time.h>
-#include <errno.h>
- ], [
- int sock = socket(AF_INET, SOCK_STREAM, 0);
- struct timeval waittime;
-
- waittime.tv_sec= 0;
- waittime.tv_usec= 500;
-
- if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
- &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
- if (errno == ENOPROTOOPT) {
- return 1;
- }
- }
- return 0;
- ])
- ], AC_DEFINE(HAVE_SNDTIMEO, 1, [Define to 1 if you have a working SO_SNDTIMEO]))
-
-AC_RUN_IFELSE([
- AC_LANG_PROGRAM([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <time.h>
-#include <sys/time.h>
-#include <errno.h>
- ], [
- int sock = socket(AF_INET, SOCK_STREAM, 0);
- struct timeval waittime;
-
- waittime.tv_sec= 0;
- waittime.tv_usec= 500;
-
- if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO,
- &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
- if (errno == ENOPROTOOPT) {
- return 1;
- }
- }
- return 0;
- ])
- ], AC_DEFINE(HAVE_RCVTIMEO, 1, [Define to 1 if you have a working SO_RCVTIMEO]))
-
-dnl ---------------------------------------------------------------------------
-dnl End Macro: SETSOCKOPT_TEST
-dnl ---------------------------------------------------------------------------
+++ /dev/null
-BUILD_UTILLIB=yes
-
-AC_ARG_ENABLE(utils,
- [ --enable-utils Build libmemcachedutils [[default=yes]]],
- [
- if test "x$enableval" = "xno"; then
- BUILD_UTILLIB="no"
- fi
- ]
- )
-
-if test "x$BUILD_UTILLIB" = "xyes"; then
- AC_SEARCH_LIBS(pthread_create, pthread)
- if test "x$ac_cv_search_pthread_create" = "xno"; then
- AC_MSG_ERROR([Sorry you need POSIX thread library to build libmemcachedutil.])
- fi
- AC_DEFINE([HAVE_LIBMEMCACHEDUTIL], [1], [Enables libmemcachedutil Support])
-fi
-
-AM_CONDITIONAL([BUILD_LIBMEMCACHEDUTIL],[test "x$BUILD_UTILLIB" = "xyes"])
AC_SEARCH_LIBS(floorf, m)
-sinclude(config/pod2man.m4)
-sinclude(config/debug.m4)
-sinclude(config/dtrace.m4)
-sinclude(config/byteorder.m4)
-sinclude(config/64bit.m4)
-sinclude(config/protocol_binary.m4)
-sinclude(config/memcached.m4)
-sinclude(config/setsockopt.m4)
-sinclude(config/hsieh.m4)
-sinclude(config/util.m4)
+sinclude(m4/pod2man.m4)
+sinclude(m4/debug.m4)
+sinclude(m4/dtrace.m4)
+sinclude(m4/byteorder.m4)
+sinclude(m4/64bit.m4)
+sinclude(m4/protocol_binary.m4)
+sinclude(m4/memcached.m4)
+sinclude(m4/setsockopt.m4)
+sinclude(m4/hsieh.m4)
+sinclude(m4/util.m4)
dnl This is likely subverted by vpath builds. How do we find the original
dnl source dir in the configure step of a vpath build?
--- /dev/null
+dnl ---------------------------------------------------------------------------
+dnl Macro: 64BIT
+dnl ---------------------------------------------------------------------------
+AC_ARG_ENABLE(64bit,
+ [ --enable-64bit Build 64bit library.],
+ [
+ org_cflags=$CFLAGS
+ CFLAGS=-m64
+ AC_LANG(C)
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([], [ if (sizeof(void*) != 8) return 1;])
+ ],[
+ CFLAGS="$CFLAGS $org_cflags"
+ ],[
+ AC_MSG_ERROR([Don't know how to build a 64-bit object.])
+ ])
+ org_cxxflags=$CXXFLAGS
+ CXXFLAGS=-m64
+ AC_LANG(C++)
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([], [ if (sizeof(void*) != 8) return 1;])
+ ],[
+ CXXFLAGS="$CXXFLAGS $org_cxxflags"
+ ],[
+ AC_MSG_ERROR([Don't know how to build a 64-bit object.])
+ ])
+
+ ])
+dnl ---------------------------------------------------------------------------
+dnl End Macro: 64BIT
+dnl ---------------------------------------------------------------------------
--- /dev/null
+AC_DEFUN([DETECT_BYTEORDER],
+[
+ AC_MSG_CHECKING([for htonll])
+ have_htoll="no"
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <inttypes.h>
+ ], [
+ return htonll(0);
+ ])
+ ], [
+ have_htoll="yes"
+ AC_DEFINE([HAVE_HTONLL], [1], [Have ntohll])
+ ])
+
+ AC_MSG_RESULT([$have_htoll])
+ AM_CONDITIONAL([BUILD_BYTEORDER],[test "x$have_htoll" == "xno"])
+ AC_MSG_CHECKING([byteorder])
+ have_htoll="no"
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <inttypes.h>
+ ], [
+if (htonl(5) != 5) {
+ return 1;
+}
+ ])
+ ], [
+ AC_MSG_RESULT([big endian])
+ AC_DEFINE([BYTEORDER_BIG_ENDIAN], [1], [Enable big endian byteorder])
+ ], [
+ AC_MSG_RESULT([little endian])
+ AC_DEFINE([BYTEORDER_LITTLE_ENDIAN], [1], [Enable little endian byteorder])
+ ])
+])
+
+DETECT_BYTEORDER
--- /dev/null
+dnl ---------------------------------------------------------------------------
+dnl Macro: DEBUG_TEST
+dnl ---------------------------------------------------------------------------
+AC_ARG_ENABLE(debug,
+ [ --enable-debug Build with support for the DEBUG.],
+ [
+ AC_DEFINE([HAVE_DEBUG], [1], [Enables DEBUG Support])
+ AC_CHECK_PROGS(DEBUG, debug)
+ ENABLE_DEBUG="yes"
+ AC_SUBST(DEBUGFLAGS)
+ AC_SUBST(HAVE_DEBUG)
+ ],
+ [
+ ENABLE_DEBUG="no"
+ ]
+ )
+AM_CONDITIONAL([HAVE_DEBUG], [ test "$ENABLE_DEBUG" = "yes" ])
+dnl ---------------------------------------------------------------------------
+dnl End Macro: DEBUG_TEST
+dnl ---------------------------------------------------------------------------
--- /dev/null
+dnl ---------------------------------------------------------------------------
+dnl Macro: DTRACE_TEST
+dnl ---------------------------------------------------------------------------
+AC_ARG_ENABLE(dtrace,
+ [ --enable-dtrace Build with support for the DTRACE.],
+ [
+ AC_PATH_PROG([DTRACE], [dtrace], "no", [/usr/sbin:$PATH])
+ if test "x$DTRACE" != "xno"; then
+ AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
+ DTRACE_HEADER=dtrace_probes.h
+
+ # DTrace on MacOSX does not use -G option
+ $DTRACE -G -o conftest.$$ -s libmemcached/libmemcached_probes.d 2>/dev/zero
+ if test $? -eq 0
+ then
+ DTRACE_OBJ=libmemcached_probes.lo
+ rm conftest.$$
+ fi
+
+ ENABLE_DTRACE="yes"
+ AC_SUBST(HAVE_DTRACE)
+ else
+ AC_MSG_ERROR([Need dtrace binary and OS support.])
+ fi
+ ],
+ [
+ ENABLE_DTRACE="no"
+ ]
+ )
+
+AC_SUBST(DTRACEFLAGS)
+AC_SUBST(DTRACE_HEADER)
+AC_SUBST(DTRACE_OBJ)
+AM_CONDITIONAL([HAVE_DTRACE], [ test "$ENABLE_DTRACE" = "yes" ])
+dnl ---------------------------------------------------------------------------
+dnl End Macro: DTRACE_TEST
+dnl ---------------------------------------------------------------------------
--- /dev/null
+# serial 6 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE. The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+ if test "$MINIX" = yes; then
+ AC_DEFINE([_POSIX_SOURCE], [1],
+ [Define to 1 if you need to in order for `stat' and other
+ things to work.])
+ AC_DEFINE([_POSIX_1_SOURCE], [2],
+ [Define to 2 if the system does not provide POSIX.1 features
+ except with this defined.])
+ AC_DEFINE([_MINIX], [1],
+ [Define to 1 if on MINIX.])
+ fi
+
+ dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+ dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
+ dnl provided.
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_XOPEN_SOURCE], [500],
+ [Define to 500 only on HP-UX.])
+ ;;
+ esac
+
+ AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+# define __EXTENSIONS__ 1
+ ]AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+])# AC_USE_SYSTEM_EXTENSIONS
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
--- /dev/null
+dnl ---------------------------------------------------------------------------
+dnl Macro: HSIEH_HASH
+dnl ---------------------------------------------------------------------------
+AC_ARG_ENABLE(hsieh_hash,
+ [ --enable-hsieh_hash build with support for hsieh hashing.],
+ [
+ if test "x$enableval" != "xno"; then
+ ENABLE_HSIEH="true"
+ AC_DEFINE([HAVE_HSIEH_HASH], [1], [Enables hsieh hashing support])
+ else
+ ENABLE_HSIEH="false"
+ fi
+ ],
+ [
+ ENABLE_HSIEH="false"
+ ]
+)
+
+AM_CONDITIONAL([INCLUDE_HSIEH_SRC], [test "x$ENABLE_HSIEH" = "xtrue"])
+dnl ---------------------------------------------------------------------------
+dnl End Macro: HSIEH_HASH
+dnl ---------------------------------------------------------------------------
--- /dev/null
+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
+
+ # 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])
+])
+
+if test x$MEMC_BINARY == "xno"
+then
+ AC_MSG_ERROR(["could not find memcached binary"])
+fi
+
+AC_DEFINE_UNQUOTED([MEMCACHED_BINARY], "$MEMC_BINARY",
+ [Name of the memcached binary used in make test])
--- /dev/null
+AC_PATH_PROG([POD2MAN], [pod2man], "no", [$PATH:/usr/bin:/usr/local/bin])
+if test "x$POD2MAN" == "xno"; then
+ AC_MSG_ERROR(["Could not find pod2man anywhere in path"])
+fi
+AC_SUBST(POD2MAN)
--- /dev/null
+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"
+ ], [
+ 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"
+
+dnl ---------------------------------------------------------------------------
+dnl End Macro: PROTOCOL_BINARY_TEST
+dnl ---------------------------------------------------------------------------
--- /dev/null
+dnl ---------------------------------------------------------------------------
+dnl Macro: SETSOCKOPT_TEST
+dnl ---------------------------------------------------------------------------
+AC_LANG(C)
+AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <time.h>
+#include <sys/time.h>
+#include <errno.h>
+ ], [
+ int sock = socket(AF_INET, SOCK_STREAM, 0);
+ struct timeval waittime;
+
+ waittime.tv_sec= 0;
+ waittime.tv_usec= 500;
+
+ if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
+ &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
+ if (errno == ENOPROTOOPT) {
+ return 1;
+ }
+ }
+ return 0;
+ ])
+ ], AC_DEFINE(HAVE_SNDTIMEO, 1, [Define to 1 if you have a working SO_SNDTIMEO]))
+
+AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <time.h>
+#include <sys/time.h>
+#include <errno.h>
+ ], [
+ int sock = socket(AF_INET, SOCK_STREAM, 0);
+ struct timeval waittime;
+
+ waittime.tv_sec= 0;
+ waittime.tv_usec= 500;
+
+ if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO,
+ &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
+ if (errno == ENOPROTOOPT) {
+ return 1;
+ }
+ }
+ return 0;
+ ])
+ ], AC_DEFINE(HAVE_RCVTIMEO, 1, [Define to 1 if you have a working SO_RCVTIMEO]))
+
+dnl ---------------------------------------------------------------------------
+dnl End Macro: SETSOCKOPT_TEST
+dnl ---------------------------------------------------------------------------
--- /dev/null
+BUILD_UTILLIB=yes
+
+AC_ARG_ENABLE(utils,
+ [ --enable-utils Build libmemcachedutils [[default=yes]]],
+ [
+ if test "x$enableval" = "xno"; then
+ BUILD_UTILLIB="no"
+ fi
+ ]
+ )
+
+if test "x$BUILD_UTILLIB" = "xyes"; then
+ AC_SEARCH_LIBS(pthread_create, pthread)
+ if test "x$ac_cv_search_pthread_create" = "xno"; then
+ AC_MSG_ERROR([Sorry you need POSIX thread library to build libmemcachedutil.])
+ fi
+ AC_DEFINE([HAVE_LIBMEMCACHEDUTIL], [1], [Enables libmemcachedutil Support])
+fi
+
+AM_CONDITIONAL([BUILD_LIBMEMCACHEDUTIL],[test "x$BUILD_UTILLIB" = "xyes"])