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