diff options
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | libmemcached/connect.cc | 9 | ||||
-rw-r--r-- | libmemcached/csl/context.h | 4 | ||||
-rw-r--r-- | libmemcached/csl/include.am | 5 | ||||
-rw-r--r-- | libmemcached/error.cc | 2 | ||||
-rw-r--r-- | libmemcached/hosts.cc | 2 | ||||
-rw-r--r-- | libmemcached/sasl.cc | 8 | ||||
-rw-r--r-- | libtest/alarm.cc | 29 | ||||
-rw-r--r-- | libtest/comparison.cc | 5 | ||||
-rw-r--r-- | libtest/gearmand.cc | 32 | ||||
-rw-r--r-- | libtest/gearmand.h | 4 | ||||
-rw-r--r-- | libtest/include.am | 5 | ||||
-rw-r--r-- | libtest/server.h | 2 | ||||
-rw-r--r-- | libtest/unittest.cc | 12 | ||||
-rw-r--r-- | m4/ax_assert.m4 | 15 | ||||
-rw-r--r-- | m4/ax_check_library.m4 | 55 | ||||
-rw-r--r-- | m4/ax_cxx_gcc_abi_demangle.m4 | 52 | ||||
-rw-r--r-- | m4/ax_sasl.m4 | 3 | ||||
-rw-r--r-- | m4/libgearman.m4 | 12 | ||||
-rw-r--r-- | man/include.am | 8 | ||||
-rw-r--r-- | rpm/include.am | 2 | ||||
-rw-r--r-- | support/libmemcached.spec.in | 6 | ||||
-rw-r--r-- | tests/include.am | 16 | ||||
-rw-r--r-- | tests/libmemcached-1.0/include.am | 6 | ||||
-rw-r--r-- | tests/parser.cc | 30 |
25 files changed, 164 insertions, 171 deletions
diff --git a/configure.ac b/configure.ac index 7ba72125..5c166a11 100644 --- a/configure.ac +++ b/configure.ac @@ -218,12 +218,13 @@ AC_CHECK_LIB([rt],[clock_gettime], AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Have clock_gettime])], [AC_DEFINE([HAVE_CLOCK_GETTIME],[0],[Have clock_gettime])]) -# Check for the ability to call dlopen +# Check for the ability to call dlopen (used in libhostile) AS_IF([test "x$enable_shared" = xyes], - [AC_CHECK_LIB([dl],[dlopen], - [AC_SUBST([DL_LIB],[-ldl]) - AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])])], - [AC_DEFINE([HAVE_LIBDL],[0],[Have dlopen])]) + [AX_CHECK_LIBRARY([DL],[dlfcn.h],[dl], + [AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen]) + AC_CHECK_LIB([dl],[dlopen],[AC_DEFINE([HAVE_DLOPEN],[1],[Have dlopen])]) + AC_CHECK_LIB([dl],[dladdr],[AC_DEFINE([HAVE_DLADDR],[1],[Have dladdr])])]) + ]) AC_CHECK_HEADERS([atomic.h]) AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"], diff --git a/libmemcached/connect.cc b/libmemcached/connect.cc index 7efdd8fe..aa2c7def 100644 --- a/libmemcached/connect.cc +++ b/libmemcached/connect.cc @@ -155,11 +155,12 @@ static memcached_return_t set_hostinfo(org::libmemcached::Instance* server) server->address_info_next= NULL; } - char str_port[NI_MAXSERV]; - int length= snprintf(str_port, NI_MAXSERV, "%u", uint32_t(server->port())); - if (length >= NI_MAXSERV or length <= 0) + char str_port[MEMCACHED_NI_MAXSERV]; + int length= snprintf(str_port, MEMCACHED_NI_MAXSERV, "%u", uint32_t(server->port())); + if (length >= MEMCACHED_NI_MAXSERV or length <= 0) { - return MEMCACHED_FAILURE; + return memcached_set_error(*server, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, + memcached_literal_param("snprintf(NI_MAXSERV)")); } struct addrinfo hints; diff --git a/libmemcached/csl/context.h b/libmemcached/csl/context.h index 97303c50..8517fdfd 100644 --- a/libmemcached/csl/context.h +++ b/libmemcached/csl/context.h @@ -37,8 +37,8 @@ #pragma once -#include <libmemcached/csl/common.h> -#include <libmemcached/csl/parser.h> +#include "libmemcached/csl/common.h" +#include "libmemcached/csl/parser.h" class Context { diff --git a/libmemcached/csl/include.am b/libmemcached/csl/include.am index fe77aa7d..68489911 100644 --- a/libmemcached/csl/include.am +++ b/libmemcached/csl/include.am @@ -23,7 +23,10 @@ MAINTAINERCLEANFILES+= libmemcached/csl/parser.cc MAINTAINERCLEANFILES+= libmemcached/csl/scanner.h MAINTAINERCLEANFILES+= libmemcached/csl/scanner.cc -BUILT_SOURCES+= libmemcached/csl/parser.h libmemcached/csl/scanner.h +BUILT_SOURCES+= libmemcached/csl/parser.cc +BUILT_SOURCES+= libmemcached/csl/parser.h +BUILT_SOURCES+= libmemcached/csl/scanner.cc +BUILT_SOURCES+= libmemcached/csl/scanner.h libmemcached/csl/parser.h: libmemcached/csl/parser.cc diff --git a/libmemcached/error.cc b/libmemcached/error.cc index 67edcce8..625c3e70 100644 --- a/libmemcached/error.cc +++ b/libmemcached/error.cc @@ -318,7 +318,7 @@ memcached_return_t memcached_set_error(org::libmemcached::Instance& self, memcac return rc; } - char hostname_port[NI_MAXHOST +NI_MAXSERV + sizeof("host : ")]; + char hostname_port[MEMCACHED_NI_MAXHOST +MEMCACHED_NI_MAXSERV + sizeof("host : ")]; size_t size= append_host_to_string(self, hostname_port, sizeof(hostname_port)); memcached_string_t error_host= { hostname_port, size}; diff --git a/libmemcached/hosts.cc b/libmemcached/hosts.cc index 62b362ad..c189d07b 100644 --- a/libmemcached/hosts.cc +++ b/libmemcached/hosts.cc @@ -580,7 +580,7 @@ memcached_return_t memcached_server_add_parsed(memcached_st *ptr, in_port_t port, uint32_t weight) { - char buffer[NI_MAXHOST]; + char buffer[MEMCACHED_NI_MAXHOST]; memcpy(buffer, hostname, hostname_length); buffer[hostname_length]= 0; diff --git a/libmemcached/sasl.cc b/libmemcached/sasl.cc index 721ff791..e4738069 100644 --- a/libmemcached/sasl.cc +++ b/libmemcached/sasl.cc @@ -67,8 +67,8 @@ sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr) */ static memcached_return_t resolve_names(org::libmemcached::Instance& server, char *laddr, size_t laddr_length, char *raddr, size_t raddr_length) { - char host[NI_MAXHOST]; - char port[NI_MAXSERV]; + char host[MEMCACHED_NI_MAXHOST]; + char port[MEMCACHED_NI_MAXSERV]; struct sockaddr_storage saddr; socklen_t salen= sizeof(saddr); @@ -180,8 +180,8 @@ memcached_return_t memcached_sasl_authenticate_connection(org::libmemcached::Ins assert_msg(server->fd != INVALID_SOCKET, "Programmer error, invalid socket"); /* set ip addresses */ - char laddr[NI_MAXHOST + NI_MAXSERV]; - char raddr[NI_MAXHOST + NI_MAXSERV]; + char laddr[MEMCACHED_NI_MAXHOST + MEMCACHED_NI_MAXSERV]; + char raddr[MEMCACHED_NI_MAXHOST + MEMCACHED_NI_MAXSERV]; if (memcached_failed(rc= resolve_names(*server, laddr, sizeof(laddr), raddr, sizeof(raddr)))) { diff --git a/libtest/alarm.cc b/libtest/alarm.cc index 2d662622..93c8ccf7 100644 --- a/libtest/alarm.cc +++ b/libtest/alarm.cc @@ -51,33 +51,42 @@ static const struct itimerval cancel_timer= { default_it_interval, default_it_in void set_alarm() { - if (setitimer(ITIMER_VIRTUAL, &defualt_timer, NULL) == -1) + if (gdb_is_caller() == false) { - Error << "setitimer() failed"; + if (setitimer(ITIMER_VIRTUAL, &defualt_timer, NULL) == -1) + { + Error << "setitimer() failed"; + } } } void set_alarm(long tv_sec, long tv_usec) { + if (gdb_is_caller() == false) + { #if defined(TARGET_OS_OSX) && TARGET_OS_OSX - struct timeval it_value= { time_t(tv_sec), suseconds_t(tv_usec) }; + struct timeval it_value= { time_t(tv_sec), suseconds_t(tv_usec) }; #else - struct timeval it_value= { tv_sec, tv_usec }; + struct timeval it_value= { tv_sec, tv_usec }; #endif - struct itimerval timer= { default_it_interval, it_value }; + struct itimerval timer= { default_it_interval, it_value }; - if (setitimer(ITIMER_VIRTUAL, &timer, NULL) == -1) - { - Error << "setitimer() failed"; + if (setitimer(ITIMER_VIRTUAL, &timer, NULL) == -1) + { + Error << "setitimer() failed"; + } } } void cancel_alarm() { - if (setitimer(ITIMER_VIRTUAL, &cancel_timer, NULL) == -1) + if (gdb_is_caller() == false) { - Error << "setitimer() failed"; + if (setitimer(ITIMER_VIRTUAL, &cancel_timer, NULL) == -1) + { + Error << "setitimer() failed"; + } } } diff --git a/libtest/comparison.cc b/libtest/comparison.cc index c16399db..4a1d99a3 100644 --- a/libtest/comparison.cc +++ b/libtest/comparison.cc @@ -66,6 +66,11 @@ bool gdb_is_caller(void) return true; } + if (bool(getenv("LIBTEST_IN_GDB"))) + { + return true; + } + return false; } diff --git a/libtest/gearmand.cc b/libtest/gearmand.cc index 41a73d3c..8106bec4 100644 --- a/libtest/gearmand.cc +++ b/libtest/gearmand.cc @@ -67,7 +67,7 @@ class Gearmand : public libtest::Server { private: public: - Gearmand(const std::string& host_arg, in_port_t port_arg, const char* binary= GEARMAND_BINARY); + Gearmand(const std::string& host_arg, in_port_t port_arg, bool libtool_, const char* binary); bool ping() { @@ -121,8 +121,8 @@ public: bool build(size_t argc, const char *argv[]); }; -Gearmand::Gearmand(const std::string& host_arg, in_port_t port_arg, const char* binary_arg) : - libtest::Server(host_arg, port_arg, binary_arg, true) +Gearmand::Gearmand(const std::string& host_arg, in_port_t port_arg, bool libtool_, const char* binary_arg) : + libtest::Server(host_arg, port_arg, binary_arg, libtool_) { set_pid_file(); } @@ -146,14 +146,28 @@ bool Gearmand::build(size_t argc, const char *argv[]) namespace libtest { -libtest::Server *build_gearmand(const char *hostname, in_port_t try_port) -{ - return new Gearmand(hostname, try_port); -} - libtest::Server *build_gearmand(const char *hostname, in_port_t try_port, const char* binary) { - return new Gearmand(hostname, try_port, binary); + if (binary == NULL) + { +#if defined(GEARMAND_BINARY) + binary= GEARMAND_BINARY; +#endif + } + + if (binary == NULL) + { + return NULL; + } + + bool is_libtool_script= true; + + if (binary[0] == '/') + { + is_libtool_script= false; + } + + return new Gearmand(hostname, try_port, is_libtool_script, binary); } } diff --git a/libtest/gearmand.h b/libtest/gearmand.h index ef14ce63..41317d7f 100644 --- a/libtest/gearmand.h +++ b/libtest/gearmand.h @@ -40,8 +40,6 @@ namespace libtest { struct Server; } namespace libtest { -libtest::Server *build_gearmand(const char *hostname, in_port_t try_port); - -libtest::Server *build_gearmand(const char *hostname, in_port_t try_port, const char* binary); +libtest::Server *build_gearmand(const char *hostname, in_port_t try_port, const char* binary= NULL); } diff --git a/libtest/include.am b/libtest/include.am index 0e495faf..8a823ba3 100644 --- a/libtest/include.am +++ b/libtest/include.am @@ -12,6 +12,7 @@ DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd MASSIF_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=massif GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb PTRCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-ptrcheck --error-exitcode=1 +PAHOLE_COMMAND= $(LIBTOOL_COMMAND) --mode=execute pahole export LIBTOOL_COMMAND export VALGRIND_COMMAND @@ -171,10 +172,8 @@ endif endif if HAVE_LIBDRIZZLE - libtest_libtest_la_LIBADD+= $(libdrizzle_LIBS) libtest_libtest_la_CXXFLAGS+= $(libdrizzle_CFLAGS) - endif if BUILDING_GEARMAN @@ -190,7 +189,7 @@ libtest_unittest_DEPENDENCIES+= libgearman/libgearman.la libtest_unittest_DEPENDENCIES+= gearmand/gearmand else if HAVE_LIBGEARMAN -libtest_libtest_la_LIBADD+= @LIBGEARMAN_LDFLAGS@ +libtest_libtest_la_LIBADD+= @LIBGEARMAN_LIB@ libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc libtest_libtest_la_SOURCES+= libtest/gearmand.cc libtest_libtest_la_SOURCES+= util/instance.cc diff --git a/libtest/server.h b/libtest/server.h index 7ec3096c..fa524056 100644 --- a/libtest/server.h +++ b/libtest/server.h @@ -281,5 +281,3 @@ private: std::ostream& operator<<(std::ostream& output, const libtest::Server &arg); } // namespace libtest - - diff --git a/libtest/unittest.cc b/libtest/unittest.cc index 0ec3e2ce..0d504477 100644 --- a/libtest/unittest.cc +++ b/libtest/unittest.cc @@ -42,7 +42,7 @@ #include <libmemcached-1.0/memcached.h> #endif -#if defined(LIBTEST_WITH_LIBGEARMAN_SUPPORT) && LIBTEST_WITH_LIBGEARMAN_SUPPORT +#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN #include <libgearman/gearman.h> #endif @@ -771,6 +771,16 @@ static test_return_t check_for_gearman(void *) { test_skip(true, HAVE_LIBGEARMAN); test_skip(true, has_gearmand()); +#if defined(HAVE_GEARMAND_BINARY) && HAVE_GEARMAND_BINARY + if (GEARMAND_BINARY) + { + test_zero(access(GEARMAND_BINARY, X_OK )); + } + else + { + return TEST_SKIPPED; + } +#endif testing_service= "gearmand"; diff --git a/m4/ax_assert.m4 b/m4/ax_assert.m4 index d13787cd..2d88a018 100644 --- a/m4/ax_assert.m4 +++ b/m4/ax_assert.m4 @@ -43,21 +43,20 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#serial 4 +#serial 5 AC_DEFUN([AX_ASSERT], [AC_PREREQ([2.63])dnl AC_REQUIRE([AX_DEBUG]) + AC_REQUIRE([AX_VCS_CHECKOUT]) AC_ARG_ENABLE([assert], [AS_HELP_STRING([--enable-assert], - [Enable assert, this will be overridden by --enable-debug (yes|no) @<:@default=no@:>@])],[ - ax_enable_assert=yes - ],[ - ax_enable_assert=no - ]) + [Enable assert, this will be overridden by --enable-debug (yes|no) @<:@default=no@:>@])], + [ax_enable_assert=yes], + [ax_enable_assert=no]) - AS_IF([ test "$ax_enable_assert" = "yes" -o "$ax_enable_debug" = "yes" ],[ - ax_enable_assert="yes" + AS_IF([ test "$ax_enable_assert" = "yes" -o "$ax_enable_debug" = "yes" -o "$ac_cv_vcs_checkout" = "yes" ], + [ax_enable_assert="yes" AC_DEFINE(NDEBUG,[1],[Define to 1 to enable assert'ing code.]) ]) diff --git a/m4/ax_check_library.m4 b/m4/ax_check_library.m4 index 8177acf0..f8d7962f 100644 --- a/m4/ax_check_library.m4 +++ b/m4/ax_check_library.m4 @@ -32,6 +32,7 @@ # # LICENSE # +# Copyright (c) 2012 Brian Aker <brian@tangent.org> # Copyright (c) 2010 Diego Elio Petteno` <flameeyes@gmail.com> # # This program is free software: you can redistribute it and/or modify it @@ -62,38 +63,34 @@ #serial 6 -AC_DEFUN([AX_CHECK_LIBRARY], [ - AC_ARG_VAR($1[_CPPFLAGS], [C preprocessor flags for ]$1[ headers]) - AC_ARG_VAR($1[_LDFLAGS], [linker flags for ]$1[ libraries]) +AC_DEFUN([AX_CHECK_LIBRARY], + [AC_ARG_VAR($1[_CPPFLAGS],[C preprocessor flags for ]$1[ headers]) + AC_ARG_VAR($1[_LDFLAGS],[linker flags for ]$1[ libraries]) - AC_CACHE_VAL(AS_TR_SH([ax_cv_have_]$1), - [save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - save_LIBS="$LIBS" + AC_CACHE_VAL(AS_TR_SH([ax_cv_have_]$1), + [AX_SAVE_FLAGS - AS_IF([test "x$]$1[_CPPFLAGS" != "x"], - [CPPFLAGS="$CPPFLAGS $]$1[_CPPFLAGS"]) + AS_IF([test "x$]$1[_CPPFLAGS" != "x"], + [CPPFLAGS="$CPPFLAGS $]$1[_CPPFLAGS"]) - AS_IF([test "x$]$1[_LDFLAGS" != "x"], - [LDFLAGS="$LDFLAGS $]$1[_LDFLAGS"]) + AS_IF([test "x$]$1[_LDFLAGS" != "x"], + [LDFLAGS="$LDFLAGS $]$1[_LDFLAGS"]) - AC_CHECK_HEADER($2, [ - AC_CHECK_LIB($3, [main], - [AS_TR_SH([ax_cv_have_]$1)=yes], - [AS_TR_SH([ax_cv_have_]$1)=no]) - ], [AS_TR_SH([ax_cv_have_]$1)=no]) + AC_CHECK_HEADER($2, [ + AC_CHECK_LIB($3, [main], + [AS_TR_SH([ax_cv_have_]$1)=yes], + [AS_TR_SH([ax_cv_have_]$1)=no]) + ], [AS_TR_SH([ax_cv_have_]$1)=no]) - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ]) + AX_RESTORE_FLAGS + ]) - AS_IF([test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"], - [AC_DEFINE([HAVE_]$1, [1], [Define to 1 if ]$1[ is found]) - AC_SUBST($1[_CPPFLAGS]) - AC_SUBST($1[_LDFLAGS]) - AC_SUBST($1[_LIB],[-l]$3) - m4_ifval( m4_normalize([$4]), [$4]), - m4_ifval( m4_normalize([$5]), [$5])]) - AM_CONDITIONAL([HAVE_]$1,[test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"]) - ]) + AS_IF([test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"], + [AC_DEFINE([HAVE_]$1, [1], [Define to 1 if ]$1[ is found]) + AC_SUBST($1[_CPPFLAGS]) + AC_SUBST($1[_LDFLAGS]) + AC_SUBST($1[_LIB],[-l]$3) + ifelse([$4], , :, [$4])], + [ifelse([$5], , :, [$5])]) + AM_CONDITIONAL([HAVE_]$1,[test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"]) + ]) diff --git a/m4/ax_cxx_gcc_abi_demangle.m4 b/m4/ax_cxx_gcc_abi_demangle.m4 index 2da0057e..41ea469e 100644 --- a/m4/ax_cxx_gcc_abi_demangle.m4 +++ b/m4/ax_cxx_gcc_abi_demangle.m4 @@ -16,6 +16,7 @@ # # LICENSE # +# Copyright (c) 2012 Brian Aker <brian@tangent.org> # Copyright (c) 2008 Neil Ferguson <nferguso@eso.org> # # Copying and distribution of this file, with or without modification, are @@ -25,35 +26,32 @@ #serial 9 - AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE], - [AC_CACHE_CHECK([whether the compiler supports GCC C++ ABI name demangling], - [ax_cv_cxx_gcc_abi_demangle], - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [ -#include <typeinfo> +AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE], + [AC_PREREQ([2.63])dnl + AC_CACHE_CHECK([whether the compiler supports GCC C++ ABI name demangling], + [ax_cv_cxx_gcc_abi_demangle], + [AC_LANG_PUSH([C++]) + AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <typeinfo> #include <cxxabi.h> #include <cstdlib> #include <string> + template<typename TYPE> + class A {};]], + [[A<int> instance; + int status = 0; + char* c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status); -template<typename TYPE> class A {}; - ],[ -A<int> instance; -int status = 0; -char* c_name = 0; + std::string name(c_name); + ::free(c_name); -c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status); -std::string name(c_name); -::free(c_name); -return name == "A<int>"; - ])], - [ax_cv_cxx_gcc_abi_demangle=yes], - [ax_cv_cxx_gcc_abi_demangle=no]) - AC_LANG_POP() - ]) - - if test "$ax_cv_cxx_gcc_abi_demangle" = yes; then - AC_DEFINE(HAVE_GCC_ABI_DEMANGLE, [1], [define if the compiler supports GCC C++ ABI name demangling]) - fi - ]) + if (name.compare("A<int>") != 0) + { + return EXIT_FAILURE; + }]])], + [ax_cv_cxx_gcc_abi_demangle=yes], + [ax_cv_cxx_gcc_abi_demangle=no], + [ax_cv_cxx_gcc_abi_demangle=no]) + AC_LANG_POP]) + AS_IF([test "x$ax_cv_cxx_gcc_abi_demangle" = xyes], + [AC_DEFINE([HAVE_GCC_ABI_DEMANGLE],[1],[define if the compiler supports GCC C++ ABI name demangling])]) + ]) diff --git a/m4/ax_sasl.m4 b/m4/ax_sasl.m4 index 303fbd2b..00aaa124 100644 --- a/m4/ax_sasl.m4 +++ b/m4/ax_sasl.m4 @@ -34,7 +34,8 @@ AC_DEFUN([AX_SASL_OPTION], echo "$ax_sasl_check" AS_IF([test "x${ax_sasl_check}" = xyes], [ax_sasl_option=yes], - [AC_MSG_WARN([request to add sasl support failed, please see config.log])]) + [AC_MSG_WARN([request to add sasl support failed, please see config.log]) + ac_enable_sasl=no]) ]) AC_MSG_CHECKING([checking to see if enabling sasl]) diff --git a/m4/libgearman.m4 b/m4/libgearman.m4 index a95c289f..3e3c96d3 100644 --- a/m4/libgearman.m4 +++ b/m4/libgearman.m4 @@ -1,9 +1,5 @@ -# serial 1 +# serial 2 AC_DEFUN([CHECK_FOR_LIBGEARMAND], - [AX_CHECK_LIBRARY([LIBGEARMAN],[libgearman/gearman.h],[gearman], - [ax_check_for_libgearman=yes], - [ax_check_for_libgearman=no]) - AS_IF([test "$ax_check_for_libgearman" = xyes], - [AC_DEFINE([HAVE_LIBGEARMAN],[1],[Enables libgearman Support])], - [AC_DEFINE([HAVE_LIBGEARMAN],[0],[Enables libgearman Support])]) - ]) + [AX_CHECK_LIBRARY([LIBGEARMAN],[libgearman/gearman.h],[gearman],, + [AC_DEFINE([HAVE_LIBGEARMAN],[0],[Define to 1 to compile in libgearman support])]) + ]) diff --git a/man/include.am b/man/include.am index 621fd612..3b68557a 100644 --- a/man/include.am +++ b/man/include.am @@ -3,7 +3,6 @@ # All paths should be given relative to the root if HAVE_RECENT_SPHINX - if IS_VCS_CHECKOUT dist-hook: man @@ -11,10 +10,11 @@ dist-hook: man # Build rule for documentation $(dist_man_MANS): man -endif - BUILT_SOURCES+= $(dist_man_MANS) +endif +endif + dist_man_MANS+= man/memaslap.1 dist_man_MANS+= man/memcapable.1 dist_man_MANS+= man/memcat.1 @@ -133,5 +133,3 @@ dist_man_MANS+= man/memcached_touch.3 dist_man_MANS+= man/memcached_touch_by_key.3 dist_man_MANS+= man/memcached_verbosity.3 dist_man_MANS+= man/memcached_version.3 - -endif diff --git a/rpm/include.am b/rpm/include.am index 16a68c1c..00d37825 100644 --- a/rpm/include.am +++ b/rpm/include.am @@ -16,7 +16,7 @@ rpm-build: support/$(PACKAGE).spec distcheck @rpmbuild -ba support/$(PACKAGE).spec @cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-$(VERSION)*.rpm . @cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-devel-$(VERSION)*.rpm . - @cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-debuginfo-$(VERSION)*.rpm . + -cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-debuginfo-$(VERSION)*.rpm . @cp ~/rpmbuild/SRPMS/$(PACKAGE)-$(VERSION)*.rpm . rpm-sign: rpm-build diff --git a/support/libmemcached.spec.in b/support/libmemcached.spec.in index afbf2b53..fe372404 100644 --- a/support/libmemcached.spec.in +++ b/support/libmemcached.spec.in @@ -10,7 +10,6 @@ Source0: http://download.tangent.org/libmemcached-%{version}.tar.gz # For test suite BuildRequires: bash BuildRequires: binutils -BuildRequires: ccache BuildRequires: coreutils BuildRequires: cpio BuildRequires: cyrus-sasl-devel @@ -20,7 +19,6 @@ BuildRequires: file BuildRequires: findutils BuildRequires: gawk BuildRequires: gcc -BuildRequires: gdb BuildRequires: glibc BuildRequires: glibc-common BuildRequires: glibc-devel @@ -31,14 +29,10 @@ BuildRequires: hostname BuildRequires: libevent-devel BuildRequires: libstdc++-devel BuildRequires: libuuid-devel -BuildRequires: llvm-libs BuildRequires: make BuildRequires: memcached -BuildRequires: mysql-libs BuildRequires: pkgconfig -BuildRequires: protobuf-devel BuildRequires: python-sphinx -BuildRequires: qt3 BuildRequires: sed BuildRequires: tar diff --git a/tests/include.am b/tests/include.am index 8f064c65..288e276b 100644 --- a/tests/include.am +++ b/tests/include.am @@ -13,10 +13,6 @@ TESTS_LDADDS+= libmemcached/libmemcached.la TESTS_LDADDS+= libmemcached/libmemcachedutil.la TESTS_LDADDS+= libtest/libtest.la -DEBUG_COMMAND= $(LIBTOOL) --mode=execute gdb - -PAHOLE_COMMAND= $(LIBTOOL) --mode=execute pahole - EXTRA_DIST+= tests/cpp_example.cc noinst_HEADERS+= tests/exist.h @@ -62,7 +58,7 @@ test-failure: tests/failure @tests/failure gdb-failure: tests/failure - @$(DEBUG_COMMAND) tests/failure + @$(GDB_COMMAND) tests/failure tests_testhashkit_SOURCES= tests/hashkit_functions.cc @@ -108,19 +104,19 @@ pahole-mem: tests/testapp @$(PAHOLE_COMMAND) tests/testapp gdb-mem: tests/libmemcached-1.0/testapp - @$(DEBUG_COMMAND) tests/libmemcached-1.0/testapp + @$(GDB_COMMAND) tests/libmemcached-1.0/testapp gdb-atom: tests/atomsmasher - @$(DEBUG_COMMAND) tests/atomsmasher + @$(GDB_COMMAND) tests/atomsmasher gdb-hash: tests/testhashkit - @$(DEBUG_COMMAND) tests/testhashkit + @$(GDB_COMMAND) tests/testhashkit gdb-hashplus: tests/hash_plus - @$(DEBUG_COMMAND) tests/hash_plus + @$(GDB_COMMAND) tests/hash_plus gdb-cycle: tests/cycle - @$(DEBUG_COMMAND) tests/cycle + @$(GDB_COMMAND) tests/cycle valgrind-cycle: tests/cycle $(VALGRIND_COMMAND) tests/cycle diff --git a/tests/libmemcached-1.0/include.am b/tests/libmemcached-1.0/include.am index 499123d8..228f72a0 100644 --- a/tests/libmemcached-1.0/include.am +++ b/tests/libmemcached-1.0/include.am @@ -178,7 +178,7 @@ test-socket: tests/libmemcached-1.0/testsocket @tests/libmemcached-1.0/testsocket gdb-socket: tests/libmemcached-1.0/testsocket - @$(DEBUG_COMMAND) tests/libmemcached-1.0/testsocket + @$(GDB_COMMAND) tests/libmemcached-1.0/testsocket tests_libmemcached_1_0_sasl_SOURCES= tests_libmemcached_1_0_sasl_DEPENDENCIES= @@ -225,7 +225,7 @@ test-sasl: tests/libmemcached-1.0/sasl @tests/libmemcached-1.0/sasl gdb-sasl: tests/libmemcached-1.0/sasl - @$(DEBUG_COMMAND) tests/libmemcached-1.0/sasl + @$(GDB_COMMAND) tests/libmemcached-1.0/sasl tests_atomsmasher_SOURCES= tests_atomsmasher_DEPENDENCIES= @@ -287,7 +287,7 @@ test-plus: tests/testplus @tests/testplus gdb-plus: tests/testplus - $(DEBUG_COMMAND) tests/testplus + $(GDB_COMMAND) tests/testplus valgrind-plus: tests/testplus @$(VALGRIND_COMMAND) tests/testplus diff --git a/tests/parser.cc b/tests/parser.cc index b4da1dff..33b05de9 100644 --- a/tests/parser.cc +++ b/tests/parser.cc @@ -58,10 +58,7 @@ static test_return_t memcached_zero_string_length_TEST(void*) static test_return_t putenv_localhost_quoted_TEST(void*) { - char set_env[1024]; - - snprintf(set_env, sizeof(set_env), "LIBMEMCACHED=\"--server=localhost\""); - test_zero(putenv(set_env)); + test_zero(setenv("LIBMEMCACHED", "\"--server=localhost\"", 1)); test_null(memcached(NULL, 0)); return TEST_SUCCESS; @@ -69,24 +66,7 @@ static test_return_t putenv_localhost_quoted_TEST(void*) static test_return_t putenv_NULL_TEST(void*) { - char set_env[1024]; - - snprintf(set_env, sizeof(set_env), "LIBMEMCACHED"); - test_zero(putenv(set_env)); - memcached_st *memc= memcached(NULL, 0); - test_true(memc); - - memcached_free(memc); - - return TEST_SUCCESS; -} - -static test_return_t putenv_NULL_TEST2(void*) -{ - char set_env[1024]; - - snprintf(set_env, sizeof(set_env), "LIBMEMCACHED="); - test_zero(putenv(set_env)); + test_zero(setenv("LIBMEMCACHED", "", 1)); memcached_st *memc= memcached(NULL, 0); test_true(memc); @@ -97,10 +77,7 @@ static test_return_t putenv_NULL_TEST2(void*) static test_return_t putenv_localhost_TEST(void*) { - char set_env[1024]; - - snprintf(set_env, sizeof(set_env), "LIBMEMCACHED=--server=localhost"); - test_zero(putenv(set_env)); + test_zero(setenv("LIBMEMCACHED", "--server=localhost", 1)); memcached_st *memc= memcached(NULL, 0); test_true(memc); @@ -114,7 +91,6 @@ test_st memcached_TESTS[] ={ {"memcached(\"value\", 0)", false, (test_callback_fn*)memcached_zero_string_length_TEST }, {"putenv(LIBMEMCACHED=--server=localhost)", false, (test_callback_fn*)putenv_localhost_TEST }, {"putenv(LIBMEMCACHED)", false, (test_callback_fn*)putenv_NULL_TEST }, - {"putenv(LIBMEMCACHED=)", false, (test_callback_fn*)putenv_NULL_TEST2 }, {"putenv(LIBMEMCACHED=--server=\"localhost\")", false, (test_callback_fn*)putenv_localhost_quoted_TEST }, {0, 0, 0} }; |