forked from p-alik/gearmand
-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
385 lines (332 loc) · 12.3 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# configure.ac -*- autoconf -*- vim: filetype=config
#
# Gearman server and library
# Copyright (C) 2011-2014 Data Differential, http://datadifferential.com/
# Copyright (C) 2008 Brian Aker, Eric Day, Monty Taylor
# All rights reserved.
#
# Use and distribution licensed under the BSD license. See
# the COPYING file in this directory for full text.
m4_include([version.m4])
AC_REVISION([m4_esyscmd_s([git describe --always])])
AC_PREREQ([2.63])
AC_INIT([gearmand],VERSION_NUMBER,[https://github.com/gearman/gearmand/issues],[gearmand],[http://gearman.info/])
AC_CONFIG_AUX_DIR([build-aux])
# Setup the compilers early on
AC_PROG_CC([cc gcc clang])
AC_PROG_CXX([c++ g++ clang++])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AC_ARG_PROGRAM
AC_USE_SYSTEM_EXTENSIONS
AX_GENERATE_CHANGELOG
AM_INIT_AUTOMAKE([1.11 color-tests -Wno-portability subdir-objects foreign tar-ustar])
AC_CONFIG_HEADERS([gear_config.h:gear_config.in])dnl Keep filename to 8.3 for MS-DOS.
AC_SUBST([AUTOHEADER_FILE],[gear_config.h])
AC_CONFIG_SRCDIR([libgearman/gearman.cc])
GEARMAN_LIBRARY_VERSION=8:0:0
# | | |
# +------+ | +---+
# | | |
# current:revision:age
# | | |
# | | +- increment if interfaces have been added
# | | set to zero if interfaces have been removed
# | | or changed
# | +- increment if source code has changed
# | set to zero if current is incremented
# +- increment if interfaces have been added, removed or changed
AC_SUBST([GEARMAN_LIBRARY_VERSION])
LT_PREREQ([2.2])
LT_INIT([dlopen])
LT_LANG([C++])
LT_LIB_M
AC_SUBST([lt_cv_dlopen_libs])
AC_PROG_CC_C99
AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])])
AC_DEFUN([CHECK_CXX0X],[
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-std=c++0x],[
CXXFLAGS="$CXXFLAGS -std=c++0x"])
AC_LANG_POP([C++])
])
CHECK_CXX0X
AX_PLATFORM
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# First look for Boost, maybe for a specific minimum version:
AC_DEFUN([CHECK_BOOST],
[AX_BOOST_BASE([1.39],,[AC_MSG_ERROR(could not find boost)])
AX_BOOST_PROGRAM_OPTIONS])
CHECK_BOOST
m4_include([libhashkit/include.m4])
AX_CXX_CINTTYPES
CONFIG_EXTRA
m4_include([libtest/yatl.m4])
AM_CONDITIONAL([BUILDING_GEARMAN],true)
AM_CONDITIONAL([HAVE_LIBGEARMAN],true)
AC_SUBST([_WITH_LIBGEARMAN_SUPPORT],["_WITH_LIBGEARMAN_SUPPORT 0"])
AC_DEFINE([GEARMAND_BINARY],["./gearmand/gearmand"],[Name of the gearmand binary used in make test])
AC_DEFINE([HAVE_LIBGEARMAN],[1], [libgearman support])
AC_DEFINE([HAVE_GEARMAND_BINARY],[1],[gearmand binary was found])
AC_DEFUN([CHECK_CURL],
[AX_LIB_CURL([7.21.7],
[AX_CHECK_LIBRARY([LIBCURL],[curl/curl.h],[curl])],
[AC_DEFINE([HAVE_LIBCURL],[0],[Have the LIBCURL library])
])
])
CHECK_CURL
AM_CONDITIONAL([HAVE_LIBCURL],[test "x${ax_cv_have_LIBCURL}" = "xyes"])
m4_include([m4/drizzled.m4])
WITH_LIBDRIZZLE
AX_LIB_SQLITE3
AS_IF([test "x${WANT_SQLITE3}" = "xyes"],
[AC_DEFINE([HAVE_LIBSQLITE3],[1],[Have the SQLITE3 library])],
[AC_DEFINE([HAVE_LIBSQLITE3],[0],[Have the SQLITE3 library])])
AM_CONDITIONAL([HAVE_LIBSQLITE3],[test "x${WANT_SQLITE3}" = "xyes"])
PANDORA_ENABLE_DTRACE
AX_HAVE_LIBPQ
PANDORA_HAVE_LIBTOKYOCABINET
AC_FUNC_STRERROR_R
SOCKET_SEND_FLAGS
FCNTL_FLAGS
AX_ENABLE_LIBHIREDIS
# Checks for programs.
AC_CHECK_PROGS([DPKG_GENSYMBOLS],[dpkg-gensymbols])
AC_CHECK_PROGS([OPENSSL],[openssl])
AC_CHECK_PROGS([VALGRIND],['valgrind'])
AC_CHECK_PROGS([WINE],['wine'])
AC_CHECK_PROGS([RPMBUILD],[rpmbuild --nocheck])
AC_CHECK_PROGS([RPMDEV_SETUPTREE],[rpmdev-setuptree])
AC_CHECK_PROGS([RPM],[rpm])
AC_PATH_PROG([GPERF],['gperf'],[])
AS_IF([test -z "$GPERF"],
[AC_MSG_ERROR([could not find gperf])]])
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AX_PROG_MEMCACHED
AX_PROG_SPHINX_BUILD(,[AC_MSG_WARN([sphinx-build version 1.0 or greater is required to build man pages])])
AX_WITH_PROG([LCOV],[lcov])
AX_WITH_PROG([LCOV_GENHTML],[genhtml])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS_ONCE([arpa/inet.h])
AC_CHECK_HEADERS_ONCE([errno.h])
AC_CHECK_HEADERS_ONCE([execinfo.h])
AC_CHECK_HEADERS_ONCE([fcntl.h])
AC_CHECK_HEADERS_ONCE([features.h])
AC_CHECK_HEADERS_ONCE([fnmatch.h])
AC_CHECK_HEADERS_ONCE([getopt.h])
AC_CHECK_HEADERS_ONCE([inttypes.h])
AC_CHECK_HEADERS_ONCE([limits.h])
AC_CHECK_HEADERS_ONCE([mach/mach.h])
AC_CHECK_HEADERS_ONCE([netdb.h])
AC_CHECK_HEADERS_ONCE([netinet/in.h])
AC_CHECK_HEADERS_ONCE([netinet/tcp.h])
AC_CHECK_HEADERS_ONCE([poll.h])
AC_CHECK_HEADERS_ONCE([pwd.h])
AC_CHECK_HEADERS_ONCE([signal.h])
AC_CHECK_HEADERS_ONCE([spawn.h])
AC_CHECK_HEADERS_ONCE([stdarg.h])
AC_CHECK_HEADERS_ONCE([stddef.h])
AC_CHECK_HEADERS_ONCE([stdint.h])
AC_CHECK_HEADERS_ONCE([stdio.h])
AC_CHECK_HEADERS_ONCE([stdlib.h])
AC_CHECK_HEADERS_ONCE([string.h])
AC_CHECK_HEADERS_ONCE([strings.h])
AC_CHECK_HEADERS_ONCE([sys/epoll.h])
AC_CHECK_HEADERS_ONCE([sys/resource.h])
AC_CHECK_HEADERS_ONCE([sys/socket.h])
AC_CHECK_HEADERS_ONCE([sys/stat.h])
AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_CHECK_HEADERS_ONCE([sys/types.h])
AC_CHECK_HEADERS_ONCE([sys/utsname.h])
AC_CHECK_HEADERS_ONCE([sys/wait.h])
AC_CHECK_HEADERS_ONCE([syslog.h])
AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_HEADERS_ONCE([winsock2.h])
AC_CHECK_HEADERS_ONCE([libmemcached-1.0/types/return.h])
AM_CONDITIONAL([BUILD_WIN32_WRAPPERS],[test "x$ac_cv_header_winsock2_h" = "xyes"])
AS_IF([test "x$ac_cv_header_winsock2_h" = "xyes"],
[AM_LDFLAGS="$AM_LDFLAGS -lws2_32"
AM_CFLAGS="$AM_CFLAGS $NO_WERROR"
AM_CXXFLAGS="$AM_CXXFLAGS $NO_WERROR"
])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_TYPES([ptrdiff_t])
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_HEADER_STDBOOL
AC_HEADER_TIME
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_MEMCMP
AC_FUNC_STRERROR_R
AC_FUNC_VPRINTF
AC_REPLACE_FNMATCH
AC_CHECK_FUNCS([accept4])
AC_CHECK_FUNCS([dup2])
AC_CHECK_FUNCS([fork])
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([memchr])
AC_CHECK_FUNCS([memmove])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([pipe])
AC_CHECK_FUNCS([pipe2])
AC_CHECK_FUNCS([select])
AC_CHECK_FUNCS([setenv])
AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([strcasecmp])
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([strerror])
AC_CHECK_FUNCS([strncasecmp])
AC_CHECK_FUNCS([strtol])
AC_CHECK_FUNCS([strtoul])
AC_CHECK_FUNCS([uname])
AC_CHECK_FUNCS([atexit])
AC_CHECK_FUNCS([getcwd])
AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNC([setsockopt],[],[AC_CHECK_LIB([socket],[setsockopt])])
AC_CHECK_FUNC([bind],[],[AC_CHECK_LIB([bind],[bind])])
# Check for -lrt
AC_CHECK_LIB([rt],[clock_gettime],
[AX_SAVE_FLAGS
LIBS="$LIB -lrt"
AC_CHECK_FUNCS([clock_gettime])
AX_RESTORE_FLAGS
AC_SUBST([RT_LIB],[-lrt])
AC_DEFINE([HAVE_LIBRT],[1],[Have -lrt])
],
[AC_CHECK_FUNCS([clock_gettime])])
# Check for OPENSSL
AX_CHECK_OPENSSL([have_openssl=yes
AC_DEFINE([HAVE_OPENSSL],[1],[Enable openssl Support])],
[have_openssl=no])
AM_CONDITIONAL([ENABLE_OPENSSL],[test "x${have_openssl}" = "xyes"])
# Check for wolfSSL
AX_CHECK_WOLFSSL([have_wolfssl=yes],[have_wolfssl=no])
AM_CONDITIONAL([ENABLE_WOLFSSL],[test "x${have_wolfssl}" = "xyes"])
AC_DEFUN([AX_ENABLE_SSL],
[AC_PREREQ([2.63])dnl
m4_define([_SSL_ENABLE_DEFAULT], [m4_if($1, no, no, no)])dnl
AC_ARG_ENABLE([ssl],
[AS_HELP_STRING([--enable-ssl],
[Enable ssl support for Gearman @<:@default=]_SSL_ENABLE_DEFAULT[@:>@])],
[AS_CASE([$enableval],
[yes],[enable_ssl=yes],
[no],[enable_ssl=no],
[enable_ssl=no])
],
[enable_ssl=]_SSL_ENABLE_DEFAULT)
AS_IF([test "x${enable_ssl}" = "xyes"],
[AS_IF([test "x${have_wolfssl}" = "xyes"],
[AC_DEFINE([HAVE_SSL],[1],[Enable SSL Support])
AC_DEFINE([HAVE_OPENSSL],[0],[Enable OPENSSL Support])
],
[AS_IF([test "x${have_openssl}" = "xyes"],
[AC_DEFINE([HAVE_SSL],[1],[Enable SSL Support])]
)]
)
]
)
AM_CONDITIONAL([ENABLE_SSL],[test "x${enable_ssl}" = "xyes"])
])
if [ test "x${enable_ssl}" = "xyes" ]; then
if ! [ test "x${have_openssl}" = "xyes" ] && ! [ test "x${have_wolfssl}" = "xyes" ]; then
AC_MSG_ERROR([Unable to find either openssl or wolfssl])
fi
fi
AX_ENABLE_SSL
AX_ENABLE_LIBMEMCACHED
AC_DEFINE([GEARMAND_BLOBSLAP_WORKER],[1],[Have Gearman Blobslap Worker])
AX_LIBEVENT(,[AC_MSG_ERROR([Unable to find libevent])])
AX_UUID(,[AC_MSG_ERROR([Unable to find libuuid])])
AX_UUID_GENERATE_TIME_SAFE
AX_AM_JOBSERVER([yes])
AS_IF([test "x${TARGET_LINUX}" = "xtrue"],
[AC_DEFINE([BUILD_LIBHOSTILE],[1],[Build libhostile])],[AC_DEFINE([BUILD_LIBHOSTILE],[0],[Build libhostile])])
AM_CONDITIONAL([TARGET_HOSTILE],[test "x${TARGET_LINUX}" = "xtrue"])
AC_DEFUN([CHECK_FOR_PTHREAD_AND_SASL],
[AC_LANG_PUSH([C++])
AX_PTHREAD(, [AC_MSG_ERROR(could not find Posix Pthread support)])
AX_PTHREAD_TIMEDJOIN_NP
AC_LANG_POP([C++])
])
CHECK_FOR_PTHREAD_AND_SASL
AX_ENDIAN
AX_HEX_VERSION([LIBGEARMAN],[$VERSION])
AC_SUBST([RPM_RELEASE],[1])
AX_HARDEN_COMPILER_FLAGS
AM_CONDITIONAL([TARGET_MINGW],[test "x${MINGW}" = "xtrue"])
# backtrace(), others require shared builds
AS_IF([test "x$enable_shared" = "xyes"],
[AC_DEFINE([HAVE_SHARED_ENABLED],[1],[Enable code which requires shared library support. Like backtrace().])
AX_CXX_GCC_ABI_DEMANGLE])
AM_CONDITIONAL([SHARED_ENABLED],[test "x$enable_shared" = "xyes"])
AC_CONFIG_FILES([Makefile
docs/source/conf.py
libgearman-1.0/version.h
scripts/gearmand
scripts/gearmand.xml
scripts/smf_install.sh
support/gearmand.init
support/gearmand.pc
support/gearmand.spec])
AC_OUTPUT
echo "---"
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
echo ""
echo " * Installation prefix: $prefix"
echo " * System type: $host_vendor-$host_os"
echo " * Host CPU: $host_cpu"
echo " * C Compiler: $CC $CC_VERSION"
echo " * C Flags: $CFLAGS"
echo " * C++ Compiler: $CXX $CXX_VERSION"
echo " * C++ Flags: $CXXFLAGS"
echo " * CPP Flags: $CPPFLAGS"
echo " * LIBS: $LIBS"
echo " * LDFLAGS Flags: $LDFLAGS"
echo " * Assertions enabled: $ax_enable_assert"
echo " * Debug enabled: $ax_enable_debug"
echo " * Warnings as failure: $ac_cv_warnings_as_errors"
echo " * Building with hiredis $ac_enable_hiredis"
echo " * Building with libsqlite3 $WANT_SQLITE3"
echo " * Building with libdrizzle $ac_enable_libdrizzle"
echo " * Building with libmemcached $ax_enable_libmemcached"
echo " * Building with libpq $ac_cv_libpq"
echo " * Building with tokyocabinet $ac_enable_libtokyocabinet"
echo " * Building with libmysql $found_mysql"
echo " * SSL enabled: $enable_ssl"
echo " * wolfssl found: $have_wolfssl"
echo " * openssl found: $have_openssl"
echo " * make -j: $enable_jobserver"
echo " * VCS checkout: $ac_cv_vcs_checkout"
echo " * sphinx-build: $SPHINXBUILD"
echo ""
echo "---"
case "$host_os" in
*freebsd*)
echo "*****"
echo "*"
echo "* NOTE: You are on FreeBSD. BSD 'make' will not work."
echo "*"
echo "* use 'gmake' To build gearmand"
echo "*"
echo "*****"
;;
esac