]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
Fixed squid_host_os detection patterns.
[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 37AC_MSG_CHECKING([simplified host os])
035a321e
FC
38squid_host_os=`echo $host_os|sed 's/[0-9].*//;s/-.*//g'`
39squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
40503c27
FC
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 *)
035a321e 1055 AC_MSG_WARN([EUI support probably won't work on host $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 1805
f2d9a578 1806 SQUID_CHECK_KRB5_SOLARIS_BROKEN_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
f2d9a578
FC
1897EXTERNAL_ACL_HELPERS=""
1898squid_opt_external_acl_helpers="auto"
c6588c68 1899AC_ARG_ENABLE(external-acl-helpers,
f2d9a578
FC
1900 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
1901 [This option selects which external_acl helpers to
e702812e
FC
1902 build and install as part of the normal build
1903 process. For a list of available helpers see the
1904 helpers/external_acl directory.]),
c6588c68 1905[ case "$enableval" in
1906 yes)
f2d9a578 1907 squid_opt_external_acl_helpers="auto"
1c690e30 1908 ;;
c6588c68 1909 no)
f2d9a578 1910 squid_opt_external_acl_helpers=""
1c690e30 1911 ;;
c6588c68 1912 *)
f2d9a578 1913 squid_opt_external_acl_helpers="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1c690e30 1914 ;;
c6588c68 1915 esac
1916])
f2d9a578
FC
1917if test "$squid_opt_external_acl_helpers" = "auto" ; then
1918 squid_opt_external_acl_helpers=""
1919 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/external_acl],[squid_opt_external_acl_helpers])
7f18d2bd 1920fi
f2d9a578
FC
1921if test -n "$squid_opt_external_acl_helpers"; then
1922 for helper in $squid_opt_external_acl_helpers; do
1923 dir="$srcdir/helpers/external_acl/$helper"
1924 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1925 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1926 else
1927 AC_MSG_NOTICE([external acl helper $helper ... found but cannot be built])
1928 fi
20d8bfe4 1929 done
c6588c68 1930fi
f2d9a578 1931AC_MSG_NOTICE([External acl helpers built: $EXTERNAL_ACL_HELPERS])
c6588c68 1932AC_SUBST(EXTERNAL_ACL_HELPERS)
1933
fdbb3b19
AJ
1934dnl Select url_rewrite helpers to build
1935URL_REWRITE_HELPERS=all
1936AC_ARG_ENABLE(url-rewrite-helpers,
1937 AC_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
1938 [This option selects which url_rewrite helpers to
1939 build and install as part of the normal build
1940 process. For a list of available helpers see the
1941 helpers/url_rewrite directory.]),
1942[ case "$enableval" in
1943 yes)
1944 URL_REWRITE_HELPERS=all
1945 ;;
1946 no)
1947 URL_REWRITE_HELPERS=""
1948 ;;
1949 *)
1950 URL_REWRITE_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1951 ;;
1952 esac
1953])
1954if test "$URL_REWRITE_HELPERS" = "all" ; then
1955 URL_REWRITE_HELPERS=""
1956 for dir in $srcdir/helpers/url_rewrite/*; do
1957 helper="`basename $dir`"
1958 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1959 URL_REWRITE_HELPERS="$URL_REWRITE_HELPERS $helper"
ce7c6bba
AJ
1960 elif test -d $srcdir/helpers/url_rewrite/$helper ; then
1961 AC_MSG_NOTICE([URL re-write helper $helper ... found but cannot be built])
fdbb3b19
AJ
1962 fi
1963 done
1964fi
1965if test -n "$URL_REWRITE_HELPERS"; then
1966 for helper in $URL_REWRITE_HELPERS; do
1967 if test -f $srcdir/helpers/url_rewrite/$helper/Makefile.in; then
1968 :
1969 else
1970 AC_MSG_ERROR(url_rewrite helper $helper does not exist)
1971 fi
1972 done
1973 AC_MSG_NOTICE([url_rewrite helpers built: $URL_REWRITE_HELPERS])
1974fi
1975AC_SUBST(URL_REWRITE_HELPERS)
1976
1977
3a125142 1978AC_ARG_WITH(valgrind-debug,
62979ab1 1979 AS_HELP_STRING([--with-valgrind-debug],[Include debug instrumentation for use with valgrind]),
b4bab919 1980[ case $withval in
1981 yes)
1982 valgrind=1
1983 ;;
1984 no)
1985 valgrind=
1986 ;;
1987 *)
1988 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1989 valgrind=1
1990 ;;
1991 esac
1992 if test $valgrind; then
ad32c661
AJ
1993 AC_CHECK_HEADERS(valgrind/memcheck.h,
1994 [ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
eed82608
AJ
1995 AC_MSG_NOTICE([Valgrind debug support enabled]) ],
1996 [ AC_MSG_WARN([Valgrind header not found. Valgrind support disabled.]) ]
ad32c661 1997 )
b4bab919 1998 fi
1999])
2000
d96ceb8e 2001dnl Disable "memPools" code
2002AC_ARG_ENABLE(mempools,
62979ab1 2003 AS_HELP_STRING([--disable-mempools],[Disable memPools. Note that this option now simply sets the
e702812e
FC
2004 default behaviour. Specific classes can override this at runtime, and
2005 only lib/MemPool.c needs to be altered to change the squid-wide
2006 default for all classes.]),
d96ceb8e 2007[ if test "$enableval" = "no" ; then
eed82608 2008 AC_MSG_NOTICE([memPools disabled])
6a9f6389 2009 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
3e0dc9a8 2010 else
2011 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 2012 fi
3e0dc9a8 2013],
2014[ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 2015])
2016
0e657244 2017dnl Enable WIN32 Service compile mode
2018AC_ARG_ENABLE(win32-service,
62979ab1 2019 AS_HELP_STRING([--enable-win32-service],[Compile Squid as a WIN32 Service.
e702812e 2020 Works only on MS-Windows platforms (NT and up).]),
0e657244 2021[ if test "$enableval" = "yes" ; then
eed82608 2022 AC_MSG_NOTICE([Enabling WIN32 run service mode])
0e657244 2023 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
2024 fi
2025])
2026
b1485ff8 2027
2adff954 2028dnl Check for Cyrus SASL
2029if test "$require_sasl" = "yes"; then
2030 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
2031 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
eed82608 2032 AC_MSG_NOTICE([using SASL2])
2adff954 2033 LIBSASL="-lsasl2"
2034 else
2035 if test "$ac_cv_header_sasl_h" = "yes"; then
eed82608 2036 AC_MSG_NOTICE([using SASL])
2adff954 2037 LIBSASL="-lsasl"
2038 else
8b0d8e31 2039 AC_MSG_ERROR(Neither SASL nor SASL2 found)
2adff954 2040 fi
2041 fi
2042 AC_SUBST(LIBSASL)
2043fi
2044
3c573763 2045dnl Disable "unlinkd" code
fe0810ac 2046AC_ARG_ENABLE(unlinkd,
62979ab1 2047 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]),
fe0810ac 2048[ if test "$enableval" = "no" ; then
3c573763 2049 use_unlinkd=no
fe0810ac 2050 else
3c573763 2051 use_unlinkd=yes
fe0810ac 2052 fi
2053],[
2054 # Here we should probably use some magic depending on the selected
2055 # storage models
3c573763 2056 use_unlinkd=yes
fe0810ac 2057])
3c573763 2058if test "$use_unlinkd" = "yes"; then
eed82608 2059 AC_MSG_NOTICE([unlinkd enabled])
6a9f6389 2060 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
a2794549 2061 AM_CONDITIONAL(ENABLE_UNLINKD, true)
fe0810ac 2062else
eed82608 2063 AC_MSG_NOTICE([unlinkd disabled])
a2794549 2064 AM_CONDITIONAL(ENABLE_UNLINKD, false)
fe0810ac 2065fi
fe0810ac 2066
ce3d30fb 2067dnl Enable backtraces on fatal errors
2068AC_ARG_ENABLE(stacktraces,
62979ab1 2069 AS_HELP_STRING([--enable-stacktraces],[Enable automatic call backtrace on fatal errors]),
ce3d30fb 2070[ if test "$enableval" = "yes" ; then
eed82608 2071 AC_MSG_NOTICE([Enabling automatic stack backtraces on fatal errors])
6a9f6389 2072 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
ce3d30fb 2073 fi
2074])
2075
88bfe092 2076AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
2077dnl Enable USE_XPROF_STATS
2078AC_ARG_ENABLE(cpu-profiling,
62979ab1 2079 AS_HELP_STRING([--enable-cpu-profiling],[Enable instrumentation to try and understand how CPU power
e702812e
FC
2080 is spent by squid, by enabling specific probes in selected
2081 functions. New probes can only be added by modifying the source code.
2082 It is meant to help developers in optimizing performance
2083 of Squid internal functions.
2084 If you are not developer you shouldn't enable this,
2085 as it slows squid down somewhat. See lib/Profiler.c for more details.]),
88bfe092 2086[ if test "$enableval" = "yes" ; then
eed82608 2087 AC_MSG_NOTICE([Enabling cpu-profiling])
6a9f6389 2088 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
88bfe092 2089 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
2090 fi
2091])
2092
f66a9ef4 2093dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
2092c67d 2094AC_ARG_ENABLE(x-accelerator-vary,
62979ab1 2095 AS_HELP_STRING([--enable-x-accelerator-vary],[Enable support for the X-Accelerator-Vary
e702812e
FC
2096 HTTP header. Can be used to indicate
2097 variance within an accelerator setup.
2098 Typically used together with other code
2099 that adds custom HTTP headers to the requests.]),
f66a9ef4 2100[ if test "$enableval" = "yes" ; then
eed82608 2101 AC_MSG_NOTICE([Enabling support for X-Accelerator-Vary])
6a9f6389 2102 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
f66a9ef4 2103 fi
2104])
2105
7172612f 2106AC_ARG_ENABLE(zph-qos,
62979ab1 2107 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]),
7172612f 2108[ if test "$enableval" = "yes" ; then
eed82608 2109 AC_MSG_NOTICE([ZPH QOS enabled])
7172612f
AJ
2110 AC_DEFINE(USE_ZPH_QOS,1,
2111 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
2112 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
2113 fi
2114])
2115
a41b3435
AJ
2116dnl --with-maxfd present for compatibility with Squid-2.
2117dnl undocumented in ./configure --help to encourage using the Squid-3 directive.
2118AC_ARG_WITH(maxfd,,
2119[
2120 case ${withval} in
2121 [[0-9]]*)
2122 squid_filedescriptors_num=$withval
2123 ;;
2124 *)
2125 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
2126 ;;
2127 esac
2128])
f49be7d1 2129AC_ARG_WITH(filedescriptors,
62979ab1 2130 AS_HELP_STRING([--with-filedescriptors=NUMBER],[Force squid to support NUMBER filedescriptors]),
8b0d8e31
AJ
2131[
2132 case ${withval} in
2133 [[0-9]]*)
2134 squid_filedescriptors_num=$withval
2135 ;;
2136 *)
2137 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
2138 ;;
2139 esac
2140])
f49be7d1 2141
8b5e106b 2142if $CPPUNITCONFIG --help >/dev/null; then
78cae3b4
FC
2143 squid_cv_cppunit_version="`$CPPUNITCONFIG --version`"
2144 AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version])
2145 unset squid_cv_cppunit_version
8b5e106b 2146 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2147 SQUID_CPPUNIT_LA=''
2148 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2149else
eed82608 2150 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
63d03edb 2151 SQUID_CPPUNIT_LA=''
2152 SQUID_CPPUNIT_LIBS=''
2153 SQUID_CPPUNIT_INC=''
f5691f9c 2154fi
8b5e106b 2155
f5691f9c 2156AC_ARG_WITH(cppunit-basedir,
62979ab1 2157 AS_HELP_STRING([--with-cppunit-basedir=PATH],[Path where the cppunit headers are libraries are found
b0e7900f 2158 for unit testing.]),
f5691f9c 2159[ if test -f $withval/include/cppunit/TestCase.h; then
eed82608 2160 AC_MSG_NOTICE([Using cppunit includes from $withval])
f5691f9c 2161 SQUID_CPPUNIT_INC="-I${withval}/include"
2162 else
8b0d8e31 2163 AC_MSG_ERROR(Cannot find cppunit at $withval)
f5691f9c 2164 fi
2165 if test -f $withval/lib/libcppunit.la; then
eed82608 2166 AC_MSG_NOTICE([Using cppunit lib from $withval])
549b1e60 2167 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
8b5e106b 2168 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
f5691f9c 2169 else
8b0d8e31 2170 AC_MSG_ERROR(Cannot find cppunit at $withval)
f5691f9c 2171 fi
f5691f9c 2172])
8b5e106b 2173AC_SUBST(SQUID_CPPUNIT_LIBS)
f5691f9c 2174AC_SUBST(SQUID_CPPUNIT_LA)
2175AC_SUBST(SQUID_CPPUNIT_INC)
f5691f9c 2176
fd9aaa3e 2177# Force some compilers to use ANSI features
2178#
2179case "$host" in
2180 alpha-dec-osf*)
2181 if test "$ac_cv_prog_CC" = "cc" ; then
eed82608 2182 AC_MSG_NOTICE([adding '-std1' to cc args for $host])
fd9aaa3e 2183 CC="cc -std1";
2184 ac_cv_prog_CC="$CC"
2185 fi
2186 ;;
c68e9c6b 2187 *-hp-hpux*)
2188 if test "$ac_cv_prog_CC" = "cc" ; then
eed82608 2189 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
c68e9c6b 2190 CC="cc -Ae";
2191 ac_cv_prog_CC="$CC"
2192 fi
2193 ;;
fd9aaa3e 2194esac
2195
dd56802c 2196
a2794549 2197dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
4e9d8e26 2198
6ad85e8a 2199case "$host" in
2200 *-hp-hpux*)
eed82608 2201 AC_MSG_NOTICE([Disabling 'ranlib' for HP-UX...])
6ad85e8a 2202 RANLIB=":"
2203 ;;
2204esac
2205
090089c4 2206dnl Check for headers
2207AC_HEADER_DIRENT
2208AC_HEADER_STDC
db40ae20 2209
2210AC_CHECK_HEADERS( \
db40ae20 2211 arpa/inet.h \
30a4f2a8 2212 arpa/nameser.h \
9441aa34 2213 assert.h \
db40ae20 2214 bstring.h \
27e059d4 2215 cassert \
db40ae20 2216 crypt.h \
281422f8 2217 cstring \
30a4f2a8 2218 ctype.h \
2219 errno.h \
ce3d30fb 2220 execinfo.h \
db40ae20 2221 fcntl.h \
42ad37af 2222 fnmatch.h \
9c1d8929 2223 getopt.h \
52303a3d 2224 glob.h \
88738790 2225 gnumalloc.h \
30a4f2a8 2226 grp.h \
27e059d4
AJ
2227 iosfwd \
2228 iomanip \
2229 iostream \
5cafc1d6 2230 ip_compat.h \
42b51993 2231 ip_fil_compat.h \
5cafc1d6 2232 ip_fil.h \
2233 ip_nat.h \
dbc5782a 2234 ipl.h \
30a4f2a8 2235 libc.h \
6ad85e8a 2236 limits.h \
d2422105 2237 linux/types.h \
1cc2f840 2238 machine/byte_swap.h \
30a4f2a8 2239 malloc.h \
04f55905 2240 map \
e0bddc45 2241 math.h \
db40ae20 2242 memory.h \
b075cbb1 2243 mount.h \
30a4f2a8 2244 netdb.h \
db40ae20 2245 netinet/in.h \
cc192b50 2246 netinet/in_systm.h \
42b51993 2247 netinet/ip_fil_compat.h \
1f7c9178 2248 openssl/err.h \
2249 openssl/md5.h \
2250 openssl/ssl.h \
8cd03ece 2251 openssl/x509v3.h \
cc192b50 2252 netinet/tcp.h \
a7ad6e4e 2253 openssl/engine.h \
27e059d4 2254 ostream \
4da086c4 2255 paths.h \
dcfe6390 2256 poll.h \
30a4f2a8 2257 pwd.h \
b5e4d7d4 2258 shadow.h \
30a4f2a8 2259 regex.h \
c68e9c6b 2260 sched.h \
519267d1 2261 security/pam_appl.h \
30a4f2a8 2262 signal.h \
27e059d4 2263 sstream \
30a4f2a8 2264 stdarg.h \
2265 stddef.h \
27e059d4 2266 stdexcept \
30a4f2a8 2267 stdio.h \
db40ae20 2268 stdlib.h \
27e059d4 2269 string \
db40ae20 2270 string.h \
2271 strings.h \
0a4e8536 2272 sys/bitypes.h \
f9576890 2273 sys/bswap.h \
2274 sys/endian.h \
db40ae20 2275 sys/file.h \
5cafc1d6 2276 sys/ioctl.h \
30a4f2a8 2277 sys/param.h \
62ae0622 2278 sys/prctl.h \
3d4022fa 2279 sys/md5.h \
77e4c0c9 2280 sys/msg.h \
30a4f2a8 2281 sys/resource.h \
db40ae20 2282 sys/select.h\
30a4f2a8 2283 sys/socket.h \
2284 sys/stat.h \
b075cbb1 2285 sys/statvfs.h \
3c641669 2286 syscall.h \
30a4f2a8 2287 sys/syscall.h \
db40ae20 2288 sys/time.h \
2289 sys/types.h \
30a4f2a8 2290 sys/un.h \
b075cbb1 2291 sys/vfs.h \
30a4f2a8 2292 sys/wait.h \
db40ae20 2293 syslog.h \
30a4f2a8 2294 time.h \
2295 unistd.h \
3c641669 2296 utime.h \
30a4f2a8 2297 varargs.h \
77d6bd88 2298 byteswap.h \
2299 glib.h \
60d096f4 2300 stdint.h \
2301 inttypes.h \
3c641669 2302 grp.h \
94331f58 2303 db.h \
5b43d209 2304 db_185.h
db40ae20 2305)
2306
fc68f6b1 2307AC_CHECK_HEADERS(
2308 linux/netfilter_ipv4.h \
2309 linux/netfilter_ipv4/ip_tproxy.h \
2310,,,
dcd1dc78 2311SQUID_DEFAULT_INCLUDES
2312#if HAVE_LIMITS_H
2313#include <limits.h>
2314#endif
a74968c2
AJ
2315/* Netfilter ip(6)tables v1.4.0 has broken headers */
2316#if HAVE_NETINET_IN_H
2317#include <netinet/in.h>
2318#endif
dcd1dc78 2319)
2320
d1e5191e 2321dnl *BSD dont include the depenencies for all their net/ and netinet/ files
c92b4732 2322dnl We must include a few basic type headers for them to work.
d1e5191e
AJ
2323AC_CHECK_HEADERS( \
2324 net/if.h \
5a3237b0 2325 netinet/if_ether.h\
d1e5191e 2326 netinet/icmp6.h \
975cfef6 2327 netinet/in.h \
d1e5191e
AJ
2328 netinet/ip.h \
2329 netinet/ip6.h \
5a3237b0 2330 netinet/ip_compat.h\
975cfef6 2331 netinet/ip_fil_compat.h\
5a3237b0 2332 netinet/ip_fil.h\
d1e5191e 2333 netinet/ip_icmp.h \
dbc5782a 2334 netinet/ipl.h \
975cfef6 2335 netinet/ip_nat.h\
ec9909b0 2336 net/pf/pfvar.h \
d1e5191e 2337 net/pfvar.h \
77e4c0c9 2338 sys/mount.h\
d1e5191e
AJ
2339 resolv.h \
2340,,,
2341SQUID_BSDNET_INCLUDES)
5a3237b0 2342
aee0606f 2343AC_C_CONST
d57288d2 2344AC_C_BIGENDIAN
aee0606f 2345
6a9f6389 2346AC_STRUCT_TM
2347AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2348#if TM_IN_SYS_TIME
2349#if HAVE_SYS_TIME_H
2350#include <sys/time.h>
2351#endif
2352#elif HAVE_TIME_H
2353#include <time.h>
2354#endif
5c51415d 2355])
46c883ed 2356
6a9f6389 2357AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2358#if HAVE_SYS_TYPES_H
2359#include <sys/types.h>
2360#endif
eb824054 2361#if HAVE_MALLOC_H
2362#include <malloc.h>
6a9f6389 2363#endif])
eb824054 2364
6a9f6389 2365AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2366#if HAVE_SYS_TYPES_H
2367#include <sys/types.h>
2368#endif
2369#if HAVE_MALLOC_H
2370#include <malloc.h>
2371#endif])
090089c4 2372
08caf8c6 2373dnl Override rusage() detect on MinGW because is emulated in source code
2374case "$host_os" in
2375 mingw|mingw32)
2376 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2377 ac_cv_func_getrusage='yes'
eed82608 2378 AC_MSG_NOTICE([Using own rusage on Windows.])
08caf8c6 2379 ;;
2380 *)
2381 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
8ff51bba 2382#if HAVE_SYS_TIME_H
2383#include <sys/time.h>
2384#endif
b54a6789 2385#if HAVE_SYS_RESOURCE_H
2386#include <sys/resource.h>
6a9f6389 2387#endif])
08caf8c6 2388 ;;
2389esac
b54a6789 2390
6a9f6389 2391AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2392#if HAVE_SYS_TYPES_H
2393#include <sys/types.h>
2394#endif
a025a745 2395#include <netinet/in.h>
2396#include <netinet/in_systm.h>
6ad85e8a 2397#include <netinet/ip.h>
b05490a8 2398#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 2399#define ip_hl ihl
2400#endif
2401#ifndef __linux__
b05490a8 2402#ifndef __CYGWIN__
6ad85e8a 2403#define iphdr ip
b05490a8 2404#endif
6a9f6389 2405#endif])
a025a745 2406
090089c4 2407dnl Check for typedefs
77d6bd88 2408AC_CHECK_SIZEOF(void *)
090089c4 2409
0409a509 2410dnl 8 bit integers - int8_t
2411dnl if this is defined we trust it to be 8 bits
2412AC_CHECK_TYPE(int8_t,[
2413 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2414 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2415 ],,SQUID_DEFAULT_INCLUDES)
2416
2417dnl fallback #1
2418AC_CHECK_TYPE(char,[
2419 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2420 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2421 ],,SQUID_DEFAULT_INCLUDES)
2422
2423dnl unsigned 8 bit ints - u_int8_t
2424dnl if this is defined we trust it to be 8 bits
2425AC_CHECK_TYPE(u_int8_t,[
2426 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2427 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2428 ],,SQUID_DEFAULT_INCLUDES)
2429
2430dnl fallback #1
2431dnl if this is defined we trust it to be 8 bits
2432AC_CHECK_TYPE(uint8_t,[
2433 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2434 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2435 ],,SQUID_DEFAULT_INCLUDES)
2436
2437dnl 16 bit integers - int16_t
6a9f6389 2438dnl if this is defined we trust it to be 16 bits
62266438 2439AC_CHECK_TYPE(int16_t,[
2440 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2441 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2442 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2443
2444dnl fallback #1
2445AC_CHECK_TYPE(short,[
856e69c5 2446 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2447 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2448 ],,SQUID_DEFAULT_INCLUDES)
2449
2450dnl fallback #2
2451AC_CHECK_TYPE(int,[
856e69c5 2452 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2453 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2454 ],,SQUID_DEFAULT_INCLUDES)
2455
2456dnl unsigned 16 bit ints - u_int16_t
2457dnl if this is defined we trust it to be 16 bits
62266438 2458AC_CHECK_TYPE(u_int16_t,[
2459 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2460 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2461 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2462
2463dnl fallback #1
2464dnl if this is defined we trust it to be 16 bits
62266438 2465AC_CHECK_TYPE(uint16_t,[
2466 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2467 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2468 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2469
2470dnl 32 bit signed int - int32_t
2471dnl if this is defined we trust it to be 32 bits
62266438 2472AC_CHECK_TYPE(int32_t,[
2473 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2474 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2475 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2476
2477dnl fallback #1
2478AC_CHECK_TYPE(long,[
856e69c5 2479 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2480 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2481 ],,SQUID_DEFAULT_INCLUDES)
2482
2483dnl 32 bit unsigned int - u_int32_t
2484dnl if this is defined we trust it to be 32 bits
62266438 2485AC_CHECK_TYPE(u_int32_t,[
2486 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2487 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2488 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2489
2490dnl fallback #1
2491dnl if this is defined we trust it to be 32 bits
62266438 2492AC_CHECK_TYPE(uint32_t,[
2493 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2494 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2495 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2496
2497dnl 64 bit signed - int64_t
2498dnl if this is defind we trust it to be 64 bits
62266438 2499AC_CHECK_TYPE(int64_t,[
2500 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2501 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2502 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2503
2504dnl fallback #1
2505dnl if this is defind we trust it to be 64 bits
62266438 2506AC_CHECK_TYPE(__int64,[
2507 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2508 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2509 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2510
2511dnl fallback #2
2512AC_CHECK_TYPE(long long,[
856e69c5 2513 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2514 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2515 ],,SQUID_DEFAULT_INCLUDES)
2516
2517dnl 64 bit unsigned - u_int64_t
2518dnl if this is defind we trust it to be 64 bits
62266438 2519AC_CHECK_TYPE(u_int64_t,[
2520 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2521 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2522 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2523
2524dnl fallback #1
2525dnl if this is defind we trust it to be 64 bits
62266438 2526AC_CHECK_TYPE(uint64_t,[
2527 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2528 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2529 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2530
588e71df 2531dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2532dnl that is incompatible with the updated Solaris header files.
2533dnl For this reason, we must check if pad128_t and upad128_t are defined.
2534AC_CHECK_TYPE(pad128_t,
2535 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2536 ,SQUID_DEFAULT_INCLUDES)
2537
2538AC_CHECK_TYPE(upad128_t,
2539 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2540 ,SQUID_DEFAULT_INCLUDES)
2541
6a9f6389 2542AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2543AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2544 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2545AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2546AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2547 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2548AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2549AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
adcceb47 2550
77d6bd88 2551dnl Check for special functions
2552AC_FUNC_ALLOCA
2553
6a9f6389 2554AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2555#include <sys/types.h>
6637e3a5 2556#include <sys/socket.h>
2557#if STDC_HEADERS
2558#include <stdlib.h>
2559#include <stddef.h>
6a9f6389 2560#endif])
6637e3a5 2561
b50f1b2b 2562dnl Check for libcap header (assume its not broken unless
69367152
HN
2563use_libcap=auto
2564AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],[disable usage of Linux capabilities library to control privileges]),
2565[ if test "x$withval" = "xyes" ; then
b64b6030 2566 AC_MSG_RESULT(libcap forced enabled)
69367152 2567 use_libcap=yes
b50f1b2b 2568 else
1c9910eb 2569 AC_MSG_RESULT(libcap forced disabled)
69367152 2570 use_libcap=no
b50f1b2b 2571 fi
b64b6030 2572])
69367152 2573if test "x$use_libcap" != "xno"; then
b64b6030
HN
2574 # cap_clear_flag is the most recent libcap function we require
2575 AC_CHECK_LIB(cap, cap_clear_flag)
6a4d3ec8
HN
2576 if test "x$ac_cv_lib_cap_cap_clear_flag" = xyes; then
2577 use_libcap=yes
2578 else
69367152 2579 if test "x$use_libcap" = "xyes"; then
ff8d255b 2580 AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
b64b6030 2581 fi
69367152 2582 use_libcap=no
b64b6030
HN
2583 fi
2584fi
69367152 2585
6a4d3ec8 2586if test "x$use_libcap" = "xyes"; then
b64b6030
HN
2587 AC_DEFINE(USE_LIBCAP, 1, [use libcap to set capabilities required for TPROXY])
2588 dnl Check for libcap headader breakage.
b50f1b2b 2589 AC_CHECK_HEADERS(sys/capability.h)
ff8d255b
HN
2590 AC_CACHE_CHECK([for operational libcap2 headers], squid_cv_sys_capability_works,
2591 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2592#include <stdlib.h>
2593#include <stddef.h>
2594#include <sys/capability.h>
2595]], [[
2596capget(NULL, NULL);
2597capset(NULL, NULL);
2598 ]])],[squid_cv_sys_capability_works=yes],[squid_cv_sys_capability_works=no])
b50f1b2b 2599 )
ff8d255b
HN
2600 if test x$squid_cv_sys_capability_works != xyes; then
2601 AC_DEFINE([LIBCAP_BROKEN],1,[if libcap2 headers are broken and clashing with glibc])
2602 fi
b50f1b2b 2603fi
5b43d209 2604
b64b6030 2605
6a9f6389 2606AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
aea1be68 2607#include <sys/ipc.h>
6a9f6389 2608#include <sys/msg.h>])
aea1be68 2609
090089c4 2610dnl Check for needed libraries
54c95954
FC
2611AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
2612AC_SEARCH_LIBS([res_init],[resolv])
2613AC_SEARCH_LIBS([bind],[socket])
2614AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
2615AC_SEARCH_LIBS([strlcpy], [bsd])
85cd85f3 2616AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
bfe8dedf 2617dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
4b26fae9 2618case "$host_os" in
2619 mingw|mingw32)
2620 AC_MSG_CHECKING(for winsock)
2621 save_LIBS="$LIBS"
2622 for curlib in ws2_32 wsock32; do
2623 LIBS="$LIBS -l$curlib"
62979ab1 2624 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>]], [[
1635bf30
GS
2625 socket(0,0,0);
2626 select(0,NULL,NULL,NULL,NULL);
2627 closesocket(0);
2628 gethostname(NULL,0);
62979ab1 2629 ]])],[have_winsock=yes],[have_winsock=no])
4b26fae9 2630
2631 if test $have_winsock = yes; then
2632 ac_cv_func_select='yes'
2633 if test $curlib = ws2_32; then
2634 have_winsock=winsock2
2635 fi
2636 break
2637 fi
2638 LIBS="$save_LIBS"
2639 done
2640 AC_MSG_RESULT($have_winsock)
bfe8dedf
GS
2641 if test $have_winsock = winsock2; then
2642 AC_CHECK_HEADERS(winsock2.h)
2643 else
2644 AC_CHECK_HEADERS(winsock.h)
2645 fi
4b26fae9 2646 ;;
2647esac
94d48591 2648
3c641669 2649dnl Ripped from the Samba sources
2650AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
62979ab1 2651 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3c641669 2652#include <sys/types.h>
2653#include <stdlib.h>
2654#include <stddef.h>
2655#include <sys/socket.h>
62979ab1 2656#include <sys/un.h>]], [[
3c641669 2657 struct sockaddr_un sunaddr;
2658 sunaddr.sun_family = AF_UNIX;
62979ab1 2659]])],[squid_cv_unixsocket=yes],[squid_cv_unixsocket=no])])
3c641669 2660if test x"$squid_cv_unixsocket" = x"yes"; then
6a9f6389 2661 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
3c641669 2662fi
2663dnl end rip
2664
94d48591 2665 AC_CHECK_LIB(gnumalloc, main)
2666 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
eed82608 2667 AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc])
94d48591 2668 ac_cv_func_mallinfo=no
2669 ac_cv_func_mallocblksize=no
2670 ac_cv_func_mallopt=no
2671 else
2672 case "$host" in
2673 *-sun-solaris*)
eed82608 2674 AC_MSG_NOTICE([skipping libmalloc check for $host])
94d48591 2675 ;;
2676 i386-*-freebsd*)
eed82608 2677 AC_MSG_NOTICE([skipping libmalloc check for $host])
94d48591 2678 ;;
2679 *)
2680
2681 AC_CHECK_LIB(malloc, main)
2682 ;;
2683 esac
2684 fi
94d48591 2685
be79ade0 2686AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
08caf8c6 2687case "$host_os" in
2688mingw|mingw32)
eed82608 2689 AC_MSG_NOTICE([Use MSVCRT for math functions.])
08caf8c6 2690 ;;
2691 *)
c753b5e6
AJ
2692 dnl rint() is only used in old C code for now.
2693 AC_LANG_PUSH([C])
2694 AC_SEARCH_LIBS([rint],[m])
2695 AC_LANG_POP([C])
08caf8c6 2696 ;;
2697esac
090089c4 2698
001ad4cc
AJ
2699dnl Enable IPv6 support
2700AC_MSG_CHECKING([whether to enable IPv6])
2701use_ipng=yes
2702AC_ARG_ENABLE(ipv6,
62979ab1 2703 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
001ad4cc
AJ
2704[ if test "x$enableval" = "xyes" ; then
2705 AC_MSG_RESULT(yes)
2706 else
2707 AC_MSG_RESULT(no)
2708 use_ipng=no
2709 fi
2710],[AC_MSG_RESULT(yes)])
2711
2712if test "$use_ipng" = "yes"; then
2713 SAVED_LIBS="$LIBS"
2714 dnl Solaris 10/11 requires -lsocket
2715 case "$host" in
2716 *-solaris*)
2717 LIBS="$LIBS -lsocket"
2718 ;;
2719 *)
2720 ;;
2721 esac
2722 AC_CACHE_CHECK([if PF_INET6 is available], $use_ipng,
62979ab1 2723 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* PF_INET6 available check */
001ad4cc
AJ
2724# include <sys/types.h>
2725# include <sys/socket.h>
b3167ca7 2726 int main(int argc, char **argv) {
001ad4cc
AJ
2727 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
2728 return 1;
2729 else
2730 return 0;
2731 }
62979ab1 2732 ]])],[ AC_MSG_RESULT(yes)
001ad4cc 2733 use_ipng=yes
62979ab1
AJ
2734 SAVED_LIBS="$LIBS" ],[ AC_MSG_RESULT(no)
2735 use_ipng=no ],[])
001ad4cc
AJ
2736 )
2737 LIBS="$SAVED_LIBS"
2738fi
2739
2740if test "$use_ipng" = "yes"; then
2741 AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
18a8e998 2742 SET_IPV6_SETTINGS=""
001ad4cc
AJ
2743 use_v4mapped=yes
2744
44770d71 2745dnl Check for forced split-stack mode
001ad4cc
AJ
2746 AC_MSG_CHECKING([for IPv6 split-stack requirement])
2747 AC_ARG_WITH(ipv6-split-stack,
62979ab1 2748 AS_HELP_STRING([--with-ipv6-split-stack],[Force-Enable experimental split-stack support for Windows XP and *BSD. Requires IPv6.]),
001ad4cc
AJ
2749 [ use_v4mapped="no"
2750 AC_MSG_RESULT(yes)],
2751 [ AC_MSG_RESULT(no) ])
2752
44770d71
AJ
2753dnl Check for IPv6 v4-mapping availability
2754dnl Useful for other OS with hybrid-stack defaults turned OFF
001ad4cc
AJ
2755dnl But only usable if it actually works...
2756 if test "$use_v4mapped" = "yes" ; then
2757 AC_MSG_CHECKING([for IPv6 v4-mapping ability])
62979ab1 2758 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* IPPROTO_V4MAPPED is usable check */
001ad4cc
AJ
2759# include <sys/types.h>
2760# include <sys/socket.h>
2761# include <netinet/in.h>
2762#if HAVE_NETINET_IN6_H
2763# include <netinet/in6.h>
2764#endif
b3167ca7 2765 int main(int argc, char **argv) {
001ad4cc
AJ
2766 int s = socket(PF_INET6, SOCK_STREAM, 0);
2767 int tos = 0;
2768 if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &tos, sizeof(int)) < 0)
2769 return 1;
2770 else
2771 return 0;
2772 }
62979ab1 2773 ]])],[ AC_MSG_RESULT(yes)
001ad4cc
AJ
2774 use_v4mapped=yes
2775 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
62979ab1 2776 ],[ AC_MSG_RESULT(no)
001ad4cc
AJ
2777 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets])
2778 use_v4mapped=no
62979ab1 2779 ],[])
001ad4cc
AJ
2780 fi
2781
2782dnl if we can't defer v4-mapping to the OS we are forced to split-stack the FD table.
2783 AC_MSG_CHECKING([for IPv6 stack type/mode])
2784 if test "$use_v4mapped" = "yes"; then
2785 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2786 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations])
2787 AC_MSG_RESULT(mapping hybrid)
2788 else
2789 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2790 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
2791 AC_MSG_RESULT(split-stack or BSD non-mapping dual-stack)
2792 fi
2793
2794dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2795AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2796 ac_cv_have_sin6_len_in_struct_sai, [
62979ab1 2797 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
001ad4cc
AJ
2798#include <sys/types.h>
2799#include <sys/socket.h>
2800#include <netinet/in.h>
62979ab1
AJ
2801 ]], [[ 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"
2802 ])
001ad4cc
AJ
2803 ])
2804 if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2805 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2806 else
2807 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2808 fi
2809
2810else
2811 # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
2812 AC_MSG_WARN([IPv6 is not available on this system.])
2813 AC_DEFINE(USE_IPV6,0,[Enable support for IPv6])
2814 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
2815 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
18a8e998 2816 SET_IPV6_SETTINGS="\#IPv6 Not Available: "
001ad4cc 2817fi
18a8e998 2818AC_SUBST(SET_IPV6_SETTINGS)
001ad4cc
AJ
2819
2820dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2821AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2822 ac_cv_have_ss_len_in_struct_ss, [
62979ab1 2823 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
001ad4cc
AJ
2824#include <sys/types.h>
2825#include <sys/socket.h>
2826#include <netinet/in.h>
62979ab1
AJ
2827 ]], [[ 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"
2828 ])
001ad4cc
AJ
2829])
2830if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2831 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2832else
2833 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2834fi
2835
2836dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2837AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2838 ac_cv_have_sin_len_in_struct_sai, [
62979ab1 2839 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
001ad4cc
AJ
2840#include <sys/types.h>
2841#include <sys/socket.h>
2842#include <netinet/in.h>
62979ab1
AJ
2843 ]], [[ 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"
2844 ])
001ad4cc
AJ
2845])
2846if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
2847 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2848else
2849 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2850fi
2851
090089c4 2852dnl Check for libcrypt
0d8565ac 2853CRYPTLIB=
8154dd82 2854dnl Some of our helpers use crypt(3) which may be in libc, or in
2855dnl libcrypt (eg FreeBSD)
c1dc012a 2856AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
3d4022fa 2857dnl Solaris10 provides MD5 natively through libmd5
c1dc012a 2858AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
be79ade0 2859AC_SUBST(CRYPTLIB)
77f675ad 2860
0d8565ac
AJ
2861# check for crypt, may require -lcrypt
2862SAVED_LIBS="$LIBS"
2863LIBS="$LIBS $CRYPTLIB"
2864AC_CHECK_FUNCS(crypt)
2865LIBS="$SAVED_LIBS"
2866
2867
042b1f8a 2868dnl Check for libdl, used by auth_modules/PAM
8154dd82 2869if test "$with_dl" = "yes"; then
2870 AC_CHECK_LIB(dl, dlopen)
2871fi
042b1f8a 2872
86ec11aa 2873dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2874dnl Robert Side <rside@aiinc.bc.ca>
2875dnl Mon, 18 Jan 1999 17:48:00 GMT
2876case "$host" in
2877 *-pc-sco3.2*)
2878 AC_CHECK_LIB(intl, strftime)
2879 ;;
2880esac
2881
20e869bf 2882dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2883dnl only with Windows LDAP libraries using -lwldap32
2884case "$host_os" in
2885mingw|mingw32)
428744a1
AJ
2886 LDAPLIB="-lwldap32"
2887 LBERLIB=""
2888 ;;
20e869bf 2889*)
428744a1
AJ
2890 LDAPLIB="-lldap"
2891 dnl LDAP helpers need to know if -llber is needed or not
2892 AC_CHECK_LIB(lber, main, [LBERLIB="-llber"])
2893 ;;
20e869bf 2894esac
428744a1
AJ
2895AC_SUBST(LDAPLIB)
2896AC_SUBST(LBERLIB)
20e869bf 2897
b7a1c19e 2898dnl Check for libdb
2899DBLIB=
01b4931d 2900dnl 1.85
a258dfca 2901AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
32d0bbd7 2902SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
62979ab1 2903 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
a258dfca 2904#if HAVE_SYS_TYPES_H
2905#include <sys/types.h>
2906#endif
2907#if HAVE_LIMITS_H
2908#include <limits.h>
2909#endif
2910#if HAVE_DB_185_H
2911#include <db_185.h>
2912#elif HAVE_DB_H
2913#include <db.h>
62979ab1 2914#endif]], [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],[ac_cv_dbopen_libdb="yes"],[ac_cv_dbopen_libdb="no"])
32d0bbd7 2915LIBS="$SAVED_LIBS"
a258dfca 2916])
2b2161bb 2917if test $ac_cv_dbopen_libdb = yes; then
32d0bbd7 2918 LIB_DB="-ldb"
2919fi
01b4931d 2920AC_SUBST(LIB_DB)
b7a1c19e 2921
77f675ad 2922dnl System-specific library modifications
2923dnl
2924case "$host" in
88738790 2925 i386-*-solaris2.*)
7149a49f 2926 if test "$GCC" = "yes"; then
eed82608 2927 AC_MSG_NOTICE([Removing -O for gcc on $host])
80e92d6d 2928 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 2929 fi
2930 ;;
77f675ad 2931 *-sgi-irix*)
eed82608 2932 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
6716b242 2933 LIBS=`echo $LIBS | sed -e s/-lsocket//`
eed82608 2934 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
6716b242 2935 LIBS=`echo $LIBS | sed -e s/-lnsl//`
c415c128 2936 ac_cv_lib_nsl_main=no
eed82608 2937 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
b44c0fb4 2938 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 2939 ;;
4ba0bd0e 2940dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2941dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2942dnl Please change your configure script. AIX doesn't need -lbsd.
2943 *-ibm-aix*)
eed82608 2944 AC_MSG_NOTICE([Removing -lbsd for AIX...])
4ba0bd0e 2945 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2946 ;;
30a4f2a8 2947 *m88k*)
fa035612 2948 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2949 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
6a9f6389 2950 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
7149a49f 2951 ;;
580ce039 2952 [*-*-solaris2.[0-4]])
6a9f6389 2953 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
30a4f2a8 2954 ;;
711fa75e 2955 [*-sony-newsos[56]*])
6a9f6389 2956 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
f62c73dc 2957 ;;
77f675ad 2958esac
090089c4 2959
57faa85a 2960# Remove optimization for GCC 2.95.[123]
d20b1cd0 2961# gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2962if test "$GCC" = "yes"; then
2963 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2964 case "$GCCVER" in
57faa85a 2965 [2.95.[123]])
eed82608 2966 AC_MSG_NOTICE([Removing -O for gcc on $host with GCC $GCCVER])
d20b1cd0 2967 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2968 ;;
2969 esac
2970fi
2971
176d10ee 2972# Recommended by Balint Nagy Endre <bne@CareNet.hu>
2973case "$host" in
2974 *-univel-sysv4.2MP)
2975 if test `uname -v` = "2.03"; then
eed82608 2976 AC_MSG_NOTICE([disabling mallinfo for $host])
176d10ee 2977 ac_cv_func_mallinfo=no
2978 fi
2979 ;;
2980esac
2981
84cecfd2 2982dnl This has to be before AC_CHECK_FUNCS
2983# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2984# when running configure.
2985if test -z "$ac_cv_func_poll"; then
2986 case "$host" in
2987 [alpha-dec-osf3.*])
2988 # John Kay (jkay@nlanr.net) 19970818
eed82608 2989 AC_MSG_NOTICE([disabling poll for $host...])
84cecfd2 2990 ac_cv_func_poll='no'
2991 ;;
2992 [*-hp-hpux*.*])
2993 # Duane Wessels
eed82608 2994 AC_MSG_NOTICE([disabling poll for $host...])
84cecfd2 2995 ac_cv_func_poll='no'
2996 ;;
2997 [*-linux-*])
f5cec332 2998 # Henrik Nordstrom (hno@squid-cache.org) 19980817
9bb83c8b 2999 # poll is problematic on Linux. We disable it
3000 # by default until Linux gets it right.
b6a2f15e 3001 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
3002 if test $rev -lt 002002; then
eed82608 3003 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
b6a2f15e 3004 ac_cv_func_poll='no'
3005 fi
84cecfd2 3006 ;;
c68e9c6b 3007 [powerpc-ibm-aix4.1.*])
3008 # Mike Laster (mlaster@metavillage.com) 19981021
eed82608 3009 AC_MSG_NOTICE([disabling poll for $host...])
c68e9c6b 3010 ac_cv_func_poll='no'
3011 ;;
86ec11aa 3012 [*-pc-sco3.2*])
3013 # Robert Side <rside@aiinc.bc.ca>
3014 # Mon, 18 Jan 1999 17:48:00 GMT
eed82608 3015 AC_MSG_NOTICE([disabling poll for $host...])
86ec11aa 3016 ac_cv_func_poll='no'
3017 ;;
84cecfd2 3018 esac
3019fi
176d10ee 3020
08caf8c6 3021dnl Override statfs() detect on MinGW becasue is emulated in source code
3022case "$host_os" in
3023mingw|mingw32)
3024 ac_cv_func_statfs='yes'
3025 ;;
3026esac
3027
6716b242 3028dnl Check for library functions
3029AC_CHECK_FUNCS(\
ce3d30fb 3030 backtrace_symbols_fd \
3a144521 3031 bcopy \
3032 bswap_16 \
3033 bswap_32 \
f9576890 3034 bswap16 \
3035 bswap32 \
4ac29a5b 3036 fchmod \
6716b242 3037 getdtablesize \
8505e57b 3038 getpagesize \
230c091c 3039 getpass \
3a144521 3040 getrlimit \
30a4f2a8 3041 getrusage \
9c1d8929 3042 getspnam \
379d5751 3043 gettimeofday \
52303a3d 3044 glob \
f9576890 3045 htobe16 \
3046 htole16 \
d474c7a6 3047 kqueue\
30a4f2a8 3048 lrand48 \
6716b242 3049 mallinfo \
0f5efab0 3050 mallocblksize \
6716b242 3051 mallopt \
2ae6b9b0 3052 memcpy \
30a4f2a8 3053 memmove \
dac27377 3054 memset \
b99a6dec 3055 mkstemp \
1812b6c7 3056 mktime \
88738790 3057 mstats \
84cecfd2 3058 poll \
62ae0622 3059 prctl \
3a144521 3060 pthread_attr_setschedparam \
cd748f27 3061 pthread_attr_setscope \
3062 pthread_setschedparam \
42b51993 3063 pthread_sigmask \
c68e9c6b 3064 putenv \
b1e77ec1 3065 random \
6716b242 3066 regcomp \
3067 regexec \
3068 regfree \
30a4f2a8 3069 res_init \
af76ec93 3070 __res_init \
4915be3b 3071 rint \
a4ba1105 3072 sbrk \
3a144521 3073 select \
234967c9 3074 seteuid \
c415c128 3075 setgroups \
30a4f2a8 3076 setpgrp \
6716b242 3077 setrlimit \
30a4f2a8 3078 setsid \
3079 sigaction \
11430c03 3080 snprintf \
1ccc0d40 3081 socketpair \
30a4f2a8 3082 srand48 \
b1e77ec1 3083 srandom \
0343b99c 3084 statfs \
6716b242 3085 sysconf \
3086 syslog \
234967c9 3087 timegm \
28da5e0d 3088 vsnprintf \
6716b242 3089)
f5e5c4cf 3090dnl ... and some we provide local replacements for
3091AC_REPLACE_FUNCS(\
3092 drand48 \
a98c2da5 3093 eui64_aton \
cc192b50 3094 inet_ntop \
3095 inet_pton \
f5e5c4cf 3096 initgroups \
cc192b50 3097 getaddrinfo \
3098 getnameinfo \
f5e5c4cf 3099 strerror \
585cddda
AJ
3100 strsep \
3101 strtoll \
f5e5c4cf 3102 tempnam \
3103)
6716b242 3104
1b3db6d9 3105dnl Magic which checks whether we are forcing a type of comm loop we
3106dnl are actually going to (ab)use
3107
3108dnl Actually do the define magic now
3109dnl mostly ripped from squid-commloops, thanks to adrian and benno
3110
8075a4da
FC
3111if test -n "$squid_opt_io_loop_engine"; then
3112 AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine])
bf53a520 3113elif test "$squid_opt_enable_epoll" != "no" && test "$ac_cv_epoll_works" = "yes" ; then
8075a4da 3114 squid_opt_io_loop_engine="epoll"
bf53a520 3115elif test "$squid_opt_enable_kqueue" != "no" && test "$ac_cv_func_kqueue" = "yes" ; then
8075a4da 3116 squid_opt_io_loop_engine="kqueue"
bf53a520 3117elif test "$squid_opt_enable_poll" != "no" && test "$ac_cv_func_poll" = "yes" ; then
8075a4da 3118 squid_opt_io_loop_engine="poll"
bf53a520 3119elif test "$squid_opt_enable_select" != "no" && test "$ac_cv_func_select" = "yes" ; then
8075a4da 3120 squid_opt_io_loop_engine="select"
bf53a520 3121 if test "$squid_host_os" = "mingw" ; then
8075a4da 3122 squid_opt_io_loop_engine="select_win32"
bf53a520 3123 fi
1b3db6d9 3124else
bf53a520
FC
3125 AC_MSG_WARN([Eep! Can't find poll, kqueue, epoll, or select!])
3126 AC_MSG_WARN([I'll try select and hope for the best.])
8075a4da 3127 squid_opt_io_loop_engine="select"
1b3db6d9 3128fi
d474c7a6 3129
8075a4da 3130AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.])
d474c7a6 3131
8075a4da
FC
3132AM_CONDITIONAL([USE_POLL], [test $squid_opt_io_loop_engine = poll])
3133AM_CONDITIONAL([USE_EPOLL], [test $squid_opt_io_loop_engine = epoll])
3134AM_CONDITIONAL([USE_SELECT], [test $squid_opt_io_loop_engine = select])
3135AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $squid_opt_io_loop_engine = select_simple])
3136AM_CONDITIONAL([USE_SELECT_WIN32], [test $squid_opt_io_loop_engine = select_win32])
3137AM_CONDITIONAL([USE_KQUEUE], [test $squid_opt_io_loop_engine = kqueue])
3138AM_CONDITIONAL([USE_DEVPOLL], [test $squid_opt_io_loop_engine = devpoll])
d474c7a6 3139
8075a4da 3140case $squid_opt_io_loop_engine in
0abb39dd
FC
3141 epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;;
3142 poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;;
3143 kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;;
3144 select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;;
3145 select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;;
d474c7a6 3146esac
1b3db6d9 3147
60939927 3148dnl Yay! Another Linux brokenness. Its not good enough
3149dnl to know that setresuid() exists, because RedHat 5.0 declares
3150dnl setresuid() but doesn't implement it.
3151dnl
3152AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
62979ab1 3153 AC_RUN_IFELSE([AC_LANG_SOURCE([[
60939927 3154#include <stdlib.h>
b3167ca7 3155 int main(int argc, char **argv) {
5c51415d 3156 if(setresuid(-1,-1,-1)) {
3157 perror("setresuid:");
b3167ca7 3158 return 1;
60939927 3159 }
b3167ca7 3160 return 0;
5c51415d 3161 }
62979ab1 3162 ]])],[ac_cv_func_setresuid="yes"],[ac_cv_func_setresuid="no"],[])
60939927 3163)
5c51415d 3164if test "$ac_cv_func_setresuid" = "yes" ; then
6a9f6389 3165 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 3166fi
60939927 3167
0abb39dd
FC
3168SQUID_CHECK_FUNC_STRNSTR
3169SQUID_CHECK_FUNC_VACOPY
3170SQUID_CHECK_FUNC___VACOPY
cee08cbc 3171
c3d0c8b5 3172
5cafc1d6 3173dnl IP-Filter support requires ipf header files. These aren't
3174dnl installed by default, so we need to check for them
47d80734 3175AC_MSG_NOTICE([Support for IPF-based transparent proxy requested: $squid_opt_ipf_transparent])
20ad76ab
FC
3176if test "$squid_opt_ipf_transparent" != "no" ; then
3177 AC_MSG_CHECKING(for availability of IP-Filter header files)
42b51993 3178 # hold on to your hats...
3179 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3180 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
87d21d8b 3181 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3182 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
42b51993 3183 have_ipfilter_compat_header="yes"
3184 fi
20ad76ab 3185 if test "$have_ipfilter_compat_header" = "yes" &&
eb824054 3186 test "$ac_cv_header_ip_fil_h" = "yes" &&
3187 test "$ac_cv_header_ip_nat_h" = "yes" ; then
20ad76ab 3188 squid_opt_ipf_transparent="yes"
eb824054 3189 AC_DEFINE(IPF_TRANSPARENT, 1)
42b51993 3190 elif test "$have_ipfilter_compat_header" = "yes" &&
eb824054 3191 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3192 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
20ad76ab 3193 squid_opt_ipf_transparent="yes"
eb824054 3194 AC_DEFINE(IPF_TRANSPARENT, 1)
3195 else
20ad76ab 3196 squid_opt_ipf_transparent="no"
5cafc1d6 3197 AC_DEFINE(IPF_TRANSPARENT, 0)
5cafc1d6 3198 fi
3199 AC_MSG_RESULT($IPF_TRANSPARENT)
3200fi
20ad76ab 3201if test "$squid_opt_ipf_transparent" = "yes" -a "$squid_host_os" = "solaris" ; then
8f6ca20d 3202dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3203dnl Solaris minor version (8, 9, 10, ...)
20ad76ab
FC
3204 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3205 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3206 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
5cafc1d6 3207fi
3208
2b0dd4ac 3209dnl PF support requires a header file.
47d80734 3210AC_MSG_NOTICE([Support for PF-based transparent proxy requested: $squid_opt_pf_transparent])
20ad76ab 3211if test "$squid_opt_pf_transparent" != "no" ; then
47d80734 3212 AC_MSG_CHECKING(for availability of PF header files)
20ad76ab
FC
3213 # hold on to your hats...
3214 if test "$ac_cv_header_net_pfvar_h" = "yes" || test "$ac_cv_header_net_pf_pfvar_h" = "yes"; then
3215 squid_opt_pf_transparent="yes"
3216 AC_DEFINE(PF_TRANSPARENT, 1)
3217 else
3218 squid_opt_pf_transparent="no"
3219 AC_DEFINE(PF_TRANSPARENT, 0)
3220 fi
3221 AC_MSG_RESULT($squid_opt_pf_transparent)
2b0dd4ac 3222fi
20ad76ab 3223if test "$squid_opt_pf_transparent" = "no" ; then
eed82608
AJ
3224 AC_MSG_WARN([Cannot find necessary PF header file])
3225 AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
2b0dd4ac 3226fi
3227
20ad76ab 3228if test "$squid_opt_linux_netfilter" != "no" ; then
d6d62546 3229 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
d852fbad 3230 # hold on to your hats...
3231 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
d852fbad 3232 AC_DEFINE(LINUX_NETFILTER, 1)
3233 else
20ad76ab 3234 squid_opt_linux_netfilter="no"
d852fbad 3235 AC_DEFINE(LINUX_NETFILTER, 0)
20ad76ab
FC
3236 AC_MSG_WARN([Cannot find necessary Linux kernel (Netfilter) header files])
3237 AC_MSG_WARN([Linux Transparent and Intercepting Proxy support WILL NOT be enabled])
d852fbad 3238 fi
20ad76ab 3239 AC_MSG_RESULT($squid_opt_linux_netfilter)
b50f1b2b 3240fi
20ad76ab 3241
b50f1b2b 3242dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
47d80734 3243AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $squid_opt_linux_netfilter])
20ad76ab 3244if test "$squid_opt_linux_netfilter" = "yes" && test "$use_libcap" != "yes" ; then
b50f1b2b
AJ
3245 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3246 AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3247 AC_MSG_WARN([Reduced support to Interception Proxy])
96f08e2d
FC
3248 squid_opt_linux_tproxy2="no"
3249 # AC_DEFINE'd later
3250fi
3251
3252# Linux Netfilter/TPROXYv2 support requires some specific header files and
3253# support infrastructure (netfilter and libcap)
47d80734 3254AC_MSG_NOTICE([Support for Linux TPROXY v2 transparent proxy requested: $squid_opt_linux_tproxy2])
96f08e2d
FC
3255if test "$squid_opt_linux_tproxy2" = "yes" -a "$use_libcap" != "yes" ; then
3256 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3257 AC_MSG_WARN([Disabling Linux TPROXY v2 support])
3258 AC_MSG_WARN([Interception proxy will still work])
3259 squid_opt_linux_tproxy2="no"
3260fi
3261if test "$squid_opt_linux_tproxy2" = "yes" ; then
3262 # we already checked that $use_libcap2=yes
3263 if test "$squid_opt_linux_netfilter" = "no" ; then
3264 squid_opt_linux_netfilter="yes"
3265 AC_MSG_NOTICE([Enabling Linux Netfilter support needed by Linux TPROXY v2])
3266 fi
3267 AC_MSG_CHECKING([if TPROXYv2 header files are installed])
3268 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" != "yes" ; then
3269 squid_opt_linux_tproxy2="no"
3270 dnl need to output before next lines
3271 AC_MSG_RESULT($squid_opt_linux_tproxy2)
96f08e2d
FC
3272 AC_MSG_WARN([Cannot find TPROXY v2 headers, you need to patch the kernel with ])
3273 AC_MSG_WARN([tproxy package from: http://www.balabit.com/downloads/files/tproxy/])
3274 AC_MSG_WARN([or use '--enable-linux-netfilter' option instead for Netfilter support.])
b50f1b2b 3275 else
96f08e2d 3276 AC_MSG_RESULT($squid_opt_linux_tproxy2)
b50f1b2b 3277 fi
fc68f6b1 3278fi
3279
96f08e2d
FC
3280dnl at the end of it all..
3281if test "$squid_opt_linux_tproxy2" = "yes" ; then
3282 AC_DEFINE(LINUX_TPROXY2, 1)
3283else
3284 AC_DEFINE(LINUX_TPROXY2, 0)
3285fi
3286
3287
cc937513 3288AC_ARG_ENABLE(gnuregex,
62979ab1 3289 AS_HELP_STRING([--enable-gnuregex],[Compile GNUregex. Unless you have reason to use
cc937513
AJ
3290 this option, you should not enable it.
3291 This library file is usually only required on Windows and
3292 very old Unix boxes which do not have their own regex
3293 library built in.]),
3294[USE_GNUREGEX=$enableval])
91bc414e 3295if test -z "$USE_GNUREGEX" ; then
3296 case "$host" in
3297 *-sun-solaris2.[[0-4]])
3298 USE_GNUREGEX="yes"
3299 ;;
3300 *-next-nextstep*)
3301 USE_GNUREGEX="yes"
3302 ;;
3303 esac
3304fi
7a081912 3305AC_MSG_CHECKING(if GNUregex needs to be compiled)
91bc414e 3306if test -z "$USE_GNUREGEX"; then
55878dfd 3307if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
74946a0f 3308 USE_GNUREGEX="yes"
00fa2c12 3309else
62979ab1
AJ
3310 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
3311#include <regex.h>]], [[regex_t t; regcomp(&t,"",0);]])],[USE_GNUREGEX="no"],[USE_GNUREGEX="yes"])
91bc414e 3312fi
00fa2c12 3313fi
74946a0f 3314AC_MSG_RESULT($USE_GNUREGEX)
3315if test "$USE_GNUREGEX" = "yes"; then
cc937513
AJ
3316 # override system regex with ours. Not good. But what was asked for.
3317 REGEXLIB=""
6a9f6389 3318 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
7a081912 3319fi
26675bf4 3320AC_SUBST(REGEXLIB)
cc937513 3321#AC_SUBST(LIBREGEX)
7a081912 3322
5c51415d 3323dnl Not cached since people are likely to tune this
e924600d 3324AC_MSG_CHECKING(Default FD_SETSIZE value)
62979ab1 3325AC_RUN_IFELSE([AC_LANG_SOURCE([[
e924600d 3326#if HAVE_STDIO_H
3327#include <stdio.h>
3328#endif
3329#if HAVE_UNISTD_H
3330#include <unistd.h>
3331#endif
cf69e4f2
HN
3332#if HAVE_STDLIB_H
3333#include <stdlib.h>
3334#endif
e924600d 3335#if HAVE_SYS_TIME_H
3336#include <sys/time.h>
3337#endif
3338#if HAVE_SYS_SELECT_H
3339#include <sys/select.h>
3340#endif
3341#if HAVE_SYS_TYPES_H
3342#include <sys/types.h>
3343#endif
bfe8dedf
GS
3344#if HAVE_WINSOCK_H
3345#include <winsock.h>
3346#endif
3347#if HAVE_WINSOCK2_H
3348#include <winsock2.h>
3349#endif
b3167ca7 3350int main(int argc, char **argv) {
635e6242 3351 FILE *fp = fopen("conftestval", "w");
3352 fprintf (fp, "%d\n", FD_SETSIZE);
b3167ca7 3353 return 0;
e924600d 3354}
62979ab1 3355]])],[DEFAULT_FD_SETSIZE=`cat conftestval`],[DEFAULT_FD_SETSIZE=256],[DEFAULT_FD_SETSIZE=256])
e924600d 3356AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
6a9f6389 3357AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
e924600d 3358
f49be7d1 3359
5c51415d 3360dnl Not cached since people are likely to tune this
234967c9 3361AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
c76d8acc 3362dnl damn! FreeBSD's pthreads breaks dup2().
5132a9eb 3363TLDFLAGS="$LDFLAGS"
f49be7d1 3364if test -n "$squid_filedescriptors_num" ; then
3365 SQUID_MAXFD=$squid_filedescriptors_num
3366 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3367else
f49be7d1 3368 case $host in
3369 i386-unknown-freebsd*)
3370 if echo "$LDFLAGS" | grep -q pthread; then
3371 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3372 fi
3373 esac
62979ab1 3374 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3375#include <stdio.h>
234967c9 3376#include <unistd.h>
cf69e4f2 3377#include <stdlib.h>
30a4f2a8 3378#include <sys/time.h> /* needed on FreeBSD */
234967c9 3379#include <sys/param.h>
3380#include <sys/resource.h>
b3167ca7 3381int main(int argc, char **argv) {
635e6242 3382 FILE *fp;
234967c9 3383 int i,j;
42b51993 3384#if defined(__CYGWIN32__) || defined (__CYGWIN__)
b05490a8 3385 /* getrlimit and sysconf returns bogous values on cygwin32.
df087e68 3386 * Number of fds is virtually unlimited in cygwin (sys/param.h)
b05490a8 3387 * __CYGWIN32__ is deprecated.
df087e68 3388 */
3389 i = NOFILE;
b05490a8 3390#else
3391#if HAVE_SETRLIMIT
234967c9 3392 struct rlimit rl;
3393#if defined(RLIMIT_NOFILE)
3394 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3395 perror("getrlimit: RLIMIT_NOFILE");
3396 } else {
f168f0c5
AJ
3397#if defined(__APPLE__)
3398 /* asking for more than OPEN_MAX fails on Leopard */
3399 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3400#else
234967c9 3401 rl.rlim_cur = rl.rlim_max; /* set it to the max */
f168f0c5 3402#endif
234967c9 3403 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3404 perror("setrlimit: RLIMIT_NOFILE");
3405 }
3406 }
3407#elif defined(RLIMIT_OFILE)
3408 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3409 perror("getrlimit: RLIMIT_OFILE");
3410 } else {
3411 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3412 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3413 perror("setrlimit: RLIMIT_OFILE");
3414 }
3415 }
3416#endif /* RLIMIT_NOFILE */
3417#endif /* HAVE_SETRLIMIT */
d9399075 3418 /* by starting at 2^14, we will never get higher
3419 than 2^15 for SQUID_MAXFD */
3420 i = j = 1<<14;
3421 while (j) {
3422 j >>= 1;
3423 if (dup2(0, i) < 0) {
3424 i -= j;
3425 } else {
3426 close(i);
3427 i += j;
3428 }
3429 }
3430 i++;
b05490a8 3431#endif /* IF !DEF CYGWIN */
635e6242 3432 fp = fopen("conftestval", "w");
a4d7e961 3433 fprintf (fp, "%d\n", i & ~0x3F);
b3167ca7 3434 return 0;
234967c9 3435}
62979ab1 3436 ]])],[SQUID_MAXFD=`cat conftestval`],[SQUID_MAXFD=256],[SQUID_MAXFD=256])
4b26fae9 3437 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3438 case "$host_os" in
3439 mingw|mingw32)
3440 SQUID_MAXFD="2048"
3441 ;;
3442 esac
f49be7d1 3443 AC_MSG_RESULT($SQUID_MAXFD)
3444fi
6a9f6389 3445AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
b9cc811d 3446if test "$SQUID_MAXFD" -lt 512 ; then
eed82608
AJ
3447 AC_MSG_WARN([$SQUID_MAXFD may not be enough filedescriptors if your])
3448 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3449 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3450 AC_MSG_WARN([on how to increase your filedescriptor limit])
80ab193b 3451fi
c76d8acc 3452LDFLAGS="$TLDFLAGS"
234967c9 3453
d0f9207a 3454if test `expr $SQUID_MAXFD % 64` != 0; then
eed82608 3455 AC_MSG_WARN([$SQUID_MAXFD is not an multiple of 64. This may cause issues on certain platforms.])
a4d7e961 3456fi
3457
5c51415d 3458dnl Not cached since people are likely to tune this
30a4f2a8 3459AC_MSG_CHECKING(Default UDP send buffer size)
62979ab1 3460AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3461#include <stdlib.h>
3462#include <stdio.h>
30a4f2a8 3463#include <sys/types.h>
bfe8dedf 3464#if HAVE_SYS_SOCKET_H
30a4f2a8 3465#include <sys/socket.h>
bfe8dedf
GS
3466#endif
3467#if HAVE_NETINET_IN_H
30a4f2a8 3468#include <netinet/in.h>
bfe8dedf
GS
3469#endif
3470#if HAVE_WINSOCK_H
3471#include <winsock.h>
3472#endif
3473#if HAVE_WINSOCK2_H
3474#include <winsock2.h>
3475#endif
b3167ca7 3476int main(int argc, char **argv)
30a4f2a8 3477{
635e6242 3478 FILE *fp;
eab7694a 3479 int fd,val=0;
bfe8dedf 3480#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
eab7694a 3481 int len=sizeof(int);
bfe8dedf
GS
3482 WSADATA wsaData;
3483 WSAStartup(2, &wsaData);
eab7694a
GS
3484#else
3485 socklen_t len=sizeof(socklen_t);
bfe8dedf 3486#endif
b3167ca7 3487 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
bfe8dedf 3488#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
b3167ca7 3489 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
bfe8dedf 3490 WSACleanup();
f3f3e961 3491#else
b3167ca7 3492 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
bfe8dedf 3493#endif
b3167ca7 3494 if (val<=0) return 1;
635e6242 3495 fp = fopen("conftestval", "w");
3496 fprintf (fp, "%d\n", val);
b3167ca7 3497 return 0;
30a4f2a8 3498}
62979ab1 3499]])],[SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_SNDBUF=16384],[SQUID_DETECT_UDP_SO_SNDBUF=16384])
6a9f6389 3500AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3501AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
30a4f2a8 3502
5c51415d 3503dnl Not cached since people are likely to tune this
30a4f2a8 3504AC_MSG_CHECKING(Default UDP receive buffer size)
62979ab1 3505AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3506#include <stdlib.h>
3507#include <stdio.h>
30a4f2a8 3508#include <sys/types.h>
bfe8dedf 3509#if HAVE_SYS_SOCKET_H
30a4f2a8 3510#include <sys/socket.h>
bfe8dedf
GS
3511#endif
3512#if HAVE_NETINET_IN_H
30a4f2a8 3513#include <netinet/in.h>
bfe8dedf
GS
3514#endif
3515#if HAVE_WINSOCK_H
3516#include <winsock.h>
3517#endif
3518#if HAVE_WINSOCK2_H
3519#include <winsock2.h>
3520#endif
b3167ca7 3521int main(int argc, char **argv)
30a4f2a8 3522{
635e6242 3523 FILE *fp;
eab7694a 3524 int fd,val=0;
bfe8dedf 3525#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
eab7694a 3526 int len=sizeof(int);
bfe8dedf
GS
3527 WSADATA wsaData;
3528 WSAStartup(2, &wsaData);
eab7694a
GS
3529#else
3530 socklen_t len=sizeof(socklen_t);
bfe8dedf 3531#endif
b3167ca7 3532 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
bfe8dedf 3533#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
b3167ca7 3534 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
bfe8dedf 3535 WSACleanup();
f3f3e961 3536#else
b3167ca7 3537 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
bfe8dedf 3538#endif
b3167ca7 3539 if (val <= 0) return 1;
635e6242 3540 fp = fopen("conftestval", "w");
3541 fprintf (fp, "%d\n", val);
b3167ca7 3542 return 0;
30a4f2a8 3543}
62979ab1 3544]])],[SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_RCVBUF=16384],[SQUID_DETECT_UDP_SO_RCVBUF=16384])
6a9f6389 3545AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3546AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
30a4f2a8 3547
5c51415d 3548dnl Not cached since people are likely to tune this
30a4f2a8 3549AC_MSG_CHECKING(Default TCP send buffer size)
62979ab1 3550AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3551#include <stdlib.h>
3552#include <stdio.h>
30a4f2a8 3553#include <sys/types.h>
bfe8dedf 3554#if HAVE_SYS_SOCKET_H
30a4f2a8 3555#include <sys/socket.h>
bfe8dedf
GS
3556#endif
3557#if HAVE_NETINET_IN_H
30a4f2a8 3558#include <netinet/in.h>
bfe8dedf
GS
3559#endif
3560#if HAVE_WINSOCK_H
3561#include <winsock.h>
3562#endif
3563#if HAVE_WINSOCK2_H
3564#include <winsock2.h>
3565#endif
b3167ca7 3566int main(int argc, char **argv)
30a4f2a8 3567{
635e6242 3568 FILE *fp;
eab7694a 3569 int fd,val=0;
bfe8dedf 3570#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
eab7694a 3571 int len=sizeof(int);
bfe8dedf
GS
3572 WSADATA wsaData;
3573 WSAStartup(2, &wsaData);
eab7694a
GS
3574#else
3575 socklen_t len=sizeof(socklen_t);
bfe8dedf 3576#endif
b3167ca7 3577 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
bfe8dedf 3578#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
b3167ca7 3579 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
bfe8dedf 3580 WSACleanup();
f3f3e961 3581#else
b3167ca7 3582 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
bfe8dedf 3583#endif
b3167ca7 3584 if (val <= 0) return 1;
635e6242 3585 fp = fopen("conftestval", "w");
3586 fprintf (fp, "%d\n", val);
b3167ca7 3587 return 0;
30a4f2a8 3588}
62979ab1 3589]])],[SQUID_TCP_SO_SNDBUF=`cat conftestval`],[SQUID_TCP_SO_SNDBUF=16384],[SQUID_TCP_SO_SNDBUF=16384])
30a4f2a8 3590AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2aa6ca58 3591if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
eed82608 3592 AC_MSG_NOTICE([Limiting send buffer size to 32K])
2aa6ca58 3593 SQUID_TCP_SO_SNDBUF=32768
3594fi
6a9f6389 3595AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
30a4f2a8 3596
5c51415d 3597dnl Not cached since people are likely to tune this
30a4f2a8 3598AC_MSG_CHECKING(Default TCP receive buffer size)
62979ab1 3599AC_RUN_IFELSE([AC_LANG_SOURCE([[
8cca06da 3600#include <stdlib.h>
3601#include <stdio.h>
30a4f2a8 3602#include <sys/types.h>
bfe8dedf 3603#if HAVE_SYS_SOCKET_H
30a4f2a8 3604#include <sys/socket.h>
bfe8dedf
GS
3605#endif
3606#if HAVE_NETINET_IN_H
30a4f2a8 3607#include <netinet/in.h>
bfe8dedf
GS
3608#endif
3609#if HAVE_WINSOCK_H
3610#include <winsock.h>
3611#endif
3612#if HAVE_WINSOCK2_H
3613#include <winsock2.h>
3614#endif
b3167ca7 3615int main(int argc, char **argv)
30a4f2a8 3616{
635e6242 3617 FILE *fp;
eab7694a 3618 int fd,val=0;
bfe8dedf 3619#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
eab7694a 3620 int len=sizeof(int);
bfe8dedf
GS
3621 WSADATA wsaData;
3622 WSAStartup(2, &wsaData);
eab7694a
GS
3623#else
3624 socklen_t len=sizeof(socklen_t);
bfe8dedf 3625#endif
b3167ca7 3626 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
bfe8dedf 3627#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
b3167ca7 3628 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
bfe8dedf 3629 WSACleanup();
f3f3e961 3630#else
b3167ca7 3631 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
bfe8dedf 3632#endif
b3167ca7 3633 if (val <= 0) return 1;
635e6242 3634 fp = fopen("conftestval", "w");
3635 fprintf (fp, "%d\n", val);
b3167ca7 3636 return 0;
30a4f2a8 3637}
62979ab1 3638]])],[SQUID_TCP_SO_RCVBUF=`cat conftestval`],[SQUID_TCP_SO_RCVBUF=16384],[SQUID_TCP_SO_RCVBUF=16384])
30a4f2a8 3639AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2aa6ca58 3640if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
eed82608 3641 AC_MSG_NOTICE([Limiting receive buffer size to 64K])
2aa6ca58 3642 SQUID_TCP_SO_RCVBUF=65535
3643fi
6a9f6389 3644AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
5c51415d 3645AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
62979ab1 3646 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 3647)
3648if test "$ac_cv_needs_sys_errlist" = "yes" ; then
6a9f6389 3649 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
5c51415d 3650fi
30a4f2a8 3651
ef364f64
AJ
3652dnl Hurd does not supply MAXPATHLEN. we may need to define it outselves.
3653dnl Other system define it in system headers
3654AC_CHECK_HEADERS([sys/param.h])
3655AC_MSG_CHECKING(for MAXPATHLEN)
3656AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/param.h>]],[[int i = MAXPATHLEN;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
3657 AC_DEFINE(MAXPATHLEN,256,[If MAXPATHLEN has not been defined])])
3658
3659
5c51415d 3660dnl Not cached since people are likely to change this
6bf65235 3661AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
62979ab1
AJ
3662AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
3663AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],[AC_MSG_RESULT(no)])
6bf65235 3664
b6a2f15e 3665if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
c68e9c6b 3666AC_MSG_CHECKING(for working statvfs() interface)
62979ab1 3667AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
c68e9c6b 3668#include <stdlib.h>
3669#include <stdio.h>
3670#include <sys/types.h>
3671#include <sys/statvfs.h>
62979ab1 3672]], [[
c68e9c6b 3673struct statvfs sfs;
3674sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3675sfs.f_files = sfs.f_ffree = 0;
3676statvfs("/tmp", &sfs);
62979ab1 3677]])],[ac_cv_func_statvfs=yes],[ac_cv_func_statvfs=no])
c68e9c6b 3678AC_MSG_RESULT($ac_cv_func_statvfs)
6b8e7481 3679if test "$ac_cv_func_statvfs" = "yes" ; then
6a9f6389 3680 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
b6a2f15e 3681fi
6b8e7481 3682fi
c68e9c6b 3683
cc192b50 3684dnl Detect what resolver fields we have available to use...
3685AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
62979ab1 3686AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
cc192b50 3687#if HAVE_SYS_TYPES_H
3688#include <sys/types.h>
3689#endif
3690#if HAVE_NETINET_IN_H
3691#include <netinet/in.h>
3692#endif
3693#if HAVE_ARPA_INET_H
3694#include <arpa/inet.h>
3695#endif
3696#if HAVE_ARPA_NAMESER_H
3697#include <arpa/nameser.h>
3698#endif
3699#if HAVE_RESOLV_H
3700#include <resolv.h>
3701#endif
62979ab1 3702]], [[_res_ext.nsaddr_list[[0]].s_addr;]])],[ac_cv_have_res_ext_nsaddr_list="yes"],[ac_cv_have_res_ext_nsaddr_list="no"]))
cc192b50 3703if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3704 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3705 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3706fi
3707
0873b2ab 3708if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
cc192b50 3709AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
62979ab1 3710AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
cc192b50 3711#if HAVE_SYS_TYPES_H
3712#include <sys/types.h>
3713#endif
3714#if HAVE_NETINET_IN_H
3715#include <netinet/in.h>
3716#endif
3717#if HAVE_ARPA_INET_H
3718#include <arpa/inet.h>
3719#endif
3720#if HAVE_ARPA_NAMESER_H
3721#include <arpa/nameser.h>
3722#endif
3723#if HAVE_RESOLV_H
3724#include <resolv.h>
3725#endif
62979ab1 3726]], [[_res._u._ext.nsaddrs[[0]]->sin6_addr;]])],[ac_cv_have_res_ext_nsaddrs="yes"],[ac_cv_have_res_ext_nsaddrs="no"]))
cc192b50 3727if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3728 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3729 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3730fi
3731fi
3732
c68e9c6b 3733AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
62979ab1 3734AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
c68e9c6b 3735#if HAVE_SYS_TYPES_H
3736#include <sys/types.h>
3737#endif
3738#if HAVE_NETINET_IN_H
3739#include <netinet/in.h>
3740#endif
3741#if HAVE_ARPA_INET_H
3742#include <arpa/inet.h>
3743#endif
3744#if HAVE_ARPA_NAMESER_H
3745#include <arpa/nameser.h>
3746#endif
3747#if HAVE_RESOLV_H
3748#include <resolv.h>
3749#endif
62979ab1 3750]], [[_res.nsaddr_list[[0]];]])],[ac_cv_have_res_nsaddr_list="yes"],[ac_cv_have_res_nsaddr_list="no"]))
c68e9c6b 3751if test $ac_cv_have_res_nsaddr_list = "yes" ; then
cc192b50 3752 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3753 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3754fi
3755
0873b2ab 3756if test "$_SQUID_RES_NSADDR_LIST" = ""; then
c68e9c6b 3757AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
62979ab1 3758AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
c68e9c6b 3759#if HAVE_SYS_TYPES_H
3760#include <sys/types.h>
3761#endif
3762#if HAVE_NETINET_IN_H
3763#include <netinet/in.h>
3764#endif
3765#if HAVE_ARPA_INET_H
3766#include <arpa/inet.h>
3767#endif
3768#if HAVE_ARPA_NAMESER_H
3769#include <arpa/nameser.h>
3770#endif
3771#if HAVE_RESOLV_H
3772#include <resolv.h>
3773#endif
62979ab1 3774]], [[_res.ns_list[[0]].addr;]])],[ac_cv_have_res_ns_list="yes"],[ac_cv_have_res_ns_list="no"]))
c68e9c6b 3775if test $ac_cv_have_res_ns_list = "yes" ; then
cc192b50 3776 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3777 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3778fi
3779fi
3780
461b8219 3781dnl Squid will usually attempt to translate when packaging or building from VCS
44e0a249 3782use_translation="yes"
461b8219 3783AC_ARG_ENABLE(translation,
62979ab1 3784 AS_HELP_STRING([--disable-translation],[Prevent Squid generating localized error page templates and manuals.
b3fed8c3 3785 Which is usually tried, but may not be needed.]),
461b8219
AJ
3786[ if test "$enableval" = "no" ; then
3787 use_translation=no
3788 fi
3789])
e4b70b44 3790dnl Squid now has .po translation capability, given the right toolkit
461b8219
AJ
3791if test "$use_translation" = "yes" ; then
3792 AX_WITH_PROG([PO2HTML],[po2html])
3793else
3794 PO2HTML="off"
3795fi
3796AC_SUBST(PO2HTML)
ee1a8ac2 3797
43000484
AJ
3798dnl Squid now has limited locale handling ...
3799dnl on error pages
8db7a54b 3800use_errlocale=yes
43000484 3801AC_ARG_ENABLE(auto-locale,
62979ab1 3802 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
21d5413e
AJ
3803 clients request headers.
3804 When disabled Squid requires explicit language configuration.]),
8db7a54b
AJ
3805[ if test "$enableval" = "no" ; then
3806 use_errlocale=no
3807 fi
3808])
3809if test "$use_errlocale" = "yes" ; then
eed82608 3810 AC_MSG_NOTICE([Enabling Multi-Language Support])
43000484 3811 AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
8db7a54b 3812else
eed82608 3813 AC_MSG_WARN([Disabling Multi-Language Support])
43000484 3814 AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
8db7a54b 3815fi
43000484 3816
090089c4 3817dnl Need the debugging version of malloc if available
3818XTRA_OBJS=''
6509a1a0 3819if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 3820 if test -r /usr/lib/debug/malloc.o ; then
3821 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3822 fi
3823 if test -r /usr/lib/debug/mallocmap.o ; then
3824 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3825 fi
3826fi
3827AC_SUBST(XTRA_OBJS)
3828
38fea766 3829if test -z "$XTRA_LIBS"; then
3830 XTRA_LIBS="$LIBS"
0f5a16f8 3831 dnl minor cleanup
3832 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 3833 LIBS=''
3834fi
090089c4 3835AC_SUBST(XTRA_LIBS)
3836
090089c4 3837dnl Clean up after OSF/1 core dump bug
3838rm -f core
3839
6a9f6389 3840AC_CONFIG_FILES([\
a2794549 3841 Makefile \
eee95dfe 3842 compat/Makefile \
a2794549 3843 lib/Makefile \
a2794549 3844 scripts/Makefile \
a2794549 3845 src/Makefile \
5bd7a218 3846 src/base/Makefile \
bcf44a2c 3847 src/acl/Makefile \
a2794549 3848 src/fs/Makefile \
3849 src/repl/Makefile \
3850 src/auth/Makefile \
5fa840c3 3851 src/adaptation/Makefile \
1f3c65fc
AR
3852 src/adaptation/icap/Makefile \
3853 src/adaptation/ecap/Makefile \
04f55905 3854 src/comm/Makefile \
f99c2cfe 3855 src/esi/Makefile \
ee0927b6 3856 src/eui/Makefile \
663ff9aa 3857 src/icmp/Makefile \
4daaf3cb 3858 src/ident/Makefile \
f963428c 3859 src/ip/Makefile \
82b7abe3 3860 src/log/Makefile \
a2794549 3861 contrib/Makefile \
3862 snmplib/Makefile \
3863 icons/Makefile \
3864 errors/Makefile \
1077c1b8 3865 test-suite/Makefile \
99db07b3 3866 doc/Makefile \
3faa6da8 3867 doc/manuals/Makefile \
0c510f3c 3868 helpers/Makefile \
3869 helpers/basic_auth/Makefile \
5a48ed18
AJ
3870 helpers/basic_auth/DB/Makefile \
3871 helpers/basic_auth/getpwnam/Makefile \
0c510f3c 3872 helpers/basic_auth/LDAP/Makefile \
3873 helpers/basic_auth/MSNT/Makefile \
5a48ed18 3874 helpers/basic_auth/MSNT-multi-domain/Makefile \
0c510f3c 3875 helpers/basic_auth/NCSA/Makefile \
5a48ed18 3876 helpers/basic_auth/NIS/Makefile \
0c510f3c 3877 helpers/basic_auth/PAM/Makefile \
bcf74be7 3878 helpers/basic_auth/POP3/Makefile \
5a48ed18
AJ
3879 helpers/basic_auth/RADIUS/Makefile \
3880 helpers/basic_auth/SASL/Makefile \
3881 helpers/basic_auth/SMB/Makefile \
3882 helpers/basic_auth/SSPI/Makefile \
0c510f3c 3883 helpers/digest_auth/Makefile \
3884 helpers/digest_auth/password/Makefile \
55013f9c 3885 helpers/digest_auth/ldap/Makefile \
89f77e43 3886 helpers/digest_auth/eDirectory/Makefile \
0c510f3c 3887 helpers/ntlm_auth/Makefile \
3888 helpers/ntlm_auth/fakeauth/Makefile \
3889 helpers/ntlm_auth/no_check/Makefile \
3963d7b1
AJ
3890 helpers/ntlm_auth/smb_lm/Makefile \
3891 helpers/ntlm_auth/smb_lm/smbval/Makefile \
6e785d85 3892 helpers/ntlm_auth/mswin_sspi/Makefile \
3893 helpers/negotiate_auth/Makefile \
45b2de83 3894 helpers/negotiate_auth/kerberos/Makefile \
6e785d85 3895 helpers/negotiate_auth/mswin_sspi/Makefile \
c6588c68 3896 helpers/external_acl/Makefile \
3897 helpers/external_acl/ip_user/Makefile \
3898 helpers/external_acl/ldap_group/Makefile \
74ab8d10 3899 helpers/external_acl/session/Makefile \
c6588c68 3900 helpers/external_acl/unix_group/Makefile \
736a9a4d 3901 helpers/external_acl/wbinfo_group/Makefile \
9e6e0372 3902 helpers/external_acl/mswin_ad_group/Makefile \
94ab55b0 3903 helpers/external_acl/mswin_lm_group/Makefile \
82b7abe3
AJ
3904 helpers/log_daemon/Makefile \
3905 helpers/log_daemon/file/Makefile \
fdbb3b19
AJ
3906 helpers/url_rewrite/Makefile \
3907 helpers/url_rewrite/fake/Makefile \
94ab55b0 3908 tools/Makefile
53cbe3e4 3909])
43ae1d95 3910
377792e4 3911AC_CONFIG_SUBDIRS(lib/libTrie)
3912
3e7b6055 3913# must configure libltdl subdir unconditionally for "make distcheck" to work
660faa02 3914AC_CONFIG_SUBDIRS(libltdl)
3e7b6055 3915
6a9f6389 3916AC_OUTPUT