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