3 # Copyright (C) 2006-2010 Brian Aker, Monty Taylor, Trond Norbye
6 # Use and distribution licensed under the BSD license. See
7 # the COPYING file in this directory for full text.
10 AC_INIT
([libmemcached
],[0.43],[http
://libmemcached.org
/])
11 AC_CONFIG_SRCDIR
([libmemcached
/memcached.c
])
12 AC_CONFIG_AUX_DIR
(config
)
14 PANDORA_CANONICAL_TARGET
16 #shared library versioning
17 MEMCACHED_UTIL_LIBRARY_VERSION
=1:0:0
18 MEMCACHED_PROTOCAL_LIBRARY_VERSION
=0:0:0
19 MEMCACHED_LIBRARY_VERSION
=5:2:0
23 # current:revision:age
25 # | | +- increment if interfaces have been added
26 # | | set to zero if interfaces have been removed or changed
27 # | +- increment if source code has changed
28 # | set to zero if current is incremented
29 # +- increment if interfaces have been added, removed or changed
30 AC_SUBST
(MEMCACHED_UTIL_LIBRARY_VERSION
)
31 AC_SUBST
(MEMCACHED_PROTOCAL_LIBRARY_VERSION
)
32 AC_SUBST
(MEMCACHED_LIBRARY_VERSION
)
35 HASHKIT_LIBRARY_VERSION
=0:0:0
36 AC_SUBST
(HASHKIT_LIBRARY_VERSION
)
42 #ifdef _SYS_FEATURE_TESTS_H
43 #error "You should include config.h as your first include file"
47 #define _WIN32_WINNT 0x0501
52 #ifdef HAVE_SYS_WAIT_H
63 #include "poll/poll.h"
66 /* To hide the platform differences between MS Windows and Unix
, I am
67 * going to use the Microsoft way and
#define the Microsoft-specific
68 * functions to the unix way. Microsoft use a separate subsystem
for sockets
,
69 * but Unix normally just use a filedescriptor on the same functions. It is
70 * a lot easier to map back to the unix way with macros than going the other
71 * way without side effect
;-)
74 #include "win32/wrappers.h"
75 #define get_socket_errno() WSAGetLastError()
77 #define INVALID_SOCKET -1
78 #define SOCKET_ERROR -1
79 #define closesocket(a) close(a)
80 #define get_socket_errno() errno
86 AC_SEARCH_LIBS
(getopt_long
, gnugetopt
)
87 AC_SEARCH_LIBS
(gethostbyname
, nsl
)
89 AC_CHECK_FUNCS
([getline
])
95 PANDORA_REQUIRE_PTHREAD
107 PANDORA_HAVE_LIBINNODB
108 PANDORA_PRINT_CALLSTACK
111 dnl The sasl functions should only be visible
if we build with sasl support
112 AS_IF
([test "x$ac_cv_sasl" = "xyes"],
113 [LIBMEMCACHED_WITH_SASL_SUPPORT
="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1"])
114 AC_SUBST
(LIBMEMCACHED_WITH_SASL_SUPPORT
)
116 AC_CHECK_HEADERS
([atomic.h
])
117 AS_IF
([test "x$ac_cv_header_atomic_h" = "xyes"],[
118 AC_CHECK_FUNCS
(atomic_add_64
)
119 AC_CHECK_FUNCS
(atomic_add_32
)
120 AS_IF
([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"],[
121 AC_DEFINE
([USE_ATOMIC_H
],
123 [Define to true
if you want to use functions from atomic.h
])])])
126 [AS_HELP_STRING
([--with-docs],
127 [Generate documentation
(yes|no
) @
<:@default
=yes@
:>@
])],
128 [with_docs
=$withval],
131 AS_IF
([test "$with_docs" = "yes"],
136 AM_CONDITIONAL
(BUILD_DOCS
, test "$with_docs" = "yes")
138 AC_CHECK_HEADERS_ONCE
(winsock2.h poll.h sys
/wait.h fnmatch.h
)
139 AM_CONDITIONAL
(BUILD_POLL
, test "x$ac_cv_header_poll_h" = "xno")
140 AM_CONDITIONAL
(BUILD_WIN32_WRAPPERS
, test "x$ac_cv_header_winsock2_h" = "xyes")
141 AS_IF
(test "x$ac_cv_header_winsock2_h" = "xyes",
142 AM_LDFLAGS
="$AM_LDFLAGS -lws2_32")
145 # Some platforms define EWOULDBLOCK == EAGAIN, causing our switch for error
146 # codes to be illegal (POSIX.1-2001 allows both return codes from recv, so
147 # we need to test both if they differ...)
149 AC_MSG_CHECKING
([if EWOULDBLOCK
== EAGAIN
])
154 return EAGAIN
== EWOULDBLOCK ?
0 : 1;
160 AC_DEFINE
([USE_EAGAIN
], [1], [Define to true
if you need to
test for eagain
])
166 libhashkit
/configure.h
167 libmemcached
/configure.h
168 support
/libmemcached.pc
169 support
/libmemcached.spec
170 support
/libmemcached-fc.spec
175 echo "Configuration summary for $PACKAGE_NAME version $VERSION"
177 echo " * Installation prefix: $prefix"
178 echo " * System type: $host_vendor-$host_os"
179 echo " * Host CPU: $host_cpu"
180 echo " * C Compiler: $CC_VERSION"
181 echo " * Assertions enabled: $ac_cv_assert"
182 echo " * Debug enabled: $with_debug"
183 echo " * Warnings as failure: $ac_cv_warnings_as_errors"
191 echo "* NOTE: You are on FreeBSD. BSD make will not work."
193 echo "* use 'gmake' To build libmemcached"
199 AS_IF
(test "$with_docs" = "no",
203 echo "* WARNING: You are not generating any documentation."
204 echo "* Please don't ship libmemcached to an end user"
205 echo "* without documentation..."