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.49],[http
://libmemcached.org
/])
12 AC_CONFIG_SRCDIR
([libmemcached
/memcached.cc
])
13 AC_CONFIG_AUX_DIR
(config
)
15 PANDORA_CANONICAL_TARGET
(no-vc-changelog
)
16 AC_CHECK_PROGS
([YACC
], ['bison'], [:])
17 AC_CHECK_PROGS
([LEX
], ['flex'], [:])
19 #shared library versioning
20 MEMCACHED_UTIL_LIBRARY_VERSION
=2:0:0
21 MEMCACHED_PROTOCAL_LIBRARY_VERSION
=0:0:0
22 MEMCACHED_LIBRARY_VERSION
=7:0:0
26 # current:revision:age
28 # | | +- increment if interfaces have been added
29 # | | set to zero if interfaces have been removed or changed
30 # | +- increment if source code has changed
31 # | set to zero if current is incremented
32 # +- increment if interfaces have been added, removed or changed
33 AC_SUBST
(MEMCACHED_UTIL_LIBRARY_VERSION
)
34 AC_SUBST
(MEMCACHED_PROTOCAL_LIBRARY_VERSION
)
35 AC_SUBST
(MEMCACHED_LIBRARY_VERSION
)
38 HASHKIT_LIBRARY_VERSION
=1:0:0
39 AC_SUBST
(HASHKIT_LIBRARY_VERSION
)
45 #ifdef _SYS_FEATURE_TESTS_H
46 #error "You should include config.h as your first include file"
50 #define _WIN32_WINNT 0x0501
55 #ifdef HAVE_SYS_WAIT_H
66 #include "poll/poll.h"
69 /* To hide the platform differences between MS Windows and Unix
, I am
70 * going to use the Microsoft way and
#define the Microsoft-specific
71 * functions to the unix way. Microsoft use a separate subsystem
for sockets
,
72 * but Unix normally just use a filedescriptor on the same functions. It is
73 * a lot easier to map back to the unix way with macros than going the other
74 * way without side effect
;-)
77 #include "win32/wrappers.h"
78 #define get_socket_errno() WSAGetLastError()
80 #define INVALID_SOCKET -1
81 #define SOCKET_ERROR -1
82 #define closesocket(a) close(a)
83 #define get_socket_errno() errno
86 #ifndef HAVE_MSG_NOSIGNAL
87 #define MSG_NOSIGNAL 0
90 #ifndef HAVE_MSG_DONTWAIT
91 #define MSG_DONTWAIT 0
101 AC_SEARCH_LIBS
(getopt_long
, gnugetopt
)
102 AC_SEARCH_LIBS
(gethostbyname
, nsl
)
104 AC_CHECK_FUNCS
([getline
])
106 PANDORA_HAVE_LIBEVENT
107 my_saved_libs
="$LIBS"
109 PANDORA_REQUIRE_PTHREAD
110 LIBS
="$my_saved_libs"
121 PANDORA_HAVE_LIBINNODB
122 PANDORA_PRINT_CALLSTACK
125 dnl The sasl functions should only be visible
if we build with sasl support
126 AS_IF
([test "x$ac_cv_sasl" = "xyes"],
127 [LIBMEMCACHED_WITH_SASL_SUPPORT
="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1"])
128 AC_SUBST
(LIBMEMCACHED_WITH_SASL_SUPPORT
)
130 AC_CHECK_HEADERS
([atomic.h
])
131 AS_IF
([test "x$ac_cv_header_atomic_h" = "xyes"],[
132 AC_CHECK_FUNCS
(atomic_add_64
)
133 AC_CHECK_FUNCS
(atomic_add_32
)
134 AS_IF
([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"],[
135 AC_DEFINE
([USE_ATOMIC_H
],
137 [Define to true
if you want to use functions from atomic.h
])])])
139 AC_CHECK_HEADERS_ONCE
(winsock2.h poll.h sys
/wait.h fnmatch.h
)
140 AM_CONDITIONAL
(BUILD_POLL
, test "x$ac_cv_header_poll_h" = "xno")
141 AM_CONDITIONAL
(BUILD_WIN32_WRAPPERS
, test "x$ac_cv_header_winsock2_h" = "xyes")
142 AS_IF
(test "x$ac_cv_header_winsock2_h" = "xyes",
143 [AM_LDFLAGS
="$AM_LDFLAGS -lws2_32"
144 AM_CFLAGS
="$AM_CFLAGS $NO_WERROR"
145 AM_CXXFLAGS
="$AM_CXXFLAGS $NO_WERROR"
152 libhashkit
/configure.h
153 libmemcached
/configure.h
154 support
/libmemcached.pc
155 support
/libmemcached.spec
156 support
/libmemcached-fc.spec
161 echo "Configuration summary for $PACKAGE_NAME version $VERSION"
163 echo " * Installation prefix: $prefix"
164 echo " * System type: $host_vendor-$host_os"
165 echo " * Host CPU: $host_cpu"
166 echo " * C Compiler: $CC_VERSION"
167 echo " * Assertions enabled: $ac_cv_assert"
168 echo " * Debug enabled: $with_debug"
169 echo " * Warnings as failure: $ac_cv_warnings_as_errors"
177 echo "* NOTE: You are on FreeBSD. BSD make will not work."
179 echo "* use 'gmake' To build libmemcached"