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