AX_CHECK_LIBRARY([LIBUUID], [uuid/uuid.h], [uuid],
[
LIBUUID_LDFLAGS="-luuid"
+ AC_DEFINE([HAVE_LIBUUID], [ 1 ], [Have libuuid])
],
[
AC_DEFINE([HAVE_LIBUUID], [ 0 ], [Have libuuid])
+++ /dev/null
-dnl Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems, Inc.
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-#--------------------------------------------------------------------
-# Check for libuuid
-#--------------------------------------------------------------------
-
-
-AC_DEFUN([_PANDORA_SEARCH_LIBUUID],[
- AC_REQUIRE([AC_LIB_PREFIX])
-
- dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
- dnl not be a lib is weird.
- AC_CHECK_HEADERS(uuid/uuid.h)
- AC_LIB_HAVE_LINKFLAGS(uuid,,
- [
- #include <uuid/uuid.h>
- ],
- [
- uuid_t uout;
- uuid_generate(uout);
- ])
-
- AM_CONDITIONAL(HAVE_LIBUUID, [test "x${ac_cv_libuuid}" = "xyes"])
-])
-
-AC_DEFUN([_PANDORA_HAVE_LIBUUID],[
-
- AC_ARG_ENABLE([libuuid],
- [AS_HELP_STRING([--disable-libuuid],
- [Build with libuuid support @<:@default=on@:>@])],
- [ac_enable_libuuid="$enableval"],
- [ac_enable_libuuid="yes"])
-
- _PANDORA_SEARCH_LIBUUID
-])
-
-
-AC_DEFUN([PANDORA_HAVE_LIBUUID],[
- AC_REQUIRE([_PANDORA_HAVE_LIBUUID])
-])
-
-AC_DEFUN([_PANDORA_REQUIRE_LIBUUID],[
- ac_enable_libuuid="yes"
- _PANDORA_SEARCH_LIBUUID
- AS_IF([test "x$ac_cv_header_uuid_uuid_h" = "xno"],[
- AC_MSG_ERROR([Couldn't find uuid/uuid.h. On Debian this can be found in uuid-dev. On RHEL 4 this can be found in e2fsprogs-devel and Fedora/RHEL 6 in libuuid-devel.])
- ])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBUUID],[
- AC_REQUIRE([_PANDORA_REQUIRE_LIBUUID])
-])
])
])
- AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
m4_if(PW_WARN_ALWAYS_ON, [yes],
[ac_cv_warnings_as_errors=yes],
AS_IF([test "$pandora_building_from_vc" = "yes"],
dnl Macro: PROTOCOL_BINARY_TEST
dnl ---------------------------------------------------------------------------
-AC_DEFUN([PROTOCOL_BINARY_TEST],
-[
- AC_CACHE_CHECK([for supported struct padding], [ac_cv_supported_struct_padding], [
- AC_LANG_PUSH([C])
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -I${srcdir}"
- AC_TRY_COMPILE([
-#include <inttypes.h>
+AC_DEFUN([PROTOCOL_BINARY_TEST], [
+ AC_LANG_PUSH([C++])
+ AC_CACHE_CHECK([for supported struct padding], [ac_cv_supported_struct_padding], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [ #include <inttypes.h>
#include "libmemcached/memcached/protocol_binary.h"
- ], [
- protocol_binary_request_set request;
- int a = 1;
- switch (a) {
- case sizeof(request):
- case sizeof(request.bytes):
+ ], [ protocol_binary_request_set request;
+ int a = 1;
+ switch (a) {
+ case sizeof(request):
+ case sizeof(request.bytes):
break;
- default:
+ default:
a = 2;
- }
- ],
- [ ac_cv_supported_struct_padding=no ],
- [ ac_cv_supported_struct_padding=yes ])
- CFLAGS="$save_CFLAGS"
- AC_LANG_POP
- ])
- AS_IF([test "x$ac_cv_supported_struct_padding" = "xno"],[
- AC_MSG_ERROR([Unsupported struct padding done by compiler.])])
-])
+ }
+ ])],
+ [ ac_cv_supported_struct_padding=no ],
+ [ ac_cv_supported_struct_padding=yes ])
+ ])
+ AC_LANG_POP
+ AS_IF([test "x$ac_cv_supported_struct_padding" = "xno"],[ AC_MSG_ERROR([Unsupported struct padding done by compiler.])])
+ ])
dnl ---------------------------------------------------------------------------
dnl End Macro: PROTOCOL_BINARY_TEST
{
len= (size_t)snprintf(k, sizeof(k), "%0250u", x);
memcached_return_t rc= memcached_delete(memc, k, len, 0);
- test_true(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED);
+ test_true_got(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED, memcached_last_error_message(memc));
}
len= snprintf(k, sizeof(k), "%037u", 251U);
memcached_server_instance_st instance_two;
if (memcached_server_count(memc) < 3 or pre_replication(memc) != TEST_SUCCESS)
+ {
return TEST_SKIPPED;
+ }
test_compare(MEMCACHED_SUCCESS,
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, 2));