3 # Copyright (C) 2011 Data Differential, http://datadifferential.com/
4 # Copyright (C) 2006-2010 Brian Aker, Monty Taylor, Trond Norbye
7 # Use and distribution licensed under the BSD license. See
8 # the COPYING file in this directory for full text.
11 AC_INIT
([libmemcached
],[0.51],[http
://libmemcached.org
/])
12 AC_CONFIG_SRCDIR
([libmemcached
/memcached.cc
])
13 AC_CONFIG_AUX_DIR
(config
)
14 AC_CONFIG_MACRO_DIR
(m4)
16 PANDORA_CANONICAL_TARGET
(no-vc-changelog
)
17 AC_CHECK_PROGS
([YACC
], ['bison'], [:])
18 AC_CHECK_PROGS
([LEX
], ['flex'], [:])
20 #shared library versioning
21 MEMCACHED_UTIL_LIBRARY_VERSION
=2:0:0
22 MEMCACHED_PROTOCAL_LIBRARY_VERSION
=0:0:0
23 MEMCACHED_LIBRARY_VERSION
=8:0:0
27 # current:revision:age
29 # | | +- increment if interfaces have been added
30 # | | set to zero if interfaces have been removed or changed
31 # | +- increment if source code has changed
32 # | set to zero if current is incremented
33 # +- increment if interfaces have been added, removed or changed
34 AC_SUBST
(MEMCACHED_UTIL_LIBRARY_VERSION
)
35 AC_SUBST
(MEMCACHED_PROTOCAL_LIBRARY_VERSION
)
36 AC_SUBST
(MEMCACHED_LIBRARY_VERSION
)
39 HASHKIT_LIBRARY_VERSION
=1:0:0
40 AC_SUBST
(HASHKIT_LIBRARY_VERSION
)
42 AC_DEFINE
([HAVE_LIBMEMCACHED
], [ 1 ], [dummy rule
for libtest
])
43 AC_SUBST
(HAVE_LIBMEMCACHED
, 1)
44 AM_CONDITIONAL
(HAVE_LIBMEMCACHED
, true
)
51 #ifdef _SYS_FEATURE_TESTS_H
52 #error "You should include config.h as your first include file"
56 #define _WIN32_WINNT 0x0501
61 #ifdef HAVE_SYS_WAIT_H
72 #include "poll/poll.h"
75 /* To hide the platform differences between MS Windows and Unix
, I am
76 * going to use the Microsoft way and
#define the Microsoft-specific
77 * functions to the unix way. Microsoft use a separate subsystem
for sockets
,
78 * but Unix normally just use a filedescriptor on the same functions. It is
79 * a lot easier to map back to the unix way with macros than going the other
80 * way without side effect
;-)
83 #include "win32/wrappers.h"
84 #define get_socket_errno() WSAGetLastError()
86 #define INVALID_SOCKET -1
87 #define SOCKET_ERROR -1
88 #define closesocket(a) close(a)
89 #define get_socket_errno() errno
92 #ifndef HAVE_MSG_NOSIGNAL
93 #define MSG_NOSIGNAL 0
96 #ifndef HAVE_MSG_DONTWAIT
97 #define MSG_DONTWAIT 0
100 #ifndef HAVE_MSG_MORE
107 AC_SEARCH_LIBS
(getopt_long
, gnugetopt
)
108 AC_SEARCH_LIBS
(gethostbyname
, nsl
)
110 AC_CHECK_FUNCS
([getline
])
112 PANDORA_HAVE_LIBEVENT
113 my_saved_libs
="$LIBS"
115 PANDORA_REQUIRE_PTHREAD
116 LIBS
="$my_saved_libs"
128 PANDORA_HAVE_LIBINNODB
129 PANDORA_PRINT_CALLSTACK
133 dnl The sasl functions should only be visible
if we build with sasl support
134 AS_IF
([test "x$ac_cv_sasl" = "xyes"],
135 [LIBMEMCACHED_WITH_SASL_SUPPORT
="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1"])
136 AC_SUBST
(LIBMEMCACHED_WITH_SASL_SUPPORT
)
138 AC_CHECK_HEADERS
([atomic.h
])
139 AS_IF
([test "x$ac_cv_header_atomic_h" = "xyes"],[
140 AC_CHECK_FUNCS
(atomic_add_64
)
141 AC_CHECK_FUNCS
(atomic_add_32
)
142 AS_IF
([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"],[
143 AC_DEFINE
([USE_ATOMIC_H
],
145 [Define to true
if you want to use functions from atomic.h
])])])
147 AC_CHECK_HEADERS_ONCE
(winsock2.h poll.h sys
/wait.h fnmatch.h
)
148 AM_CONDITIONAL
(BUILD_POLL
, test "x$ac_cv_header_poll_h" = "xno")
149 AM_CONDITIONAL
(BUILD_WIN32_WRAPPERS
, test "x$ac_cv_header_winsock2_h" = "xyes")
150 AS_IF
(test "x$ac_cv_header_winsock2_h" = "xyes",
151 [AM_LDFLAGS
="$AM_LDFLAGS -lws2_32"
152 AM_CFLAGS
="$AM_CFLAGS $NO_WERROR"
153 AM_CXXFLAGS
="$AM_CXXFLAGS $NO_WERROR"
161 libhashkit
/configure.h
162 libmemcached
/configure.h
163 support
/libmemcached.pc
164 support
/libmemcached.spec
165 support
/libmemcached-fc.spec
170 echo "Configuration summary for $PACKAGE_NAME version $VERSION"
172 echo " * Installation prefix: $prefix"
173 echo " * System type: $host_vendor-$host_os"
174 echo " * Host CPU: $host_cpu"
175 echo " * C Compiler: $CC_VERSION"
176 echo " * Assertions enabled: $ac_cv_assert"
177 echo " * Debug enabled: $with_debug"
178 echo " * Warnings as failure: $ac_cv_warnings_as_errors"
186 echo "* NOTE: You are on FreeBSD. BSD make will not work."
188 echo "* use 'gmake' To build libmemcached"