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.4],[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
=9: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
=1: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 m4_include
([m
4/memcached.
m4])
67 m4_include
([m
4/memcached_sasl.
m4])
68 m4_include
([m
4/gearmand.
m4])
69 m4_include
([m
4/libgearman.
m4])
71 AM_CONDITIONAL
(BUILDING_LIBMEMCACHED
, true
)
72 AM_CONDITIONAL
(HAVE_LIBMEMCACHED
, false
)
73 AC_DEFINE
([HAVE_LIBMEMCACHED
], [1], [Enables libmemcached Support
])
75 AM_CONDITIONAL
(BUILDING_GEARMAN
, false
)
77 AC_SEARCH_LIBS
(getopt_long
, gnugetopt
)
78 AC_SEARCH_LIBS
(gethostbyname
, nsl
)
82 AS_IF
([test "x$GCC" = "xyes"],
84 LDFLAGS
="$LDFLAGS -z relro -z now"
102 AC_CHECK_FUNCS
([alarm
])
103 AC_CHECK_FUNCS
([dup2
])
104 AC_CHECK_FUNCS
([getline
])
105 AC_CHECK_FUNCS
([gettimeofday
])
106 AC_CHECK_FUNCS
([memchr
])
107 AC_CHECK_FUNCS
([memmove
])
108 AC_CHECK_FUNCS
([memset
])
109 AC_CHECK_FUNCS
([select])
110 AC_CHECK_FUNCS
([setenv
])
111 AC_CHECK_FUNCS
([socket
])
112 AC_CHECK_FUNCS
([sqrt
])
113 AC_CHECK_FUNCS
([strcasecmp
])
114 AC_CHECK_FUNCS
([strchr
])
115 AC_CHECK_FUNCS
([strdup
])
116 AC_CHECK_FUNCS
([strerror
])
117 AC_CHECK_FUNCS
([strtol
])
118 AC_CHECK_FUNCS
([strtoul
])
119 AC_CHECK_FUNCS
([strtoull
])
121 AC_CHECK_HEADERS
([arpa
/inet.h
])
122 AC_CHECK_HEADERS
([fcntl.h
])
123 AC_CHECK_HEADERS
([libintl.h
])
124 AC_CHECK_HEADERS
([limits.h
])
125 AC_CHECK_HEADERS
([malloc.h
])
126 AC_CHECK_HEADERS
([netdb.h
])
127 AC_CHECK_HEADERS
([netinet
/in.h
])
128 AC_CHECK_HEADERS
([stddef.h
])
129 AC_CHECK_HEADERS
([sys
/time.h
])
130 AC_CHECK_HEADERS
([sasl
/sasl.h
])
131 AC_CHECK_HEADERS
([execinfo.h
])
132 AC_CHECK_HEADERS
([cxxabi.h
],
133 AC_DEFINE
([HAVE_CXXABI_H
], [1], [Have cxxabi.h
]),
134 AC_DEFINE
([HAVE_CXXABI_H
], [0], [Have cxxabi.h
]))
139 AC_FUNC_ERROR_AT_LINE
163 AX_CXX_GCC_ABI_DEMANGLE
168 dnl The sasl functions should only be visible
if we build with sasl support
170 AS_IF
([test "x$ac_enable_sasl" = "xyes"], [
171 [ LIBMEMCACHED_WITH_SASL_SUPPORT
="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1" ]
173 [ LIBMEMCACHED_WITH_SASL_SUPPORT
="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0" ]
175 AC_SUBST
(LIBMEMCACHED_WITH_SASL_SUPPORT
)
177 AX_CHECK_LIBRARY
([LIBUUID
], [uuid
/uuid.h
], [uuid
],
179 LIBUUID_LDFLAGS
="-luuid"
180 AC_DEFINE
([HAVE_LIBUUID
], [ 1 ], [Have libuuid
])
183 AC_DEFINE
([HAVE_LIBUUID
], [ 0 ], [Have libuuid
])
186 AC_CHECK_LIB
([rt
], [clock_gettime
],
190 AC_DEFINE
([HAVE_LIBRT
], [ 1 ], [Have clock_gettime
])
193 AC_DEFINE
([HAVE_LIBRT
], [ 0 ], [Have clock_gettime
])
196 AC_CHECK_LIB
([m
], [floor
])
198 AC_CHECK_HEADERS
([atomic.h
])
199 AS_IF
([test "x$ac_cv_header_atomic_h" = "xyes"],[
200 AC_CHECK_FUNCS
(atomic_add_64
)
201 AC_CHECK_FUNCS
(atomic_add_32
)
202 AS_IF
([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"],[
203 AC_DEFINE
([USE_ATOMIC_H
],
205 [Define to true
if you want to use functions from atomic.h
])])])
207 AC_CHECK_HEADERS_ONCE
(winsock2.h poll.h sys
/wait.h fnmatch.h
)
208 AM_CONDITIONAL
(BUILD_POLL
, test "x$ac_cv_header_poll_h" = "xno")
209 AM_CONDITIONAL
(BUILD_WIN32_WRAPPERS
, test "x$ac_cv_header_winsock2_h" = "xyes")
210 AS_IF
(test "x$ac_cv_header_winsock2_h" = "xyes",
211 [AM_LDFLAGS
="$AM_LDFLAGS -lws2_32"
212 AM_CFLAGS
="$AM_CFLAGS $NO_WERROR"
213 AM_CXXFLAGS
="$AM_CXXFLAGS $NO_WERROR"
217 AX_CHECK_LIBRARY
([LIBEVENT
], [event.h
], [event
],
219 LIBEVENT_LDFLAGS
="-levent"
222 AC_MSG_WARN
([Unable to
find libevent
])
224 AM_CONDITIONAL
(HAVE_LIBEVENT
, test "x${ax_cv_have_LIBEVENT}" = "xyes")
229 libhashkit-1.0
/configure.h
230 libmemcached-1.0
/configure.h
231 libmemcached-1.2
/configure.h
232 libmemcached-2.0
/configure.h
233 support
/libmemcached.pc
234 support
/libmemcached.spec
235 support
/libmemcached-fc.spec
241 echo "Configuration summary for $PACKAGE_NAME version $VERSION"
243 echo " * Installation prefix: $prefix"
244 echo " * System type: $host_vendor-$host_os"
245 echo " * Host CPU: $host_cpu"
246 echo " * C Compiler: $CC_VERSION"
247 echo " * Assertions enabled: $ac_cv_assert"
248 echo " * Debug enabled: $with_debug"
249 echo " * Warnings as failure: $ac_cv_warnings_as_errors"
250 echo " * SASL support: $ac_enable_sasl"
258 echo "* NOTE: You are on FreeBSD. BSD make will not work."
260 echo "* use 'gmake' To build libmemcached"