pandora-build v0.75. Also fixed visibility which had accidentally been turned off.
authorMonty Taylor <mordred@inaugust.com>
Wed, 2 Dec 2009 04:43:41 +0000 (20:43 -0800)
committerMonty Taylor <mordred@inaugust.com>
Wed, 2 Dec 2009 04:43:41 +0000 (20:43 -0800)
clients/ms_sigsegv.c
configure.ac
libmemcached/Makefile.am
libmemcached/byteorder.h
libmemcached/memcached.h
m4/pandora_canonical.m4
m4/pandora_cxx_demangle.m4 [new file with mode: 0644]
m4/pandora_drizzle_build.m4
tests/function.c

index a91acc96e8ad4f7cf84691b927eb5741ca4b4579..2cdd3017d8ec49c272ca019e59437943cbe1adce 100644 (file)
@@ -23,8 +23,7 @@
 #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
 
@@ -86,7 +85,7 @@ static void ms_signal_segv(int signum, siginfo_t *info, void *ptr)
       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);
 
@@ -101,7 +100,7 @@ static void ms_signal_segv(int signum, siginfo_t *info, void *ptr)
             (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
index 5198402bd1eb5adb1500792a7791380a49c34aff..c594d67f9360ffc72b3329e119e9e293592fccab 100644 (file)
@@ -14,46 +14,14 @@ AC_CONFIG_MACRO_DIR([m4])
 
 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
index ac9aa101a6cd0aefac1a9fcd8f1f11ff6fef8a3b..360739c5335aab5b9ec7bbc257cfb3a01c7310f1 100644 (file)
@@ -43,7 +43,7 @@ libmemcachedprotocol_la_SOURCES= protocol/ascii_handler.c \
                                  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
@@ -92,7 +92,7 @@ endif
 
 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
@@ -100,8 +100,8 @@ lib_LTLIBRARIES+= libmemcachedutil.la
 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
index 254641f81dfaaf01f56cf3696837e5e4942e1791..99e9f5d196f52e7df4af6b617d2798e5fed3b04a 100644 (file)
@@ -12,9 +12,9 @@
 
 #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
index 722da814d6df773e9b2a24435ad9305fa1c75193..78afa3489faa6f7e75cc77574dbe93190dfc7fb5 100644 (file)
@@ -322,7 +322,7 @@ void *memcached_get_user_data(memcached_st *ptr);
 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
 }
index 5917d28f9cadc6925c5062b83e829fcbe05b80a2..1a0f15ffd7a939ce118bfff88a62b2f9ed7b0f5f 100644 (file)
@@ -4,7 +4,7 @@ dnl gives unlimited permission to copy and/or distribute it,
 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
@@ -82,6 +82,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
 
   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
@@ -154,6 +158,18 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   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++)
@@ -170,10 +186,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   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
 
@@ -208,5 +224,6 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   AC_SUBST([AM_CFLAGS])
   AC_SUBST([AM_CXXFLAGS])
   AC_SUBST([AM_CPPFLAGS])
+  AC_SUBST([AM_LDFLAGS])
 
 ])
diff --git a/m4/pandora_cxx_demangle.m4 b/m4/pandora_cxx_demangle.m4
new file mode 100644 (file)
index 0000000..13a0db1
--- /dev/null
@@ -0,0 +1,24 @@
+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.])
+  ])
+])
index 57941052eb6f59b52991495ce916467941094db2..bcec7f71bad7fc713a92c5a98c3093916597ab35 100644 (file)
@@ -56,13 +56,7 @@ AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
   # 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"])])
@@ -78,19 +72,6 @@ AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
   ]])
   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
 
 ])
index da103cac923e941dc77e583c1f347d32048fe7f4..f1074697d4853d6f820238376beb1bc629740db1 100644 (file)
@@ -2848,7 +2848,8 @@ static test_return_t auto_eject_hosts(memcached_st *trash)
   /* 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));
@@ -4302,7 +4303,7 @@ static test_return_t set_udp_behavior_test(memcached_st *memc)
 
   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);;