From 6b04196d0ea6aa9fcd2a6c14a6cb5733c34aa2d2 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Thu, 25 Oct 2012 02:28:22 -0400 Subject: [PATCH] A number of small build fixes found while looking at mingw support. --- ChangeLog | 3 ++ Makefile.am | 14 ++++- bootstrap.sh | 57 ++++++++++++++++++-- clients/memaslap.c | 12 ++--- clients/ms_conn.c | 13 +++-- clients/ms_task.c | 12 ++--- clients/ms_thread.c | 12 ++--- clients/utilities.h | 12 ++--- configure.ac | 26 +++++++-- libhashkit/common.h | 2 - libmemcached-1.0/platform.h | 6 +++ libmemcached-1.0/struct/server.h | 12 ++--- libmemcached/assert.hpp | 3 -- libmemcached/backtrace.cc | 4 -- libmemcached/byteorder.cc | 21 +++----- libmemcached/byteorder.h | 2 - libmemcached/common.h | 68 +++++++++++++++--------- libmemcached/connect.cc | 4 +- libmemcached/csl/parser.yy | 14 ++--- libmemcached/csl/scanner.l | 11 ++-- libmemcached/server.hpp | 4 +- libmemcachedprotocol/binary_handler.c | 2 +- libmemcachedprotocol/handler.c | 3 ++ libmemcachedutil/common.h | 6 ++- libtest/cmdline.cc | 4 +- libtest/cmdline.h | 16 ++++-- libtest/common.h | 22 ++++++++ libtest/drizzled.h | 2 - libtest/gearmand.h | 2 - libtest/server.h | 11 +++- libtest/server_container.h | 3 +- libtest/test.hpp | 9 +++- libtest/tmpfile.cc | 1 + m4/ax_compiler_version.m4 | 76 ++++++++++++++++++--------- tests/memdump.cc | 1 + util/instance.hpp | 1 - win32/include.am | 2 + 37 files changed, 308 insertions(+), 165 deletions(-) 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 00aed45a..ad4751a6 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -49,7 +49,7 @@ command_not_found_handle () exit 127 } -die () +function die () { echo "$BASH_SOURCE:$BASH_LINENO: $@" >&2 exit 1; @@ -492,6 +492,26 @@ function 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 function check_for_jenkins () { @@ -508,6 +528,17 @@ function check_for_jenkins () fi } +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 @@ -663,8 +694,10 @@ function make_distcheck () 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 } function make_maintainer_clean () @@ -817,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 @@ -1008,6 +1047,10 @@ check_make_target() ;; 'snapshot') ;; + 'mingw') + ;; + 'universe') + ;; 'valgrind') ;; 'jenkins') @@ -1101,6 +1144,9 @@ function bootstrap () make run_configure ;; + 'mingw') + make_for_mingw32 + ;; 'snapshot') make_for_snapshot ;; @@ -1110,6 +1156,9 @@ function bootstrap () 'valgrind') make_valgrind ;; + 'universe') + make_universe + ;; 'jenkins') make_for_continuus_integration ;; 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/tests/memdump.cc b/tests/memdump.cc index 840c1a17..f044844d 100644 --- a/tests/memdump.cc +++ b/tests/memdump.cc @@ -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 -- 2.30.2