tests/testapp
tests/testplus
tests/udptest
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+libtool.m4
-ACLOCAL_AMFLAGS = -I config
+ACLOCAL_AMFLAGS = -I m4
SUBDIRS = docs libmemcached libmemcachedutil tests support clients
EXTRA_dist = README.FIRST
+check-local: test-no-outputdiff
+
test: all
@(cd tests; ${MAKE} test)
+++ /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 m4"
# AUTOHEADER=${AUTOHEADER:-autoheader}
# AUTOMAKE=${AUTOMAKE:-automake}
AUTOMAKE_FLAGS="--add-missing --copy --force"
fi
-run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
-run $AUTOHEADER || die "Can't execute autoheader"
-
# --force means overwrite ltmain.sh script if it already exists
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
+run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
+run $AUTOHEADER || die "Can't execute autoheader"
+
# --add-missing instructs automake to install missing auxiliary files
# and --force to overwrite them if they already exist
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake"
+++ /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"])
# | set to zero if current is incremented
# +- increment if interfaces have been added, removed or changed
AC_SUBST(MEMCACHED_LIBRARY_VERSION)
+MEMCACHEDUTIL_LIBRARY_VERSION=0:0:0
+AC_SUBST(MEMCACHEDUTIL_LIBRARY_VERSION)
AM_INIT_AUTOMAKE(nostdinc no-define -Wall -Werror)
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CXX
AC_PROG_LIBTOOL
AM_SANITY_CHECK
-LIBTOOL="$LIBTOOL --preserve-dup-deps"
-AC_SUBST(LIBTOOL)dnl
+
+AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+
# libmemcached versioning when linked with GNU ld.
if test "$lt_cv_prog_gnu_ld" = "yes"
then
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmemcached/libmemcached.ver"
+ LD_UTIL_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmemcachedutil/libmemcachedutil.ver"
fi
AC_SUBST(LD_VERSION_SCRIPT)
+AC_SUBST(LD_UTIL_VERSION_SCRIPT)
AC_C_CONST
AC_HEADER_TIME
AC_SEARCH_LIBS(getopt_long, gnugetopt)
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
+
+save_LIBS="$LIBS"
+LIBS="$LIBS -lm"
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+ ]],[[
+ float f= floorf((float) 1.0);
+ ]],
+ [LIBM="-lm"],[LIBM=""])])
+
+AC_SUBST(LIBM)
+LIBS="$save_LIBS"
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?
building_from_hg=no
fi
+
# We only support GCC and Sun's forte at the moment
if test "$GCC" = "yes"
then
+ if test "$ENABLE_DEBUG" = "yes"
+ then
+ CFLAGS="-O0 -DHAVE_DEBUG $CFLAGS"
+ CXXFLAGS="-O0 -DHAVE_DEBUG $CXXFLAGS"
+ else
+ CFLAGS="-O3 $CFLAGS"
+ CXXFLAGS="-O3 $CXXFLAGS"
+ fi
if test "$building_from_hg" = "yes"
then
CFLAGS="-Werror $CFLAGS"
CXXFLAGS="-Werror $CXXFLAGS"
fi
- CFLAGS="-W -std=iso9899:1999 -Wall -Wextra -Wno-strict-aliasing -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -O3 -ggdb $CFLAGS"
- CXXFLAGS="-W -Wall -Wextra -Wno-strict-aliasing -pedantic -Wundef -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast -Weffc++ -Wconversion -Wmissing-declarations -Wredundant-decls -O3 -ggdb $CXXFLAGS"
+ CFLAGS="-W -std=iso9899:1999 -Wall -Wextra -Wno-strict-aliasing -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -ggdb3 $CFLAGS"
+ CXXFLAGS="-W -Wall -Wextra -Wno-strict-aliasing -pedantic -Wundef -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast -Weffc++ -Wconversion -Wmissing-declarations -Wredundant-decls -ggdb3 $CXXFLAGS"
+
+
+fi
+
+if test "$SUNCC" = "yes"
+then
if test "$ENABLE_DEBUG" = "yes"
then
- CFLAGS="$CFLAGS -ggdb -DHAVE_DEBUG"
+ CFLAGS="-xO0 -DHAVE_DEBUG $CFLAGS"
+ CXXFLAGS="-xO0 -DHAVE_DEBUG $CXXFLAGS"
+ else
+ CFLAGS="-xO4 -xlibmil -xdepend $CFLAGS"
+ CXXFLAGS="-xO4 -xlibmil -xdepend $CXXFLAGS"
fi
-else
- CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -errfmt=error -errwarn -errshort=tags $CFLAGS"
- CXXFLAGS="+w +w2 -xwe -mt -D_FORTEC_ $CXXFLAGS"
- if test "$ENABLE_DEBUG" = "yes"
+ if test "$building_from_hg" = "yes"
then
- CFLAGS="$CFLAGS -DHAVE_DEBUG"
- CXXFLAGS="$CXXFLAGS -DHAVE_DEBUG"
+ CFLAGS="-errwarn $CFLAGS"
+ CXXFLAGS="-errwarn $CXXFLAGS"
fi
+ CFLAGS="-Xa -xstrconst -mt -errfmt=error -errshort=tags ${CFLAGS}"
+ CXXFLAGS="+w +w2 -xwe -mt ${CXXFLAGS}"
fi
CXXFLAGS=""
CPPFLAGS=""
-AC_CONFIG_FILES([Makefile clients/Makefile tests/Makefile docs/Makefile libmemcached/Makefile libmemcachedutil/Makefile support/Makefile support/libmemcached.pc support/libmemcached.spec support/libmemcached-fc.spec])
+AC_CONFIG_FILES([
+ Makefile
+ clients/Makefile
+ tests/Makefile
+ docs/Makefile
+ libmemcached/Makefile
+ libmemcachedutil/Makefile
+ support/Makefile
+ support/libmemcached.pc
+ support/libmemcached.spec
+ support/libmemcached-fc.spec
+ ])
AC_OUTPUT
=head1 NAME
-memcached_behavior_get memcached_behavior_set - Manipulate behavior
+memcached_behavior_get, memcached_behavior_set - Manipulate behavior
=head1 LIBRARY
=head1 NAME
-memcached_callback_get memcached_callback_set - Get and set a callback
+memcached_callback_get, memcached_callback_set - Get and set a callback
=head1 LIBRARY
=head1 NAME
-memcached_stat memcached_stat_servername memcached_stat_get_value memcached_stat_get_keys - Get statistics
+memcached_stat, memcached_stat_servername, memcached_stat_get_value, memcached_stat_get_keys - Get memcached statistics
=head1 LIBRARY
DEFS += -DMEMCACHED_INTERNAL
libmemcached_la_DEPENDENCIES = @DTRACE_OBJ@
-libmemcached_la_LIBADD = @DTRACE_OBJ@
+libmemcached_la_LIBADD = @DTRACE_OBJ@ $(LIBM)
libmemcached_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION) $(LD_VERSION_SCRIPT) $(LIBM)
dtrace_probes.h: libmemcached_probes.d
-LIBS = @LIBS@
+EXTRA_DIST= libmemcachedutil.ver
lib_LTLIBRARIES=
+
if BUILD_LIBMEMCACHEDUTIL
lib_LTLIBRARIES+= libmemcachedutil.la
endif
libmemcachedutil_la_SOURCES= memcached_pool.c
+libmemcachedutil_la_LDFLAGS= -version-info $(MEMCACHEDUTIL_LIBRARY_VERSION) $(LD_UTIL_VERSION_SCRIPT)
+libmemcachedutil_la_LIBADD= ${top_builddir}/libmemcached/libmemcached.la
--- /dev/null
+libmemcachedutil_0 { global: *; };
--- /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:/usr/perl5/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"])