From: Brian Aker Date: Tue, 4 Dec 2012 07:44:26 +0000 (-0500) Subject: Update, fix build rules for -j X-Git-Tag: 1.0.15~11^2~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f9b74a208522a12dca6ee9c894c6782920860b88;p=m6w6%2Flibmemcached Update, fix build rules for -j --- 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/include.am b/libmemcached/csl/include.am index 209b5246..68489911 100644 --- a/libmemcached/csl/include.am +++ b/libmemcached/csl/include.am @@ -11,8 +11,6 @@ noinst_HEADERS+= libmemcached/csl/scanner.h noinst_HEADERS+= libmemcached/csl/server.h noinst_HEADERS+= libmemcached/csl/symbol.h -libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/parser.h -libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/scanner.h libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/context.cc libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/parser.cc libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/scanner.cc @@ -25,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/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..23cc90b2 100644 --- a/libtest/include.am +++ b/libtest/include.am @@ -171,10 +171,8 @@ endif endif if HAVE_LIBDRIZZLE - libtest_libtest_la_LIBADD+= $(libdrizzle_LIBS) libtest_libtest_la_CXXFLAGS+= $(libdrizzle_CFLAGS) - endif if BUILDING_GEARMAN @@ -190,7 +188,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..f8e1aa8c 100644 --- a/libtest/unittest.cc +++ b/libtest/unittest.cc @@ -42,7 +42,7 @@ #include #endif -#if defined(LIBTEST_WITH_LIBGEARMAN_SUPPORT) && LIBTEST_WITH_LIBGEARMAN_SUPPORT +#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN #include #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(GEARMAND_BINARY) + if (GEARMAND_BINARY) + { + test_skip(0, 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/libgearman.m4 b/m4/libgearman.m4 index a95c289f..f4c5d3b0 100644 --- a/m4/libgearman.m4 +++ b/m4/libgearman.m4 @@ -1,9 +1,4 @@ -# 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]) ]) 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