Update for release 1.01
[awesomized/libmemcached] / configure.ac
1 #!/usr/bin/env bash
2 # LibmemcacheD
3 # Copyright (C) 2011 Data Differential, http://datadifferential.com/
4 # Copyright (C) 2006-2010 Brian Aker, Monty Taylor, Trond Norbye
5 # All rights reserved.
6 #
7 # Use and distribution licensed under the BSD license. See
8 # the COPYING file in this directory for full text.
9
10 AC_INIT([libmemcached],[1.01],[http://libmemcached.org/])
11
12 AC_CONFIG_AUX_DIR(config)
13
14 AC_CANONICAL_TARGET
15
16 AM_INIT_AUTOMAKE
17
18 AC_CANONICAL_HOST
19 AC_CANONICAL_BUILD
20
21 AC_PREREQ([2.61])
22
23 AC_CONFIG_MACRO_DIR(m4)
24
25 AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
26
27 AC_CONFIG_SRCDIR([libmemcached/memcached.cc])
28
29 PANDORA_CANONICAL_TARGET(no-vc-changelog)
30 AC_CHECK_PROGS([YACC], ['bison'], [:])
31 AC_CHECK_PROGS([LEX], ['flex'], [:])
32
33 #shared library versioning
34 MEMCACHED_UTIL_LIBRARY_VERSION=2:0:0
35 MEMCACHED_PROTOCAL_LIBRARY_VERSION=0:0:0
36 MEMCACHED_LIBRARY_VERSION=8:0:0
37 # | | |
38 # +------+ | +---+
39 # | | |
40 # current:revision:age
41 # | | |
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)
50
51
52 HASHKIT_LIBRARY_VERSION=1:0:0
53 AC_SUBST(HASHKIT_LIBRARY_VERSION)
54
55 LT_PREREQ([2.2])
56 LT_INIT()
57 LT_LANG([C++])
58 LT_LANG([C])
59 gl_VISIBILITY
60
61 m4_include([m4/memcached.m4])
62 m4_include([m4/memcached_sasl.m4])
63 m4_include([m4/gearmand.m4])
64 m4_include([m4/libgearman.m4])
65
66 AM_CONDITIONAL(BUILDING_LIBMEMCACHED, true)
67 AM_CONDITIONAL(HAVE_LIBMEMCACHED, false)
68 AC_DEFINE([HAVE_LIBMEMCACHED], [1], [Enables libmemcached Support])
69
70 AM_CONDITIONAL(BUILDING_GEARMAN, false)
71
72 AC_SEARCH_LIBS(getopt_long, gnugetopt)
73 AC_SEARCH_LIBS(gethostbyname, nsl)
74
75 PANDORA_HAVE_LIBEVENT
76
77 case "$target_os" in
78 *linux*)
79 AS_IF([test "x$GCC" = "xyes"],
80 [
81 LDFLAGS="$LDFLAGS -z relro -z now"
82 ])
83 ;;
84 esac
85
86 dnl Specialty checks
87 AX_PTHREAD
88 CONFIG_EXTRA
89 DETECT_BYTEORDER
90 ENABLE_UTILLIB
91 SETSOCKOPT_SANITY
92 ENABLE_HSIEH_HASH
93 ENABLE_MURMUR_HASH
94 ENABLE_FNV64_HASH
95 ENABLE_MEMASLAP
96 PROTOCOL_BINARY_TEST
97 ENABLE_DEPRECATED
98 PANDORA_HAVE_LIBINNODB
99 PANDORA_HAVE_SASL
100
101 AC_CHECK_FUNCS([alarm])
102 AC_CHECK_FUNCS([dup2])
103 AC_CHECK_FUNCS([getline])
104 AC_CHECK_FUNCS([gettimeofday])
105 AC_CHECK_FUNCS([memchr])
106 AC_CHECK_FUNCS([memmove])
107 AC_CHECK_FUNCS([memset])
108 AC_CHECK_FUNCS([select])
109 AC_CHECK_FUNCS([setenv])
110 AC_CHECK_FUNCS([socket])
111 AC_CHECK_FUNCS([sqrt])
112 AC_CHECK_FUNCS([strcasecmp])
113 AC_CHECK_FUNCS([strchr])
114 AC_CHECK_FUNCS([strdup])
115 AC_CHECK_FUNCS([strerror])
116 AC_CHECK_FUNCS([strtol])
117 AC_CHECK_FUNCS([strtoul])
118 AC_CHECK_FUNCS([strtoull])
119
120 AC_CHECK_HEADERS([arpa/inet.h])
121 AC_CHECK_HEADERS([fcntl.h])
122 AC_CHECK_HEADERS([libintl.h])
123 AC_CHECK_HEADERS([limits.h])
124 AC_CHECK_HEADERS([malloc.h])
125 AC_CHECK_HEADERS([netdb.h])
126 AC_CHECK_HEADERS([netinet/in.h])
127 AC_CHECK_HEADERS([stddef.h])
128 AC_CHECK_HEADERS([sys/time.h])
129 AC_CHECK_HEADERS([sasl/sasl.h])
130 AC_CXX_HEADER_STDCXX_98
131
132 AC_FUNC_ALLOCA
133 AC_FUNC_ERROR_AT_LINE
134 AC_FUNC_FORK
135 AC_FUNC_MALLOC
136 AC_FUNC_REALLOC
137 AC_FUNC_STRERROR_R
138 AC_HEADER_STDBOOL
139 AC_TYPE_INT16_T
140 AC_TYPE_INT32_T
141 AC_TYPE_INT64_T
142 AC_TYPE_INT8_T
143 AC_TYPE_OFF_T
144 AC_TYPE_PID_T
145 AC_TYPE_SSIZE_T
146 AC_TYPE_UINT16_T
147 AC_TYPE_UINT32_T
148 AC_TYPE_UINT64_T
149 AC_TYPE_UINT8_T
150
151 dnl The sasl functions should only be visible if we build with sasl support
152 AS_IF([test "x$ac_cv_sasl" = "xyes"],
153 [
154 [ LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1" ]
155 ],
156 [
157 [ LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0" ]
158 ]
159 )
160 AC_SUBST(LIBMEMCACHED_WITH_SASL_SUPPORT)
161
162 AC_CHECK_HEADERS([atomic.h])
163 AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"],[
164 AC_CHECK_FUNCS(atomic_add_64)
165 AC_CHECK_FUNCS(atomic_add_32)
166 AS_IF([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"],[
167 AC_DEFINE([USE_ATOMIC_H],
168 [1],
169 [Define to true if you want to use functions from atomic.h])])])
170
171 AC_CHECK_HEADERS_ONCE(winsock2.h poll.h sys/wait.h fnmatch.h)
172 AM_CONDITIONAL(BUILD_POLL, test "x$ac_cv_header_poll_h" = "xno")
173 AM_CONDITIONAL(BUILD_WIN32_WRAPPERS, test "x$ac_cv_header_winsock2_h" = "xyes")
174 AS_IF(test "x$ac_cv_header_winsock2_h" = "xyes",
175 [AM_LDFLAGS="$AM_LDFLAGS -lws2_32"
176 AM_CFLAGS="$AM_CFLAGS $NO_WERROR"
177 AM_CXXFLAGS="$AM_CXXFLAGS $NO_WERROR"
178 ])
179 DETECT_EAGAIN
180 SOCKET_SEND_FLAGS
181
182 AC_CONFIG_FILES([
183 Makefile
184 docs/conf.py
185 libhashkit-1.0/configure.h
186 libmemcached-1.0/configure.h
187 support/libmemcached.pc
188 support/libmemcached.spec
189 support/libmemcached-fc.spec
190 libtest/version.h
191 ])
192 AC_OUTPUT
193
194 echo "---"
195 echo "Configuration summary for $PACKAGE_NAME version $VERSION"
196 echo ""
197 echo " * Installation prefix: $prefix"
198 echo " * System type: $host_vendor-$host_os"
199 echo " * Host CPU: $host_cpu"
200 echo " * C Compiler: $CC_VERSION"
201 echo " * Assertions enabled: $ac_cv_assert"
202 echo " * Debug enabled: $with_debug"
203 echo " * Warnings as failure: $ac_cv_warnings_as_errors"
204 echo ""
205 echo "---"
206
207 case "$host_os" in
208 *freebsd*)
209 echo "*****"
210 echo "*"
211 echo "* NOTE: You are on FreeBSD. BSD make will not work."
212 echo "*"
213 echo "* use 'gmake' To build libmemcached"
214 echo "*"
215 echo "*****"
216 ;;
217 esac
218