From d4c5a2229396c74f3e66767f01ce4c8853eba92b Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 1 Dec 2009 20:43:41 -0800 Subject: [PATCH] pandora-build v0.75. Also fixed visibility which had accidentally been turned off. --- clients/ms_sigsegv.c | 7 +++---- configure.ac | 38 +++---------------------------------- libmemcached/Makefile.am | 6 +++--- libmemcached/byteorder.h | 4 ++-- libmemcached/memcached.h | 2 +- m4/pandora_canonical.m4 | 27 +++++++++++++++++++++----- m4/pandora_cxx_demangle.m4 | 24 +++++++++++++++++++++++ m4/pandora_drizzle_build.m4 | 23 ++-------------------- tests/function.c | 5 +++-- 9 files changed, 63 insertions(+), 73 deletions(-) create mode 100644 m4/pandora_cxx_demangle.m4 diff --git a/clients/ms_sigsegv.c b/clients/ms_sigsegv.c index a91acc96..2cdd3017 100644 --- a/clients/ms_sigsegv.c +++ b/clients/ms_sigsegv.c @@ -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 #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 diff --git a/configure.ac b/configure.ac index 5198402b..c594d67f 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/libmemcached/Makefile.am b/libmemcached/Makefile.am index ac9aa101..360739c5 100644 --- a/libmemcached/Makefile.am +++ b/libmemcached/Makefile.am @@ -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 diff --git a/libmemcached/byteorder.h b/libmemcached/byteorder.h index 254641f8..99e9f5d1 100644 --- a/libmemcached/byteorder.h +++ b/libmemcached/byteorder.h @@ -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 diff --git a/libmemcached/memcached.h b/libmemcached/memcached.h index 722da814..78afa348 100644 --- a/libmemcached/memcached.h +++ b/libmemcached/memcached.h @@ -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 } diff --git a/m4/pandora_canonical.m4 b/m4/pandora_canonical.m4 index 5917d28f..1a0f15ff 100644 --- a/m4/pandora_canonical.m4 +++ b/m4/pandora_canonical.m4 @@ -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 index 00000000..13a0db15 --- /dev/null +++ b/m4/pandora_cxx_demangle.m4 @@ -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 ]], [[ + 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.]) + ]) +]) diff --git a/m4/pandora_drizzle_build.m4 b/m4/pandora_drizzle_build.m4 index 57941052..bcec7f71 100644 --- a/m4/pandora_drizzle_build.m4 +++ b/m4/pandora_drizzle_build.m4 @@ -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 ]], [[ - 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 ]) diff --git a/tests/function.c b/tests/function.c index da103cac..f1074697 100644 --- a/tests/function.c +++ b/tests/function.c @@ -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);; -- 2.30.2