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