From: Continuous Integration Date: Thu, 25 Oct 2012 17:26:38 +0000 (-0400) Subject: Merge lp:~tangent-org/libmemcached/1.0-build Build: jenkins-Libmemcached-1.0-89 X-Git-Tag: 1.0.14~20 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=fa5dde3af5a99cda67d0ab005393cfd1627bd3d5;hp=3893029e70c654f4fcf3bf8f8ba5b404afc6d446;p=awesomized%2Flibmemcached Merge lp:~tangent-org/libmemcached/1.0-build Build: jenkins-Libmemcached-1.0-89 --- diff --git a/ChangeLog b/ChangeLog index ddb4be3b..6679d8c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +1.0.14 +* + 1.0.13 Fri Oct 19 00:09:28 EDT 2012 * Fix bug that caused version string to not be exported correctly. diff --git a/Makefile.am b/Makefile.am index c6b23a43..dcf1519a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,17 +39,29 @@ include libtest/include.am include libhashkit-1.0/include.am include libmemcached-1.0/include.am + +if BUILD_LIBMEMCACHED_PROTOCOL include libmemcachedprotocol-0.0/include.am +endif + include libmemcachedutil-1.0/include.am include clients/include.am include docs/include.am include man/include.am + +if BUILD_LIBMEMCACHED_PROTOCOL include example/include.am +endif + include libhashkit/include.am include libmemcached/include.am include libmemcachedutil/include.am + +if BUILD_LIBMEMCACHED_PROTOCOL include libmemcachedprotocol/include.am +endif + include libmemcachedinternal/include.am include libmemcachedinternal/util/include.am include poll/include.am @@ -128,5 +140,5 @@ maintainer-clean-local: -rmdir build-aux install-website: html-local - @rm -r -f /var/www/libmemcached/* + -rm -r -f /var/www/libmemcached/* @cp -r docs/html /var/www/libmemcached diff --git a/bootstrap.sh b/bootstrap.sh index 40b28299..ad4751a6 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -49,19 +49,30 @@ command_not_found_handle () exit 127 } -die () +function die () { echo "$BASH_SOURCE:$BASH_LINENO: $@" >&2 exit 1; } +function nassert () +{ + local param_name=\$"$1" + local param_value=`eval "expr \"$param_name\" "` + + if [ -n "$param_value" ]; then + echo "$bash_source:$bash_lineno: assert($param_name) had value of "$param_value"" >&2 + exit 1 + fi +} + function assert () { local param_name=\$"$1" local param_value=`eval "expr \"$param_name\" "` if [ -z "$param_value" ]; then - echo "$BASH_SOURCE:$BASH_LINENO: assert($param_name)" >&2 + echo "$bash_source:$bash_lineno: assert($param_name)" >&2 exit 1 fi } @@ -343,7 +354,7 @@ pop_TESTS_ENVIRONMENT () fi } -safe_pushd () +function safe_pushd () { pushd $1 &> /dev/null ; @@ -352,7 +363,7 @@ safe_pushd () fi } -safe_popd () +function safe_popd () { local directory_to_delete=`pwd` popd &> /dev/null ; @@ -365,7 +376,7 @@ safe_popd () fi } -make_valgrind () +function make_valgrind () { if [[ "$VENDOR_DISTRIBUTION" == 'darwin' ]]; then make_darwin_malloc @@ -394,8 +405,10 @@ make_valgrind () push_TESTS_ENVIRONMENT + # If we don't have a configure, then most likely we will be missing libtool + assert_file 'configure' if [[ -f 'libtool' ]]; then - TESTS_ENVIRONMENT="$LIBTOOL_COMMAND $VALGRIND_COMMAND" + TESTS_ENVIRONMENT="./libtool --mode=execute $VALGRIND_COMMAND" else TESTS_ENVIRONMENT="$VALGRIND_COMMAND" fi @@ -405,7 +418,7 @@ make_valgrind () pop_TESTS_ENVIRONMENT } -make_install_system () +function make_install_system () { local INSTALL_LOCATION=$(mktemp -d /tmp/XXXXXXXXXX) push_PREFIX_ARG $INSTALL_LOCATION @@ -437,7 +450,7 @@ make_install_system () safe_popd } -make_darwin_malloc () +function make_darwin_malloc () { run_configure_if_required @@ -455,7 +468,7 @@ make_darwin_malloc () MallocScribble=$old_MallocScribble } -snapshot_check () +function snapshot_check () { if [ -n "$BOOTSTRAP_SNAPSHOT_CHECK" ]; then assert_file "$BOOTSTRAP_SNAPSHOT_CHECK" 'snapshot check failed' @@ -463,7 +476,7 @@ snapshot_check () } # This will reset our environment, and make sure built files are available. -make_for_snapshot () +function make_for_snapshot () { # Make sure it is clean make_maintainer_clean @@ -479,8 +492,28 @@ make_for_snapshot () snapshot_check } +function make_for_mingw32 () +{ + # Make sure it is clean + if [ -f Makefile -o -f configure ]; then + make_maintainer_clean + fi + assert_no_file 'Makefile' + + if command_exists mingw32-configure; then + run_autoreconf + + mingw32-configure || die 'mingw32-configure failed' + assert_file 'Makefile' + + if command_exists mingw32-make; then + mingw32-make || die 'mingw32-make failed' + fi + fi +} + # If we are locally testing, we should make sure the environment is setup correctly -check_for_jenkins () +function check_for_jenkins () { if ! $jenkins_build_environment; then echo "Not inside of jenkins" @@ -495,7 +528,18 @@ check_for_jenkins () fi } -make_for_continuus_integration () +function make_universe () +{ + make_for_snapshot + make_valgrind + make_gdb + make_rpm + make_for_mingw32 + make_distcheck + make_install_system +} + +function make_for_continuus_integration () { # Setup the environment if we are local check_for_jenkins @@ -556,8 +600,7 @@ make_for_continuus_integration () make_install_system ;; *) - run_configure - make_all + make_jenkins_default ;; esac @@ -566,7 +609,19 @@ make_for_continuus_integration () safe_popd } -make_gdb () +# The point to this test is to test bootstrap.sh itself +function self_test () +{ + # We start off with a clean env + make_maintainer_clean + + eval "./bootstrap.sh jenkins" || die "failed 'jenkins'" + eval "./bootstrap.sh all" || die "failed 'all'" + eval "./bootstrap.sh gdb" || die "failed 'gdb'" + eval "./bootstrap.sh maintainer-clean" || die "failed 'maintainer-clean'" +} + +function make_gdb () { run_configure_if_required @@ -579,8 +634,10 @@ make_gdb () setup_gdb_command fi - if [ -f 'libtool' ]; then - TESTS_ENVIRONMENT="$LIBTOOL_COMMAND $GDB_COMMAND" + # If we don't have a configure, then most likely we will be missing libtool + assert_file 'configure' + if [[ -f 'libtool' ]]; then + TESTS_ENVIRONMENT="./libtool --mode=execute $GDB_COMMAND" else TESTS_ENVIRONMENT="$GDB_COMMAND" fi @@ -604,7 +661,7 @@ make_gdb () # $1 target to compile # $2 to die, or not to die, based on contents -make_target () +function make_target () { if [[ -z "$1" ]]; then die "Programmer error, no target provided for make" @@ -630,34 +687,43 @@ make_target () fi } -make_distcheck () +function make_distcheck () { make_target 'distcheck' } -make_rpm () +function make_rpm () { - run_configure_if_required - make_target 'rpm' + if [ -f 'rpm.am' -o -d 'rpm' ]; then + run_configure_if_required + make_target 'rpm' + fi } -make_maintainer_clean () +function make_maintainer_clean () { run_configure_if_required make_target 'maintainer-clean' 'no_error' } -make_check () +function make_check () { make_target 'check' } -make_all () +function make_jenkins_default () { + run_configure make_target 'all' } -run_configure_if_required () +function make_default () +{ + run_configure_if_required + make_target 'all' +} + +function run_configure_if_required () { run_autoreconf_if_required @@ -668,7 +734,7 @@ run_configure_if_required () assert_file 'Makefile' 'configure did not produce a Makefile' } -run_autoreconf_if_required () +function run_autoreconf_if_required () { if [ ! -x 'configure' ]; then run_autoreconf @@ -677,7 +743,7 @@ run_autoreconf_if_required () assert_exec_file 'configure' } -run_autoreconf () +function run_autoreconf () { if [[ -z "$AUTORECONF" ]]; then die "Programmer error, tried to call run_autoreconf () but AUTORECONF was not set" @@ -699,7 +765,9 @@ function run () parse_command_line_options () { - local SHORTOPTS=':apcmt:dv' + local SHORTOPTS=':apcmt:dvh' + + nassert MAKE_TARGET while getopts "$SHORTOPTS" opt; do case $opt in @@ -727,6 +795,10 @@ parse_command_line_options () DEBUG_OPTION=true enable_debug ;; + h) # help + echo "bootstrap.sh [options] optional_target ..." + exit + ;; v) # verbose VERBOSE_OPTION=true VERBOSE=true @@ -742,8 +814,10 @@ parse_command_line_options () esac done + shift $((OPTIND-1)) + if [ -n "$1" ]; then - MAKE_TARGET="$1" + MAKE_TARGET="$@" fi } @@ -776,8 +850,14 @@ autoreconf_setup () fi fi + if [ "$VCS_CHECKOUT" ]; then + if $DEBUG; then + MAKE="$MAKE --warn-undefined-variables" + fi + fi + if $DEBUG; then - MAKE="$MAKE --warn-undefined-variables" + MAKE="$MAKE -d" fi fi @@ -949,6 +1029,8 @@ make_for_autoreconf () check_make_target() { case $1 in + 'self') + ;; 'gdb') ;; 'clean_op') @@ -959,10 +1041,16 @@ check_make_target() ;; 'configure') ;; - 'rpm') + 'distcheck') + ;; + 'check') ;; 'snapshot') ;; + 'mingw') + ;; + 'universe') + ;; 'valgrind') ;; 'jenkins') @@ -975,6 +1063,12 @@ check_make_target() ;; 'all') ;; + 'test-*') + ;; + 'valgrind-*') + ;; + 'gdb-*') + ;; 'dist') ;; *) @@ -983,7 +1077,7 @@ check_make_target() esac } -bootstrap () +function bootstrap () { determine_target_platform @@ -992,6 +1086,10 @@ bootstrap () # Set up whatever we need to do to use autoreconf later autoreconf_setup + if [ -z "$MAKE_TARGET" ]; then + MAKE_TARGET="make_default" + fi + if $PRINT_SETUP_OPTION -o $DEBUG; then echo print_setup @@ -1003,11 +1101,6 @@ bootstrap () fi fi - # Setup LIBTOOL_COMMAND if we need it - if [ -f 'libtool' ]; then - LIBTOOL_COMMAND='./libtool --mode=execute' - fi - # Use OLD_TESTS_ENVIRONMENT for tracking the state of the variable local OLD_TESTS_ENVIRONMENT= @@ -1016,15 +1109,22 @@ bootstrap () push_PREFIX_ARG $PREFIX fi - # Either we run a known target (or error), or we default to "all" - if [[ -n "$MAKE_TARGET" ]]; then + # We should always have a target by this point + assert MAKE_TARGET + local MAKE_TARGET_ARRAY=($MAKE_TARGET) + + for target in "${MAKE_TARGET_ARRAY[@]}" + do # If we are running inside of Jenkins, we want to only run some of the possible tests if $jenkins_build_environment; then - check_make_target $MAKE_TARGET + check_make_target $target fi - case $MAKE_TARGET in + case $target in + 'self') + self_test + ;; 'gdb') make_gdb ;; @@ -1040,6 +1140,13 @@ bootstrap () 'configure') run_configure ;; + 'default') + make + run_configure + ;; + 'mingw') + make_for_mingw32 + ;; 'snapshot') make_for_snapshot ;; @@ -1049,18 +1156,18 @@ bootstrap () 'valgrind') make_valgrind ;; + 'universe') + make_universe + ;; 'jenkins') make_for_continuus_integration ;; *) run_configure_if_required - make_target $MAKE_TARGET + make_target "$target" ;; esac - else - run_configure_if_required - make_all - fi + done } main () @@ -1108,15 +1215,15 @@ main () rebuild_host_os no_output + parse_command_line_options $@ + # If we are running under Jenkins we predetermine what tests we will run against # This MAKE_TARGET can be overridden by parse_command_line_options based MAKE_TARGET changes. # We don't want Jenkins overriding other variables, so we NULL them. - if $jenkins_build_environment; then + if [ -z "$MAKE_TARGET" -a $jenkins_build_environment ]; then MAKE_TARGET='jenkins' fi - parse_command_line_options $@ - bootstrap jobs -l diff --git a/clients/memaslap.c b/clients/memaslap.c index 8053775c..764707b5 100644 --- a/clients/memaslap.c +++ b/clients/memaslap.c @@ -18,15 +18,13 @@ #include #include #include -#if TIME_WITH_SYS_TIME + +#if defined(HAVE_SYS_TIME_H) # include +#endif + +#if defined(HAVE_TIME_H) # include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif diff --git a/clients/ms_conn.c b/clients/ms_conn.c index b4d5f673..2a65f6cf 100644 --- a/clients/ms_conn.c +++ b/clients/ms_conn.c @@ -20,16 +20,15 @@ #include #include #include -#if TIME_WITH_SYS_TIME + +#if defined(HAVE_SYS_TIME_H) # include +#endif + +#if defined(HAVE_TIME_H) # include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif + #include "ms_setting.h" #include "ms_thread.h" #include "ms_atomic.h" diff --git a/clients/ms_task.c b/clients/ms_task.c index 7e7921fc..083b46f4 100644 --- a/clients/ms_task.c +++ b/clients/ms_task.c @@ -11,16 +11,12 @@ #include "config.h" -#include -#if TIME_WITH_SYS_TIME +#if defined(HAVE_SYS_TIME_H) # include +#endif + +#if defined(HAVE_TIME_H) # include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif #include "ms_thread.h" diff --git a/clients/ms_thread.c b/clients/ms_thread.c index 1efe5cfb..2405e6ad 100644 --- a/clients/ms_thread.c +++ b/clients/ms_thread.c @@ -11,16 +11,14 @@ #include "config.h" -#if TIME_WITH_SYS_TIME +#if defined(HAVE_SYS_TIME_H) # include +#endif + +#if defined(HAVE_TIME_H) # include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif + #include "ms_thread.h" #include "ms_setting.h" #include "ms_atomic.h" diff --git a/clients/utilities.h b/clients/utilities.h index da973b5f..a9f199d5 100644 --- a/clients/utilities.h +++ b/clients/utilities.h @@ -15,17 +15,15 @@ #include #include "clients/client_options.h" -#if TIME_WITH_SYS_TIME +#if defined(HAVE_SYS_TIME_H) # include +#endif + +#if defined(HAVE_TIME_H) # include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif + #ifdef __sun /* For some odd reason the option struct on solaris defines the argument * as char* and not const char* diff --git a/configure.ac b/configure.ac index eb896f52..9e3f72ac 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ # Use and distribution licensed under the BSD license. See # the COPYING file in this directory for full text. -AC_INIT([libmemcached],[1.0.13],[http://libmemcached.org/]) +AC_INIT([libmemcached],[1.0.14],[http://libmemcached.org/]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) @@ -59,6 +59,20 @@ AS_IF([ test "$ax_cv_cxx_stdcxx_98" = no ],[ AC_MSG_ERROR([Your system lacks a new enough C++ compiler]) ]) +AC_DEFUN([LIBMEMCACHED_PROTOCOL], + [AC_ARG_ENABLE([libmemcachedprotocol], + [AS_HELP_STRING([--enable-libmemcachedprotocol], + [Enable libmemcachedprotocol])], + [ax_enable_libmemcachedprotocol=yes], + [ax_enable_libmemcachedprotocol=no]) + + AM_CONDITIONAL([BUILD_LIBMEMCACHED_PROTOCOL],[test "$ax_enable_libmemcachedprotocol" = "yes"]) + + AC_MSG_CHECKING([for libmemcachedprotocol]) + AC_MSG_RESULT([$ax_enable_libmemcachedprotocol]) + ]) +LIBMEMCACHED_PROTOCOL + # Adding support for libtest m4_include([libtest/yatl.m4]) @@ -103,12 +117,12 @@ AC_CHECK_HEADERS([fcntl.h]) AC_CHECK_HEADERS([inttypes.h]) AC_CHECK_HEADERS([libintl.h]) AC_CHECK_HEADERS([limits.h]) -AC_CHECK_HEADERS([malloc.h]) AC_CHECK_HEADERS([math.h]) AC_CHECK_HEADERS([netdb.h]) AC_CHECK_HEADERS([netinet/in.h]) AC_CHECK_HEADERS([netinet/tcp.h]) AC_CHECK_HEADERS([pthread.h]) +AC_CHECK_HEADERS([spawn.h]) AC_CHECK_HEADERS([stdarg.h]) AC_CHECK_HEADERS([stddef.h]) AC_CHECK_HEADERS([stdio.h]) @@ -116,9 +130,13 @@ AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([sys/socket.h]) AC_CHECK_HEADERS([sys/sysctl.h]) AC_CHECK_HEADERS([sys/time.h]) +AC_CHECK_HEADERS([sys/un.h]) AC_CHECK_HEADERS([time.h]) AC_CHECK_HEADERS([unistd.h]) -AC_HEADER_TIME + +# Windows only +AC_CHECK_HEADERS([winsock2.h]) +AC_CHECK_HEADERS([ws2tcpip.h]) # Checks for typedefs, structures, and compiler characteristics. @@ -146,8 +164,6 @@ AC_CHECK_FUNCS([strtoull]) AC_FUNC_ALLOCA AC_FUNC_ERROR_AT_LINE AC_FUNC_FORK -AC_FUNC_MALLOC -AC_FUNC_REALLOC AC_FUNC_STRERROR_R AC_CHECK_HEADER([umem.h], [ diff --git a/libhashkit/common.h b/libhashkit/common.h index 5b0b8e0b..e1343971 100644 --- a/libhashkit/common.h +++ b/libhashkit/common.h @@ -54,10 +54,8 @@ extern "C" { #endif -HASHKIT_LOCAL void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result); -HASHKIT_LOCAL int update_continuum(hashkit_st *hashkit); #ifdef __cplusplus diff --git a/libmemcached-1.0/platform.h b/libmemcached-1.0/platform.h index 763febaa..6f43ca2c 100644 --- a/libmemcached-1.0/platform.h +++ b/libmemcached-1.0/platform.h @@ -46,11 +46,17 @@ typedef short in_port_t; typedef SOCKET memcached_socket_t; #else typedef int memcached_socket_t; + #include + #include + #include + #include + #include + #include #endif /* WIN32 */ diff --git a/libmemcached-1.0/struct/server.h b/libmemcached-1.0/struct/server.h index a8a30565..33bdc049 100644 --- a/libmemcached-1.0/struct/server.h +++ b/libmemcached-1.0/struct/server.h @@ -38,20 +38,20 @@ #pragma once -#ifndef WIN32 -#include +#ifdef HAVE_NETDB_H +# include #endif #ifdef NI_MAXHOST -#define MEMCACHED_NI_MAXHOST NI_MAXHOST +# define MEMCACHED_NI_MAXHOST NI_MAXHOST #else -#define MEMCACHED_NI_MAXHOST 1025 +# define MEMCACHED_NI_MAXHOST 1025 #endif #ifdef NI_MAXSERV -#define MEMCACHED_NI_MAXSERV NI_MAXSERV +# define MEMCACHED_NI_MAXSERV NI_MAXSERV #else -#define MEMCACHED_NI_MAXSERV 32 +# define MEMCACHED_NI_MAXSERV 32 #endif enum memcached_server_state_t { diff --git a/libmemcached/assert.hpp b/libmemcached/assert.hpp index 6858879c..28948c3c 100644 --- a/libmemcached/assert.hpp +++ b/libmemcached/assert.hpp @@ -37,9 +37,6 @@ #pragma once -#include -#include - #ifdef NDEBUG #define assert_msg(__expr, __mesg) (void)(__expr); (void)(__mesg); #else diff --git a/libmemcached/backtrace.cc b/libmemcached/backtrace.cc index 81cfddef..d2979016 100644 --- a/libmemcached/backtrace.cc +++ b/libmemcached/backtrace.cc @@ -37,10 +37,6 @@ #include -#include -#include -#include - #ifdef HAVE_EXECINFO_H # include #endif diff --git a/libmemcached/byteorder.cc b/libmemcached/byteorder.cc index 7e141756..1a96d987 100644 --- a/libmemcached/byteorder.cc +++ b/libmemcached/byteorder.cc @@ -58,28 +58,21 @@ static inline uint64_t swap64(uint64_t in) } #endif -#ifdef HAVE_HTONLL uint64_t memcached_ntohll(uint64_t value) { +#ifdef HAVE_HTONLL return ntohll(value); -} - -uint64_t memcached_htonll(uint64_t value) -{ - return htonll(value); -} - -#else // HAVE_HTONLL - -uint64_t memcached_ntohll(uint64_t value) -{ +#else return swap64(value); +#endif } uint64_t memcached_htonll(uint64_t value) { +#ifdef HAVE_HTONLL + return htonll(value); +#else return swap64(value); +#endif } - -#endif // HAVE_HTONLL diff --git a/libmemcached/byteorder.h b/libmemcached/byteorder.h index 92687c1d..a7d108d3 100644 --- a/libmemcached/byteorder.h +++ b/libmemcached/byteorder.h @@ -41,10 +41,8 @@ extern "C" { #endif -LIBMEMCACHED_LOCAL uint64_t memcached_ntohll(uint64_t); -LIBMEMCACHED_LOCAL uint64_t memcached_htonll(uint64_t); #ifdef __cplusplus diff --git a/libmemcached/common.h b/libmemcached/common.h index 5c86eb16..5a76faf6 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -45,48 +45,66 @@ #include #ifdef __cplusplus -# include -# include -# include -# include -# include -# include -# include +# include +# include +# include +# include +# include +# include +# include +# include #else -# ifdef HAVE_STDLIB_H -# include -# endif -# ifdef HAVE_STDLIB_H -# include -# endif -# include +# ifdef HAVE_STDDEF_H +# include +# endif +# ifdef HAVE_STDLIB_H +# include +# endif +# ifdef HAVE_STDLIB_H +# include +# endif +# include +# ifdef HAVE_TIME_H # include -# ifdef HAVE_ERRNO_H -# include -# endif -# ifdef HAVE_LIMITS_H -# include -# endif +# endif +# ifdef HAVE_ERRNO_H +# include +# endif +# ifdef HAVE_LIMITS_H +# include +# endif +#endif + +#ifdef HAVE_SYS_UN_H +# include +#endif + +#ifdef HAVE_SYS_TIME_H +# include #endif #ifdef HAVE_FCNTL_H -# include +# include #endif #ifdef HAVE_SYS_TYPES_H -# include +# include #endif #ifdef HAVE_UNISTD_H -# include +# include +#endif + +#ifdef HAVE_SYS_SOCKET_H +# include #endif #ifdef HAVE_STRINGS_H -# include +# include #endif #ifdef HAVE_DLFCN_H -# include +# include #endif #include diff --git a/libmemcached/connect.cc b/libmemcached/connect.cc index 65be51a0..4e7e24bf 100644 --- a/libmemcached/connect.cc +++ b/libmemcached/connect.cc @@ -39,15 +39,13 @@ #include #include -#include -#include #ifndef SOCK_CLOEXEC # define SOCK_CLOEXEC 0 #endif #ifndef SOCK_NONBLOCK -# define SOCK_NONBLOCK 0 +# define SOCK_NONBLOCK 0 #endif #ifndef FD_CLOEXEC diff --git a/libmemcached/csl/parser.yy b/libmemcached/csl/parser.yy index 486fb4b3..4fed2754 100644 --- a/libmemcached/csl/parser.yy +++ b/libmemcached/csl/parser.yy @@ -96,14 +96,14 @@ inline void __config_error(Context *context, yyscan_t *scanner, const char *erro %token COMMENT %token END -%token ERROR +%token CSL_ERROR %token RESET %token PARSER_DEBUG %token INCLUDE %token CONFIGURE_FILE %token EMPTY_LINE %token SERVER -%token SOCKET +%token CSL_SOCKET %token SERVERS %token SERVERS_OPTION %token UNKNOWN_OPTION @@ -165,13 +165,13 @@ inline void __config_error(Context *context, yyscan_t *scanner, const char *erro %token RANDOM /* Boolean values */ -%token TRUE -%token FALSE +%token CSL_TRUE +%token CSL_FALSE %nonassoc ',' %nonassoc '=' -%token FLOAT +%token CSL_FLOAT %token NUMBER %token PORT %token WEIGHT_START @@ -208,7 +208,7 @@ statement: context->set_end(); YYACCEPT; } - | ERROR + | CSL_ERROR { context->rc= MEMCACHED_PARSE_USER_ERROR; parser_abort(context, "ERROR called directly"); @@ -252,7 +252,7 @@ expression: } context->unset_server(); } - | SOCKET string optional_weight + | CSL_SOCKET string optional_weight { if (memcached_failed(context->rc= memcached_server_add_unix_socket_with_weight(context->memc, $2.c_str, uint32_t($3)))) { diff --git a/libmemcached/csl/scanner.l b/libmemcached/csl/scanner.l index 5a341906..e35008a8 100644 --- a/libmemcached/csl/scanner.l +++ b/libmemcached/csl/scanner.l @@ -67,9 +67,6 @@ %{ -#include -#include - #define PARAM yyget_extra(yyscanner) #define get_lex_chars(buffer, result, max_size, context) \ @@ -129,7 +126,7 @@ "--SERVER=" { yyextra->begin= yytext; yyextra->set_server(); return yyextra->previous_token= SERVER; } -"--SOCKET=" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET; } +"--SOCKET=" { yyextra->begin= yytext; return yyextra->previous_token= CSL_SOCKET; } "--BINARY-PROTOCOL" { yyextra->begin= yytext; return yyextra->previous_token= BINARY_PROTOCOL; } "--BUFFER-REQUESTS" { yyextra->begin= yytext; return yyextra->previous_token= BUFFER_REQUESTS; } @@ -172,10 +169,10 @@ RESET { yyextra->begin= yytext; return yyextra->previous_token= RESET; DEBUG { yyextra->begin= yytext; return yyextra->previous_token= PARSER_DEBUG; } SERVERS { yyextra->begin= yytext; return yyextra->previous_token= SERVERS; } END { yyextra->begin= yytext; return yyextra->previous_token= END; } -ERROR { yyextra->begin= yytext; return yyextra->previous_token= ERROR; } +CSL_ERROR { yyextra->begin= yytext; return yyextra->previous_token= CSL_ERROR; } -TRUE { return yyextra->previous_token= TRUE; } -FALSE { return yyextra->previous_token= FALSE; } +TRUE { return yyextra->previous_token= CSL_TRUE; } +FALSE { return yyextra->previous_token= CSL_FALSE; } "--"[[:alnum:]]* { diff --git a/libmemcached/server.hpp b/libmemcached/server.hpp index 351b34be..8cbdc151 100644 --- a/libmemcached/server.hpp +++ b/libmemcached/server.hpp @@ -60,12 +60,12 @@ void __server_free(memcached_server_st *); static inline bool memcached_is_valid_servername(const memcached_string_t& arg) { - return (arg.c_str != NULL or arg.size == 0) and arg.size < NI_MAXHOST; + return (arg.c_str != NULL or arg.size == 0) and arg.size < MEMCACHED_NI_MAXHOST; } static inline bool memcached_is_valid_filename(const memcached_string_t& arg) { - return arg.c_str != NULL and arg.size > 0 and arg.size < NI_MAXHOST; + return arg.c_str != NULL and arg.size > 0 and arg.size < MEMCACHED_NI_MAXHOST; } void memcached_instance_free(org::libmemcached::Instance *); diff --git a/libmemcachedprotocol/binary_handler.c b/libmemcachedprotocol/binary_handler.c index d720424a..851c8751 100644 --- a/libmemcachedprotocol/binary_handler.c +++ b/libmemcachedprotocol/binary_handler.c @@ -76,7 +76,7 @@ static protocol_binary_response_status raw_response_handler(const void *cookie, return PROTOCOL_BINARY_RESPONSE_EINTERNAL; } - size_t len= sizeof(protocol_binary_response_header) + htonl(response->response.bodylen); + size_t len= sizeof(protocol_binary_response_header) + memcached_htonl(response->response.bodylen); size_t offset= 0; char *ptr= (void*)response; diff --git a/libmemcachedprotocol/handler.c b/libmemcachedprotocol/handler.c index 59b461f6..2a639055 100644 --- a/libmemcachedprotocol/handler.c +++ b/libmemcachedprotocol/handler.c @@ -46,6 +46,9 @@ #include #include +#include +#include + /* ** ********************************************************************** ** INTERNAL INTERFACE diff --git a/libmemcachedutil/common.h b/libmemcachedutil/common.h index 5c7b59f4..ec00877a 100644 --- a/libmemcachedutil/common.h +++ b/libmemcachedutil/common.h @@ -38,7 +38,11 @@ #pragma once -#include +#include "config.h" + +#include +#include +#include #include #include diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc index d4dd970b..ce98acb1 100644 --- a/libtest/cmdline.cc +++ b/libtest/cmdline.cc @@ -45,8 +45,6 @@ using namespace libtest; #include #include #include -#include -#include #include #include #include @@ -435,7 +433,7 @@ Application::error_t Application::join() } _app_exit_state= Application::SIGTERM_KILLED; - Error << "waitpid() application terminated at request" + Out << "waitpid() application terminated at request" << " pid:" << _pid << " name:" << built_argv[0]; } diff --git a/libtest/cmdline.h b/libtest/cmdline.h index ae4d9ba1..ca7098dd 100644 --- a/libtest/cmdline.h +++ b/libtest/cmdline.h @@ -36,18 +36,24 @@ #pragma once -#include +#ifdef HAVE_SPAWN_H +# include +#endif + +/* + http://www.gnu.org/software/automake/manual/automake.html#Tests + When no test protocol is in use, an exit status of 0 from a test script will denote a success, an exit status of 77 a skipped test, an exit status of 99 an hard error, and any other exit status will denote a failure. +*/ -// http://www.gnu.org/software/automake/manual/automake.html#Using-the-TAP-test-protocol #define EXIT_SKIP 77 -#define EXIT_FATAL 77 +#define EXIT_FATAL 99 #ifndef EX_NOEXEC -# define EX_NOEXEC 126 +# define EX_NOEXEC 126 #endif #ifndef EX_NOTFOUND -# define EX_NOTFOUND 127 +# define EX_NOTFOUND 127 #endif namespace libtest { diff --git a/libtest/common.h b/libtest/common.h index 4d8d5724..20b48258 100644 --- a/libtest/common.h +++ b/libtest/common.h @@ -65,6 +65,28 @@ #include #endif +#ifdef HAVE_NETDB_H +# include +#endif + +#ifdef HAVE_NETINET_IN_H +# include +#endif + +#ifdef HAVE_ARPA_INET_H +# include +#endif + +#ifdef HAVE_POLL_H +# include +#else +# include "poll/poll.h" +#endif + +#ifdef HAVE_SPAWN_H +# include +#endif + #include #include diff --git a/libtest/drizzled.h b/libtest/drizzled.h index c3e3055a..3bc37555 100644 --- a/libtest/drizzled.h +++ b/libtest/drizzled.h @@ -36,8 +36,6 @@ #pragma once -#include - namespace libtest { struct Server; } namespace libtest { diff --git a/libtest/gearmand.h b/libtest/gearmand.h index 49c08c9f..ef14ce63 100644 --- a/libtest/gearmand.h +++ b/libtest/gearmand.h @@ -36,8 +36,6 @@ #pragma once -#include - namespace libtest { struct Server; } namespace libtest { diff --git a/libtest/server.h b/libtest/server.h index f27ce08f..c4e7579c 100644 --- a/libtest/server.h +++ b/libtest/server.h @@ -41,8 +41,15 @@ #include #include #include -#include -#include + +#ifdef HAVE_NETDB_H +# include +#endif + +#ifdef HAVE_NETINET_IN_H +# include +#endif + #include #include #include diff --git a/libtest/server_container.h b/libtest/server_container.h index b8743033..6eadc6d5 100644 --- a/libtest/server_container.h +++ b/libtest/server_container.h @@ -39,8 +39,7 @@ #include #include #include -#include -#include + #include #include #include diff --git a/libtest/test.hpp b/libtest/test.hpp index bdcccdc0..576f3014 100644 --- a/libtest/test.hpp +++ b/libtest/test.hpp @@ -40,7 +40,14 @@ #include #include -#include + +#ifdef HAVE_ARPA_INET_H +# include +#endif + +#ifdef HAVE_NETINET_IN_H +# include +#endif #include #include diff --git a/libtest/tmpfile.cc b/libtest/tmpfile.cc index d2457e2b..a576a4a1 100644 --- a/libtest/tmpfile.cc +++ b/libtest/tmpfile.cc @@ -34,6 +34,7 @@ * */ +#include "config.h" #include namespace libtest { diff --git a/m4/ax_compiler_version.m4 b/m4/ax_compiler_version.m4 index a277a9e7..da897bc2 100644 --- a/m4/ax_compiler_version.m4 +++ b/m4/ax_compiler_version.m4 @@ -4,8 +4,8 @@ # # SYNOPSIS # -# AX_C_COMPILER_VERSION -# AX_CXX_COMPILER_VERSION +# AX_C_COMPILER_VERSION() +# AX_CXX_COMPILER_VERSION() # # DESCRIPTION # @@ -44,37 +44,65 @@ # (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 3 +#serial 4 AC_DEFUN([AX_C_COMPILER_VERSION],[ AC_REQUIRE([AX_COMPILER_VENDOR]) - AC_MSG_CHECKING("C Compiler version") + AC_MSG_CHECKING([C Compiler version]) - AC_CHECK_DECL([__GNUC_PATCHLEVEL__],[GNUCC="yes"], [GNUCC="no"]) - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"],[SUNCC="no"]) - AC_CHECK_DECL([__ICC], [INTELCC="yes"],[INTELCC="no"]) - AC_CHECK_DECL([__clang__], [CLANG="yes"],[CLANG="no"]) + ax_cv_c_compiler_version_vendor="$ax_cv_c_compiler_vendor" - ax_cc_version=unknown - AS_IF([test "$ax_cc_version" = "unknown"],[AS_IF([test "$SUNCC" = "yes"],[ax_cc_version=`$CC -V 2>&1 | sed 1q`])]) - AS_IF([test "$ax_cc_version" = "unknown"],[AS_IF([test "$CLANG" = "yes"],[ax_cc_version=`$CC --version 2>&1 | sed 1q` ])]) - AS_IF([test "$ax_cc_version" = "unknown"],[AS_IF([test "$INTELCC" = "yes"],[ax_cc_version=`$CC --version 2>&1 | sed 1q` ])]) - AS_IF([test "$ax_cc_version" = "unknown"],[AS_IF([test "$GNUCC" = "yes"],[ax_cc_version=`$CC --version | sed 1q` ])]) + AC_CHECK_DECL([__GNUC_PATCHLEVEL__],[ + GNUCC=yes + ],[GNUCC=no]) + AC_MSG_CHECKING([GNUCC]) + AC_MSG_RESULT([$GNUCC]) - AC_MSG_RESULT(["$ax_cc_version"]) - AC_SUBST([CC_VERSION],["$ax_cc_version"]) + AC_CHECK_DECL([__SUNPRO_C],[SUNCC=yes],[SUNCC=no]) + AC_MSG_CHECKING([SUNCC]) + AC_MSG_RESULT([$SUNCC]) + + AC_CHECK_DECL([__ICC],[INTELCC=yes],[INTELCC=no]) + AC_MSG_CHECKING([INTELCC]) + AC_MSG_RESULT([$INTELCC]) + + AC_CHECK_DECL([__clang__],[CLANG=yes],[CLANG=no]) + AC_MSG_CHECKING([CLANG]) + AC_MSG_RESULT([$CLANG]) + + AC_CHECK_DECL([__MINGW32__],[ + MINGW=yes + ax_cv_c_compiler_version_vendor=mingw + ],[MINGW=no]) + AC_MSG_CHECKING([MINGW]) + AC_MSG_RESULT([$MINGW]) + + AS_CASE(["$ax_cv_c_compiler_version_vendor"],[ + sun],[ax_c_compiler_version=`$CC -V 2>&1 | sed 1q`],[ + intel],[ax_c_compiler_version=`$CC --version 2>&1 | sed 1q`],[ + clang],[ax_c_compiler_version=`$CC --version 2>&1 | sed 1q`],[ + gnu],[ax_c_compiler_version=`$CC --version | sed 1q`],[ + mingw],[ax_c_compiler_version=`$CC --version | sed 1q`],[ + ax_c_compiler_version=unknown]) + + AC_MSG_RESULT(["$ax_c_compiler_version"]) + AC_SUBST([CC_VERSION_VENDOR],["$ax_cv_c_compiler_version_vendor"]) + AC_SUBST([CC_VERSION],["$ax_c_compiler_version"]) ]) - AC_DEFUN([AX_CXX_COMPILER_VERSION], [ + AC_DEFUN([AX_CXX_COMPILER_VERSION],[ AC_REQUIRE([AX_C_COMPILER_VERSION]) - AC_MSG_CHECKING("C++ Compiler version") + AC_MSG_CHECKING([C++ Compiler version]) - ax_cxx_version=unknown - AS_IF([test "$ax_cxx_version" = "unknown"],[AS_IF([test "$GNUCC" = "yes"],[ax_cxx_version=`$CXX --version | sed 1q`])]) - AS_IF([test "$ax_cxx_version" = "unknown"],[AS_IF([test "$SUNCC" = "yes"],[ax_cxx_version=`$CXX -V 2>&1 | sed 1q`])]) - AS_IF([test "$ax_cxx_version" = "unknown"],[AS_IF([test "$CLANG" = "yes"],[ax_cxx_version=`$CXX --version 2>&1 | sed 1q`])]) - AS_IF([test "$ax_cxx_version" = "unknown"],[AS_IF([test "$INTELCC" = "yes"],[ax_cc_version=`$CCX --version 2>&1 | sed 1q` ])]) + AS_CASE(["$ax_cv_c_compiler_version_vendor"],[ + sun],[ax_cxx_compiler_version=`$CC -V 2>&1 | sed 1q`],[ + intel],[ax_cxx_compiler_version=`$CC --version 2>&1 | sed 1q`],[ + clang],[ax_cxx_compiler_version=`$CC --version 2>&1 | sed 1q`],[ + gnu],[ax_cxx_compiler_version=`$CC --version | sed 1q`],[ + mingw],[ax_cxx_compiler_version=`$CC --version | sed 1q`],[ + ax_cxx_compiler_version=unknown]) - AC_MSG_RESULT(["$ax_cxx_version"]) - AC_SUBST([CXX_VERSION], ["$ax_cxx_version"]) + AC_MSG_RESULT(["$ax_cxx_compiler_version"]) + AC_SUBST([CXX_VERSION_VENDOR],["$ax_cv_c_compiler_version_vendor"]) + AC_SUBST([CXX_VERSION],["$ax_cxx_compiler_version"]) ]) diff --git a/support/libmemcached.spec.in b/support/libmemcached.spec.in index 6660ac5d..1530ee5c 100644 --- a/support/libmemcached.spec.in +++ b/support/libmemcached.spec.in @@ -113,18 +113,14 @@ you will need to install %{name}-devel. %exclude %{_libdir}/libmemcached.la %exclude %{_libdir}/libhashkit.la %exclude %{_libdir}/libmemcachedutil.la -%exclude %{_libdir}/libmemcachedprotocol.la %exclude %{_libdir}/libmemcached.a %exclude %{_libdir}/libhashkit.a %exclude %{_libdir}/libmemcachedutil.a -%exclude %{_libdir}/libmemcachedprotocol.a %{_libdir}/libhashkit.so.2.0.0 %{_libdir}/libmemcached.so.11.0.0 %{_libdir}/libmemcachedutil.so.2.0.0 -%{_libdir}/libmemcachedprotocol.so.0.0.0 %{_libdir}/libhashkit.so.2 %{_libdir}/libmemcached.so.11 -%{_libdir}/libmemcachedprotocol.so.0 %{_libdir}/libmemcachedutil.so.2 %{_mandir}/man1/memaslap.1.gz %{_mandir}/man1/memcapable.1.gz @@ -160,11 +156,6 @@ you will need to install %{name}-devel. %{_includedir}/libhashkit-1.0/types.h %{_includedir}/libhashkit-1.0/visibility.h -%{_includedir}/libmemcachedprotocol-0.0/binary.h -%{_includedir}/libmemcachedprotocol-0.0/callback.h -%{_includedir}/libmemcachedprotocol-0.0/handler.h -%{_includedir}/libmemcachedprotocol-0.0/vbucket.h - %{_includedir}/libmemcachedutil-1.0/util.h %{_includedir}/libmemcachedutil-1.0/flush.h %{_includedir}/libmemcachedutil-1.0/pid.h @@ -239,7 +230,6 @@ you will need to install %{name}-devel. %{_libdir}/libhashkit.so %{_libdir}/libmemcached.so -%{_libdir}/libmemcachedprotocol.so %{_libdir}/libmemcachedutil.so %{_libdir}/pkgconfig/libmemcached.pc %{_mandir}/man3/hashkit_clone.3.gz diff --git a/tests/memdump.cc b/tests/memdump.cc index 840c1a17..e34d1b08 100644 --- a/tests/memdump.cc +++ b/tests/memdump.cc @@ -67,7 +67,7 @@ static test_return_t server_test(void *) snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); const char *args[]= { buffer, 0 }; - test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); + test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE); return TEST_SUCCESS; } @@ -91,7 +91,7 @@ static test_return_t FOUND_test(void *) test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); test_compare(MEMCACHED_SUCCESS, rc); - test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); + test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE); memcached_free(memc); @@ -121,6 +121,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error) if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false) { error= TEST_FAILURE; + return NULL; } return &servers; diff --git a/util/instance.hpp b/util/instance.hpp index bd9aeaa4..1855ef8d 100644 --- a/util/instance.hpp +++ b/util/instance.hpp @@ -37,7 +37,6 @@ #pragma once -#include #include #include #include diff --git a/win32/include.am b/win32/include.am index 43e8d9b1..9552bc73 100644 --- a/win32/include.am +++ b/win32/include.am @@ -6,6 +6,8 @@ noinst_HEADERS+= win32/wrappers.h if BUILD_WIN32_WRAPPERS libhashkit_libhashkit_la_LDFLAGS+=-no-undefined libmemcached_libmemcached_la_LDFLAGS+=-no-undefined +if BUILD_LIBMEMCACHED_PROTOCOL libmemcached_libmemcachedprotocol_la_LDFLAGS+=-no-undefined +endif libmemcached_libmemcachedutil_la_LDFLAGS+=-no-undefined endif