#include "ms_memslap.h"
#include "ms_setting.h"
-#define NO_CPP_DEMANGLE
-#ifndef NO_CPP_DEMANGLE
+#if defined(__cplusplus) && defined(HAVE_ABI_CXA_DEMANGLE)
# include <cxxabi.h>
#endif
break;
const char *symname= dlinfo.dli_sname;
-# ifndef NO_CPP_DEMANGLE
+# if defined(HAVE_ABI_CXA_DEMANGLE) && defined(__cplusplus)
int status;
char *tmp= __cxa_demangle(symname, NULL, 0, &status);
(unsigned)(ip - dlinfo.dli_saddr),
dlinfo.dli_fname);
-# ifndef NO_CPP_DEMANGLE
+# if defined(HAVE_ABI_CXA_DEMANGLE) && defined(__cplusplus)
if (tmp)
free(tmp);
# endif
PANDORA_CANONICAL_TARGET
-#shared library versioning
-MEMCACHED_LIBRARY_VERSION=3:0:0
-# | | |
-# +------+ | +---+
-# | | |
-# current:revision:age
-# | | |
-# | | +- increment if interfaces have been added
-# | | set to zero if interfaces have been removed or changed
-# | +- increment if source code has changed
-# | 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)
-MEMCACHEDPROTOCOL_LIBRARY_VERSION=0:0:0
-AC_SUBST(MEMCACHEDPROTOCOL_LIBRARY_VERSION)
-
-
-# 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)/libmemcached/util/libmemcachedutil.ver"
- LD_PROTOCOL_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmemcached/protocol/libmemcachedprotocol.ver"
-fi
-AC_SUBST(LD_VERSION_SCRIPT)
-AC_SUBST(LD_UTIL_VERSION_SCRIPT)
-AC_SUBST(LD_PROTOCOL_VERSION_SCRIPT)
+AC_SEARCH_LIBS(getopt_long, gnugetopt)
+AC_SEARCH_LIBS(gethostbyname, nsl)
PANDORA_HAVE_LIBEVENT
PANDORA_REQUIRE_PTHREAD
+PANDORA_CXX_DEMANGLE
-AC_SEARCH_LIBS(getopt_long, gnugetopt)
-AC_SEARCH_LIBS(socket, socket)
-AC_SEARCH_LIBS(gethostbyname, nsl)
-
-AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
-
dnl Specialty checks
DETECT_BYTEORDER
ENABLE_UTILLIB
protocol/pedantic.c \
protocol/protocol_handler.c
-libmemcachedprotocol_la_LDFLAGS= -version-info $(MEMCACHEDPROTOCOL_LIBRARY_VERSION) $(LD_PROTOCOL_VERSION_SCRIPT)
+libmemcachedprotocol_la_LDFLAGS= ${AM_LDFLAGS} -version-info 0:0:0
lib_LTLIBRARIES = libmemcached.la libmemcachedprotocol.la
noinst_LTLIBRARIES = libmemcachedcallbacks.la
libmemcached_la_DEPENDENCIES= libmemcachedcallbacks.la
libmemcached_la_LIBADD= $(LIBM) libmemcachedcallbacks.la
-libmemcached_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION) $(LD_VERSION_SCRIPT) $(LIBM)
+libmemcached_la_LDFLAGS= ${AM_LDFLAGS} -version-info 3:0:0
if BUILD_LIBMEMCACHEDUTIL
pkginclude_HEADERS+= memcached_util.h memcached_pool.h
endif
libmemcachedutil_la_SOURCES= util/memcached_pool.c
-libmemcachedutil_la_LDFLAGS= -version-info $(MEMCACHEDUTIL_LIBRARY_VERSION) $(LD_UTIL_VERSION_SCRIPT)
libmemcachedutil_la_LIBADD= libmemcached.la
+libmemcachedutil_la_LDFLAGS= ${AM_LDFLAGS} -version-info 0:0:0
libmemcachedutil_la_DEPENDENCIES=libmemcached.la
if BUILD_BYTEORDER
#ifndef HAVE_HTONLL
LIBMEMCACHED_LOCAL
-extern uint64_t ntohll(uint64_t);
+uint64_t ntohll(uint64_t);
LIBMEMCACHED_LOCAL
-extern uint64_t htonll(uint64_t);
+uint64_t htonll(uint64_t);
#endif
#ifdef linux
LIBMEMCACHED_API
void *memcached_set_user_data(memcached_st *ptr, void *data);
-LIBMEMCACHED_API
+LIBMEMCACHED_LOCAL
memcached_return run_distribution(memcached_st *ptr);
#ifdef __cplusplus
}
dnl with or without modifications, as long as this notice is preserved.
dnl Which version of the canonical setup we're using
-AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.74])
+AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.75])
AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
dnl Force dependency tracking on for Sun Studio builds
PANDORA_LIBTOOL
+ AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
+ AM_LDFLAGS="${AM_LDFLAGS} -Wl,--default-symver"
+ ])
+
dnl autoconf doesn't automatically provide a fail-if-no-C++ macro
dnl so we check c++98 features and fail if we don't have them, mainly
dnl for that reason
dnl alloca - but we need to know it anyway for check_stack_overrun.
PANDORA_STACK_DIRECTION
+ save_LIBS="${LIBS}"
+ LIBS=""
+ AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
+ LIBM="${LIBS}"
+ LIBS="${save_LIBS}"
+ AC_SUBST([LIBM])
+
+ AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
+ AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
+
+
+
PANDORA_OPTIMIZE
AC_LANG_PUSH(C++)
PANDORA_HAVE_GCC_ATOMICS
dnl We need to inject error into the cflags to test if visibility works or not
- dnl save_CFLAGS="${CFLAGS}"
- dnl CFLAGS="${CFLAGS} -Werror"
- dnl gl_VISIBILITY
- dnl CFLAGS="${save_CFLAGS}"
+ save_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} -Werror"
+ gl_VISIBILITY
+ CFLAGS="${save_CFLAGS}"
PANDORA_HEADER_ASSERT
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_CPPFLAGS])
+ AC_SUBST([AM_LDFLAGS])
])
--- /dev/null
+dnl Copyright (C) 2009 Sun Microsystems
+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.
+
+dnl Check for all of the headers and libs that Drizzle needs. We check all
+dnl of these for plugins too, to ensure that all of the appropriate defines
+dnl are set.
+
+AC_DEFUN([PANDORA_CXX_DEMANGLE],[
+ AC_LANG_PUSH([C++])
+ AC_CHECK_HEADERS(cxxabi.h)
+ AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
+ char *foo= 0; int bar= 0;
+ foo= abi::__cxa_demangle(foo, foo, 0, &bar);
+ ]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
+ AC_LANG_POP()
+
+ AS_IF([test "x$pandora_cv_cxa_demangle" = xyes],[
+ AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
+ [Define to 1 if you have the `abi::__cxa_demangle' function.])
+ ])
+])
# and defines HAVE_LIBM etc
#--------------------------------------------------------------------
- AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
-
- AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
- # This may get things to compile even if bind-8 is installed
- AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
-
- # For the sched_yield() function on Solaris
+ # For the sched_yield() function on Solaris
AC_CHECK_FUNC(sched_yield, [],
[AC_CHECK_LIB(posix4, [sched_yield],
[AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
]])
AC_CHECK_TYPES([ulong])
- AC_LANG_PUSH([C++])
- AC_CHECK_HEADERS(cxxabi.h)
- AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
- char *foo= 0; int bar= 0;
- foo= abi::__cxa_demangle(foo, foo, 0, &bar);
- ]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
- AC_LANG_POP([])
-
- AS_IF([test "x$pandora_cv_cxa_demangle" = xyes],[
- AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
- [Define to 1 if you have the `abi::__cxa_demangle' function.])
- ])
-
+ PANDORA_CXX_DEMANGLE
])
/* and re-added when it's back. */
memc->hosts[2].next_retry = time(NULL) - 1;
memc->next_distribution_rebuild= time(NULL) - 1;
- run_distribution(memc);
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION,
+ memc->distribution);
for (int x= 0; x < 99; x++)
{
uint32_t server_idx = memcached_generate_hash(memc, ketama_test_cases[x].key, strlen(ketama_test_cases[x].key));
memcached_quit(memc);
memc->number_of_hosts= 0;
- run_distribution(memc);
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, memc->distribution);
assert(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_USE_UDP, 1) == MEMCACHED_SUCCESS);
assert(memc->flags & MEM_USE_UDP);
assert(memc->flags & MEM_NOREPLY);;