]>
Commit | Line | Data |
---|---|---|
77b1029d | 1 | ## Copyright (C) 1996-2020 The Squid Software Foundation and contributors |
5d2e6f19 AJ |
2 | ## |
3 | ## Squid software is distributed under GPLv2+ license and includes | |
4 | ## contributions from numerous individuals and organizations. | |
5 | ## Please see the COPYING and CONTRIBUTORS files for details. | |
6 | ## | |
7 | ||
a8b7dd82 | 8 | AC_INIT([Squid Web Proxy],[6.0.0-VCS],[http://bugs.squid-cache.org/],[squid]) |
d966027f | 9 | AC_PREREQ(2.61) |
62979ab1 | 10 | AC_CONFIG_HEADERS([include/autoconf.h]) |
71b12d7c | 11 | AC_CONFIG_AUX_DIR(cfgaux) |
8d9ce05e | 12 | AC_CONFIG_SRCDIR([src/main.cc]) |
3dc6f003 | 13 | AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects dist-xz]) |
c2720d44 | 14 | AC_REVISION($Revision$)dnl |
a2794549 | 15 | AC_PREFIX_DEFAULT(/usr/local/squid) |
246d7ffc | 16 | AM_MAINTAINER_MODE |
a2794549 | 17 | |
5d2e6f19 | 18 | m4_include([acinclude/ax_with_prog.m4]) |
4ecf021b | 19 | m4_include([acinclude/init.m4]) |
fa522425 | 20 | m4_include([acinclude/squid-util.m4]) |
6a56798f | 21 | m4_include([acinclude/compiler-flags.m4]) |
0abb39dd | 22 | m4_include([acinclude/os-deps.m4]) |
c8093f05 | 23 | m4_include([acinclude/krb5.m4]) |
3c586e38 | 24 | m4_include([acinclude/pam.m4]) |
2b448046 | 25 | m4_include([acinclude/pkg.m4]) |
acd207af | 26 | m4_include([acinclude/tdb.m4]) |
91983da0 | 27 | m4_include([acinclude/lib-checks.m4]) |
ea1cf567 | 28 | m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4]) |
a203dec7 | 29 | m4_include([acinclude/ax_cxx_0x_types.m4]) |
6a56798f | 30 | |
63e02610 | 31 | PRESET_CFLAGS="$CFLAGS" |
a203dec7 | 32 | PRESET_CXXFLAGS="$CXXFLAGS" |
63e02610 | 33 | PRESET_LDFLAGS="$LDFLAGS" |
34 | ||
a2794549 | 35 | dnl Set default LDFLAGS |
fcabe077 | 36 | if test "x$LDFLAGS" = "x" ; then |
73862432 | 37 | LDFLAGS="-g" |
a2794549 | 38 | fi |
39 | ||
aff48cc8 | 40 | # Check for GNU cc |
a2794549 | 41 | AC_PROG_CC |
e6c4cdd6 | 42 | AM_PROG_CC_C_O |
29b8d8d6 | 43 | AC_PROG_CXX |
62979ab1 | 44 | AC_LANG([C++]) |
88d50a22 | 45 | AC_CANONICAL_HOST |
3e7b6055 | 46 | |
c8640c9a AJ |
47 | # Clang 3.2 on some CPUs requires -march-native to detect correctly. |
48 | # GCC 4.3+ can also produce faster executables when its used. | |
49 | # But building inside a virtual machine environment has been found to | |
50 | # cause random Illegal Instruction errors due to mis-detection of CPU. | |
51 | AC_ARG_ENABLE(arch-native, | |
52 | AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific | |
53 | optimizations with the -march=native parameter. | |
54 | This flag disables the optimization. The default is to | |
55 | auto-detect compiler support and use where available.]), [ | |
56 | SQUID_YESNO([$enableval], | |
57 | [Unrecognized argument to --disable-arch-native: $enableval]) | |
58 | ]) | |
d8a4ba7c | 59 | AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}]) |
c8640c9a AJ |
60 | if test "x${enable_arch_native}" != "xno"; then |
61 | SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native]) | |
62 | fi | |
e9d3951b AJ |
63 | |
64 | # might be cross-compiling. | |
b2f0a375 AJ |
65 | # NP: BUILDCXXFLAGS defined at the end of configure after CXXFLAGS fully known. |
66 | AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen]) | |
67 | if test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"; then | |
68 | AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Uses BUILDCXX instead.]) | |
69 | BUILDCXX="$HOSTCXX" | |
70 | fi | |
71 | if test "x$BUILDCXX" = "x"; then | |
72 | BUILDCXX="$CXX" | |
e9d3951b AJ |
73 | if test "x$squid_cv_check_marchnative" = "xyes"; then |
74 | CXXFLAGS="$CXXFLAGS -march=native" | |
75 | fi | |
76 | fi | |
b2f0a375 | 77 | AC_SUBST(BUILDCXX) |
de051d9d | 78 | |
40503c27 | 79 | AC_MSG_CHECKING([simplified host os]) |
78a60bca | 80 | simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'` |
035a321e | 81 | squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"` |
6ca34f6f HN |
82 | if test -n "$squid_host_os_version"; then |
83 | squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`" | |
84 | else | |
85 | squid_host_os="$simple_host_os" | |
86 | fi | |
40503c27 FC |
87 | AC_MSG_RESULT($squid_host_os (version $squid_host_os_version)) |
88 | # on windows squid_host_os is either mingw or cygwin, version is 32 | |
89 | ||
b2b60232 FC |
90 | # this needs to be before any test is run, to have more standard |
91 | # functions available on some Unix sysems (e.g. Solaris) | |
92 | if test "x$squid_host_os" = "solaris" -a "x$GCC" != "x" ; then | |
93 | AC_USE_SYSTEM_EXTENSIONS | |
94 | fi | |
95 | ||
79987b1a AJ |
96 | # If the user did not specify a C++ version. |
97 | user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "\-std="` | |
98 | if test "x$user_cxx" = "x"; then | |
99 | # Check for C++11 compiler support | |
100 | AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) | |
101 | fi | |
a203dec7 | 102 | |
aff48cc8 | 103 | # test for programs |
aff48cc8 FC |
104 | AC_PROG_RANLIB |
105 | AC_PROG_CPP | |
106 | AC_PROG_INSTALL | |
107 | AC_PROG_LN_S | |
108 | AC_PROG_EGREP | |
109 | ||
110 | AC_PATH_PROG(SH, sh, /bin/sh) | |
111 | AC_PATH_PROG(FALSE, false, /usr/bin/false) | |
112 | AC_PATH_PROG(TRUE, true, /usr/bin/true) | |
113 | AC_PATH_PROG(MV, mv, $FALSE) | |
114 | AC_PATH_PROG(MKDIR, mkdir, $FALSE) | |
115 | AC_PATH_PROG(LN, ln, cp) | |
116 | AC_PATH_PROG(CHMOD, chmod, $FALSE) | |
6d1c1ab1 | 117 | AC_PATH_PROG(TR, tr, $FALSE) |
aff48cc8 FC |
118 | AC_PATH_PROG(RM, rm, $FALSE) |
119 | dnl Libtool 2.2.6 requires: rm -f | |
120 | RM="$RM -f" | |
121 | ||
d93bf055 AJ |
122 | PKG_PROG_PKG_CONFIG |
123 | ||
aff48cc8 | 124 | AC_PATH_PROG(PERL, perl, none) |
fcabe077 | 125 | if test "x$ac_cv_path_PERL" = "xnone"; then |
aff48cc8 FC |
126 | AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ]) |
127 | fi | |
07f370ee | 128 | AC_PATH_PROG(POD2MAN, pod2man, $FALSE) |
33d1abfe | 129 | AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE") |
aff48cc8 | 130 | |
52c549d9 AJ |
131 | dnl set $(AR) if not provided by the build environment |
132 | if test "x$AR" = "x"; then | |
133 | AC_PATH_PROG(AR, ar, $FALSE) | |
134 | fi | |
aff48cc8 | 135 | AR_R="$AR r" |
aff48cc8 FC |
136 | AC_SUBST(AR_R) |
137 | ||
86b8d400 AJ |
138 | AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE) |
139 | AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE") | |
140 | ||
cda5e747 AJ |
141 | # pre-define DEFAULT_PREFIX, some modules need it. |
142 | if test "${prefix}" = "NONE" ; then | |
143 | squid_prefix=$ac_default_prefix | |
144 | else | |
145 | squid_prefix=$prefix | |
146 | fi | |
147 | AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix]) | |
148 | ||
0b45d157 FC |
149 | AC_ARG_ENABLE(strict-error-checking, |
150 | AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled | |
2d65bb9a | 151 | with all possible static compiler error-checks enabled. |
cdb352bb FC |
152 | This flag disables the behavior]), [ |
153 | SQUID_YESNO([$enableval], | |
154 | [Unrecognized argument to --disable-strict-error-checking: $enableval]) | |
0b45d157 | 155 | ]) |
cdb352bb | 156 | AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}]) |
d1f95b42 | 157 | |
3e7b6055 AR |
158 | AC_MSG_CHECKING(whether to use loadable modules) |
159 | AC_ARG_ENABLE(loadable-modules, | |
73862432 FC |
160 | AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [ |
161 | SQUID_YESNO([$enableval], | |
162 | [Unrecognized argument to --disable-loadable-modules: $enableval]) | |
163 | ]) | |
cb5569cd | 164 | AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_loadable_modules:=yes}" = "xyes") |
73862432 | 165 | AC_MSG_RESULT([$enable_loadable_modules]) |
3e7b6055 | 166 | |
73862432 | 167 | if test "x$enable_loadable_modules" = "xyes"; |
3e7b6055 | 168 | then |
73862432 FC |
169 | AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules]) |
170 | AC_ENABLE_SHARED | |
3e7b6055 | 171 | else |
73862432 | 172 | AC_DISABLE_SHARED |
3e7b6055 AR |
173 | fi |
174 | ||
4313559d | 175 | # LT_INIT requires libtool v2, might as well state it loud |
2663a9c8 | 176 | LT_PREREQ([2.2]) |
220d7675 | 177 | LT_INIT([dlopen],[disable-shared]) |
2148ef58 AJ |
178 | if ! test "${ac_top_build_prefix}" = ""; |
179 | then | |
180 | # LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined | |
181 | # But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile | |
182 | # This fixes Linux LTDLv3-v7, and BSD LTDL v2.2 | |
183 | top_build_prefix=${ac_top_build_prefix} | |
184 | AC_SUBST(top_build_prefix) | |
185 | fi | |
bd9303f5 | 186 | LTDL_INIT |
081863f3 | 187 | |
d9a41469 | 188 | dnl LibTool environment is now prepared for setup. Check that it is usable and initialize. |
081863f3 | 189 | LT_LIB_DLLOAD |
3e7b6055 AR |
190 | |
191 | # Do we need these unconditionally for "make distcheck" to work? | |
192 | AC_SUBST(INCLTDL) | |
193 | AC_SUBST(LIBLTDL) | |
194 | ||
73862432 | 195 | if test "x$enable_loadable_modules" = "xyes"; |
3e7b6055 | 196 | then |
73862432 FC |
197 | # Why is this needed? Should not LT_INIT (or LT_LIB_DLLOAD) from libtool do that? |
198 | LIBADD_DL=${lt_cv_dlopen_libs} | |
199 | AC_SUBST([LIBADD_DL]) | |
3e7b6055 AR |
200 | fi |
201 | ||
07f370ee | 202 | SQUID_CC_GUESS_VARIANT |
fa6307ae | 203 | SQUID_CC_GUESS_OPTIONS |
f9d138eb | 204 | |
be0c7ff0 FC |
205 | dnl find out the exe extension for this platform. |
206 | dnl If it is not empty, use it for CGI as well. | |
a2794549 | 207 | AC_EXEEXT |
208 | AC_OBJEXT | |
209 | ||
fcabe077 FC |
210 | if test "x$EXEEXT" = "x" ; then |
211 | CGIEXT=".cgi" | |
a2794549 | 212 | else |
fcabe077 FC |
213 | # automake automatically adds .exe when installing binaries |
214 | CGIEXT="" | |
a2794549 | 215 | fi |
7aeb8001 | 216 | AC_SUBST(CGIEXT) |
a2794549 | 217 | |
a396d1f8 | 218 | AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"]) |
daf2ddfa | 219 | AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"]) |
fcabe077 | 220 | |
b5467222 CT |
221 | case "$squid_host_os" in |
222 | mingw) | |
fcabe077 FC |
223 | AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none) |
224 | CFLAGS="$CFLAGS -mthreads" | |
d66b42da | 225 | CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++" |
fcabe077 FC |
226 | if test "x$ac_cv_path_WIN32_PSAPI" = "xnone"; then |
227 | AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform]) | |
228 | AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.]) | |
229 | else | |
230 | AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems]) | |
231 | LIBS="$LIBS -lpsapi" | |
232 | fi | |
233 | MINGW_LIBS="-lmingwex" | |
234 | AC_SUBST(MINGW_LIBS) | |
b5467222 CT |
235 | ;; |
236 | freebsd) | |
237 | # FreeBSD places local libraries and packages in /usr/local | |
238 | CFLAGS="$CFLAGS -I/usr/local/include" | |
239 | CXXFLAGS="$CXXFLAGS -I/usr/local/include" | |
240 | LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib" | |
241 | ;; | |
242 | *) | |
243 | ;; | |
244 | esac | |
4b26fae9 | 245 | |
f4aaf39c | 246 | dnl Substitutions |
6a9f6389 | 247 | AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure]) |
30a4f2a8 | 248 | |
8075a4da FC |
249 | AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", |
250 | [configure command line used to configure Squid]) | |
090089c4 | 251 | |
5483d916 | 252 | CACHE_EFFECTIVE_USER="nobody" |
253 | AC_ARG_WITH(default-user, | |
62979ab1 | 254 | AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]), |
5483d916 | 255 | [ CACHE_EFFECTIVE_USER="$withval" ] |
256 | ) | |
257 | AC_SUBST(CACHE_EFFECTIVE_USER) | |
258 | ||
c8d2dc9b AJ |
259 | DEFAULT_LOG_DIR="$localstatedir/logs" |
260 | AC_ARG_WITH(logdir, | |
73862432 | 261 | AS_HELP_STRING([--with-logdir=PATH], |
cdb352bb | 262 | [Default location for squid logs. default: PREFIX/var/logs]), [ |
73862432 FC |
263 | case $withval in |
264 | yes|no) | |
265 | AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH ) | |
266 | ;; | |
267 | *) | |
268 | DEFAULT_LOG_DIR="$withval" | |
269 | ;; | |
270 | esac | |
c8d2dc9b AJ |
271 | ] |
272 | ) | |
273 | AC_SUBST(DEFAULT_LOG_DIR) | |
274 | ||
2f36643c | 275 | DEFAULT_PID_FILE="$localstatedir/run/@SERVICE_NAME@.pid" |
a7f6af35 | 276 | AC_ARG_WITH(pidfile, |
e0eb5853 | 277 | AS_HELP_STRING([--with-pidfile=PATH], |
cdb352bb | 278 | [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]), [ |
73862432 FC |
279 | case $withval in |
280 | yes|no) | |
281 | AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH ) | |
282 | ;; | |
283 | *) | |
32f07882 | 284 | DEFAULT_PID_FILE="$withval" |
73862432 FC |
285 | ;; |
286 | esac | |
e0eb5853 | 287 | ]) |
32f07882 | 288 | AC_SUBST(DEFAULT_PID_FILE) |
a7f6af35 | 289 | |
bf52b026 AJ |
290 | DEFAULT_SWAP_DIR="$localstatedir/cache/squid" |
291 | AC_ARG_WITH(swapdir, | |
292 | AS_HELP_STRING([--with-swapdir=PATH], | |
293 | [Default location for squid cache directories. Default: PREFIX/var/cache/squid]), [ | |
294 | case $withval in | |
295 | yes|no) | |
296 | AC_MSG_ERROR( --with-swapdir requires a directory PATH. --with-swapdir=PATH ) | |
297 | ;; | |
298 | *) | |
299 | DEFAULT_SWAP_DIR="$withval" | |
300 | ;; | |
301 | esac | |
302 | ]) | |
303 | AC_SUBST(DEFAULT_SWAP_DIR) | |
304 | ||
30a4f2a8 | 305 | dnl Set Default CFLAGS |
fcabe077 | 306 | if test "x$PRESET_CFLAGS" = "x"; then |
f70e69c6 | 307 | if test "$squid_cv_compiler" = "gcc"; then |
fcabe077 FC |
308 | case "$host" in |
309 | *-sun-sunos*) | |
310 | # sunos has too many warnings for this to be useful | |
311 | # motorola too | |
312 | ;; | |
313 | *m88k*) | |
314 | # Motorola cc/ld does not like -02 but is ok on -O | |
315 | CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'` | |
316 | ;; | |
317 | *) | |
318 | CFLAGS="$squid_cv_cc_option_wall $CFLAGS" | |
319 | ;; | |
320 | esac | |
321 | else | |
322 | case "$host" in | |
323 | *mips-sgi-irix6.*) | |
324 | # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com> | |
325 | CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \ | |
326 | -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \ | |
327 | -Wl,-woff,85,-woff,84,-woff,134 \ | |
328 | -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS" | |
329 | CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \ | |
330 | -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \ | |
331 | -Wl,-woff,85,-woff,84,-woff,134 \ | |
332 | -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS" | |
333 | ;; | |
30a4f2a8 | 334 | *) |
fcabe077 FC |
335 | ;; |
336 | esac | |
337 | fi | |
30a4f2a8 | 338 | fi |
339 | ||
d2e3605e | 340 | dnl set squid required flags |
f70e69c6 | 341 | if test "$squid_cv_compiler" = "gcc"; then |
78a60bca AJ |
342 | case "$squid_host_os" in |
343 | mingw) | |
9f68fb10 | 344 | dnl Guido Serassio (serassio@squid-cache.org) 20070811 |
345 | dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with | |
0a13cc9d | 346 | dnl -Werror -Wmissing-prototypes -Wmissing-declarations |
9f68fb10 | 347 | dnl TODO: check if the problem will be present in any other newer MinGW release. |
cb35a124 | 348 | SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow" |
fcabe077 FC |
349 | ;; |
350 | *) | |
cb35a124 | 351 | SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow" |
fcabe077 FC |
352 | ;; |
353 | esac | |
777e8376 | 354 | SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual" |
d2e3605e | 355 | else |
fcabe077 FC |
356 | SQUID_CFLAGS= |
357 | SQUID_CXXFLAGS= | |
d2e3605e | 358 | fi |
07f370ee | 359 | |
05c9db69 | 360 | dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features |
629cb141 | 361 | SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]]) |
05c9db69 | 362 | |
cdb352bb | 363 | if test "x$enable_strict_error_checking" != "xno"; then |
fcabe077 | 364 | SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror" |
59a09b98 | 365 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror" |
07f370ee FC |
366 | fi |
367 | ||
0568bff2 | 368 | if test "x$ac_cv_require_wno_deprecated_register" = "xyes"; then |
369 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register" | |
370 | fi | |
371 | ||
e0eb5853 FC |
372 | # squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS |
373 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe" | |
374 | SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe" | |
2060fa9a | 375 | |
4fe75473 FC |
376 | # possibly include some build info tag into squid -v |
377 | SQUID_EMBED_BUILD_INFO | |
378 | ||
83079644 | 379 | AC_ARG_ENABLE(optimizations, |
ffa3bad9 | 380 | AS_HELP_STRING([--disable-optimizations], |
be0c7ff0 | 381 | [Do not compile Squid with compiler optimizations enabled. |
a2f6a96c FC |
382 | Optimization is good for production builds, but not |
383 | good for debugging. During development, use | |
384 | --disable-optimizations to reduce compilation times | |
10185a38 | 385 | and allow easier debugging.]), [ |
fcabe077 FC |
386 | if test "x$enableval" = "xno" ; then |
387 | AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)]) | |
d0441961 CG |
388 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`" |
389 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9g]]*//'`" | |
fcabe077 | 390 | fi |
83079644 | 391 | ]) |
392 | ||
fa80a8ef | 393 | AC_ARG_ENABLE(debug-cbdata, |
8075a4da FC |
394 | AS_HELP_STRING([--enable-debug-cbdata], |
395 | [Provide some debug information in cbdata]), [ | |
50af7161 FC |
396 | SQUID_YESNO([$enableval], |
397 | [unrecognized argument to --enable-debug-cbdata: $enableval]) | |
fa80a8ef | 398 | ]) |
9a0a18de | 399 | SQUID_DEFINE_BOOL(USE_CBDATA_DEBUG,${enable_debug_cbdata:=no}, |
50af7161 FC |
400 | [Enable support for cbdata debug information]) |
401 | AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata]) | |
402 | ||
fa80a8ef | 403 | |
c9267250 AJ |
404 | dnl Nasty hack to get autoconf 2.64 on Linux to run. |
405 | dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64 | |
aff0e8fe | 406 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:]) |
c9267250 | 407 | |
0d00c98b | 408 | AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics]) |
d9180414 | 409 | AC_ARG_ENABLE(xmalloc-statistics, |
8075a4da FC |
410 | AS_HELP_STRING([--enable-xmalloc-statistics], |
411 | [Show malloc statistics in status page]), [ | |
4d1d2477 FC |
412 | SQUID_YESNO([$enableval], |
413 | [unrecognized argument to --enable-xmalloc-statistics: $enableval]) | |
e5f4e1b0 | 414 | ]) |
4d1d2477 FC |
415 | SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no}, |
416 | [Show malloc statistics in status page]) | |
417 | AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics]) | |
e5f4e1b0 | 418 | |
8075a4da | 419 | squid_opt_aufs_threads="" |
f85c88f3 | 420 | AC_ARG_WITH(aufs-threads, |
8075a4da FC |
421 | AS_HELP_STRING([--with-aufs-threads=N_THREADS], |
422 | [Tune the number of worker threads for the aufs object store.]), [ | |
423 | case $withval in | |
a3310b77 | 424 | [[0-9]]*) |
50fbcbd6 | 425 | squid_opt_aufs_threads=$withval |
a3310b77 | 426 | ;; |
427 | *) | |
8b0d8e31 | 428 | AC_MSG_ERROR(--with-aufs-threads expects a numeric argument) |
a3310b77 | 429 | ;; |
430 | esac | |
431 | ]) | |
fcabe077 | 432 | if test "x$squid_opt_aufs_threads" != "x"; then |
50fbcbd6 FC |
433 | AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads]) |
434 | AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads, | |
8075a4da | 435 | [Defines how many threads aufs uses for I/O]) |
cd748f27 | 436 | fi |
437 | ||
50fbcbd6 | 438 | AC_ARG_WITH(dl, AS_HELP_STRING([--with-dl],[Use dynamic linking])) |
fcabe077 | 439 | if test "x$with_dl" = "xyes"; then |
eed82608 | 440 | AC_MSG_NOTICE([With dl]) |
8154dd82 | 441 | fi |
f85c88f3 | 442 | |
4b0f8912 | 443 | ## check for atomics library before anything that might need it |
16530552 FC |
444 | # AC_SEARCH_LIBS pollutes LIBS |
445 | SQUID_STATE_SAVE(LIBATOMIC) | |
446 | AC_SEARCH_LIBS([__atomic_load_8],[atomic],[ | |
447 | test "$ac_res" = "none required" || ATOMICLIB=$ac_res],[]) | |
448 | SQUID_STATE_ROLLBACK(LIBATOMIC) | |
4b0f8912 AJ |
449 | AC_SUBST(ATOMICLIB) |
450 | ||
c975f532 DK |
451 | AC_SEARCH_LIBS([shm_open], [rt]) |
452 | if test "x$ac_cv_search_shm_open" != "xno" ; then | |
453 | AC_DEFINE(HAVE_SHM,1,[Support shared memory features]) | |
454 | fi | |
455 | ||
d235bc84 | 456 | AC_MSG_CHECKING([for DiskIO modules to be enabled]) |
50fbcbd6 | 457 | squid_disk_module_candidates="" |
8075a4da | 458 | squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules) |
2513178d | 459 | AC_ARG_ENABLE(disk-io, |
50fbcbd6 FC |
460 | AS_HELP_STRING([--enable-disk-io="list of modules"], |
461 | [Build support for the list of disk I/O modules. | |
462 | Set without a value or omitted, all available modules will be built. | |
463 | See src/DiskIO for a list of available modules, or | |
464 | Programmers Guide section on DiskIO | |
8075a4da FC |
465 | for details on how to build your custom disk module]), [ |
466 | case $enableval in | |
2513178d | 467 | yes) |
fe9ddf62 | 468 | ${TRUE} |
50fbcbd6 | 469 | #do nothing, "auto" is ok |
507ca601 | 470 | ;; |
2513178d | 471 | no) |
8075a4da | 472 | squid_opt_enable_diskio="no" |
507ca601 | 473 | ;; |
2513178d | 474 | *) |
8075a4da | 475 | squid_opt_enable_diskio="yes" |
47d80734 | 476 | squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` " |
d235bc84 | 477 | SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates]) |
507ca601 | 478 | ;; |
2513178d | 479 | esac |
50fbcbd6 FC |
480 | ]) |
481 | ||
d235bc84 | 482 | # if requested to autodetect, find out what we have |
fcabe077 | 483 | if test "x$squid_opt_enable_diskio" = "xauto"; then |
8075a4da | 484 | squid_opt_enable_diskio="yes" |
50fbcbd6 | 485 | SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates]) |
c975f532 DK |
486 | if test "x$ac_cv_search_shm_open" = "xno" ; then |
487 | # disable IpcIo | |
488 | squid_disk_module_candidates=`echo $squid_disk_module_candidates|sed 's/IpcIo//'` | |
489 | fi | |
50fbcbd6 | 490 | fi |
d235bc84 | 491 | |
47d80734 | 492 | AC_MSG_RESULT([${squid_disk_module_candidates:-none}]) |
dc299f29 | 493 | SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates]) |
0f658b5b | 494 | SQUID_DEFINE_BOOL(USE_DISKIO,$squid_opt_enable_diskio, |
50fbcbd6 | 495 | [DiskIO modules are expected to be available.]) |
2513178d | 496 | |
dc299f29 | 497 | |
40503c27 | 498 | |
2513178d | 499 | dnl Some autoconf.h defines we might enable later... |
0b163dbb FC |
500 | AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads])) |
501 | AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect])) | |
daf2ddfa | 502 | ENABLE_WIN32_AIOPS=0 |
ffa3bad9 FC |
503 | squid_opt_use_aio= |
504 | squid_opt_use_diskthreads= | |
46577dd1 | 505 | AIOLIB= |
2513178d AJ |
506 | |
507 | dnl Setup the module paths etc. | |
2513178d AJ |
508 | DISK_LIBS= |
509 | DISK_MODULES= | |
d9691f09 AJ |
510 | AH_TEMPLATE(HAVE_DISKIO_MODULE_AIO, [Whether POSIX AIO Disk I/O module is built]) |
511 | AH_TEMPLATE(HAVE_DISKIO_MODULE_BLOCKING, [Whether Blocking Disk I/O module is built]) | |
512 | AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKDAEMON, [Whether DiskDaemon Disk I/O module is built]) | |
23ee12fb | 513 | AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKTHREADS, [Whether DiskThreads Disk I/O module is built]) |
d9691f09 AJ |
514 | AH_TEMPLATE(HAVE_DISKIO_MODULE_IPCIO, [Whether IpcIo Disk I/O module is built]) |
515 | AH_TEMPLATE(HAVE_DISKIO_MODULE_MMAPPED, [Whether Mmapped Disk I/O module is built]) | |
50fbcbd6 | 516 | for module in $squid_disk_module_candidates none; do |
d235bc84 | 517 | # maybe not needed |
fcabe077 | 518 | if test "x$module" = "xnone"; then |
507ca601 | 519 | continue |
2513178d | 520 | fi |
fcabe077 | 521 | if ! test -d "$srcdir/src/DiskIO/$module"; then |
2513178d AJ |
522 | AC_MSG_ERROR(disk-io $module does not exist) |
523 | fi | |
524 | case "$module" in | |
d9691f09 AJ |
525 | |
526 | AIO) | |
527 | dnl Check for POSIX AIO availability | |
528 | squid_opt_use_aio="yes" | |
529 | AIOLIB= | |
530 | if test "x$with_aio" != "xno"; then | |
531 | have_aio_header=no | |
532 | AC_CHECK_HEADERS(aio.h,[have_aio_header=yes]) | |
533 | dnl On some systems POSIX AIO functions are in librt | |
534 | dnl On some systems POSIX AIO functions are in libaio | |
535 | AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[])) | |
536 | dnl Enable AIO if the library and headers are found | |
537 | if test "x$AIOLIB" != "x" && test "x$have_aio_header" = "xyes"; then | |
538 | AC_MSG_NOTICE([Native POSIX AIO support detected.]) | |
539 | squid_opt_use_aio="yes" | |
540 | else | |
541 | dnl Windows does things differently. We provide wrappers. | |
542 | dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO | |
543 | case "$squid_host_os" in | |
544 | mingw) | |
545 | squid_opt_use_aio="yes" | |
546 | AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.]) | |
547 | ;; | |
548 | *) | |
549 | AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.]) | |
550 | squid_opt_use_aio="no" | |
551 | ;; | |
552 | esac | |
553 | fi | |
554 | else | |
555 | AC_MSG_NOTICE([POSIX AIO support manually disabled.]) | |
556 | squid_opt_use_aio="no" | |
557 | fi | |
558 | dnl Use the POSIX AIO pieces if we actually need them. | |
559 | if test "x$squid_opt_use_aio" = "xyes" ; then | |
560 | DISK_MODULES="$DISK_MODULES AIO" | |
d9691f09 AJ |
561 | AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built]) |
562 | case "$squid_host_os" in | |
563 | mingw) | |
564 | ENABLE_WIN32_AIO=1 | |
565 | AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support]) | |
566 | ;; | |
567 | *) | |
568 | AC_MSG_NOTICE([Enabling AIO DiskIO module]) | |
569 | ;; | |
570 | esac | |
571 | else | |
572 | AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.]) | |
fedd516f | 573 | squid_disk_module_candidates_AIO=no |
d9691f09 AJ |
574 | fi |
575 | ;; | |
576 | ||
577 | Blocking) | |
578 | AC_MSG_NOTICE([Enabling Blocking DiskIO module]) | |
579 | DISK_MODULES="$DISK_MODULES Blocking" | |
d9691f09 AJ |
580 | AC_DEFINE([HAVE_DISKIO_MODULE_BLOCKING],1,[Blocking Disk I/O module is built]) |
581 | ;; | |
582 | ||
2513178d | 583 | DiskDaemon) |
1d3aafe4 FC |
584 | case "$squid_host_os" in |
585 | mingw) | |
586 | AC_MSG_NOTICE(["DiskDaemon not supported on MinGW"]) | |
fedd516f | 587 | squid_disk_module_candidates_DiskDaemon=no |
1d3aafe4 FC |
588 | ;; |
589 | *) | |
590 | AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module]) | |
1d3aafe4 | 591 | DISK_MODULES="$DISK_MODULES DiskDaemon" |
d9691f09 | 592 | AC_DEFINE([HAVE_DISKIO_MODULE_DISKDAEMON],1,[DiskDaemon Disk I/O module is built]) |
1d3aafe4 FC |
593 | ;; |
594 | esac | |
507ca601 | 595 | ;; |
d9691f09 | 596 | |
2513178d | 597 | DiskThreads) |
507ca601 FC |
598 | squid_opt_use_diskthreads="yes" |
599 | LIBPTHREADS= | |
600 | SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS]) | |
601 | if test "x$with_pthreads" != "xno"; then | |
602 | dnl TODO: this needs to be extended to handle more systems and better | |
603 | dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html | |
604 | dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html | |
605 | case "$squid_host_os" in | |
606 | mingw) | |
daf2ddfa | 607 | ENABLE_WIN32_AIOPS=1 |
507ca601 FC |
608 | AC_MSG_NOTICE([Windows threads support automatically enabled]) |
609 | ;; | |
610 | freebsd) | |
2a76c9c4 | 611 | if test `echo "$squid_host_os_version" | tr -d .` -lt 70 ; then |
a0f82085 AJ |
612 | AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later) |
613 | squid_opt_use_diskthreads="no" | |
614 | else | |
615 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" | |
616 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" | |
617 | if test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x" ; then | |
618 | LDFLAGS="$LDFLAGS -pthread" | |
619 | fi | |
507ca601 FC |
620 | fi |
621 | ;; | |
ec264296 SH |
622 | openbsd) |
623 | if test `echo "$squid_host_os_version" | tr -d .` -lt 52 ; then | |
624 | AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later) | |
625 | squid_opt_use_diskthreads="no" | |
626 | else | |
627 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" | |
628 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" | |
629 | LDFLAGS="$LDFLAGS -lpthread" | |
630 | fi | |
631 | ;; | |
507ca601 FC |
632 | solaris) |
633 | if test "x$GCC" = "xyes" ; then | |
634 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads" | |
635 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads" | |
636 | AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [ | |
637 | AC_MSG_NOTICE(pthread library required but cannot be found.) | |
638 | squid_opt_use_diskthreads="no" | |
639 | ]) | |
640 | else | |
641 | dnl test for -lpthread first. libc version is a stub apparently on Solaris. | |
642 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread" | |
643 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread" | |
644 | AC_SEARCH_LIBS([pthread_create],[pthread thread],[ | |
645 | LIBPTHREADS="" #in LIBS | |
646 | ],[ | |
647 | AC_MSG_NOTICE(pthread library required but cannot be found.) | |
648 | squid_opt_use_diskthreads="no" | |
649 | ]) | |
650 | fi | |
651 | ;; | |
652 | *) | |
653 | SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" | |
654 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" | |
655 | AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [ | |
40503c27 FC |
656 | AC_MSG_NOTICE(pthread library required but cannot be found.) |
657 | squid_opt_use_diskthreads="no" | |
658 | ]) | |
507ca601 FC |
659 | ;; |
660 | esac | |
661 | else | |
662 | AC_MSG_NOTICE([Native pthreads support manually disabled.]) | |
663 | squid_opt_use_diskthreads="no" | |
664 | fi | |
665 | if test "x$squid_opt_use_diskthreads" = "xyes" ; then | |
507ca601 | 666 | AC_MSG_NOTICE([Enabling DiskThreads DiskIO module]) |
507ca601 | 667 | DISK_MODULES="$DISK_MODULES DiskThreads" |
d9691f09 | 668 | AC_DEFINE([HAVE_DISKIO_MODULE_DISKTHREADS],1,[DiskThreads Disk I/O module is built]) |
507ca601 | 669 | else |
507ca601 | 670 | AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.]) |
0b163dbb | 671 | SQUID_STATE_ROLLBACK([diskthreads_state]) |
fedd516f | 672 | squid_disk_module_candidates_DiskThreads=no |
507ca601 FC |
673 | fi |
674 | ;; | |
2513178d | 675 | |
d9691f09 | 676 | IpcIo) |
d9691f09 | 677 | if test "x$ac_cv_search_shm_open" = "xno" ; then |
fedd516f AJ |
678 | AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support]) |
679 | squid_disk_module_candidates_IpcIo=no | |
680 | else | |
23ee12fb | 681 | AC_MSG_NOTICE([Enabling IpcIo DiskIO module]) |
fedd516f | 682 | DISK_MODULES="$DISK_MODULES IpcIo" |
fedd516f | 683 | AC_DEFINE([HAVE_DISKIO_MODULE_IPCIO],1,[IpcIo Disk I/O module is built]) |
507ca601 FC |
684 | fi |
685 | ;; | |
2513178d | 686 | |
e2851fe7 | 687 | Mmapped) |
e2cbb70e FC |
688 | dnl TODO: use availability of sys/mman.h and/or mmap to define |
689 | dnl OR support windows mmap functions | |
690 | if test "x$squid_host_os" = "xmingw" ; then | |
691 | AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw]) | |
fedd516f | 692 | squid_disk_module_candidates_Mmapped=no |
e2cbb70e FC |
693 | else |
694 | AC_MSG_NOTICE([Enabling Mmapped DiskIO module]) | |
e2cbb70e | 695 | DISK_MODULES="$DISK_MODULES Mmapped" |
d9691f09 | 696 | AC_DEFINE([HAVE_DISKIO_MODULE_MMAPPED],1,[Mmapped Disk I/O module is built]) |
e2cbb70e | 697 | fi |
e2851fe7 AR |
698 | ;; |
699 | ||
2513178d | 700 | *) |
507ca601 | 701 | AC_MSG_NOTICE([Enabling $module DiskIO module]) |
d9691f09 | 702 | DISK_LIBS="$DISK_LIBS lib${module}.la" |
507ca601 | 703 | DISK_MODULES="$DISK_MODULES ${module}" |
507ca601 | 704 | ;; |
2513178d AJ |
705 | esac |
706 | done | |
707 | AC_MSG_NOTICE([IO Modules built: $DISK_MODULES]) | |
708 | AC_SUBST(DISK_MODULES) | |
709 | AC_SUBST(DISK_LIBS) | |
8aafbbc1 | 710 | AM_CONDITIONAL(ENABLE_DISKIO_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes") |
d9691f09 | 711 | AC_SUBST(AIOLIB) |
8aafbbc1 AJ |
712 | AM_CONDITIONAL(ENABLE_WIN32_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1") |
713 | AM_CONDITIONAL(ENABLE_DISKIO_BLOCKING, test "x$squid_disk_module_candidates_Blocking" = "xyes") | |
714 | AM_CONDITIONAL(ENABLE_DISKIO_DISKDAEMON, test "x$squid_disk_module_candidates_DiskDaemon" = "xyes") | |
715 | AM_CONDITIONAL(ENABLE_DISKIO_DISKTHREADS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes") | |
d9691f09 | 716 | AC_SUBST(LIBPTHREADS) |
8aafbbc1 AJ |
717 | AM_CONDITIONAL(ENABLE_WIN32_AIOPS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1") |
718 | AM_CONDITIONAL(ENABLE_DISKIO_IPCIO, test "x$squid_disk_module_candidates_IpcIo" = "xyes") | |
719 | AM_CONDITIONAL(ENABLE_DISKIO_MMAPPED, test "x$squid_disk_module_candidates_Mmapped" = "xyes") | |
2513178d AJ |
720 | |
721 | dnl Check what Storage formats are wanted. | |
722 | dnl This version will error out with a message saying why if a required DiskIO is missing. | |
dc299f29 | 723 | squid_opt_enable_storeio=auto |
d235bc84 FC |
724 | AC_ARG_ENABLE([storeio], |
725 | AS_HELP_STRING([--enable-storeio="list of modules"], | |
726 | [Build support for the list of store I/O modules. | |
18cc92fb FC |
727 | The default is only to build the "ufs" module. |
728 | See src/fs for a list of available modules, or | |
729 | Programmers Guide section <not yet written> | |
507ca601 FC |
730 | for details on how to build your custom store module]), [ |
731 | case $enableval in | |
cd748f27 | 732 | yes) |
dc299f29 | 733 | squid_opt_enable_storeio=auto |
507ca601 | 734 | ;; |
cd748f27 | 735 | no) |
dc299f29 | 736 | squid_opt_enable_storeio=no |
507ca601 | 737 | ;; |
1c690e30 | 738 | *) |
dc299f29 | 739 | squid_opt_enable_storeio=yes |
507ca601 | 740 | squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
80f756db | 741 | # ufs is really always needed as it has low-level routines |
be0c7ff0 | 742 | # if it is a dupe it will be cleaned-up later |
80f756db | 743 | squid_storeio_module_candidates="$squid_storeio_module_candidates ufs" |
507ca601 | 744 | ;; |
cd748f27 | 745 | esac |
cd748f27 | 746 | ]) |
fcabe077 | 747 | if test "x$squid_opt_enable_storeio" = "xauto"; then |
dc299f29 | 748 | squid_opt_enable_storeio=yes |
d235bc84 FC |
749 | AC_MSG_CHECKING([for available StoreIO modules]) |
750 | SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates]) | |
751 | AC_MSG_RESULT([$squid_storeio_module_candidates]) | |
752 | fi | |
753 | ||
dc299f29 FC |
754 | SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates]) |
755 | SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates]) | |
756 | AC_MSG_NOTICE([Store modules built: $squid_storeio_module_candidates]) | |
757 | ||
758 | for fs in $squid_storeio_module_candidates none; do | |
507ca601 | 759 | case "$fs" in |
8154dd82 | 760 | diskd) |
507ca601 | 761 | if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \ |
80f756db | 762 | "$squid_disk_module_candidates_DiskDaemon" != "yes" ; then |
507ca601 FC |
763 | AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon]) |
764 | fi | |
765 | ;; | |
8154dd82 | 766 | aufs) |
507ca601 | 767 | if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \ |
80f756db | 768 | "$squid_disk_module_candidates_DiskThreads" != "yes" ; then |
507ca601 FC |
769 | AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads]) |
770 | fi | |
771 | ;; | |
e2851fe7 | 772 | rock) |
b5b88fb5 MM |
773 | if test "x$squid_disk_module_candidates_IpcIo" != "xyes" -a \ |
774 | "x$squid_disk_module_candidates_Blocking" != "xyes"; then | |
775 | AC_MSG_ERROR([Storage module Rock requires DiskIO module: Blocking or IpcIo]) | |
776 | fi | |
777 | squid_do_build_rock=true | |
778 | ;; | |
d3b3ab85 | 779 | ufs) |
b5b88fb5 MM |
780 | if test "x$squid_disk_module_candidates_Blocking" != "xyes"; then |
781 | AC_MSG_ERROR([Storage module ufs requires DiskIO module: Blocking]) | |
782 | fi | |
783 | squid_do_build_ufs=true | |
784 | ;; | |
8154dd82 | 785 | esac |
a2794549 | 786 | done |
23ee12fb | 787 | |
8aafbbc1 AJ |
788 | AM_CONDITIONAL(ENABLE_FS_UFS, test "x$squid_do_build_ufs" = "xtrue") |
789 | AM_CONDITIONAL(ENABLE_FS_ROCK, test "x$squid_do_build_rock" = "xtrue") | |
9d6186b1 FC |
790 | dnl hack: need to define those even if not used in the build system to |
791 | dnl make sure that global FS objects are linked to the squid binary. | |
7b5b7ba8 CT |
792 | AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build") |
793 | AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build") | |
794 | AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build") | |
e2851fe7 | 795 | AH_TEMPLATE(HAVE_FS_ROCK, "Define to 1 if rock filesystem module is build") |
7b5b7ba8 CT |
796 | |
797 | ||
dc299f29 | 798 | dnl got final squid_storeio_module_candidates, build library lists |
b66455ff AR |
799 | dnl This list will not be needed when each fs library has its own Makefile |
800 | STORE_LIBS_TO_BUILD= | |
801 | dnl File system libraries to link executables with. | |
802 | dnl These are the same as STORE_LIBS_TO_BUILD, but with a path | |
803 | STORE_LIBS_TO_ADD= | |
dc299f29 | 804 | for fs in $squid_storeio_module_candidates; do |
7b5b7ba8 CT |
805 | STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la" |
806 | STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la" | |
6d1c1ab1 FC |
807 | SQUID_TOUPPER_VAR_CONTENTS([fs]) |
808 | AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1) | |
b66455ff AR |
809 | done |
810 | ||
811 | AC_SUBST(STORE_LIBS_TO_BUILD) | |
812 | AC_SUBST(STORE_LIBS_TO_ADD) | |
082a5e7a | 813 | AC_SUBST(STORE_TESTS) |
a2794549 | 814 | |
24a04df9 AJ |
815 | |
816 | dnl At lest one removal policy is always needed. | |
817 | dnl 'lru' removal policy is currently hard-coded by name for tests | |
818 | dnl so we must set it as default. | |
819 | REPL_POLICIES="lru" | |
d9180414 | 820 | AC_ARG_ENABLE(removal-policies, |
56ffc413 FC |
821 | AS_HELP_STRING([--enable-removal-policies="list of policies"], |
822 | [Build support for the list of removal policies. | |
18cc92fb FC |
823 | The default is only to build the "lru" module. |
824 | See src/repl for a list of available modules, or | |
825 | Programmers Guide section 9.9 for details on how | |
507ca601 FC |
826 | to build your custom policy]), [ |
827 | case $enableval in | |
6a566b9c | 828 | yes) |
5069fb38 | 829 | SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES]) |
507ca601 | 830 | ;; |
6a566b9c | 831 | no) |
507ca601 | 832 | ;; |
1c690e30 | 833 | *) |
507ca601 FC |
834 | REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
835 | ;; | |
6a566b9c | 836 | esac |
6a566b9c | 837 | ]) |
fcabe077 | 838 | if test "x$REPL_POLICIES" != "x" ; then |
56ffc413 | 839 | SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES]) |
5069fb38 | 840 | AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES]) |
1c690e30 | 841 | REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a" |
842 | REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`" | |
843 | fi | |
6a566b9c | 844 | AC_SUBST(REPL_POLICIES) |
6a566b9c | 845 | AC_SUBST(REPL_OBJS) |
f71946fc | 846 | AC_SUBST(REPL_LIBS) |
6a566b9c | 847 | |
d1da2d1f | 848 | AM_CONDITIONAL(ENABLE_PINGER, false) |
e5f4e1b0 | 849 | AC_ARG_ENABLE(icmp, |
62979ab1 | 850 | AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]), |
fcabe077 | 851 | [ if test "x$enableval" = "xyes" ; then |
eed82608 | 852 | AC_MSG_NOTICE([ICMP enabled]) |
be0c7ff0 | 853 | AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)]) |
d1da2d1f | 854 | AM_CONDITIONAL(ENABLE_PINGER, true) |
e5f4e1b0 | 855 | fi |
856 | ]) | |
857 | ||
9a0a18de | 858 | AM_CONDITIONAL(ENABLE_DELAY_POOLS, false) |
d9180414 | 859 | AC_ARG_ENABLE(delay-pools, |
62979ab1 | 860 | AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]), |
fcabe077 | 861 | [ if test "x$enableval" = "xyes" ; then |
eed82608 | 862 | AC_MSG_NOTICE([Delay pools enabled]) |
9a0a18de | 863 | AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".]) |
ffe4ffd8 | 864 | AM_CONDITIONAL(ENABLE_DELAY_POOLS, true) |
e5f4e1b0 | 865 | fi |
866 | ]) | |
867 | ||
5fa840c3 | 868 | dnl disable generic/common adaptation support by default |
5069fb38 | 869 | squid_opt_use_adaptation=no |
5fa840c3 | 870 | |
799b66d1 AJ |
871 | squid_opt_use_esi=auto |
872 | AH_TEMPLATE([USE_SQUID_ESI],[Define to enable the ESI processor]) | |
43ae1d95 | 873 | AC_ARG_ENABLE(esi, |
799b66d1 AJ |
874 | AS_HELP_STRING([--disable-esi], |
875 | [Disable ESI for accelerators. ESI requires expat or libxml2. | |
7eb77a5f | 876 | Enabling ESI will cause squid reverse proxies to be capable |
5069fb38 | 877 | of the Edge Acceleration Specification (www.esi.org).]), |
799b66d1 | 878 | [squid_opt_use_esi=$enableval],[]) |
88bfe098 AJ |
879 | HAVE_LIBEXPAT=0 |
880 | EXPATLIB= | |
881 | HAVE_LIBXML2=0 | |
882 | XMLLIB= | |
88bfe098 | 883 | |
7eb77a5f FC |
884 | # ESI support libraries: expat |
885 | AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect])) | |
799b66d1 | 886 | if test "x$squid_opt_use_esi" != "xno" -a "x$with_expat" != "xno" ; then |
7eb77a5f FC |
887 | AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1]) |
888 | AC_CHECK_HEADERS([expat.h]) | |
889 | AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library]) | |
799b66d1 AJ |
890 | AS_IF(test "x$HAVE_LIBEXPAT" = "x1",[ |
891 | squid_opt_use_esi=yes | |
892 | ],[ | |
893 | AS_IF(test "x$with_expat" = "xyes",[ | |
894 | AC_MSG_ERROR([Required library expat not found.]) | |
895 | ],[ | |
896 | AC_MSG_NOTICE([Library expat not found.]) | |
897 | ]) | |
898 | ]) | |
7eb77a5f | 899 | fi |
ad32c661 | 900 | |
7eb77a5f | 901 | AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect])) |
799b66d1 | 902 | if test "x$squid_opt_use_esi" != "xno" -a "x$with_libxml2" != "xno" ; then |
8fa07024 FF |
903 | SQUID_STATE_SAVE([squid_libxml2_save]) |
904 | PKG_CHECK_MODULES([LIBXML2],[libxml-2.0],[],[ | |
905 | AC_CHECK_LIB([xml2], [main], [LIBXML2_LIBS="$LIBXML2_LIBS -lxml2"]) | |
906 | dnl Find the main header and include path... | |
907 | AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [ | |
908 | AC_CHECK_HEADERS([libxml/parser.h], [], [ | |
909 | AC_MSG_NOTICE([Testing in /usr/include/libxml2]) | |
910 | SAVED_CPPFLAGS="$CPPFLAGS" | |
911 | CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS" | |
0dc1a86a | 912 | unset ac_cv_header_libxml_parser_h |
8fa07024 FF |
913 | AC_CHECK_HEADERS([libxml/parser.h], [LIBXML2_CFLAGS="$LIBXML2_CFLAGS -I/usr/include/libxml2"], [ |
914 | AC_MSG_NOTICE([Testing in /usr/local/include/libxml2]) | |
915 | CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS" | |
916 | unset ac_cv_header_libxml_parser_h | |
917 | AC_CHECK_HEADERS([libxml/parser.h], [LIBXML2_CFLAGS="$LIBXML2_CFLAGS -I/usr/local/include/libxml2"], [ | |
918 | AC_MSG_NOTICE([Failed to find libxml2 header file libxml/parser.h]) | |
919 | ]) | |
0dc1a86a | 920 | ]) |
8fa07024 | 921 | CPPFLAGS="$SAVED_CPPFLAGS" |
7eb77a5f | 922 | ]) |
0dc1a86a HN |
923 | ]) |
924 | ]) | |
8fa07024 | 925 | CPPFLAGS="$CPPFLAGS $LIBXML2_CFLAGS" |
0dc1a86a HN |
926 | dnl Now that we know where to look find the headers... |
927 | AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h) | |
8fa07024 FF |
928 | SQUID_STATE_ROLLBACK([squid_libxml2_save]) |
929 | ||
930 | if test "x$LIBXML2_LIBS" != "x"; then | |
931 | HAVE_LIBXML2=1 | |
799b66d1 | 932 | squid_opt_use_esi=yes |
8fa07024 FF |
933 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS $LIBXML2_CFLAGS" |
934 | CPPFLAGS="$CPPFLAGS $LIBXML2_CFLAGS" | |
935 | XMLLIB="$LIBXML2_LIBS" | |
936 | AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library]) | |
937 | elif test "x$with_libxml2" = "xyes"; then | |
938 | AC_MSG_ERROR([Required library libxml2 not found]) | |
939 | else | |
940 | AC_MSG_NOTICE([Library libxml2 not found.]) | |
941 | fi | |
43ae1d95 | 942 | fi |
7eb77a5f | 943 | |
799b66d1 AJ |
944 | AS_IF([test "x$squid_opt_use_esi" = "xyes"],[ |
945 | AS_IF(test "x$HAVE_LIBXML2" = "x0" -a "x$HAVE_LIBEXPAT" = "x0",[ | |
946 | AC_MSG_ERROR([ESI processor requires libxml2 or libexpat]) | |
947 | ]) | |
948 | AC_MSG_NOTICE([Enabling ESI processor: $EXPATLIB $XMLLIB]) | |
949 | AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor]) | |
950 | ],[ | |
951 | AS_IF(test "x$squid_opt_use_esi" = "xno",[ | |
952 | AC_MSG_NOTICE([Disabling ESI processor.]) | |
953 | ],[ | |
954 | AC_MSG_NOTICE([Disabling ESI processor. libxml2 and libexpat not found.]) | |
955 | ]) | |
956 | ]) | |
8aafbbc1 | 957 | AM_CONDITIONAL(ENABLE_ESI, test "x$squid_opt_use_esi" = "xyes") |
799b66d1 | 958 | AM_CONDITIONAL(ENABLE_LIBEXPAT, test "x$HAVE_LIBEXPAT" = "x1") |
88bfe098 | 959 | AC_SUBST(EXPATLIB) |
799b66d1 | 960 | AM_CONDITIONAL(ENABLE_LIBXML2, test "x$HAVE_LIBXML2" = "x1") |
88bfe098 | 961 | AC_SUBST(XMLLIB) |
43ae1d95 | 962 | |
8075a4da | 963 | # icap argument handling |
51952383 | 964 | AC_ARG_ENABLE(icap-client, |
4f07726a AJ |
965 | AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[ |
966 | SQUID_YESNO([$enableval],[Unrecognized argument to --disable-icap-client: $enableval]) | |
967 | ]) | |
968 | SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid]) | |
ebf76e07 | 969 | AS_IF(test "x$enable_icap_client" != "xno", squid_opt_use_adaptation="yes") |
8aafbbc1 | 970 | AM_CONDITIONAL(ENABLE_ICAP_CLIENT, test "x$enable_icap_client" != "xno") |
51952383 | 971 | |
5069fb38 | 972 | squid_opt_use_ecap=1 |
3e7b6055 AR |
973 | AC_MSG_CHECKING(whether to support eCAP) |
974 | AC_ARG_ENABLE(ecap, | |
8075a4da FC |
975 | AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]), [ |
976 | case "${enableval}" in | |
977 | yes|no) squid_opt_use_ecap=$enableval ;; | |
978 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;; | |
979 | esac | |
980 | AC_MSG_RESULT([$squid_opt_use_ecap, explicitly]) | |
981 | ], [ | |
5069fb38 FC |
982 | squid_opt_use_ecap=no; |
983 | AC_MSG_RESULT([$squid_opt_use_ecap, implicitly]) | |
3e7b6055 AR |
984 | ] |
985 | ) | |
986 | ||
987 | dnl Perform configuration consistency checks for eCAP | |
cbc14831 | 988 | if test "x$squid_opt_use_ecap" != "xno"; |
3e7b6055 | 989 | then |
cbc14831 AJ |
990 | dnl eCAP support requires loadable modules, which are enabled by default |
991 | if test "x$enable_loadable_modules" != "xyes" | |
992 | then | |
993 | AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]) | |
994 | fi | |
4cfba571 | 995 | |
cbc14831 | 996 | if test -n "$PKG_CONFIG"; then |
6666da11 | 997 | dnl eCAP support requires libecap. |
0a720258 | 998 | dnl This Squid supports libecap v1.0.x. |
3e115aaf AR |
999 | dnl Use EXT_ prefix to distinguish external libecap (that we check for |
1000 | dnl here) from our own convenience ecap library in Makefiles. | |
0a720258 | 1001 | PKG_CHECK_MODULES([EXT_LIBECAP],[libecap >= 1.0 libecap < 1.1]) |
cbc14831 AJ |
1002 | else |
1003 | AC_MSG_NOTICE([eCAP support requires pkg-config to verify the correct library version. Trouble may follow.]) | |
1004 | fi | |
3e7b6055 | 1005 | |
ebf76e07 AJ |
1006 | SQUID_STATE_SAVE(squid_ecap_state) |
1007 | AC_MSG_CHECKING([whether -lecap will link]) | |
a023fd8e AJ |
1008 | CXXFLAGS="$CXXFLAGS $EXT_LIBECAP_CFLAGS" |
1009 | LIBS="$LIBS $EXT_LIBECAP_LIBS" | |
ebf76e07 AJ |
1010 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libecap/common/names.h>]],[[ |
1011 | const libecap::Name test("test", libecap::Name::NextId()); | |
1012 | ]])],[ | |
1013 | AC_MSG_RESULT(yes) | |
5069fb38 | 1014 | squid_opt_use_adaptation=yes |
ebf76e07 AJ |
1015 | ],[ |
1016 | AC_MSG_RESULT(no) | |
1017 | AS_IF( | |
1018 | test "x$squid_opt_use_ecap" = "xyes", AC_MSG_ERROR([eCAP library will not link. | |
1019 | You may need to rebuild libecap using the same version of GCC as Squid. | |
1020 | There have been breaking ABI changes in the libstdc++ STL with GCC 5.]), | |
1021 | ||
1022 | [AC_MSG_NOTICE([eCAP library will not link. | |
1023 | You may need to rebuild libecap using the same version of GCC as Squid. | |
1024 | There have been breaking ABI changes in the libstdc++ STL with GCC 5.]) | |
1025 | squid_opt_use_ecap="no" | |
1026 | ]) | |
1027 | ]) | |
1028 | SQUID_STATE_ROLLBACK(squid_ecap_state) | |
3e7b6055 | 1029 | fi |
b65a2365 | 1030 | SQUID_DEFINE_BOOL(USE_ECAP,${squid_opt_use_ecap:=no},[Whether to use eCAP support]) |
8aafbbc1 | 1031 | AM_CONDITIONAL(ENABLE_ECAP, test "x$squid_opt_use_ecap" = "xyes") |
3e7b6055 | 1032 | |
5fa840c3 | 1033 | dnl enable adaptation if requested by specific adaptation mechanisms |
8aafbbc1 AJ |
1034 | ADAPTATION_LIBS="" |
1035 | if test "x$squid_opt_use_adaptation" = "xyes"; then | |
5fa840c3 | 1036 | ADAPTATION_LIBS="adaptation/libadaptation.la" |
51952383 | 1037 | fi |
8aafbbc1 AJ |
1038 | SQUID_DEFINE_BOOL(USE_ADAPTATION,${squid_opt_use_adaptation:=no}, [common adaptation support]) |
1039 | AM_CONDITIONAL(ENABLE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes") | |
5fa840c3 | 1040 | AC_SUBST(ADAPTATION_LIBS) |
3e7b6055 | 1041 | |
1d3aafe4 | 1042 | test "x$squid_host_os" = "xmingw" && enable_wccp=no |
5069fb38 | 1043 | AC_ARG_ENABLE(wccp, |
8075a4da | 1044 | AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [ |
1a6b111a | 1045 | SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccp: $enableval]) |
5069fb38 | 1046 | ]) |
0067eb06 | 1047 | SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP]) |
1a6b111a | 1048 | AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp]) |
0b0cfcf2 | 1049 | |
1d3aafe4 | 1050 | test "x$squid_host_os" = "xmingw" && enable_wccpv2=no |
0b0cfcf2 | 1051 | AC_ARG_ENABLE(wccpv2, |
1a6b111a FC |
1052 | AS_HELP_STRING([--disable-wccpv2], |
1053 | [Disable Web Cache Coordination V2 Protocol]), [ | |
1054 | SQUID_YESNO([$enableval], | |
1055 | [unrecognized argument to --disable-wccpv2: $enableval]) | |
0b0cfcf2 | 1056 | ]) |
0067eb06 | 1057 | SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes}, |
1a6b111a FC |
1058 | [Define to enable WCCP V2]) |
1059 | AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2]) | |
320e9f36 | 1060 | |
d9180414 | 1061 | AC_ARG_ENABLE(kill-parent-hack, |
8075a4da | 1062 | AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [ |
1a6b111a FC |
1063 | SQUID_YESNO([$enableval], |
1064 | [unrecognized argument to --enable-kill-parent-hack: $enableval]) | |
e5f4e1b0 | 1065 | ]) |
0067eb06 | 1066 | SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no}, |
1a6b111a FC |
1067 | [A dangerous feature which causes Squid to kill its parent |
1068 | process (presumably the RunCache script) upon receipt | |
1069 | of SIGTERM or SIGINT. Deprecated, Use with caution.]) | |
1070 | AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack]) | |
20ad76ab | 1071 | |
e5f4e1b0 | 1072 | AC_ARG_ENABLE(snmp, |
1d87b6b3 | 1073 | AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [ |
1a6b111a FC |
1074 | SQUID_YESNO([$enableval], |
1075 | [unrecognized argument to --disable-snmp: $enableval]) | |
87630341 | 1076 | ]) |
0067eb06 | 1077 | SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes}, |
1a6b111a | 1078 | [Define to enable SNMP monitoring of Squid]) |
f738d783 | 1079 | AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"]) |
fcabe077 | 1080 | if test "x$enable_snmp" = "xyes"; then |
4de1e2da | 1081 | SNMPLIB='../lib/snmplib/libsnmplib.la' |
87630341 | 1082 | fi |
1a6b111a | 1083 | AC_MSG_NOTICE([SNMP support enabled: $enable_snmp]) |
e5f4e1b0 | 1084 | AC_SUBST(SNMPLIB) |
e5f4e1b0 | 1085 | |
d9180414 | 1086 | AC_ARG_ENABLE(cachemgr-hostname, |
5069fb38 FC |
1087 | AS_HELP_STRING([--enable-cachemgr-hostname=hostname], |
1088 | [Make cachemgr.cgi default to this host. | |
1d87b6b3 FC |
1089 | If unspecified, uses the name of the build-host]), [ |
1090 | case $enableval in | |
1091 | yes) | |
1092 | AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()], | |
1093 | [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()]) | |
1094 | AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs]) | |
1095 | ;; | |
1096 | no) | |
1097 | : # Nothing to do.. | |
1098 | ;; | |
1099 | *) | |
1100 | AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}") | |
1101 | AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}]) | |
1102 | ;; | |
1103 | esac | |
e5f4e1b0 | 1104 | ]) |
1105 | ||
ee0927b6 | 1106 | AC_ARG_ENABLE(eui, |
1a6b111a | 1107 | AS_HELP_STRING([--disable-eui], |
c8da66ba | 1108 | [Disable use of ARP / MAC/ EUI (ether address)]), [ |
1a6b111a FC |
1109 | SQUID_YESNO([$enableval],[--disable-eui expects no arguments]) |
1110 | ]) | |
fcabe077 | 1111 | if test "x${enable_eui:=yes}" = "xyes" ; then |
195ec847 AJ |
1112 | SQUID_STATE_SAVE(LIBEUI) |
1113 | # GLIBC 2.30 deprecates sysctl.h. Test with the same flags that (may) break includes later. | |
1114 | CFLAGS=$SQUID_CFLAGS | |
1115 | CXXFLAGS=$SQUID_CXXFLAGS | |
507ca601 | 1116 | case "$squid_host_os" in |
a396d1f8 | 1117 | linux|solaris|freebsd|openbsd|netbsd|cygwin) |
507ca601 FC |
1118 | ${TRUE} |
1119 | ;; | |
a396d1f8 | 1120 | mingw) |
507ca601 FC |
1121 | EUILIB="-liphlpapi" |
1122 | ;; | |
1123 | *) | |
1124 | AC_MSG_WARN([EUI support probably will not work on host $host.]) | |
1125 | ;; | |
1126 | esac | |
b966288b | 1127 | # iphlpapi.h check delayed after winsock2.h |
507ca601 | 1128 | AC_CHECK_HEADERS( \ |
32341684 | 1129 | windows.h \ |
507ca601 | 1130 | sys/sockio.h \ |
32341684 AJ |
1131 | sys/param.h, |
1132 | [], [], [[ | |
1133 | #if HAVE_WINDOWS_H | |
1134 | include <windows.h> | |
54d47324 | 1135 | #endif |
32341684 | 1136 | ]] |
507ca601 | 1137 | ) |
29759678 FC |
1138 | AC_CHECK_HEADERS( \ |
1139 | net/if_arp.h \ | |
1140 | net/route.h, | |
1141 | [], [], [[ | |
1142 | #include <sys/types.h> | |
1143 | #include <sys/socket.h> | |
1144 | ]]) | |
1145 | ||
43c1320a AJ |
1146 | # OpenBSD, FreeBSD and NetBSD requires sys/param.h to be included before sysctl.h and net/if_dl.h |
1147 | AC_CHECK_HEADERS( \ | |
1148 | net/if_dl.h \ | |
1149 | sys/sysctl.h, | |
1150 | [], [], [[ | |
54d47324 | 1151 | #if HAVE_SYS_PARAM_H |
29759678 FC |
1152 | #include <sys/param.h> |
1153 | #endif | |
1154 | ]]) | |
195ec847 | 1155 | SQUID_STATE_ROLLBACK(LIBEUI) |
a98c2da5 | 1156 | fi |
2ef664d8 | 1157 | AC_SUBST(EUILIB) |
1a6b111a | 1158 | AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui]) |
0067eb06 | 1159 | SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui, |
1a6b111a | 1160 | [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.]) |
8aafbbc1 | 1161 | AM_CONDITIONAL(ENABLE_EUI, [test "x$enable_eui" = "xyes" ]) |
1a6b111a | 1162 | |
e5f4e1b0 | 1163 | |
74075210 | 1164 | AC_ARG_ENABLE(htcp, |
47d80734 | 1165 | AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [ |
1a6b111a FC |
1166 | SQUID_YESNO([$enableval], |
1167 | [unrecognized argument to --disable-htcp: $enableval]) | |
74075210 | 1168 | ]) |
0f658b5b | 1169 | SQUID_DEFINE_BOOL(USE_HTCP,${enable_htcp:=yes}, |
47d80734 | 1170 | [Define this to include code for the Hypertext Cache Protocol (HTCP)]) |
fcabe077 | 1171 | AM_CONDITIONAL(ENABLE_HTCP, [test "x$enable_htcp" = "xyes"]) |
1a6b111a FC |
1172 | AC_MSG_NOTICE([HTCP support enabled: $enable_htcp]) |
1173 | ||
09cd7204 AJ |
1174 | # Cryptograhic libraries |
1175 | AC_ARG_WITH(nettle, | |
1176 | AS_HELP_STRING([--without-nettle],[Compile without the Nettle crypto library.]),[ | |
1177 | case "$with_nettle" in | |
1178 | yes|no) | |
1179 | : # Nothing special to do here | |
1180 | ;; | |
1181 | *) | |
1182 | if test ! -d "$withval" ; then | |
1183 | AC_MSG_ERROR([--with-nettle path does not point to a directory]) | |
1184 | fi | |
1185 | NETTLELIBDIR="-L$with_nettle/lib" | |
1186 | CPPFLAGS="-I$with_nettle/include $CPPFLAGS" | |
1187 | with_nettle=yes | |
1188 | esac | |
a9dfcab8 | 1189 | ]) |
09cd7204 AJ |
1190 | if test "x$with_nettle" != "xno" ; then |
1191 | AC_CHECK_LIB(nettle, nettle_md5_init,[ | |
1192 | NETTLELIB="$NETTLELIBDIR -lnettle" | |
f9ef3ed8 | 1193 | AC_CHECK_HEADERS(nettle/md5.h) |
09cd7204 | 1194 | ],[with_nettle=no]) |
f9ef3ed8 | 1195 | if test "x$with_nettle" != "xno" ; then |
1d11e9b3 | 1196 | # Base64 uses the nettle 3.4 API |
f9ef3ed8 AJ |
1197 | # which matters on 64-bit systems |
1198 | AC_CHECK_HEADERS(nettle/base64.h) | |
1d11e9b3 | 1199 | AC_MSG_CHECKING([for Nettle 3.4 API compatibility]) |
f9ef3ed8 AJ |
1200 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
1201 | # include <cstddef> | |
1202 | # include <cstdint> | |
1203 | # include <nettle/base64.h> | |
1204 | ]],[[ | |
1d11e9b3 | 1205 | char inData[10]; inData[0] = '\0'; |
f9ef3ed8 AJ |
1206 | size_t srcLen = 0; |
1207 | struct base64_decode_ctx ctx; | |
1208 | base64_decode_init(&ctx); | |
1209 | uint8_t outData[10]; | |
1210 | size_t dstLen = 0; | |
1211 | if (!base64_decode_update(&ctx, &dstLen, outData, srcLen, inData) || | |
1212 | !base64_decode_final(&ctx)) { | |
1213 | return 1; | |
1214 | } | |
1215 | ]])],[AC_MSG_RESULT(yes) | |
1d11e9b3 | 1216 | AC_DEFINE(HAVE_NETTLE34_BASE64,1,[set to 1 if Nettle 3.4 API will link]) |
f9ef3ed8 AJ |
1217 | ],[AC_MSG_RESULT(no)]) |
1218 | fi | |
a9dfcab8 | 1219 | fi |
09cd7204 AJ |
1220 | AC_MSG_NOTICE([Using Nettle cryptographic library: ${with_nettle:=yes}]) |
1221 | AC_SUBST(NETTLELIB) | |
a9dfcab8 | 1222 | |
e59a64d7 AJ |
1223 | dnl Check for libcrypt |
1224 | CRYPTLIB= | |
1225 | dnl Some of our helpers use crypt(3) which may be in libc, or in | |
1226 | dnl libcrypt (eg FreeBSD) | |
1227 | AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) | |
1228 | dnl Solaris10 provides MD5 natively through libmd5 | |
1229 | AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"]) | |
1230 | AC_SUBST(CRYPTLIB) | |
1231 | ||
b4f805f6 AJ |
1232 | SSLLIB="" |
1233 | ||
1234 | dnl User may want to disable GnuTLS | |
1235 | AC_ARG_WITH(gnutls, | |
1236 | AS_HELP_STRING([--without-gnutls], | |
1237 | [Do not use GnuTLS for SSL. Default: auto-detect]), [ | |
1238 | case "$with_gnutls" in | |
1239 | yes|no) | |
1240 | : # Nothing special to do here | |
1241 | ;; | |
1242 | *) | |
1243 | if test ! -d "$withval" ; then | |
1244 | AC_MSG_ERROR([--with-gnutls path does not point to a directory]) | |
1245 | fi | |
1246 | LIBGNUTLS_PATH="-L$with_gnutls/lib" | |
1247 | CPPFLAGS="-I$with_gnutls/include $CPPFLAGS" | |
1248 | esac | |
1249 | ]) | |
1250 | AH_TEMPLATE(USE_GNUTLS,[GnuTLS support is available]) | |
1251 | if test "x$with_gnutls" != "xno"; then | |
7c760558 | 1252 | SQUID_STATE_SAVE(squid_gnutls_state) |
b4f805f6 AJ |
1253 | |
1254 | # User may have provided a custom location for GnuTLS. Otherwise... | |
b4f805f6 AJ |
1255 | LIBS="$LIBS $LIBGNUTLS_PATH" |
1256 | ||
1257 | # auto-detect using pkg-config | |
516ec633 | 1258 | PKG_CHECK_MODULES([LIBGNUTLS],[gnutls >= 3.4.0],[ |
7c760558 FC |
1259 | CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS" |
1260 | ],[ | |
b4f805f6 | 1261 | ## find the package without pkg-config |
c113986e | 1262 | ## check that the library is actually new enough. |
516ec633 AJ |
1263 | ## by testing for a 3.4.0+ function which we use |
1264 | AC_CHECK_LIB(gnutls,gnutls_pcert_export_x509,[LIBGNUTLS_LIBS="-lgnutls"]) | |
b4f805f6 | 1265 | ]) |
51e09c08 | 1266 | AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/x509.h gnutls/abstract.h) |
b4f805f6 AJ |
1267 | |
1268 | SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS | |
1269 | ||
1270 | if test "x$with_gnutls" = "xyes" -a "x$LIBGNUTLS_LIBS" = "x"; then | |
1271 | AC_MSG_ERROR([Required GnuTLS library not found]) | |
1272 | fi | |
1273 | if test "x$LIBGNUTLS_LIBS" != "x" ; then | |
1274 | CXXFLAGS="$LIBGNUTLS_CFLAGS $CXXFLAGS" | |
1275 | SSLLIB="$LIBGNUTLS_PATH $LIBGNUTLS_LIBS $SSLLIB" | |
1276 | AC_DEFINE(USE_GNUTLS,1,[GnuTLS support is available]) | |
1277 | else | |
1278 | with_gnutls=no | |
1279 | fi | |
1280 | fi | |
1281 | AC_MSG_NOTICE([GnuTLS library support: ${with_gnutls:=auto} ${LIBGNUTLS_PATH} ${LIBGNUTLS_LIBS}]) | |
1282 | ||
3d4022fa | 1283 | dnl User may specify OpenSSL is needed from a non-standard location |
1f7c9178 | 1284 | AC_ARG_WITH(openssl, |
f88ca0d1 FC |
1285 | AS_HELP_STRING([--with-openssl=PATH], |
1286 | [Compile with the OpenSSL libraries. The path to | |
86f53af2 FC |
1287 | the OpenSSL development libraries and headers |
1288 | installation can be specified if outside of the | |
f88ca0d1 FC |
1289 | system standard directories]), [ |
1290 | case "$with_openssl" in | |
a3b28798 HN |
1291 | yes|no) |
1292 | : # Nothing special to do here | |
1f7c9178 | 1293 | ;; |
1294 | *) | |
fcabe077 | 1295 | if test ! -d "$withval" ; then |
f88ca0d1 FC |
1296 | AC_MSG_ERROR([--with-openssl path does not point to a directory]) |
1297 | fi | |
84c3fc14 | 1298 | LIBOPENSSL_PATH="-L$with_openssl/lib" |
bcce53ce | 1299 | CPPFLAGS="-I$with_openssl/include $CPPFLAGS" |
a3b28798 | 1300 | with_openssl=yes |
1f7c9178 | 1301 | esac |
1302 | ]) | |
cb4f4424 | 1303 | AH_TEMPLATE(USE_OPENSSL,[OpenSSL support is available]) |
c41db002 AJ |
1304 | ## OpenSSL is default disable due to licensing issues on some OS |
1305 | if test "x$with_openssl" = "xyes"; then | |
1306 | AC_CHECK_HEADERS( \ | |
24b30fdc | 1307 | openssl/asn1.h \ |
8693472e | 1308 | openssl/bio.h \ |
24b30fdc | 1309 | openssl/bn.h \ |
eacc1666 | 1310 | openssl/crypto.h \ |
24b30fdc | 1311 | openssl/dh.h \ |
c41db002 | 1312 | openssl/err.h \ |
24b30fdc EQ |
1313 | openssl/evp.h \ |
1314 | openssl/lhash.h \ | |
c41db002 AJ |
1315 | openssl/md5.h \ |
1316 | openssl/opensslv.h \ | |
24b30fdc | 1317 | openssl/rsa.h \ |
c41db002 | 1318 | openssl/ssl.h \ |
24b30fdc | 1319 | openssl/x509.h \ |
c41db002 AJ |
1320 | openssl/x509v3.h \ |
1321 | openssl/engine.h \ | |
1322 | openssl/txt_db.h \ | |
1323 | ) | |
1324 | ||
e0b98074 | 1325 | # User may have provided a custom location for OpenSSL. Otherwise... |
84c3fc14 AJ |
1326 | SQUID_STATE_SAVE(squid_openssl_state) |
1327 | LIBS="$LIBS $LIBOPENSSL_PATH" | |
1328 | ||
1329 | # auto-detect using pkg-config | |
1330 | PKG_CHECK_MODULES([LIBOPENSSL],[openssl],,[ | |
1331 | ## For some OS pkg-config is broken or unavailable. | |
1332 | ## Detect libraries the hard way. | |
1333 | ||
1334 | # Windows MinGW has some special libraries ... | |
1335 | if test "x$squid_host_os" = "xmingw" ; then | |
1336 | LIBOPENSSL_LIBS='-lssleay32 -leay32 -lgdi32 $LIBOPENSSL_LIBS' | |
1337 | AC_MSG_NOTICE([Windows OpenSSL library support: yes -lssleay32 -leay32 -lgdi32]) | |
1338 | fi | |
e0b98074 | 1339 | |
84c3fc14 AJ |
1340 | AC_CHECK_LIB(crypto,[CRYPTO_new_ex_data],[LIBOPENSSL_LIBS="-lcrypto $LIBOPENSSL_LIBS"],[ |
1341 | AC_MSG_ERROR([library 'crypto' is required for OpenSSL]) | |
37a20074 | 1342 | ],$LIBOPENSSL_LIBS) |
403c4682 | 1343 | AC_CHECK_LIB(ssl,[SSL_CTX_new],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[ |
84c3fc14 | 1344 | AC_MSG_ERROR([library 'ssl' is required for OpenSSL]) |
37a20074 | 1345 | ],$LIBOPENSSL_LIBS) |
84c3fc14 | 1346 | ]) |
e0b98074 | 1347 | |
84c3fc14 AJ |
1348 | # This is a workaround for RedHat 9 brain damage.. |
1349 | if test -d /usr/kerberos/include -a -f /usr/include/openssl/kssl.h; then | |
1350 | AC_MSG_NOTICE([OpenSSL depends on Kerberos]) | |
1351 | LIBOPENSSL_LIBS="-L/usr/kerberos/lib $LIBOPENSSL_LIBS" | |
1352 | CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" | |
f11555e0 | 1353 | fi |
84c3fc14 | 1354 | SQUID_STATE_ROLLBACK(squid_openssl_state) #de-pollute LIBS |
1f7c9178 | 1355 | |
e0b98074 | 1356 | if test "x$LIBOPENSSL_LIBS" != "x"; then |
c41db002 | 1357 | CXXFLAGS="$LIBOPENSSL_CFLAGS $CXXFLAGS" |
84c3fc14 | 1358 | SSLLIB="$LIBOPENSSL_PATH $LIBOPENSSL_LIBS $SSLLIB" |
cb4f4424 | 1359 | AC_DEFINE(USE_OPENSSL,1,[OpenSSL support is available]) |
c41db002 | 1360 | |
b8649ee4 | 1361 | # check for API functions |
17e98f24 AJ |
1362 | SQUID_CHECK_LIBCRYPTO_API |
1363 | SQUID_CHECK_LIBSSL_API | |
8d56fe55 | 1364 | SQUID_CHECK_OPENSSL_TLS_METHODS |
b8649ee4 CT |
1365 | SQUID_STATE_SAVE(check_SSL_CTX_get0_certificate) |
1366 | LIBS="$LIBS $SSLLIB" | |
1367 | AC_CHECK_LIB(ssl, SSL_CTX_get0_certificate, [ | |
1368 | AC_DEFINE(HAVE_SSL_CTX_GET0_CERTIFICATE, 1, [SSL_CTX_get0_certificate is available]) | |
1369 | ], [ | |
1370 | missing_SSL_CTX_get0_certificate=yes | |
1371 | ]) | |
1372 | SQUID_STATE_ROLLBACK(check_SSL_CTX_get0_certificate) | |
1373 | ||
c41db002 | 1374 | # check for other specific broken implementations |
b8649ee4 CT |
1375 | if test "x$missing_SSL_CTX_get0_certificate" = "xyes"; then |
1376 | SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS | |
1377 | fi | |
c41db002 | 1378 | SQUID_CHECK_OPENSSL_CONST_SSL_METHOD |
7d841344 AJ |
1379 | SQUID_CHECK_OPENSSL_CONST_CRYPTO_EX_DATA |
1380 | SQUID_CHECK_OPENSSL_CONST_SSL_SESSION_CB_ARG | |
70cfe22f | 1381 | SQUID_CHECK_OPENSSL_CONST_X509_GET0_SIGNATURE_ARGS |
c41db002 | 1382 | SQUID_CHECK_OPENSSL_TXTDB |
a95989ed | 1383 | SQUID_CHECK_OPENSSL_HELLO_OVERWRITE_HACK |
1f7c9178 | 1384 | fi |
e0b98074 AJ |
1385 | if test "x$SSLLIB" = "x"; then |
1386 | AC_MSG_ERROR([Required OpenSSL library not found]) | |
f11555e0 | 1387 | fi |
1f7c9178 | 1388 | fi |
84c3fc14 | 1389 | AC_MSG_NOTICE([OpenSSL library support: ${with_openssl:=no} ${LIBOPENSSL_PATH} ${LIBOPENSSL_LIBS}]) |
c41db002 | 1390 | AM_CONDITIONAL(ENABLE_SSL,[ test "x$with_openssl" = "xyes" ]) |
1f7c9178 | 1391 | AC_SUBST(SSLLIB) |
1392 | ||
1a22a39e MM |
1393 | dnl User may specify MIT Kerberos is needed from a non-standard location |
1394 | AC_ARG_WITH(mit-krb5, | |
a5c79bf3 AJ |
1395 | AS_HELP_STRING([--without-mit-krb5], |
1396 | [Compile without MIT Kerberos support.]), [ | |
1a22a39e MM |
1397 | case "$with_mit_krb5" in |
1398 | yes|no) | |
1399 | : # Nothing special to do here | |
1400 | ;; | |
1401 | *) | |
1402 | if test ! -d "$withval" ; then | |
1403 | AC_MSG_ERROR([--with-mit-krb5 path does not point to a directory]) | |
1404 | fi | |
1405 | if test -d "$with_mit_krb5/lib64" ; then | |
1406 | LIB_KRB5_PATH="-L$with_mit_krb5/lib64 -L$with_mit_krb5/lib" | |
1407 | else | |
1408 | LIB_KRB5_PATH="-L$with_mit_krb5/lib" | |
1409 | fi | |
1410 | CXXFLAGS="-I$with_mit_krb5/include $CXXFLAGS" | |
1411 | krb5confpath="$with_mit_krb5/bin" | |
1412 | with_mit_krb5=yes | |
1413 | esac | |
1414 | ]) | |
75f3c557 | 1415 | AH_TEMPLATE(USE_APPLE_KRB5,[Apple Kerberos support is available]) |
1a22a39e MM |
1416 | AH_TEMPLATE(USE_MIT_KRB5,[MIT Kerberos support is available]) |
1417 | AH_TEMPLATE(USE_SOLARIS_KRB5,[Solaris Kerberos support is available]) | |
1418 | ||
75c5f82b AJ |
1419 | ## find out if pkg-config or krb5-config will work |
1420 | if test "x$with_mit_krb5" != "xno"; then | |
1a22a39e | 1421 | # find installed libs via pkg-config or krb5-config |
75c5f82b | 1422 | squid_pc_krb5_name= |
7c664dbc AJ |
1423 | PKG_CHECK_EXISTS(mit-krb5-gssapi mit-krb5, [squid_pc_krb5_name="mit-krb5-gssapi mit-krb5"],[ |
1424 | PKG_CHECK_EXISTS(gssapi-krb5 krb5, [squid_pc_krb5_name="gssapi-krb5 krb5"]) | |
1425 | ]) | |
75c5f82b | 1426 | if test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"; then |
77f4953d | 1427 | # Look for krb5-config (unless cross-compiling) |
c4b12583 | 1428 | AC_PATH_PROG(krb5_config,krb5-config,no,$krb5confpath) |
1a22a39e MM |
1429 | if test "x$ac_cv_path_krb5_config" != "xno" ; then |
1430 | krb5confpath="`dirname $ac_cv_path_krb5_config`" | |
1431 | ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`" | |
1432 | ac_solaris="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i solaris`" | |
75f3c557 | 1433 | ac_apple="`$ac_cv_path_krb5_config --vendor 2>/dev/null | grep -c -i apple`" |
1a22a39e MM |
1434 | if test $ac_solaris -gt 0 ; then |
1435 | with_solaris_krb5=yes | |
75c5f82b | 1436 | elif test $ac_apple -gt 0 ; then |
75f3c557 | 1437 | with_apple_krb5=yes |
75c5f82b AJ |
1438 | elif test $ac_heimdal -gt 0; then |
1439 | with_mit_krb5=no | |
1440 | if test "x$with_mit_krb5" = "xyes"; then | |
1441 | AC_MSG_ERROR([Could not find pkg-config or krb5-config for MIT Kerberos]) | |
1442 | fi | |
1a22a39e MM |
1443 | fi |
1444 | else | |
75c5f82b AJ |
1445 | if test "x$with_mit_krb5" = "xyes"; then |
1446 | AC_MSG_ERROR([Could not find krb5-config in path]) | |
1447 | else | |
1448 | with_mit_krb5=no | |
1449 | fi | |
1a22a39e MM |
1450 | fi |
1451 | fi | |
1452 | fi | |
1453 | ||
ed3a42d0 AJ |
1454 | # detect MIT Kerberos dependencies (except on Solaris) |
1455 | if test "x$with_mit_krb5" != "xno" -a "x$with_solaris_krb5" != "xyes"; then | |
1a22a39e MM |
1456 | SQUID_STATE_SAVE([squid_krb5_save]) |
1457 | LIBS="$LIBS $LIB_KRB5_PATH" | |
1458 | ||
1459 | # auto-detect using pkg-config | |
75c5f82b | 1460 | PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[ |
77f4953d AJ |
1461 | # look for krb5-config (unless cross-compiling) |
1462 | if test "$cross_compiling" = "no"; then | |
1463 | if test "x$krb5confpath" = "x" ; then | |
1464 | AC_PATH_PROG(krb5_config,krb5-config,no) | |
1465 | if test "x$ac_cv_path_krb5_config" != "xno" ; then | |
1466 | ac_krb5_config="$ac_cv_path_krb5_config" | |
1467 | fi | |
1468 | else | |
1469 | ac_krb5_config="$krb5confpath/krb5-config" | |
1a22a39e | 1470 | fi |
1a22a39e MM |
1471 | fi |
1472 | if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then | |
1473 | # Get libs, etc | |
1474 | AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS]) | |
1475 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`" | |
1476 | LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`" | |
1477 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS" | |
1478 | LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS" | |
1479 | else | |
1480 | ## For some OS pkg-config is broken or unavailable. | |
1481 | ## Detect libraries the hard way. | |
1482 | ||
b2bdde72 | 1483 | SQUID_STATE_SAVE([squid_mit_save]) |
ff78f3c3 | 1484 | missing_required= |
1a22a39e MM |
1485 | AC_MSG_NOTICE([Try to find Kerberos libraries in given path]) |
1486 | AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[ | |
ff78f3c3 AJ |
1487 | AC_MSG_WARN([library 'com_err' is required for MIT Kerberos]) |
1488 | missing_required=yes | |
1a22a39e | 1489 | ]) |
b2bdde72 | 1490 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1491 | AC_CHECK_LIB(k5crypto, [main], [LIB_KRB5_LIBS="-lk5crypto $LIB_KRB5_LIBS"],[ |
ff78f3c3 AJ |
1492 | AC_MSG_WARN([library 'k5crypto' is required for MIT Kerberos]) |
1493 | missing_required=yes | |
1a22a39e | 1494 | ]) |
b2bdde72 | 1495 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1496 | AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[ |
ff78f3c3 AJ |
1497 | AC_MSG_WARN([library 'krb5' is required for MIT Kerberos]) |
1498 | missing_required=yes | |
1a22a39e | 1499 | ]) |
b2bdde72 | 1500 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1501 | AC_CHECK_LIB(gssapi_krb5, [main], [LIB_KRB5_LIBS="-lgssapi_krb5 $LIB_KRB5_LIBS"],[ |
ff78f3c3 AJ |
1502 | AC_MSG_WARN([library 'gssapi_krb5' is required for MIT Kerberos]) |
1503 | missing_required=yes | |
1a22a39e | 1504 | ]) |
b2bdde72 | 1505 | SQUID_STATE_ROLLBACK([squid_mit_save]) |
ff78f3c3 AJ |
1506 | if test "x$missing_required" = "xyes"; then |
1507 | LIB_KRB5_LIBS="" | |
1508 | fi | |
1a22a39e | 1509 | fi |
1a22a39e MM |
1510 | ]) |
1511 | ||
1512 | if test "x$LIB_KRB5_LIBS" != "x"; then | |
75f3c557 MM |
1513 | if test "x$with_apple_krb5" = "xyes" ; then |
1514 | AC_DEFINE(USE_APPLE_KRB5,1,[Apple Kerberos support is available]) | |
1515 | KRB5_FLAVOUR="Apple" | |
1516 | else | |
1517 | AC_DEFINE(USE_MIT_KRB5,1,[MIT Kerberos support is available]) | |
1518 | KRB5_FLAVOUR="MIT" | |
1519 | fi | |
1a22a39e MM |
1520 | KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS" |
1521 | KRB5INCS="$LIB_KRB5_CFLAGS" | |
1a22a39e MM |
1522 | |
1523 | # check for other specific broken implementations | |
1524 | CXXFLAGS="$CXXFLAGS $KRB5INCS" | |
1525 | LIBS="$LIBS $KRB5LIBS" | |
1526 | ||
1527 | AC_MSG_NOTICE([Try to find Kerberos headers in given path]) | |
1528 | AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h) | |
1529 | AC_CHECK_HEADERS(gssapi/gssapi_generic.h) | |
1530 | AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h) | |
1531 | AC_CHECK_HEADERS(profile.h) | |
1532 | ||
1a22a39e | 1533 | SQUID_CHECK_KRB5_FUNCS |
1a22a39e | 1534 | fi |
75c5f82b | 1535 | if test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then |
1a22a39e | 1536 | AC_MSG_ERROR([Required Kerberos library not found]) |
75c5f82b AJ |
1537 | elif test "x$KRB5LIBS" = "x"; then |
1538 | with_mit_krb5=no | |
1539 | with_apple_krb5=no | |
1a22a39e | 1540 | fi |
1a22a39e MM |
1541 | SQUID_STATE_ROLLBACK([squid_krb5_save]) |
1542 | fi | |
1543 | ||
75c5f82b AJ |
1544 | # detect Solaris Kerberos dependencies |
1545 | if test "x$with_solaris_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then | |
1a22a39e MM |
1546 | SQUID_STATE_SAVE([squid_krb5_save]) |
1547 | LIBS="$LIBS $LIB_KRB5_PATH" | |
1548 | ||
1549 | # no pkg-config for solaris native Kerberos | |
77f4953d AJ |
1550 | # look for krb5-config (unless cross-compiling) |
1551 | if test "$cross_compiling" = "no"; then | |
1552 | if test "x$krb5confpath" = "x" ; then | |
1553 | AC_PATH_PROG(krb5_config,krb5-config,no) | |
1554 | if test "x$ac_cv_path_krb5_config" != "xno" ; then | |
1555 | ac_krb5_config="$ac_cv_path_krb5_config" | |
1556 | fi | |
1557 | else | |
1558 | ac_krb5_config="$krb5confpath/krb5-config" | |
1a22a39e | 1559 | fi |
1a22a39e MM |
1560 | fi |
1561 | if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then | |
1562 | # Get libs, etc | |
1563 | AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS]) | |
1564 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`" | |
1565 | LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`" | |
b2da83da AJ |
1566 | # Solaris 10 Update 11 patches the krb5-config tool to produce stderr messages on stdout. |
1567 | SOLARIS_BROKEN_KRB5CONFIG_GSSAPI="`$ac_krb5_config --libs gssapi 2>/dev/null | grep "krb5-config"`" | |
1568 | if test "x$SOLARIS_BROKEN_KRB5CONFIG_GSSAPI" = "x"; then | |
1569 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS" | |
1570 | LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS" | |
1571 | fi | |
1a22a39e MM |
1572 | else |
1573 | ## For some OS pkg-config is broken or unavailable. | |
1574 | ## Detect libraries the hard way. | |
1575 | ||
1576 | CXXFLAGS="-I/usr/include/kerberosv5 $CXXFLAGS" | |
1577 | ||
b2bdde72 | 1578 | SQUID_STATE_SAVE([squid_solaris_save]) |
ff78f3c3 | 1579 | missing_required= |
1a22a39e MM |
1580 | AC_MSG_NOTICE([Try to find Kerberos libraries in given path]) |
1581 | AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[ | |
ff78f3c3 AJ |
1582 | AC_MSG_WARN([library 'krb5' is required for Solaris Kerberos]) |
1583 | missing_required=yes | |
1a22a39e | 1584 | ]) |
b2bdde72 | 1585 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1586 | AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[ |
ff78f3c3 AJ |
1587 | AC_MSG_WARN([library 'gss' is required for Solaris Kerberos]) |
1588 | missing_required=yes | |
1a22a39e | 1589 | ]) |
b2bdde72 | 1590 | SQUID_STATE_ROLLBACK([squid_solaris_save]) |
ff78f3c3 AJ |
1591 | if test "x$missing_required" = "xyes"; then |
1592 | LIB_KRB5_LIBS="" | |
1593 | fi | |
1a22a39e MM |
1594 | fi |
1595 | ||
1596 | if test "x$LIB_KRB5_LIBS" != "x"; then | |
1597 | KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS" | |
1598 | KRB5INCS="$LIB_KRB5_CFLAGS" | |
1599 | AC_DEFINE(USE_SOLARIS_KRB5,1,[Solaris Kerberos support is available]) | |
1600 | KRB5_FLAVOUR="Solaris" | |
1601 | ||
1602 | # check for other specific broken implementations | |
1603 | CXXFLAGS="$CXXFLAGS $KRB5INCS" | |
1604 | LIBS="$LIBS $KRB5LIBS" | |
1605 | ||
1606 | AC_MSG_NOTICE([Try to find Kerberos headers in given path]) | |
1607 | AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_ext.h) | |
1608 | AC_CHECK_HEADERS(krb5.h com_err.h) | |
1609 | ||
1610 | SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H | |
1611 | if test "x$squid_cv_broken_krb5_h" = "xyes"; then | |
1612 | AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if Solaris krb5.h is broken for C++]) | |
1613 | AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.]) | |
1614 | AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512]) | |
1615 | AC_MSG_WARN([If you need Kerberos support you will have to patch]) | |
1616 | AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch]) | |
1617 | fi | |
1a22a39e | 1618 | SQUID_CHECK_KRB5_FUNCS |
1a22a39e | 1619 | fi |
75c5f82b AJ |
1620 | if test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then |
1621 | # Error only if Solaris flavour was detected while looking for required MIT Kerberos | |
1a22a39e | 1622 | AC_MSG_ERROR([Required Kerberos library not found]) |
75c5f82b AJ |
1623 | elif test "x$KRB5LIBS" = "x"; then |
1624 | with_solaris_krb5=no | |
1625 | with_mit_krb5=no | |
1a22a39e | 1626 | fi |
1a22a39e MM |
1627 | SQUID_STATE_ROLLBACK([squid_krb5_save]) |
1628 | fi | |
1629 | ||
75c5f82b AJ |
1630 | dnl User may specify Heimdal Kerberos is needed from a non-standard location |
1631 | AC_ARG_WITH(heimdal-krb5, | |
1632 | AS_HELP_STRING([--without-heimdal-krb5], | |
1633 | [Compile without Heimdal Kerberos support.]), [ | |
1634 | case "$with_heimdal_krb5" in | |
1635 | yes|no) | |
1636 | : # Nothing special to do here | |
1637 | ;; | |
1638 | *) | |
1639 | if test ! -d "$withval" ; then | |
1640 | AC_MSG_ERROR([--with-heimdal-krb5 path does not point to a directory]) | |
1641 | fi | |
1642 | if test -d "$with_heimdal_krb5/lib64" ; then | |
1643 | LIB_KRB5_PATH="-L$with_heimdal_krb5/lib64 -L$with_heimdal_krb5/lib" | |
1644 | else | |
1645 | LIB_KRB5_PATH="-L$with_heimdal_krb5/lib" | |
1646 | fi | |
1647 | CXXFLAGS="-I$with_heimdal_krb5/include $CXXFLAGS" | |
1648 | krb5confpath="$with_heimdal_krb5/bin" | |
1649 | with_heimdal_krb5=yes | |
1650 | esac | |
1651 | ]) | |
1652 | AH_TEMPLATE(USE_HEIMDAL_KRB5,[Heimdal Kerberos support is available]) | |
1653 | if test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"; then | |
1654 | # find installed libs via pkg-config or krb5-config | |
1655 | PKG_CHECK_EXISTS(heimdal-krb5, [squid_pc_krb5_name="heimdal-krb5"]) | |
1656 | if test "x$squid_pc_krb5_name" = "x"; then | |
1657 | PKG_CHECK_EXISTS(heimdal-gssapi, [squid_pc_krb5_name="heimdal-gssapi"]) | |
1658 | fi | |
297a2769 | 1659 | if test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"; then |
75c5f82b | 1660 | # Look for krb5-config (unless cross-compiling) |
c4b12583 | 1661 | AC_PATH_PROG(krb5_config,krb5-config,no,$krb5confpath) |
75c5f82b AJ |
1662 | if test "x$ac_cv_path_krb5_config" != "xno" ; then |
1663 | krb5confpath="`dirname $ac_cv_path_krb5_config`" | |
1664 | ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`" | |
95ee97e7 | 1665 | if test "x$with_heimdal_krb5" = "xyes" -a $ac_heimdal = 0; then |
75c5f82b AJ |
1666 | AC_MSG_ERROR([Could not find pkg-config or krb5-config for Heimdal Kerberos]) |
1667 | fi | |
1668 | else | |
1669 | if test "x$with_heimdal_krb5" = "xyes"; then | |
1670 | AC_MSG_ERROR([Could not find krb5-config in path]) | |
1671 | else | |
1672 | AC_MSG_WARN([Could not find krb5-config in path]) | |
1673 | with_heimdal_krb5=no | |
1674 | fi | |
1675 | fi | |
1676 | fi | |
1677 | fi | |
1678 | if test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"; then | |
1a22a39e MM |
1679 | SQUID_STATE_SAVE([squid_krb5_save]) |
1680 | LIBS="$LIBS $LIB_KRB5_PATH" | |
1681 | ||
1682 | # auto-detect using pkg-config | |
75c5f82b | 1683 | PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[ |
77f4953d AJ |
1684 | # look for krb5-config (unless cross-compiling) |
1685 | if test "$cross_compiling" = "no"; then | |
1686 | if test "x$krb5confpath" = "x" ; then | |
1687 | AC_PATH_PROG(krb5_config,krb5-config,no) | |
1688 | if test "x$ac_cv_path_krb5_config" != "xno" ; then | |
1689 | ac_krb5_config="$ac_cv_path_krb5_config" | |
1690 | fi | |
1691 | else | |
1692 | ac_krb5_config="$krb5confpath/krb5-config" | |
1a22a39e | 1693 | fi |
1a22a39e | 1694 | fi |
75c5f82b | 1695 | if test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"; then |
1a22a39e MM |
1696 | # Get libs, etc |
1697 | AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS]) | |
1698 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`" | |
1699 | LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`" | |
1700 | LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS" | |
1701 | LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS" | |
1702 | else | |
1703 | ## For some OS pkg-config is broken or unavailable. | |
1704 | ## Detect libraries the hard way. | |
b2bdde72 | 1705 | SQUID_STATE_SAVE([squid_heimdal_save]) |
87a4a80f | 1706 | missing_required= |
1a22a39e MM |
1707 | AC_MSG_NOTICE([Try to find Kerberos libraries in given path]) |
1708 | AC_CHECK_LIB(resolv, [main], [LIB_KRB5_LIBS="-lresolv $LIB_KRB5_LIBS"],[ | |
87a4a80f AJ |
1709 | AC_MSG_WARN([library 'resolv' is required for Heimdal Kerberos]) |
1710 | missing_required=yes | |
1a22a39e | 1711 | ]) |
b2bdde72 | 1712 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1713 | AC_CHECK_LIB(crypt, [main], [LIB_KRB5_LIBS="-lcrypt $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1714 | AC_MSG_WARN([library 'crypt' is required for Heimdal Kerberos]) |
1715 | missing_required=yes | |
1a22a39e | 1716 | ]) |
b2bdde72 | 1717 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1718 | AC_CHECK_LIB(roken, [main], [LIB_KRB5_LIBS="-lroken $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1719 | AC_MSG_WARN([library 'roken' is required for Heimdal Kerberos]) |
1720 | missing_required=yes | |
1a22a39e | 1721 | ]) |
b2bdde72 | 1722 | LIBS=$LIB_KRB5_LIBS |
1a22a39e MM |
1723 | AC_CHECK_LIB(heimbase, [main], [LIB_KRB5_LIBS="-lheimbase $LIB_KRB5_LIBS"],[ |
1724 | AC_MSG_WARN([library 'heimbase' may be required for Heimdal Kerberos]) | |
1725 | ]) | |
b2bdde72 | 1726 | LIBS=$LIB_KRB5_LIBS |
1a22a39e MM |
1727 | AC_CHECK_LIB(wind, [main], [LIB_KRB5_LIBS="-lwind $LIB_KRB5_LIBS"],[ |
1728 | AC_MSG_WARN([library 'wind' may be required for Heimdal Kerberos]) | |
1729 | ]) | |
b2bdde72 | 1730 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1731 | AC_CHECK_LIB(crypto, [main], [LIB_KRB5_LIBS="-lcrypto $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1732 | AC_MSG_WARN([library 'crypto' is required for Heimdal Kerberos]) |
1733 | missing_required=yes | |
1a22a39e | 1734 | ]) |
b2bdde72 | 1735 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1736 | AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1737 | AC_MSG_WARN([library 'com_err' is required for Heimdal Kerberos]) |
1738 | missing_required=yes | |
1a22a39e | 1739 | ]) |
b2bdde72 | 1740 | LIBS=$LIB_KRB5_LIBS |
1a22a39e MM |
1741 | AC_CHECK_LIB(hx509, [main], [LIB_KRB5_LIBS="-lhx509 $LIB_KRB5_LIBS"],[ |
1742 | AC_MSG_WARN([library 'hx509' may be required for Heimdal Kerberos]) | |
1743 | ]) | |
b2bdde72 | 1744 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1745 | AC_CHECK_LIB(asn1, [main], [LIB_KRB5_LIBS="-lasn1 $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1746 | AC_MSG_WARN([library 'asn1' is required for Heimdal Kerberos]) |
1747 | missing_required=yes | |
1a22a39e | 1748 | ]) |
b2bdde72 | 1749 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1750 | AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1751 | AC_MSG_WARN([library 'krb5' is required for Heimdal Kerberos]) |
1752 | missing_required=yes | |
1a22a39e | 1753 | ]) |
b2bdde72 | 1754 | LIBS=$LIB_KRB5_LIBS |
1a22a39e MM |
1755 | AC_CHECK_LIB(heimntlm, [main], [LIB_KRB5_LIBS="-lheimntlm $LIB_KRB5_LIBS"],[ |
1756 | AC_MSG_WARN([library 'heimntlm' may be required for Heimdal Kerberos]) | |
1757 | ]) | |
b2bdde72 | 1758 | LIBS=$LIB_KRB5_LIBS |
1a22a39e | 1759 | AC_CHECK_LIB(gssapi, [main], [LIB_KRB5_LIBS="-lgssapi $LIB_KRB5_LIBS"],[ |
87a4a80f AJ |
1760 | AC_MSG_WARN([library 'gssapi' is required for Heimdal Kerberos]) |
1761 | missing_required=yes | |
1a22a39e | 1762 | ]) |
b2bdde72 | 1763 | SQUID_STATE_ROLLBACK([squid_heimdal_save]) |
87a4a80f AJ |
1764 | if test "x$missing_required" = "xyes"; then |
1765 | LIB_KRB5_LIBS="" | |
1766 | fi | |
1a22a39e | 1767 | fi |
1a22a39e MM |
1768 | ]) |
1769 | if test "x$LIB_KRB5_LIBS" != "x"; then | |
1770 | KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS" | |
1771 | KRB5INCS="$LIB_KRB5_CFLAGS" | |
1772 | AC_DEFINE(USE_HEIMDAL_KRB5,1,[Heimdal Kerberos support is available]) | |
1773 | KRB5_FLAVOUR="Heimdal" | |
1774 | ||
1775 | # check for other specific broken implementations | |
1776 | CXXFLAGS="$CXXFLAGS $KRB5INCS" | |
1777 | LIBS="$LIBS $KRB5LIBS" | |
1778 | ||
1779 | AC_MSG_NOTICE([Try to find Kerberos headers in given path]) | |
1780 | AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h) | |
1781 | AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h) | |
1782 | ||
1783 | SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H | |
1784 | if test "x$squid_cv_broken_heimdal_krb5_h" = "xyes"; then | |
1785 | AC_DEFINE(HAVE_BROKEN_HEIMDAL_KRB5_H, 1, [Define to 1 if Heimdal krb5.h is broken for C++]) | |
1786 | fi | |
1a22a39e | 1787 | SQUID_CHECK_KRB5_FUNCS |
1a22a39e MM |
1788 | fi |
1789 | if test "x$KRB5LIBS" = "x"; then | |
a4f19899 | 1790 | if test "x$with_heimdal_krb5" = "xyes"; then |
75c5f82b AJ |
1791 | AC_MSG_ERROR([Required Heimdal Kerberos library not found]) |
1792 | else | |
1793 | AC_MSG_WARN([Heimdal Kerberos library not found]) | |
1794 | fi | |
1a22a39e | 1795 | fi |
1a22a39e MM |
1796 | SQUID_STATE_ROLLBACK([squid_krb5_save]) |
1797 | fi | |
1798 | ||
75c5f82b AJ |
1799 | dnl User may specify GNU gss is needed from a non-standard location |
1800 | AC_ARG_WITH(gnugss, | |
1801 | AS_HELP_STRING([--without-gnugss], | |
1802 | [Compile without the GNU gss libraries.]), [ | |
1803 | case "$with_gnugss" in | |
1804 | yes|no) | |
1805 | : # Nothing special to do here | |
1806 | ;; | |
1807 | *) | |
1808 | if test ! -d "$withval" ; then | |
1809 | AC_MSG_ERROR([--with-gnugss path does not point to a directory]) | |
1810 | fi | |
1811 | if test ! -d "$with_gnugss/lib64" ; then | |
1812 | LIB_KRB5_PATH="-L$with_gnugss/lib64 -L$with_gnugss/lib" | |
1813 | else | |
1814 | LIB_KRB5_PATH="-L$with_gnugss/lib" | |
1815 | fi | |
1816 | CXXFLAGS="-I$with_gnugss/include $CXXFLAGS" | |
1817 | krb5confpath= | |
1818 | with_gnugss=yes | |
1819 | esac | |
1820 | ]) | |
1821 | AH_TEMPLATE(USE_GNUGSS,[GNU gss support is available]) | |
1822 | if test "x$with_gnugss" != "xno" -a "x$KRB5LIBS" = "x"; then | |
1a22a39e MM |
1823 | SQUID_STATE_SAVE([squid_krb5_save]) |
1824 | LIBS="$LIBS $LIB_KRB5_PATH" | |
1825 | ||
1826 | # auto-detect using pkg-config | |
1827 | PKG_CHECK_MODULES([LIB_KRB5],[gss],,[ | |
1828 | ## For some OS pkg-config is broken or unavailable. | |
1829 | ## Detect libraries the hard way. | |
1830 | ||
1831 | AC_MSG_NOTICE([Try to find Kerberos libraries in given path]) | |
1832 | AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[ | |
75c5f82b | 1833 | AC_MSG_WARN([library 'com_err' is required for GNU Kerberos]) |
1a22a39e | 1834 | ]) |
1a22a39e MM |
1835 | ]) |
1836 | ||
1837 | if test "x$LIB_KRB5_LIBS" != "x"; then | |
1838 | KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS" | |
1839 | KRB5INCS="$LIB_KRB5_CFLAGS" | |
1840 | AC_DEFINE(USE_GNUGSS,1,[GNU Kerberos support is available]) | |
1841 | KRB5_FLAVOUR="GNU GSS" | |
1842 | ||
1843 | # check for other specific broken implementations | |
1844 | CXXFLAGS="$CXXFLAGS $KRB5INCS" | |
1845 | LIBS="$LIBS $KRB5LIBS" | |
1846 | ||
1847 | AC_MSG_NOTICE([Try to find Kerbeors headers in given path]) | |
1848 | AC_CHECK_HEADERS(gss.h) | |
1849 | ||
1850 | SQUID_CHECK_WORKING_GSSAPI | |
1851 | SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support]) | |
1852 | ||
1853 | SQUID_CHECK_SPNEGO_SUPPORT | |
1854 | SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support]) | |
1855 | ||
1856 | SQUID_CHECK_WORKING_KRB5 | |
1857 | SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support]) | |
1a22a39e MM |
1858 | fi |
1859 | if test "x$KRB5LIBS" = "x"; then | |
a4f19899 | 1860 | if test "x$with_gnugss" = "xyes"; then |
75c5f82b AJ |
1861 | AC_MSG_ERROR([Required GNU GSS Kerberos library not found]) |
1862 | else | |
1863 | AC_MSG_WARN([GNU GSS Kerberos library not found]) | |
1864 | fi | |
1a22a39e | 1865 | fi |
1a22a39e MM |
1866 | SQUID_STATE_ROLLBACK([squid_krb5_save]) |
1867 | fi | |
75c5f82b AJ |
1868 | |
1869 | if test "x$KRB5LIBS" != "x"; then | |
1a22a39e MM |
1870 | with_krb5=yes |
1871 | fi | |
1872 | AC_MSG_NOTICE([$KRB5_FLAVOUR Kerberos library support: ${with_krb5:=no} ${LIB_KRB5_PATH} ${LIB_KRB5_LIBS}]) | |
1873 | AC_SUBST(KRB5INCS) | |
1874 | AC_SUBST(KRB5LIBS) | |
1a22a39e | 1875 | |
8aafbbc1 | 1876 | dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked |
1a22a39e MM |
1877 | dnl only with Windows LDAP libraries using -lwldap32 |
1878 | case "$squid_host_os" in | |
1879 | mingw) | |
1880 | LDAPLIB="-lwldap32" | |
1881 | LBERLIB="" | |
1882 | ;; | |
1883 | *) | |
1884 | AC_CHECK_LIB(ldap, ldap_init, [LDAPLIB="-lldap"]) | |
1885 | dnl LDAP helpers need to know if -llber is needed or not | |
1886 | AC_CHECK_LIB(lber, ber_init, [LBERLIB="-llber"]) | |
1887 | dnl if no ldap lib found check for mozilla version | |
1888 | if test "x$ac_cv_lib_ldap_ldap_init" != x""yes; then | |
1889 | oLIBS=$LIBS | |
1890 | LIBS="$LIBPTHREADS" | |
1891 | AC_CHECK_LIB(ldap60, ldap_init, [LDAPLIB="-lldap60"]) | |
1892 | LIBS="$LDAPLIB $LIBPTHREADS" | |
1893 | AC_CHECK_LIB(prldap60, prldap_init, [LDAPLIB="-lprldap60 $LDAPLIB"]) | |
1894 | LIBS="$LDAPLIB $LIBPTHREADS" | |
1895 | AC_CHECK_LIB(ssldap60, ldapssl_init, [LDAPLIB="-lssldap60 $LDAPLIB"]) | |
1896 | LIBS=$oLIBS | |
1897 | fi | |
1898 | ||
1899 | AC_CHECK_HEADERS(ldap.h lber.h) | |
1900 | AC_CHECK_HEADERS(mozldap/ldap.h) | |
1901 | ||
1902 | dnl | |
1903 | dnl Check for LDAP_OPT_DEBUG_LEVEL | |
1904 | dnl | |
1905 | AC_MSG_CHECKING([for LDAP_OPT_DEBUG_LEVEL]) | |
1906 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
1907 | # include <ldap.h> | |
1908 | ]],[[ | |
1909 | int i=LDAP_OPT_DEBUG_LEVEL | |
1910 | ]])], | |
1911 | [ AC_MSG_RESULT(yes) ], | |
1912 | [ AC_MSG_RESULT(no) ]) | |
1913 | ||
1914 | dnl | |
1915 | dnl Check for working ldap | |
1916 | dnl | |
1917 | oLIBS=$LIBS | |
1918 | LIBS="$LDAPLIB $LBERLIB $LIBPTHREADS" | |
1919 | AC_MSG_CHECKING([for working ldap]) | |
1920 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ | |
1921 | # define LDAP_DEPRECATED 1 | |
1922 | # if HAVE_LDAP_H | |
1923 | # include <ldap.h> | |
1924 | # elif HAVE_MOZLDAP_LDAP_H | |
1925 | # include <mozldap/ldap.h> | |
1926 | # endif | |
1927 | int | |
1928 | main(void) | |
1929 | { | |
1930 | char host[]=""; | |
1931 | int port; | |
1932 | ||
1933 | ldap_init((const char *)&host, port); | |
1934 | ||
1935 | return 0; | |
1936 | } | |
1937 | ]])], | |
1938 | [ AC_DEFINE(HAVE_LDAP, 1, [LDAP support]) | |
1939 | AC_MSG_RESULT(yes) ], | |
1940 | [ AC_MSG_RESULT(no) ], | |
1941 | [ AC_MSG_RESULT(cross-compiler cant tell) ]) | |
1942 | LIBS=$oLIBS | |
1943 | ||
1944 | dnl | |
1945 | dnl Check for ldap vendor | |
1946 | dnl | |
1947 | AC_MSG_CHECKING([for OpenLDAP]) | |
1948 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ | |
1949 | # if HAVE_LDAP_H | |
1950 | # include <ldap.h> | |
1951 | # endif | |
1952 | # include <string.h> | |
1953 | int | |
1954 | main(void) | |
1955 | { | |
1956 | return strcmp(LDAP_VENDOR_NAME,"OpenLDAP"); | |
1957 | } | |
1958 | ]])], | |
1959 | [ AC_DEFINE(HAVE_OPENLDAP, 1, [OpenLDAP support]) | |
1960 | AC_MSG_RESULT(yes) ], | |
1961 | [ AC_MSG_RESULT(no) ], | |
1962 | [ AC_MSG_RESULT(cross-compiler cant tell) ]) | |
1963 | ||
1964 | AC_MSG_CHECKING([for Sun LDAP SDK]) | |
1965 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ | |
1966 | # if HAVE_LDAP_H | |
1967 | # include <ldap.h> | |
1968 | # endif | |
1969 | # include <string.h> | |
1970 | int | |
1971 | main(void) | |
1972 | { | |
1973 | return strcmp(LDAP_VENDOR_NAME,"Sun Microsystems Inc."); | |
1974 | } | |
1975 | ]])], | |
1976 | [ AC_DEFINE(HAVE_SUN_LDAP_SDK, 1, [Sun LDAP SDK support]) | |
1977 | AC_MSG_RESULT(yes) ], | |
1978 | [ AC_MSG_RESULT(no) ], | |
1979 | [ AC_MSG_RESULT(cross-compiler cant tell) ]) | |
1980 | ||
1981 | AC_MSG_CHECKING([for Mozilla LDAP SDK]) | |
1982 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ | |
1983 | # if HAVE_LDAP_H | |
1984 | # include <ldap.h> | |
1985 | # elif HAVE_MOZLDAP_LDAP_H | |
1986 | # include <mozldap/ldap.h> | |
1987 | # endif | |
1988 | # include <string.h> | |
1989 | int | |
1990 | main(void) | |
1991 | { | |
1992 | return strcmp(LDAP_VENDOR_NAME,"mozilla.org"); | |
1993 | } | |
1994 | ]])], | |
1995 | [ AC_DEFINE(HAVE_MOZILLA_LDAP_SDK, 1, [Mozilla LDAP SDK support]) | |
1996 | AC_MSG_RESULT(yes) ], | |
1997 | [ AC_MSG_RESULT(no)], | |
1998 | [ AC_MSG_RESULT(cross-compiler cant tell) ]) | |
1999 | ||
2000 | dnl | |
2001 | dnl Check for LDAP_REBINDPROC_CALLBACK | |
2002 | dnl | |
2003 | AC_MSG_CHECKING([for LDAP_REBINDPROC_CALLBACK]) | |
2004 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
2005 | # if HAVE_LDAP_H | |
2006 | # include <ldap.h> | |
2007 | # elif HAVE_MOZLDAP_LDAP_H | |
2008 | # include <mozldap/ldap.h> | |
2009 | # endif | |
2010 | ]],[[ | |
2011 | LDAP_REBINDPROC_CALLBACK ldap_rebind; | |
2012 | ]])], | |
2013 | [ AC_DEFINE(HAVE_LDAP_REBINDPROC_CALLBACK,1,[Define to 1 if you have LDAP_REBINDPROC_CALLBACK]) | |
2014 | AC_MSG_RESULT(yes) ], | |
2015 | [ AC_MSG_RESULT(no) ]) | |
2016 | ||
2017 | dnl | |
2018 | dnl Check for LDAP_REBIND_PROC | |
2019 | dnl | |
2020 | AC_MSG_CHECKING([for LDAP_REBIND_PROC]) | |
2021 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
2022 | # if HAVE_LDAP_H | |
2023 | # include <ldap.h> | |
2024 | # elif HAVE_MOZLDAP_LDAP_H | |
2025 | # include <mozldap/ldap.h> | |
2026 | # endif | |
2027 | ]],[[ | |
2028 | LDAP_REBIND_PROC ldap_rebind; | |
2029 | ]])], | |
2030 | [ AC_DEFINE(HAVE_LDAP_REBIND_PROC,1,[Define to 1 if you have LDAP_REBIND_PROC]) | |
2031 | AC_MSG_RESULT(yes) ], | |
2032 | [ AC_MSG_RESULT(no) ]) | |
2033 | ||
2034 | dnl | |
2035 | dnl Check for LDAP_REBIND_FUNCTION | |
2036 | dnl | |
2037 | AC_MSG_CHECKING([for LDAP_REBIND_FUNCTION]) | |
2038 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
2039 | # define LDAP_REFERRALS | |
2040 | # if HAVE_LDAP_H | |
2041 | # include <ldap.h> | |
2042 | # elif HAVE_MOZLDAP_LDAP_H | |
2043 | # include <mozldap/ldap.h> | |
2044 | # endif | |
2045 | ]],[[ | |
2046 | LDAP_REBIND_FUNCTION ldap_rebind; | |
2047 | ]])], | |
2048 | [ AC_DEFINE(HAVE_LDAP_REBIND_FUNCTION,1,[Define to 1 if you have LDAP_REBIND_FUNCTION]) | |
2049 | AC_MSG_RESULT(yes) ], | |
2050 | [ AC_MSG_RESULT(no) ]) | |
2051 | ||
2052 | dnl | |
2053 | dnl Check for LDAP_SCOPE_DEFAULT | |
2054 | dnl | |
2055 | AC_MSG_CHECKING([for LDAP_SCOPE_DEFAULT]) | |
2056 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
2057 | # if HAVE_LDAP_H | |
2058 | # include <ldap.h> | |
2059 | # elif HAVE_MOZLDAP_LDAP_H | |
2060 | # include <mozldap/ldap.h> | |
2061 | # endif | |
2062 | ]],[[ | |
2063 | int i=LDAP_SCOPE_DEFAULT; | |
2064 | ]])], | |
2065 | [ AC_DEFINE(HAVE_LDAP_SCOPE_DEFAULT,1,[Define to 1 if you have LDAP_SCOPE_DEFAULT]) | |
2066 | AC_MSG_RESULT(yes) ], | |
2067 | [ AC_MSG_RESULT(no) ]) | |
2068 | ||
2069 | dnl | |
2070 | dnl Check for ldap_url_desc.lud_scheme | |
2071 | dnl | |
2072 | AC_CHECK_MEMBER(struct ldap_url_desc.lud_scheme, | |
2073 | AC_DEFINE(HAVE_LDAP_URL_LUD_SCHEME,1, | |
2074 | [Define to 1 if you have LDAPURLDesc.lud_scheme]),,[#include <ldap.h>]) | |
2075 | ||
2076 | dnl | |
2077 | dnl Check for ldapssl_client_init | |
2078 | dnl | |
2079 | AC_CHECK_LIB(ldap,ldapssl_client_init, | |
2080 | AC_DEFINE(HAVE_LDAPSSL_CLIENT_INIT,1,[Define to 1 if you have ldapssl_client_init]),) | |
2081 | ||
2082 | dnl | |
2083 | dnl Check for ldap_url_desc2str | |
2084 | dnl | |
2085 | AC_CHECK_LIB(ldap,ldap_url_desc2str, | |
2086 | AC_DEFINE(HAVE_LDAP_URL_DESC2STR,1,[Define to 1 if you have ldap_url_desc2str]),) | |
2087 | ||
2088 | dnl | |
2089 | dnl Check for ldap_url_parse | |
2090 | dnl | |
2091 | AC_CHECK_LIB(ldap,ldap_url_parse, | |
2092 | AC_DEFINE(HAVE_LDAP_URL_PARSE,1,[Define to 1 if you have ldap_url_parse]),) | |
2093 | ||
2094 | dnl | |
2095 | dnl Check for ldap_start_tls_s | |
2096 | dnl | |
2097 | AC_CHECK_LIB(ldap,ldap_start_tls_s, | |
2098 | AC_DEFINE(HAVE_LDAP_START_TLS_S,1,[Define to 1 if you have ldap_start_tls_s]),) | |
2099 | ;; | |
2100 | esac | |
2101 | ||
2102 | AC_SUBST(LDAPLIB) | |
2103 | AC_SUBST(LBERLIB) | |
2104 | ||
6fa8c664 MM |
2105 | AC_ARG_WITH(systemd, |
2106 | AS_HELP_STRING([--without-systemd], | |
2107 | [Do not use systemd API to send start-up completion | |
2108 | notification. Default: auto-detect]), [ | |
2109 | case "$with_systemd" in | |
2110 | yes|no) | |
2111 | : # Nothing special to do here | |
2112 | ;; | |
2113 | *) | |
2114 | if test ! -d "$withval" ; then | |
2115 | AC_MSG_ERROR([--with-systemd path does not point to a directory]) | |
2116 | fi | |
2117 | SYSTEMD_PATH="-L$with_systemd/lib" | |
2118 | CPPFLAGS="-I$with_systemd/include $CPPFLAGS" | |
2119 | esac | |
2120 | ]) | |
2121 | AH_TEMPLATE(USE_SYSTEMD,[systemd support is available]) | |
2122 | if test "x$with_systemd" != "xno" -a "x$squid_host_os" = "xlinux"; then | |
2123 | SQUID_STATE_SAVE(squid_systemd_state) | |
2124 | ||
2125 | # User may have provided a custom location for systemd. Otherwise... | |
2126 | LIBS="$LIBS $SYSTEMD_PATH" | |
2127 | ||
2128 | # auto-detect using pkg-config | |
2129 | PKG_CHECK_MODULES(SYSTEMD,[libsystemd],,[ | |
2130 | # systemd < 209 | |
2131 | PKG_CHECK_MODULES(SYSTEMD,[libsystemd-daemon],,[:]) | |
2132 | ]) | |
2133 | ||
2134 | AC_CHECK_HEADERS(systemd/sd-daemon.h) | |
2135 | ||
2136 | SQUID_STATE_ROLLBACK(squid_systemd_state) #de-pollute LIBS | |
2137 | ||
2138 | if test "x$with_systemd" = "xyes" -a "x$SYSTEMD_LIBS" = "x"; then | |
2139 | AC_MSG_ERROR([Required systemd library not found]) | |
2140 | fi | |
2141 | if test "x$SYSTEMD_LIBS" != "x" ; then | |
2142 | CXXFLAGS="$SYSTEMD_CFLAGS $CXXFLAGS" | |
2143 | AC_DEFINE(USE_SYSTEMD,1,[systemd support is available]) | |
2144 | else | |
2145 | with_systemd=no | |
2146 | fi | |
2147 | fi | |
2148 | AC_MSG_NOTICE([systemd library support: ${with_systemd:=auto} ${SYSTEMD_PATH} ${SYSTEMD_LIBS}]) | |
2149 | ||
02749868 | 2150 | AC_ARG_ENABLE(forw-via-db, |
47d80734 FC |
2151 | AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [ |
2152 | SQUID_YESNO([$enableval],[unrecognized argument to --enable-forw-via-db: $enableval]) | |
02749868 | 2153 | ]) |
21f6708d | 2154 | SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no}, |
9676633b FC |
2155 | [Enable Forw/Via database]) |
2156 | AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db]) | |
02749868 | 2157 | |
6cfa8966 | 2158 | AC_ARG_ENABLE(cache-digests, |
47d80734 | 2159 | AS_HELP_STRING([--enable-cache-digests], |
9676633b FC |
2160 | [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]), |
2161 | [ | |
2162 | SQUID_YESNO($enableval, | |
2163 | [unrecognized argument to --enable-cache-digests: $enableval]) | |
484f2ebc | 2164 | ]) |
0067eb06 | 2165 | SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no}, |
47d80734 | 2166 | [Use Cache Digests for locating objects in neighbor caches.]) |
9676633b | 2167 | AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests]) |
47d80734 | 2168 | |
484f2ebc | 2169 | |
9676633b FC |
2170 | ################################ |
2171 | # check for netio plugin stuff # | |
2172 | ################################ | |
2173 | dnl order of these options handling is relevant in case the user | |
2174 | dnl supplies more than one --enable option. Options handled later | |
2175 | dnl override those handled earlier for io loop method manual override | |
2176 | AC_ARG_ENABLE(select, | |
2177 | AS_HELP_STRING([--disable-select],[Disable select(2) support.]), | |
2178 | [ | |
2179 | SQUID_YESNO($enableval,[--disable-select takes no extra argument]) | |
39145d19 AJ |
2180 | if test "x$enableval" = "xyes"; then |
2181 | if test "x$squid_host_os" = "xmingw"; then | |
2182 | squid_opt_io_loop_engine="select_win32" | |
2183 | else | |
2184 | squid_opt_io_loop_engine="select" | |
2185 | fi | |
2186 | fi | |
9676633b FC |
2187 | ]) |
2188 | AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}]) | |
cd748f27 | 2189 | |
9bb83c8b | 2190 | AC_ARG_ENABLE(poll, |
62979ab1 | 2191 | AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]), |
1b3db6d9 | 2192 | [ |
9676633b | 2193 | SQUID_YESNO($enableval,[--disable-poll takes no extra argument]) |
fcabe077 | 2194 | test "x$enableval" = "xyes" && squid_opt_io_loop_engine="poll" |
9bb83c8b | 2195 | ]) |
9676633b | 2196 | AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}]) |
9bb83c8b | 2197 | |
1b3db6d9 | 2198 | AC_ARG_ENABLE(kqueue, |
26d50fd2 AJ |
2199 | AS_HELP_STRING([--disable-kqueue], |
2200 | [Disable kqueue(2) support.]), [ | |
9676633b | 2201 | SQUID_YESNO($enableval,[--enable-kqueue takes no extra argument]) |
1b3db6d9 | 2202 | ]) |
26d50fd2 AJ |
2203 | if test "x${enable_kqueue:=auto}" != "xno" ; then |
2204 | AC_CHECK_HEADERS([sys/event.h],[],[ | |
2205 | if test "x${enable_kqueue}" = "xyes" ; then | |
2206 | AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) | |
2207 | fi | |
2208 | ]) | |
2209 | AC_CHECK_FUNCS(kqueue,[],[ | |
2210 | if test "x${enable_kqueue}" = "xyes" ; then | |
2211 | AC_MSG_ERROR([kqueue support missing in libc library.]) | |
2212 | fi | |
2213 | ]) | |
2214 | if test "x$ac_cv_func_kqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes" ; then | |
2215 | squid_opt_io_loop_engine="kqueue" | |
2216 | else | |
2217 | enable_kqueue="no" | |
2218 | fi | |
9676633b | 2219 | fi |
26d50fd2 | 2220 | AC_MSG_NOTICE([enabling kqueue for net I/O: ${enable_kqueue:=auto}]) |
1b3db6d9 | 2221 | |
a46d2c0e | 2222 | dnl Enable epoll() |
a46d2c0e | 2223 | AC_ARG_ENABLE(epoll, |
62979ab1 | 2224 | AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]), |
a46d2c0e | 2225 | [ |
9676633b | 2226 | SQUID_YESNO($enableval,[--disable-epoll takes no extra argument]) |
fcabe077 | 2227 | test "x$enableval" = "xyes" && squid_opt_io_loop_engine="epoll" |
a46d2c0e | 2228 | ]) |
9676633b | 2229 | AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}]) |
2ca8b332 | 2230 | |
9676633b FC |
2231 | # auto-detect and verify epoll header and library present and working |
2232 | # logic mapping and loop method selection are performed later | |
fcabe077 | 2233 | if test "x$enable_epoll" != "xno" ; then |
2ca8b332 | 2234 | |
9676633b FC |
2235 | # check if libs are needed to support epoll |
2236 | # note: this code block seems quite generic. Could it be extracted | |
2237 | # into a squid specific configure function? | |
af1e01a8 | 2238 | SQUID_STATE_SAVE(squid_epoll_state) |
9676633b | 2239 | AC_SEARCH_LIBS(epoll_ctl,[epoll]) |
fcabe077 | 2240 | if test "x$ac_cv_search_epoll_ctl" = "xno" ; then |
9676633b | 2241 | enable_epoll=no #disable. Needed code not found |
fcabe077 | 2242 | elif test "x$ac_cv_search_epoll_ctl" = "xnone required" ; then |
9676633b FC |
2243 | EPOLL_LIBS="" |
2244 | else | |
2245 | EPOLL_LIBS=$ac_cv_search_epoll_ctl | |
2246 | fi | |
2247 | AC_SUBST(EPOLL_LIBS) | |
2248 | SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS | |
a46d2c0e | 2249 | |
9676633b | 2250 | # epoll requires sys/epoll.h |
98d13964 | 2251 | AC_CHECK_HEADERS([sys/epoll.h]) |
ad32c661 AJ |
2252 | |
2253 | dnl Verify that epoll really works | |
dcac6885 | 2254 | if test "x$ac_cv_search_epoll_ctl" != 'xno' ; then |
af1e01a8 | 2255 | SQUID_CHECK_EPOLL |
ad32c661 | 2256 | fi |
2ca8b332 | 2257 | |
fcabe077 | 2258 | if test "x$enable_epoll" = "xyes" -a "x$squid_cv_epoll_works" = "xno" ; then |
2ca8b332 AJ |
2259 | AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.]) |
2260 | fi | |
ad32c661 | 2261 | fi |
a46d2c0e | 2262 | |
a1ad2f9b AJ |
2263 | dnl Enable /dev/poll |
2264 | AC_ARG_ENABLE(devpoll, | |
2265 | AS_HELP_STRING([--disable-devpoll],[Disable Solaris /dev/poll support.]), | |
2266 | [ | |
2267 | SQUID_YESNO($enableval,[--disable-devpoll takes no extra argument]) | |
2268 | test "x$enableval" = "xyes" && squid_opt_io_loop_engine="devpoll" | |
2269 | ]) | |
2270 | AC_MSG_NOTICE([enabling /dev/poll for net I/O: ${enable_devpoll:=auto}]) | |
2271 | ||
2272 | ## auto-detect and verify devpoll header and library present and working | |
2273 | if test "x$enable_devpoll" != "xno"; then | |
2274 | ||
2275 | # /dev/poll requires ioctl() and write() | |
2276 | AC_CHECK_FUNCS(ioctl) | |
2277 | AC_CHECK_FUNCS(write) | |
2278 | ||
2279 | # /dev/poll requires sys/devpoll.h | |
2280 | AC_CHECK_HEADERS([sys/devpoll.h],,[ | |
2281 | if test "x$enable_devpoll" = "xyes"; then | |
2282 | AC_MSG_ERROR([--enable-devpoll specified but /dev/poll headers not found]) | |
2283 | fi | |
2284 | enable_devpoll=no]) | |
2285 | ||
2286 | # Verify that /dev/poll really works | |
2287 | if test "x$enable_devpoll" != 'xno' ; then | |
2288 | SQUID_CHECK_DEVPOLL | |
2289 | fi | |
2290 | ||
2291 | if test "x$enable_devpoll" = "xyes" -a "x$squid_cv_devpoll_works" = "xno" ; then | |
2292 | AC_MSG_ERROR([/dev/poll does not work. Force-enabling it is not going to help.]) | |
2293 | fi | |
2294 | fi | |
2295 | ||
9676633b | 2296 | |
72fd085a | 2297 | AC_ARG_ENABLE(http-violations, |
af1e01a8 FC |
2298 | AS_HELP_STRING([--disable-http-violations], |
2299 | [This allows you to remove code which is known to | |
47d80734 | 2300 | violate the HTTP protocol specification.]), [ |
9676633b FC |
2301 | SQUID_YESNO([$enableval], |
2302 | [unrecognized argument to --disable-http-violations: $enableval]) | |
72fd085a | 2303 | ]) |
626096be | 2304 | SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes}, |
47d80734 | 2305 | [Define to enable code which volates the HTTP standard specification]) |
9676633b | 2306 | AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations]) |
72fd085a | 2307 | |
47d80734 | 2308 | # IPFW Transparent Proxy |
68075fad | 2309 | AC_ARG_ENABLE(ipfw-transparent, |
1d26e252 FC |
2310 | AS_HELP_STRING([--enable-ipfw-transparent], |
2311 | [Enable Transparent Proxy support for systems | |
47d80734 | 2312 | using FreeBSD IPFW-style firewalling.]), [ |
1d26e252 FC |
2313 | SQUID_YESNO([$enableval], |
2314 | [unrecognized argument to --enable-ipfw-transparent: $enableval]) | |
68075fad | 2315 | ]) |
0067eb06 | 2316 | SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no}, |
2277004e | 2317 | [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.]) |
1d26e252 | 2318 | AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent]) |
68075fad | 2319 | |
47d80734 | 2320 | # IP-Filter Transparent Proxy |
5cafc1d6 | 2321 | AC_ARG_ENABLE(ipf-transparent, |
2277004e | 2322 | AS_HELP_STRING([--enable-ipf-transparent], |
1d26e252 FC |
2323 | [Enable Transparent Proxy support using IPFilter-style firewalling]), [ |
2324 | SQUID_YESNO([$enableval], | |
2325 | [unrecognized argument to --enable-ipf-transparent: $enableval]) | |
5cafc1d6 | 2326 | ]) |
be0c7ff0 | 2327 | #will be AC_DEFINEd later, after checking for appropriate infrastructure |
4bd144d2 FC |
2328 | #IPF currently broken. Default-disabled for now. |
2329 | AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}]) | |
5cafc1d6 | 2330 | |
2b0dd4ac | 2331 | dnl Enable PF Transparent Proxy |
2332 | AC_ARG_ENABLE(pf-transparent, | |
2277004e | 2333 | AS_HELP_STRING([--enable-pf-transparent], |
47d80734 | 2334 | [Enable Transparent Proxy support for systems using PF network address redirection.]), [ |
1d26e252 FC |
2335 | SQUID_YESNO([$enableval], |
2336 | [unrecognized argument to --enable-pf-transparent: $enableval]) | |
2b0dd4ac | 2337 | ]) |
be0c7ff0 | 2338 | #will be AC_DEFINEd later, after checking for appropriate infrastructure |
b2192042 AJ |
2339 | AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=no}]) |
2340 | ||
2341 | dnl Enable /dev/pf support for older PF Transparent Proxy systems (OpenBSD 4.x and older) | |
2342 | AC_ARG_WITH(nat-devpf, | |
2343 | AS_HELP_STRING([--with-nat-devpf], | |
2344 | [Enable /dev/pf support for NAT on older OpenBSD and FreeBSD kernels.]), [ | |
2345 | SQUID_YESNO([$enableval], | |
2346 | [unrecognized argument to --with-nat-devpf: $enableval]) | |
2347 | ]) | |
2348 | #will be AC_DEFINEd later, after checking for appropriate infrastructure | |
2349 | AC_MSG_NOTICE([NAT lookups via /dev/pf: ${with_nat_devpf:=no}]) | |
2b0dd4ac | 2350 | |
4bd144d2 | 2351 | # Linux Netfilter Transparent Proxy |
d852fbad | 2352 | AC_ARG_ENABLE(linux-netfilter, |
20ad76ab | 2353 | AS_HELP_STRING([--enable-linux-netfilter], |
96f08e2d | 2354 | [Enable Transparent Proxy support for Linux (Netfilter)]), [ |
4bd144d2 FC |
2355 | SQUID_YESNO([$enableval], |
2356 | [unrecognized argument to --enable-linux-netfilter: $enableval]) | |
d852fbad | 2357 | ]) |
4bd144d2 | 2358 | AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}]) |
be0c7ff0 | 2359 | #will be AC_DEFINEd later, after checking for appropriate infrastructure |
d852fbad | 2360 | |
425de4c8 AJ |
2361 | |
2362 | dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking) | |
11e8cfe3 | 2363 | dnl squid_opt_netfilterconntrack is set only when option is explicity specified |
425de4c8 AJ |
2364 | AC_ARG_WITH(netfilter-conntrack, |
2365 | AS_HELP_STRING([--without-netfilter-conntrack], | |
2366 | [Do not use Netfilter conntrack libraries for packet marking. | |
2367 | A path to alternative library location may be specified by | |
2368 | using --with-netfilter-conntrack=PATH. Default: auto-detect.]), [ | |
f4f6c2e0 AJ |
2369 | case "$with_netfilter_conntrack" in |
2370 | yes|no) | |
11e8cfe3 | 2371 | squid_opt_netfilterconntrack=$with_netfilter_conntrack |
f4f6c2e0 AJ |
2372 | ;; |
2373 | *) | |
2374 | if test ! -d "$withval" ; then | |
fc209a6a | 2375 | AC_MSG_ERROR([--with-netfilter-conntrack path does not point to a directory]) |
f4f6c2e0 AJ |
2376 | fi |
2377 | squid_opt_netfilterconntrackpath=$withval | |
2378 | LDFLAGS="-L$squid_opt_netfilterconntrackpath/lib $LDFLAGS" | |
2379 | CPPFLAGS="-I$squid_opt_netfilterconntrackpath/include $CPPFLAGS" | |
425de4c8 | 2380 | with_netfilter_conntrack=yes |
11e8cfe3 | 2381 | squid_opt_netfilterconntrack=yes |
f4f6c2e0 | 2382 | esac |
425de4c8 | 2383 | ]) |
f4f6c2e0 AJ |
2384 | AC_MSG_NOTICE([Linux Netfilter Conntrack support requested: ${with_netfilter_conntrack:=auto}]) |
2385 | if test "x$with_netfilter_conntrack" != "xno"; then | |
2386 | AC_SEARCH_LIBS([nfct_query], [netfilter_conntrack],,[ | |
2387 | if test x"$with_netfilter_conntrack" = "xyes"; then | |
2388 | AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack library not found]) | |
425de4c8 | 2389 | fi |
f4f6c2e0 | 2390 | with_netfilter_conntrack=no]) |
425de4c8 | 2391 | AC_CHECK_HEADERS([libnetfilter_conntrack/libnetfilter_conntrack.h \ |
f4f6c2e0 AJ |
2392 | libnetfilter_conntrack/libnetfilter_conntrack_tcp.h],,[ |
2393 | if test x"$with_netfilter_conntrack" = "xyes"; then | |
2394 | AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack headers not found]) | |
2395 | fi | |
2396 | with_netfilter_conntrack=no]) | |
88a2a8c6 AJ |
2397 | # If nothing is broken; enable the libraries usage. |
2398 | if test "x$with_netfilter_conntrack" != "xno"; then | |
2399 | with_netfilter_conntrack=yes | |
2400 | fi | |
425de4c8 AJ |
2401 | fi |
2402 | ||
2403 | ||
bb7b5fd0 | 2404 | dnl Enable Large file support |
2df6213e | 2405 | buildmodel="" |
2277004e | 2406 | squid_opt_enable_large_files=no |
2df6213e | 2407 | |
2408 | AC_ARG_WITH(large-files, | |
507ca601 FC |
2409 | AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]), [ |
2410 | if test "x$withval" = "xyes"; then | |
2411 | squid_opt_enable_large_files=yes | |
bb7b5fd0 | 2412 | fi |
2413 | ]) | |
2414 | ||
2df6213e | 2415 | dnl UNIX Build environment |
be0c7ff0 | 2416 | dnl AS_HELP_STRING is not suited here because it cannot to specify newlines |
2df6213e | 2417 | AC_ARG_WITH(build-environment, |
507ca601 FC |
2418 | AS_HELP_STRING([--with-build-environment=model], |
2419 | [The build environment to use. Normally one of | |
2420 | POSIX_V6_ILP32_OFF32 (32 bits), | |
2421 | POSIX_V6_ILP32_OFFBIG (32 bits with large file support), | |
2422 | POSIX_V6_LP64_OFF64 (64 bits), | |
2423 | POSIX_V6_LPBIG_OFFBIG (large pointers and files), | |
2424 | XBS5_ILP32_OFF32 i(legacy, 32 bits), | |
2425 | XBS5_ILP32_OFFBIG (legacy, 32 bits with large file support), | |
2426 | XBS5_LP64_OFF64 (legacy, 64 bits), | |
2427 | XBS5_LPBIG_OFFBIG (legacy, large pointers and files) | |
2428 | or default (The default for your OS)]), [ | |
2429 | case "$withval" in | |
2df6213e | 2430 | yes|no) |
507ca601 FC |
2431 | AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf]) |
2432 | ;; | |
2df6213e | 2433 | *) |
507ca601 FC |
2434 | buildmodel="$withval" |
2435 | ;; | |
2436 | esac | |
2df6213e | 2437 | ]) |
2438 | ||
228332d3 FC |
2439 | #hack. Let's early-detect sizeof(long) |
2440 | AC_CHECK_SIZEOF(long) | |
2441 | ||
fcabe077 | 2442 | if test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"; then |
2277004e FC |
2443 | for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do |
2444 | if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then | |
2445 | buildmodel=$model | |
2446 | break | |
2447 | fi | |
2448 | done | |
fcabe077 | 2449 | if test "x$buildmodel" = "x"; then |
2277004e FC |
2450 | AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64]) |
2451 | fi | |
9b8002de | 2452 | fi |
0c0d381b | 2453 | if test "x$buildmodel" = "xdefault" -o "x$buildmodel" = "x"; then |
228332d3 FC |
2454 | # define _FILE_OFFSET_BITS if requested and needed |
2455 | if test "x$squid_opt_enable_large_files" = "xyes" -a $ac_cv_sizeof_long -le 4 ; then | |
507ca601 FC |
2456 | AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64]) |
2457 | CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS" | |
2458 | CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS" | |
2459 | fi | |
2460 | else | |
2461 | AC_MSG_NOTICE([Using $buildmodel build environment]) | |
2462 | if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then | |
2463 | : # All fine | |
2464 | else | |
2465 | AC_MSG_ERROR(Build environment $buildmodel not known to getconf.) | |
2466 | fi | |
2467 | CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS" | |
2468 | CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS" | |
2469 | LIBS="`getconf ${buildmodel}_LIBS` $LIBS" | |
2470 | LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS" | |
941c31f3 | 2471 | if test "x$squid_host_os" = "xsolaris" ; then |
2277004e FC |
2472 | |
2473 | # On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and | |
2474 | # for LDFLAGS -xarch=generic64, but: | |
2475 | # "-Xa" is supported only by Sun cc, so we need to remove it when using gcc | |
2476 | # For gcc "-xarch=generic64" must be replaced with "-m64" | |
2477 | # The 'sun' define is needed by ipfilter includes, so we must remove "-Usun" | |
fcabe077 | 2478 | if test "x$GCC" = "xyes"; then |
2277004e FC |
2479 | AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host]) |
2480 | CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`" | |
2481 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`" | |
2482 | AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host]) | |
2483 | CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`" | |
2484 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`" | |
2485 | LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`" | |
2486 | fi | |
2487 | AC_MSG_NOTICE([Removing -Usun on $host]) | |
2488 | CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`" | |
2489 | CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`" | |
2490 | fi | |
507ca601 | 2491 | fi |
2df6213e | 2492 | |
5d620373 | 2493 | dnl Enable Leak Finding Functions |
2494 | AC_ARG_ENABLE(leakfinder, | |
47d80734 FC |
2495 | AS_HELP_STRING([--enable-leakfinder], |
2496 | [Enable Leak Finding code. Enabling this alone does nothing; | |
2497 | you also have to modify the source code to use the leak | |
2498 | finding functions. Probably Useful for hackers only.]), [ | |
89f640aa FC |
2499 | SQUID_YESNO([$enableval], |
2500 | [unrecognized argument to --enable-leakfinder: $enableval]) | |
5d620373 | 2501 | ]) |
89f640aa FC |
2502 | AC_MSG_NOTICE([Leak Finder enabled: ${enable_leakfinder:=no}]) |
2503 | SQUID_DEFINE_BOOL(USE_LEAKFINDER,$enable_leakfinder, | |
47d80734 | 2504 | [Enable code for assisting in finding memory leaks. Not for the faint of heart]) |
8aafbbc1 | 2505 | AM_CONDITIONAL(ENABLE_LEAKFINDER, [test "x$enable_leakfinder" = "xyes"]) |
47d80734 | 2506 | |
5d620373 | 2507 | |
3d674977 | 2508 | AC_ARG_ENABLE(follow-x-forwarded-for, |
6ec005b5 FC |
2509 | AS_HELP_STRING([--enable-follow-x-forwarded-for], |
2510 | [Enable support for following the X-Forwarded-For | |
19b4777c FC |
2511 | HTTP header to try to find the IP address of the |
2512 | original or indirect client when a request has | |
8075a4da | 2513 | been forwarded through other proxies.]), [ |
6ec005b5 FC |
2514 | SQUID_YESNO([$enableval], |
2515 | [unrecognized argument to --enable-follow-x-forwarded-for: $enableval]) | |
8075a4da | 2516 | ]) |
6ec005b5 | 2517 | AC_MSG_NOTICE([Support for X-Forwarded-For enabled: ${enable_follow_x_forwarded_for:=yes}]) |
3a5af257 | 2518 | SQUID_DEFINE_BOOL(FOLLOW_X_FORWARDED_FOR,$enable_follow_x_forwarded_for, |
47d80734 | 2519 | [Enable following X-Forwarded-For headers]) |
3d674977 | 2520 | |
3898f57f | 2521 | AC_ARG_ENABLE(ident-lookups, |
8075a4da | 2522 | AS_HELP_STRING([--disable-ident-lookups], |
47d80734 FC |
2523 | [Remove code that supports performing Ident (RFC 931) lookups.]), [ |
2524 | SQUID_YESNO([$enableval],[unrecognized argument to --disable-ident-lookups: $enableval]) | |
8075a4da | 2525 | ]) |
6c5dc16a FC |
2526 | AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}]) |
2527 | SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups]) | |
3898f57f | 2528 | |
9d798391 | 2529 | dnl Select Default hosts file location |
2530 | AC_ARG_ENABLE(default-hostsfile, | |
8ea232f5 FC |
2531 | AS_HELP_STRING([--enable-default-hostsfile=path], |
2532 | [Select default location for hosts file. | |
75eaac6c FC |
2533 | See hosts_file directive in squid.conf for details]), [ |
2534 | if test "x$enableval" != "xnone" -a "x$enableval" != "xno" ; then | |
2535 | if test \! -f "$enableval"; then | |
2536 | AC_MSG_WARN([Unable to find file $enableval. I hope you know what you are doing.]) | |
20ad76ab | 2537 | fi |
75eaac6c FC |
2538 | squid_opt_default_hosts=$enableval |
2539 | else | |
2540 | squid_opt_default_hosts="none" | |
2541 | fi | |
2542 | ]) | |
2543 | AC_MSG_NOTICE([Default hosts file set to: ${squid_opt_default_hosts:=/etc/hosts}]) | |
2544 | DEFAULT_HOSTS=$squid_opt_default_hosts | |
2545 | AC_SUBST(DEFAULT_HOSTS) | |
9d798391 | 2546 | |
47d80734 | 2547 | # Select auth schemes modules to build |
94439e4e | 2548 | AC_ARG_ENABLE(auth, |
26ffc057 FC |
2549 | AS_HELP_STRING([--enable-auth], |
2550 | [Build global support for authentication. The list of schemes | |
2551 | and helpers to be enabled is defined elsewhere]), [ | |
2552 | SQUID_YESNO([$enableval], | |
2553 | [unrecognized argument to --enable-auth: $enableval]) | |
94439e4e | 2554 | ]) |
26ffc057 | 2555 | AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}]) |
2f1431ea AJ |
2556 | SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,[Enable support for authentication]) |
2557 | AM_CONDITIONAL(ENABLE_AUTH, test "x$enable_auth" != "xno") | |
26ffc057 | 2558 | AUTH_MODULES="" |
dcbfe1a3 | 2559 | require_smblib="no" |
26ffc057 FC |
2560 | |
2561 | AC_ARG_ENABLE(auth-basic, | |
2562 | AS_HELP_STRING([--enable-auth-basic="list of helpers"], | |
2563 | [Enable the basic authentication scheme, and build the specified helpers. | |
2564 | Not providing an explicit list of helpers will attempt build of | |
2565 | all possible helpers. Default is to do so. | |
2566 | To disable the basic authentication scheme, use --disable-auth-basic. | |
d9655720 | 2567 | To enable but build no helpers, specify "none". |
03901cf8 | 2568 | To see available helpers, see the src/auth/basic/ directory. ]),[ |
26ffc057 FC |
2569 | #nothing to do really |
2570 | ]) | |
03901cf8 | 2571 | m4_include([src/auth/basic/helpers.m4]) |
94439e4e | 2572 | |
12daeef6 AJ |
2573 | AC_ARG_ENABLE(auth-digest, |
2574 | AS_HELP_STRING([--enable-auth-digest="list of helpers"], | |
2575 | [Enable the Digest authentication scheme, and build the specified helpers. | |
26ffc057 FC |
2576 | Not providing an explicit list of helpers will attempt build of |
2577 | all possible helpers. Default is to do so. | |
12daeef6 | 2578 | To disable the Digest authentication scheme, use --disable-auth-digest. |
26ffc057 | 2579 | To enable but build no helpers, specify "none". |
d4d7f6dd | 2580 | To see available helpers, see the src/auth/digest/ directory. ]),[ |
12daeef6 | 2581 | #nothing to do, really |
380f0a87 | 2582 | ]) |
d4d7f6dd | 2583 | m4_include([src/auth/digest/helpers.m4]) |
94439e4e | 2584 | |
26ffc057 FC |
2585 | AC_ARG_ENABLE(auth-negotiate, |
2586 | AS_HELP_STRING([--enable-auth-negotiate="list of helpers"], | |
16c02b14 | 2587 | [Enable the Negotiate authentication scheme, and build the specified |
26ffc057 FC |
2588 | helpers. |
2589 | Not providing an explicit list of helpers will attempt build of | |
2590 | all possible helpers. Default is to do so. | |
16c02b14 | 2591 | To disable the Negotiate authentication scheme, |
26ffc057 FC |
2592 | use --disable-auth-negotiate. |
2593 | To enable but build no helpers, specify "none". | |
16c02b14 | 2594 | To see available helpers, see the src/auth/negotiate/ directory. ]),[ |
26ffc057 | 2595 | #nothing to do, really |
6e785d85 | 2596 | ]) |
16c02b14 | 2597 | m4_include([src/auth/negotiate/helpers.m4]) |
6e785d85 | 2598 | |
12daeef6 AJ |
2599 | AC_ARG_ENABLE(auth-ntlm, |
2600 | AS_HELP_STRING([--enable-auth-ntlm="list of helpers"], | |
2601 | [Enable the NTLM authentication scheme, and build the specified helpers. | |
26ffc057 FC |
2602 | Not providing an explicit list of helpers will attempt build of |
2603 | all possible helpers. Default is to do so. | |
12daeef6 | 2604 | To disable the NTLM authentication scheme, use --disable-auth-ntlm. |
1a22a39e | 2605 | To enable but build no helpers, specify "none". |
b817c20f | 2606 | To see available helpers, see the src/auth/ntlm/ directory. ]),[ |
1a22a39e | 2607 | ]) |
b817c20f | 2608 | m4_include([src/auth/ntlm/helpers.m4]) |
c8093f05 | 2609 | |
1a22a39e MM |
2610 | dnl Authentication libraries to build |
2611 | dnl This list will not be needed when each auth library has its own Makefile | |
2612 | dnl this is to be placed AFTER each auth module's handler | |
2613 | AUTH_LIBS_TO_BUILD= | |
2614 | for module in $AUTH_MODULES; do | |
2615 | AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD ${module}/lib${module}.la" | |
2616 | done | |
2617 | AC_SUBST(AUTH_MODULES) | |
2618 | AC_SUBST(AUTH_LIBS_TO_BUILD) | |
dcbfe1a3 | 2619 | AM_CONDITIONAL(ENABLE_SMBLIB, test "x$require_smblib" = "xyes") |
3d62cc61 | 2620 | |
1a22a39e MM |
2621 | dnl Select logging daemon helpers to build |
2622 | AC_ARG_ENABLE(log-daemon-helpers, | |
2623 | AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"], | |
4d5dd85a | 2624 | [This option selects which logging daemon helpers to |
1a22a39e | 2625 | build and install as part of the normal build process |
4d5dd85a | 2626 | For a list of available helpers see the src/log/ |
1a22a39e MM |
2627 | directory.]),[ |
2628 | #nothing to do, really | |
2629 | ]) | |
4d5dd85a | 2630 | m4_include([src/log/helpers.m4]) |
9ca29d23 | 2631 | |
c6588c68 | 2632 | AC_ARG_ENABLE(external-acl-helpers, |
f2d9a578 | 2633 | AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"], |
e046643f | 2634 | [Enable external_acl helpers support and the helpers themselves. |
d9655720 | 2635 | Default is to build all buildable helpers and enable support. |
8ea232f5 | 2636 | To disable support, use --disable-external-acl-helpers. |
d9655720 | 2637 | To build no helpers, specify "none". |
e046643f | 2638 | To see available helpers, see the src/acl/external/ |
8ea232f5 | 2639 | directory]), [ |
d9655720 | 2640 | #nothing to do, really |
c6588c68 | 2641 | ]) |
e046643f | 2642 | m4_include([src/acl/external/helpers.m4]) |
d9655720 | 2643 | |
fdbb3b19 | 2644 | dnl Select url_rewrite helpers to build |
fdbb3b19 | 2645 | AC_ARG_ENABLE(url-rewrite-helpers, |
081863f3 | 2646 | AS_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"], |
fdbb3b19 AJ |
2647 | [This option selects which url_rewrite helpers to |
2648 | build and install as part of the normal build | |
8ea232f5 FC |
2649 | process. The default is to attempt the build of all possible |
2650 | helpers. Use --disable-url-rewrite-helpers to build none. | |
2651 | For a list of available helpers see the | |
d6d6203a | 2652 | src/http/url_rewriters/ directory.]),[ |
fdbb3b19 | 2653 | ]) |
d6d6203a | 2654 | m4_include([src/http/url_rewriters/helpers.m4]) |
fdbb3b19 | 2655 | |
a27cfbe0 | 2656 | dnl Select security helpers to build |
8732ea9d AJ |
2657 | AC_ARG_ENABLE(security-cert-validators, |
2658 | AS_HELP_STRING([--enable-security-cert-validators="list of helpers"], | |
bbf79f12 AJ |
2659 | [This option selects which security certificate validator |
2660 | helpers to build and install as part of the normal build | |
a27cfbe0 | 2661 | process. The default is to attempt the build of all possible |
8732ea9d | 2662 | helpers. Use --disable-security-cert-validators to |
bbf79f12 AJ |
2663 | build none. For a list of available helpers see the |
2664 | src/security/cert_validators/ directory.]),[ | |
a27cfbe0 | 2665 | ]) |
4d5dd85a | 2666 | m4_include([src/security/cert_validators/helpers.m4]) |
a27cfbe0 | 2667 | |
cb0b3d63 AJ |
2668 | AC_ARG_ENABLE(security-cert-generators, |
2669 | AS_HELP_STRING([--enable-security-cert-generators="list of helpers"], | |
2670 | [This option selects which security certificate validator | |
2671 | helpers to build and install as part of the normal build | |
2672 | process. The default is to attempt the build of all possible | |
2673 | helpers. Use --disable-security-cert-genrators to | |
2674 | build none. For a list of available helpers see the | |
2675 | src/security/cert_generators/ directory.]),[ | |
2676 | ]) | |
2677 | m4_include([src/security/cert_generators/helpers.m4]) | |
2678 | ||
0d5ee502 AM |
2679 | dnl Select storeid_rewrite helpers to build |
2680 | AC_ARG_ENABLE(storeid-rewrite-helpers, | |
2681 | AS_HELP_STRING([--enable-storeid-rewrite-helpers="list of helpers"], | |
2682 | [This option selects which Store-ID rewrite helpers to | |
2683 | build and install as part of the normal build | |
2684 | process. The default is to attempt the build of all possible | |
2685 | helpers. Use --disable-storeid-rewrite-helpers to build none. | |
2686 | For a list of available helpers see the | |
0c1f8b9b | 2687 | src/store/id_rewriters/ directory.]),[ |
0d5ee502 | 2688 | ]) |
0c1f8b9b | 2689 | m4_include([src/store/id_rewriters/helpers.m4]) |
0d5ee502 | 2690 | |
3a125142 | 2691 | AC_ARG_WITH(valgrind-debug, |
0f705e3b FC |
2692 | AS_HELP_STRING([--with-valgrind-debug], |
2693 | [Include debug instrumentation for use with valgrind]), | |
4e26f472 FC |
2694 | [ |
2695 | SQUID_YESNO([$withval], | |
2696 | [unrecognized argument to --with-valgrind-debug: $withval]) | |
fcabe077 | 2697 | if test "x$withval" != "xno" ; then |
4e26f472 FC |
2698 | AC_CHECK_HEADERS(valgrind/memcheck.h,[],[ |
2699 | AC_MSG_ERROR([Valgrind support requested, needed headers not found.]) | |
2700 | ]) | |
b4bab919 | 2701 | fi |
2702 | ]) | |
4e26f472 FC |
2703 | SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no}, |
2704 | [Valgrind memory debugger support]) | |
2705 | AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug]) | |
b4bab919 | 2706 | |
0e657244 | 2707 | dnl Enable WIN32 Service compile mode |
2708 | AC_ARG_ENABLE(win32-service, | |
054a4caa | 2709 | AS_HELP_STRING([--enable-win32-service], |
0f705e3b | 2710 | [Compile Squid as a WIN32 Service. |
b284c470 FC |
2711 | Works only on MS-Windows platforms]), [ |
2712 | SQUID_YESNO([$enableval], | |
2713 | [unrecognized argument to --enable-win32-service: $enableval]) | |
0e657244 | 2714 | ]) |
b284c470 FC |
2715 | SQUID_DEFINE_BOOL(USE_WIN32_SERVICE,${enable_win32_service:=no}, |
2716 | [Enable code supporting MS Windows service mode]) | |
2717 | AC_MSG_NOTICE([MS Windows service mode enabled: $enable_win32_service]) | |
0e657244 | 2718 | |
b1485ff8 | 2719 | |
29f22442 | 2720 | # Disable "unlinkd" code |
fe0810ac | 2721 | AC_ARG_ENABLE(unlinkd, |
0a081cb0 | 2722 | AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [ |
0f705e3b FC |
2723 | SQUID_YESNO([$enableval], |
2724 | [unrecognized argument to --disable-unlinkd: $enableval]) | |
fe0810ac | 2725 | ]) |
0f658b5b | 2726 | SQUID_DEFINE_BOOL(USE_UNLINKD,${enable_unlinkd:=yes}, |
0f705e3b | 2727 | [Enable useage of unlinkd]) |
fcabe077 | 2728 | AM_CONDITIONAL(ENABLE_UNLINKD,test "x$enable_unlinkd" = "xyes") |
fbc04c0a | 2729 | AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd]) |
fe0810ac | 2730 | |
0f705e3b | 2731 | # Enable backtraces on fatal errors |
ce3d30fb | 2732 | AC_ARG_ENABLE(stacktraces, |
0f705e3b FC |
2733 | AS_HELP_STRING([--enable-stacktraces], |
2734 | [Enable automatic call backtrace on fatal errors]), [ | |
2735 | SQUID_YESNO([$enableval], | |
2736 | [unrecognized argument to --enable-stacktraces: $enableval]) | |
ce3d30fb | 2737 | ]) |
0f658b5b | 2738 | SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no}, |
0f705e3b | 2739 | [Print stack traces on fatal errors]) |
78614cd4 | 2740 | AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces]) |
0a081cb0 | 2741 | |
ce3d30fb | 2742 | |
904676a2 | 2743 | # CPU Profiling options handling |
88bfe092 | 2744 | AC_ARG_ENABLE(cpu-profiling, |
0f705e3b FC |
2745 | AS_HELP_STRING([--enable-cpu-profiling], |
2746 | [Enable instrumentation to try and understand how CPU power | |
2747 | is spent by squid, by enabling specific probes in selected | |
2748 | functions. | |
2749 | New probes can only be added by modifying the source code. | |
2750 | It is meant to help developers in optimizing performance | |
2751 | of Squid internal functions. | |
87fa90fb | 2752 | If you are not developer you should not enable this, |
0f705e3b FC |
2753 | as it slows squid down somewhat. |
2754 | See lib/Profiler.c for more details.]), [ | |
2755 | SQUID_YESNO([$enableval], | |
2756 | [unrecognized argument to --enable-cpu-profiling: $enableval]) | |
88bfe092 | 2757 | ]) |
13e41ca5 AJ |
2758 | # Default OFF. This is a debug feature. Only check and enable if forced ON. |
2759 | if test "x$enable_cpu_profiling" = "xyes"; then | |
5e44eea8 | 2760 | SQUID_CHECK_FUNCTIONAL_CPU_PROFILER |
13e41ca5 | 2761 | if test "x$squid_cv_cpu_profiler_works" = "xno"; then |
5e44eea8 | 2762 | AC_MSG_ERROR([CPU profiling will not be functional in this build.]) |
5e44eea8 | 2763 | fi |
5e44eea8 | 2764 | fi |
0f658b5b | 2765 | SQUID_DEFINE_BOOL(USE_XPROF_STATS,${enable_cpu_profiling:=no}, |
0f705e3b FC |
2766 | [Define to enable CPU profiling within Squid]) |
2767 | AM_CONDITIONAL(ENABLE_XPROF_STATS, | |
fcabe077 | 2768 | test "x$enable_cpu_profiling" = "xyes") |
78614cd4 | 2769 | AC_MSG_NOTICE([CPU profiling enabled: $enable_cpu_profiling]) |
88bfe092 | 2770 | |
904676a2 | 2771 | # Enable X-Accelerator-Vary for Vary support within an accelerator setup |
2092c67d | 2772 | AC_ARG_ENABLE(x-accelerator-vary, |
904676a2 FC |
2773 | AS_HELP_STRING([--enable-x-accelerator-vary], |
2774 | [Enable support for the X-Accelerator-Vary | |
e702812e FC |
2775 | HTTP header. Can be used to indicate |
2776 | variance within an accelerator setup. | |
2777 | Typically used together with other code | |
904676a2 FC |
2778 | that adds custom HTTP headers to the requests.]), [ |
2779 | SQUID_YESNO([$enableval], | |
2780 | [unrecognized argument to --enable-x-accelerator-vary: $enableval]) | |
f66a9ef4 | 2781 | ]) |
0f658b5b | 2782 | SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no}, |
904676a2 | 2783 | [Enable support for the X-Accelerator-Vary HTTP header]) |
78614cd4 | 2784 | AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary]) |
f66a9ef4 | 2785 | |
d93bf055 AJ |
2786 | AC_ARG_WITH([cppunit], AS_HELP_STRING([--without-cppunit],[Do not use cppunit test framework]),[ |
2787 | AS_CASE($with_cppunit, [yes|no],[], | |
2788 | [ | |
2789 | AS_IF([test ! -d "$withval"],AC_MSG_ERROR([--with-cppunit PATH does not point to a directory])) | |
2790 | LIBCPPUNIT_CFLAGS="-I$with_cppunit/include" | |
2791 | LIBCPPUNIT_LIBS="-L$with_cppunit/lib -lcppunit" | |
2792 | ]) | |
2793 | ]) | |
2794 | AS_IF([test "x$with_cppunit" != "xno"],[ | |
2795 | PKG_CHECK_MODULES([LIBCPPUNIT],[cppunit],[ | |
2796 | squid_cv_cppunit_version="`pkg-config cppunit --version`" | |
2797 | AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version]) | |
2798 | AS_UNSET(squid_cv_cppunit_version) | |
2799 | ||
2800 | SQUID_STATE_SAVE(squid_cppunit_state) | |
e77b66af FC |
2801 | CXXFLAGS="${CXXFLAGS} ${LIBCPPUNIT_CFLAGS}" |
2802 | LIBS="${LIBS} ${LIBCPPUNIT_LIBS}" | |
d93bf055 AJ |
2803 | AC_CHECK_HEADERS(cppunit/extensions/HelperMacros.h) |
2804 | SQUID_STATE_ROLLBACK(squid_cppunit_state) | |
2805 | ],[ | |
2806 | AC_MSG_WARN([cppunit does not appear to be installed. Squid does not require this, but code testing with 'make check' will fail.]) | |
2807 | ]) | |
f5691f9c | 2808 | ]) |
f5691f9c | 2809 | |
fd9aaa3e | 2810 | # Force some compilers to use ANSI features |
2811 | # | |
2812 | case "$host" in | |
3680cc44 FC |
2813 | *-hp-hpux*) |
2814 | if test "x$ac_cv_prog_CC" = "xcc" ; then | |
2815 | AC_MSG_NOTICE([adding '-Ae' to cc args for $host]) | |
2816 | CC="cc -Ae"; | |
2817 | ac_cv_prog_CC="$CC" | |
2818 | fi | |
2819 | ;; | |
fd9aaa3e | 2820 | esac |
2821 | ||
dd56802c | 2822 | |
a2794549 | 2823 | dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE) |
4e9d8e26 | 2824 | |
6ad85e8a | 2825 | case "$host" in |
3680cc44 FC |
2826 | *hpux*) |
2827 | AC_MSG_NOTICE([Disabling ranlib for HP-UX...]) | |
2828 | RANLIB=":" | |
2829 | ;; | |
6ad85e8a | 2830 | esac |
2831 | ||
090089c4 | 2832 | dnl Check for headers |
2833 | AC_HEADER_DIRENT | |
2834 | AC_HEADER_STDC | |
db40ae20 | 2835 | |
2836 | AC_CHECK_HEADERS( \ | |
3680cc44 FC |
2837 | arpa/inet.h \ |
2838 | arpa/nameser.h \ | |
2839 | assert.h \ | |
2840 | bstring.h \ | |
3680cc44 | 2841 | crypt.h \ |
3680cc44 | 2842 | ctype.h \ |
ee4d4e85 | 2843 | direct.h \ |
3680cc44 FC |
2844 | errno.h \ |
2845 | execinfo.h \ | |
2846 | fcntl.h \ | |
2847 | fnmatch.h \ | |
2848 | getopt.h \ | |
2849 | glob.h \ | |
2850 | gnumalloc.h \ | |
2851 | grp.h \ | |
3680cc44 FC |
2852 | ipl.h \ |
2853 | lber.h \ | |
2854 | ldap.h \ | |
2855 | libc.h \ | |
2856 | limits.h \ | |
2857 | linux/posix_types.h \ | |
2858 | linux/types.h \ | |
3680cc44 | 2859 | malloc.h \ |
3680cc44 FC |
2860 | math.h \ |
2861 | memory.h \ | |
2862 | mount.h \ | |
2863 | netdb.h \ | |
2864 | netinet/in.h \ | |
2865 | netinet/in_systm.h \ | |
3680cc44 | 2866 | netinet/tcp.h \ |
3680cc44 FC |
2867 | paths.h \ |
2868 | poll.h \ | |
2869 | pwd.h \ | |
c2afddd8 | 2870 | regex.h \ |
3680cc44 | 2871 | sched.h \ |
2ccf2eb2 | 2872 | siginfo.h \ |
3680cc44 | 2873 | signal.h \ |
3680cc44 FC |
2874 | stdarg.h \ |
2875 | stddef.h \ | |
3680cc44 FC |
2876 | stdio.h \ |
2877 | stdlib.h \ | |
3680cc44 FC |
2878 | string.h \ |
2879 | strings.h \ | |
2880 | sys/bitypes.h \ | |
3680cc44 FC |
2881 | sys/file.h \ |
2882 | sys/ioctl.h \ | |
d440d5a4 | 2883 | sys/ipc.cc \ |
3680cc44 FC |
2884 | sys/param.h \ |
2885 | sys/prctl.h \ | |
2886 | sys/md5.h \ | |
c975f532 | 2887 | sys/mman.h \ |
3680cc44 FC |
2888 | sys/msg.h \ |
2889 | sys/resource.h \ | |
2ccf2eb2 | 2890 | sys/select.h \ |
d440d5a4 | 2891 | sys/shm.h \ |
3680cc44 FC |
2892 | sys/socket.h \ |
2893 | sys/stat.h \ | |
3680cc44 FC |
2894 | syscall.h \ |
2895 | sys/syscall.h \ | |
2896 | sys/time.h \ | |
2897 | sys/types.h \ | |
2898 | sys/uio.h \ | |
2899 | sys/un.h \ | |
2900 | sys/vfs.h \ | |
2901 | sys/wait.h \ | |
2902 | syslog.h \ | |
2903 | time.h \ | |
2904 | unistd.h \ | |
2905 | utime.h \ | |
2906 | varargs.h \ | |
2907 | byteswap.h \ | |
2908 | glib.h \ | |
2909 | stdint.h \ | |
2910 | inttypes.h \ | |
cdb86165 | 2911 | wchar.h |
db40ae20 | 2912 | ) |
3c586e38 | 2913 | |
ee80a919 AR |
2914 | AC_CHECK_HEADERS( \ |
2915 | linux/netfilter_ipv4.h \ | |
2916 | linux/netfilter_ipv6/ip6_tables.h \ | |
fc68f6b1 | 2917 | ,,, |
dcd1dc78 | 2918 | SQUID_DEFAULT_INCLUDES |
2919 | #if HAVE_LIMITS_H | |
2920 | #include <limits.h> | |
2921 | #endif | |
a74968c2 AJ |
2922 | /* Netfilter ip(6)tables v1.4.0 has broken headers */ |
2923 | #if HAVE_NETINET_IN_H | |
2924 | #include <netinet/in.h> | |
2925 | #endif | |
dcd1dc78 | 2926 | ) |
2927 | ||
61beade2 | 2928 | dnl *BSD do not include the dependencies for all their net/ and netinet/ files |
c92b4732 | 2929 | dnl We must include a few basic type headers for them to work. |
d1e5191e | 2930 | AC_CHECK_HEADERS( \ |
0c0d381b FC |
2931 | net/if.h \ |
2932 | netinet/if_ether.h\ | |
2933 | netinet/icmp6.h \ | |
2934 | netinet/in.h \ | |
2935 | netinet/ip.h \ | |
2936 | netinet/ip6.h \ | |
0c0d381b FC |
2937 | netinet/ip_icmp.h \ |
2938 | netinet/ipl.h \ | |
0c0d381b FC |
2939 | net/pf/pfvar.h \ |
2940 | net/pfvar.h \ | |
2941 | sys/mount.h\ | |
2942 | resolv.h \ | |
d1e5191e AJ |
2943 | ,,, |
2944 | SQUID_BSDNET_INCLUDES) | |
5a3237b0 | 2945 | |
aee0606f | 2946 | AC_C_CONST |
d57288d2 | 2947 | AC_C_BIGENDIAN |
aee0606f | 2948 | |
6a9f6389 | 2949 | AC_STRUCT_TM |
2950 | AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[ | |
2951 | #if TM_IN_SYS_TIME | |
2952 | #if HAVE_SYS_TIME_H | |
2953 | #include <sys/time.h> | |
2954 | #endif | |
2955 | #elif HAVE_TIME_H | |
2956 | #include <time.h> | |
2957 | #endif | |
5c51415d | 2958 | ]) |
46c883ed | 2959 | |
08caf8c6 | 2960 | dnl Override rusage() detect on MinGW because is emulated in source code |
78a60bca AJ |
2961 | case "$squid_host_os" in |
2962 | mingw) | |
08caf8c6 | 2963 | AC_DEFINE(HAVE_STRUCT_RUSAGE) |
2964 | ac_cv_func_getrusage='yes' | |
eed82608 | 2965 | AC_MSG_NOTICE([Using own rusage on Windows.]) |
08caf8c6 | 2966 | ;; |
2967 | *) | |
2968 | AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[ | |
8ff51bba | 2969 | #if HAVE_SYS_TIME_H |
2970 | #include <sys/time.h> | |
2971 | #endif | |
b54a6789 | 2972 | #if HAVE_SYS_RESOURCE_H |
2973 | #include <sys/resource.h> | |
6a9f6389 | 2974 | #endif]) |
08caf8c6 | 2975 | ;; |
2976 | esac | |
b54a6789 | 2977 | |
6a9f6389 | 2978 | AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[ |
2979 | #if HAVE_SYS_TYPES_H | |
2980 | #include <sys/types.h> | |
2981 | #endif | |
a025a745 | 2982 | #include <netinet/in.h> |
2983 | #include <netinet/in_systm.h> | |
6ad85e8a | 2984 | #include <netinet/ip.h> |
b05490a8 | 2985 | #if defined (__linux__) || defined (__CYGWIN__) |
6ad85e8a | 2986 | #define ip_hl ihl |
2987 | #endif | |
2988 | #ifndef __linux__ | |
b05490a8 | 2989 | #ifndef __CYGWIN__ |
6ad85e8a | 2990 | #define iphdr ip |
b05490a8 | 2991 | #endif |
6a9f6389 | 2992 | #endif]) |
a025a745 | 2993 | |
090089c4 | 2994 | dnl Check for typedefs |
77d6bd88 | 2995 | AC_CHECK_SIZEOF(void *) |
090089c4 | 2996 | |
41aa7d00 FC |
2997 | # check for a bunch of types |
2998 | AC_TYPE_INT8_T | |
2999 | AC_TYPE_UINT8_T | |
3000 | AC_TYPE_INT16_T | |
3001 | AC_TYPE_UINT16_T | |
3002 | AC_TYPE_INT32_T | |
3003 | AC_TYPE_UINT32_T | |
3004 | AC_TYPE_INT64_T | |
3005 | AC_TYPE_UINT64_T | |
3006 | AC_TYPE_PID_T | |
3007 | AC_TYPE_SIZE_T | |
3008 | AC_TYPE_SSIZE_T | |
3009 | AC_TYPE_OFF_T | |
3010 | AC_TYPE_UID_T | |
59a09b98 | 3011 | AC_CHECK_TYPE([bool]) |
41aa7d00 FC |
3012 | #need the defines for PRId64 |
3013 | AC_CHECK_SIZEOF(int64_t) | |
3014 | AC_CHECK_SIZEOF(long) | |
fe1e5c91 AJ |
3015 | #need the defines for PRIuSIZE |
3016 | AC_CHECK_SIZEOF(size_t) | |
50f9c873 AR |
3017 | #need the define for overflow checks |
3018 | AC_CHECK_SIZEOF(off_t) | |
46e172d9 | 3019 | AC_CHECK_SIZEOF(size_t) |
6a9f6389 | 3020 | |
249b93df | 3021 | dnl Some C++11 types we try to use |
a203dec7 AJ |
3022 | AX_CXX_TYPE_NULLPTR |
3023 | AX_CXX_TYPE_UNIQUE_PTR | |
249b93df | 3024 | AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS |
2fefc43c | 3025 | SQUID_CXX_STD_UNDERLYING_TYPE |
a203dec7 | 3026 | |
588e71df | 3027 | dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files |
3028 | dnl that is incompatible with the updated Solaris header files. | |
3029 | dnl For this reason, we must check if pad128_t and upad128_t are defined. | |
3030 | AC_CHECK_TYPE(pad128_t, | |
3031 | AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]), | |
3032 | ,SQUID_DEFAULT_INCLUDES) | |
3033 | ||
3034 | AC_CHECK_TYPE(upad128_t, | |
3035 | AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]), | |
3036 | ,SQUID_DEFAULT_INCLUDES) | |
3037 | ||
6a9f6389 | 3038 | AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) |
3039 | AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) | |
adcceb47 | 3040 | |
6a9f6389 | 3041 | AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[ |
3042 | #include <sys/types.h> | |
6637e3a5 | 3043 | #include <sys/socket.h> |
3044 | #if STDC_HEADERS | |
3045 | #include <stdlib.h> | |
3046 | #include <stddef.h> | |
6a9f6389 | 3047 | #endif]) |
6637e3a5 | 3048 | |
cdb352bb FC |
3049 | AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1, |
3050 | [mtyp_t is defined by the system headers]),,[#include <sys/types.h> | |
3051 | #include <sys/ipc.h> | |
3052 | #include <sys/msg.h>]) | |
3053 | ||
f367e6af AJ |
3054 | AC_CHECK_TYPE(cpu_set_t, |
3055 | AC_DEFINE(HAVE_CPU_SET_T,1,[cpu_set_t is defined by the system headers]),,[ | |
3056 | #if HAVE_SCHED_H | |
3057 | #include <sched.h> | |
3058 | #endif | |
3059 | ]) | |
3060 | ||
fe1e5c91 AJ |
3061 | # check for compiler support of %zu printf macro |
3062 | AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro]) | |
3063 | AC_MSG_CHECKING([for compiler %zu support]) | |
3064 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
3065 | #include <stdio.h> | |
3066 | ]],[[size_t n=1;printf("%zu",n);]])],[ | |
3067 | AC_DEFINE(PRIuSIZE,"zu") | |
3068 | AC_MSG_RESULT(yes) | |
3069 | ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)]) | |
3070 | ||
3071 | ||
cdb352bb FC |
3072 | dnl Check for special functions |
3073 | AC_FUNC_ALLOCA | |
3074 | ||
3075 | ||
b50f1b2b | 3076 | dnl Check for libcap header (assume its not broken unless |
45c41a07 FC |
3077 | AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap], |
3078 | [disable usage of Linux capabilities library to control privileges]), [ | |
3079 | SQUID_YESNO([$withval],[unrecognized argument to --without-libcap: $withval]) | |
3080 | ],[with_libcap=auto]) | |
3081 | ||
3082 | if test "x$with_libcap" != "xno"; then | |
b64b6030 | 3083 | # cap_clear_flag is the most recent libcap function we require |
45c41a07 | 3084 | AC_CHECK_HEADERS(sys/capability.h) |
b64b6030 | 3085 | AC_CHECK_LIB(cap, cap_clear_flag) |
45c41a07 FC |
3086 | SQUID_CHECK_FUNCTIONAL_LIBCAP2 |
3087 | ||
3088 | # if it can't be supported.. | |
35e2b2e5 | 3089 | if test "x$ac_cv_header_sys_capability_h" = "xno" -o \ |
46f50de9 | 3090 | "x$ac_cv_lib_cap_cap_clear_flag" = "xno"; then |
45c41a07 | 3091 | # and it was forced on: error |
46f50de9 | 3092 | if test "x$with_libcap" = "xyes" ; then |
ff8d255b | 3093 | AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later]) |
3fbda12c FC |
3094 | else |
3095 | # with_libcap is "auto"; it can't be supported. Disable. | |
3096 | with_libcap=no | |
b64b6030 | 3097 | fi |
45c41a07 FC |
3098 | else |
3099 | # header and lib are ok, we support | |
3100 | with_libcap=yes | |
b64b6030 | 3101 | fi |
69367152 | 3102 | |
b50f1b2b | 3103 | fi |
5b43d209 | 3104 | |
45c41a07 FC |
3105 | SQUID_DEFINE_BOOL(USE_LIBCAP,$with_libcap, |
3106 | [use libcap to set capabilities required for TPROXY]) | |
3107 | AC_MSG_NOTICE([libcap support enabled: $with_libcap]) | |
3108 | SQUID_DEFINE_BOOL(LIBCAP_BROKEN,${squid_cv_sys_capability_works:=no}, | |
3109 | [libcap2 headers are broken and clashing with glibc]) | |
3110 | AC_MSG_NOTICE([libcap2 headers are ok: $squid_cv_sys_capability_works]) | |
3111 | ||
b64b6030 | 3112 | |
090089c4 | 3113 | dnl Check for needed libraries |
54c95954 | 3114 | AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind]) |
819656da AJ |
3115 | AC_SEARCH_LIBS([res_init],[resolv]) |
3116 | AC_SEARCH_LIBS([__res_search],[resolv]) | |
54c95954 FC |
3117 | AC_SEARCH_LIBS([bind],[socket]) |
3118 | AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack]) | |
3119 | AC_SEARCH_LIBS([strlcpy], [bsd]) | |
85cd85f3 | 3120 | AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus]) |
bfe8dedf | 3121 | dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API |
0c0d381b FC |
3122 | if test "x$squid_host_os" = "xmingw" ; then |
3123 | SQUID_CHECK_WINSOCK_LIB | |
32341684 AJ |
3124 | AC_CHECK_HEADERS( \ |
3125 | windows.h \ | |
3126 | ws2tcpip.h \ | |
b966288b | 3127 | iphlpapi.h ,,,[ |
2ff9dfaa AJ |
3128 | #if HAVE_WINSOCK2_H |
3129 | #include <winsock2.h> | |
3130 | #endif | |
32341684 AJ |
3131 | #if HAVE_WINDOWS_H |
3132 | #include <windows.h> | |
3133 | #endif | |
2ff9dfaa AJ |
3134 | #if HAVE_WS2TCPIP_H |
3135 | #include <ws2tcpip.h> | |
3136 | #endif | |
3137 | ]) | |
0c0d381b | 3138 | fi |
94d48591 | 3139 | |
46f50de9 FC |
3140 | # check that we have unix sockets |
3141 | SQUID_CHECK_UNIX_SOCKET | |
3142 | SQUID_DEFINE_BOOL(HAVE_UNIXSOCKET,$squid_cv_unixsocket,[System supports unix sockets]) | |
3143 | ||
3144 | AC_CHECK_LIB(gnumalloc, malloc) | |
3145 | if test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"; then | |
ef7ece58 | 3146 | AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc]) |
46f50de9 FC |
3147 | ac_cv_func_mallocblksize=no |
3148 | ac_cv_func_mallopt=no | |
3149 | else | |
3150 | case "$squid_host_os" in | |
3151 | solaris) | |
3152 | AC_MSG_NOTICE([skipping libmalloc check for $host]) | |
3153 | ;; | |
3154 | freebsd) | |
3155 | AC_MSG_NOTICE([skipping libmalloc check for $host]) | |
3156 | ;; | |
3157 | *) | |
3158 | #used later. FIXME | |
3159 | AC_CHECK_LIB(malloc, main) | |
3160 | ;; | |
cdb352bb FC |
3161 | esac |
3162 | fi | |
94d48591 | 3163 | |
78a60bca AJ |
3164 | case "$squid_host_os" in |
3165 | mingw) | |
3166 | AC_MSG_NOTICE([Use MSVCRT for math functions.]) | |
3167 | ;; | |
3168 | *) | |
3169 | dnl rint() and log() are only used in old C code for now. | |
3170 | AC_LANG_PUSH([C]) | |
3171 | AC_SEARCH_LIBS([rint],[m]) | |
3172 | AC_SEARCH_LIBS([log],[m]) | |
3173 | AC_LANG_POP([C]) | |
3174 | ;; | |
08caf8c6 | 3175 | esac |
090089c4 | 3176 | |
f467f578 FC |
3177 | dnl --with-maxfd present for compatibility with Squid-2. |
3178 | dnl undocumented in ./configure --help to encourage using the Squid-3 directive | |
3179 | AC_ARG_WITH(maxfd,, | |
3180 | [ | |
3181 | case ${withval} in | |
3182 | [[0-9]]*) | |
3183 | squid_filedescriptors_num=$withval | |
acea95af | 3184 | AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)]) |
f467f578 FC |
3185 | ;; |
3186 | *) | |
3187 | AC_MSG_ERROR(--with-maxfd expects a numeric argument) | |
3188 | ;; | |
3189 | esac | |
055421ee | 3190 | ]) |
001ad4cc | 3191 | |
f467f578 FC |
3192 | AC_ARG_WITH(filedescriptors, |
3193 | AS_HELP_STRING([--with-filedescriptors=NUMBER], | |
3194 | [Force squid to support NUMBER filedescriptors]), | |
3195 | [ | |
3196 | case ${withval} in | |
3197 | [[0-9]]*) | |
3198 | squid_filedescriptors_num=$withval | |
acea95af | 3199 | AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)]) |
f467f578 FC |
3200 | ;; |
3201 | *) | |
3202 | AC_MSG_ERROR(--with-filedescriptors expects a numeric argument) | |
3203 | ;; | |
3204 | esac | |
001ad4cc | 3205 | ]) |
f467f578 FC |
3206 | |
3207 | SQUID_CHECK_DEFAULT_FD_SETSIZE | |
acea95af | 3208 | SQUID_CHECK_MAXFD |
001ad4cc | 3209 | |
f467f578 | 3210 | |
001ad4cc AJ |
3211 | dnl Enable IPv6 support |
3212 | AC_MSG_CHECKING([whether to enable IPv6]) | |
001ad4cc | 3213 | AC_ARG_ENABLE(ipv6, |
af494bc8 FC |
3214 | AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support. The default is to probe system capabilities on startup.]), [ |
3215 | SQUID_YESNO([$enableval],[unrecognized argument to --disable-ipv6: $enableval]) | |
001ad4cc | 3216 | ]) |
7d927f1f AJ |
3217 | AC_MSG_RESULT(${enable_ipv6:=yes}) |
3218 | SQUID_DEFINE_BOOL(USE_IPV6,$enable_ipv6,[Enable support for IPv6 ]) | |
001ad4cc | 3219 | |
7d927f1f | 3220 | if test "x$enable_ipv6" = "xyes" ; then |
af494bc8 | 3221 | SQUID_CHECK_SIN6_LEN_IN_SAI |
001ad4cc | 3222 | fi |
7d553ad9 AJ |
3223 | SQUID_CHECK_SS_LEN_IN_SOCKADDR_STORAGE |
3224 | SQUID_CHECK_SIN_LEN_IN_SOCKADDR_IN | |
001ad4cc | 3225 | |
001ad4cc | 3226 | |
042b1f8a | 3227 | dnl Check for libdl, used by auth_modules/PAM |
fcabe077 | 3228 | if test "x$with_dl" = "xyes"; then |
8154dd82 | 3229 | AC_CHECK_LIB(dl, dlopen) |
3230 | fi | |
042b1f8a | 3231 | |
86ec11aa | 3232 | dnl -lintl is needed on SCO version 3.2v4.2 for strftime() |
3233 | dnl Robert Side <rside@aiinc.bc.ca> | |
3234 | dnl Mon, 18 Jan 1999 17:48:00 GMT | |
3235 | case "$host" in | |
3236 | *-pc-sco3.2*) | |
3237 | AC_CHECK_LIB(intl, strftime) | |
3238 | ;; | |
3239 | esac | |
3240 | ||
77f675ad | 3241 | dnl System-specific library modifications |
3242 | dnl | |
3243 | case "$host" in | |
fcabe077 FC |
3244 | i386-*-solaris2.*) |
3245 | if test "x$GCC" = "xyes"; then | |
3246 | AC_MSG_NOTICE([Removing -O for gcc on $host]) | |
d0441961 | 3247 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`" |
fcabe077 FC |
3248 | fi |
3249 | ;; | |
141eb4a6 | 3250 | |
fcabe077 FC |
3251 | *-sgi-irix*) |
3252 | AC_MSG_NOTICE([Removing -lsocket for IRIX...]) | |
3253 | LIBS=`echo $LIBS | sed -e s/-lsocket//` | |
3254 | AC_MSG_NOTICE([Removing -lnsl for IRIX...]) | |
3255 | LIBS=`echo $LIBS | sed -e s/-lnsl//` | |
3256 | ac_cv_lib_nsl_main=no | |
3257 | AC_MSG_NOTICE([Removing -lbsd for IRIX...]) | |
3258 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
3259 | ;; | |
4ba0bd0e | 3260 | dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher) |
3261 | dnl Date: Thu, 17 Oct 1996 04:09:30 +0200 | |
3262 | dnl Please change your configure script. AIX doesn't need -lbsd. | |
fcabe077 FC |
3263 | *-ibm-aix*) |
3264 | AC_MSG_NOTICE([Removing -lbsd for AIX...]) | |
3265 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
3e1ce596 KB |
3266 | |
3267 | SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_rtti],[-rtti],[[ | |
3268 | #include <assert.h> | |
3269 | #ifndef NULL | |
3270 | #define NULL 0 | |
3271 | #endif | |
3272 | class Foo{ | |
3273 | public:virtual ~Foo(){} | |
3274 | }; | |
3275 | class Bar:public Foo{ | |
3276 | public:Bar():Foo(){} | |
3277 | }; | |
3278 | ]],[[ | |
3279 | Foo * myFoo=new Bar(); | |
3280 | Bar * myBar=dynamic_cast<Bar *>(myFoo); | |
3281 | assert(myBar != NULL); | |
3282 | ]]) | |
3283 | if test "$ac_cv_require_rtti" = "yes"; then | |
3284 | SQUID_CFLAGS="-rtti $SQUID_CFLAGS" | |
3285 | SQUID_CXXFLAGS="-rtti $SQUID_CXXFLAGS" | |
fcabe077 | 3286 | fi |
3e1ce596 KB |
3287 | |
3288 | AC_LANG_PUSH([C]) | |
3289 | SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_qcpluscmt],[-qcpluscmt],[[]],[[//c++ cmt]]) | |
fcabe077 | 3290 | AC_LANG_POP([C]) |
3e1ce596 KB |
3291 | if test "$ac_cv_require_qcpluscmt" = "yes"; then |
3292 | SQUID_CFLAGS="-qcpluscmt $SQUID_CFLAGS" | |
3293 | fi | |
fcabe077 | 3294 | ;; |
3e1ce596 | 3295 | |
fcabe077 FC |
3296 | *m88k*) |
3297 | SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_" | |
3298 | SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_" | |
3299 | AC_DEFINE(GETTIMEOFDAY_NO_TZP,1, | |
3300 | [If gettimeofday is known to take only one argument]) | |
3301 | ;; | |
3302 | [*-*-solaris2.[0-4]]) | |
3303 | AC_DEFINE(GETTIMEOFDAY_NO_TZP,1) | |
3304 | ;; | |
3305 | [*-sony-newsos[56]*]) | |
3306 | AC_DEFINE(GETTIMEOFDAY_NO_TZP,1) | |
3307 | ;; | |
3308 | esac | |
090089c4 | 3309 | |
84cecfd2 | 3310 | dnl This has to be before AC_CHECK_FUNCS |
3311 | # Disable poll() on certain platforms. Override by setting ac_cv_func_poll | |
3312 | # when running configure. | |
fcabe077 FC |
3313 | if test "x$ac_cv_func_poll" = "x" ; then |
3314 | case "$host" in | |
3315 | [*-hp-hpux*.*]) | |
3316 | # Duane Wessels | |
3317 | AC_MSG_NOTICE([disabling poll for $host...]) | |
3318 | ac_cv_func_poll='no' | |
3319 | ;; | |
3320 | [*-linux-*]) | |
3321 | # Henrik Nordstrom (hno@squid-cache.org) 19980817 | |
3322 | # poll is problematic on Linux. We disable it | |
3323 | # by default until Linux gets it right. | |
3324 | rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'` | |
3325 | if test $rev -lt 002002; then | |
3326 | AC_MSG_NOTICE([disabling poll for $host < 2.2...]) | |
3327 | ac_cv_func_poll='no' | |
3328 | fi | |
3329 | ;; | |
3330 | [powerpc-ibm-aix4.1.*]) | |
3331 | # Mike Laster (mlaster@metavillage.com) 19981021 | |
3332 | AC_MSG_NOTICE([disabling poll for $host...]) | |
3333 | ac_cv_func_poll='no' | |
3334 | ;; | |
3335 | [*-pc-sco3.2*]) | |
3336 | # Robert Side <rside@aiinc.bc.ca> | |
3337 | # Mon, 18 Jan 1999 17:48:00 GMT | |
3338 | AC_MSG_NOTICE([disabling poll for $host...]) | |
3339 | ac_cv_func_poll='no' | |
3340 | ;; | |
3341 | esac | |
84cecfd2 | 3342 | fi |
176d10ee | 3343 | |
6716b242 | 3344 | dnl Check for library functions |
3345 | AC_CHECK_FUNCS(\ | |
ce3d30fb | 3346 | backtrace_symbols_fd \ |
3a144521 | 3347 | bcopy \ |
4de1e2da | 3348 | eui64_aton \ |
4ac29a5b | 3349 | fchmod \ |
6716b242 | 3350 | getdtablesize \ |
8505e57b | 3351 | getpagesize \ |
230c091c | 3352 | getpass \ |
30a4f2a8 | 3353 | getrusage \ |
9c1d8929 | 3354 | getspnam \ |
379d5751 | 3355 | gettimeofday \ |
52303a3d | 3356 | glob \ |
0f5efab0 | 3357 | mallocblksize \ |
6716b242 | 3358 | mallopt \ |
2ae6b9b0 | 3359 | memcpy \ |
30a4f2a8 | 3360 | memmove \ |
ee4d4e85 | 3361 | memrchr \ |
dac27377 | 3362 | memset \ |
b99a6dec | 3363 | mkstemp \ |
1812b6c7 | 3364 | mktime \ |
88738790 | 3365 | mstats \ |
84cecfd2 | 3366 | poll \ |
62ae0622 | 3367 | prctl \ |
3a144521 | 3368 | pthread_attr_setschedparam \ |
cd748f27 | 3369 | pthread_attr_setscope \ |
3370 | pthread_setschedparam \ | |
42b51993 | 3371 | pthread_sigmask \ |
c68e9c6b | 3372 | putenv \ |
c2afddd8 AJ |
3373 | regcomp \ |
3374 | regexec \ | |
3375 | regfree \ | |
819656da AJ |
3376 | res_init \ |
3377 | __res_init \ | |
4915be3b | 3378 | rint \ |
96c2bb61 AR |
3379 | sched_getaffinity \ |
3380 | sched_setaffinity \ | |
3a144521 | 3381 | select \ |
234967c9 | 3382 | seteuid \ |
c415c128 | 3383 | setgroups \ |
30a4f2a8 | 3384 | setpgrp \ |
30a4f2a8 | 3385 | setsid \ |
3386 | sigaction \ | |
11430c03 | 3387 | snprintf \ |
1ccc0d40 | 3388 | socketpair \ |
6716b242 | 3389 | sysconf \ |
3390 | syslog \ | |
234967c9 | 3391 | timegm \ |
28da5e0d | 3392 | vsnprintf \ |
6716b242 | 3393 | ) |
f5e5c4cf | 3394 | dnl ... and some we provide local replacements for |
3395 | AC_REPLACE_FUNCS(\ | |
f5e5c4cf | 3396 | initgroups \ |
2ccf2eb2 | 3397 | psignal \ |
f5e5c4cf | 3398 | strerror \ |
585cddda | 3399 | strtoll \ |
f5e5c4cf | 3400 | tempnam \ |
3401 | ) | |
6716b242 | 3402 | |
dfb96b6b | 3403 | AC_CHECK_DECLS([getaddrinfo,getnameinfo,inet_ntop,inet_pton,InetNtopA,InetPtonA],,,[ |
55d7d5e9 AJ |
3404 | /* |
3405 | * BSD requires sys/types.h, sys/socket.h, netinet/in.h, netdb.h, arpa/inet.h | |
3406 | * Linux requires sys/types.h, sys/socket.h, arpa/inet.h | |
3407 | * Windows requires sys/socket.h, winsock2.h, ws2tcpip.h | |
3408 | */ | |
3409 | #if HAVE_SYS_TYPES_H | |
3410 | #include <sys/types.h> | |
3411 | #endif | |
3412 | #if HAVE_NETINET_IN_H | |
3413 | #include <netinet/in.h> | |
3414 | #endif | |
3415 | #if HAVE_SYS_SOCKET_H | |
3416 | #include <sys/socket.h> | |
3417 | #endif | |
3418 | #if HAVE_NETDB_H | |
3419 | #include <netdb.h> | |
3420 | #endif | |
3421 | #if HAVE_ARPA_INET_H | |
3422 | #include <arpa/inet.h> | |
3423 | #endif | |
3424 | #if HAVE_WINSOCK2_H | |
3425 | #include <winsock2.h> | |
3426 | #endif | |
3427 | #if HAVE_WS2TCPIP_H | |
3428 | #include <ws2tcpip.h> | |
3429 | #endif | |
3430 | ]) | |
3431 | ||
9676633b FC |
3432 | # Magic which checks whether we are forcing a type of comm loop we |
3433 | # are actually going to (ab)use. | |
3434 | # Mostly ripped from squid-commloops, thanks to adrian and benno | |
1b3db6d9 | 3435 | |
fcabe077 | 3436 | if test "x$squid_opt_io_loop_engine" != "x"; then |
8075a4da | 3437 | AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine]) |
fcabe077 | 3438 | elif test "x$enable_epoll" != "xno" -a "x$squid_cv_epoll_works" = "xyes" ; then |
8075a4da | 3439 | squid_opt_io_loop_engine="epoll" |
26d50fd2 | 3440 | elif test "x$enable_kqueue" != "xno" ; then |
8075a4da | 3441 | squid_opt_io_loop_engine="kqueue" |
a1ad2f9b AJ |
3442 | elif test "x$enable_devpoll" != "xno" ; then |
3443 | squid_opt_io_loop_engine="devpoll" | |
fcabe077 | 3444 | elif test "x$enable_poll" != "xno" -a "x$ac_cv_func_poll" = "xyes" ; then |
8075a4da | 3445 | squid_opt_io_loop_engine="poll" |
39145d19 | 3446 | elif test "x$enable_select" != "xno" -a "x$ac_cv_func_select" = "xyes"; then |
8075a4da | 3447 | squid_opt_io_loop_engine="select" |
39145d19 AJ |
3448 | elif test "x$enable_select" != "xno" -a "x$squid_host_os" = "xmingw"; then |
3449 | squid_opt_io_loop_engine="select_win32" | |
1b3db6d9 | 3450 | else |
a1ad2f9b | 3451 | AC_MSG_WARN([Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!]) |
be0c7ff0 | 3452 | AC_MSG_WARN([Will try select and hope for the best.]) |
8075a4da | 3453 | squid_opt_io_loop_engine="select" |
1b3db6d9 | 3454 | fi |
d474c7a6 | 3455 | |
8075a4da | 3456 | AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.]) |
d474c7a6 | 3457 | |
8aafbbc1 AJ |
3458 | AM_CONDITIONAL(ENABLE_POLL, test "x$squid_opt_io_loop_engine" = "xpoll") |
3459 | AM_CONDITIONAL(ENABLE_EPOLL, test "x$squid_opt_io_loop_engine" = "xepoll") | |
3460 | AM_CONDITIONAL(ENABLE_SELECT, test "x$squid_opt_io_loop_engine" = "xselect") | |
3461 | AM_CONDITIONAL(ENABLE_SELECT_WIN32, test "x$squid_opt_io_loop_engine" = "xselect_win32") | |
3462 | AM_CONDITIONAL(ENABLE_KQUEUE, test "x$squid_opt_io_loop_engine" = "xkqueue") | |
3463 | AM_CONDITIONAL(ENABLE_DEVPOLL, test "x$squid_opt_io_loop_engine" = "xdevpoll") | |
d474c7a6 | 3464 | |
8075a4da | 3465 | case $squid_opt_io_loop_engine in |
0abb39dd | 3466 | epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;; |
a1ad2f9b | 3467 | devpoll) AC_DEFINE(USE_DEVPOLL,1,[Use /dev/poll for the IO loop]) ;; |
0abb39dd FC |
3468 | poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;; |
3469 | kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;; | |
3470 | select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;; | |
3471 | select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;; | |
d474c7a6 | 3472 | esac |
1b3db6d9 | 3473 | |
96c2bb61 AR |
3474 | if test "x$ac_cv_func_sched_getaffinity" = "xyes" -a "x$ac_cv_func_sched_setaffinity" = "xyes" ; then |
3475 | AC_DEFINE(HAVE_CPU_AFFINITY,1,[Support setting CPU affinity for workers]) | |
3476 | fi | |
3477 | ||
91983da0 FC |
3478 | SQUID_CHECK_SETRESUID_WORKS |
3479 | if test "x$squid_cv_resuid_works" = "xyes" ; then | |
be0c7ff0 | 3480 | AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Knowing that setresuid() exists is not enough, because RedHat 5.0 declares setresuid() but does not implement it.]) |
5c51415d | 3481 | fi |
60939927 | 3482 | |
2ff9dfaa | 3483 | AC_CHECK_HEADERS(mswsock.h) |
14c0d3ab DK |
3484 | AC_MSG_CHECKING([for constant CMSG_SPACE]) |
3485 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | |
3486 | #if HAVE_SYS_SOCKET_H | |
3487 | #include <sys/socket.h> | |
3488 | #endif | |
2ff9dfaa AJ |
3489 | #if HAVE_MSWSOCK_H |
3490 | #include <mswsock.h> | |
3491 | #endif | |
14c0d3ab DK |
3492 | |
3493 | int a[CMSG_SPACE(int)]; | |
3494 | ]])], [ | |
3495 | AC_MSG_RESULT(yes) | |
3496 | AC_DEFINE(HAVE_CONSTANT_CMSG_SPACE, 1, [Define to 1 if CMSG_SPACE is constant]) | |
3497 | ], [ | |
3498 | AC_MSG_RESULT(no) | |
3499 | ]) | |
3500 | ||
ecd8516d | 3501 | AC_CHECK_TYPE(struct cmsghdr,AC_DEFINE(HAVE_CMSGHDR,1,[The system provides struct cmsghdr]),,[ |
c72f8c2e AJ |
3502 | #if HAVE_SYS_SOCKET_H |
3503 | #include <sys/socket.h> | |
3504 | #endif | |
2ff9dfaa AJ |
3505 | #if HAVE_MSWSOCK_H |
3506 | #include <mswsock.h> | |
3507 | #endif | |
c72f8c2e AJ |
3508 | #if HAVE_WINSOCK2_H |
3509 | #include <winsock2.h> | |
3510 | #endif | |
3511 | ]) | |
3512 | ||
ecd8516d | 3513 | AC_CHECK_TYPE(struct iovec,AC_DEFINE(HAVE_IOVEC,1,[The system provides struct iovec]),,[ |
c72f8c2e AJ |
3514 | #if HAVE_SYS_SOCKET_H |
3515 | #include <sys/socket.h> | |
3516 | #endif | |
3517 | #if HAVE_WINSOCK2_H | |
3518 | #include <winsock2.h> | |
3519 | #endif | |
9ac84dcf FC |
3520 | #if HAVE_SYS_UIO_H |
3521 | #include <sys/uio.h> | |
3522 | #endif | |
c72f8c2e AJ |
3523 | ]) |
3524 | ||
ecd8516d | 3525 | AC_CHECK_TYPE(struct msghdr,AC_DEFINE(HAVE_MSGHDR,1,[The system provides struct msghdr]),,[ |
c72f8c2e AJ |
3526 | #if HAVE_SYS_SOCKET_H |
3527 | #include <sys/socket.h> | |
3528 | #endif | |
2ff9dfaa AJ |
3529 | #if HAVE_MSWSOCK_H |
3530 | #include <mswsock.h> | |
3531 | #endif | |
c72f8c2e AJ |
3532 | #if HAVE_WINSOCK2_H |
3533 | #include <winsock2.h> | |
3534 | #endif | |
3535 | ]) | |
3536 | ||
ecd8516d | 3537 | AC_CHECK_TYPE(struct sockaddr_un,AC_DEFINE(HAVE_SOCKADDR_UN,1,[The system provides sockaddr_un]),,[ |
c72f8c2e AJ |
3538 | #if HAVE_SYS_UN_H |
3539 | #include <sys/un.h> | |
3540 | #endif | |
3541 | #if HAVE_SYS_SOCKET_H | |
3542 | #include <sys/socket.h> | |
3543 | #endif | |
3544 | #if HAVE_WINSOCK2_H | |
3545 | #include <winsock2.h> | |
3546 | #endif | |
3547 | ]) | |
3548 | ||
0abb39dd | 3549 | SQUID_CHECK_FUNC_STRNSTR |
cee08cbc | 3550 | |
5cafc1d6 | 3551 | dnl IP-Filter support requires ipf header files. These aren't |
3552 | dnl installed by default, so we need to check for them | |
fcabe077 | 3553 | if test "x$enable_ipf_transparent" != "xno" ; then |
d25bbe26 | 3554 | SQUID_CHECK_BROKEN_SOLARIS_IPFILTER |
20ad76ab | 3555 | AC_MSG_CHECKING(for availability of IP-Filter header files) |
42b51993 | 3556 | # hold on to your hats... |
fcabe077 FC |
3557 | if test "x$ac_cv_header_ip_compat_h" = "xyes" -o \ |
3558 | "x$ac_cv_header_ip_fil_compat_h" = "xyes" -o \ | |
3559 | "x$ac_cv_header_netinet_ip_compat_h" = "xyes" -o \ | |
3560 | "x$ac_cv_header_netinet_ip_fil_compat_h" = "xyes" ; then | |
42b51993 | 3561 | have_ipfilter_compat_header="yes" |
d25bbe26 AJ |
3562 | fi |
3563 | if test "x$have_ipfilter_compat_header" = "xyes" -a \ | |
fcabe077 FC |
3564 | "x$ac_cv_header_ip_fil_h" = "xyes" -a \ |
3565 | "x$ac_cv_header_ip_nat_h" = "xyes" ; then | |
1d26e252 | 3566 | enable_ipf_transparent="yes" |
fcabe077 FC |
3567 | elif test "x$have_ipfilter_compat_header" = "xyes" -a \ |
3568 | "x$ac_cv_header_netinet_ip_fil_h" = "xyes" -a \ | |
3569 | "x$ac_cv_header_netinet_ip_nat_h" = "xyes" ; then | |
1d26e252 | 3570 | enable_ipf_transparent="yes" |
eb824054 | 3571 | else |
1d26e252 | 3572 | enable_ipf_transparent="no" |
5cafc1d6 | 3573 | fi |
3574 | AC_MSG_RESULT($IPF_TRANSPARENT) | |
d25bbe26 AJ |
3575 | |
3576 | ## On Solaris Ipfilter includes expect that SOLARIS2 is defined with the | |
3577 | ## Solaris minor version (8, 9, 10, ...) | |
3578 | if test "x$enable_ipf_transparent" = "xyes" -a "x$squid_host_os" = "xsolaris" ; then | |
3579 | solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'` | |
3580 | CFLAGS="-DSOLARIS2=$solrev $CFLAGS" | |
3581 | CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS" | |
3582 | fi | |
3583 | ||
1d26e252 FC |
3584 | fi |
3585 | AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent]) | |
0f658b5b | 3586 | SQUID_DEFINE_BOOL(IPF_TRANSPARENT,$enable_ipf_transparent, |
1d26e252 FC |
3587 | [Enable support for IPF-style transparent proxying]) |
3588 | ||
b2192042 AJ |
3589 | dnl PF /dev/pf support requires a header file. |
3590 | if test "x$with_nat_devpf" != "xno" ; then | |
fcabe077 FC |
3591 | if test "x$ac_cv_header_net_pfvar_h" = "xyes" -o \ |
3592 | "x$ac_cv_header_net_pf_pfvar_h" = "xyes"; then | |
b2192042 AJ |
3593 | if test "x$with_nat_devpf" = "xauto" ; then |
3594 | with_nat_devpf="no" | |
fcabe077 FC |
3595 | fi |
3596 | else | |
b2192042 AJ |
3597 | if test "x$with_nat_devpf" = "xyes" ; then |
3598 | AC_MSG_ERROR([PF /dev/pf based NAT requested but needed header not found]) | |
fcabe077 | 3599 | fi |
b2192042 | 3600 | with_nat_devpf="no" |
fcabe077 | 3601 | fi |
2b0dd4ac | 3602 | fi |
b2192042 | 3603 | SQUID_DEFINE_BOOL(PF_TRANSPARENT,${enable_pf_transparent:=no}, |
38ff0a40 | 3604 | [Enable support for PF-style transparent proxying]) |
b2192042 AJ |
3605 | SQUID_DEFINE_BOOL(USE_NAT_DEVPF,${with_nat_devpf:=no}, |
3606 | [Enable support for /dev/pf NAT lookups]) | |
2b0dd4ac | 3607 | |
fcabe077 FC |
3608 | if test "x$enable_linux_netfilter" != "xno" ; then |
3609 | if test "x$ac_cv_header_linux_netfilter_ipv4_h" = "xyes"; then | |
3610 | if test "x$enable_linux_netfilter" = "xauto" ; then | |
4bd144d2 FC |
3611 | enable_linux_netfilter=yes |
3612 | fi | |
3613 | else | |
fcabe077 | 3614 | if test "x$enable_linux_netfilter" = "xauto" ; then |
4bd144d2 | 3615 | enable_linux_netfilter=no |
d852fbad | 3616 | else |
4bd144d2 | 3617 | AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found]) |
d852fbad | 3618 | fi |
4bd144d2 | 3619 | fi |
b50f1b2b | 3620 | fi |
0f658b5b | 3621 | SQUID_DEFINE_BOOL(LINUX_NETFILTER,$enable_linux_netfilter, |
969d4051 | 3622 | [Enable support for Transparent Proxy on Linux via Netfilter]) |
20ad76ab | 3623 | |
b50f1b2b | 3624 | dnl Netfilter TPROXY depends on libcap but the NAT parts can still work. |
4bd144d2 | 3625 | AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter]) |
fcabe077 | 3626 | if test "x$enable_linux_netfilter" = "xyes" -a "x$with_libcap" != "xyes" ; then |
3b7a7630 AJ |
3627 | AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for TPROXY]) |
3628 | AC_MSG_WARN([Linux Transparent Proxy (version 4+) support WILL NOT be enabled]) | |
3629 | AC_MSG_WARN([Reduced support to NAT Interception Proxy]) | |
be0c7ff0 | 3630 | # AC_DEFINEd later |
96f08e2d FC |
3631 | fi |
3632 | ||
11e8cfe3 | 3633 | if test "x$squid_opt_netfilterconntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then |
3b7a7630 | 3634 | AC_MSG_ERROR([Linux netfilter conntrack requires libcap support (libcap 2.09+)]) |
11e8cfe3 AB |
3635 | fi |
3636 | if test "x$with_netfilter_conntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then | |
3b7a7630 | 3637 | AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for netfilter mark support]) |
11e8cfe3 AB |
3638 | AC_MSG_WARN([Linux netfilter marking support WILL NOT be enabled]) |
3639 | with_netfilter_conntrack=no | |
3640 | fi | |
3641 | AC_MSG_NOTICE([Linux Netfilter Conntrack support enabled: ${with_netfilter_conntrack} ${squid_opt_netfilterconntrackpath}]) | |
3642 | ||
3643 | ||
3644 | AC_ARG_ENABLE(zph-qos, | |
3645 | AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]), [ | |
3646 | SQUID_YESNO([$enableval], | |
3647 | [unrecognized argument to --enable-zph-qos: $enableval]) | |
3648 | ]) | |
3649 | SQUID_DEFINE_BOOL(USE_QOS_TOS,${enable_zph_qos:=yes}, | |
3650 | [Enable Zero Penalty Hit QOS. When set, Squid will alter the | |
3651 | TOS field of HIT responses to help policing network traffic]) | |
3652 | AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos]) | |
3653 | if test x"$enable_zph_qos" = "xyes" ; then | |
3654 | AC_MSG_NOTICE([QOS netfilter mark preservation enabled: $with_netfilter_conntrack]) | |
3655 | SQUID_DEFINE_BOOL(USE_LIBNETFILTERCONNTRACK,${with_netfilter_conntrack:=no}, | |
3656 | [Enable support for QOS netfilter mark preservation]) | |
3657 | fi | |
3658 | ||
c2afddd8 AJ |
3659 | |
3660 | AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB='']) | |
3661 | AC_ARG_ENABLE(gnuregex, | |
3662 | AS_HELP_STRING([--enable-gnuregex], | |
3663 | [Compile GNUregex. Unless you have reason to use | |
3664 | this option, you should not enable it. | |
3665 | This library file is usually only required on Windows and | |
3666 | very old Unix boxes which do not have their own regex | |
3667 | library built in.]), [ | |
3668 | SQUID_YESNO([$enableval],[unrecognized argument to --enable-gnuregex: $enableval]) | |
3669 | ]) | |
3670 | # force-enable on old solaris and nextstep | |
3671 | if test "x${enable_gnuregex:=auto}" = "xauto" ; then | |
3672 | case "$host" in | |
3673 | *-sun-solaris2.[[0-4]]) | |
3674 | enable_gnuregex="yes" | |
3675 | ;; | |
3676 | *-next-nextstep*) | |
3677 | enable_gnuregex="yes" | |
3678 | ;; | |
3679 | esac | |
3680 | fi | |
3681 | ||
3682 | # try detecting if it is needed | |
3683 | if test "x$enable_gnuregex" = "xauto" ; then | |
3684 | SQUID_CHECK_REGEX_WORKS | |
3685 | if test "x$squid_cv_regex_works" = "xyes" ; then | |
3686 | enable_gnuregex=no | |
3687 | else | |
3688 | enable_gnuregex=yes | |
3689 | fi | |
3690 | fi | |
3691 | AC_MSG_CHECKING(if GNUregex needs to be compiled) | |
3692 | AC_MSG_RESULT($enable_gnuregex) | |
3693 | if test "x$enable_gnuregex" = "xyes"; then | |
3694 | # for some reason (force-enable, test..) gnuregex was found as needed. Override any system lib | |
3695 | REGEXLIB="" | |
3696 | fi | |
3697 | #if no reason was found to enable gnuregex, disable it | |
3698 | if test "x$enable_gnuregex" = "xauto" ; then | |
3699 | enable_gnuregex=no | |
3700 | fi | |
3701 | SQUID_DEFINE_BOOL(USE_GNUREGEX,$enable_gnuregex,[Define if we should use GNU regex]) | |
3702 | AC_SUBST(REGEXLIB) | |
3703 | ||
8e0acaf5 FC |
3704 | SQUID_DETECT_UDP_SND_BUFSIZE |
3705 | SQUID_DETECT_UDP_RECV_BUFSIZE | |
3706 | SQUID_DETECT_TCP_SND_BUFSIZE | |
3707 | SQUID_DETECT_TCP_RECV_BUFSIZE | |
6bf65235 | 3708 | |
fa8be5b5 | 3709 | SQUID_CHECK_RECV_ARG_TYPE |
5c3c56fa FC |
3710 | SQUID_CHECK_NEED_SYS_ERRLIST |
3711 | SQUID_CHECK_MAXPATHLEN | |
cc192b50 | 3712 | |
819656da AJ |
3713 | SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK |
3714 | SQUID_CHECK_RESOLVER_FIELDS | |
3715 | ||
615540cd | 3716 | AC_CHECK_HEADERS(sys/statvfs.h) |
fcabe077 | 3717 | if test "x$ac_cv_header_sys_statvfs_h" = "xyes" ; then |
bb214e97 | 3718 | SQUID_CHECK_WORKING_STATVFS |
c68e9c6b | 3719 | fi |
615540cd AJ |
3720 | if test "x$ac_cv_func_statvfs" != "xyes" ; then |
3721 | AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/vfs.h sys/statfs.h) | |
3722 | AC_CHECK_FUNCS(statfs) | |
3723 | SQUID_CHECK_F_FRSIZE_IN_STATFS | |
3724 | fi | |
c68e9c6b | 3725 | |
4eb85b7a | 3726 | dnl Squid will not usually attempt to translate templates when building |
461b8219 | 3727 | AC_ARG_ENABLE(translation, |
4eb85b7a AJ |
3728 | AS_HELP_STRING([--enable-translation],[Generate the localized error page templates and manuals. |
3729 | Which can also be downloaded from http://www.squid-cache.org/Versions/langpack/.]), [ | |
3730 | SQUID_YESNO([$enableval], | |
3731 | [unrecognized argument to --enable-translation: $enableval]) | |
461b8219 | 3732 | ]) |
4eb85b7a | 3733 | if test "x${enable_translation:=no}" = "xyes" ; then |
461b8219 | 3734 | AX_WITH_PROG([PO2HTML],[po2html]) |
02259ff8 | 3735 | AX_WITH_PROG([PO2TEXT],[po2txt]) |
461b8219 AJ |
3736 | else |
3737 | PO2HTML="off" | |
02259ff8 | 3738 | PO2TEXT="off" |
461b8219 AJ |
3739 | fi |
3740 | AC_SUBST(PO2HTML) | |
02259ff8 | 3741 | AC_SUBST(PO2TEXT) |
ee1a8ac2 | 3742 | |
43000484 AJ |
3743 | dnl Squid now has limited locale handling ... |
3744 | dnl on error pages | |
3745 | AC_ARG_ENABLE(auto-locale, | |
62979ab1 | 3746 | AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the |
21d5413e | 3747 | clients request headers. |
fb46b778 FC |
3748 | When disabled Squid requires explicit language configuration.]), [ |
3749 | SQUID_YESNO([$enableval], | |
3750 | [unrecognized argument to --disable-auto-locale: $enableval]) | |
8db7a54b | 3751 | ]) |
fb46b778 FC |
3752 | AC_MSG_NOTICE([Multi-Language support enabled: ${enable_auto_locale:=yes}]) |
3753 | SQUID_DEFINE_BOOL(USE_ERR_LOCALES,$enable_auto_locale, | |
3754 | [Use multi-language support on error pages]) | |
3755 | ||
43000484 | 3756 | |
090089c4 | 3757 | dnl Need the debugging version of malloc if available |
3758 | XTRA_OBJS='' | |
fcabe077 | 3759 | if test "x$ac_cv_lib_malloc_main" = "xyes" ; then |
090089c4 | 3760 | if test -r /usr/lib/debug/malloc.o ; then |
3761 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o" | |
3762 | fi | |
3763 | if test -r /usr/lib/debug/mallocmap.o ; then | |
3764 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o" | |
3765 | fi | |
3766 | fi | |
3767 | AC_SUBST(XTRA_OBJS) | |
3768 | ||
fcabe077 | 3769 | if test "x$XTRA_LIBS" = "x"; then |
38fea766 | 3770 | XTRA_LIBS="$LIBS" |
0f5a16f8 | 3771 | dnl minor cleanup |
3772 | XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"` | |
38fea766 | 3773 | LIBS='' |
3774 | fi | |
090089c4 | 3775 | AC_SUBST(XTRA_LIBS) |
3776 | ||
daed6927 FC |
3777 | AC_SUBST(SQUID_CFLAGS) |
3778 | AC_SUBST(SQUID_CXXFLAGS) | |
3779 | ||
b2f0a375 AJ |
3780 | AC_ARG_VAR([BUILDCXXFLAGS],[C++ compiler flags for building compile-time tools. e.g. cf_gen]) |
3781 | if test "x$BUILDCXXFLAGS" = "x"; then | |
3782 | # if we are NOT cross-compiling, use the default build flags for cf_gen and friends | |
3783 | # otherwise rely on the user-provided value | |
3784 | if test "x$squid_cv_check_marchnative" = "xyes"; then | |
3785 | # always valid for the Build compiler. | |
b3080eec | 3786 | BUILDCXXFLAGS="-march=native" |
b2f0a375 AJ |
3787 | fi |
3788 | BUILDCXXFLAGS="$BUILDCXXFLAGS $CXXFLAGS" | |
3789 | fi | |
3790 | AC_SUBST(BUILDCXXFLAGS) | |
3791 | ||
90b412dd AJ |
3792 | AC_MSG_NOTICE([BUILD LIBRARIES: $LIBS]) |
3793 | AC_MSG_NOTICE([BUILD EXTRA LIBRARIES: $XTRA_LIBS]) | |
3794 | AC_MSG_NOTICE([BUILD OBJECTS: $OBJS]) | |
3795 | AC_MSG_NOTICE([BUILD EXTRA OBJECTS: $XTRA_OBJS]) | |
3796 | AC_MSG_NOTICE([BUILD C FLAGS: $CFLAGS]) | |
3797 | AC_MSG_NOTICE([BUILD EXTRA C FLAGS: $SQUID_CFLAGS]) | |
3798 | AC_MSG_NOTICE([BUILD C++ FLAGS: $CXXFLAGS]) | |
3799 | AC_MSG_NOTICE([BUILD EXTRA C++ FLAGS: $SQUID_CXXFLAGS]) | |
b2f0a375 | 3800 | AC_MSG_NOTICE([BUILD Tools C++ FLAGS: $BUILDCXXFLAGS]) |
daed6927 | 3801 | |
090089c4 | 3802 | dnl Clean up after OSF/1 core dump bug |
3803 | rm -f core | |
3804 | ||
7a03447c AJ |
3805 | AC_CONFIG_FILES([ |
3806 | Makefile | |
3807 | compat/Makefile | |
7a03447c | 3808 | contrib/Makefile |
7a03447c AJ |
3809 | doc/Makefile |
3810 | doc/manuals/Makefile | |
86b8d400 | 3811 | doc/release-notes/Makefile |
6b99776c | 3812 | errors/Makefile |
6b99776c AJ |
3813 | icons/Makefile |
3814 | lib/Makefile | |
3815 | lib/libTrie/Makefile | |
3816 | lib/libTrie/test/Makefile | |
3817 | lib/ntlmauth/Makefile | |
3818 | lib/profiler/Makefile | |
3819 | lib/rfcnb/Makefile | |
3820 | lib/smblib/Makefile | |
3821 | lib/snmplib/Makefile | |
3822 | scripts/Makefile | |
3823 | src/Makefile | |
3824 | src/acl/Makefile | |
e046643f AJ |
3825 | src/acl/external/Makefile |
3826 | src/acl/external/AD_group/Makefile | |
3827 | src/acl/external/delayer/Makefile | |
3828 | src/acl/external/eDirectory_userip/Makefile | |
3829 | src/acl/external/file_userip/Makefile | |
3830 | src/acl/external/kerberos_ldap_group/Makefile | |
4a544c9d | 3831 | src/acl/external/kerberos_sid_group/Makefile |
e046643f AJ |
3832 | src/acl/external/LDAP_group/Makefile |
3833 | src/acl/external/LM_group/Makefile | |
3834 | src/acl/external/session/Makefile | |
3835 | src/acl/external/SQL_session/Makefile | |
3836 | src/acl/external/unix_group/Makefile | |
3837 | src/acl/external/wbinfo_group/Makefile | |
3838 | src/acl/external/time_quota/Makefile | |
6b99776c AJ |
3839 | src/adaptation/Makefile |
3840 | src/adaptation/icap/Makefile | |
3841 | src/adaptation/ecap/Makefile | |
3842 | src/anyp/Makefile | |
3843 | src/auth/Makefile | |
3844 | src/auth/basic/Makefile | |
03901cf8 AJ |
3845 | src/auth/basic/DB/Makefile |
3846 | src/auth/basic/fake/Makefile | |
3847 | src/auth/basic/getpwnam/Makefile | |
3848 | src/auth/basic/LDAP/Makefile | |
3849 | src/auth/basic/NCSA/Makefile | |
3850 | src/auth/basic/NIS/Makefile | |
3851 | src/auth/basic/PAM/Makefile | |
3852 | src/auth/basic/POP3/Makefile | |
3853 | src/auth/basic/RADIUS/Makefile | |
3854 | src/auth/basic/SASL/Makefile | |
3855 | src/auth/basic/SMB/Makefile | |
3856 | src/auth/basic/SMB_LM/Makefile | |
3857 | src/auth/basic/SSPI/Makefile | |
6b99776c | 3858 | src/auth/digest/Makefile |
d4d7f6dd AJ |
3859 | src/auth/digest/eDirectory/Makefile |
3860 | src/auth/digest/file/Makefile | |
3861 | src/auth/digest/LDAP/Makefile | |
6b99776c | 3862 | src/auth/negotiate/Makefile |
16c02b14 AJ |
3863 | src/auth/negotiate/kerberos/Makefile |
3864 | src/auth/negotiate/SSPI/Makefile | |
3865 | src/auth/negotiate/wrapper/Makefile | |
6b99776c | 3866 | src/auth/ntlm/Makefile |
b817c20f AJ |
3867 | src/auth/ntlm/fake/Makefile |
3868 | src/auth/ntlm/SMB_LM/Makefile | |
3869 | src/auth/ntlm/SSPI/Makefile | |
6b99776c AJ |
3870 | src/base/Makefile |
3871 | src/clients/Makefile | |
3872 | src/comm/Makefile | |
4a3b98d7 | 3873 | src/dns/Makefile |
13d8c08c | 3874 | src/DiskIO/Makefile |
d9691f09 AJ |
3875 | src/DiskIO/AIO/Makefile |
3876 | src/DiskIO/Blocking/Makefile | |
3877 | src/DiskIO/DiskDaemon/Makefile | |
3878 | src/DiskIO/DiskThreads/Makefile | |
3879 | src/DiskIO/IpcIo/Makefile | |
3880 | src/DiskIO/Mmapped/Makefile | |
6b99776c AJ |
3881 | src/esi/Makefile |
3882 | src/eui/Makefile | |
3883 | src/format/Makefile | |
3884 | src/fs/Makefile | |
3885 | src/ftp/Makefile | |
3886 | src/helper/Makefile | |
3887 | src/http/Makefile | |
3888 | src/http/one/Makefile | |
d6d6203a AJ |
3889 | src/http/url_rewriters/Makefile |
3890 | src/http/url_rewriters/fake/Makefile | |
3891 | src/http/url_rewriters/LFS/Makefile | |
6b99776c AJ |
3892 | src/icmp/Makefile |
3893 | src/ident/Makefile | |
3894 | src/ip/Makefile | |
3895 | src/ipc/Makefile | |
3896 | src/log/Makefile | |
4d5dd85a AJ |
3897 | src/log/DB/Makefile |
3898 | src/log/file/Makefile | |
6b99776c AJ |
3899 | src/mem/Makefile |
3900 | src/mgr/Makefile | |
3901 | src/parser/Makefile | |
36c774f7 | 3902 | src/proxyp/Makefile |
6b99776c | 3903 | src/repl/Makefile |
65e41a45 | 3904 | src/sbuf/Makefile |
7dcca85b | 3905 | src/security/Makefile |
cb0b3d63 AJ |
3906 | src/security/cert_generators/Makefile |
3907 | src/security/cert_generators/file/Makefile | |
bbf79f12 AJ |
3908 | src/security/cert_validators/Makefile |
3909 | src/security/cert_validators/fake/Makefile | |
6b99776c AJ |
3910 | src/servers/Makefile |
3911 | src/snmp/Makefile | |
3912 | src/ssl/Makefile | |
2745fea5 | 3913 | src/store/Makefile |
0c1f8b9b AJ |
3914 | src/store/id_rewriters/Makefile |
3915 | src/store/id_rewriters/file/Makefile | |
6b99776c | 3916 | test-suite/Makefile |
94ab55b0 | 3917 | tools/Makefile |
3d276e1d | 3918 | tools/apparmor/Makefile |
33d1abfe | 3919 | tools/helper-mux/Makefile |
2ccf2eb2 | 3920 | tools/purge/Makefile |
a35a0ac7 | 3921 | tools/squidclient/Makefile |
422cb5da | 3922 | tools/systemd/Makefile |
a35a0ac7 | 3923 | tools/sysvinit/Makefile |
53cbe3e4 | 3924 | ]) |
43ae1d95 | 3925 | |
3e7b6055 | 3926 | # must configure libltdl subdir unconditionally for "make distcheck" to work |
081863f3 | 3927 | #AC_CONFIG_SUBDIRS(libltdl) |
3e7b6055 | 3928 | |
6a9f6389 | 3929 | AC_OUTPUT |