clients/memstat
config.h
config.h.in
+config.in
config.log
config.status
config/compile
/* -*- Mode: C; tab-width: 2; c-basic-offset: 2; indent-tabs-mode: nil -*- */
#undef NDEBUG
-#include "config.h"
-#include <pthread.h>
-#include <sys/types.h>
+#include <config.h>
+
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#else
+#include "poll/poll.h"
+#endif
+
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
+#include <pthread.h>
#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
#include <string.h>
-#include <inttypes.h>
-#include <stdbool.h>
+#include <sys/types.h>
#include <unistd.h>
-#include <ctype.h>
#include <libmemcached/memcached.h>
#include <libmemcached/memcached/protocol_binary.h>
#include <libmemcached/byteorder.h>
-#include "utilities.h"
+#include <clients/utilities.h>
#ifdef linux
/* /usr/include/netinet/in.h defines macros from ntohs() to _bswap_nn to
#include <config.h>
+#include <cstdio>
#include <iostream>
#include <libmemcached/memcached.h>
# Use and distribution licensed under the BSD license. See
# the COPYING file in this directory for full text.
-AC_PREREQ([2.61])
-AC_INIT([libmemcached],[0.51],[http://libmemcached.org/])
-AC_CONFIG_SRCDIR([libmemcached/memcached.cc])
+AC_INIT([libmemcached],[0.52],[http://libmemcached.org/])
+
AC_CONFIG_AUX_DIR(config)
+
+AC_CANONICAL_TARGET
+
+AM_INIT_AUTOMAKE
+
+AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
+
+AC_PREREQ([2.61])
+
AC_CONFIG_MACRO_DIR(m4)
+AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
+
+AC_CONFIG_SRCDIR([libmemcached/memcached.cc])
+
PANDORA_CANONICAL_TARGET(no-vc-changelog)
AC_CHECK_PROGS([YACC], ['bison'], [:])
AC_CHECK_PROGS([LEX], ['flex'], [:])
AM_CONDITIONAL(HAVE_LIBMEMCACHED, true)
LT_INIT
-AH_TOP([
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#ifdef _SYS_FEATURE_TESTS_H
-#error "You should include config.h as your first include file"
-#endif
-
-#ifdef WIN32
-#define _WIN32_WINNT 0x0501
-#endif
-])
-
-AH_BOTTOM([
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
-#ifdef HAVE_FNMATCH_H
-#include <fnmatch.h>
-#endif
-
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#else
-#include "poll/poll.h"
-#endif
-
-/* To hide the platform differences between MS Windows and Unix, I am
- * going to use the Microsoft way and #define the Microsoft-specific
- * functions to the unix way. Microsoft use a separate subsystem for sockets,
- * but Unix normally just use a filedescriptor on the same functions. It is
- * a lot easier to map back to the unix way with macros than going the other
- * way without side effect ;-)
- */
-#ifdef WIN32
-#include "win32/wrappers.h"
-#define get_socket_errno() WSAGetLastError()
-#else
-#define INVALID_SOCKET -1
-#define SOCKET_ERROR -1
-#define closesocket(a) close(a)
-#define get_socket_errno() errno
-#endif
-
-#ifndef HAVE_MSG_NOSIGNAL
-#define MSG_NOSIGNAL 0
-#endif
-
-#ifndef HAVE_MSG_DONTWAIT
-#define MSG_DONTWAIT 0
-#endif
-
-#ifndef HAVE_MSG_MORE
-#define MSG_MORE 0
-#endif
-
-#endif
-])
-
AC_SEARCH_LIBS(getopt_long, gnugetopt)
AC_SEARCH_LIBS(gethostbyname, nsl)
LIBS="$my_saved_libs"
dnl Specialty checks
+CONFIG_EXTRA
DETECT_BYTEORDER
ENABLE_UTILLIB
SETSOCKOPT_SANITY
#include <libhashkit/common.h>
/* FNV hash'es lifted from Dustin Sallings work */
-static uint64_t FNV_64_INIT= UINT64_C(0xcbf29ce484222325);
-static uint64_t FNV_64_PRIME= UINT64_C(0x100000001b3);
+static uint64_t FNV_64_INIT= uint64_t(0xcbf29ce484222325);
+static uint64_t FNV_64_PRIME= uint64_t(0x100000001b3);
static uint32_t FNV_32_INIT= 2166136261UL;
static uint32_t FNV_32_PRIME= 16777619;
#include <libmemcached/server_instance.h>
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#else
+#include "poll/poll.h"
+#endif
+
+
#ifdef __cplusplus
extern "C" {
#endif
--- /dev/null
+AC_DEFUN([CONFIG_EXTRA], [
+
+AH_BOTTOM([
+
+#if defined(__cplusplus)
+#include CSTDINT_H
+#include CINTTYPES_H
+#else
+#include <stdint.h>
+#include <inttypes.h>
+#endif
+
+#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
+# define HAVE_ULONG 1
+typedef unsigned long int ulong;
+#endif
+
+])
+
+AH_BOTTOM([
+#ifdef WIN32
+#define _WIN32_WINNT 0x0501
+#endif
+
+/* To hide the platform differences between MS Windows and Unix, I am
+ * going to use the Microsoft way and #define the Microsoft-specific
+ * functions to the unix way. Microsoft use a separate subsystem for sockets,
+ * but Unix normally just use a filedescriptor on the same functions. It is
+ * a lot easier to map back to the unix way with macros than going the other
+ * way without side effect ;-)
+ */
+#ifdef WIN32
+#include "win32/wrappers.h"
+#define get_socket_errno() WSAGetLastError()
+#else
+#define INVALID_SOCKET -1
+#define SOCKET_ERROR -1
+#define closesocket(a) close(a)
+#define get_socket_errno() errno
+#endif
+
+#ifndef HAVE_MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
+
+#ifndef HAVE_MSG_DONTWAIT
+#define MSG_DONTWAIT 0
+#endif
+
+#ifndef HAVE_MSG_MORE
+#define MSG_MORE 0
+#endif
+
+])
+])dnl CONFIG_EXTRA
])
])
- AC_CONFIG_MACRO_DIR([m4])
-
- m4_if(m4_substr(m4_esyscmd(test -d src && echo 0),0,1),0,[
- AC_CONFIG_HEADERS([src/config.h])
- ],[
- AC_CONFIG_HEADERS([config.h])
- ])
-
PANDORA_BLOCK_BAD_OPTIONS
# We need to prevent canonical target
AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
[CXXFLAGS=""])
- AC_CANONICAL_TARGET
-
m4_if(PCT_DONT_SUPRESS_INCLUDE,yes,[
AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability subdir-objects foreign tar-ustar)
],[
PANDORA_USE_PIPE
- AH_TOP([
-#ifndef __CONFIG_H__
-#define __CONFIG_H__
-
-/* _SYS_FEATURE_TESTS_H is Solaris, _FEATURES_H is GCC */
-#if defined( _SYS_FEATURE_TESTS_H) || defined(_FEATURES_H)
-#error "You should include config.h as your first include file"
-#endif
-
-#include <config/top.h>
-])
- mkdir -p config
- cat > config/top.h.stamp <<EOF_CONFIG_TOP
-
-#if defined(i386) && !defined(__i386__)
-#define __i386__
-#endif
-
-#if defined(_FILE_OFFSET_BITS)
-# undef _FILE_OFFSET_BITS
-#endif
-EOF_CONFIG_TOP
-
- diff config/top.h.stamp config/top.h >/dev/null 2>&1 || mv config/top.h.stamp config/top.h
- rm -f config/top.h.stamp
-
- AH_BOTTOM([
-#if defined(__cplusplus)
-# include CSTDINT_H
-# include CINTTYPES_H
-#else
-# include <stdint.h>
-# include <inttypes.h>
-#endif
-
-#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
-# define HAVE_ULONG 1
-typedef unsigned long int ulong;
-#endif
-
-/* To hide the platform differences between MS Windows and Unix, I am
- * going to use the Microsoft way and #define the Microsoft-specific
- * functions to the unix way. Microsoft use a separate subsystem for sockets,
- * but Unix normally just use a filedescriptor on the same functions. It is
- * a lot easier to map back to the unix way with macros than going the other
- * way without side effect ;-)
- */
-#ifdef TARGET_OS_WINDOWS
-#define random() rand()
-#define srandom(a) srand(a)
-#define get_socket_errno() WSAGetLastError()
-#else
-#define INVALID_SOCKET -1
-#define SOCKET_ERROR -1
-#define closesocket(a) close(a)
-#define get_socket_errno() errno
-#endif
-
-#if defined(__cplusplus)
-# if defined(DEBUG)
-# include <cassert>
-# include <cstddef>
-# endif
-template<typename To, typename From>
-inline To implicit_cast(From const &f) {
- return f;
-}
-template<typename To, typename From> // use like this: down_cast<T*>(foo);
-inline To down_cast(From* f) { // so we only accept pointers
- // Ensures that To is a sub-type of From *. This test is here only
- // for compile-time type checking, and has no overhead in an
- // optimized build at run-time, as it will be optimized away
- // completely.
- if (false) {
- implicit_cast<From*, To>(0);
- }
-
-#if defined(DEBUG)
- assert(f == NULL || dynamic_cast<To>(f) != NULL); // RTTI: debug mode only!
-#endif
- return static_cast<To>(f);
-}
-#endif /* defined(__cplusplus) */
-
-#endif /* __CONFIG_H__ */
- ])
-
AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
+++ /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.
-
-dnl Try to define a macro to dump the current callstack.
-AC_DEFUN([PANDORA_PRINT_CALLSTACK],[
- AC_CHECK_HEADERS([ucontext.h])
- AS_IF([test "x$ac_cv_header_ucontext_h" = "xyes"],
- [ AC_CHECK_FUNCS([printstack]) ])
-
-
- AS_IF([ test "x$ac_cv_func_printstack" != "xyes"],
- [ AC_CHECK_HEADERS([dlfcn.h])
- AC_CHECK_HEADERS([execinfo.h])
- AC_CHECK_FUNCS([backtrace])
- AC_CHECK_FUNCS([backtrace_symbols_fd]) ])
-
- AH_BOTTOM([
-#ifdef __cplusplus
-#include <cstdio>
-#define PANDORA_PRINTSTACK_STD_PREFIX std::
-#else
-#include <stdio.h>
-#define PANDORA_PRINTSTACK_STD_PREFIX
-#endif
-
-#if defined(HAVE_UCONTEXT_H) && defined(HAVE_PRINTSTACK)
-#include <ucontext.h>
-#define pandora_print_callstack(a) \
-printstack(PANDORA_PRINTSTACK_STD_PREFIX fileno(a))
-#elif defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS_FD)
-
-#include <execinfo.h>
-
-#define pandora_print_callstack(a) \
-{ \
- void *stack[100]; \
- int depth = backtrace(stack, 100); \
- backtrace_symbols_fd(stack, depth, PANDORA_PRINTSTACK_STD_PREFIX fileno(a)); \
-}
-#elif defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS) && !defined(HAVE_BACKTRACE_SYMBOLS_FD)
-
-#include <execinfo.h>
-
-#define pandora_print_callstack(a) \
-{ \
- void *stack[100]; \
- int depth= backtrace(stack, 100); \
- char **symbol= backtrace_symbols(stack, depth); \
- for (int x= 0; x < size; ++x) \
- PANDORA_PRINTSTACK_STD_PREFIX fprintf(a, "%s\n", symbol[x]); \
-}
-#else
-#define pandora_print_callstack(a) \
- PANDORA_PRINTSTACK_STD_PREFIX fprintf(a, \
- "Stackdump not supported for this platform\n");
-#endif
- ])
-
-])
(void)memcached_failed(MEMCACHED_SUCCESS);
(void)memcached_continue(MEMCACHED_SUCCESS);
+ memcached_st *memc= memcached_create(NULL);
+ memcached_free(memc);
+
return EXIT_SUCCESS;
}
# Test linking with C application
tests_c_test_SOURCES= tests/c_test.c
-tests_c_test_LDADD= ${CLIENT_LDADD}
+tests_c_test_LDADD= libmemcached/libmemcached.la
+tests_c_test_DEPENDENCIES= libmemcached/libmemcached.la
check_PROGRAMS+=tests/c_test
noinst_PROGRAMS+=tests/c_test