diff options
author | Continuous Integration <ci@tangent.org> | 2014-02-01 06:30:50 -0800 |
---|---|---|
committer | Continuous Integration <ci@tangent.org> | 2014-02-01 06:30:50 -0800 |
commit | ecb8ed2090d2bc35c4ffe5febe1ba465d3e0be5d (patch) | |
tree | aab5bca3401820803829e83a4c6f6a0d71c4cb2b | |
parent | 983dbab68778496de22a9b03bc935e035de43e34 (diff) | |
parent | 8a04c53710520be5a4d37b6acb682045a6c41faf (diff) | |
download | libmemcached-ecb8ed2090d2bc35c4ffe5febe1ba465d3e0be5d.tar.gz |
Merge lp:~brianaker/libmemcached/1215783 Build: jenkins-Libmemcached-438
-rw-r--r-- | .quickly | 5 | ||||
-rw-r--r-- | GNUmakefile | 36 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rwxr-xr-x | bootstrap.sh | 59 | ||||
-rw-r--r-- | clients/include.am | 2 | ||||
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | libmemcached/virtual_bucket.c | 11 | ||||
-rw-r--r-- | libtest/formatter.cc | 88 | ||||
-rw-r--r-- | m4/ax_compiler_vendor.m4 | 5 | ||||
-rw-r--r-- | m4/ax_pthread.m4 | 4 | ||||
-rw-r--r-- | m4/ax_restore_flags.m4 | 41 | ||||
-rw-r--r-- | m4/ax_save_flags.m4 | 60 |
12 files changed, 238 insertions, 87 deletions
diff --git a/.quickly b/.quickly deleted file mode 100644 index 637e364c..00000000 --- a/.quickly +++ /dev/null @@ -1,5 +0,0 @@ -project = libmemcached -version = 0.4.2 -template = pandora-build -project-type = library -pandora-version = 0.175 diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 00000000..33ec5acc --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,36 @@ +# -*-Makefile-*- +# +_bootstrap_Makefile := $(wildcard [M]akefile) +_bootstrap_config-status := $(wildcard config.status) + +ALL_RECURSIVE_TARGETS= + +ifneq ($(_bootstrap_Makefile),) + include Makefile +else + ifneq ($(_bt_config-status),) + $(srcdir)/config.status + $(MAKE) $(AM_MAKEFLAGS) configure + endif + +.DEFAULT_GOAL:= basic_build +srcdir= . + +configure: bootstrap.sh + @$(srcdir)/bootstrap.sh -a + +Makefile: configure + @$(srcdir)/bootstrap.sh -c + +.PHONY: basic_build +basic_build: Makefile + @$(MAKE) $(AM_MAKEFLAGS) +endif + +ALL_RECURSIVE_TARGETS+= $(AM_RECURSIVE_TARGETS) + +ifneq ($(word 2, $(MAKECMDGOALS)), ) +ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), ) +.NOTPARALLEL: +endif +endif diff --git a/Makefile.am b/Makefile.am index cc65cb78..7432e682 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,6 @@ MAINTAINERCLEANFILES= DISTCLEANFILES+= aminclude.am -EXTRA_DIST+= .quickly EXTRA_DIST+= README.FIRST EXTRA_DIST+= README.win32 @@ -152,5 +151,7 @@ maintainer-clean-local: -rm -f m4/ltsugar.m4 -rm -f m4/ltversion.m4 -rm -f m4/lt~obsolete.m4 + -rm -f m4/test-driver -rmdir build-aux -rm -rf ${top_builddir}/html + -rm -f bootstrap diff --git a/bootstrap.sh b/bootstrap.sh index 06f6fbe0..d45c9194 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -404,10 +404,6 @@ run_configure () # Arguments for configure local BUILD_CONFIGURE_ARG='' - if $jenkins_build_environment; then - BUILD_CONFIGURE_ARG="--disable-silent-rules " - fi - # If debug is set we enable both debug and asssert, otherwise we see if this is a VCS checkout and if so enable assert # Set ENV ASSERT in order to enable assert. # If we are doing a valgrind run, we always compile with assert disabled @@ -1390,8 +1386,8 @@ print_setup () echo "MAKE=$MAKE" fi - if [[ -n "$MAKE_TARGET" ]]; then - echo "MAKE_TARGET=$MAKE_TARGET" + if [[ -n "$BOOTSTRAP_TARGET" ]]; then + echo "BOOTSTRAP_TARGET=$BOOTSTRAP_TARGET" fi if [[ -n "$PREFIX" ]]; then @@ -1515,7 +1511,7 @@ check_make_target() execute_job () { # We should always have a target by this point - assert MAKE_TARGET + assert BOOTSTRAP_TARGET determine_target_platform @@ -1551,17 +1547,17 @@ execute_job () make_maintainer_clean fi - local MAKE_TARGET_ARRAY - MAKE_TARGET_ARRAY=( $MAKE_TARGET ) + local BOOTSTRAP_TARGET_ARRAY + BOOTSTRAP_TARGET_ARRAY=( $BOOTSTRAP_TARGET ) - for target in "${MAKE_TARGET_ARRAY[@]}" + for target in "${BOOTSTRAP_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 $target ret=$? if [ $ret -ne 0 ]; then - die "Unknown MAKE_TARGET option: $target" + die "Unknown BOOTSTRAP_TARGET option: $target" fi fi @@ -1667,7 +1663,7 @@ main () declare -x VCS_CHECKOUT= # Variables we control globally - local -a MAKE_TARGET= + local -a BOOTSTRAP_TARGET= local CONFIGURE= local use_libtool=false local verbose=false @@ -1730,47 +1726,36 @@ main () local OPT_TARGET= parse_command_line_options "$@" - nassert MAKE_TARGET + nassert BOOTSTRAP_TARGET if [ -n "$OPT_TARGET" ]; then - MAKE_TARGET="$OPT_TARGET" + BOOTSTRAP_TARGET="$OPT_TARGET" fi # 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. + # This BOOTSTRAP_TARGET can be overridden by parse_command_line_options based BOOTSTRAP_TARGET changes. # We don't want Jenkins overriding other variables, so we NULL them. - if [ -z "$MAKE_TARGET" ]; then + if [ -z "$BOOTSTRAP_TARGET" ]; then if $jenkins_build_environment; then if [[ -n "$JENKINS_TARGET" ]]; then - MAKE_TARGET="$JENKINS_TARGET" - else - if [[ -n "$label" ]]; then - check_make_target $label - if [ $? -eq 0 ]; then - MAKE_TARGET="$label" - fi - fi - - if [[ -n "$LABEL" ]]; then - check_make_target $LABEL - if [ $? -eq 0 ]; then - MAKE_TARGET="$LABEL" - fi - fi - - if [ -z "$MAKE_TARGET" ]; then - MAKE_TARGET='jenkins' + check_make_target $JENKINS_TARGET + if [ $? -eq 0 ]; then + BOOTSTRAP_TARGET="$JENKINS_TARGET" + else + die "label not found: $label" fi + else + BOOTSTRAP_TARGET='jenkins' fi fi fi - if [ -z "$MAKE_TARGET" ]; then - MAKE_TARGET="make_default" + if [ -z "$BOOTSTRAP_TARGET" ]; then + BOOTSTRAP_TARGET="make_default" fi # We should always have a target by this point - assert MAKE_TARGET + assert BOOTSTRAP_TARGET execute_job local ret=$? diff --git a/clients/include.am b/clients/include.am index bd38ef04..50c76cc6 100644 --- a/clients/include.am +++ b/clients/include.am @@ -97,10 +97,12 @@ clients_memaslap_LDADD= clients_memaslap_LDADD+= @LIBEVENT_LIB@ clients_memaslap_LDADD+= $(CLIENTS_LDADDS) +clients_memcapable_CXXFLAGS= @PTHREAD_CFLAGS@ clients_memcapable_SOURCES= clients_memcapable_SOURCES+= clients/memcapable.cc clients_memcapable_SOURCES+= libmemcached/byteorder.cc clients_memcapable_LDADD= $(CLIENTS_LDADDS) +clients_memcapable_LDADD+= @PTHREAD_LIBS@ test-start-server: clients/memflush --servers=localhost diff --git a/configure.ac b/configure.ac index 2b7bfd54..e74ebb7b 100644 --- a/configure.ac +++ b/configure.ac @@ -7,18 +7,22 @@ # the COPYING file in this directory for full text. m4_include([version.m4]) +AC_PREREQ([2.61]) AC_INIT([libmemcached],VERSION_NUMBER,[http://libmemcached.org/]) + +# Setup the compilers early on +AC_PROG_CC([cc gcc clang]) +AC_PROG_CXX([c++ g++ clang++]) + AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) -AC_CANONICAL_TARGET +AC_CANONICAL_HOST AC_ARG_PROGRAM AC_USE_SYSTEM_EXTENSIONS AM_INIT_AUTOMAKE([1.11 color-tests -Wno-portability subdir-objects foreign tar-ustar]) -AC_PREREQ([2.61]) - AC_CONFIG_HEADERS([mem_config.h:mem_config.in])dnl Keep filename to 8.3 for MS-DOS. AC_SUBST([AUTOHEADER_FILE],[mem_config.h]) AC_CONFIG_SRCDIR([libmemcached/memcached.cc]) @@ -68,7 +72,6 @@ CHECK_CXX0X AX_ASSERT AX_PLATFORM - m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_DEFUN([LIBMEMCACHED_PROTOCOL], diff --git a/libmemcached/virtual_bucket.c b/libmemcached/virtual_bucket.c index 92c5dc45..951881bd 100644 --- a/libmemcached/virtual_bucket.c +++ b/libmemcached/virtual_bucket.c @@ -109,14 +109,11 @@ uint32_t memcached_virtual_bucket_get(const memcached_st *self, uint32_t digest) { if (self->virtual_bucket) { - if (self->virtual_bucket) - { - uint32_t result= (uint32_t) (digest & (self->virtual_bucket->size -1)); - return self->virtual_bucket->buckets[result].master; - } - - return (uint32_t) (digest & (self->number_of_hosts -1)); + uint32_t result= (uint32_t) (digest & (self->virtual_bucket->size -1)); + return self->virtual_bucket->buckets[result].master; } + + return (uint32_t) (digest & (self->number_of_hosts -1)); } return 0; diff --git a/libtest/formatter.cc b/libtest/formatter.cc index 01c57609..7cb3ea0a 100644 --- a/libtest/formatter.cc +++ b/libtest/formatter.cc @@ -44,6 +44,56 @@ namespace libtest { +std::string& escape4XML(std::string const& arg, std::string& escaped_string) +{ + escaped_string.clear(); + + escaped_string+= '"'; + for (std::string::const_iterator x= arg.begin(), end= arg.end(); x != end; ++x) + { + unsigned char c= *x; + if (c == '&') + { + escaped_string+= "&"; + } + else if (c == '>') + { + escaped_string+= ">"; + } + else if (c == '<') + { + escaped_string+= "<"; + } + else if (c == '\'') + { + escaped_string+= "'"; break; + } + else if (c == '"') + { + escaped_string+= """; + } + else if (c == ' ') + { + escaped_string+= ' '; + } + else if (isalnum(c)) + { + escaped_string+= c; + } + else + { + char const* const hexdig= "0123456789ABCDEF"; + escaped_string+= "&#x"; + escaped_string+= hexdig[c >> 4]; + escaped_string+= hexdig[c & 0xF]; + escaped_string+= ';'; + } + } + escaped_string+= '"'; + + return escaped_string; +} + class TestCase { public: TestCase(const std::string& arg): @@ -110,7 +160,10 @@ TestCase* Formatter::current() void Formatter::skipped() { current()->result(TEST_SKIPPED); - Out << name() << "." << current()->name() << "\t\t\t\t\t" << "[ " << test_strerror(current()->result()) << " ]"; + Out << name() << "." + << current()->name() + << "\t\t\t\t\t" + << "[ " << test_strerror(current()->result()) << " ]"; reset(); } @@ -120,7 +173,9 @@ void Formatter::failed() assert(current()); current()->result(TEST_FAILURE); - Out << name() << "." << current()->name() << "\t\t\t\t\t" << "[ " << test_strerror(current()->result()) << " ]"; + Out << name() + << "." << current()->name() << "\t\t\t\t\t" + << "[ " << test_strerror(current()->result()) << " ]"; reset(); } @@ -129,6 +184,7 @@ void Formatter::success(const libtest::Timer& timer_) { assert(current()); current()->result(TEST_SUCCESS, timer_); + std::string escaped_string; Out << name() << "." << current()->name() @@ -141,38 +197,50 @@ void Formatter::success(const libtest::Timer& timer_) void Formatter::xml(libtest::Framework& framework_, std::ofstream& output) { - output << "<testsuites name=\"" << framework_.name() << "\">" << std::endl; + std::string escaped_string; + + output << "<testsuites name=" + << escape4XML(framework_.name(), escaped_string) << ">" << std::endl; + for (Suites::iterator framework_iter= framework_.suites().begin(); framework_iter != framework_.suites().end(); ++framework_iter) { - output << "\t<testsuite name=\"" << (*framework_iter)->name() << "\" classname=\"\" package=\"\">" << std::endl; + output << "\t<testsuite name=" + << escape4XML((*framework_iter)->name(), escaped_string) +#if 0 + << " classname=\"\" package=\"\"" +#endif + << ">" << std::endl; for (TestCases::iterator case_iter= (*framework_iter)->formatter()->testcases().begin(); case_iter != (*framework_iter)->formatter()->testcases().end(); ++case_iter) { - output << "\t\t<testcase name=\"" - << (*case_iter)->name() - << "\" time=\"" + output << "\t\t<testcase name=" + << escape4XML((*case_iter)->name(), escaped_string) + << " time=\"" << (*case_iter)->timer().elapsed_milliseconds() - << "\">" - << std::endl; + << "\""; switch ((*case_iter)->result()) { case TEST_SKIPPED: + output << ">" << std::endl; output << "\t\t <skipped/>" << std::endl; + output << "\t\t</testcase>" << std::endl; break; case TEST_FAILURE: + output << ">" << std::endl; output << "\t\t <failure message=\"\" type=\"\"/>"<< std::endl; + output << "\t\t</testcase>" << std::endl; break; case TEST_SUCCESS: + output << "/>" << std::endl; break; } - output << "\t\t</testcase>" << std::endl; } output << "\t</testsuite>" << std::endl; } diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4 index 13bf7dba..c2f421bc 100644 --- a/m4/ax_compiler_vendor.m4 +++ b/m4/ax_compiler_vendor.m4 @@ -4,7 +4,7 @@ # # SYNOPSIS # -# AX_COMPILER_VENDOR() +# AX_COMPILER_VENDOR # # DESCRIPTION # @@ -44,7 +44,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 11 +#serial 12 AC_DEFUN([AX_COMPILER_VENDOR], [AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, @@ -53,6 +53,7 @@ AC_DEFUN([AX_COMPILER_VENDOR], ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ + fujitsu: __FUJITSU gnu: __GNUC__ sun: __SUNPRO_C,__SUNPRO_CC hp: __HP_cc,__HP_aCC diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index 007f6276..18055791 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -82,11 +82,12 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 22 +#serial 23 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h @@ -327,4 +328,5 @@ else ax_pthread_ok=no $2 fi +AC_LANG_POP ])dnl AX_PTHREAD diff --git a/m4/ax_restore_flags.m4 b/m4/ax_restore_flags.m4 index cf03cae7..aafd3638 100644 --- a/m4/ax_restore_flags.m4 +++ b/m4/ax_restore_flags.m4 @@ -4,28 +4,49 @@ # # SYNOPSIS # -# AX_RESTORE_FLAGS() +# AX_RESTORE_FLAGS([namespace]) # # DESCRIPTION # -# Restore common compilation flags from temporary variables +# Restore common compilation flags from temporary variables. +# +# Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS, +# OBJCFLAGS. +# +# By default these flags are restored to a global (empty) namespace, but +# user could restore from specific NAMESPACE by using +# AX_RESTORE_FLAGS(NAMESPACE) macro. +# +# Typical usage is like: +# +# AX_SAVE_FLAGS(mypackage) +# CPPFLAGS="-Imypackagespath ${CPPFLAGS}" +# dnl ... do some detection ... +# AX_RESTORE_FLAGS(mypackage) # # LICENSE # # Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net> +# Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2011 Russ Allbery <rra@stanford.edu> +# Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf@gmail.com> # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 3 +#serial 6 + +# save one flag in name space +AC_DEFUN([_AX_RESTORE_ONE_FLAG],[dnl + AS_VAR_PUSHDEF([_ax_restore_flag_var], [$2[]_$1[]_ax_save_flags]) + AS_VAR_COPY($2[],_ax_restore_flag_var) + AS_VAR_POPDEF([_ax_restore_flag_var]) +]) -AC_DEFUN([AX_RESTORE_FLAGS], [ - CPPFLAGS="${CPPFLAGS_save}" - CFLAGS="${CFLAGS_save}" - CXXFLAGS="${CXXFLAGS_save}" - OBJCFLAGS="${OBJCFLAGS_save}" - LDFLAGS="${LDFLAGS_save}" - LIBS="${LIBS_save}" +AC_DEFUN([AX_RESTORE_FLAGS], [dnl + m4_foreach([FLAG], dnl + [_AX_SAVE_FLAGS_LIST()], dnl + [_AX_RESTORE_ONE_FLAG([$1],FLAG)]) ]) diff --git a/m4/ax_save_flags.m4 b/m4/ax_save_flags.m4 index d2a05422..39f45be4 100644 --- a/m4/ax_save_flags.m4 +++ b/m4/ax_save_flags.m4 @@ -4,28 +4,68 @@ # # SYNOPSIS # -# AX_SAVE_FLAGS() +# AX_SAVE_FLAGS([NAMESPACE]) # # DESCRIPTION # -# Save common compilation flags into temporary variables +# Save common compilation flags into temporary variables. +# +# Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS, +# OBJCFLAGS. +# +# By default these flags are saved to a global (empty) namespace, but user +# could specify a specific NAMESPACE to AX_SAVE_FLAGS macro and latter +# restore it by using AX_RESTORE_FLAGS(NAMESPACE). +# +# AX_SAVE_FLAGS(mypackage) +# CPPFLAGS="-Imypackagespath ${CPPFLAGS}" +# dnl .. do some detection ... +# AX_RESTORE_FLAGS(mypackage) # # LICENSE # # Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net> +# Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2011 Russ Allbery <rra@stanford.edu> +# Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf@gmail.com> # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 3 +#serial 7 + +# list of flag to save +AC_DEFUN([_AX_SAVE_FLAGS_LIST],[dnl +[CCASFLAGS],dnl +[CFLAGS],dnl +[CPPFLAGS],dnl +[CXXFLAGS],dnl +[ERLCFLAGS],dnl +[FCFLAGS],dnl +[FCLIBS],dnl +[FFLAGS],dnl +[FLIBS],dnl +[GCJFLAGS],dnl +[JAVACFLAGS],dnl +[LDFLAGS],dnl +[LIBS],dnl +[OBJCFLAGS],dnl +[OBJCXXFLAGS],dnl +[UPCFLAGS],dnl +[VALAFLAGS]dnl +]) + +# save one flag in name space +AC_DEFUN([_AX_SAVE_ONE_FLAG],[ + AS_VAR_PUSHDEF([_ax_save_flag_var], [$2[]_$1[]_ax_save_flags]) + AS_VAR_COPY(_ax_save_flag_var, $2[]) + AS_VAR_POPDEF([_ax_save_flag_var]) +]) -AC_DEFUN([AX_SAVE_FLAGS], [ - CPPFLAGS_save="${CPPFLAGS}" - CFLAGS_save="${CFLAGS}" - CXXFLAGS_save="${CXXFLAGS}" - OBJCFLAGS_save="${OBJCFLAGS}" - LDFLAGS_save="${LDFLAGS}" - LIBS_save="${LIBS}" +AC_DEFUN([AX_SAVE_FLAGS],[dnl + m4_foreach([FLAG], dnl + [_AX_SAVE_FLAGS_LIST()], dnl + [_AX_SAVE_ONE_FLAG([$1],FLAG)]) ]) |