3 # Copyright (C) 2011-2012 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.
10 AC_INIT
([libmemcached
],[1.0.10],[http
://libmemcached.org
/])
12 AC_CONFIG_AUX_DIR
(config
)
23 AC_CONFIG_MACRO_DIR
(m4)
25 AC_CONFIG_HEADERS
([config.h
:config.
in])dnl Keep filename to
8.3 for MS-DOS.
27 AC_CONFIG_SRCDIR
([libmemcached
/memcached.cc
])
29 PANDORA_CANONICAL_TARGET
(no-vc-changelog
)
30 AC_CHECK_PROGS
([YACC
], ['bison'], [:])
31 AC_CHECK_PROGS
([LEX
], ['flex'], [:])
33 #shared library versioning
34 MEMCACHED_UTIL_LIBRARY_VERSION
=2:0:0
35 MEMCACHED_PROTOCAL_LIBRARY_VERSION
=0:0:0
36 MEMCACHED_LIBRARY_VERSION
=11:0:0
40 # current:revision:age
42 # | | +- increment if interfaces have been added
43 # | | set to zero if interfaces have been removed or changed
44 # | +- increment if source code has changed
45 # | set to zero if current is incremented
46 # +- increment if interfaces have been added, removed or changed
47 AC_SUBST
(MEMCACHED_UTIL_LIBRARY_VERSION
)
48 AC_SUBST
(MEMCACHED_PROTOCAL_LIBRARY_VERSION
)
49 AC_SUBST
(MEMCACHED_LIBRARY_VERSION
)
52 HASHKIT_LIBRARY_VERSION
=2:0:0
53 AC_SUBST
(HASHKIT_LIBRARY_VERSION
)
61 AX_CXX_HEADER_STDCXX_98
62 if test "$ax_cv_cxx_stdcxx_98" = no
; then
63 AC_MSG_ERROR
([Your system lacks a new enough C
++ compiler
])
66 # Adding support for libtest
67 m4_include
([libtest
/yatl.
m4])
69 m4_include
([m
4/memcached_sasl.
m4])
70 m4_include
([m
4/gearmand.
m4])
71 m4_include
([m
4/libgearman.
m4])
73 AM_CONDITIONAL
(BUILDING_LIBMEMCACHED
, true
)
74 AM_CONDITIONAL
(HAVE_LIBMEMCACHED
, false
)
75 AM_CONDITIONAL
(HAVE_LIBDRIZZLE
, false
)
76 AC_DEFINE
([HAVE_LIBMEMCACHED
], [1], [Enables libmemcached Support
])
78 AM_CONDITIONAL
(BUILDING_GEARMAN
, false
)
80 AC_SEARCH_LIBS
(getopt_long
, gnugetopt
)
81 AC_SEARCH_LIBS
(gethostbyname
, nsl
)
95 AC_CHECK_FUNCS
([alarm
])
96 AC_CHECK_FUNCS
([clock_gettime
])
97 AC_CHECK_FUNCS
([dup2
])
98 AC_CHECK_FUNCS
([getline
])
99 AC_CHECK_FUNCS
([gettimeofday
])
100 AC_CHECK_FUNCS
([memchr
])
101 AC_CHECK_FUNCS
([memmove
])
102 AC_CHECK_FUNCS
([memset
])
103 AC_CHECK_FUNCS
([pipe2
])
104 AC_CHECK_FUNCS
([select])
105 AC_CHECK_FUNCS
([setenv
])
106 AC_CHECK_FUNCS
([socket
])
107 AC_CHECK_FUNCS
([sqrt
])
108 AC_CHECK_FUNCS
([strcasecmp
])
109 AC_CHECK_FUNCS
([strchr
])
110 AC_CHECK_FUNCS
([strdup
])
111 AC_CHECK_FUNCS
([strerror
])
112 AC_CHECK_FUNCS
([strtol
])
113 AC_CHECK_FUNCS
([strtoul
])
114 AC_CHECK_FUNCS
([strtoull
])
116 AC_CHECK_HEADERS
([arpa
/inet.h
])
117 AC_CHECK_HEADERS
([errno.h
])
118 AC_CHECK_HEADERS
([execinfo.h
])
119 AC_CHECK_HEADERS
([fcntl.h
])
120 AC_CHECK_HEADERS
([inttypes.h
])
121 AC_CHECK_HEADERS
([libintl.h
])
122 AC_CHECK_HEADERS
([limits.h
])
123 AC_CHECK_HEADERS
([malloc.h
])
124 AC_CHECK_HEADERS
([math.h
])
125 AC_CHECK_HEADERS
([netdb.h
])
126 AC_CHECK_HEADERS
([netinet
/in.h
])
127 AC_CHECK_HEADERS
([pthread.h
])
128 AC_CHECK_HEADERS
([stdarg.h
])
129 AC_CHECK_HEADERS
([stddef.h
])
130 AC_CHECK_HEADERS
([stdlib.h
])
131 AC_CHECK_HEADERS
([sys
/time.h
])
132 AC_CHECK_HEADERS
([unistd.h
])
133 AC_CHECK_HEADERS
([cxxabi.h
],
134 AC_DEFINE
([HAVE_CXXABI_H
], [1], [Have cxxabi.h
]),
135 AC_DEFINE
([HAVE_CXXABI_H
], [0], [Have cxxabi.h
]))
137 AC_CHECK_HEADERS
([sys
/sysctl.h
])
139 AC_CHECK_HEADER
(umem.h
, [
140 AC_DEFINE
([HAVE_UMEM_H
], 1,
141 [Define this
if you have umem.h
])
143 ], [build_cache
=yes])
145 AM_CONDITIONAL
([BUILD_CACHE
], [test "x$build_cache" = "xyes"])
150 AC_FUNC_ERROR_AT_LINE
174 AX_CXX_GCC_ABI_DEMANGLE
179 dnl The sasl functions should only be visible
if we build with sasl support
181 AS_IF
([test "x$ac_enable_sasl" = "xyes"], [
182 [ LIBMEMCACHED_WITH_SASL_SUPPORT
="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1" ]
184 [ LIBMEMCACHED_WITH_SASL_SUPPORT
="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0" ]
186 AC_SUBST
(LIBMEMCACHED_WITH_SASL_SUPPORT
)
188 AX_CHECK_LIBRARY
([LIBUUID
], [uuid
/uuid.h
], [uuid
],
190 LIBUUID_LDFLAGS
="-luuid"
191 AC_DEFINE
([HAVE_LIBUUID
], [ 1 ], [Have libuuid
])
194 AC_DEFINE
([HAVE_LIBUUID
], [ 0 ], [Have libuuid
])
197 AC_CHECK_LIB
([rt
], [clock_gettime
],
201 AC_DEFINE
([HAVE_LIBRT
], [ 1 ], [Have clock_gettime
])
204 AC_DEFINE
([HAVE_LIBRT
], [ 0 ], [Have clock_gettime
])
207 AC_CHECK_LIB
([m
], [floor
])
208 AC_CHECK_FUNCS
([sigignore
])
210 AC_CHECK_HEADERS
([atomic.h
])
211 AS_IF
([test "x$ac_cv_header_atomic_h" = "xyes"],[
212 AC_CHECK_FUNCS
(atomic_add_64
)
213 AC_CHECK_FUNCS
(atomic_add_32
)
214 AS_IF
([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"],[
215 AC_DEFINE
([USE_ATOMIC_H
],
217 [Define to true
if you want to use functions from atomic.h
])])])
219 AC_DEFINE
([HAVE_LIBDRIZZLE
], [0], [Support
for libdrizzle
])
220 AC_DEFINE
([HAVE_DRIZZLED_BINARY
], [0], [Support
for DrizzleD
])
221 AC_DEFINE
([DRIZZLED_BINARY
], [0], [Support
for DrizzleD
])
222 AC_DEFINE
([GEARMAND_BLOBSLAP_WORKER
], [0], [Support
for Gearman Blobslap worker
])
223 AC_DEFINE
([HAVE_LIBPQ
], [0], [Support
for Postgres
])
224 AC_DEFINE
([HAVE_LIBCURL
], [0], [Support
for libcurl
])
226 AC_DEFINE
([HAVE_MEMCACHED_LIGHT_BINARY
], [1], [Support
for memcached_light
])
227 AC_DEFINE
([MEMCACHED_LIGHT_BINARY
], ["example/memcached_light"], [Support
for memcached_light
])
229 dnl Check
for the requirements
for running memcached with
less privileges
230 dnl than the default privilege
set. On Solaris we need setppriv and priv.h
231 dnl If you want to add support
for other platforms you should check
for
232 dnl your requirements
, define HAVE_DROP_PRIVILEGES
, and
make sure you add
233 dnl the
source file containing the implementation into memcached_SOURCE
235 AC_CHECK_FUNCS
(setppriv
, [
236 AC_CHECK_HEADER
(priv.h
, [
237 AC_DEFINE
([HAVE_DROP_PRIVILEGES
], 1,
238 [Define this
if you have an implementation of drop_privileges
()])
239 build_solaris_privs
=yes
243 AC_CHECK_HEADERS_ONCE
(winsock2.h poll.h sys
/wait.h fnmatch.h
)
244 AM_CONDITIONAL
(BUILD_POLL
, test "x$ac_cv_header_poll_h" = "xno")
245 AM_CONDITIONAL
(BUILD_WIN32_WRAPPERS
, test "x$ac_cv_header_winsock2_h" = "xyes")
246 AS_IF
(test "x$ac_cv_header_winsock2_h" = "xyes",
247 [AM_LDFLAGS
="$AM_LDFLAGS -lws2_32"
248 AM_CFLAGS
="$AM_CFLAGS $NO_WERROR"
249 AM_CXXFLAGS
="$AM_CXXFLAGS $NO_WERROR"
253 AX_CHECK_LIBRARY
([LIBEVENT
], [event.h
], [event
],
255 LIBEVENT_LDFLAGS
="-levent"
258 AC_MSG_WARN
([Unable to
find libevent
])
260 AM_CONDITIONAL
(HAVE_LIBEVENT
, test "x${ax_cv_have_LIBEVENT}" = "xyes")
262 dnl Check
if we
're a little-endian or a big-endian system, needed by hash code
263 AC_DEFUN([AC_C_ENDIAN],
264 [AC_CACHE_CHECK(for endianness, ac_cv_c_endian,
267 [AC_LANG_PROGRAM([], [dnl
269 char *c = (char *) &val;
275 ac_cv_c_endian=little
278 if test $ac_cv_c_endian = big; then
279 AC_DEFINE(ENDIAN_BIG, 1, [machine is bigendian])
281 if test $ac_cv_c_endian = little; then
282 AC_DEFINE(ENDIAN_LITTLE, 1, [machine is littleendian])
286 AX_CHECK_SOCK_CLOEXEC([AC_DEFINE([HAVE_SOCK_CLOEXEC], [1], [Check for SOCK_CLOEXEC.])],
287 [AC_DEFINE([HAVE_SOCK_CLOEXEC], [0], [Check for SOCK_CLOEXEC.])])
289 AX_PTHREAD(, [AC_MSG_ERROR(could not find libpthread)])
291 AX_HARDEN_COMPILER_FLAGS
298 libhashkit-1.0/configure.h
299 libmemcached-1.0/configure.h
300 libmemcached-1.2/configure.h
301 libmemcached-2.0/configure.h
302 support/libmemcached.pc
303 support/libmemcached.spec
304 support/libmemcached-fc.spec
309 echo "Configuration summary for $PACKAGE_NAME version $VERSION"
311 echo " * Installation prefix: $prefix"
312 echo " * System type: $host_vendor-$host_os"
313 echo " * Host CPU: $host_cpu"
314 echo " * C Compiler: $CC_VERSION"
315 echo " * Assertions enabled: $ac_cv_assert"
316 echo " * Debug enabled: $with_debug"
317 echo " * Warnings as failure: $ac_cv_warnings_as_errors"
318 echo " * SASL support: $ac_enable_sasl"
326 echo "* NOTE: You are on FreeBSD. BSD make will not work."
328 echo "* use 'gmake
' To build libmemcached"