]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
Fixed merge error.
[thirdparty/squid.git] / configure.in
CommitLineData
e2716c57 1
090089c4 2dnl
262a0e14 3dnl $Id$
090089c4 4dnl
090089c4 5dnl
6dnl
62979ab1 7AC_INIT([Squid Web Proxy],[3.HEAD-BZR],[http://www.squid-cache.org/bugs/],[squid])
d966027f 8AC_PREREQ(2.61)
62979ab1 9AC_CONFIG_HEADERS([include/autoconf.h])
71b12d7c 10AC_CONFIG_AUX_DIR(cfgaux)
8d9ce05e 11AC_CONFIG_SRCDIR([src/main.cc])
189f1e66 12AM_INIT_AUTOMAKE([tar-ustar nostdinc])
c2720d44 13AC_REVISION($Revision$)dnl
a2794549 14AC_PREFIX_DEFAULT(/usr/local/squid)
246d7ffc 15AM_MAINTAINER_MODE
a2794549 16
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])
6a56798f 21
63e02610 22PRESET_CFLAGS="$CFLAGS"
23PRESET_LDFLAGS="$LDFLAGS"
24
a2794549 25dnl Set default LDFLAGS
26if test -z "$LDFLAGS"; then
27 LDFLAGS="-g"
28fi
29
aff48cc8 30# Check for GNU cc
a2794549 31AC_PROG_CC
e6c4cdd6 32AM_PROG_CC_C_O
29b8d8d6 33AC_PROG_CXX
62979ab1 34AC_LANG([C++])
88d50a22 35AC_CANONICAL_HOST
3e7b6055 36
40503c27
FC
37AC_MSG_CHECKING([simplified host os])
38squid_host_os=`echo $host_os|sed 's/[0-9].*//'`
39squid_host_os_version=`echo $host_os|sed "s/$squid_host_os//"`
40AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
41# on windows squid_host_os is either mingw or cygwin, version is 32
42
aff48cc8
FC
43# test for programs
44AC_PROG_LIBTOOL
45AC_PROG_RANLIB
46AC_PROG_CPP
47AC_PROG_INSTALL
48AC_PROG_LN_S
49AC_PROG_EGREP
50
51AC_PATH_PROG(SH, sh, /bin/sh)
52AC_PATH_PROG(FALSE, false, /usr/bin/false)
53AC_PATH_PROG(TRUE, true, /usr/bin/true)
54AC_PATH_PROG(MV, mv, $FALSE)
55AC_PATH_PROG(MKDIR, mkdir, $FALSE)
56AC_PATH_PROG(LN, ln, cp)
57AC_PATH_PROG(CHMOD, chmod, $FALSE)
6d1c1ab1 58AC_PATH_PROG(TR, tr, $FALSE)
aff48cc8 59AC_PATH_PROG(RM, rm, $FALSE)
ffa3bad9 60AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
aff48cc8
FC
61dnl Libtool 2.2.6 requires: rm -f
62RM="$RM -f"
63
64AC_PATH_PROG(PERL, perl, none)
65if test "$ac_cv_path_PERL" = "none"; then
66 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
67fi
07f370ee 68AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
aff48cc8
FC
69
70dnl set $(AR)
71AC_PATH_PROG(AR, ar, $FALSE)
72AR_R="$AR r"
aff48cc8
FC
73AC_SUBST(AR_R)
74
f9d138eb 75
d1f95b42 76dnl Make the squid top srcdir available to sub-packages as --with-squid=PATH
fa6307ae 77ac_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir"
d1f95b42 78
fa6307ae 79squid_opt_enable_werror="yes" # default
0b45d157
FC
80AC_ARG_ENABLE(strict-error-checking,
81 AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
82 with all possible static compiler error-checks enbled.
83 This flag disables the behavior]),
84[
85 if test "${enableval}" = "no"
86 then
fa6307ae 87 squid_opt_enable_werror="no"
0b45d157
FC
88 fi
89])
d1f95b42 90
f7baea2d 91use_loadable_modules=1
3e7b6055
AR
92AC_MSG_CHECKING(whether to use loadable modules)
93AC_ARG_ENABLE(loadable-modules,
8075a4da 94 AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [
3e7b6055
AR
95 case "${enableval}" in
96 yes) use_loadable_modules=yes ;;
97 no) use_loadable_modules=no ;;
98 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
99 esac
100 AC_MSG_RESULT([$use_loadable_modules, explicitly])
8075a4da 101 ], [
3e7b6055
AR
102 use_loadable_modules=yes;
103 AC_MSG_RESULT([$use_loadable_modules, implicitly])
8075a4da 104 ])
3e7b6055
AR
105
106AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
107
108if test $use_loadable_modules = yes;
109then
110 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
111 AC_ENABLE_SHARED
112else
113 AC_DISABLE_SHARED
114fi
115
116AC_LIBTOOL_DLOPEN
117if test $use_loadable_modules = yes;
118then
0fb3665c
AJ
119 dnl Linux LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
120 dnl But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
121 top_build_prefix=${ac_top_build_prefix}
122 AC_SUBST(top_build_prefix)
123
660faa02 124 AC_LIBLTDL_CONVENIENCE
3e7b6055 125fi
f5691f9c 126AC_LTDL_DLLIB
3e7b6055
AR
127
128# Do we need these unconditionally for "make distcheck" to work?
129AC_SUBST(INCLTDL)
130AC_SUBST(LIBLTDL)
131
132if test $use_loadable_modules = yes;
133then
134 # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
135 LIBADD_DL=${lt_cv_dlopen_libs}
136 AC_SUBST([LIBADD_DL])
137fi
138
88d50a22 139
07f370ee 140SQUID_CC_GUESS_VARIANT
fa6307ae 141SQUID_CC_GUESS_OPTIONS
f9d138eb 142
a2794549 143
00fa2c12 144REGEXLIB='' # -lregex
cc937513 145# LIBREGEX='' # libregex.a
090089c4 146
a2794549 147dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
148AC_EXEEXT
149AC_OBJEXT
150
151if test -z "$EXEEXT"; then
152 CGIEXT=".cgi"
153else
7aeb8001 154 # automake automatically adds .exe when installing binaries
155 CGIEXT=""
a2794549 156fi
7aeb8001 157AC_SUBST(CGIEXT)
a2794549 158
0e6d05ef 159dnl this should be expanded to a list of platform sensible support requirements.
160dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
8075a4da
FC
161AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,
162 [test "$squid_host_os" = "mingw" -o "$squid_host_os" = "cygwin"])
40503c27 163AM_CONDITIONAL(USE_IPC_WIN32,[test "$squid_host_os" = "mingw"])
df087e68 164
40503c27 165if test $squid_host_os = "mingw"; then
4b26fae9 166 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
167 CFLAGS="$CFLAGS -mthreads"
168 CXXFLAGS="$CXXFLAGS -mthreads"
169 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
eed82608
AJ
170 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
171 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
4b26fae9 172 else
173 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
174 LIBS="$LIBS -lpsapi"
175 fi
790ebe36 176 MINGW_LIBS="-lmingwex"
177 AC_SUBST(MINGW_LIBS)
40503c27 178fi
4b26fae9 179
a26bdc75 180if test -z "$CACHE_HTTP_PORT"; then
181 CACHE_HTTP_PORT="3128"
182fi
183if test -z "$CACHE_ICP_PORT"; then
184 CACHE_ICP_PORT="3130"
185fi
a26bdc75 186
f4aaf39c 187dnl Substitutions
6a9f6389 188AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
8075a4da 189 [What default TCP port to use for HTTP listening?])
58c1507a 190AC_SUBST(CACHE_HTTP_PORT)
6a9f6389 191AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
8075a4da 192 [What default UDP port to use for ICP listening?])
f5e5c4cf 193AC_SUBST(CACHE_ICP_PORT)
090089c4 194
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,
62979ab1 209 AS_HELP_STRING([--with-logdir=PATH],[Default location for squid logs. default: $DEFAULT_LOG_DIR]),
c8d2dc9b
AJ
210 [ case $withval in
211 yes|no)
212 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
213 ;;
214 *)
215 DEFAULT_LOG_DIR="$withval"
216 ;;
217 esac
218 ]
219)
220AC_SUBST(DEFAULT_LOG_DIR)
221
b1d38b05 222DEFAULT_PIDFILE="$localstatedir/run/squid.pid"
a7f6af35 223AC_ARG_WITH(pidfile,
e0eb5853
FC
224 AS_HELP_STRING([--with-pidfile=PATH],
225 [Default location for squid PID file. default: PREFIX/var/run/squid.pid]),
226[case $withval in
a7f6af35
AJ
227 yes|no)
228 AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
229 ;;
230 *)
231 DEFAULT_PIDFILE="$withval"
232 ;;
233 esac
e0eb5853 234])
a7f6af35
AJ
235AC_SUBST(DEFAULT_PIDFILE)
236
4c43504f 237if test "$GCC" = "yes"; then
238 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
239 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
240 case "$host" in
241 i386-*-freebsd*)
242 if test $GCCVER2 -lt 300 ; then
eed82608 243 AC_MSG_FAILURE([GCC $GCCVER causes a coredump on $host. Try a more recent GCC version])
4c43504f 244 fi
245 ;;
246 esac
247 unset GCCVER
248 unset GCCVER2
6bb3e7d4 249
4c43504f 250fi
251
30a4f2a8 252dnl Set Default CFLAGS
253if test -z "$PRESET_CFLAGS"; then
254 if test "$GCC" = "yes"; then
255 case "$host" in
97b12a5b 256 *-sun-sunos*)
30a4f2a8 257 # sunos has too many warnings for this to be useful
258 # motorola too
259 ;;
97b12a5b 260 *m88k*)
261 # Motorola cc/ld does not like -02 but is ok on -O
262 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
263 ;;
30a4f2a8 264 *)
fa6307ae 265 CFLAGS="$squid_cv_cc_option_wall $CFLAGS"
30a4f2a8 266 ;;
267 esac
81a820c6 268 else
269 case "$host" in
c415c128 270 *mips-sgi-irix6.*)
81a820c6 271 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
fa6307ae 272 CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
776b0191 273 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
81a820c6 274 -Wl,-woff,85,-woff,84,-woff,134 \
63e02610 275 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
fa6307ae 276 CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
776b0191 277 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
278 -Wl,-woff,85,-woff,84,-woff,134 \
279 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
81a820c6 280 ;;
e8f5fb18 281 alpha-dec-osf4.*)
553c24ae 282 # Mogul says DEC compilers take both -g and -O2
b6a2f15e 283 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
fa6307ae 284 CFLAGS="$squid_cv_cc_option_optimize $CFLAGS"
553c24ae 285 ;;
81a820c6 286 *)
287 ;;
288 esac
30a4f2a8 289 fi
30a4f2a8 290fi
291
d2e3605e 292dnl set squid required flags
293if test "$GCC" = "yes"; then
9f68fb10 294dnl Guido Serassio (serassio@squid-cache.org) 20070811
295dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
0a13cc9d 296dnl -Werror -Wmissing-prototypes -Wmissing-declarations
9f68fb10 297dnl TODO: check if the problem will be present in any other newer MinGW release.
298 case "$host_os" in
299 mingw|mingw32)
fa6307ae 300 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments"
9f68fb10 301 ;;
302 *)
fa6307ae 303 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
9f68fb10 304 ;;
305 esac
fa6307ae 306 SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments"
d2e3605e 307else
9f68fb10 308 SQUID_CFLAGS=
309 SQUID_CXXFLAGS=
d2e3605e 310fi
07f370ee 311
fa6307ae 312if test "$squid_opt_enable_werror" = "no"
07f370ee
FC
313then
314 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
315 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_option_werror"
316fi
317
d2e3605e 318AC_SUBST(SQUID_CFLAGS)
319AC_SUBST(SQUID_CXXFLAGS)
320
07f370ee
FC
321SQUID_CXX_CHECK_ARG_FHUGEOBJECTS
322if test "$squid_cv_cxx_arg_fhugeobjects" = "yes"; then
6a56798f
FC
323 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -fhuge-objects"
324fi
e0eb5853
FC
325# squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS
326SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
327SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
2060fa9a 328
6c0c04db 329SquidInline="yes"
83079644 330
331AC_ARG_ENABLE(optimizations,
ffa3bad9
FC
332 AS_HELP_STRING([--disable-optimizations],
333 [Don't compile Squid with compiler optimizations enabled.
a2f6a96c
FC
334 Optimization is good for production builds, but not
335 good for debugging. During development, use
336 --disable-optimizations to reduce compilation times
337 and allow easier debugging. This option implicitly
338 also enabled --disable-inline]),
83079644 339[ if test "$enableval" = "no" ; then
eed82608 340 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
83079644 341 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
342 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
343 SquidInline="no"
344 fi
345])
346
ffa3bad9 347AH_TEMPLATE(_USE_INLINE_,[Include inline methods into header file])
6c0c04db 348AC_ARG_ENABLE(inline,
62979ab1 349 AS_HELP_STRING([--disable-inline],[Don't compile trivial methods as inline. Squid
a2f6a96c
FC
350 is coded with much of the code able to be inlined.
351 Inlining is good for production builds, but not
352 good for development. During development, use
353 --disable-inline to reduce compilation times and
354 allow incremental builds to be quick. For
355 production builds, or load tests, use
356 --enable-inline to have squid make all trivial
357 methods inlinable by the compiler.]),
6c0c04db 358[ if test "$enableval" = "no" ; then
359 SquidInline="no"
360 fi
361])
362
363if test "$SquidInline" = "yes" ; then
364 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
ffa3bad9 365 AC_DEFINE(_USE_INLINE_, 1 , [Include inline methods into header file])
6c0c04db 366else
eed82608 367 AC_MSG_NOTICE([Inlining optimization disabled])
ffa3bad9 368 AC_DEFINE(_SQUID_INLINE_,[], [Keyword used by squid for inlining methods])
6c0c04db 369fi
370
fa80a8ef 371AC_ARG_ENABLE(debug-cbdata,
8075a4da
FC
372 AS_HELP_STRING([--enable-debug-cbdata],
373 [Provide some debug information in cbdata]), [
374if test "$enableval" = "yes" ; then
375 AC_MSG_NOTICE([cbdata debugging enabled])
376 AC_DEFINE(CBDATA_DEBUG,1, [Enable support for cbdata debug information])
377fi
fa80a8ef 378])
379
c9267250
AJ
380dnl Nasty hack to get autoconf 2.64 on Linux to run.
381dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
382AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[])
383
0961c811 384dnl This is a developer only option.. developers know how to set defines
385dnl
386dnl AC_ARG_ENABLE(xmalloc-debug,
387dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
388dnl [ if test "$enableval" = "yes" ; then
eed82608 389dnl AC_MSG_NOTICE([malloc debugging enabled])
6a9f6389 390dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
0961c811 391dnl fi
392dnl ])
393
394dnl This is a developer only option.. developers know how to set defines
395dnl
396dnl AC_ARG_ENABLE(xmalloc-debug-trace,
397dnl [ --enable-xmalloc-debug-trace
398dnl Detailed trace of memory allocations],
399dnl [ if test "$enableval" = "yes" ; then
eed82608 400dnl AC_MSG_NOTICE([malloc debug trace enabled])
6a9f6389 401dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
402dnl AC_DEFINE(XMALLOC_DEBUG,1)
0961c811 403dnl fi
404dnl ])
e5f4e1b0 405
0d00c98b 406AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics])
d9180414 407AC_ARG_ENABLE(xmalloc-statistics,
8075a4da
FC
408 AS_HELP_STRING([--enable-xmalloc-statistics],
409 [Show malloc statistics in status page]), [
410if test "$enableval" = "yes" ; then
411 AC_MSG_NOTICE([malloc statistics enabled])
412 AC_DEFINE(XMALLOC_STATISTICS,1)
413fi
e5f4e1b0 414])
415
8075a4da 416squid_opt_aufs_threads=""
f85c88f3 417AC_ARG_WITH(aufs-threads,
8075a4da
FC
418 AS_HELP_STRING([--with-aufs-threads=N_THREADS],
419 [Tune the number of worker threads for the aufs object store.]), [
420case $withval in
a3310b77 421 [[0-9]]*)
50fbcbd6 422 squid_opt_aufs_threads=$withval
a3310b77 423 ;;
424 *)
8b0d8e31 425 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
a3310b77 426 ;;
427 esac
428])
8075a4da 429if test -n "$squid_opt_aufs_threads"; then
50fbcbd6
FC
430 AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads])
431 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads,
8075a4da 432 [Defines how many threads aufs uses for I/O])
cd748f27 433fi
434
50fbcbd6 435AC_ARG_WITH(dl, AS_HELP_STRING([--with-dl],[Use dynamic linking]))
8154dd82 436if test "$with_dl" = "yes"; then
eed82608 437 AC_MSG_NOTICE([With dl])
8154dd82 438fi
f85c88f3 439
d235bc84 440AC_MSG_CHECKING([for DiskIO modules to be enabled])
50fbcbd6 441squid_disk_module_candidates=""
8075a4da 442squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules)
2513178d 443AC_ARG_ENABLE(disk-io,
50fbcbd6
FC
444 AS_HELP_STRING([--enable-disk-io="list of modules"],
445 [Build support for the list of disk I/O modules.
446 Set without a value or omitted, all available modules will be built.
447 See src/DiskIO for a list of available modules, or
448 Programmers Guide section on DiskIO
8075a4da
FC
449 for details on how to build your custom disk module]), [
450case $enableval in
2513178d 451 yes)
fe9ddf62 452 ${TRUE}
50fbcbd6 453 #do nothing, "auto" is ok
2513178d
AJ
454 ;;
455 no)
8075a4da 456 squid_opt_enable_diskio="no"
2513178d
AJ
457 ;;
458 *)
8075a4da 459 squid_opt_enable_diskio="yes"
47d80734 460 squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
d235bc84 461 SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
2513178d
AJ
462 ;;
463 esac
50fbcbd6
FC
464])
465
d235bc84 466# if requested to autodetect, find out what we have
50fbcbd6 467if test $squid_opt_enable_diskio = "auto"; then
8075a4da 468 squid_opt_enable_diskio="yes"
50fbcbd6 469 SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
50fbcbd6 470fi
d235bc84 471
47d80734 472AC_MSG_RESULT([${squid_disk_module_candidates:-none}])
dc299f29 473SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
8075a4da 474SQUID_DEFINE_UNQUOTED([USE_DISKIO],$squid_opt_enable_diskio,
50fbcbd6 475 [DiskIO modules are expected to be available.])
2513178d 476
dc299f29 477
40503c27 478
2513178d 479dnl Some autoconf.h defines we might enable later...
0b163dbb
FC
480AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
481AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
0d00c98b
FC
482AH_TEMPLATE(USE_DISKIO_AIO, [Whether POSIX AIO support is needed. Automatic])
483AH_TEMPLATE(USE_DISKIO_DISKTHREADS, [Whether pthreads support is needed. Automatic])
2513178d 484USE_AIOPS_WIN32=0
ffa3bad9
FC
485squid_opt_use_aio=
486squid_opt_use_diskthreads=
46577dd1 487AIOLIB=
2513178d
AJ
488
489dnl Setup the module paths etc.
2513178d 490DISK_LIBS=
e2716c57 491DISK_OS_LIBS=
2513178d
AJ
492DISK_MODULES=
493DISK_LINKOBJS=
50fbcbd6 494for module in $squid_disk_module_candidates none; do
d235bc84 495 # maybe not needed
2513178d
AJ
496 if test "$module" = "none"; then
497 continue
498 fi
499 if ! test -d $srcdir/src/DiskIO/$module; then
500 AC_MSG_ERROR(disk-io $module does not exist)
501 fi
502 case "$module" in
503 DiskDaemon)
6312592e 504 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
2513178d
AJ
505 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
506 DISK_MODULES="$DISK_MODULES DiskDaemon"
507 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
508 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
509 ;;
510 DiskThreads)
ffa3bad9 511 squid_opt_use_diskthreads="yes"
6312592e 512 LIBPTHREADS=
0b163dbb 513 SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
6312592e
AJ
514 if test "$with_pthreads" != "no"; then
515 dnl TODO: this needs to be extended to handle more systems and better
516 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
517 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
0b163dbb
FC
518 case "$squid_host_os" in
519 mingw)
6312592e
AJ
520 USE_AIOPS_WIN32=1
521 AC_MSG_NOTICE([Windows threads support automatically enabled])
522 ;;
0b163dbb 523 freebsd)
6312592e
AJ
524 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
525 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
0b163dbb
FC
526 if test "$GCC" = "yes" -a -z "$PRESET_LDFLAGS" ; then
527 LDFLAGS="$LDFLAGS -pthread"
6312592e
AJ
528 fi
529 ;;
0b163dbb 530 solaris)
6312592e
AJ
531 if test "$GCC" = "yes" ; then
532 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
533 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
ffa3bad9 534 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"],
6312592e 535 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
ffa3bad9 536 squid_opt_use_diskthreads="no"
6312592e
AJ
537 ])
538 else
539 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
540 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
541 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
40503c27
FC
542 AC_SEARCH_LIBS([pthread_create],[pthread thread],[
543 LIBPTHREADS="" #in LIBS
544 ],[
545 AC_MSG_NOTICE(pthread library required but cannot be found.)
546 squid_opt_use_diskthreads="no"
547 ])
6312592e
AJ
548 fi
549 ;;
550 *)
551 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
552 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
0b163dbb 553 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"],
6312592e 554 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
ffa3bad9 555 squid_opt_use_diskthreads="no"
6312592e
AJ
556 ])
557 ;;
558 esac
2513178d 559 else
6312592e 560 AC_MSG_NOTICE([Native pthreads support manually disabled.])
ffa3bad9 561 squid_opt_use_diskthreads="no"
2513178d 562 fi
ffa3bad9 563 if test "$squid_opt_use_diskthreads" = "yes" ; then
6312592e 564 AC_DEFINE(USE_DISKIO_DISKTHREADS, 1, [Whether pthreads support is needed. Automatic])
2513178d 565 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
e2716c57
HN
566 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
567 DISK_OS_LIBS="$DISK_OS_LIBS $LIBPTHREADS"
2513178d
AJ
568 DISK_MODULES="$DISK_MODULES DiskThreads"
569 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
570 else
6312592e
AJ
571 AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic])
572 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
0b163dbb 573 SQUID_STATE_ROLLBACK([diskthreads_state])
2513178d
AJ
574 fi
575 ;;
576
577 AIO)
2513178d 578 dnl Check for POSIX AIO availability
ffa3bad9 579 squid_opt_use_aio="yes"
46577dd1 580 AIOLIB=
2513178d
AJ
581 if test "$with_aio" != "no"; then
582 have_aio_header=no
583 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
584 dnl On some systems POSIX AIO functions are in librt
585 dnl On some systems POSIX AIO functions are in libaio
46577dd1 586 AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
2513178d 587 dnl Enable AIO if the library and headers are found
46577dd1 588 if test "$AIOLIB" != "" && test "$have_aio_header" = "yes"; then
2513178d 589 AC_MSG_NOTICE([Native POSIX AIO support detected.])
ffa3bad9 590 squid_opt_use_aio="yes"
2513178d
AJ
591 else
592 dnl Windows does things differently. We provide wrappers.
593 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
594 case "$host_os" in
595 mingw|mingw32)
ffa3bad9 596 squid_opt_use_aio="yes"
2513178d
AJ
597 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
598 ;;
599 *)
600 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
ffa3bad9 601 squid_opt_use_aio="no"
2513178d
AJ
602 ;;
603 esac
604 fi
605 else
606 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
ffa3bad9 607 squid_opt_use_aio="no"
2513178d
AJ
608 fi
609 dnl Use the POSIX AIO pieces if we actually need them.
ffa3bad9 610 if test "$squid_opt_use_aio" = "yes" ; then
2513178d
AJ
611 AC_DEFINE(USE_DISKIO_AIO, 1, [Whether POSIX AIO support is needed. Automatic])
612 DISK_MODULES="$DISK_MODULES AIO"
46577dd1 613 DISK_LIBS="$DISK_LIBS libAIO.a"
2513178d
AJ
614 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
615 case "$host_os" in
616 mingw|mingw32)
617 USE_AIO_WIN32=1
618 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
619 ;;
620 *)
621 AC_MSG_NOTICE([Enabling AIO DiskIO module])
e2716c57 622 DISK_OS_LIBS="$DISK_OS_LIBS $AIOLIB"
2513178d
AJ
623 ;;
624 esac
625 else
3cf1e8b6 626 AC_DEFINE(USE_DISKIO_AIO, 0, [Whether POSIX AIO support is needed. Automatic])
2513178d
AJ
627 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
628 fi
629 ;;
630
631 Blocking)
2513178d
AJ
632 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
633 DISK_LIBS="$DISK_LIBS libBlocking.a"
634 DISK_MODULES="$DISK_MODULES Blocking"
635 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
636 ;;
637
638 *)
639 AC_MSG_NOTICE([Enabling $module DiskIO module])
640 DISK_LIBS="$DISK_LIBS lib${module}.a"
641 DISK_MODULES="$DISK_MODULES ${module}"
642 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
643 ;;
644 esac
645done
646AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
647AC_SUBST(DISK_MODULES)
648AC_SUBST(DISK_LIBS)
649AC_SUBST(DISK_PROGRAMS)
650AC_SUBST(DISK_LINKOBJS)
e2716c57 651AC_SUBST(DISK_OS_LIBS)
2513178d
AJ
652AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
653AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
654
655
656dnl Check what Storage formats are wanted.
657dnl This version will error out with a message saying why if a required DiskIO is missing.
dc299f29 658squid_opt_enable_storeio=auto
d235bc84
FC
659AC_ARG_ENABLE([storeio],
660 AS_HELP_STRING([--enable-storeio="list of modules"],
661 [Build support for the list of store I/O modules.
18cc92fb
FC
662 The default is only to build the "ufs" module.
663 See src/fs for a list of available modules, or
664 Programmers Guide section <not yet written>
665 for details on how to build your custom store module]),
cd748f27 666[ case $enableval in
667 yes)
dc299f29 668 squid_opt_enable_storeio=auto
cd748f27 669 ;;
670 no)
dc299f29 671 squid_opt_enable_storeio=no
cd748f27 672 ;;
1c690e30 673 *)
dc299f29 674 squid_opt_enable_storeio=yes
d235bc84 675 squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
80f756db
FC
676 # ufs is really always needed as it has low-level routines
677 # if it's a dupe it will be cleaned-up later
678 squid_storeio_module_candidates="$squid_storeio_module_candidates ufs"
cd748f27 679 ;;
680 esac
cd748f27 681])
dc299f29
FC
682if test "$squid_opt_enable_storeio" = "auto"; then
683 squid_opt_enable_storeio=yes
d235bc84
FC
684 AC_MSG_CHECKING([for available StoreIO modules])
685 SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
defb3257 686 # disable coss
7eb77a5f 687 squid_storeio_module_candidates=`echo $squid_storeio_module_candidates|sed 's/coss//'`
d235bc84
FC
688 AC_MSG_RESULT([$squid_storeio_module_candidates])
689fi
690
dc299f29
FC
691SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates])
692SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
693AC_MSG_NOTICE([Store modules built: $squid_storeio_module_candidates])
694
695for fs in $squid_storeio_module_candidates none; do
8154dd82 696 case "$fs" in
697 diskd)
80f756db
FC
698 if test "$squid_disk_module_candidates_Blocking" != "yes" -a \
699 "$squid_disk_module_candidates_DiskDaemon" != "yes" ; then
700 AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon])
2513178d 701 fi
8154dd82 702 ;;
703 aufs)
80f756db
FC
704 if test "$squid_disk_module_candidates_Blocking" != "yes" -a \
705 "$squid_disk_module_candidates_DiskThreads" != "yes" ; then
706 AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads])
2513178d 707 fi
8154dd82 708 ;;
709 coss)
dc299f29 710 AC_MSG_WARN([COSS Support is not stable yet in Squid-3. Please do not use.\a])
dc299f29 711 if ! test "$squid_disk_module_candidates_AIO" = "yes"; then
2513178d
AJ
712 AC_MSG_ERROR([COSS requires POSIX AIO which is not available.])
713 fi
3256ae73 714 dnl
715 dnl Automake om MinGW needs explicit exe extension
716 dnl for STORE_TESTS substition
717 dnl
082a5e7a 718 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
719 ;;
d3b3ab85 720 ufs)
082a5e7a 721 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
8154dd82 722 esac
a2794549 723done
d3b3ab85 724
6d1c1ab1 725dnl TODO: FIXME What are those for? They seem to be never be defined. Kinkie
7b5b7ba8
CT
726AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
727AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
728AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
729AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build")
730
731
dc299f29 732dnl got final squid_storeio_module_candidates, build library lists
b66455ff
AR
733dnl This list will not be needed when each fs library has its own Makefile
734STORE_LIBS_TO_BUILD=
735dnl File system libraries to link executables with.
736dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
737STORE_LIBS_TO_ADD=
dc299f29 738for fs in $squid_storeio_module_candidates; do
7b5b7ba8
CT
739 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
740 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
6d1c1ab1
FC
741 SQUID_TOUPPER_VAR_CONTENTS([fs])
742 AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1)
b66455ff
AR
743done
744
745AC_SUBST(STORE_LIBS_TO_BUILD)
746AC_SUBST(STORE_LIBS_TO_ADD)
082a5e7a 747AC_SUBST(STORE_TESTS)
a2794549 748
24a04df9
AJ
749
750dnl At lest one removal policy is always needed.
751dnl 'lru' removal policy is currently hard-coded by name for tests
752dnl so we must set it as default.
753REPL_POLICIES="lru"
d9180414 754AC_ARG_ENABLE(removal-policies,
56ffc413
FC
755 AS_HELP_STRING([--enable-removal-policies="list of policies"],
756 [Build support for the list of removal policies.
18cc92fb
FC
757 The default is only to build the "lru" module.
758 See src/repl for a list of available modules, or
759 Programmers Guide section 9.9 for details on how
760 to build your custom policy]),
6a566b9c 761[ case $enableval in
762 yes)
5069fb38 763 SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES])
6a566b9c 764 ;;
765 no)
766 ;;
1c690e30 767 *)
768 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
6a566b9c 769 ;;
770 esac
6a566b9c 771])
1c690e30 772if test -n "$REPL_POLICIES"; then
56ffc413 773 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES])
5069fb38 774 AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES])
1c690e30 775 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
776 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
777fi
6a566b9c 778AC_SUBST(REPL_POLICIES)
6a566b9c 779AC_SUBST(REPL_OBJS)
f71946fc 780AC_SUBST(REPL_LIBS)
6a566b9c 781
d1da2d1f 782AM_CONDITIONAL(ENABLE_PINGER, false)
e5f4e1b0 783AC_ARG_ENABLE(icmp,
62979ab1 784 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
e5f4e1b0 785[ if test "$enableval" = "yes" ; then
eed82608 786 AC_MSG_NOTICE([ICMP enabled])
8e62bf65 787 AC_DEFINE(USE_ICMP,1,[Define to use Squid's ICMP and Network Measurement features (highly recommended!)])
d1da2d1f 788 AM_CONDITIONAL(ENABLE_PINGER, true)
e5f4e1b0 789 fi
790])
791
a2794549 792AM_CONDITIONAL(USE_DELAY_POOLS, false)
d9180414 793AC_ARG_ENABLE(delay-pools,
62979ab1 794 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
e5f4e1b0 795[ if test "$enableval" = "yes" ; then
eed82608 796 AC_MSG_NOTICE([Delay pools enabled])
6a9f6389 797 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
798 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
e5f4e1b0 799 fi
800])
801
5fa840c3 802dnl disable generic/common adaptation support by default
5069fb38 803squid_opt_use_adaptation=no
5fa840c3 804
5069fb38 805squid_opt_use_esi=yes
7eb77a5f
FC
806AH_TEMPLATE([USE_SQUID_ESI],
807 [Define to enable the ESI processor and Surrogate header support])
43ae1d95 808AC_ARG_ENABLE(esi,
7eb77a5f 809 AS_HELP_STRING([--enable-esi],
5069fb38 810 [Enable ESI for accelerators. Benefits from expat or libxml2.
7eb77a5f 811 Enabling ESI will cause squid reverse proxies to be capable
5069fb38
FC
812 of the Edge Acceleration Specification (www.esi.org).]),
813 [squid_opt_use_esi=$enableval], [squid_opt_use_esi=no])
88bfe098
AJ
814HAVE_LIBEXPAT=0
815EXPATLIB=
816HAVE_LIBXML2=0
817XMLLIB=
5069fb38 818if test "$squid_opt_use_esi" = "yes" ; then
3473acb1 819 AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.])
7eb77a5f
FC
820 AC_DEFINE(USE_SQUID_ESI,1,
821 [Compile the ESI processor and Surrogate header support])
822else
8075a4da 823 AC_MSG_NOTICE([Disabling ESI processor])
7eb77a5f 824fi
88bfe098 825
7eb77a5f
FC
826# ESI support libraries: expat
827AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect]))
5069fb38 828if test "$squid_opt_use_esi" = "yes" -a "$with_expat" != "no" ; then
7eb77a5f
FC
829 AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
830 AC_CHECK_HEADERS([expat.h])
831 AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
832 if test "$with_expat" = "yes" && test "$HAVE_LIBEXPAT" != "1" ; then
833 AC_MSG_ERROR([Required library expat is not able to be found.])
23df48fd 834 fi
7eb77a5f 835fi
ad32c661 836
7eb77a5f 837AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
5069fb38 838if test "$squid_opt_use_esi" = "yes" -a "$with_libxml2" != "no" ; then
7eb77a5f
FC
839 AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1])
840 dnl Find the main header and include path...
841 AC_CHECK_HEADERS([libxml/parser.h], [], [
842 SAVED_CPPFLAGS="$CPPFLAGS"
843 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
844 unset ac_cv_header_libxml_parser_h
845 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include=yes], [])
846 CPPFLAGS="$SAVED_CPPFLAGS"
847 ])
848 if test "x$ac_cv_libxml2_include" = "xyes"; then
849 SQUID_CXXFLAGS="-I/usr/include/libxml2 $SQUID_CXXFLAGS"
850 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
851 fi
852 dnl Now that we know where to look find the other headers...
853 AC_CHECK_HEADERS(libxml/HTMLparser.h libxml/HTMLtree.h)
854 AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
855 if test "$with_libxml2" = "yes" && test "$HAVE_LIBXML2" != "1" ; then
856 AC_MSG_ERROR([Required library libxml2 is not able to be found.])
857 fi
43ae1d95 858fi
7eb77a5f 859
5069fb38 860AM_CONDITIONAL(USE_ESI, test "$squid_opt_use_esi" = "yes")
88bfe098
AJ
861AM_CONDITIONAL(HAVE_LIBEXPAT, test $HAVE_LIBEXPAT = 1)
862AC_SUBST(EXPATLIB)
863AM_CONDITIONAL(HAVE_LIBXML2, test $HAVE_LIBXML2 = 1)
864AC_SUBST(XMLLIB)
43ae1d95 865
8075a4da 866# icap argument handling
51952383 867AC_ARG_ENABLE(icap-client,
62979ab1 868 AS_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
8075a4da
FC
869 [squid_opt_use_icap_client=$enableval], [squid_opt_use_icap_client=no])
870SQUID_DEFINE_UNQUOTED([ICAP_CLIENT],$squid_opt_use_icap_client,
871 [Enable ICAP client features in Squid])
872AM_CONDITIONAL(USE_ICAP_CLIENT, [test "$squid_opt_use_icap_client" = "yes" ])
5069fb38 873if test "$squid_opt_use_icap_client" = "yes" ; then
1f3c65fc 874 ICAP_LIBS="icap/libicap.la"
5069fb38 875 squid_opt_use_adaptation=yes
51952383 876else
c21ad0f5 877 ICAP_LIBS=""
51952383 878fi
c21ad0f5 879AC_SUBST(ICAP_LIBS)
51952383 880
5069fb38 881squid_opt_use_ecap=1
3e7b6055
AR
882AC_MSG_CHECKING(whether to support eCAP)
883AC_ARG_ENABLE(ecap,
8075a4da
FC
884 AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]), [
885 case "${enableval}" in
886 yes|no) squid_opt_use_ecap=$enableval ;;
887 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
888 esac
889AC_MSG_RESULT([$squid_opt_use_ecap, explicitly])
890 ], [
5069fb38
FC
891 squid_opt_use_ecap=no;
892 AC_MSG_RESULT([$squid_opt_use_ecap, implicitly])
3e7b6055
AR
893 ]
894)
895
896dnl Perform configuration consistency checks for eCAP
b61a58df 897ECAPLIB=""
5069fb38 898if test $squid_opt_use_ecap = yes;
3e7b6055 899then
5fa840c3 900 dnl eCAP support requires loadable modules, which are enabled by default
3e7b6055
AR
901 if test "$use_loadable_modules" != "yes"
902 then
945980c0 903 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
3e7b6055 904 fi
4cfba571
AR
905
906 dnl eCAP support requires libecap
907 AC_CHECK_LIB([ecap], [main],
b61a58df 908 [ECAPLIB="-lecap"],
591e6db0 909 [AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])]
4cfba571 910 )
3e7b6055
AR
911fi
912
5069fb38
FC
913AM_CONDITIONAL(USE_ECAP, test $squid_opt_use_ecap = yes)
914if test $squid_opt_use_ecap = yes;
3e7b6055
AR
915then
916 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
1f3c65fc 917 ECAP_LIBS="ecap/libecap.la $ECAP_LIBS"
5069fb38 918 squid_opt_use_adaptation=yes
3e7b6055 919else
5fa840c3 920 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
3e7b6055
AR
921 ECAP_LIBS=""
922fi
b61a58df 923dnl convenience library
3e7b6055 924AC_SUBST(ECAP_LIBS)
b61a58df
AJ
925dnl -lecap if needed
926AC_SUBST(ECAPLIB)
3e7b6055 927
3e7b6055 928
5fa840c3 929dnl enable adaptation if requested by specific adaptation mechanisms
5069fb38
FC
930AM_CONDITIONAL(USE_ADAPTATION, test $squid_opt_use_adaptation = yes)
931if test $squid_opt_use_adaptation = yes
5fa840c3
AR
932then
933 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
934 ADAPTATION_LIBS="adaptation/libadaptation.la"
51952383 935else
5fa840c3
AR
936 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
937 ADAPTATION_LIBS=""
51952383 938fi
5fa840c3 939AC_SUBST(ADAPTATION_LIBS)
3e7b6055
AR
940
941
0961c811 942dnl This is a developer only option. Developers know how to set defines
943dnl
944dnl AC_ARG_ENABLE(mem-gen-trace,
945dnl [ --enable-mem-gen-trace Do trace of memory stuff],
946dnl [ if test "$enableval" = "yes" ; then
eed82608 947dnl AC_MSG_NOTICE([Memory trace (to file) enabled])
6a9f6389 948dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
5069fb38
FC
949dnl fi
950dnl ])
951
36a97e19 952
1d87b6b3 953squid_opt_useragent_log="no"
d9180414 954AC_ARG_ENABLE(useragent-log,
8075a4da 955 AS_HELP_STRING([--enable-useragent-log],[Enable logging of User-Agent header]), [
1d87b6b3
FC
956 SQUID_YESNO([$enableval],[unrecognized argument to --enable-useragent-log: $enableval])
957 squid_opt_useragent_log=$enableval
e5f4e1b0 958])
1d87b6b3
FC
959AC_MSG_NOTICE([User-Agent logging enabled: $squid_opt_useragent_log])
960SQUID_DEFINE_UNQUOTED(USE_USERAGENT_LOG,$squid_opt_useragent_log,
961 [If you want to log User-Agent request header values, define this.])
e5f4e1b0 962
1d87b6b3 963squid_opt_referer_log="no"
dfca7e1a 964AC_ARG_ENABLE(referer-log,
1d87b6b3
FC
965 AS_HELP_STRING([--enable-referer-log],[Enable logging of Referer header]), [
966 SQUID_YESNO([$enableval],[unrecognized argument to --enable-referer-log: $enableval])
967 squid_opt_referer_log=$enableval
dfca7e1a 968])
1d87b6b3
FC
969AC_MSG_NOTICE([Referer logging enabled: $squid_opt_referer_log])
970SQUID_DEFINE_UNQUOTED(USE_REFERER_LOG,$squid_opt_referer_log,
971 [If you want to log Referer request header values, define this.
972 By default, they are written to referer.log in the Squid log directory.])
dfca7e1a 973
8075a4da 974squid_opt_use_wccp="yes"
5069fb38 975AC_ARG_ENABLE(wccp,
8075a4da 976 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [
1d87b6b3
FC
977 SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccp: $enableval])
978 squid_opt_use_wccp=$enableval
5069fb38 979])
8075a4da
FC
980AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $squid_opt_use_wccp])
981SQUID_DEFINE_UNQUOTED(USE_WCCP, $squid_opt_use_wccp, [Define to enable WCCP])
0b0cfcf2 982
8075a4da 983squid_opt_use_wccp_v2="yes"
0b0cfcf2 984AC_ARG_ENABLE(wccpv2,
8075a4da 985 AS_HELP_STRING([--disable-wccpv2],[Disable Web Cache Coordination V2 Protocol]), [
1d87b6b3
FC
986 SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccpv2: $enableval])
987 squid_opt_use_wccp_v2=$enableval
0b0cfcf2 988])
8075a4da
FC
989AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $squid_opt_use_wccp_v2])
990SQUID_DEFINE_UNQUOTED(USE_WCCPv2,$squid_opt_use_wccp_v2,[Define to enable WCCP V2])
320e9f36 991
8075a4da 992squid_opt_kill_parent="no"
d9180414 993AC_ARG_ENABLE(kill-parent-hack,
8075a4da 994 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [
1d87b6b3
FC
995 SQUID_YESNO([$enableval],[unrecognized argument to --enable-kill-parent-hack: $enableval])
996 squid_opt_kill_parent=$enableval
e5f4e1b0 997])
8075a4da
FC
998AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $squid_opt_kill_parent])
999SQUID_DEFINE_UNQUOTED(KILL_PARENT_OPT,$squid_opt_kill_parent,
20ad76ab
FC
1000 [A dangerous feature which causes Squid to kill its parent process
1001 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
1002 Use with caution.])
1003
af1e01a8 1004squid_opt_enable_snmp="yes"
e5f4e1b0 1005AC_ARG_ENABLE(snmp,
1d87b6b3
FC
1006 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
1007 SQUID_YESNO([$enableval],[unrecognized argument to --disable-snmp: $enableval])
1008 squid_opt_enable_snmp=$enableval
87630341 1009])
af1e01a8 1010if test "$squid_opt_enable_snmp" = "yes"; then
63705952 1011 SNMPLIB='../snmplib/libsnmp.a'
e5f4e1b0 1012 makesnmplib=snmplib
87630341 1013fi
47d80734 1014AC_MSG_NOTICE([SNMP support enabled: $squid_opt_enable_snmp])
8efb08bc
FC
1015SQUID_DEFINE_UNQUOTED(SQUID_SNMP,$squid_opt_enable_snmp,
1016 [Define to enable SNMP monitoring of Squid])
af1e01a8 1017AM_CONDITIONAL(USE_SNMP, [test "$squid_opt_enable_snmp" = "yes"])
e5f4e1b0 1018AC_SUBST(SNMPLIB)
e5f4e1b0 1019AC_SUBST(makesnmplib)
1020
d9180414 1021AC_ARG_ENABLE(cachemgr-hostname,
5069fb38
FC
1022 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],
1023 [Make cachemgr.cgi default to this host.
1d87b6b3
FC
1024 If unspecified, uses the name of the build-host]), [
1025 case $enableval in
1026 yes)
1027 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1028 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1029 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1030 ;;
1031 no)
1032 : # Nothing to do..
1033 ;;
1034 *)
1035 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1036 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1037 ;;
1038 esac
e5f4e1b0 1039])
1040
5069fb38 1041squid_opt_use_eui="yes"
ee0927b6 1042AC_ARG_ENABLE(eui,
a98c2da5 1043 AS_HELP_STRING([--disable-eui],[Enable use of ARP / MAC/ EUI (ether address)]),
5069fb38
FC
1044 [squid_opt_use_eui="$enableval"])
1045if test "$squid_opt_use_eui" = "yes" ; then
ee0927b6 1046 AC_MSG_NOTICE([EUI controls enabled (ether address)])
5069fb38
FC
1047 case "$squid_host_os" in
1048 linux|solaris|freebsd|openbsd|netbsd)
fe9ddf62 1049 ${TRUE}
074bf084 1050 ;;
5069fb38 1051 cygwin|mingw)
ee0927b6 1052 EUILIB="-liphlpapi"
5700029a 1053 ;;
933cc58d 1054 *)
ee0927b6 1055 AC_MSG_WARN([EUI support probably won't work on $host.])
933cc58d 1056 ;;
1057 esac
ee0927b6
AJ
1058 AC_CHECK_HEADERS( \
1059 Iphlpapi.h \
1060 net/if.h \
1061 net/if_arp.h \
1062 net/if_dl.h \
1063 net/route.h \
1064 netinet/if_ether.h \
1065 sys/sockio.h \
1066 sys/sysctl.h \
1067 sys/ioctl.h \
1068 )
a98c2da5 1069fi
47d80734
FC
1070AC_MSG_NOTICE([EUI controls enabled: $squid_opt_use_eui])
1071SQUID_DEFINE_UNQUOTED(USE_SQUID_EUI,$squid_opt_use_eui,
1072 [Define this to include code which lets you use ethernet hardware addresses. This code uses API initially defined in 4.4-BSD.])
1073AM_CONDITIONAL(USE_SQUID_EUI, [test "$squid_opt_use_eui" = "yes" ])
e5f4e1b0 1074
47d80734 1075squid_opt_enable_htcp="yes"
74075210 1076AC_ARG_ENABLE(htcp,
47d80734
FC
1077 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [
1078 SQUID_YESNO([$enableval],[unrecognized argument to --disable-htcp: $enableval])
1079 squid_opt_enable_htcp=$enableval
74075210 1080])
47d80734
FC
1081AC_MSG_NOTICE([HTCP support enabled: $squid_opt_enable_htcp])
1082SQUID_DEFINE_UNQUOTED([USE_HTCP],$squid_opt_enable_htcp,
1083 [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1084AM_CONDITIONAL(ENABLE_HTCP, [test "$squid_opt_enable_htcp" = "yes"])
a2794549 1085
47d80734 1086dnl TODO KK: SSL not yet refactored
3d4022fa 1087dnl SSL is not enabled by default.
a2794549 1088AM_CONDITIONAL(ENABLE_SSL, false)
3d4022fa 1089dnl Default is to use OpenSSL when available
1f7c9178 1090AC_ARG_ENABLE(ssl,
62979ab1 1091 AS_HELP_STRING([--enable-ssl],[Enable ssl gatewaying support using OpenSSL]),
1f7c9178 1092[ if test "$enableval" != "no"; then
eed82608 1093 AC_MSG_NOTICE([SSL gatewaying using OpenSSL enabled])
6a9f6389 1094 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
a2794549 1095 AM_CONDITIONAL(ENABLE_SSL, true)
5069fb38 1096 if test "$squid_host_os" = "mingw" ; then
ee86c79b 1097 SSLLIB='-lssleay32 -leay32 -lgdi32'
5069fb38 1098 else
4b26fae9 1099 SSLLIB='-lssl -lcrypto'
5069fb38 1100 fi
1f7c9178 1101 USE_OPENSSL=1
1102 fi
1103])
1104
3d4022fa 1105dnl User may specify OpenSSL is needed from a non-standard location
1f7c9178 1106AC_ARG_WITH(openssl,
62979ab1 1107 AS_HELP_STRING([--with-openssl{=PATH}],[Compile with the OpenSSL libraries. The path to
86f53af2
FC
1108 the OpenSSL development libraries and headers
1109 installation can be specified if outside of the
1110 system standard directories]),
1f7c9178 1111[
46ce628c 1112 case "$with_openssl" in
1f7c9178 1113 yes)
1114 USE_OPENSSL=1
1115 ;;
1116 no)
1117 USE_OPENSSL=
1118 ;;
1119 *)
46ce628c 1120 SSLLIBDIR="$with_openssl/lib"
bcce53ce 1121 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1f7c9178 1122 USE_OPENSSL=1
1123 esac
1124])
1f7c9178 1125if test -n "$USE_OPENSSL"; then
eed82608 1126 AC_MSG_NOTICE([Using OpenSSL MD5 implementation])
6a9f6389 1127 AC_DEFINE(USE_OPENSSL,1,[Define this to make use of the OpenSSL libraries for MD5 calculation rather than Squid's own MD5 implementation or if building with SSL encryption (USE_SSL)])
1f7c9178 1128 if test -z "$SSLLIB"; then
1129 SSLLIB="-lcrypto" # for MD5 routines
1130 fi
f11555e0 1131 dnl This is a workaround for RedHat 9 brain damage..
1132 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
eed82608 1133 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
f11555e0 1134 SSLLIBDIR="/usr/kerberos/lib"
1135 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1136 fi
1f7c9178 1137fi
1138if test -n "$SSLLIBDIR"; then
1139 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1140fi
1f7c9178 1141AC_SUBST(SSLLIB)
1142
3d4022fa 1143
47d80734 1144squid_opt_enable_forw_via_db="no"
02749868 1145AC_ARG_ENABLE(forw-via-db,
47d80734
FC
1146 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [
1147 SQUID_YESNO([$enableval],[unrecognized argument to --enable-forw-via-db: $enableval])
1148 squid_opt_enable_forw_via_db=$enableval
02749868 1149])
47d80734
FC
1150AC_MSG_NOTICE([Forw/Via database enabled: $squid_opt_enable_forw_via_db])
1151SQUID_DEFINE_UNQUOTED(FORW_VIA_DB,$squid_opt_enable_forw_via_db,[Enable Forw/Via database])
02749868 1152
47d80734 1153squid_opt_enable_cache_digests="no"
6cfa8966 1154AC_ARG_ENABLE(cache-digests,
47d80734
FC
1155 AS_HELP_STRING([--enable-cache-digests],
1156 [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]), [
1157 SQUID_YESNO([$enableval],[unrecognized argument to --enable-cache-digests: $enableval])
1158 squid_opt_enable_cache_digests=$enableval
484f2ebc 1159])
47d80734
FC
1160AC_MSG_NOTICE([Cache Digests enabled: $squid_opt_enable_cache_digests])
1161SQUID_DEFINE_UNQUOTED(USE_CACHE_DIGESTS,$squid_opt_enable_cache_digests,
1162 [Use Cache Digests for locating objects in neighbor caches.])
1163
484f2ebc 1164
cd748f27 1165dnl Size of COSS memory buffer
47d80734 1166squid_opt_coss_membuf_size=1048576
cd748f27 1167AC_ARG_WITH(coss-membuf-size,
47d80734
FC
1168 AS_HELP_STRING([--with-coss-membuf-size=size],[COSS membuf size (default 1048576 bytes)]), [
1169 case $withval in
1170 [[0-9]]*) squid_opt_coss_membuf_size=$withval ;;
1171 *) AC_MSG_ERROR([--with-coss-membuf-size expects a numeric argument]) ;;
1172 esac
1173 AC_MSG_NOTICE([Setting COSS membuf size to $withval bytes])
cd748f27 1174])
47d80734
FC
1175AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $squid_opt_coss_membuf_size,
1176 [Define if you want to set the COSS membuf size])
cd748f27 1177
47d80734 1178# check for netio plugin stuff
9bb83c8b 1179dnl Enable poll()
bf53a520 1180squid_opt_enable_poll=auto
9bb83c8b 1181AC_ARG_ENABLE(poll,
62979ab1 1182 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
1b3db6d9 1183[
c68e9c6b 1184 case "$enableval" in
1185 yes)
8075a4da 1186 squid_opt_io_loop_engine="poll"
bf53a520 1187 squid_opt_enable_poll=yes
c68e9c6b 1188 ;;
1189 no)
bf53a520 1190 squid_opt_enable_poll=no
c68e9c6b 1191 ;;
1192 esac
9bb83c8b 1193])
bf53a520 1194AC_MSG_NOTICE([enabling the use of poll() for net I/O: $squid_opt_enable_poll])
9bb83c8b 1195
1b3db6d9 1196dnl Enable select()
bf53a520 1197squid_opt_enable_select=auto
1b3db6d9 1198AC_ARG_ENABLE(select,
62979ab1 1199 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
1b3db6d9 1200[
1201 case "$enableval" in
1202 yes)
8075a4da 1203 squid_opt_io_loop_engine="select"
bf53a520 1204 squid_opt_enable_select=yes
1b3db6d9 1205 ;;
1206 no)
bf53a520 1207 squid_opt_enable_select=no
1b3db6d9 1208 ;;
1209 esac
1210])
bf53a520 1211AC_MSG_NOTICE([enabling the use of select() for net I/O: $squid_opt_enable_select])
1b3db6d9 1212
1213dnl Enable kqueue()
6564c397 1214dnl kqueue support is still experiemntal and unstable. Not enabled by default.
bf53a520 1215squid_opt_enable_kqueue="no"
1b3db6d9 1216AC_ARG_ENABLE(kqueue,
62979ab1 1217 AS_HELP_STRING([--enable-kqueue],[Enable kqueue(2) support (experimental).]),
1b3db6d9 1218[
1219 case "$enableval" in
1220 yes)
8075a4da 1221 squid_opt_io_loop_engine="kqueue"
11f11b5c
AJ
1222 AC_CHECK_HEADERS([sys/event.h],[],
1223 [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ])
bf53a520 1224 squid_opt_enable_kqueue=yes
1b3db6d9 1225 ;;
1226 no)
bf53a520 1227 squid_opt_enable_kqueue=no
1b3db6d9 1228 ;;
bf53a520 1229 esac
1b3db6d9 1230])
bf53a520 1231AC_MSG_NOTICE([enabling the use of kqueue for net I/O: $squid_opt_enable_kqueue])
1b3db6d9 1232
a46d2c0e 1233dnl Enable epoll()
bf53a520 1234squid_opt_enable_epoll="auto"
a46d2c0e 1235AC_ARG_ENABLE(epoll,
62979ab1 1236 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
a46d2c0e 1237[
1238 case "$enableval" in
1239 yes)
8075a4da 1240 squid_opt_io_loop_engine="epoll"
bf53a520 1241 squid_opt_enable_epoll="yes"
a46d2c0e 1242 ;;
1243 no)
bf53a520 1244 squid_opt_enable_epoll="no"
a46d2c0e 1245 ;;
1246esac
1247])
bf53a520
FC
1248AC_MSG_NOTICE([enabling the use of epoll for net I/O: $squid_opt_enable_epoll])
1249
2ca8b332 1250dnl auto-detect and verify epoll header and library present and working
bf53a520 1251if test "$squid_opt_enable_epoll" != "no" ; then
2ca8b332 1252
ad32c661 1253 # Check for libepoll
bf53a520 1254 EPOLL_LIBS=""
ad32c661
AJ
1255 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
1256 AC_SUBST(EPOLL_LIBS)
1257
2ca8b332
AJ
1258 dnl on some systems it is provided by libc
1259 dnl not to worry, the working test below will catch them
1260 dnl and we don't want to force additional libraries
1261
1262
ad32c661 1263 # Check for epoll_ctl, may need -lepoll
af1e01a8 1264 SQUID_STATE_SAVE(squid_epoll_state)
2ca8b332 1265 LIBS="$LIBS $EPOLL_LIBS"
ad32c661 1266 AC_CHECK_FUNCS(epoll_ctl)
af1e01a8 1267 SQUID_STATE_ROLLBACK(squid_epoll_state)
a46d2c0e 1268
2ca8b332 1269 dnl epoll requires sys/epoll.h
98d13964 1270 AC_CHECK_HEADERS([sys/epoll.h])
ad32c661
AJ
1271
1272 dnl Verify that epoll really works
1273 if test $ac_cv_func_epoll_ctl = yes; then
af1e01a8 1274 SQUID_CHECK_EPOLL
ad32c661 1275 fi
2ca8b332 1276
af1e01a8 1277 if test "$squid_opt_enable_epoll" = "yes" && test "$squid_cv_epoll_works" = "no" ; then
2ca8b332
AJ
1278 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
1279 fi
ad32c661 1280fi
a46d2c0e 1281
72fd085a 1282dnl Disable HTTP violations
47d80734 1283squid_opt_enable_http_violations="yes"
72fd085a 1284AC_ARG_ENABLE(http-violations,
af1e01a8
FC
1285 AS_HELP_STRING([--disable-http-violations],
1286 [This allows you to remove code which is known to
47d80734
FC
1287 violate the HTTP protocol specification.]), [
1288 SQUID_YESNO([$enableval],[unrecognized argument to --disable-http-violations: $enableval])
1289 squid_opt_enable_http_violations=$enableval
72fd085a 1290])
47d80734
FC
1291AC_MSG_NOTICE([HTTP violations support enabled: $squid_opt_kill_parent])
1292SQUID_DEFINE_UNQUOTED(HTTP_VIOLATIONS, $squid_opt_enable_http_violations,
1293 [Define to enable code which volates the HTTP standard specification])
72fd085a 1294
47d80734
FC
1295# IPFW Transparent Proxy
1296squid_opt_enable_ipfw_transparent="no"
68075fad 1297AC_ARG_ENABLE(ipfw-transparent,
62979ab1 1298 AS_HELP_STRING([--enable-ipfw-transparent],[Enable Transparent Proxy support for systems
47d80734
FC
1299 using FreeBSD IPFW-style firewalling.]), [
1300 SQUID_YESNO([$enableval],[unrecognized argument to --enable-ipfw-transparent: $enableval])
1301 squid_opt_enable_ipfw_transparent=$enableval
68075fad 1302])
47d80734 1303SQUID_DEFINE_UNQUOTED(IPFW_TRANSPARENT,$squid_opt_enable_ipfw_transparent,
2277004e 1304 [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.])
68075fad 1305
47d80734 1306# IP-Filter Transparent Proxy
2277004e
FC
1307AH_TEMPLATE(IPF_TRANSPARENT,
1308 [Enable support for Transparent Proxy on systems using IPF-style firewalling])
20ad76ab 1309squid_opt_ipf_transparent=no
5cafc1d6 1310AC_ARG_ENABLE(ipf-transparent,
2277004e 1311 AS_HELP_STRING([--enable-ipf-transparent],
47d80734
FC
1312 [Enable Transparent Proxy support for OSes using IPFilter-style firewalling]), [
1313 SQUID_YESNO([$enableval],[unrecognized argument to --enable-ipf-transparent: $enableval])
1314 squid_opt_ipf_transparent=$enableval
1315 #will be AC_DEFINE'd and MSG'ed later, after checking for appropriate infrastructure
5cafc1d6 1316])
1317
2b0dd4ac 1318dnl Enable PF Transparent Proxy
2277004e
FC
1319AH_TEMPLATE(PF_TRANSPARENT,
1320 [Enable support for Transparent Proxy on systems using OpenBSD-style PF firewalling])
2b0dd4ac 1321AC_ARG_ENABLE(pf-transparent,
2277004e 1322 AS_HELP_STRING([--enable-pf-transparent],
47d80734
FC
1323 [Enable Transparent Proxy support for systems using PF network address redirection.]), [
1324 SQUID_YESNO([$enableval],[unrecognized argument to --enable-pf-transparent: $enableval])
1325 squid_opt_pf_transparent=$enableval
1326 if test "$enableval" = "yes" ; then
eed82608 1327 AC_MSG_NOTICE([PF Transparent Proxy enabled])
20ad76ab 1328 squid_opt_pf_transparent="yes"
2277004e 1329 #will be AC_DEFINE'd later, after checking for appropriate infrastructure
2b0dd4ac 1330 fi
1331])
1332
96f08e2d
FC
1333# Enable Linux Netfilter Transparent Proxy
1334squid_opt_linux_netfilter="auto"
20ad76ab 1335AH_TEMPLATE(LINUX_NETFILTER,[Enable support for Transparent Proxy on Linux via Netfilter])
d852fbad 1336AC_ARG_ENABLE(linux-netfilter,
20ad76ab 1337 AS_HELP_STRING([--enable-linux-netfilter],
96f08e2d
FC
1338 [Enable Transparent Proxy support for Linux (Netfilter)]), [
1339squid_opt_linux_netfilter=$enableval
1340AC_MSG_NOTICE([Linux Transparent Proxy (Netfilter) support requested: $squid_opt_linux_netfilter])
1341#will be AC_DEFINE'd later, after checking for appropriate infrastructure
d852fbad 1342])
1343
bb7b5fd0 1344dnl Enable Large file support
2df6213e 1345buildmodel=""
2277004e 1346squid_opt_enable_large_files=no
2df6213e 1347
1348AC_ARG_WITH(large-files,
62979ab1 1349 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]),
8b0d8e31 1350[ if test "x$withval" = "xyes"; then
2277004e 1351 squid_opt_enable_large_files=yes
bb7b5fd0 1352 fi
1353])
1354
2df6213e 1355dnl UNIX Build environment
62979ab1 1356dnl AS_HELP_STRING is not suited here because it doesn't allow to specify newlines
2df6213e 1357AC_ARG_WITH(build-environment,
1358[ --with-build-environment=model
1359 The build environment to use. Normally one of
1360 POSIX_V6_ILP32_OFF32 32 bits
1361 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1362 POSIX_V6_LP64_OFF64 64 bits
1363 POSIX_V6_LPBIG_OFFBIG large pointers and files
1364 XBS5_ILP32_OFF32 32 bits (legacy)
1365 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1366 XBS5_LP64_OFF64 64 bits (legacy)
1367 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1368 default The default for your OS],
1369[ case "$withval" in
1370 yes|no)
2277004e 1371 AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf])
2df6213e 1372 ;;
1373 *)
1374 buildmodel="$withval"
1375 ;;
1376 esac
1377])
1378
2277004e
FC
1379if test "$squid_opt_enable_large_files" = "yes" -a -z "$buildmodel"; then
1380 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
1381 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1382 buildmodel=$model
1383 break
1384 fi
1385 done
1386 if test -z "$buildmodel"; then
1387 AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
1388 fi
9b8002de
HN
1389fi
1390case "$buildmodel" in
1391default|"")
2277004e 1392 if test "$squid_opt_enable_large_files" = "yes" ; then
eed82608 1393 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
2df6213e 1394 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
cca81db1 1395 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2df6213e 1396 fi
9b8002de
HN
1397 ;;
1398*)
eed82608 1399 AC_MSG_NOTICE([Using $buildmodel build environment])
2df6213e 1400 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1401 : # All fine
1402 else
8b0d8e31 1403 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
2df6213e 1404 fi
1405 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
cca81db1 1406 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2df6213e 1407 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1408 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
2277004e
FC
1409 if "$squid_host_os" = "solaris" ; then
1410
1411# On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1412# for LDFLAGS -xarch=generic64, but:
1413# "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1414# For gcc "-xarch=generic64" must be replaced with "-m64"
1415# The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1416 if test "$GCC" = "yes"; then
1417 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
1418 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1419 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1420 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
1421 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1422 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1423 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1424 fi
1425 AC_MSG_NOTICE([Removing -Usun on $host])
1426 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1427 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1428 fi
9b8002de 1429esac
2df6213e 1430
7b0a0d1f 1431dnl Enable Linux transparent proxy support for obsolete TPROXY
20ad76ab 1432AH_TEMPLATE(LINUX_TPROXY2,[Enable real Transparent Proxy support for Netfilter TPROXY v2])
96f08e2d 1433squid_opt_linux_tproxy2="no"
e8cca4ac 1434AC_ARG_ENABLE(linux-tproxy,
2277004e 1435 AS_HELP_STRING([--enable-linux-tproxy],
96f08e2d
FC
1436 [Enable real Transparent Proxy support for Netfilter TPROXY (version 2).]), [
1437 if test "$enableval" = "yes" ; then
1438 squid_opt_linux_tproxy2="yes"
1439 AC_MSG_NOTICE([Linux Transparent Proxy (TPROXY) requested])
f1e0717c 1440 fi
96f08e2d 1441 #AC_DEFINE will be handled later
f1e0717c 1442])
fc68f6b1 1443
5d620373 1444dnl Enable Leak Finding Functions
47d80734 1445squid_opt_enable_leakfinder=no
5d620373 1446AC_ARG_ENABLE(leakfinder,
47d80734
FC
1447 AS_HELP_STRING([--enable-leakfinder],
1448 [Enable Leak Finding code. Enabling this alone does nothing;
1449 you also have to modify the source code to use the leak
1450 finding functions. Probably Useful for hackers only.]), [
1451 SQUID_YESNO([$enableval],[unrecognized argument to --enable-leakfinder: $enableval])
1452 squid_opt_enable_leakfinder=$enableval
5d620373 1453])
47d80734
FC
1454AC_MSG_NOTICE([Leak Finder enabled: $squid_opt_enable_leakfinder])
1455SQUID_DEFINE_UNQUOTED(USE_LEAKFINDER,$squid_opt_enable_leakfinder,
1456 [Enable code for assisting in finding memory leaks. Not for the faint of heart])
1457AM_CONDITIONAL(MAKE_LEAKFINDER, [test "$squid_opt_enable_leakfinder" = "yes"])
1458
5d620373 1459
8efb08bc 1460squid_opt_follow_xff="yes"
3d674977 1461AC_ARG_ENABLE(follow-x-forwarded-for,
62979ab1 1462 AS_HELP_STRING([--enable-follow-x-forwarded-for],[Enable support for following the X-Forwarded-For
19b4777c
FC
1463 HTTP header to try to find the IP address of the
1464 original or indirect client when a request has
8075a4da 1465 been forwarded through other proxies.]), [
47d80734
FC
1466 SQUID_YESNO([$enableval],[unrecognized argument to --enable-follow-x-forwarded-for: $enableval])
1467 squid_opt_follow_xff=$enableval
8075a4da
FC
1468])
1469AC_MSG_NOTICE([Support for X-Forwarded-For enabled: $squid_opt_follow_xff])
47d80734
FC
1470SQUID_DEFINE_UNQUOTED([FOLLOW_X_FORWARDED_FOR],$squid_opt_follow_xff,
1471 [Enable following X-Forwarded-For headers])
3d674977 1472
8efb08bc 1473squid_opt_use_ident="yes"
3898f57f 1474AC_ARG_ENABLE(ident-lookups,
8075a4da 1475 AS_HELP_STRING([--disable-ident-lookups],
47d80734
FC
1476 [Remove code that supports performing Ident (RFC 931) lookups.]), [
1477 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ident-lookups: $enableval])
1478 squid_opt_use_ident=$enableval
8075a4da
FC
1479])
1480AC_MSG_NOTICE([Support for Ident lookups enabled: $squid_opt_use_ident])
47d80734 1481SQUID_DEFINE_UNQUOTED(USE_IDENT,$squid_opt_use_ident,[Support for Ident (RFC 931) lookups])
3898f57f 1482
8efb08bc
FC
1483squid_opt_use_dnsserver="no"
1484AH_TEMPLATE(USE_DNSSERVERS,
1485 [Use dnsserver processes instead of the internal DNS protocol support])
eb824054 1486AC_ARG_ENABLE(internal-dns,
8efb08bc
FC
1487 AS_HELP_STRING([--disable-internal-dns],
1488 [Prevents Squid from directly sending and receiving DNS messages,
1489 and instead enables the old external 'dnsserver' processes.]), [
1490 if test "$enableval" = "no" ; then
eed82608 1491 AC_MSG_WARN([Disabling Internal DNS queries])
8efb08bc
FC
1492 squid_opt_use_dnsserver="yes"
1493 AC_DEFINE(USE_DNSSERVERS,1)
1494 else
1495 AC_DEFINE(USE_DNSSERVERS,0)
eb824054 1496 fi
1497])
8efb08bc
FC
1498AM_CONDITIONAL([USE_DNSSERVER],[test "$squid_opt_use_dnsserver" = "yes" ])
1499
eb824054 1500
9d798391 1501dnl Select Default hosts file location
1502AC_ARG_ENABLE(default-hostsfile,
62979ab1 1503 AS_HELP_STRING([--enable-default-hostsfile=path],[Select default location for hosts file.
19b4777c 1504 See hosts_file directive in squid.conf for details]),
9d798391 1505[
59ad6d31 1506 if test "$enableval" != "none" -a "$enableval" != "no" ; then
20ad76ab
FC
1507 if test -f $enableval; then
1508 OPT_DEFAULT_HOSTS=$enableval
9d798391 1509 else
20ad76ab 1510 AC_MSG_WARN([Unable to find $enableval])
9d798391 1511 fi
20ad76ab
FC
1512 else
1513 OPT_DEFAULT_HOSTS="none"
1514 fi
1515 AC_MSG_NOTICE([Default hosts file set to: $enableval])
9d798391 1516],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1517AC_SUBST(OPT_DEFAULT_HOSTS)
1518
47d80734
FC
1519# Select auth schemes modules to build
1520squid_opt_enable_auth="auto"
94439e4e 1521AC_ARG_ENABLE(auth,
47d80734
FC
1522 AS_HELP_STRING([--enable-auth="list of auth scheme modules"],
1523 [Build support for the list of authentication schemes.
19b4777c
FC
1524 The default is to build support for the Basic scheme.
1525 See src/auth for a list of available modules, or
1526 Programmers Guide section authentication schemes
1527 for details on how to build your custom auth scheme
47d80734
FC
1528 module]), [
1529 case $enableval in
94439e4e 1530 yes)
47d80734
FC
1531 : # auto is OK
1532 ;;
94439e4e 1533 no)
47d80734
FC
1534 squid_opt_enable_auth="no"
1535 ;;
1c690e30 1536 *)
47d80734
FC
1537 squid_opt_enable_auth="yes"
1538 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1539 ;;
94439e4e 1540 esac
94439e4e 1541])
47d80734
FC
1542AC_MSG_CHECKING([for authentication modules to build])
1543if test "$squid_opt_enable_auth" = "auto" ; then
1544 squid_opt_enable_auth="yes"
1545 SQUID_LOOK_FOR_MODULES([$srcdir/src/auth],[AUTH_MODULES])
1c690e30 1546fi
47d80734
FC
1547SQUID_CHECK_EXISTING_MODULES([$srcdir/src/auth],[AUTH_MODULES])
1548AC_MSG_RESULT([${AUTH_MODULES:-none}])
1549
2d2b0bb7
AR
1550dnl Authentication libraries to build
1551dnl This list will not be needed when each auth library has its own Makefile
1552AUTH_LIBS_TO_BUILD=
f5691f9c 1553for module in $AUTH_MODULES; do
bcf44a2c 1554 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD lib${module}.la"
f5691f9c 1555done
94439e4e 1556AC_SUBST(AUTH_MODULES)
2d2b0bb7 1557AC_SUBST(AUTH_LIBS_TO_BUILD)
94439e4e 1558
7762106d 1559dnl bundled auth modules, in order to have handy defines for the cppunit testsuite
47d80734
FC
1560test -n "$AUTH_MODULES_basic" && AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built])
1561test -n "$AUTH_MODULES_digest" && AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built])
1562test -n "$AUTH_MODULES_ntlm" && AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
1563test -n "$AUTH_MODULES_negotiate" && AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built])
7762106d 1564
0bbcab1c
FC
1565# Select basic auth scheme helpers to build
1566dnl code path: squid_opt_basic_auth_helpers can contain either
1567dnl "auto" (default) or the list of modules to be built.
1568dnl Modules are then checked for existence dnl and for a
1569dnl successful config.test in the module's dir. As they succeed the
1570dnl variable BASIC_AUTH_HELPERS gets filled in and then substituted in
1571dnl the Makefile
1572BASIC_AUTH_HELPERS=""
9ff0f5b7
FC
1573if test "$AUTH_MODULES_basic" = "yes" ; then
1574 squid_opt_basic_auth_helpers="auto"
1575else
1576 squid_opt_basic_auth_helpers=""
1577fi
94439e4e 1578AC_ARG_ENABLE(basic-auth-helpers,
0bbcab1c
FC
1579 AS_HELP_STRING([--enable-basic-auth-helpers="list of helpers"],
1580 [This option selects which basic scheme proxy_auth
19b4777c
FC
1581 helpers to build and install as part of the normal
1582 build process. For a list of available
0bbcab1c
FC
1583 helpers see the helpers/basic_auth directory.]), [
1584 case "$enableval" in
1585 yes) squid_opt_basic_auth_helpers="auto" ;;
1586 no) squid_opt_basic_auth_helpers="" ;;
9ff0f5b7 1587 *) squid_opt_basic_auth_helpers="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;;
94439e4e 1588 esac
1589])
0bbcab1c
FC
1590if test "$squid_opt_basic_auth_helpers" = "auto" ; then
1591 squid_opt_basic_auth_helpers=""
1592 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/basic_auth],[squid_opt_basic_auth_helpers])
94439e4e 1593fi
9ff0f5b7
FC
1594if test -n "$squid_opt_basic_auth_helpers" -a -z "$AUTH_MODULES_basic" ; then
1595 AC_MSG_WARN([Basic auth helpers selected without the basic scheme enabled])
1596fi
0bbcab1c
FC
1597for helper in $squid_opt_basic_auth_helpers ; do
1598 dir="$srcdir/helpers/basic_auth/$helper"
1599 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1600 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1601 # special case
1602 if test "$helper" = "SASL" ; then
1603 require_sasl=yes
1604 fi
1605 elif test -d $srcdir/helpers/basic_auth/$helper ; then
1606 AC_MSG_NOTICE([Basic auth helper $helper ... found but cannot be built])
1607 fi
1608done
1609AC_MSG_NOTICE([Basic auth helpers built: $BASIC_AUTH_HELPERS])
fc83a946 1610AC_SUBST(BASIC_AUTH_HELPERS)
94439e4e 1611
59b38d95 1612# Select ntlm auth helpers to build
9ff0f5b7
FC
1613if test "$AUTH_MODULES_ntlm" = "yes" ; then
1614 squid_opt_ntlm_auth_helpers="auto"
1615else
1616 squid_opt_ntlm_auth_helpers=""
7f18d2bd 1617fi
94439e4e 1618AC_ARG_ENABLE(ntlm-auth-helpers,
9ff0f5b7
FC
1619 AS_HELP_STRING([--enable-ntlm-auth-helpers="list of helpers"],
1620 [This option selects which proxy_auth ntlm helpers
19b4777c
FC
1621 to build and install as part of the normal build
1622 process. For a list of available helpers see
9ff0f5b7
FC
1623 the helpers/ntlm_auth directory.]), [
1624case "$enableval" in
1625 yes) squid_opt_ntlm_auth_helpers="auto" ;;
1626 no) squid_opt_ntlm_auth_helpers="" ;;
1627 *) squid_opt_ntlm_auth_helpers="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;;
380f0a87 1628 esac
1629])
9ff0f5b7
FC
1630if test "$squid_opt_ntlm_auth_helpers" = "auto" ; then
1631 squid_opt_ntlm_auth_helpers=""
1632 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/ntlm_auth],[squid_opt_ntlm_auth_helpers])
7f18d2bd 1633fi
9ff0f5b7
FC
1634if test -n "$squid_opt_ntlm_auth_helpers" -a -z "$AUTH_MODULES_ntlm" ; then
1635 AC_MSG_WARN([NTLM auth helpers selected without the NTLM scheme enabled])
380f0a87 1636fi
9ff0f5b7
FC
1637for helper in $squid_opt_ntlm_auth_helpers ; do
1638 dir="$srcdir/helpers/ntlm_auth/$helper"
1639 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1640 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1641 elif test -d $srcdir/helpers/ntlm_auth/$helper ; then
59b38d95 1642 AC_MSG_NOTICE([NTLM auth helper $helper ... found but cannot be built])
9ff0f5b7
FC
1643 fi
1644done
1645AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS])
94439e4e 1646AC_SUBST(NTLM_AUTH_HELPERS)
1647
59b38d95
FC
1648# Select negotiate auth helpers to build
1649if test "$AUTH_MODULES_negotiate" = "yes" ; then
1650 squid_opt_negotiate_auth_helpers="auto"
1651else
1652 squid_opt_negotiate_auth_helpers=""
7f18d2bd 1653fi
6e785d85 1654AC_ARG_ENABLE(negotiate-auth-helpers,
9ff0f5b7
FC
1655 AS_HELP_STRING([--enable-negotiate-auth-helpers="list of helpers"],
1656 [This option selects which proxy_auth negotiate helpers
e702812e
FC
1657 to build and install as part of the normal build
1658 process. For a list of available helpers see
59b38d95
FC
1659 the helpers/negotiate_auth directory.]), [
1660 case "$enableval" in
1661 yes) squid_opt_negotiate_auth_helpers="all" ;;
1662 no) squid_opt_negotiate_auth_helpers="" ;;
1663 *) squid_opt_negotiate_auth_helpers="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;;
6e785d85 1664 esac
1665])
59b38d95
FC
1666if test "$squid_opt_negotiate_auth_helpers" = "auto" ; then
1667 squid_opt_negotiate_auth_helpers=""
1668 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/negotiate_auth],[squid_opt_negotiate_auth_helpers])
7f18d2bd 1669fi
59b38d95
FC
1670if test -n "$squid_opt_negotiate_auth_helpers" -a -z "$AUTH_MODULES_negotiate" ; then
1671 AC_MSG_WARN([Negotiate auth helpers selected without the Negotiate scheme enabled])
6e785d85 1672fi
59b38d95
FC
1673for helper in $squid_opt_negotiate_auth_helpers ; do
1674 dir="$srcdir/helpers/negotiate_auth/$helper"
1675 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1676 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1677 elif test -d $srcdir/helpers/negotiate_auth/$helper ; then
1678 AC_MSG_NOTICE([Negotiate auth helper $helper ... found but cannot be built])
1679 fi
1680done
1681AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS])
6e785d85 1682AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1683
59b38d95 1684
2d70df72 1685dnl Select digest auth scheme helpers to build
ea9b7bb6
FC
1686if test "$AUTH_MODULES_digest" = "yes" ; then
1687 squid_opt_digest_auth_helpers="auto"
1688else
1689 squid_opt_digest_auth_helpers=""
7f18d2bd 1690fi
2d70df72 1691AC_ARG_ENABLE(digest-auth-helpers,
ea9b7bb6
FC
1692 AS_HELP_STRING([--enable-digest-auth-helpers="list of helpers"],
1693 [This option selects which digest scheme authentication
e702812e
FC
1694 helpers to build and install as part of the normal build
1695 process. For a list of available helpers see the
ea9b7bb6
FC
1696 helpers/digest_auth directory.]), [
1697case "$enableval" in
1698 yes) squid_opt_digest_auth_helpers="all" ;;
1699 no) squid_opt_digest_auth_helpers="" ;;
1700 *) squid_opt_digest_auth_helpers="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;;
2d70df72 1701 esac
1702])
ea9b7bb6
FC
1703if test "$squid_opt_digest_auth_helpers" = "auto" ; then
1704 squid_opt_digest_auth_helpers=""
1705 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/digest_auth],[squid_opt_digest_auth_helpers])
7f18d2bd 1706fi
ea9b7bb6
FC
1707if test -n "$squid_opt_digest_auth_helpers" -a -z "$AUTH_MODULES_digest" ; then
1708 AC_MSG_WARN([Digest auth helpers selected without the Digest scheme enabled])
2d70df72 1709fi
ea9b7bb6
FC
1710for helper in $squid_opt_digest_auth_helpers ; do
1711 dir="$srcdir/helpers/digest_auth/$helper"
1712 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1713 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1714 elif test -d $srcdir/helpers/digest_auth/$helper ; then
1715 AC_MSG_NOTICE([Digest auth helper $helper ... found but cannot be built])
1716 fi
1717done
1718AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
2d70df72 1719AC_SUBST(DIGEST_AUTH_HELPERS)
380f0a87 1720
82b7abe3 1721dnl Select logging daemon helpers to build
a62e8408 1722squid_opt_logdaemon_helpers="auto"
82b7abe3 1723AC_ARG_ENABLE(log-daemon-helpers,
a62e8408
FC
1724 AS_HELP_STRING([--enable-log-daemon-auth-helpers="list of helpers"],
1725 [This option selects which logging daemon helpers to
1726 build and install as part of the normal build process
1727 For a list of available helpers see the helpers/log_daemon
1728 directory.]),[
1729case "$enableval" in
1730 yes) : ;;
1731 no) squid_opt_logdaemon_helpers="" ;;
1732 *) squid_opt_logdaemon_helpers="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;;
82b7abe3
AJ
1733 esac
1734])
a62e8408
FC
1735if test "$squid_opt_logdaemon_helpers" = "auto" ; then
1736 squid_opt_logdaemon_helpers=""
1737 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/log_daemon],[squid_opt_logdaemon_helpers])
82b7abe3 1738fi
a62e8408
FC
1739for helper in $squid_opt_logdaemon_helpers ; do
1740 dir="$srcdir/helpers/log_daemon/$helper"
1741 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1742 LOG_DAEMON_HELPERS="$LOG_DAEMON_HELPERS $helper"
1743 elif test -d $srcdir/helpers/log_daemon/$helper ; then
1744 AC_MSG_NOTICE([Log daemon auth helper $helper ... found but cannot be built])
1745 fi
1746done
1747AC_MSG_NOTICE([Log daemon helpers built: $LOG_DAEMON_HELPERS])
82b7abe3
AJ
1748AC_SUBST(LOG_DAEMON_HELPERS)
1749
3d62cc61
FC
1750dnl
1751dnl Check Kerberos/GSSAPI/SPNEGO
1752dnl
c8093f05
FC
1753SQUID_STATE_SAVE([krbsave])
1754
9ca29d23
AJ
1755AC_ARG_WITH(krb5-config,
1756 [ --with-krb5-config=PATH specify path to krb5-config @<:@default=detect@:>@],
c8093f05
FC
1757[
1758 case "$withval" in
1759 yes) unset krb5confpath ;;
1760 no) krb5confpath=no ;;
1761 *) krb5confpath=$withval ;;
1762 esac
9ca29d23
AJ
1763])
1764if test x"$krb5confpath" != xno; then
1765 if test x"$krb5confpath" != x; then
1766 if ! test -x "$krb5confpath"; then
1767 AC_MSG_WARN([krb5-config '$krb5confpath' not executable, ignoring])
1768 AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no)
1769 krb5confpath=krb5-config
1770 fi
1771 krb5_config_path=`dirname $krb5confpath`
1772 AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no, $krb5_config_path)
1773 else
1774 AC_CHECK_PROG(ac_krb5_config,krb5-config,yes,no)
1775 krb5confpath=krb5-config
1776 fi
1777fi
1778if test "$ac_krb5_config" = "yes" ; then
cf99ae25
AJ
1779 ac_heimdal="`$krb5confpath --version 2>/dev/null | grep -i heimdal`"
1780 ac_solaris="`$krb5confpath --version 2>/dev/null | grep -i solaris`"
9ca29d23
AJ
1781 if test "x$ac_heimdal" != "x" ; then
1782 AC_DEFINE(HAVE_HEIMDAL_KERBEROS,1,[Define to 1 if you have Heimdal Kerberos])
1783 else
1784 AC_DEFINE(HAVE_MIT_KERBEROS,1,[Define to 1 if you have MIT Kerberos])
1785 fi
1786 if test "$ac_solaris" != "" ; then
cf99ae25
AJ
1787 KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`"
1788 KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`"
9ca29d23
AJ
1789 KRB5INCS="-I/usr/include/gssapi $KRB5INCS"
1790 KRB5LIBS="-L/usr/lib -R/usr/lib -lgss -lresolv -lsocket -lnsl $KRB5LIBS"
1791 else
cf99ae25
AJ
1792 KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`"
1793 KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`"
9ca29d23
AJ
1794 KRB5INCS="`$krb5confpath --cflags gssapi 2>/dev/null` $KRB5INCS"
1795 KRB5LIBS="`$krb5confpath --libs gssapi 2>/dev/null` $KRB5LIBS"
1796 fi
1797 CPPFLAGS="$CPPFLAGS $KRB5INCS"
1798 LIBS="$LIBS $KRB5LIBS"
1799 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1800 if test "x$ac_heimdal" == "x" ; then
1801 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
3d62cc61 1802 AC_CHECK_HEADERS(profile.h)
9ca29d23 1803 fi
d14e78e9 1804 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
c8093f05
FC
1805
1806 SQUID_CHECK_KRB5_BROKEN_SOLARIS_KRB5_H
3d62cc61
FC
1807 if test x"$squid_cv_broken_krb5_h" = x"yes"; then
1808 AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if krb5.h is broken for C++])
1809 fi
9ca29d23 1810
3d62cc61
FC
1811 ac_com_error_message=no
1812 if test "x$ac_cv_header_com_err_h" == "xyes" ; then
1813 AC_EGREP_HEADER(error_message,com_err.h,ac_com_error_message=yes)
1814 elif test "x$ac_cv_header_et_com_err_h" == "xyes" ; then
1815 AC_EGREP_HEADER(error_message,et/com_err.h,ac_com_error_message=yes)
1816 fi
c8093f05
FC
1817
1818 SQUID_CHECK_MAX_SKEW_IN_KRB5_CONTEXT
3d62cc61
FC
1819 if test x"$squid_cv_max_skew_context" = x"yes"; then
1820 AC_DEFINE(HAVE_MAX_SKEW_IN_KRB5_CONTEXT, 1, [Define to 1 if max_skew in struct krb5_context])
1821 fi
1822
1823 if test `echo $KRB5LIBS | grep -c com_err` -ne 0 -a "x$ac_com_error_message" == "xyes" ; then
1824 AC_CHECK_LIB(com_err,error_message,
c8093f05
FC
1825 AC_DEFINE(HAVE_ERROR_MESSAGE,1,
1826 [Define to 1 if you have error_message]),)
3d62cc61
FC
1827 elif test "x$ac_com_error_message" == "xyes" ; then
1828 AC_CHECK_LIB(krb5,error_message,
c8093f05
FC
1829 AC_DEFINE(HAVE_ERROR_MESSAGE,1,
1830 [Define to 1 if you have error_message]),)
9ca29d23 1831 fi
cf99ae25 1832 AC_CHECK_LIB(krb5,krb5_get_err_text,
c8093f05
FC
1833 AC_DEFINE(HAVE_KRB5_GET_ERR_TEXT,1,
1834 [Define to 1 if you have krb5_get_err_text]),)
cf99ae25 1835 AC_CHECK_LIB(krb5,krb5_get_error_message,
c8093f05
FC
1836 AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE,1,
1837 [Define to 1 if you have krb5_get_error_message]),)
9ca29d23 1838 AC_CHECK_LIB(krb5,krb5_kt_free_entry,
c8093f05
FC
1839 AC_DEFINE(HAVE_KRB5_KT_FREE_ENTRY,1,
1840 [Define to 1 if you have krb5_kt_free_entry]),)
9ca29d23 1841 AC_CHECK_LIB(krb5,krb5_get_init_creds_keytab,
c8093f05
FC
1842 AC_DEFINE(HAVE_GET_INIT_CREDS_KEYTAB,1,
1843 [Define to 1 if you have krb5_get_init_creds_keytab]),)
9ca29d23 1844 AC_CHECK_LIB(krb5,krb5_get_max_time_skew,
c8093f05
FC
1845 AC_DEFINE(HAVE_KRB5_GET_MAX_TIME_SKEW,1,
1846 [Define to 1 if you have krb5_get_max_time_skew]),)
9ca29d23 1847 AC_CHECK_LIB(krb5,krb5_get_profile,
c8093f05
FC
1848 AC_DEFINE(HAVE_KRB5_GET_PROFILE,1,
1849 [Define to 1 if you have krb5_get_profile]),)
9ca29d23 1850 AC_CHECK_LIB(krb5,profile_get_integer,
c8093f05
FC
1851 AC_DEFINE(HAVE_PROFILE_GET_INTEGER,1,
1852 [Define to 1 if you have profile_get_integer]),)
9ca29d23 1853 AC_CHECK_LIB(krb5,profile_release,
c8093f05
FC
1854 AC_DEFINE(HAVE_PROFILE_RELEASE,1,
1855 [Define to 1 if you have profile_release]),)
9ca29d23 1856
c8093f05 1857 SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE
3d62cc61
FC
1858 if test "$squid_cv_memory_cache" = "yes" ; then
1859 AC_DEFINE(HAVE_KRB5_MEMORY_CACHE,1, [Define to 1 if you have MEMORY: cache support])
1860 fi
9ca29d23 1861
c8093f05 1862 SQUID_CHECK_WORKING_GSSAPI
3d62cc61
FC
1863 if test "$squid_cv_working_gssapi" = "yes" ; then
1864 AC_DEFINE(HAVE_GSSAPI, 1, [GSSAPI support])
1865 fi
1866
c8093f05 1867 SQUID_CHECK_SPNEGO_SUPPORT
3d62cc61 1868 if test "$squid_cv_have_spnego" = "yes" ; then
9ca29d23 1869 AC_DEFINE(HAVE_SPNEGO,1, [Define to 1 if you have SPNEGO support])
3d62cc61 1870 fi
c8093f05 1871
1a5ffec6 1872 SQUID_CHECK_WORKING_KRB5
3d62cc61
FC
1873 if test "$squid_cv_working_krb5" = "yes" ; then
1874 AC_DEFINE(HAVE_KRB5, 1, [KRB5 support])
1875 fi
1876
9ca29d23
AJ
1877 AC_SUBST(KRB5INCS)
1878 AC_SUBST(KRB5LIBS)
1879fi
1a5ffec6 1880SQUID_STATE_ROLLBACK([krbsave])
3d62cc61 1881AM_CONDITIONAL(HAVE_SPNEGO, test x"$squid_cv_have_spnego" = x"yes" )
9ca29d23 1882
6437ac71 1883dnl Enable "NTLM fail open"
1884AC_ARG_ENABLE(ntlm-fail-open,
1a5ffec6
FC
1885 AS_HELP_STRING([--enable-ntlm-fail-open],
1886 [Enable NTLM fail open, where a helper that fails one of the
e702812e 1887 Authentication steps can allow squid to still authenticate
1a5ffec6
FC
1888 the user. This has security implications.]), [
1889 if test "$enableval" = "yes" ; then
1890 AC_DEFINE(NTLM_FAIL_OPEN,1,
1891 [Define if NTLM is allowed to fail gracefully when a helper has problems.])
6437ac71 1892 fi
1893])
1894
1a5ffec6 1895########### KK HERE ##########
c6588c68 1896dnl Select external_acl helpers to build
7f18d2bd 1897EXTERNAL_ACL_HELPERS=all
c6588c68 1898AC_ARG_ENABLE(external-acl-helpers,
62979ab1 1899 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],[This option selects which external_acl helpers to
e702812e
FC
1900 build and install as part of the normal build
1901 process. For a list of available helpers see the
1902 helpers/external_acl directory.]),
c6588c68 1903[ case "$enableval" in
1904 yes)
7f18d2bd 1905 EXTERNAL_ACL_HELPERS=all
1c690e30 1906 ;;
c6588c68 1907 no)
7f18d2bd 1908 EXTERNAL_ACL_HELPERS=""
1c690e30 1909 ;;
c6588c68 1910 *)
1c690e30 1911 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1912 ;;
c6588c68 1913 esac
1914])
7f18d2bd 1915if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
39ee7289 1916 EXTERNAL_ACL_HELPERS=""
7f18d2bd 1917 for dir in $srcdir/helpers/external_acl/*; do
1918 helper="`basename $dir`"
1919 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1920 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
ce7c6bba
AJ
1921 elif test -d $srcdir/helpers/external_acl/$helper ; then
1922 AC_MSG_NOTICE([External ACL helper $helper ... found but cannot be built])
7f18d2bd 1923 fi
1924 done
1925fi
c6588c68 1926if test -n "$EXTERNAL_ACL_HELPERS"; then
20d8bfe4 1927 for helper in $EXTERNAL_ACL_HELPERS; do
1928 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1929 :
1930 else
8b0d8e31 1931 AC_MSG_ERROR(external acl helper $helper does not exist)
20d8bfe4 1932 fi
1933 done
eed82608 1934 AC_MSG_NOTICE([External acl helpers built: $EXTERNAL_ACL_HELPERS])
c6588c68 1935fi
1936AC_SUBST(EXTERNAL_ACL_HELPERS)
1937
fdbb3b19
AJ
1938dnl Select url_rewrite helpers to build
1939URL_REWRITE_HELPERS=all
1940AC_ARG_ENABLE(url-rewrite-helpers,
1941 AC_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
1942 [This option selects which url_rewrite helpers to
1943 build and install as part of the normal build
1944 process. For a list of available helpers see the
1945 helpers/url_rewrite directory.]),
1946[ case "$enableval" in
1947 yes)
1948 URL_REWRITE_HELPERS=all
1949 ;;
1950 no)
1951 URL_REWRITE_HELPERS=""
1952 ;;
1953 *)
1954 URL_REWRITE_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1955 ;;
1956 esac
1957])
1958if test "$URL_REWRITE_HELPERS" = "all" ; then
1959 URL_REWRITE_HELPERS=""
1960 for dir in $srcdir/helpers/url_rewrite/*; do
1961 helper="`basename $dir`"
1962 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1963 URL_REWRITE_HELPERS="$URL_REWRITE_HELPERS $helper"
ce7c6bba
AJ
1964 elif test -d $srcdir/helpers/url_rewrite/$helper ; then
1965 AC_MSG_NOTICE([URL re-write helper $helper ... found but cannot be built])
fdbb3b19
AJ
1966 fi
1967 done
1968fi
1969if test -n "$URL_REWRITE_HELPERS"; then
1970 for helper in $URL_REWRITE_HELPERS; do
1971 if test -f $srcdir/helpers/url_rewrite/$helper/Makefile.in; then
1972 :
1973 else
1974 AC_MSG_ERROR(url_rewrite helper $helper does not exist)
1975 fi
1976 done
1977 AC_MSG_NOTICE([url_rewrite helpers built: $URL_REWRITE_HELPERS])
1978fi
1979AC_SUBST(URL_REWRITE_HELPERS)
1980
1981
3a125142 1982AC_ARG_WITH(valgrind-debug,
62979ab1 1983 AS_HELP_STRING([--with-valgrind-debug],[Include debug instrumentation for use with valgrind]),
b4bab919 1984[ case $withval in
1985 yes)
1986 valgrind=1
1987 ;;
1988 no)
1989 valgrind=
1990 ;;
1991 *)
1992 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1993 valgrind=1
1994 ;;
1995 esac
1996 if test $valgrind; then
ad32c661
AJ
1997 AC_CHECK_HEADERS(valgrind/memcheck.h,
1998 [ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
eed82608
AJ
1999 AC_MSG_NOTICE([Valgrind debug support enabled]) ],
2000 [ AC_MSG_WARN([Valgrind header not found. Valgrind support disabled.]) ]
ad32c661 2001 )
b4bab919 2002 fi
2003])
2004
d96ceb8e 2005dnl Disable "memPools" code
2006AC_ARG_ENABLE(mempools,
62979ab1 2007 AS_HELP_STRING([--disable-mempools],[Disable memPools. Note that this option now simply sets the
e702812e
FC
2008 default behaviour. Specific classes can override this at runtime, and
2009 only lib/MemPool.c needs to be altered to change the squid-wide
2010 default for all classes.]),
d96ceb8e 2011[ if test "$enableval" = "no" ; then
eed82608 2012 AC_MSG_NOTICE([memPools disabled])
6a9f6389 2013 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
3e0dc9a8 2014 else
2015 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 2016 fi
3e0dc9a8 2017],
2018[ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 2019])
2020
0e657244 2021dnl Enable WIN32 Service compile mode
2022AC_ARG_ENABLE(win32-service,
62979ab1 2023 AS_HELP_STRING([--enable-win32-service],[Compile Squid as a WIN32 Service.
e702812e 2024 Works only on MS-Windows platforms (NT and up).]),
0e657244 2025[ if test "$enableval" = "yes" ; then
eed82608 2026 AC_MSG_NOTICE([Enabling WIN32 run service mode])
0e657244 2027 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
2028 fi
2029])
2030
b1485ff8 2031
2adff954 2032dnl Check for Cyrus SASL
2033if test "$require_sasl" = "yes"; then
2034 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
2035 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
eed82608 2036 AC_MSG_NOTICE([using SASL2])
2adff954 2037 LIBSASL="-lsasl2"
2038 else
2039 if test "$ac_cv_header_sasl_h" = "yes"; then
eed82608 2040 AC_MSG_NOTICE([using SASL])
2adff954 2041 LIBSASL="-lsasl"
2042 else
8b0d8e31 2043 AC_MSG_ERROR(Neither SASL nor SASL2 found)
2adff954 2044 fi
2045 fi
2046 AC_SUBST(LIBSASL)
2047fi
2048
3c573763 2049dnl Disable "unlinkd" code
fe0810ac 2050AC_ARG_ENABLE(unlinkd,
62979ab1 2051 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]),
fe0810ac 2052[ if test "$enableval" = "no" ; then
3c573763 2053 use_unlinkd=no
fe0810ac 2054 else
3c573763 2055 use_unlinkd=yes
fe0810ac 2056 fi
2057],[
2058 # Here we should probably use some magic depending on the selected
2059 # storage models
3c573763 2060 use_unlinkd=yes
fe0810ac 2061])
3c573763 2062if test "$use_unlinkd" = "yes"; then
eed82608 2063 AC_MSG_NOTICE([unlinkd enabled])
6a9f6389 2064 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
a2794549 2065 AM_CONDITIONAL(ENABLE_UNLINKD, true)
fe0810ac 2066else
eed82608 2067 AC_MSG_NOTICE([unlinkd disabled])
a2794549 2068 AM_CONDITIONAL(ENABLE_UNLINKD, false)
fe0810ac 2069fi
fe0810ac 2070
ce3d30fb 2071dnl Enable backtraces on fatal errors
2072AC_ARG_ENABLE(stacktraces,
62979ab1 2073 AS_HELP_STRING([--enable-stacktraces],[Enable automatic call backtrace on fatal errors]),
ce3d30fb 2074[ if test "$enableval" = "yes" ; then
eed82608 2075 AC_MSG_NOTICE([Enabling automatic stack backtraces on fatal errors])
6a9f6389 2076 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
ce3d30fb 2077 fi
2078])
2079
88bfe092 2080AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
2081dnl Enable USE_XPROF_STATS
2082AC_ARG_ENABLE(cpu-profiling,
62979ab1 2083 AS_HELP_STRING([--enable-cpu-profiling],[Enable instrumentation to try and understand how CPU power
e702812e
FC
2084 is spent by squid, by enabling specific probes in selected
2085 functions. New probes can only be added by modifying the source code.
2086 It is meant to help developers in optimizing performance
2087 of Squid internal functions.
2088 If you are not developer you shouldn't enable this,
2089 as it slows squid down somewhat. See lib/Profiler.c for more details.]),
88bfe092 2090[ if test "$enableval" = "yes" ; then
eed82608 2091 AC_MSG_NOTICE([Enabling cpu-profiling])
6a9f6389 2092 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
88bfe092 2093 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
2094 fi
2095])
2096
f66a9ef4 2097dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
2092c67d 2098AC_ARG_ENABLE(x-accelerator-vary,
62979ab1 2099 AS_HELP_STRING([--enable-x-accelerator-vary],[Enable support for the X-Accelerator-Vary
e702812e
FC
2100 HTTP header. Can be used to indicate
2101 variance within an accelerator setup.
2102 Typically used together with other code
2103 that adds custom HTTP headers to the requests.]),
f66a9ef4 2104[ if test "$enableval" = "yes" ; then
eed82608 2105 AC_MSG_NOTICE([Enabling support for X-Accelerator-Vary])
6a9f6389 2106 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
f66a9ef4 2107 fi
2108])
2109
7172612f 2110AC_ARG_ENABLE(zph-qos,
62979ab1 2111 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]),
7172612f 2112[ if test "$enableval" = "yes" ; then
eed82608 2113 AC_MSG_NOTICE([ZPH QOS enabled])
7172612f
AJ
2114 AC_DEFINE(USE_ZPH_QOS,1,
2115 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
2116 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
2117 fi
2118])
2119
a41b3435
AJ
2120dnl --with-maxfd present for compatibility with Squid-2.
2121dnl undocumented in ./configure --help to encourage using the Squid-3 directive.
2122AC_ARG_WITH(maxfd,,
2123[
2124 case ${withval} in
2125 [[0-9]]*)
2126 squid_filedescriptors_num=$withval
2127 ;;
2128 *)
2129 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
2130 ;;
2131 esac
2132])
f49be7d1 2133AC_ARG_WITH(filedescriptors,
62979ab1 2134 AS_HELP_STRING([--with-filedescriptors=NUMBER],[Force squid to support NUMBER filedescriptors]),
8b0d8e31
AJ
2135[
2136 case ${withval} in
2137 [[0-9]]*)
2138 squid_filedescriptors_num=$withval
2139 ;;
2140 *)
2141 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
2142 ;;
2143 esac
2144])
f49be7d1 2145
8b5e106b 2146if $CPPUNITCONFIG --help >/dev/null; then
78cae3b4
FC
2147 squid_cv_cppunit_version="`$CPPUNITCONFIG --version`"
2148 AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version])
2149 unset squid_cv_cppunit_version
8b5e106b 2150 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2151 SQUID_CPPUNIT_LA=''
2152 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2153else
eed82608 2154 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
63d03edb 2155 SQUID_CPPUNIT_LA=''
2156 SQUID_CPPUNIT_LIBS=''
2157 SQUID_CPPUNIT_INC=''
f5691f9c 2158fi
8b5e106b 2159
f5691f9c 2160AC_ARG_WITH(cppunit-basedir,
62979ab1 2161 AS_HELP_STRING([--with-cppunit-basedir=PATH],[Path where the cppunit headers are libraries are found
b0e7900f 2162 for unit testing.]),
f5691f9c 2163[ if test -f $withval/include/cppunit/TestCase.h; then
eed82608 2164 AC_MSG_NOTICE([Using cppunit includes from $withval])
f5691f9c 2165 SQUID_CPPUNIT_INC="-I${withval}/include"
2166 else
8b0d8e31 2167 AC_MSG_ERROR(Cannot find cppunit at $withval)
f5691f9c 2168 fi
2169 if test -f $withval/lib/libcppunit.la; then
eed82608 2170 AC_MSG_NOTICE([Using cppunit lib from $withval])
549b1e60 2171 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
8b5e106b 2172 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
f5691f9c 2173 else
8b0d8e31 2174 AC_MSG_ERROR(Cannot find cppunit at $withval)
f5691f9c 2175 fi
f5691f9c 2176])
8b5e106b 2177AC_SUBST(SQUID_CPPUNIT_LIBS)
f5691f9c 2178AC_SUBST(SQUID_CPPUNIT_LA)
2179AC_SUBST(SQUID_CPPUNIT_INC)
f5691f9c 2180
fd9aaa3e 2181# Force some compilers to use ANSI features
2182#
2183case "$host" in
2184 alpha-dec-osf*)
2185 if test "$ac_cv_prog_CC" = "cc" ; then
eed82608 2186 AC_MSG_NOTICE([adding '-std1' to cc args for $host])
fd9aaa3e 2187 CC="cc -std1";
2188 ac_cv_prog_CC="$CC"
2189 fi
2190 ;;
c68e9c6b 2191 *-hp-hpux*)
2192 if test "$ac_cv_prog_CC" = "cc" ; then
eed82608 2193 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
c68e9c6b 2194 CC="cc -Ae";
2195 ac_cv_prog_CC="$CC"
2196 fi
2197 ;;
fd9aaa3e 2198esac
2199
dd56802c 2200
a2794549 2201dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
4e9d8e26 2202
6ad85e8a 2203case "$host" in
2204 *-hp-hpux*)
eed82608 2205 AC_MSG_NOTICE([Disabling 'ranlib' for HP-UX...])
6ad85e8a 2206 RANLIB=":"
2207 ;;
2208esac
2209
090089c4 2210dnl Check for headers
2211AC_HEADER_DIRENT
2212AC_HEADER_STDC
db40ae20 2213
2214AC_CHECK_HEADERS( \
db40ae20 2215 arpa/inet.h \
30a4f2a8 2216 arpa/nameser.h \
9441aa34 2217 assert.h \
db40ae20 2218 bstring.h \
27e059d4 2219 cassert \
db40ae20 2220 crypt.h \
281422f8 2221 cstring \
30a4f2a8 2222 ctype.h \
2223 errno.h \
ce3d30fb 2224 execinfo.h \
db40ae20 2225 fcntl.h \
42ad37af 2226 fnmatch.h \
9c1d8929 2227 getopt.h \
52303a3d 2228 glob.h \
88738790 2229 gnumalloc.h \
30a4f2a8 2230 grp.h \
27e059d4
AJ
2231 iosfwd \
2232 iomanip \
2233 iostream \
5cafc1d6 2234 ip_compat.h \
42b51993 2235 ip_fil_compat.h \
5cafc1d6 2236 ip_fil.h \
2237 ip_nat.h \
dbc5782a 2238 ipl.h \
30a4f2a8 2239 libc.h \
6ad85e8a 2240 limits.h \
d2422105 2241 linux/types.h \
1cc2f840 2242 machine/byte_swap.h \
30a4f2a8 2243 malloc.h \
04f55905 2244 map \
e0bddc45 2245 math.h \
db40ae20 2246 memory.h \
b075cbb1 2247 mount.h \
30a4f2a8 2248 netdb.h \
db40ae20 2249 netinet/in.h \
cc192b50 2250 netinet/in_systm.h \
42b51993 2251 netinet/ip_fil_compat.h \
1f7c9178 2252 openssl/err.h \
2253 openssl/md5.h \
2254 openssl/ssl.h \
8cd03ece 2255 openssl/x509v3.h \
cc192b50 2256 netinet/tcp.h \
a7ad6e4e 2257 openssl/engine.h \
27e059d4 2258 ostream \
4da086c4 2259 paths.h \
dcfe6390 2260 poll.h \
30a4f2a8 2261 pwd.h \
b5e4d7d4 2262 shadow.h \
30a4f2a8 2263 regex.h \
c68e9c6b 2264 sched.h \
519267d1 2265 security/pam_appl.h \
30a4f2a8 2266 signal.h \
27e059d4 2267 sstream \
30a4f2a8 2268 stdarg.h \
2269 stddef.h \
27e059d4 2270 stdexcept \
30a4f2a8 2271 stdio.h \
db40ae20 2272 stdlib.h \
27e059d4 2273 string \
db40ae20 2274 string.h \
2275 strings.h \
0a4e8536 2276 sys/bitypes.h \
f9576890 2277 sys/bswap.h \
2278 sys/endian.h \
db40ae20 2279 sys/file.h \
5cafc1d6 2280 sys/ioctl.h \
30a4f2a8 2281 sys/param.h \
62ae0622 2282 sys/prctl.h \
3d4022fa 2283 sys/md5.h \
77e4c0c9 2284 sys/msg.h \
30a4f2a8 2285 sys/resource.h \
db40ae20 2286 sys/select.h\
30a4f2a8 2287 sys/socket.h \
2288 sys/stat.h \
b075cbb1 2289 sys/statvfs.h \
3c641669 2290 syscall.h \
30a4f2a8 2291 sys/syscall.h \
db40ae20 2292 sys/time.h \
2293 sys/types.h \
30a4f2a8 2294 sys/un.h \
b075cbb1 2295 sys/vfs.h \
30a4f2a8 2296 sys/wait.h \
db40ae20 2297 syslog.h \
30a4f2a8 2298 time.h \
2299 unistd.h \
3c641669 2300 utime.h \
30a4f2a8 2301 varargs.h \
77d6bd88 2302 byteswap.h \
2303 glib.h \
60d096f4 2304 stdint.h \
2305 inttypes.h \
3c641669 2306 grp.h \
94331f58 2307 db.h \
5b43d209 2308 db_185.h
db40ae20 2309)
2310
fc68f6b1 2311AC_CHECK_HEADERS(
2312 linux/netfilter_ipv4.h \
2313 linux/netfilter_ipv4/ip_tproxy.h \
2314,,,
dcd1dc78 2315SQUID_DEFAULT_INCLUDES
2316#if HAVE_LIMITS_H
2317#include <limits.h>
2318#endif
a74968c2
AJ
2319/* Netfilter ip(6)tables v1.4.0 has broken headers */
2320#if HAVE_NETINET_IN_H
2321#include <netinet/in.h>
2322#endif
dcd1dc78 2323)
2324
d1e5191e 2325dnl *BSD dont include the depenencies for all their net/ and netinet/ files
c92b4732 2326dnl We must include a few basic type headers for them to work.
d1e5191e
AJ
2327AC_CHECK_HEADERS( \
2328 net/if.h \
5a3237b0 2329 netinet/if_ether.h\
d1e5191e 2330 netinet/icmp6.h \
975cfef6 2331 netinet/in.h \
d1e5191e
AJ
2332 netinet/ip.h \
2333 netinet/ip6.h \
5a3237b0 2334 netinet/ip_compat.h\
975cfef6 2335 netinet/ip_fil_compat.h\
5a3237b0 2336 netinet/ip_fil.h\
d1e5191e 2337 netinet/ip_icmp.h \
dbc5782a 2338 netinet/ipl.h \
975cfef6 2339 netinet/ip_nat.h\
ec9909b0 2340 net/pf/pfvar.h \
d1e5191e 2341 net/pfvar.h \
77e4c0c9 2342 sys/mount.h\
d1e5191e
AJ
2343 resolv.h \
2344,,,
2345SQUID_BSDNET_INCLUDES)
5a3237b0 2346
aee0606f 2347AC_C_CONST
d57288d2 2348AC_C_BIGENDIAN
aee0606f 2349
6a9f6389 2350AC_STRUCT_TM
2351AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2352#if TM_IN_SYS_TIME
2353#if HAVE_SYS_TIME_H
2354#include <sys/time.h>
2355#endif
2356#elif HAVE_TIME_H
2357#include <time.h>
2358#endif
5c51415d 2359])
46c883ed 2360
6a9f6389 2361AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2362#if HAVE_SYS_TYPES_H
2363#include <sys/types.h>
2364#endif
eb824054 2365#if HAVE_MALLOC_H
2366#include <malloc.h>
6a9f6389 2367#endif])
eb824054 2368
6a9f6389 2369AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2370#if HAVE_SYS_TYPES_H
2371#include <sys/types.h>
2372#endif
2373#if HAVE_MALLOC_H
2374#include <malloc.h>
2375#endif])
090089c4 2376
08caf8c6 2377dnl Override rusage() detect on MinGW because is emulated in source code
2378case "$host_os" in
2379 mingw|mingw32)
2380 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2381 ac_cv_func_getrusage='yes'
eed82608 2382 AC_MSG_NOTICE([Using own rusage on Windows.])
08caf8c6 2383 ;;
2384 *)
2385 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
8ff51bba 2386#if HAVE_SYS_TIME_H
2387#include <sys/time.h>
2388#endif
b54a6789 2389#if HAVE_SYS_RESOURCE_H
2390#include <sys/resource.h>
6a9f6389 2391#endif])
08caf8c6 2392 ;;
2393esac
b54a6789 2394
6a9f6389 2395AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2396#if HAVE_SYS_TYPES_H
2397#include <sys/types.h>
2398#endif
a025a745 2399#include <netinet/in.h>
2400#include <netinet/in_systm.h>
6ad85e8a 2401#include <netinet/ip.h>
b05490a8 2402#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 2403#define ip_hl ihl
2404#endif
2405#ifndef __linux__
b05490a8 2406#ifndef __CYGWIN__
6ad85e8a 2407#define iphdr ip
b05490a8 2408#endif
6a9f6389 2409#endif])
a025a745 2410
090089c4 2411dnl Check for typedefs
77d6bd88 2412AC_CHECK_SIZEOF(void *)
090089c4 2413
0409a509 2414dnl 8 bit integers - int8_t
2415dnl if this is defined we trust it to be 8 bits
2416AC_CHECK_TYPE(int8_t,[
2417 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2418 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2419 ],,SQUID_DEFAULT_INCLUDES)
2420
2421dnl fallback #1
2422AC_CHECK_TYPE(char,[
2423 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2424 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2425 ],,SQUID_DEFAULT_INCLUDES)
2426
2427dnl unsigned 8 bit ints - u_int8_t
2428dnl if this is defined we trust it to be 8 bits
2429AC_CHECK_TYPE(u_int8_t,[
2430 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2431 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2432 ],,SQUID_DEFAULT_INCLUDES)
2433
2434dnl fallback #1
2435dnl if this is defined we trust it to be 8 bits
2436AC_CHECK_TYPE(uint8_t,[
2437 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2438 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2439 ],,SQUID_DEFAULT_INCLUDES)
2440
2441dnl 16 bit integers - int16_t
6a9f6389 2442dnl if this is defined we trust it to be 16 bits
62266438 2443AC_CHECK_TYPE(int16_t,[
2444 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2445 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2446 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2447
2448dnl fallback #1
2449AC_CHECK_TYPE(short,[
856e69c5 2450 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2451 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2452 ],,SQUID_DEFAULT_INCLUDES)
2453
2454dnl fallback #2
2455AC_CHECK_TYPE(int,[
856e69c5 2456 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2457 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2458 ],,SQUID_DEFAULT_INCLUDES)
2459
2460dnl unsigned 16 bit ints - u_int16_t
2461dnl if this is defined we trust it to be 16 bits
62266438 2462AC_CHECK_TYPE(u_int16_t,[
2463 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2464 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2465 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2466
2467dnl fallback #1
2468dnl if this is defined we trust it to be 16 bits
62266438 2469AC_CHECK_TYPE(uint16_t,[
2470 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2471 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2472 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2473
2474dnl 32 bit signed int - int32_t
2475dnl if this is defined we trust it to be 32 bits
62266438 2476AC_CHECK_TYPE(int32_t,[
2477 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2478 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2479 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2480
2481dnl fallback #1
2482AC_CHECK_TYPE(long,[
856e69c5 2483 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2484 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2485 ],,SQUID_DEFAULT_INCLUDES)
2486
2487dnl 32 bit unsigned int - u_int32_t
2488dnl if this is defined we trust it to be 32 bits
62266438 2489AC_CHECK_TYPE(u_int32_t,[
2490 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2491 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2492 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2493
2494dnl fallback #1
2495dnl if this is defined we trust it to be 32 bits
62266438 2496AC_CHECK_TYPE(uint32_t,[
2497 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2498 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2499 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2500
2501dnl 64 bit signed - int64_t
2502dnl if this is defind we trust it to be 64 bits
62266438 2503AC_CHECK_TYPE(int64_t,[
2504 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2505 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2506 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2507
2508dnl fallback #1
2509dnl if this is defind we trust it to be 64 bits
62266438 2510AC_CHECK_TYPE(__int64,[
2511 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2512 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2513 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2514
2515dnl fallback #2
2516AC_CHECK_TYPE(long long,[
856e69c5 2517 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2518 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2519 ],,SQUID_DEFAULT_INCLUDES)
2520
2521dnl 64 bit unsigned - u_int64_t
2522dnl if this is defind we trust it to be 64 bits
62266438 2523AC_CHECK_TYPE(u_int64_t,[
2524 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2525 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2526 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2527
2528dnl fallback #1
2529dnl if this is defind we trust it to be 64 bits
62266438 2530AC_CHECK_TYPE(uint64_t,[
2531 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2532 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2533 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2534
588e71df 2535dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2536dnl that is incompatible with the updated Solaris header files.
2537dnl For this reason, we must check if pad128_t and upad128_t are defined.
2538AC_CHECK_TYPE(pad128_t,
2539 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2540 ,SQUID_DEFAULT_INCLUDES)
2541
2542AC_CHECK_TYPE(upad128_t,
2543 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2544 ,SQUID_DEFAULT_INCLUDES)
2545
6a9f6389 2546AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2547AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2548 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2549AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2550AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2551 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2552AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2553AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
adcceb47 2554
77d6bd88 2555dnl Check for special functions
2556AC_FUNC_ALLOCA
2557
6a9f6389 2558AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2559#include <sys/types.h>
6637e3a5 2560#include <sys/socket.h>
2561#if STDC_HEADERS
2562#include <stdlib.h>
2563#include <stddef.h>
6a9f6389 2564#endif])
6637e3a5 2565
b50f1b2b 2566dnl Check for libcap header (assume its not broken unless
69367152
HN
2567use_libcap=auto
2568AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],[disable usage of Linux capabilities library to control privileges]),
2569[ if test "x$withval" = "xyes" ; then
b64b6030 2570 AC_MSG_RESULT(libcap forced enabled)
69367152 2571 use_libcap=yes
b50f1b2b 2572 else
1c9910eb 2573 AC_MSG_RESULT(libcap forced disabled)
69367152 2574 use_libcap=no
b50f1b2b 2575 fi
b64b6030 2576])
69367152 2577if test "x$use_libcap" != "xno"; then
b64b6030
HN
2578 # cap_clear_flag is the most recent libcap function we require
2579 AC_CHECK_LIB(cap, cap_clear_flag)
6a4d3ec8
HN
2580 if test "x$ac_cv_lib_cap_cap_clear_flag" = xyes; then
2581 use_libcap=yes
2582 else
69367152 2583 if test "x$use_libcap" = "xyes"; then
ff8d255b 2584 AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
b64b6030 2585 fi
69367152 2586 use_libcap=no
b64b6030
HN
2587 fi
2588fi
69367152 2589
6a4d3ec8 2590if test "x$use_libcap" = "xyes"; then
b64b6030
HN
2591 AC_DEFINE(USE_LIBCAP, 1, [use libcap to set capabilities required for TPROXY])
2592 dnl Check for libcap headader breakage.
b50f1b2b 2593 AC_CHECK_HEADERS(sys/capability.h)
ff8d255b
HN
2594 AC_CACHE_CHECK([for operational libcap2 headers], squid_cv_sys_capability_works,
2595 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2596#include <stdlib.h>
2597#include <stddef.h>
2598#include <sys/capability.h>
2599]], [[
2600capget(NULL, NULL);
2601capset(NULL, NULL);
2602 ]])],[squid_cv_sys_capability_works=yes],[squid_cv_sys_capability_works=no])
b50f1b2b 2603 )
ff8d255b
HN
2604 if test x$squid_cv_sys_capability_works != xyes; then
2605 AC_DEFINE([LIBCAP_BROKEN],1,[if libcap2 headers are broken and clashing with glibc])
2606 fi
b50f1b2b 2607fi
5b43d209 2608
b64b6030 2609
6a9f6389 2610AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
aea1be68 2611#include <sys/ipc.h>
6a9f6389 2612#include <sys/msg.h>])
aea1be68 2613
090089c4 2614dnl Check for needed libraries
54c95954
FC
2615AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
2616AC_SEARCH_LIBS([res_init],[resolv])
2617AC_SEARCH_LIBS([bind],[socket])
2618AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
2619AC_SEARCH_LIBS([strlcpy], [bsd])
85cd85f3 2620AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
bfe8dedf 2621dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
4b26fae9 2622case "$host_os" in
2623 mingw|mingw32)
2624 AC_MSG_CHECKING(for winsock)
2625 save_LIBS="$LIBS"
2626 for curlib in ws2_32 wsock32; do
2627 LIBS="$LIBS -l$curlib"
62979ab1 2628 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>]], [[
1635bf30
GS
2629 socket(0,0,0);
2630 select(0,NULL,NULL,NULL,NULL);
2631 closesocket(0);
2632 gethostname(NULL,0);
62979ab1 2633 ]])],[have_winsock=yes],[have_winsock=no])
4b26fae9 2634
2635 if test $have_winsock = yes; then
2636 ac_cv_func_select='yes'
2637 if test $curlib = ws2_32; then
2638 have_winsock=winsock2
2639 fi
2640 break
2641 fi
2642 LIBS="$save_LIBS"
2643 done
2644 AC_MSG_RESULT($have_winsock)
bfe8dedf
GS
2645 if test $have_winsock = winsock2; then
2646 AC_CHECK_HEADERS(winsock2.h)
2647 else
2648 AC_CHECK_HEADERS(winsock.h)
2649 fi
4b26fae9 2650 ;;
2651esac
94d48591 2652
3c641669 2653dnl Ripped from the Samba sources
2654AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
62979ab1 2655 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3c641669 2656#include <sys/types.h>
2657#include <stdlib.h>
2658#include <stddef.h>
2659#include <sys/socket.h>
62979ab1 2660#include <sys/un.h>]], [[
3c641669 2661 struct sockaddr_un sunaddr;
2662 sunaddr.sun_family = AF_UNIX;
62979ab1 2663]])],[squid_cv_unixsocket=yes],[squid_cv_unixsocket=no])])
3c641669 2664if test x"$squid_cv_unixsocket" = x"yes"; then
6a9f6389 2665 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
3c641669 2666fi
2667dnl end rip
2668
94d48591 2669 AC_CHECK_LIB(gnumalloc, main)
2670 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
eed82608 2671 AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc])
94d48591 2672 ac_cv_func_mallinfo=no
2673 ac_cv_func_mallocblksize=no
2674 ac_cv_func_mallopt=no
2675 else
2676 case "$host" in
2677 *-sun-solaris*)
eed82608 2678 AC_MSG_NOTICE([skipping libmalloc check for $host])
94d48591 2679 ;;
2680 i386-*-freebsd*)
eed82608 2681 AC_MSG_NOTICE([skipping libmalloc check for $host])
94d48591 2682 ;;
2683 *)
2684
2685 AC_CHECK_LIB(malloc, main)
2686 ;;
2687 esac
2688 fi
94d48591 2689
be79ade0 2690AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
08caf8c6 2691case "$host_os" in
2692mingw|mingw32)
eed82608 2693 AC_MSG_NOTICE([Use MSVCRT for math functions.])
08caf8c6 2694 ;;
2695 *)
c753b5e6
AJ
2696 dnl rint() is only used in old C code for now.
2697 AC_LANG_PUSH([C])
2698 AC_SEARCH_LIBS([rint],[m])
2699 AC_LANG_POP([C])
08caf8c6 2700 ;;
2701esac
090089c4 2702
001ad4cc
AJ
2703dnl Enable IPv6 support
2704AC_MSG_CHECKING([whether to enable IPv6])
2705use_ipng=yes
2706AC_ARG_ENABLE(ipv6,
62979ab1 2707 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
001ad4cc
AJ
2708[ if test "x$enableval" = "xyes" ; then
2709 AC_MSG_RESULT(yes)
2710 else
2711 AC_MSG_RESULT(no)
2712 use_ipng=no
2713 fi
2714],[AC_MSG_RESULT(yes)])
2715
2716if test "$use_ipng" = "yes"; then
2717 SAVED_LIBS="$LIBS"
2718 dnl Solaris 10/11 requires -lsocket
2719 case "$host" in
2720 *-solaris*)
2721 LIBS="$LIBS -lsocket"
2722 ;;
2723 *)
2724 ;;
2725 esac
2726 AC_CACHE_CHECK([if PF_INET6 is available], $use_ipng,
62979ab1 2727 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* PF_INET6 available check */
001ad4cc
AJ
2728# include <sys/types.h>
2729# include <sys/socket.h>
b3167ca7 2730 int main(int argc, char **argv) {
001ad4cc
AJ
2731 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
2732 return 1;
2733 else
2734 return 0;
2735 }
62979ab1 2736 ]])],[ AC_MSG_RESULT(yes)
001ad4cc 2737 use_ipng=yes
62979ab1
AJ
2738 SAVED_LIBS="$LIBS" ],[ AC_MSG_RESULT(no)
2739 use_ipng=no ],[])
001ad4cc
AJ
2740 )
2741 LIBS="$SAVED_LIBS"
2742fi
2743
2744if test "$use_ipng" = "yes"; then
2745 AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
18a8e998 2746 SET_IPV6_SETTINGS=""
001ad4cc
AJ
2747 use_v4mapped=yes
2748
44770d71 2749dnl Check for forced split-stack mode
001ad4cc
AJ
2750 AC_MSG_CHECKING([for IPv6 split-stack requirement])
2751 AC_ARG_WITH(ipv6-split-stack,
62979ab1 2752 AS_HELP_STRING([--with-ipv6-split-stack],[Force-Enable experimental split-stack support for Windows XP and *BSD. Requires IPv6.]),
001ad4cc
AJ
2753 [ use_v4mapped="no"
2754 AC_MSG_RESULT(yes)],
2755 [ AC_MSG_RESULT(no) ])
2756
44770d71
AJ
2757dnl Check for IPv6 v4-mapping availability
2758dnl Useful for other OS with hybrid-stack defaults turned OFF
001ad4cc
AJ
2759dnl But only usable if it actually works...
2760 if test "$use_v4mapped" = "yes" ; then
2761 AC_MSG_CHECKING([for IPv6 v4-mapping ability])
62979ab1 2762 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* IPPROTO_V4MAPPED is usable check */
001ad4cc
AJ
2763# include <sys/types.h>
2764# include <sys/socket.h>
2765# include <netinet/in.h>
2766#if HAVE_NETINET_IN6_H
2767# include <netinet/in6.h>
2768#endif
b3167ca7 2769 int main(int argc, char **argv) {
001ad4cc
AJ
2770 int s = socket(PF_INET6, SOCK_STREAM, 0);
2771 int tos = 0;
2772 if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &tos, sizeof(int)) < 0)
2773 return 1;
2774 else
2775 return 0;
2776 }
62979ab1 2777 ]])],[ AC_MSG_RESULT(yes)
001ad4cc
AJ
2778 use_v4mapped=yes
2779 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
62979ab1 2780 ],[ AC_MSG_RESULT(no)
001ad4cc
AJ
2781 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets])
2782 use_v4mapped=no
62979ab1 2783 ],[])
001ad4cc
AJ
2784 fi
2785
2786dnl if we can't defer v4-mapping to the OS we are forced to split-stack the FD table.
2787 AC_MSG_CHECKING([for IPv6 stack type/mode])
2788 if test "$use_v4mapped" = "yes"; then
2789 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2790 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations])
2791 AC_MSG_RESULT(mapping hybrid)
2792 else
2793 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2794 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
2795 AC_MSG_RESULT(split-stack or BSD non-mapping dual-stack)
2796 fi
2797
2798dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2799AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2800 ac_cv_have_sin6_len_in_struct_sai, [
62979ab1 2801 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
001ad4cc
AJ
2802#include <sys/types.h>
2803#include <sys/socket.h>
2804#include <netinet/in.h>
62979ab1
AJ
2805 ]], [[ struct sockaddr_in6 s; s.sin6_len = 1; ]])],[ ac_cv_have_sin6_len_in_struct_sai="yes" ],[ ac_cv_have_sin6_len_in_struct_sai="no"
2806 ])
001ad4cc
AJ
2807 ])
2808 if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2809 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2810 else
2811 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2812 fi
2813
2814else
2815 # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
2816 AC_MSG_WARN([IPv6 is not available on this system.])
2817 AC_DEFINE(USE_IPV6,0,[Enable support for IPv6])
2818 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
2819 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
18a8e998 2820 SET_IPV6_SETTINGS="\#IPv6 Not Available: "
001ad4cc 2821fi
18a8e998 2822AC_SUBST(SET_IPV6_SETTINGS)
001ad4cc
AJ
2823
2824dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2825AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2826 ac_cv_have_ss_len_in_struct_ss, [
62979ab1 2827 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
001ad4cc
AJ
2828#include <sys/types.h>
2829#include <sys/socket.h>
2830#include <netinet/in.h>
62979ab1
AJ
2831 ]], [[ struct sockaddr_storage s; s.ss_len = 1; ]])],[ ac_cv_have_ss_len_in_struct_ss="yes" ],[ ac_cv_have_ss_len_in_struct_ss="no"
2832 ])
001ad4cc
AJ
2833])
2834if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2835 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2836else
2837 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2838fi
2839
2840dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2841AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2842 ac_cv_have_sin_len_in_struct_sai, [
62979ab1 2843 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
001ad4cc
AJ
2844#include <sys/types.h>
2845#include <sys/socket.h>
2846#include <netinet/in.h>
62979ab1
AJ
2847 ]], [[ struct sockaddr_in s; s.sin_len = 1; ]])],[ ac_cv_have_sin_len_in_struct_sai="yes" ],[ ac_cv_have_sin_len_in_struct_sai="no"
2848 ])
001ad4cc
AJ
2849])
2850if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
2851 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2852else
2853 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2854fi
2855
090089c4 2856dnl Check for libcrypt
0d8565ac 2857CRYPTLIB=
8154dd82 2858dnl Some of our helpers use crypt(3) which may be in libc, or in
2859dnl libcrypt (eg FreeBSD)
c1dc012a 2860AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
3d4022fa 2861dnl Solaris10 provides MD5 natively through libmd5
c1dc012a 2862AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
be79ade0 2863AC_SUBST(CRYPTLIB)
77f675ad 2864
0d8565ac
AJ
2865# check for crypt, may require -lcrypt
2866SAVED_LIBS="$LIBS"
2867LIBS="$LIBS $CRYPTLIB"
2868AC_CHECK_FUNCS(crypt)
2869LIBS="$SAVED_LIBS"
2870
2871
042b1f8a 2872dnl Check for libdl, used by auth_modules/PAM
8154dd82 2873if test "$with_dl" = "yes"; then
2874 AC_CHECK_LIB(dl, dlopen)
2875fi
042b1f8a 2876
86ec11aa 2877dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2878dnl Robert Side <rside@aiinc.bc.ca>
2879dnl Mon, 18 Jan 1999 17:48:00 GMT
2880case "$host" in
2881 *-pc-sco3.2*)
2882 AC_CHECK_LIB(intl, strftime)
2883 ;;
2884esac
2885
20e869bf 2886dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2887dnl only with Windows LDAP libraries using -lwldap32
2888case "$host_os" in
2889mingw|mingw32)
428744a1
AJ
2890 LDAPLIB="-lwldap32"
2891 LBERLIB=""
2892 ;;
20e869bf 2893*)
428744a1
AJ
2894 LDAPLIB="-lldap"
2895 dnl LDAP helpers need to know if -llber is needed or not
2896 AC_CHECK_LIB(lber, main, [LBERLIB="-llber"])
2897 ;;
20e869bf 2898esac
428744a1
AJ
2899AC_SUBST(LDAPLIB)
2900AC_SUBST(LBERLIB)
20e869bf 2901
b7a1c19e 2902dnl Check for libdb
2903DBLIB=
01b4931d 2904dnl 1.85
a258dfca 2905AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
32d0bbd7 2906SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
62979ab1 2907 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
a258dfca 2908#if HAVE_SYS_TYPES_H
2909#include <sys/types.h>
2910#endif
2911#if HAVE_LIMITS_H
2912#include <limits.h>
2913#endif
2914#if HAVE_DB_185_H
2915#include <db_185.h>
2916#elif HAVE_DB_H
2917#include <db.h>
62979ab1 2918#endif]], [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],[ac_cv_dbopen_libdb="yes"],[ac_cv_dbopen_libdb="no"])
32d0bbd7 2919LIBS="$SAVED_LIBS"
a258dfca 2920])
2b2161bb 2921if test $ac_cv_dbopen_libdb = yes; then
32d0bbd7 2922 LIB_DB="-ldb"
2923fi
01b4931d 2924AC_SUBST(LIB_DB)
b7a1c19e 2925
77f675ad 2926dnl System-specific library modifications
2927dnl
2928case "$host" in
88738790 2929 i386-*-solaris2.*)
7149a49f 2930 if test "$GCC" = "yes"; then
eed82608 2931 AC_MSG_NOTICE([Removing -O for gcc on $host])
80e92d6d 2932 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 2933 fi
2934 ;;
77f675ad 2935 *-sgi-irix*)
eed82608 2936 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
6716b242 2937 LIBS=`echo $LIBS | sed -e s/-lsocket//`
eed82608 2938 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
6716b242 2939 LIBS=`echo $LIBS | sed -e s/-lnsl//`
c415c128 2940 ac_cv_lib_nsl_main=no
eed82608 2941 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
b44c0fb4 2942 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 2943 ;;
4ba0bd0e 2944dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2945dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2946dnl Please change your configure script. AIX doesn't need -lbsd.
2947 *-ibm-aix*)
eed82608 2948 AC_MSG_NOTICE([Removing -lbsd for AIX...])
4ba0bd0e 2949 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2950 ;;
30a4f2a8 2951 *m88k*)
fa035612 2952 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2953 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
6a9f6389 2954 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
7149a49f 2955 ;;
580ce039 2956 [*-*-solaris2.[0-4]])
6a9f6389 2957 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
30a4f2a8 2958 ;;
711fa75e 2959 [*-sony-newsos[56]*])
6a9f6389 2960 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
f62c73dc 2961 ;;
77f675ad 2962esac
090089c4 2963
57faa85a 2964# Remove optimization for GCC 2.95.[123]
d20b1cd0 2965# gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2966if test "$GCC" = "yes"; then
2967 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2968 case "$GCCVER" in
57faa85a 2969 [2.95.[123]])
eed82608 2970 AC_MSG_NOTICE([Removing -O for gcc on $host with GCC $GCCVER])
d20b1cd0 2971 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2972 ;;
2973 esac
2974fi
2975
176d10ee 2976# Recommended by Balint Nagy Endre <bne@CareNet.hu>
2977case "$host" in
2978 *-univel-sysv4.2MP)
2979 if test `uname -v` = "2.03"; then
eed82608 2980 AC_MSG_NOTICE([disabling mallinfo for $host])
176d10ee 2981 ac_cv_func_mallinfo=no
2982 fi
2983 ;;
2984esac
2985
84cecfd2 2986dnl This has to be before AC_CHECK_FUNCS
2987# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2988# when running configure.
2989if test -z "$ac_cv_func_poll"; then
2990 case "$host" in
2991 [alpha-dec-osf3.*])
2992 # John Kay (jkay@nlanr.net) 19970818
eed82608 2993 AC_MSG_NOTICE([disabling poll for $host...])
84cecfd2 2994 ac_cv_func_poll='no'
2995 ;;
2996 [*-hp-hpux*.*])
2997 # Duane Wessels
eed82608 2998 AC_MSG_NOTICE([disabling poll for $host...])
84cecfd2 2999 ac_cv_func_poll='no'
3000 ;;
3001 [*-linux-*])
f5cec332 3002 # Henrik Nordstrom (hno@squid-cache.org) 19980817
9bb83c8b 3003 # poll is problematic on Linux. We disable it
3004 # by default until Linux gets it right.
b6a2f15e 3005 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
3006 if test $rev -lt 002002; then
eed82608 3007 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
b6a2f15e 3008 ac_cv_func_poll='no'
3009 fi
84cecfd2 3010 ;;
c68e9c6b 3011 [powerpc-ibm-aix4.1.*])
3012 # Mike Laster (mlaster@metavillage.com) 19981021
eed82608 3013 AC_MSG_NOTICE([disabling poll for $host...])
c68e9c6b 3014 ac_cv_func_poll='no'
3015 ;;
86ec11aa 3016 [*-pc-sco3.2*])
3017 # Robert Side <rside@aiinc.bc.ca>
3018 # Mon, 18 Jan 1999 17:48:00 GMT
eed82608 3019 AC_MSG_NOTICE([disabling poll for $host...])
86ec11aa 3020 ac_cv_func_poll='no'
3021 ;;
84cecfd2 3022 esac
3023fi
176d10ee 3024
08caf8c6 3025dnl Override statfs() detect on MinGW becasue is emulated in source code
3026case "$host_os" in
3027mingw|mingw32)
3028 ac_cv_func_statfs='yes'
3029 ;;
3030esac
3031
6716b242 3032dnl Check for library functions
3033AC_CHECK_FUNCS(\
ce3d30fb 3034 backtrace_symbols_fd \
3a144521 3035 bcopy \
3036 bswap_16 \
3037 bswap_32 \
f9576890 3038 bswap16 \
3039 bswap32 \
4ac29a5b 3040 fchmod \
6716b242 3041 getdtablesize \
8505e57b 3042 getpagesize \
230c091c 3043 getpass \
3a144521 3044 getrlimit \
30a4f2a8 3045 getrusage \
9c1d8929 3046 getspnam \
379d5751 3047 gettimeofday \
52303a3d 3048 glob \
f9576890 3049 htobe16 \
3050 htole16 \
d474c7a6 3051 kqueue\
30a4f2a8 3052 lrand48 \
6716b242 3053 mallinfo \
0f5efab0 3054 mallocblksize \
6716b242 3055 mallopt \
2ae6b9b0 3056 memcpy \
30a4f2a8 3057 memmove \
dac27377 3058 memset \
b99a6dec 3059 mkstemp \
1812b6c7 3060 mktime \
88738790 3061 mstats \
84cecfd2 3062 poll \
62ae0622 3063 prctl \
3a144521 3064 pthread_attr_setschedparam \
cd748f27 3065 pthread_attr_setscope \
3066 pthread_setschedparam \
42b51993 3067 pthread_sigmask \
c68e9c6b 3068 putenv \
b1e77ec1 3069 random \
6716b242 3070 regcomp \
3071 regexec \
3072 regfree \
30a4f2a8 3073 res_init \
af76ec93 3074 __res_init \
4915be3b 3075 rint \
a4ba1105 3076 sbrk \
3a144521 3077 select \
234967c9 3078 seteuid \
c415c128 3079 setgroups \
30a4f2a8 3080 setpgrp \
6716b242 3081 setrlimit \
30a4f2a8 3082 setsid \
3083 sigaction \
11430c03 3084 snprintf \
1ccc0d40 3085 socketpair \
30a4f2a8 3086 srand48 \
b1e77ec1 3087 srandom \
0343b99c 3088 statfs \
6716b242 3089 sysconf \
3090 syslog \
234967c9 3091 timegm \
28da5e0d 3092 vsnprintf \
6716b242 3093)
f5e5c4cf 3094dnl ... and some we provide local replacements for
3095AC_REPLACE_FUNCS(\
3096 drand48 \
a98c2da5 3097 eui64_aton \
cc192b50 3098 inet_ntop \
3099 inet_pton \
f5e5c4cf 3100 initgroups \
cc192b50 3101 getaddrinfo \
3102 getnameinfo \
f5e5c4cf 3103 strerror \
585cddda
AJ
3104 strsep \
3105 strtoll \
f5e5c4cf 3106 tempnam \
3107)
6716b242 3108
1b3db6d9 3109dnl Magic which checks whether we are forcing a type of comm loop we
3110dnl are actually going to (ab)use
3111
3112dnl Actually do the define magic now
3113dnl mostly ripped from squid-commloops, thanks to adrian and benno
3114
8075a4da
FC
3115if test -n "$squid_opt_io_loop_engine"; then
3116 AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine])
bf53a520 3117elif test "$squid_opt_enable_epoll" != "no" && test "$ac_cv_epoll_works" = "yes" ; then
8075a4da 3118 squid_opt_io_loop_engine="epoll"
bf53a520 3119elif test "$squid_opt_enable_kqueue" != "no" && test "$ac_cv_func_kqueue" = "yes" ; then
8075a4da 3120 squid_opt_io_loop_engine="kqueue"
bf53a520 3121elif test "$squid_opt_enable_poll" != "no" && test "$ac_cv_func_poll" = "yes" ; then
8075a4da 3122 squid_opt_io_loop_engine="poll"
bf53a520 3123elif test "$squid_opt_enable_select" != "no" && test "$ac_cv_func_select" = "yes" ; then
8075a4da 3124 squid_opt_io_loop_engine="select"
bf53a520 3125 if test "$squid_host_os" = "mingw" ; then
8075a4da 3126 squid_opt_io_loop_engine="select_win32"
bf53a520 3127 fi
1b3db6d9 3128else
bf53a520
FC
3129 AC_MSG_WARN([Eep! Can't find poll, kqueue, epoll, or select!])
3130 AC_MSG_WARN([I'll try select and hope for the best.])
8075a4da 3131 squid_opt_io_loop_engine="select"
1b3db6d9 3132fi
d474c7a6 3133
8075a4da 3134AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.])
d474c7a6 3135
8075a4da
FC
3136AM_CONDITIONAL([USE_POLL], [test $squid_opt_io_loop_engine = poll])
3137AM_CONDITIONAL([USE_EPOLL], [test $squid_opt_io_loop_engine = epoll])
3138AM_CONDITIONAL([USE_SELECT], [test $squid_opt_io_loop_engine = select])
3139AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $squid_opt_io_loop_engine = select_simple])
3140AM_CONDITIONAL([USE_SELECT_WIN32], [test $squid_opt_io_loop_engine = select_win32])
3141AM_CONDITIONAL([USE_KQUEUE], [test $squid_opt_io_loop_engine = kqueue])
3142AM_CONDITIONAL([USE_DEVPOLL], [test $squid_opt_io_loop_engine = devpoll])
d474c7a6 3143
8075a4da 3144case $squid_opt_io_loop_engine in
0abb39dd
FC
3145 epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;;
3146 poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;;
3147 kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;;
3148 select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;;
3149 select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;;
d474c7a6 3150esac
1b3db6d9 3151
60939927 3152dnl Yay! Another Linux brokenness. Its not good enough
3153dnl to know that setresuid() exists, because RedHat 5.0 declares
3154dnl setresuid() but doesn't implement it.
3155dnl
3156AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
62979ab1 3157 AC_RUN_IFELSE([AC_LANG_SOURCE([[
60939927 3158#include <stdlib.h>
b3167ca7 3159 int main(int argc, char **argv) {
5c51415d 3160 if(setresuid(-1,-1,-1)) {
3161 perror("setresuid:");
b3167ca7 3162 return 1;
60939927 3163 }
b3167ca7 3164 return 0;
5c51415d 3165 }
62979ab1 3166 ]])],[ac_cv_func_setresuid="yes"],[ac_cv_func_setresuid="no"],[])
60939927 3167)
5c51415d 3168if test "$ac_cv_func_setresuid" = "yes" ; then
6a9f6389 3169 AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Its not good enough to know that setresuid() exists, because RedHat 5.0 declare setresuid() but doesn't implement it.])
5c51415d 3170fi
60939927 3171
0abb39dd
FC
3172SQUID_CHECK_FUNC_STRNSTR
3173SQUID_CHECK_FUNC_VACOPY
3174SQUID_CHECK_FUNC___VACOPY
cee08cbc 3175
c3d0c8b5 3176
5cafc1d6 3177dnl IP-Filter support requires ipf header files. These aren't
3178dnl installed by default, so we need to check for them
47d80734 3179AC_MSG_NOTICE([Support for IPF-based transparent proxy requested: $squid_opt_ipf_transparent])
20ad76ab
FC
3180if test "$squid_opt_ipf_transparent" != "no" ; then
3181 AC_MSG_CHECKING(for availability of IP-Filter header files)
42b51993 3182 # hold on to your hats...
3183 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3184 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
87d21d8b 3185 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3186 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
42b51993 3187 have_ipfilter_compat_header="yes"
3188 fi
20ad76ab 3189 if test "$have_ipfilter_compat_header" = "yes" &&
eb824054 3190 test "$ac_cv_header_ip_fil_h" = "yes" &&
3191 test "$ac_cv_header_ip_nat_h" = "yes" ; then
20ad76ab 3192 squid_opt_ipf_transparent="yes"
eb824054 3193 AC_DEFINE(IPF_TRANSPARENT, 1)
42b51993 3194 elif test "$have_ipfilter_compat_header" = "yes" &&
eb824054 3195 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3196 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
20ad76ab 3197 squid_opt_ipf_transparent="yes"
eb824054 3198 AC_DEFINE(IPF_TRANSPARENT, 1)
3199 else
20ad76ab 3200 squid_opt_ipf_transparent="no"
5cafc1d6 3201 AC_DEFINE(IPF_TRANSPARENT, 0)
5cafc1d6 3202 fi
3203 AC_MSG_RESULT($IPF_TRANSPARENT)
3204fi
20ad76ab 3205if test "$squid_opt_ipf_transparent" = "yes" -a "$squid_host_os" = "solaris" ; then
8f6ca20d 3206dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3207dnl Solaris minor version (8, 9, 10, ...)
20ad76ab
FC
3208 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3209 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3210 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
5cafc1d6 3211fi
3212
2b0dd4ac 3213dnl PF support requires a header file.
47d80734 3214AC_MSG_NOTICE([Support for PF-based transparent proxy requested: $squid_opt_pf_transparent])
20ad76ab 3215if test "$squid_opt_pf_transparent" != "no" ; then
47d80734 3216 AC_MSG_CHECKING(for availability of PF header files)
20ad76ab
FC
3217 # hold on to your hats...
3218 if test "$ac_cv_header_net_pfvar_h" = "yes" || test "$ac_cv_header_net_pf_pfvar_h" = "yes"; then
3219 squid_opt_pf_transparent="yes"
3220 AC_DEFINE(PF_TRANSPARENT, 1)
3221 else
3222 squid_opt_pf_transparent="no"
3223 AC_DEFINE(PF_TRANSPARENT, 0)
3224 fi
3225 AC_MSG_RESULT($squid_opt_pf_transparent)
2b0dd4ac 3226fi
20ad76ab 3227if test "$squid_opt_pf_transparent" = "no" ; then
eed82608
AJ
3228 AC_MSG_WARN([Cannot find necessary PF header file])
3229 AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
2b0dd4ac 3230fi
3231
20ad76ab 3232if test "$squid_opt_linux_netfilter" != "no" ; then
d6d62546 3233 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
d852fbad 3234 # hold on to your hats...
3235 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
d852fbad 3236 AC_DEFINE(LINUX_NETFILTER, 1)
3237 else
20ad76ab 3238 squid_opt_linux_netfilter="no"
d852fbad 3239 AC_DEFINE(LINUX_NETFILTER, 0)
20ad76ab
FC
3240 AC_MSG_WARN([Cannot find necessary Linux kernel (Netfilter) header files])
3241 AC_MSG_WARN([Linux Transparent and Intercepting Proxy support WILL NOT be enabled])
d852fbad 3242 fi
20ad76ab 3243 AC_MSG_RESULT($squid_opt_linux_netfilter)
b50f1b2b 3244fi
20ad76ab 3245
b50f1b2b 3246dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
47d80734 3247AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $squid_opt_linux_netfilter])
20ad76ab 3248if test "$squid_opt_linux_netfilter" = "yes" && test "$use_libcap" != "yes" ; then
b50f1b2b
AJ
3249 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3250 AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3251 AC_MSG_WARN([Reduced support to Interception Proxy])
96f08e2d
FC
3252 squid_opt_linux_tproxy2="no"
3253 # AC_DEFINE'd later
3254fi
3255
3256# Linux Netfilter/TPROXYv2 support requires some specific header files and
3257# support infrastructure (netfilter and libcap)
47d80734 3258AC_MSG_NOTICE([Support for Linux TPROXY v2 transparent proxy requested: $squid_opt_linux_tproxy2])
96f08e2d
FC
3259if test "$squid_opt_linux_tproxy2" = "yes" -a "$use_libcap" != "yes" ; then
3260 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3261 AC_MSG_WARN([Disabling Linux TPROXY v2 support])
3262 AC_MSG_WARN([Interception proxy will still work])
3263 squid_opt_linux_tproxy2="no"
3264fi
3265if test "$squid_opt_linux_tproxy2" = "yes" ; then
3266 # we already checked that $use_libcap2=yes
3267 if test "$squid_opt_linux_netfilter" = "no" ; then
3268 squid_opt_linux_netfilter="yes"
3269 AC_MSG_NOTICE([Enabling Linux Netfilter support needed by Linux TPROXY v2])
3270 fi
3271 AC_MSG_CHECKING([if TPROXYv2 header files are installed])
3272 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" != "yes" ; then
3273 squid_opt_linux_tproxy2="no"
3274 dnl need to output before next lines
3275 AC_MSG_RESULT($squid_opt_linux_tproxy2)
96f08e2d
FC
3276 AC_MSG_WARN([Cannot find TPROXY v2 headers, you need to patch the kernel with ])
3277 AC_MSG_WARN([tproxy package from: http://www.balabit.com/downloads/files/tproxy/])
3278 AC_MSG_WARN([or use '--enable-linux-netfilter' option instead for Netfilter support.])
b50f1b2b 3279 else
96f08e2d 3280 AC_MSG_RESULT($squid_opt_linux_tproxy2)
b50f1b2b 3281 fi
fc68f6b1 3282fi
3283
96f08e2d
FC
3284dnl at the end of it all..
3285if test "$squid_opt_linux_tproxy2" = "yes" ; then
3286 AC_DEFINE(LINUX_TPROXY2, 1)
3287else
3288 AC_DEFINE(LINUX_TPROXY2, 0)
3289fi
3290
3291
cc937513 3292AC_ARG_ENABLE(gnuregex,
62979ab1 3293 AS_HELP_STRING([--enable-gnuregex],[Compile GNUregex. Unless you have reason to use
cc937513
AJ
3294 this option, you should not enable it.
3295 This library file is usually only required on Windows and
3296 very old Unix boxes which do not have their own regex
3297 library built in.]),
3298[USE_GNUREGEX=$enableval])
91bc414e 3299if test -z "$USE_GNUREGEX" ; then
3300 case "$host" in
3301 *-sun-solaris2.[[0-4]])
3302 USE_GNUREGEX="yes"
3303 ;;
3304 *-next-nextstep*)
3305 USE_GNUREGEX="yes"
3306 ;;
3307 esac
3308fi
7a081912 3309AC_MSG_CHECKING(if GNUregex needs to be compiled)
91bc414e 3310if test -z "$USE_GNUREGEX"; then
55878dfd 3311if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
74946a0f 3312 USE_GNUREGEX="yes"
00fa2c12 3313else
62979ab1
AJ
3314 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
3315#include <regex.h>]], [[regex_t t; regcomp(&t,"",0);]])],[USE_GNUREGEX="no"],[USE_GNUREGEX="yes"])
91bc414e 3316fi
00fa2c12 3317fi
74946a0f 3318AC_MSG_RESULT($USE_GNUREGEX)
3319if test "$USE_GNUREGEX" = "yes"; then
cc937513
AJ
3320 # override system regex with ours. Not good. But what was asked for.
3321 REGEXLIB=""
6a9f6389 3322 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
7a081912 3323fi
26675bf4 3324AC_SUBST(REGEXLIB)
cc937513 3325#AC_SUBST(LIBREGEX)
7a081912 3326
5c51415d 3327dnl Not cached since people are likely to tune this
e924600d 3328AC_MSG_CHECKING(Default FD_SETSIZE value)
62979ab1 3329AC_RUN_IFELSE([AC_LANG_SOURCE([[
e924600d 3330#if HAVE_STDIO_H
3331#include <stdio.h>
3332#endif
3333#if HAVE_UNISTD_H
3334#include <unistd.h>
3335#endif
cf69e4f2
HN
3336#if HAVE_STDLIB_H
3337#include <stdlib.h>
3338#endif
e924600d 3339#if HAVE_SYS_TIME_H
3340#include <sys/time.h>
3341#endif
3342#if HAVE_SYS_SELECT_H
3343#include <sys/select.h>
3344#endif
3345#if HAVE_SYS_TYPES_H
3346#include <sys/types.h>
3347#endif
bfe8dedf
GS
3348#if HAVE_WINSOCK_H
3349#include <winsock.h>
3350#endif
3351#if HAVE_WINSOCK2_H
3352#include <winsock2.h>
3353#endif
b3167ca7 3354int main(int argc, char **argv) {
635e6242 3355 FILE *fp = fopen("conftestval", "w");
3356 fprintf (fp, "%d\n", FD_SETSIZE);
b3167ca7 3357 return 0;
e924600d 3358}
62979ab1 3359]])],[DEFAULT_FD_SETSIZE=`cat conftestval`],[DEFAULT_FD_SETSIZE=256],[DEFAULT_FD_SETSIZE=256])
e924600d 3360AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
6a9f6389 3361AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
e924600d 3362
f49be7d1 3363
5c51415d 3364dnl Not cached since people are likely to tune this
234967c9 3365AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
c76d8acc 3366dnl damn! FreeBSD's pthreads breaks dup2().
5132a9eb 3367TLDFLAGS="$LDFLAGS"
f49be7d1 3368if test -n "$squid_filedescriptors_num" ; then
3369 SQUID_MAXFD=$squid_filedescriptors_num
3370 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3371else
f49be7d1 3372 case $host in
3373 i386-unknown-freebsd*)
3374 if echo "$LDFLAGS" | grep -q pthread; then
3375 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3376 fi
3377 esac
62979ab1 3378 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3379#include <stdio.h>
234967c9 3380#include <unistd.h>
cf69e4f2 3381#include <stdlib.h>
30a4f2a8 3382#include <sys/time.h> /* needed on FreeBSD */
234967c9 3383#include <sys/param.h>
3384#include <sys/resource.h>
b3167ca7 3385int main(int argc, char **argv) {
635e6242 3386 FILE *fp;
234967c9 3387 int i,j;
42b51993 3388#if defined(__CYGWIN32__) || defined (__CYGWIN__)
b05490a8 3389 /* getrlimit and sysconf returns bogous values on cygwin32.
df087e68 3390 * Number of fds is virtually unlimited in cygwin (sys/param.h)
b05490a8 3391 * __CYGWIN32__ is deprecated.
df087e68 3392 */
3393 i = NOFILE;
b05490a8 3394#else
3395#if HAVE_SETRLIMIT
234967c9 3396 struct rlimit rl;
3397#if defined(RLIMIT_NOFILE)
3398 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3399 perror("getrlimit: RLIMIT_NOFILE");
3400 } else {
f168f0c5
AJ
3401#if defined(__APPLE__)
3402 /* asking for more than OPEN_MAX fails on Leopard */
3403 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3404#else
234967c9 3405 rl.rlim_cur = rl.rlim_max; /* set it to the max */
f168f0c5 3406#endif
234967c9 3407 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3408 perror("setrlimit: RLIMIT_NOFILE");
3409 }
3410 }
3411#elif defined(RLIMIT_OFILE)
3412 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3413 perror("getrlimit: RLIMIT_OFILE");
3414 } else {
3415 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3416 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3417 perror("setrlimit: RLIMIT_OFILE");
3418 }
3419 }
3420#endif /* RLIMIT_NOFILE */
3421#endif /* HAVE_SETRLIMIT */
d9399075 3422 /* by starting at 2^14, we will never get higher
3423 than 2^15 for SQUID_MAXFD */
3424 i = j = 1<<14;
3425 while (j) {
3426 j >>= 1;
3427 if (dup2(0, i) < 0) {
3428 i -= j;
3429 } else {
3430 close(i);
3431 i += j;
3432 }
3433 }
3434 i++;
b05490a8 3435#endif /* IF !DEF CYGWIN */
635e6242 3436 fp = fopen("conftestval", "w");
a4d7e961 3437 fprintf (fp, "%d\n", i & ~0x3F);
b3167ca7 3438 return 0;
234967c9 3439}
62979ab1 3440 ]])],[SQUID_MAXFD=`cat conftestval`],[SQUID_MAXFD=256],[SQUID_MAXFD=256])
4b26fae9 3441 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3442 case "$host_os" in
3443 mingw|mingw32)
3444 SQUID_MAXFD="2048"
3445 ;;
3446 esac
f49be7d1 3447 AC_MSG_RESULT($SQUID_MAXFD)
3448fi
6a9f6389 3449AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
b9cc811d 3450if test "$SQUID_MAXFD" -lt 512 ; then
eed82608
AJ
3451 AC_MSG_WARN([$SQUID_MAXFD may not be enough filedescriptors if your])
3452 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3453 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3454 AC_MSG_WARN([on how to increase your filedescriptor limit])
80ab193b 3455fi
c76d8acc 3456LDFLAGS="$TLDFLAGS"
234967c9 3457
d0f9207a 3458if test `expr $SQUID_MAXFD % 64` != 0; then
eed82608 3459 AC_MSG_WARN([$SQUID_MAXFD is not an multiple of 64. This may cause issues on certain platforms.])
a4d7e961 3460fi
3461
5c51415d 3462dnl Not cached since people are likely to tune this
30a4f2a8 3463AC_MSG_CHECKING(Default UDP send buffer size)
62979ab1 3464AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3465#include <stdlib.h>
3466#include <stdio.h>
30a4f2a8 3467#include <sys/types.h>
bfe8dedf 3468#if HAVE_SYS_SOCKET_H
30a4f2a8 3469#include <sys/socket.h>
bfe8dedf
GS
3470#endif
3471#if HAVE_NETINET_IN_H
30a4f2a8 3472#include <netinet/in.h>
bfe8dedf
GS
3473#endif
3474#if HAVE_WINSOCK_H
3475#include <winsock.h>
3476#endif
3477#if HAVE_WINSOCK2_H
3478#include <winsock2.h>
3479#endif
b3167ca7 3480int main(int argc, char **argv)
30a4f2a8 3481{
635e6242 3482 FILE *fp;
eab7694a 3483 int fd,val=0;
bfe8dedf 3484#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
eab7694a 3485 int len=sizeof(int);
bfe8dedf
GS
3486 WSADATA wsaData;
3487 WSAStartup(2, &wsaData);
eab7694a
GS
3488#else
3489 socklen_t len=sizeof(socklen_t);
bfe8dedf 3490#endif
b3167ca7 3491 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
bfe8dedf 3492#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
b3167ca7 3493 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
bfe8dedf 3494 WSACleanup();
f3f3e961 3495#else
b3167ca7 3496 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
bfe8dedf 3497#endif
b3167ca7 3498 if (val<=0) return 1;
635e6242 3499 fp = fopen("conftestval", "w");
3500 fprintf (fp, "%d\n", val);
b3167ca7 3501 return 0;
30a4f2a8 3502}
62979ab1 3503]])],[SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_SNDBUF=16384],[SQUID_DETECT_UDP_SO_SNDBUF=16384])
6a9f6389 3504AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3505AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
30a4f2a8 3506
5c51415d 3507dnl Not cached since people are likely to tune this
30a4f2a8 3508AC_MSG_CHECKING(Default UDP receive buffer size)
62979ab1 3509AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3510#include <stdlib.h>
3511#include <stdio.h>
30a4f2a8 3512#include <sys/types.h>
bfe8dedf 3513#if HAVE_SYS_SOCKET_H
30a4f2a8 3514#include <sys/socket.h>
bfe8dedf
GS
3515#endif
3516#if HAVE_NETINET_IN_H
30a4f2a8 3517#include <netinet/in.h>
bfe8dedf
GS
3518#endif
3519#if HAVE_WINSOCK_H
3520#include <winsock.h>
3521#endif
3522#if HAVE_WINSOCK2_H
3523#include <winsock2.h>
3524#endif
b3167ca7 3525int main(int argc, char **argv)
30a4f2a8 3526{
635e6242 3527 FILE *fp;
eab7694a 3528 int fd,val=0;
bfe8dedf 3529#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
eab7694a 3530 int len=sizeof(int);
bfe8dedf
GS
3531 WSADATA wsaData;
3532 WSAStartup(2, &wsaData);
eab7694a
GS
3533#else
3534 socklen_t len=sizeof(socklen_t);
bfe8dedf 3535#endif
b3167ca7 3536 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
bfe8dedf 3537#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
b3167ca7 3538 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
bfe8dedf 3539 WSACleanup();
f3f3e961 3540#else
b3167ca7 3541 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
bfe8dedf 3542#endif
b3167ca7 3543 if (val <= 0) return 1;
635e6242 3544 fp = fopen("conftestval", "w");
3545 fprintf (fp, "%d\n", val);
b3167ca7 3546 return 0;
30a4f2a8 3547}
62979ab1 3548]])],[SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_RCVBUF=16384],[SQUID_DETECT_UDP_SO_RCVBUF=16384])
6a9f6389 3549AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3550AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
30a4f2a8 3551
5c51415d 3552dnl Not cached since people are likely to tune this
30a4f2a8 3553AC_MSG_CHECKING(Default TCP send buffer size)
62979ab1 3554AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3555#include <stdlib.h>
3556#include <stdio.h>
30a4f2a8 3557#include <sys/types.h>
bfe8dedf 3558#if HAVE_SYS_SOCKET_H
30a4f2a8 3559#include <sys/socket.h>
bfe8dedf
GS
3560#endif
3561#if HAVE_NETINET_IN_H
30a4f2a8 3562#include <netinet/in.h>
bfe8dedf
GS
3563#endif
3564#if HAVE_WINSOCK_H
3565#include <winsock.h>
3566#endif
3567#if HAVE_WINSOCK2_H
3568#include <winsock2.h>
3569#endif
b3167ca7 3570int main(int argc, char **argv)
30a4f2a8 3571{
635e6242 3572 FILE *fp;
eab7694a 3573 int fd,val=0;
bfe8dedf 3574#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
eab7694a 3575 int len=sizeof(int);
bfe8dedf
GS
3576 WSADATA wsaData;
3577 WSAStartup(2, &wsaData);
eab7694a
GS
3578#else
3579 socklen_t len=sizeof(socklen_t);
bfe8dedf 3580#endif
b3167ca7 3581 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
bfe8dedf 3582#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
b3167ca7 3583 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
bfe8dedf 3584 WSACleanup();
f3f3e961 3585#else
b3167ca7 3586 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
bfe8dedf 3587#endif
b3167ca7 3588 if (val <= 0) return 1;
635e6242 3589 fp = fopen("conftestval", "w");
3590 fprintf (fp, "%d\n", val);
b3167ca7 3591 return 0;
30a4f2a8 3592}
62979ab1 3593]])],[SQUID_TCP_SO_SNDBUF=`cat conftestval`],[SQUID_TCP_SO_SNDBUF=16384],[SQUID_TCP_SO_SNDBUF=16384])
30a4f2a8 3594AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2aa6ca58 3595if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
eed82608 3596 AC_MSG_NOTICE([Limiting send buffer size to 32K])
2aa6ca58 3597 SQUID_TCP_SO_SNDBUF=32768
3598fi
6a9f6389 3599AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
30a4f2a8 3600
5c51415d 3601dnl Not cached since people are likely to tune this
30a4f2a8 3602AC_MSG_CHECKING(Default TCP receive buffer size)
62979ab1 3603AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3604#include <stdlib.h>
3605#include <stdio.h>
30a4f2a8 3606#include <sys/types.h>
bfe8dedf 3607#if HAVE_SYS_SOCKET_H
30a4f2a8 3608#include <sys/socket.h>
bfe8dedf
GS
3609#endif
3610#if HAVE_NETINET_IN_H
30a4f2a8 3611#include <netinet/in.h>
bfe8dedf
GS
3612#endif
3613#if HAVE_WINSOCK_H
3614#include <winsock.h>
3615#endif
3616#if HAVE_WINSOCK2_H
3617#include <winsock2.h>
3618#endif
b3167ca7 3619int main(int argc, char **argv)
30a4f2a8 3620{
635e6242 3621 FILE *fp;
eab7694a 3622 int fd,val=0;
bfe8dedf 3623#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
eab7694a 3624 int len=sizeof(int);
bfe8dedf
GS
3625 WSADATA wsaData;
3626 WSAStartup(2, &wsaData);
eab7694a
GS
3627#else
3628 socklen_t len=sizeof(socklen_t);
bfe8dedf 3629#endif
b3167ca7 3630 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
bfe8dedf 3631#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
b3167ca7 3632 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
bfe8dedf 3633 WSACleanup();
f3f3e961 3634#else
b3167ca7 3635 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
bfe8dedf 3636#endif
b3167ca7 3637 if (val <= 0) return 1;
635e6242 3638 fp = fopen("conftestval", "w");
3639 fprintf (fp, "%d\n", val);
b3167ca7 3640 return 0;
30a4f2a8 3641}
62979ab1 3642]])],[SQUID_TCP_SO_RCVBUF=`cat conftestval`],[SQUID_TCP_SO_RCVBUF=16384],[SQUID_TCP_SO_RCVBUF=16384])
30a4f2a8 3643AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2aa6ca58 3644if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
eed82608 3645 AC_MSG_NOTICE([Limiting receive buffer size to 64K])
2aa6ca58 3646 SQUID_TCP_SO_RCVBUF=65535
3647fi
6a9f6389 3648AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
5c51415d 3649AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
62979ab1 3650 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[char *s = sys_errlist;]])],[ac_cv_needs_sys_errlist="no"],[ac_cv_needs_sys_errlist="yes"])
5c51415d 3651)
3652if test "$ac_cv_needs_sys_errlist" = "yes" ; then
6a9f6389 3653 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
5c51415d 3654fi
30a4f2a8 3655
ef364f64
AJ
3656dnl Hurd does not supply MAXPATHLEN. we may need to define it outselves.
3657dnl Other system define it in system headers
3658AC_CHECK_HEADERS([sys/param.h])
3659AC_MSG_CHECKING(for MAXPATHLEN)
3660AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/param.h>]],[[int i = MAXPATHLEN;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
3661 AC_DEFINE(MAXPATHLEN,256,[If MAXPATHLEN has not been defined])])
3662
3663
5c51415d 3664dnl Not cached since people are likely to change this
6bf65235 3665AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
62979ab1
AJ
3666AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
3667AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],[AC_MSG_RESULT(no)])
6bf65235 3668
b6a2f15e 3669if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
c68e9c6b 3670AC_MSG_CHECKING(for working statvfs() interface)
62979ab1 3671AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
c68e9c6b 3672#include <stdlib.h>
3673#include <stdio.h>
3674#include <sys/types.h>
3675#include <sys/statvfs.h>
62979ab1 3676]], [[
c68e9c6b 3677struct statvfs sfs;
3678sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3679sfs.f_files = sfs.f_ffree = 0;
3680statvfs("/tmp", &sfs);
62979ab1 3681]])],[ac_cv_func_statvfs=yes],[ac_cv_func_statvfs=no])
c68e9c6b 3682AC_MSG_RESULT($ac_cv_func_statvfs)
6b8e7481 3683if test "$ac_cv_func_statvfs" = "yes" ; then
6a9f6389 3684 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
b6a2f15e 3685fi
6b8e7481 3686fi
c68e9c6b 3687
cc192b50 3688dnl Detect what resolver fields we have available to use...
3689AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
62979ab1 3690AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
cc192b50 3691#if HAVE_SYS_TYPES_H
3692#include <sys/types.h>
3693#endif
3694#if HAVE_NETINET_IN_H
3695#include <netinet/in.h>
3696#endif
3697#if HAVE_ARPA_INET_H
3698#include <arpa/inet.h>
3699#endif
3700#if HAVE_ARPA_NAMESER_H
3701#include <arpa/nameser.h>
3702#endif
3703#if HAVE_RESOLV_H
3704#include <resolv.h>
3705#endif
62979ab1 3706]], [[_res_ext.nsaddr_list[[0]].s_addr;]])],[ac_cv_have_res_ext_nsaddr_list="yes"],[ac_cv_have_res_ext_nsaddr_list="no"]))
cc192b50 3707if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3708 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3709 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3710fi
3711
0873b2ab 3712if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
cc192b50 3713AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
62979ab1 3714AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
cc192b50 3715#if HAVE_SYS_TYPES_H
3716#include <sys/types.h>
3717#endif
3718#if HAVE_NETINET_IN_H
3719#include <netinet/in.h>
3720#endif
3721#if HAVE_ARPA_INET_H
3722#include <arpa/inet.h>
3723#endif
3724#if HAVE_ARPA_NAMESER_H
3725#include <arpa/nameser.h>
3726#endif
3727#if HAVE_RESOLV_H
3728#include <resolv.h>
3729#endif
62979ab1 3730]], [[_res._u._ext.nsaddrs[[0]]->sin6_addr;]])],[ac_cv_have_res_ext_nsaddrs="yes"],[ac_cv_have_res_ext_nsaddrs="no"]))
cc192b50 3731if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3732 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3733 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3734fi
3735fi
3736
c68e9c6b 3737AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
62979ab1 3738AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
c68e9c6b 3739#if HAVE_SYS_TYPES_H
3740#include <sys/types.h>
3741#endif
3742#if HAVE_NETINET_IN_H
3743#include <netinet/in.h>
3744#endif
3745#if HAVE_ARPA_INET_H
3746#include <arpa/inet.h>
3747#endif
3748#if HAVE_ARPA_NAMESER_H
3749#include <arpa/nameser.h>
3750#endif
3751#if HAVE_RESOLV_H
3752#include <resolv.h>
3753#endif
62979ab1 3754]], [[_res.nsaddr_list[[0]];]])],[ac_cv_have_res_nsaddr_list="yes"],[ac_cv_have_res_nsaddr_list="no"]))
c68e9c6b 3755if test $ac_cv_have_res_nsaddr_list = "yes" ; then
cc192b50 3756 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3757 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3758fi
3759
0873b2ab 3760if test "$_SQUID_RES_NSADDR_LIST" = ""; then
c68e9c6b 3761AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
62979ab1 3762AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
c68e9c6b 3763#if HAVE_SYS_TYPES_H
3764#include <sys/types.h>
3765#endif
3766#if HAVE_NETINET_IN_H
3767#include <netinet/in.h>
3768#endif
3769#if HAVE_ARPA_INET_H
3770#include <arpa/inet.h>
3771#endif
3772#if HAVE_ARPA_NAMESER_H
3773#include <arpa/nameser.h>
3774#endif
3775#if HAVE_RESOLV_H
3776#include <resolv.h>
3777#endif
62979ab1 3778]], [[_res.ns_list[[0]].addr;]])],[ac_cv_have_res_ns_list="yes"],[ac_cv_have_res_ns_list="no"]))
c68e9c6b 3779if test $ac_cv_have_res_ns_list = "yes" ; then
cc192b50 3780 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3781 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3782fi
3783fi
3784
461b8219 3785dnl Squid will usually attempt to translate when packaging or building from VCS
44e0a249 3786use_translation="yes"
461b8219 3787AC_ARG_ENABLE(translation,
62979ab1 3788 AS_HELP_STRING([--disable-translation],[Prevent Squid generating localized error page templates and manuals.
b3fed8c3 3789 Which is usually tried, but may not be needed.]),
461b8219
AJ
3790[ if test "$enableval" = "no" ; then
3791 use_translation=no
3792 fi
3793])
e4b70b44 3794dnl Squid now has .po translation capability, given the right toolkit
461b8219
AJ
3795if test "$use_translation" = "yes" ; then
3796 AX_WITH_PROG([PO2HTML],[po2html])
3797else
3798 PO2HTML="off"
3799fi
3800AC_SUBST(PO2HTML)
ee1a8ac2 3801
43000484
AJ
3802dnl Squid now has limited locale handling ...
3803dnl on error pages
8db7a54b 3804use_errlocale=yes
43000484 3805AC_ARG_ENABLE(auto-locale,
62979ab1 3806 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
21d5413e
AJ
3807 clients request headers.
3808 When disabled Squid requires explicit language configuration.]),
8db7a54b
AJ
3809[ if test "$enableval" = "no" ; then
3810 use_errlocale=no
3811 fi
3812])
3813if test "$use_errlocale" = "yes" ; then
eed82608 3814 AC_MSG_NOTICE([Enabling Multi-Language Support])
43000484 3815 AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
8db7a54b 3816else
eed82608 3817 AC_MSG_WARN([Disabling Multi-Language Support])
43000484 3818 AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
8db7a54b 3819fi
43000484 3820
090089c4 3821dnl Need the debugging version of malloc if available
3822XTRA_OBJS=''
6509a1a0 3823if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 3824 if test -r /usr/lib/debug/malloc.o ; then
3825 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3826 fi
3827 if test -r /usr/lib/debug/mallocmap.o ; then
3828 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3829 fi
3830fi
3831AC_SUBST(XTRA_OBJS)
3832
38fea766 3833if test -z "$XTRA_LIBS"; then
3834 XTRA_LIBS="$LIBS"
0f5a16f8 3835 dnl minor cleanup
3836 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 3837 LIBS=''
3838fi
090089c4 3839AC_SUBST(XTRA_LIBS)
3840
090089c4 3841dnl Clean up after OSF/1 core dump bug
3842rm -f core
3843
6a9f6389 3844AC_CONFIG_FILES([\
a2794549 3845 Makefile \
eee95dfe 3846 compat/Makefile \
a2794549 3847 lib/Makefile \
a2794549 3848 scripts/Makefile \
a2794549 3849 src/Makefile \
5bd7a218 3850 src/base/Makefile \
bcf44a2c 3851 src/acl/Makefile \
a2794549 3852 src/fs/Makefile \
3853 src/repl/Makefile \
3854 src/auth/Makefile \
5fa840c3 3855 src/adaptation/Makefile \
1f3c65fc
AR
3856 src/adaptation/icap/Makefile \
3857 src/adaptation/ecap/Makefile \
04f55905 3858 src/comm/Makefile \
f99c2cfe 3859 src/esi/Makefile \
ee0927b6 3860 src/eui/Makefile \
663ff9aa 3861 src/icmp/Makefile \
4daaf3cb 3862 src/ident/Makefile \
f963428c 3863 src/ip/Makefile \
82b7abe3 3864 src/log/Makefile \
a2794549 3865 contrib/Makefile \
3866 snmplib/Makefile \
3867 icons/Makefile \
3868 errors/Makefile \
1077c1b8 3869 test-suite/Makefile \
99db07b3 3870 doc/Makefile \
3faa6da8 3871 doc/manuals/Makefile \
0c510f3c 3872 helpers/Makefile \
3873 helpers/basic_auth/Makefile \
5a48ed18
AJ
3874 helpers/basic_auth/DB/Makefile \
3875 helpers/basic_auth/getpwnam/Makefile \
0c510f3c 3876 helpers/basic_auth/LDAP/Makefile \
3877 helpers/basic_auth/MSNT/Makefile \
5a48ed18 3878 helpers/basic_auth/MSNT-multi-domain/Makefile \
0c510f3c 3879 helpers/basic_auth/NCSA/Makefile \
5a48ed18 3880 helpers/basic_auth/NIS/Makefile \
0c510f3c 3881 helpers/basic_auth/PAM/Makefile \
bcf74be7 3882 helpers/basic_auth/POP3/Makefile \
5a48ed18
AJ
3883 helpers/basic_auth/RADIUS/Makefile \
3884 helpers/basic_auth/SASL/Makefile \
3885 helpers/basic_auth/SMB/Makefile \
3886 helpers/basic_auth/SSPI/Makefile \
0c510f3c 3887 helpers/digest_auth/Makefile \
3888 helpers/digest_auth/password/Makefile \
55013f9c 3889 helpers/digest_auth/ldap/Makefile \
89f77e43 3890 helpers/digest_auth/eDirectory/Makefile \
0c510f3c 3891 helpers/ntlm_auth/Makefile \
3892 helpers/ntlm_auth/fakeauth/Makefile \
3893 helpers/ntlm_auth/no_check/Makefile \
3963d7b1
AJ
3894 helpers/ntlm_auth/smb_lm/Makefile \
3895 helpers/ntlm_auth/smb_lm/smbval/Makefile \
6e785d85 3896 helpers/ntlm_auth/mswin_sspi/Makefile \
3897 helpers/negotiate_auth/Makefile \
45b2de83 3898 helpers/negotiate_auth/kerberos/Makefile \
6e785d85 3899 helpers/negotiate_auth/mswin_sspi/Makefile \
c6588c68 3900 helpers/external_acl/Makefile \
3901 helpers/external_acl/ip_user/Makefile \
3902 helpers/external_acl/ldap_group/Makefile \
74ab8d10 3903 helpers/external_acl/session/Makefile \
c6588c68 3904 helpers/external_acl/unix_group/Makefile \
736a9a4d 3905 helpers/external_acl/wbinfo_group/Makefile \
9e6e0372 3906 helpers/external_acl/mswin_ad_group/Makefile \
94ab55b0 3907 helpers/external_acl/mswin_lm_group/Makefile \
82b7abe3
AJ
3908 helpers/log_daemon/Makefile \
3909 helpers/log_daemon/file/Makefile \
fdbb3b19
AJ
3910 helpers/url_rewrite/Makefile \
3911 helpers/url_rewrite/fake/Makefile \
94ab55b0 3912 tools/Makefile
53cbe3e4 3913])
43ae1d95 3914
377792e4 3915AC_CONFIG_SUBDIRS(lib/libTrie)
3916
3e7b6055 3917# must configure libltdl subdir unconditionally for "make distcheck" to work
660faa02 3918AC_CONFIG_SUBDIRS(libltdl)
3e7b6055 3919
6a9f6389 3920AC_OUTPUT