-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathconfigure.ac
More file actions
306 lines (270 loc) · 9.06 KB
/
configure.ac
File metadata and controls
306 lines (270 loc) · 9.06 KB
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
# Pound - the reverse-proxy load-balancer -*- autoconf -*-
# Copyright (C) 2002-2010 Apsis GmbH
# Copyright (C) 2018-2026 Sergey Poznyakoff
#
# Pound is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Pound is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pound. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.71])
AC_INIT([pound],[4.22.90],[gray@gnu.org],
[pound],[https://github.com/graygnuorg/pound])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/pound.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.16.5 gnu tar-ustar subdir-objects silent-rules])
AC_CANONICAL_HOST
AM_SILENT_RULES([yes])
# Checks for programs.
AC_PROG_CC
LT_INIT
# Checks for libraries.
AX_PTHREAD([CC="$PTHREAD_CC"],
[AC_MSG_ERROR([No suitable pthread library found])])
AC_CHECK_LIB(crypt, crypt)
# Checks for headers
AC_CHECK_HEADERS([getopt.h pthread.h crypt.h openssl/ssl.h openssl/engine.h])
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_UNSIGNED_LONG_LONG_INT
AC_TYPE_LONG_LONG_INT
# Check whether they want dynamic backends
AC_ARG_ENABLE([dynamic-backends],
[AS_HELP_STRING([--enable-dynamic-backends],
[enable dynamic backend support (default)])],
[status_dynamic_backends=${enableval}],
[status_dynamic_backends=probe])
if test $status_dynamic_backends != no; then
# Check for adns library
AC_CHECK_HEADERS([adns.h])
AC_CHECK_LIB([adns], [adns_init])
if test "$ac_cv_lib_adns_adns_init$ac_cv_header_adns_h" = yesyes; then
AC_DEFINE([ENABLE_DYNAMIC_BACKENDS], [1],
[Define if dynamic backends are supported])
status_dynamic_backends=yes
elif test $status_dynamic_backends = yes; then
AC_MSG_FAILURE([required library adns not found; install it or use --disable-resolver to disable])
else
status_dynamic_backends=no
fi
fi
AM_CONDITIONAL([COND_DYNAMIC_BACKENDS], [test $status_dynamic_backends = yes])
AC_ARG_ENABLE([dns-tests],
[AS_HELP_STRING([--enable-dns-tests],
[enable DNS-based dynamic backend tests])],
[if test "${status_dynamic_backends}${enableval}" = yesyes; then
status_dns_tests=yes
else
status_dns_tests=no
fi
],
[status_dns_tests=no])
if test $status_dns_tests = yes; then
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <sys/syscall.h>
int x[] = { SYS_connect, SYS_sendto, SYS_recvfrom };
]],
[return 0;])],
[],
[status_dns_tests=no])
fi
AM_CONDITIONAL([COND_BUILD_FAKEDNS], [test "$status_dns_tests" = yes])
AC_SUBST(SSL_CPPFLAGS)
AC_SUBST(SSL_LDFLAGS)
AC_ARG_WITH([ssl],
[AS_HELP_STRING([--with-ssl=directory],[location of OpenSSL package])],
[SSL_CPPFLAGS="-I${withval}/include"
SSL_LDFLAGS="-L${withval}/lib ${LDFLAGS}"
C_SSL="${withval}"],
[C_SSL=""])
# Check for structures
AC_CHECK_MEMBERS([struct stat.st_mtim],[],[],
[#include <sys/types.h>
#include <sys/stat.h>
])
AC_ARG_WITH([maxbuf],
[AS_HELP_STRING([--with-maxbuf=nnn],[Value of the MAXBUF parameter (default: 4096)])],
[MAXBUF=${withval}],
[MAXBUF=4096])
AC_DEFINE_UNQUOTED([MAXBUF],[$MAXBUF],
[Max. buffer size])
AC_ARG_ENABLE([tcmalloc],
[AS_HELP_STRING([--enable-tcmalloc],[enable or disable using the tcmalloc library (default: enabled if available)])],
[status_tcmalloc=${enableval}],
[status_tcmalloc=probe])
AC_ARG_ENABLE([hoard],
[AS_HELP_STRING([--enable-hoard],[enable or disable using the hoard library (default: enabled if available and tcmalloc NOT available)])],
[status_hoard=${enableval}],
[status_hoard=probe])
memory_allocator=libc
if test $status_tcmalloc != no; then
AC_CHECK_LIB([tcmalloc],[malloc])
if test $ac_cv_lib_tcmalloc_malloc = yes; then
memory_allocator=tcmalloc
fi
elif test $status_hoard != no; then
AC_CHECK_LIB([hoard],[malloc])
if test $ac_cv_lib_hoard_malloc = yes; then
memory_allocator=hoard
fi
fi
AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([nsl], [gethostbyaddr])
AC_CHECK_LIB([socket], [socket])
AC_CHECK_LIB([resolv], [hstrerror])
AC_CHECK_LIB([crypto],[BIO_new],[],
[AC_MSG_FAILURE([Missing OpenSSL (-lcrypto) - aborted],[1])])
AC_CHECK_LIB([ssl],[SSL_CTX_new],[],
[AC_MSG_FAILURE([Missing OpenSSL (-lssl) - aborted])])
PND_PCRE
AM_CONDITIONAL([COND_PCRE], [test $status_pcre = 1])
AM_CONDITIONAL([COND_PCRE2], [test $status_pcre = 2])
m4_define([POUND_LUA_REQ],5.3.5)
unset version_lua
AC_ARG_ENABLE([lua],
[AS_HELP_STRING([--enable-lua],
[enable Lua extensions])],
[case $enableval in
yes|no) status_lua=$enableval;;
*) version_lua=[$(echo $enableval | sed -n '/^[0-9][0-9]*\(\.[0-9][0-9]*\)*$/p')]
if test -n "$version_lua"; then
AS_VERSION_COMPARE($version_lua, POUND_LUA_REQ,
[AC_MSG_ERROR([requested Lua version is less than the minimum supported (POUND_LUA_REQ)])])
status_lua=probe
else
AC_MSG_ERROR([invalid version string: $enableval])
fi
;;
esac],
[status_lua=probe])
AH_TEMPLATE([ENABLE_LUA],[Define if Lua extension language is supported])
if test $status_lua != no; then
AX_LUA(${version_lua:-POUND_LUA_REQ}, $version_lua,
[status_lua=yes
AC_DEFINE([ENABLE_LUA], [1])],
[status_lua=no])
fi
AM_CONDITIONAL([COND_LUA], [test $status_lua = yes])
# Determine how to mass-close fds equal to or greater than the given one.
AX_CLOSEFROM
# **********************
# Event monitoring
# **********************
AC_CHECK_HEADERS([sys/inotify.h sys/event.h])
AC_CHECK_FUNCS([inotify_init kqueue])
if test "$ac_cv_header_sys_inotify_h/$ac_cv_func_inotify_init" = yes/yes; then
status_fsevmon=inotify
elif test "$ac_cv_header_sys_event_h/$ac_cv_func_kqueue" = yes/yes; then
# The code in src/watcher/kqueue.c relies on kqueue being able to report
# that the file was modified and closed, either directly (via the
# NOTE_CLOSE_WRITE event) or indirectly (looking for NOTE_CLOSE and
# NOTE_WRITE). This code is disabled if neither NOTE_CLOSE nor
# NOTE_CLOSE_WRITE is defined (notable cases: Darwin and NetBSD).
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
#include <sys/event.h>
],
[
#if defined(NOTE_CLOSE) || defined(NOTE_CLOSE_WRITE)
return 0;
#else
# error "Either NOTE_CLOSE or NOTE_CLOSE_WRITE must be defined"
#endif
])],
[status_fsevmon=kqueue],
[status_fsevmon=none])
else
status_fsevmon=none
fi
AC_ARG_WITH(fsevmon,
[AS_HELP_STRING([--without-fsevmon],
[disable filesystem event monitoring API])],
[case $withval in
inotify)
if test $status_fsevmon != inotify; then
AC_MSG_ERROR([inotify is requested, but not available])
fi
;;
kqueue)
if test $status_fsevmon != kqueue; then
AC_MSG_ERROR([kqueue is requested, but not available])
fi
;;
yes) ;;
no|periodic) status_fsevmon=none
;;
*) AC_MSG_ERROR([unsupported value for --with-fsevmon: $witval])
esac])
AC_ARG_WITH(inotify,[],
[case $withval$status_fsevmon in
noinotify)
status_fsevmon=none
;;
no*|yesinotify)
;;
*)
AC_MSG_ERROR([--with-inotify doesn't take arguments])
esac])
AM_CONDITIONAL([COND_INOTIFY],[test $status_fsevmon = inotify])
AM_CONDITIONAL([COND_KQUEUE],[test $status_fsevmon = kqueue])
AC_MSG_CHECKING([if building from git clone])
if test -d .git; then
build_from_git=yes
else
build_from_git=no
fi
AC_MSG_RESULT([$build_from_git])
AM_CONDITIONAL([FROM_GIT],[test "$build_from_git" = yes])
# Documentation
AC_ARG_VAR([MAKEINFO_INIT_FILE],
[Initialization file for generation of the html manual])
AM_CONDITIONAL([COND_MAKEINFO_INIT_FILE],[test -n "$MAKEINFO_INIT_FILE"])
AC_CONFIG_COMMANDS([status],[
cat <<EOF
*******************************************************************
Pound configuration parameters:
Buffer size ................................... $bufsize
Regular expressions ........................... POSIX$status_pcre
Memory allocator .............................. $memory_allocator
Dynamic backends .............................. $status_dynamic_backends
Test dynamic backends ......................... $status_dns_tests
Filesystem event monitoring ................... $status_fsevmon
Lua support ................................... $status_lua
*******************************************************************
EOF
],
[bufsize=$MAXBUF
if test $status_pcre != no; then
status_pcre=", PCRE$status_pcre"
else
status_pcre=""
fi
memory_allocator=$memory_allocator
if test "$early_pthread_cancel_probe" = 1; then
status_pthread_cancel_probe=yes
else
status_pthread_cancel_probe=no
fi
status_dynamic_backends=$status_dynamic_backends
status_dns_tests=$status_dns_tests
status_lua=$status_lua
status_fsevmon=$status_fsevmon
])
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
AM_MISSING_PROG([AUTOM4TE], [autom4te])
AC_CONFIG_FILES([Makefile
src/Makefile
doc/Makefile])
AC_OUTPUT