7 AC_INIT([Squid Web Proxy],[3.HEAD-BZR],[http://www.squid-cache.org/bugs/],[squid])
9 AC_CONFIG_HEADERS([include/autoconf.h])
10 AC_CONFIG_AUX_DIR(cfgaux)
11 AC_CONFIG_SRCDIR([src/main.cc])
12 AM_INIT_AUTOMAKE([tar-ustar nostdinc])
13 AC_REVISION($Revision$)dnl
14 AC_PREFIX_DEFAULT(/usr/local/squid)
17 m4_include([acinclude/squid-util.m4])
18 m4_include([acinclude/compiler-flags.m4])
19 m4_include([acinclude/os-deps.m4])
20 m4_include([acinclude/krb5.m4])
21 m4_include([acinclude/pam.m4])
23 PRESET_CFLAGS="$CFLAGS"
24 PRESET_LDFLAGS="$LDFLAGS"
26 dnl Set default LDFLAGS
27 if test -z "$LDFLAGS"; then
38 AC_MSG_CHECKING([simplified host os])
39 squid_host_os=`echo $host_os|sed 's/[0-9].*//;s/-.*//g'`
40 squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
41 AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
42 # on windows squid_host_os is either mingw or cygwin, version is 32
51 AC_PATH_PROG(SH, sh, /bin/sh)
52 AC_PATH_PROG(FALSE, false, /usr/bin/false)
53 AC_PATH_PROG(TRUE, true, /usr/bin/true)
54 AC_PATH_PROG(MV, mv, $FALSE)
55 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
56 AC_PATH_PROG(LN, ln, cp)
57 AC_PATH_PROG(CHMOD, chmod, $FALSE)
58 AC_PATH_PROG(TR, tr, $FALSE)
59 AC_PATH_PROG(RM, rm, $FALSE)
60 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
61 dnl Libtool 2.2.6 requires: rm -f
64 AC_PATH_PROG(PERL, perl, none)
65 if 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 ])
68 AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
71 AC_PATH_PROG(AR, ar, $FALSE)
75 squid_opt_enable_werror="yes" # default
76 AC_ARG_ENABLE(strict-error-checking,
77 AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
78 with all possible static compiler error-checks enbled.
79 This flag disables the behavior]),
81 if test "${enableval}" = "no"
83 squid_opt_enable_werror="no"
87 use_loadable_modules=1
88 AC_MSG_CHECKING(whether to use loadable modules)
89 AC_ARG_ENABLE(loadable-modules,
90 AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [
91 case "${enableval}" in
92 yes) use_loadable_modules=yes ;;
93 no) use_loadable_modules=no ;;
94 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
96 AC_MSG_RESULT([$use_loadable_modules, explicitly])
98 use_loadable_modules=yes;
99 AC_MSG_RESULT([$use_loadable_modules, implicitly])
102 AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
104 if test $use_loadable_modules = yes;
106 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
113 if test $use_loadable_modules = yes;
115 dnl Linux LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
116 dnl But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
117 top_build_prefix=${ac_top_build_prefix}
118 AC_SUBST(top_build_prefix)
120 AC_LIBLTDL_CONVENIENCE
122 dnl LibTool environment is now prepared for setup. Check that it is usable and initialize.
126 # Do we need these unconditionally for "make distcheck" to work?
130 if test $use_loadable_modules = yes;
132 # Why is this needed? Should not AC_LIBTOOL_DLOPEN from libtool do that?
133 LIBADD_DL=${lt_cv_dlopen_libs}
134 AC_SUBST([LIBADD_DL])
138 SQUID_CC_GUESS_VARIANT
139 SQUID_CC_GUESS_OPTIONS
142 REGEXLIB='' # -lregex
143 # LIBREGEX='' # libregex.a
145 dnl find out the exe extension for this platform.
146 dnl If it is not empty, use it for CGI as well.
150 if test -z "$EXEEXT"; then
153 # automake automatically adds .exe when installing binaries
158 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,
159 [test "$squid_host_os" = "mingw" -o "$squid_host_os" = "cygwin"])
160 AM_CONDITIONAL(USE_IPC_WIN32,[test "$squid_host_os" = "mingw"])
162 if test $squid_host_os = "mingw"; then
163 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
164 CFLAGS="$CFLAGS -mthreads"
165 CXXFLAGS="$CXXFLAGS -mthreads"
166 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
167 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
168 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
170 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
173 MINGW_LIBS="-lmingwex"
177 if test -z "$CACHE_HTTP_PORT"; then
178 CACHE_HTTP_PORT="3128"
180 if test -z "$CACHE_ICP_PORT"; then
181 CACHE_ICP_PORT="3130"
185 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
186 [What default TCP port to use for HTTP listening?])
187 AC_SUBST(CACHE_HTTP_PORT)
188 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
189 [What default UDP port to use for ICP listening?])
190 AC_SUBST(CACHE_ICP_PORT)
192 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
194 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args",
195 [configure command line used to configure Squid])
197 CACHE_EFFECTIVE_USER="nobody"
198 AC_ARG_WITH(default-user,
199 AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
200 [ CACHE_EFFECTIVE_USER="$withval" ]
202 AC_SUBST(CACHE_EFFECTIVE_USER)
204 DEFAULT_LOG_DIR="$localstatedir/logs"
206 AS_HELP_STRING([--with-logdir=PATH],[Default location for squid logs. default: $DEFAULT_LOG_DIR]),
209 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
212 DEFAULT_LOG_DIR="$withval"
217 AC_SUBST(DEFAULT_LOG_DIR)
219 DEFAULT_PIDFILE="$localstatedir/run/squid.pid"
221 AS_HELP_STRING([--with-pidfile=PATH],
222 [Default location for squid PID file. default: PREFIX/var/run/squid.pid]),
225 AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
228 DEFAULT_PIDFILE="$withval"
232 AC_SUBST(DEFAULT_PIDFILE)
234 if test "$GCC" = "yes"; then
235 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
236 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
239 if test $GCCVER2 -lt 300 ; then
240 AC_MSG_FAILURE([GCC $GCCVER causes a coredump on $host. Try a more recent GCC version])
249 dnl Set Default CFLAGS
250 if test -z "$PRESET_CFLAGS"; then
251 if test "$GCC" = "yes"; then
254 # sunos has too many warnings for this to be useful
258 # Motorola cc/ld does not like -02 but is ok on -O
259 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
262 CFLAGS="$squid_cv_cc_option_wall $CFLAGS"
268 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
269 CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
270 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
271 -Wl,-woff,85,-woff,84,-woff,134 \
272 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
273 CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
274 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
275 -Wl,-woff,85,-woff,84,-woff,134 \
276 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
284 dnl set squid required flags
285 if test "$GCC" = "yes"; then
286 dnl Guido Serassio (serassio@squid-cache.org) 20070811
287 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
288 dnl -Werror -Wmissing-prototypes -Wmissing-declarations
289 dnl TODO: check if the problem will be present in any other newer MinGW release.
292 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments"
295 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
298 SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments"
304 if test "$squid_opt_enable_werror" = "no"
306 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
307 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_option_werror"
310 AC_SUBST(SQUID_CFLAGS)
311 AC_SUBST(SQUID_CXXFLAGS)
313 SQUID_CXX_CHECK_ARG_FHUGEOBJECTS
314 if test "$squid_cv_cxx_arg_fhugeobjects" = "yes"; then
315 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -fhuge-objects"
317 # squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS
318 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
319 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
323 AC_ARG_ENABLE(optimizations,
324 AS_HELP_STRING([--disable-optimizations],
325 [Do not compile Squid with compiler optimizations enabled.
326 Optimization is good for production builds, but not
327 good for debugging. During development, use
328 --disable-optimizations to reduce compilation times
329 and allow easier debugging. This option implicitly
330 also enabled --disable-inline]),
331 [ if test "$enableval" = "no" ; then
332 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
333 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
334 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
339 AH_TEMPLATE(_USE_INLINE_,[Include inline methods into header file])
340 AC_ARG_ENABLE(inline,
341 AS_HELP_STRING([--disable-inline],
342 [Do not compile trivial methods as inline. Squid
343 is coded with much of the code able to be inlined.
344 Inlining is good for production builds, but not
345 good for development. During development, use
346 --disable-inline to reduce compilation times and
347 allow incremental builds to be quick. For
348 production builds, or load tests, use
349 --enable-inline to have squid make all trivial
350 methods inlinable by the compiler.]),
351 [ if test "$enableval" = "no" ; then
356 if test "$SquidInline" = "yes" ; then
357 AC_DEFINE(_SQUID_INLINE_, inline,
358 [Keyword used by squid for inlining methods])
359 AC_DEFINE(_USE_INLINE_, 1 ,
360 [Include inline methods into header file])
362 AC_MSG_NOTICE([Inlining optimization disabled])
363 AC_DEFINE(_SQUID_INLINE_,[],
364 [Keyword used by squid for inlining methods])
367 AC_ARG_ENABLE(debug-cbdata,
368 AS_HELP_STRING([--enable-debug-cbdata],
369 [Provide some debug information in cbdata]), [
370 SQUID_YESNO([$enableval],
371 [unrecognized argument to --enable-debug-cbdata: $enableval])
373 SQUID_DEFINE_BOOL(CBDATA_DEBUG,${enable_debug_cbdata:=no},
374 [Enable support for cbdata debug information])
375 AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata])
378 dnl Nasty hack to get autoconf 2.64 on Linux to run.
379 dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
380 AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[])
382 dnl This is a developer only option.. developers know how to set defines
384 dnl AC_ARG_ENABLE(xmalloc-debug,
385 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
386 dnl [ if test "$enableval" = "yes" ; then
387 dnl AC_MSG_NOTICE([malloc debugging enabled])
388 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
392 dnl This is a developer only option.. developers know how to set defines
394 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
395 dnl [ --enable-xmalloc-debug-trace
396 dnl Detailed trace of memory allocations],
397 dnl [ if test "$enableval" = "yes" ; then
398 dnl AC_MSG_NOTICE([malloc debug trace enabled])
399 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
400 dnl AC_DEFINE(XMALLOC_DEBUG,1)
404 AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics])
405 AC_ARG_ENABLE(xmalloc-statistics,
406 AS_HELP_STRING([--enable-xmalloc-statistics],
407 [Show malloc statistics in status page]), [
408 SQUID_YESNO([$enableval],
409 [unrecognized argument to --enable-xmalloc-statistics: $enableval])
411 SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no},
412 [Show malloc statistics in status page])
413 AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics])
415 squid_opt_aufs_threads=""
416 AC_ARG_WITH(aufs-threads,
417 AS_HELP_STRING([--with-aufs-threads=N_THREADS],
418 [Tune the number of worker threads for the aufs object store.]), [
421 squid_opt_aufs_threads=$withval
424 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
428 if test -n "$squid_opt_aufs_threads"; then
429 AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads])
430 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads,
431 [Defines how many threads aufs uses for I/O])
434 AC_ARG_WITH(dl, AS_HELP_STRING([--with-dl],[Use dynamic linking]))
435 if test "$with_dl" = "yes"; then
436 AC_MSG_NOTICE([With dl])
439 AC_MSG_CHECKING([for DiskIO modules to be enabled])
440 squid_disk_module_candidates=""
441 squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules)
442 AC_ARG_ENABLE(disk-io,
443 AS_HELP_STRING([--enable-disk-io="list of modules"],
444 [Build support for the list of disk I/O modules.
445 Set without a value or omitted, all available modules will be built.
446 See src/DiskIO for a list of available modules, or
447 Programmers Guide section on DiskIO
448 for details on how to build your custom disk module]), [
452 #do nothing, "auto" is ok
455 squid_opt_enable_diskio="no"
458 squid_opt_enable_diskio="yes"
459 squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
460 SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
465 # if requested to autodetect, find out what we have
466 if test $squid_opt_enable_diskio = "auto"; then
467 squid_opt_enable_diskio="yes"
468 SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
471 AC_MSG_RESULT([${squid_disk_module_candidates:-none}])
472 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
473 SQUID_DEFINE_BOOL(USE_DISKIO,$squid_opt_enable_diskio,
474 [DiskIO modules are expected to be available.])
478 dnl Some autoconf.h defines we might enable later...
479 AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
480 AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
481 AH_TEMPLATE(USE_DISKIO_AIO, [Whether POSIX AIO support is needed. Automatic])
482 AH_TEMPLATE(USE_DISKIO_DISKTHREADS, [Whether pthreads support is needed. Automatic])
485 squid_opt_use_diskthreads=
488 dnl Setup the module paths etc.
493 for module in $squid_disk_module_candidates none; do
495 if test "$module" = "none"; then
498 if ! test -d $srcdir/src/DiskIO/$module; then
499 AC_MSG_ERROR(disk-io $module does not exist)
503 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
504 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
505 DISK_MODULES="$DISK_MODULES DiskDaemon"
506 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
507 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
510 squid_opt_use_diskthreads="yes"
512 SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
513 if test "$with_pthreads" != "no"; then
514 dnl TODO: this needs to be extended to handle more systems and better
515 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
516 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
517 case "$squid_host_os" in
520 AC_MSG_NOTICE([Windows threads support automatically enabled])
523 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
524 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
525 if test "$GCC" = "yes" -a -z "$PRESET_LDFLAGS" ; then
526 LDFLAGS="$LDFLAGS -pthread"
530 if test "$GCC" = "yes" ; then
531 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
532 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
533 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"],
534 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
535 squid_opt_use_diskthreads="no"
538 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
539 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
540 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
541 AC_SEARCH_LIBS([pthread_create],[pthread thread],[
542 LIBPTHREADS="" #in LIBS
544 AC_MSG_NOTICE(pthread library required but cannot be found.)
545 squid_opt_use_diskthreads="no"
550 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
551 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
552 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"],
553 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
554 squid_opt_use_diskthreads="no"
559 AC_MSG_NOTICE([Native pthreads support manually disabled.])
560 squid_opt_use_diskthreads="no"
562 if test "$squid_opt_use_diskthreads" = "yes" ; then
563 AC_DEFINE(USE_DISKIO_DISKTHREADS, 1, [Whether pthreads support is needed. Automatic])
564 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
565 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
566 DISK_OS_LIBS="$DISK_OS_LIBS $LIBPTHREADS"
567 DISK_MODULES="$DISK_MODULES DiskThreads"
568 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
570 AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic])
571 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
572 SQUID_STATE_ROLLBACK([diskthreads_state])
577 dnl Check for POSIX AIO availability
578 squid_opt_use_aio="yes"
580 if test "$with_aio" != "no"; then
582 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
583 dnl On some systems POSIX AIO functions are in librt
584 dnl On some systems POSIX AIO functions are in libaio
585 AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
586 dnl Enable AIO if the library and headers are found
587 if test "$AIOLIB" != "" && test "$have_aio_header" = "yes"; then
588 AC_MSG_NOTICE([Native POSIX AIO support detected.])
589 squid_opt_use_aio="yes"
591 dnl Windows does things differently. We provide wrappers.
592 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
595 squid_opt_use_aio="yes"
596 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
599 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
600 squid_opt_use_aio="no"
605 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
606 squid_opt_use_aio="no"
608 dnl Use the POSIX AIO pieces if we actually need them.
609 if test "$squid_opt_use_aio" = "yes" ; then
610 AC_DEFINE(USE_DISKIO_AIO, 1, [Whether POSIX AIO support is needed. Automatic])
611 DISK_MODULES="$DISK_MODULES AIO"
612 DISK_LIBS="$DISK_LIBS libAIO.a"
613 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
617 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
620 AC_MSG_NOTICE([Enabling AIO DiskIO module])
621 DISK_OS_LIBS="$DISK_OS_LIBS $AIOLIB"
625 AC_DEFINE(USE_DISKIO_AIO, 0, [Whether POSIX AIO support is needed. Automatic])
626 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
631 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
632 DISK_LIBS="$DISK_LIBS libBlocking.a"
633 DISK_MODULES="$DISK_MODULES Blocking"
634 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
638 AC_MSG_NOTICE([Enabling $module DiskIO module])
639 DISK_LIBS="$DISK_LIBS lib${module}.a"
640 DISK_MODULES="$DISK_MODULES ${module}"
641 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
645 AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
646 AC_SUBST(DISK_MODULES)
648 AC_SUBST(DISK_PROGRAMS)
649 AC_SUBST(DISK_LINKOBJS)
650 AC_SUBST(DISK_OS_LIBS)
651 AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
652 AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
655 dnl Check what Storage formats are wanted.
656 dnl This version will error out with a message saying why if a required DiskIO is missing.
657 squid_opt_enable_storeio=auto
658 AC_ARG_ENABLE([storeio],
659 AS_HELP_STRING([--enable-storeio="list of modules"],
660 [Build support for the list of store I/O modules.
661 The default is only to build the "ufs" module.
662 See src/fs for a list of available modules, or
663 Programmers Guide section <not yet written>
664 for details on how to build your custom store module]),
667 squid_opt_enable_storeio=auto
670 squid_opt_enable_storeio=no
673 squid_opt_enable_storeio=yes
674 squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
675 # ufs is really always needed as it has low-level routines
676 # if it is a dupe it will be cleaned-up later
677 squid_storeio_module_candidates="$squid_storeio_module_candidates ufs"
681 if test "$squid_opt_enable_storeio" = "auto"; then
682 squid_opt_enable_storeio=yes
683 AC_MSG_CHECKING([for available StoreIO modules])
684 SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
686 squid_storeio_module_candidates=`echo $squid_storeio_module_candidates|sed 's/coss//'`
687 AC_MSG_RESULT([$squid_storeio_module_candidates])
690 SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates])
691 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
692 AC_MSG_NOTICE([Store modules built: $squid_storeio_module_candidates])
694 for fs in $squid_storeio_module_candidates none; do
697 if test "$squid_disk_module_candidates_Blocking" != "yes" -a \
698 "$squid_disk_module_candidates_DiskDaemon" != "yes" ; then
699 AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon])
703 if test "$squid_disk_module_candidates_Blocking" != "yes" -a \
704 "$squid_disk_module_candidates_DiskThreads" != "yes" ; then
705 AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads])
709 AC_MSG_WARN([COSS Support is not stable yet in Squid-3. Please do not use.
\a])
710 if ! test "$squid_disk_module_candidates_AIO" = "yes"; then
711 AC_MSG_ERROR([COSS requires POSIX AIO which is not available.])
714 dnl Automake om MinGW needs explicit exe extension
715 dnl for STORE_TESTS substition
717 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
720 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
724 dnl hack: need to define those even if not used in the build system to
725 dnl make sure that global FS objects are linked to the squid binary.
726 AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
727 AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
728 AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
729 AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build")
732 dnl got final squid_storeio_module_candidates, build library lists
733 dnl This list will not be needed when each fs library has its own Makefile
735 dnl File system libraries to link executables with.
736 dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
738 for fs in $squid_storeio_module_candidates; do
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"
741 SQUID_TOUPPER_VAR_CONTENTS([fs])
742 AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1)
745 AC_SUBST(STORE_LIBS_TO_BUILD)
746 AC_SUBST(STORE_LIBS_TO_ADD)
747 AC_SUBST(STORE_TESTS)
750 dnl At lest one removal policy is always needed.
751 dnl 'lru' removal policy is currently hard-coded by name for tests
752 dnl so we must set it as default.
754 AC_ARG_ENABLE(removal-policies,
755 AS_HELP_STRING([--enable-removal-policies="list of policies"],
756 [Build support for the list of removal policies.
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]),
763 SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES])
768 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
772 if test -n "$REPL_POLICIES"; then
773 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES])
774 AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES])
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'`"
778 AC_SUBST(REPL_POLICIES)
782 AM_CONDITIONAL(ENABLE_PINGER, false)
784 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
785 [ if test "$enableval" = "yes" ; then
786 AC_MSG_NOTICE([ICMP enabled])
787 AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)])
788 AM_CONDITIONAL(ENABLE_PINGER, true)
792 AM_CONDITIONAL(USE_DELAY_POOLS, false)
793 AC_ARG_ENABLE(delay-pools,
794 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
795 [ if test "$enableval" = "yes" ; then
796 AC_MSG_NOTICE([Delay pools enabled])
797 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
798 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
802 dnl disable generic/common adaptation support by default
803 squid_opt_use_adaptation=no
805 squid_opt_use_esi=yes
806 AH_TEMPLATE([USE_SQUID_ESI],
807 [Define to enable the ESI processor and Surrogate header support])
809 AS_HELP_STRING([--enable-esi],
810 [Enable ESI for accelerators. Benefits from expat or libxml2.
811 Enabling ESI will cause squid reverse proxies to be capable
812 of the Edge Acceleration Specification (www.esi.org).]),
813 [squid_opt_use_esi=$enableval], [squid_opt_use_esi=no])
818 if test "$squid_opt_use_esi" = "yes" ; then
819 AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.])
820 AC_DEFINE(USE_SQUID_ESI,1,
821 [Compile the ESI processor and Surrogate header support])
823 AC_MSG_NOTICE([Disabling ESI processor])
826 # ESI support libraries: expat
827 AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect]))
828 if test "$squid_opt_use_esi" = "yes" -a "$with_expat" != "no" ; then
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.])
837 AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
838 if test "$squid_opt_use_esi" = "yes" -a "$with_libxml2" != "no" ; then
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"
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"
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.])
860 AM_CONDITIONAL(USE_ESI, test "$squid_opt_use_esi" = "yes")
861 AM_CONDITIONAL(HAVE_LIBEXPAT, test $HAVE_LIBEXPAT = 1)
863 AM_CONDITIONAL(HAVE_LIBXML2, test $HAVE_LIBXML2 = 1)
866 # icap argument handling
867 AC_ARG_ENABLE(icap-client,
868 AS_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
869 [squid_opt_use_icap_client=$enableval], [squid_opt_use_icap_client=no])
870 SQUID_DEFINE_BOOL(ICAP_CLIENT,$squid_opt_use_icap_client,
871 [Enable ICAP client features in Squid])
872 AM_CONDITIONAL(USE_ICAP_CLIENT, [test "$squid_opt_use_icap_client" = "yes" ])
873 if test "$squid_opt_use_icap_client" = "yes" ; then
874 ICAP_LIBS="icap/libicap.la"
875 squid_opt_use_adaptation=yes
882 AC_MSG_CHECKING(whether to support eCAP)
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) ;;
889 AC_MSG_RESULT([$squid_opt_use_ecap, explicitly])
891 squid_opt_use_ecap=no;
892 AC_MSG_RESULT([$squid_opt_use_ecap, implicitly])
896 dnl Perform configuration consistency checks for eCAP
898 if test $squid_opt_use_ecap = yes;
900 dnl eCAP support requires loadable modules, which are enabled by default
901 if test "$use_loadable_modules" != "yes"
903 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
906 dnl eCAP support requires libecap
907 AC_CHECK_LIB([ecap], [main],
909 [AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])]
913 AM_CONDITIONAL(USE_ECAP, test $squid_opt_use_ecap = yes)
914 if test $squid_opt_use_ecap = yes;
916 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
917 ECAP_LIBS="ecap/libecap.la $ECAP_LIBS"
918 squid_opt_use_adaptation=yes
920 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
923 dnl convenience library
929 dnl enable adaptation if requested by specific adaptation mechanisms
930 AM_CONDITIONAL(USE_ADAPTATION, test $squid_opt_use_adaptation = yes)
931 if test $squid_opt_use_adaptation = yes
933 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
934 ADAPTATION_LIBS="adaptation/libadaptation.la"
936 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
939 AC_SUBST(ADAPTATION_LIBS)
942 dnl This is a developer only option. Developers know how to set defines
944 dnl AC_ARG_ENABLE(mem-gen-trace,
945 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
946 dnl [ if test "$enableval" = "yes" ; then
947 dnl AC_MSG_NOTICE([Memory trace (to file) enabled])
948 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
953 AC_ARG_ENABLE(useragent-log,
954 AS_HELP_STRING([--enable-useragent-log],
955 [Enable logging of User-Agent header]), [
956 SQUID_YESNO([$enableval],
957 [unrecognized argument to --enable-useragent-log: $enableval])
958 enable_useragent_log=$enableval
960 SQUID_DEFINE_BOOL(USE_USERAGENT_LOG,${enable_useragent_log:=no},
961 [If you want to log User-Agent request header values, define this.])
962 AC_MSG_NOTICE([User-Agent logging enabled: $enable_useragent_log])
964 AC_ARG_ENABLE(referer-log,
965 AS_HELP_STRING([--enable-referer-log],[Enable logging of Referer header]), [
966 SQUID_YESNO([$enableval],
967 [unrecognized argument to --enable-referer-log: $enableval])
969 SQUID_DEFINE_BOOL(USE_REFERER_LOG,${enable_referer_log:=no},
970 [If you want to log Referer request header values, define this.
971 By default, they are written to referer.log in the Squid logdir.
972 This feature is deprecated in favour of custom log formats])
973 AC_MSG_NOTICE([Referer logging enabled: $enable_referer_log])
976 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [
977 SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccp: $enableval])
979 SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP])
980 AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp])
982 AC_ARG_ENABLE(wccpv2,
983 AS_HELP_STRING([--disable-wccpv2],
984 [Disable Web Cache Coordination V2 Protocol]), [
985 SQUID_YESNO([$enableval],
986 [unrecognized argument to --disable-wccpv2: $enableval])
988 SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes},
989 [Define to enable WCCP V2])
990 AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2])
992 AC_ARG_ENABLE(kill-parent-hack,
993 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [
994 SQUID_YESNO([$enableval],
995 [unrecognized argument to --enable-kill-parent-hack: $enableval])
997 SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no},
998 [A dangerous feature which causes Squid to kill its parent
999 process (presumably the RunCache script) upon receipt
1000 of SIGTERM or SIGINT. Deprecated, Use with caution.])
1001 AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack])
1004 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
1005 SQUID_YESNO([$enableval],
1006 [unrecognized argument to --disable-snmp: $enableval])
1008 SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes},
1009 [Define to enable SNMP monitoring of Squid])
1010 AM_CONDITIONAL(USE_SNMP, [test "$enable_snmp" = "yes"])
1011 if test "$enable_snmp" = "yes"; then
1012 SNMPLIB='../snmplib/libsnmp.a'
1015 AC_MSG_NOTICE([SNMP support enabled: $enable_snmp])
1017 AC_SUBST(makesnmplib)
1019 AC_ARG_ENABLE(cachemgr-hostname,
1020 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],
1021 [Make cachemgr.cgi default to this host.
1022 If unspecified, uses the name of the build-host]), [
1025 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1026 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1027 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1033 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1034 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1040 AS_HELP_STRING([--disable-eui],
1041 [Enable use of ARP / MAC/ EUI (ether address)]), [
1042 SQUID_YESNO([$enableval],[--disable-eui expects no arguments])
1044 if test ${enable_eui:=yes} = "yes" ; then
1045 case "$squid_host_os" in
1046 linux|solaris|freebsd|openbsd|netbsd)
1053 AC_MSG_WARN([EUI support probably will not work on host $host.])
1062 netinet/if_ether.h \
1068 AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui])
1069 SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui,
1070 [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.])
1071 AM_CONDITIONAL(USE_SQUID_EUI, [test "$enable_eui" = "yes" ])
1075 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [
1076 SQUID_YESNO([$enableval],
1077 [unrecognized argument to --disable-htcp: $enableval])
1079 SQUID_DEFINE_BOOL(USE_HTCP,${enable_htcp:=yes},
1080 [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1081 AM_CONDITIONAL(ENABLE_HTCP, [test "$enable_htcp" = "yes"])
1082 AC_MSG_NOTICE([HTCP support enabled: $enable_htcp])
1085 # SSL is not enabled by default.
1086 # Default is to use OpenSSL when available
1088 AS_HELP_STRING([--enable-ssl],
1089 [Enable ssl gatewaying support using OpenSSL]), [
1090 SQUID_YESNO([$enableval],
1091 [unrecognized argument to --enable-ssl: $enableval])
1093 # USE_OPENSSL is AC_DEFINED later
1094 # default for ssl is set here
1095 if test ${enable_ssl:=no} = "yes" ; then
1096 if test "$squid_host_os" = "mingw" ; then
1097 SSLLIB='-lssleay32 -leay32 -lgdi32'
1099 SSLLIB='-lssl -lcrypto'
1101 if test -z "$with_openssl"; then
1104 if test -z "$with_openssl"; then
1108 AM_CONDITIONAL(ENABLE_SSL,[ test $enable_ssl = "yes" ])
1109 AC_MSG_NOTICE([SSL gatewaying support enabled: $enable_ssl])
1111 dnl User may specify OpenSSL is needed from a non-standard location
1112 AC_ARG_WITH(openssl,
1113 AS_HELP_STRING([--with-openssl=PATH],
1114 [Compile with the OpenSSL libraries. The path to
1115 the OpenSSL development libraries and headers
1116 installation can be specified if outside of the
1117 system standard directories]), [
1118 case "$with_openssl" in
1120 : # Nothing special to do here
1123 if test ! -d $withval ; then
1124 AC_MSG_ERROR([--with-openssl path does not point to a directory])
1126 SSLLIBDIR="$with_openssl/lib"
1127 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1131 SQUID_DEFINE_BOOL(USE_SSL,$enable_ssl,
1132 [Define this to include code for SSL gatewaying support])
1133 AC_MSG_NOTICE([Using OpenSSL MD5 implementation: ${with_openssl:=no}])
1134 SQUID_DEFINE_BOOL(USE_OPENSSL,${with_openssl},
1135 [Define this to make use of the OpenSSL libraries for MD5 calculation rather than Squid-supplied MD5 implementation or if building with SSL encryption])
1136 if test "$enable_ssl" = "yes"; then
1137 if test -z "$SSLLIB"; then
1138 SSLLIB="-lcrypto" # for MD5 routines
1140 # This is a workaround for RedHat 9 brain damage..
1141 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
1142 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1143 SSLLIBDIR="/usr/kerberos/lib"
1144 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1147 if test -n "$SSLLIBDIR"; then
1148 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1153 AC_ARG_ENABLE(forw-via-db,
1154 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [
1155 SQUID_YESNO([$enableval],[unrecognized argument to --enable-forw-via-db: $enableval])
1157 SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no},
1158 [Enable Forw/Via database])
1159 AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db])
1161 AC_ARG_ENABLE(cache-digests,
1162 AS_HELP_STRING([--enable-cache-digests],
1163 [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
1165 SQUID_YESNO($enableval,
1166 [unrecognized argument to --enable-cache-digests: $enableval])
1168 SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no},
1169 [Use Cache Digests for locating objects in neighbor caches.])
1170 AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests])
1173 dnl Size of COSS memory buffer
1174 squid_opt_coss_membuf_size=1048576
1175 AC_ARG_WITH(coss-membuf-size,
1176 AS_HELP_STRING([--with-coss-membuf-size=size],
1177 [COSS membuf size (default $squid_opt_coss_membuf_size bytes)]), [
1179 [[0-9]]*) squid_opt_coss_membuf_size=$withval ;;
1180 *) AC_MSG_ERROR([--with-coss-membuf-size expects a numeric argument]) ;;
1183 AC_MSG_NOTICE([Setting COSS membuf size to $squid_opt_coss_membuf_size bytes])
1184 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $squid_opt_coss_membuf_size,
1185 [Default COSS membuf size])
1187 ################################
1188 # check for netio plugin stuff #
1189 ################################
1190 dnl order of these options handling is relevant in case the user
1191 dnl supplies more than one --enable option. Options handled later
1192 dnl override those handled earlier for io loop method manual override
1193 AC_ARG_ENABLE(select,
1194 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
1196 SQUID_YESNO($enableval,[--disable-select takes no extra argument])
1197 test $enableval = "yes" && squid_opt_io_loop_engine="select"
1199 AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}])
1202 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
1204 SQUID_YESNO($enableval,[--disable-poll takes no extra argument])
1205 test $enableval = "yes" && squid_opt_io_loop_engine="poll"
1207 AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}])
1209 # kqueue support is still experiemntal and unstable. Not enabled by default.
1210 AC_ARG_ENABLE(kqueue,
1211 AS_HELP_STRING([--enable-kqueue],
1212 [Enable kqueue(2) support (experimental).]), [
1213 SQUID_YESNO($enableval,[--enable-kqueue takes no extra argument])
1215 if test ${enable_kqueue:=no} = "yes" ; then
1216 AC_CHECK_HEADERS([sys/event.h],[],
1217 [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ])
1218 squid_opt_io_loop_engine="kqueue"
1220 AC_MSG_NOTICE([enabling kqueue for net I/O: $enable_kqueue])
1223 AC_ARG_ENABLE(epoll,
1224 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
1226 SQUID_YESNO($enableval,[--disable-epoll takes no extra argument])
1227 test $enableval = "yes" && squid_opt_io_loop_engine="epoll"
1229 AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}])
1231 # auto-detect and verify epoll header and library present and working
1232 # logic mapping and loop method selection are performed later
1233 if test "$enable_epoll" != "no" ; then
1235 # check if libs are needed to support epoll
1236 # note: this code block seems quite generic. Could it be extracted
1237 # into a squid specific configure function?
1238 SQUID_STATE_SAVE(squid_epoll_state)
1239 AC_SEARCH_LIBS(epoll_ctl,[epoll])
1240 if test "$ac_cv_search_epoll_ctl" = "no" ; then
1241 enable_epoll=no #disable. Needed code not found
1242 elif test "$ac_cv_search_epoll_ctl" = "none required" ; then
1245 EPOLL_LIBS=$ac_cv_search_epoll_ctl
1247 AC_SUBST(EPOLL_LIBS)
1248 SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS
1250 # epoll requires sys/epoll.h
1251 AC_CHECK_HEADERS([sys/epoll.h])
1253 dnl Verify that epoll really works
1254 if test "x$ac_cv_search_epoll_ctl" != 'xno' ; then
1258 if test "$enable_epoll" = "yes" -a "$squid_cv_epoll_works" = "no" ; then
1259 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
1264 AC_ARG_ENABLE(http-violations,
1265 AS_HELP_STRING([--disable-http-violations],
1266 [This allows you to remove code which is known to
1267 violate the HTTP protocol specification.]), [
1268 SQUID_YESNO([$enableval],
1269 [unrecognized argument to --disable-http-violations: $enableval])
1271 SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes},
1272 [Define to enable code which volates the HTTP standard specification])
1273 AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations])
1275 # IPFW Transparent Proxy
1276 AC_ARG_ENABLE(ipfw-transparent,
1277 AS_HELP_STRING([--enable-ipfw-transparent],
1278 [Enable Transparent Proxy support for systems
1279 using FreeBSD IPFW-style firewalling.]), [
1280 SQUID_YESNO([$enableval],
1281 [unrecognized argument to --enable-ipfw-transparent: $enableval])
1283 SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no},
1284 [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.])
1285 AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent])
1287 # IP-Filter Transparent Proxy
1288 AC_ARG_ENABLE(ipf-transparent,
1289 AS_HELP_STRING([--enable-ipf-transparent],
1290 [Enable Transparent Proxy support using IPFilter-style firewalling]), [
1291 SQUID_YESNO([$enableval],
1292 [unrecognized argument to --enable-ipf-transparent: $enableval])
1294 #will be AC_DEFINEd later, after checking for appropriate infrastructure
1295 #IPF currently broken. Default-disabled for now.
1296 AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}])
1298 dnl Enable PF Transparent Proxy
1299 AC_ARG_ENABLE(pf-transparent,
1300 AS_HELP_STRING([--enable-pf-transparent],
1301 [Enable Transparent Proxy support for systems using PF network address redirection.]), [
1302 SQUID_YESNO([$enableval],
1303 [unrecognized argument to --enable-pf-transparent: $enableval])
1305 #will be AC_DEFINEd later, after checking for appropriate infrastructure
1306 AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=auto}])
1308 # Linux Netfilter Transparent Proxy
1309 AC_ARG_ENABLE(linux-netfilter,
1310 AS_HELP_STRING([--enable-linux-netfilter],
1311 [Enable Transparent Proxy support for Linux (Netfilter)]), [
1312 SQUID_YESNO([$enableval],
1313 [unrecognized argument to --enable-linux-netfilter: $enableval])
1315 AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}])
1316 #will be AC_DEFINEd later, after checking for appropriate infrastructure
1318 dnl Enable Large file support
1320 squid_opt_enable_large_files=no
1322 AC_ARG_WITH(large-files,
1323 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]),
1324 [ if test "x$withval" = "xyes"; then
1325 squid_opt_enable_large_files=yes
1329 dnl UNIX Build environment
1330 dnl AS_HELP_STRING is not suited here because it cannot to specify newlines
1331 AC_ARG_WITH(build-environment,
1332 [ --with-build-environment=model
1333 The build environment to use. Normally one of
1334 POSIX_V6_ILP32_OFF32 32 bits
1335 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1336 POSIX_V6_LP64_OFF64 64 bits
1337 POSIX_V6_LPBIG_OFFBIG large pointers and files
1338 XBS5_ILP32_OFF32 32 bits (legacy)
1339 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1340 XBS5_LP64_OFF64 64 bits (legacy)
1341 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1342 default The default for your OS],
1343 [ case "$withval" in
1345 AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf])
1348 buildmodel="$withval"
1353 if test "$squid_opt_enable_large_files" = "yes" -a -z "$buildmodel"; then
1354 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
1355 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1360 if test -z "$buildmodel"; then
1361 AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
1364 case "$buildmodel" in
1366 if test "$squid_opt_enable_large_files" = "yes" ; then
1367 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
1368 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1369 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1373 AC_MSG_NOTICE([Using $buildmodel build environment])
1374 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1377 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
1379 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1380 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1381 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1382 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1383 if "$squid_host_os" = "solaris" ; then
1385 # On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1386 # for LDFLAGS -xarch=generic64, but:
1387 # "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1388 # For gcc "-xarch=generic64" must be replaced with "-m64"
1389 # The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1390 if test "$GCC" = "yes"; then
1391 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
1392 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1393 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1394 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
1395 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1396 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1397 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1399 AC_MSG_NOTICE([Removing -Usun on $host])
1400 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1401 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1405 dnl Enable Leak Finding Functions
1406 AC_ARG_ENABLE(leakfinder,
1407 AS_HELP_STRING([--enable-leakfinder],
1408 [Enable Leak Finding code. Enabling this alone does nothing;
1409 you also have to modify the source code to use the leak
1410 finding functions. Probably Useful for hackers only.]), [
1411 SQUID_YESNO([$enableval],
1412 [unrecognized argument to --enable-leakfinder: $enableval])
1414 AC_MSG_NOTICE([Leak Finder enabled: ${enable_leakfinder:=no}])
1415 SQUID_DEFINE_BOOL(USE_LEAKFINDER,$enable_leakfinder,
1416 [Enable code for assisting in finding memory leaks. Not for the faint of heart])
1417 AM_CONDITIONAL(MAKE_LEAKFINDER, [test "$enable_leakfinder" = "yes"])
1420 AC_ARG_ENABLE(follow-x-forwarded-for,
1421 AS_HELP_STRING([--enable-follow-x-forwarded-for],
1422 [Enable support for following the X-Forwarded-For
1423 HTTP header to try to find the IP address of the
1424 original or indirect client when a request has
1425 been forwarded through other proxies.]), [
1426 SQUID_YESNO([$enableval],
1427 [unrecognized argument to --enable-follow-x-forwarded-for: $enableval])
1429 AC_MSG_NOTICE([Support for X-Forwarded-For enabled: ${enable_follow_x_forwarded_for:=yes}])
1430 SQUID_DEFINE_BOOL(FOLLOW_X_FORWARDED_FOR,$enable_follow_x_forwarded_for,
1431 [Enable following X-Forwarded-For headers])
1433 AC_ARG_ENABLE(ident-lookups,
1434 AS_HELP_STRING([--disable-ident-lookups],
1435 [Remove code that supports performing Ident (RFC 931) lookups.]), [
1436 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ident-lookups: $enableval])
1438 AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}])
1439 SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups])
1441 squid_opt_use_dnsserver="no"
1442 AH_TEMPLATE(USE_DNSSERVERS,
1443 [Use dnsserver processes instead of the internal DNS protocol support])
1444 AC_ARG_ENABLE(internal-dns,
1445 AS_HELP_STRING([--disable-internal-dns],
1446 [Prevents Squid from directly sending and receiving DNS messages,
1447 and instead enables the old external 'dnsserver' processes.]), [
1448 if test "$enableval" = "no" ; then
1449 AC_MSG_WARN([Disabling Internal DNS queries])
1450 squid_opt_use_dnsserver="yes"
1451 AC_DEFINE(USE_DNSSERVERS,1)
1453 AC_DEFINE(USE_DNSSERVERS,0)
1456 AM_CONDITIONAL([USE_DNSSERVER],[test "$squid_opt_use_dnsserver" = "yes" ])
1459 dnl Select Default hosts file location
1460 AC_ARG_ENABLE(default-hostsfile,
1461 AS_HELP_STRING([--enable-default-hostsfile=path],
1462 [Select default location for hosts file.
1463 See hosts_file directive in squid.conf for details]),
1465 if test "$enableval" != "none" -a "$enableval" != "no" ; then
1466 if test -f $enableval; then
1467 OPT_DEFAULT_HOSTS=$enableval
1469 AC_MSG_WARN([Unable to find $enableval])
1472 OPT_DEFAULT_HOSTS="none"
1474 AC_MSG_NOTICE([Default hosts file set to: $enableval])
1475 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1476 AC_SUBST(OPT_DEFAULT_HOSTS)
1478 # Select auth schemes modules to build
1480 AS_HELP_STRING([--enable-auth],
1481 [Build global support for authentication. The list of schemes
1482 and helpers to be enabled is defined elsewhere]), [
1483 SQUID_YESNO([$enableval],
1484 [unrecognized argument to --enable-auth: $enableval])
1486 AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}])
1487 SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,
1488 [Enable support for authentication])
1491 AC_ARG_ENABLE(auth-basic,
1492 AS_HELP_STRING([--enable-auth-basic="list of helpers"],
1493 [Enable the basic authentication scheme, and build the specified helpers.
1494 Not providing an explicit list of helpers will attempt build of
1495 all possible helpers. Default is to do so.
1496 To disable the basic authentication scheme, use --disable-auth-basic.
1497 To enable but build no helpers, specify "none".
1498 To see available helpers, see the helpers/basic_auth directory. ]),[
1499 #nothing to do really
1501 #not specified. Inherit global
1502 if test "x$enable_auth_basic" = "x"; then
1503 enable_auth_basic=$enable_auth
1505 #conflicts with global
1506 if test "$enable_auth_basic" != "no" -a "$enable_auth" = "no" ; then
1507 AC_MSG_ERROR([Basic auth requested but auth disabled])
1509 #define list of modules to build
1510 if test "$enable_auth_basic" = "yes" ; then
1511 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/basic_auth],[enable_auth_basic])
1513 #handle the "none" special case
1514 if test "x$enable_auth_basic" = "xnone" ; then
1515 enable_auth_basic=""
1517 BASIC_AUTH_HELPERS=""
1518 #enable_auth_basic contains either "no" or the list of modules to be built
1519 enable_auth_basic="`echo $enable_auth_basic| sed -e 's/,/ /g;s/ */ /g'`"
1520 if test "$enable_auth_basic" != "no" ; then
1521 AUTH_MODULES="$AUTH_MODULES basic"
1522 AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built])
1523 for helper in $enable_auth_basic
1525 dir="$srcdir/helpers/basic_auth/$helper"
1526 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1527 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1529 if test "$helper" = "SASL" ; then
1530 squid_require_sasl=yes
1532 elif test -d $srcdir/helpers/basic_auth/$helper ; then
1533 AC_MSG_NOTICE([Basic auth helper $helper ... found but cannot be built])
1537 AC_MSG_NOTICE([Basic auth helpers to be built: $BASIC_AUTH_HELPERS])
1538 AM_CONDITIONAL(ENABLE_AUTH_BASIC, test "$enable_auth_basic" != "no")
1539 AC_SUBST(BASIC_AUTH_HELPERS)
1541 AC_ARG_ENABLE(auth-ntlm,
1542 AS_HELP_STRING([--enable-auth-ntlm="list of helpers"],
1543 [Enable the NTLM authentication scheme, and build the specified helpers.
1544 Not providing an explicit list of helpers will attempt build of
1545 all possible helpers. Default is to do so.
1546 To disable the NTLM authentication scheme, use --disable-auth-ntlm.
1547 To enable but build no helpers, specify "none".
1548 To see available helpers, see the helpers/ntlm_auth directory. ]),[
1550 if test "x$enable_auth_ntlm" = "x"; then
1551 enable_auth_ntlm=$enable_auth
1553 #conflicts with global
1554 if test "x$enable_auth_ntlm" != "xno" -a "x$enable_auth" = "xno" ; then
1555 AC_MSG_ERROR([NTLM auth requested but auth disabled])
1557 #define list of modules to build
1558 if test "x$enable_auth_ntlm" = "xyes" ; then
1559 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/ntlm_auth],[enable_auth_ntlm])
1561 #handle the "none" special case
1562 if test "x$enable_auth_ntlm" = "xnone" ; then
1565 NTLM_AUTH_HELPERS=""
1566 enable_auth_ntlm="`echo $enable_auth_ntlm| sed -e 's/,/ /g;s/ */ /g'`"
1567 if test "$enable_auth_ntlm" != "no" ; then
1568 AUTH_MODULES="$AUTH_MODULES ntlm"
1569 AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
1570 for helper in $enable_auth_ntlm ; do
1571 dir="$srcdir/helpers/ntlm_auth/$helper"
1572 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1573 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1574 elif test -d $srcdir/helpers/ntlm_auth/$helper ; then
1575 AC_MSG_NOTICE([NTLM auth helper $helper ... found but cannot be built])
1579 AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS])
1580 AM_CONDITIONAL(ENABLE_AUTH_NTLM, test "$enable_auth_ntlm" != "no")
1581 AC_SUBST(NTLM_AUTH_HELPERS)
1583 AC_ARG_ENABLE(auth-negotiate,
1584 AS_HELP_STRING([--enable-auth-negotiate="list of helpers"],
1585 [Enable the Negotiate authentication scheme, and build the specified
1587 Not providing an explicit list of helpers will attempt build of
1588 all possible helpers. Default is to do so.
1589 To disable the Negotiate authentication scheme,
1590 use --disable-auth-negotiate.
1591 To enable but build no helpers, specify "none".
1592 To see available helpers, see the helpers/negotiate_auth directory. ]),[
1593 #nothing to do, really
1595 if test "x$enable_auth_negotiate" = "x"; then
1596 enable_auth_negotiate=$enable_auth
1598 #conflicts with global
1599 if test "x$enable_auth_negotiate" != "xno" -a "x$enable_auth" = "xno" ; then
1600 AC_MSG_ERROR([Negotiate auth requested but auth disabled])
1602 #define list of modules to build
1603 if test "x$enable_auth_negotiate" = "xyes" ; then
1604 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/negotiate_auth],[enable_auth_negotiate])
1606 #handle the "none" special case
1607 if test "x$enable_auth_negotiate" = "xnone" ; then
1608 enable_auth_negotiate=""
1610 NEGOTIATE_AUTH_HELPERS=""
1611 enable_auth_negotiate="`echo $enable_auth_negotiate| sed -e 's/,/ /g;s/ */ /g'`"
1612 if test "$enable_auth_negotiate" != "no" ; then
1613 AUTH_MODULES="$AUTH_MODULES negotiate"
1614 AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built])
1615 for helper in $enable_auth_negotiate ; do
1616 dir="$srcdir/helpers/negotiate_auth/$helper"
1617 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1618 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1619 elif test -d $srcdir/helpers/negotiate_auth/$helper ; then
1620 AC_MSG_NOTICE([Negotiate auth helper $helper ... found but cannot be built])
1624 AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS])
1625 AM_CONDITIONAL(ENABLE_AUTH_NEGOTIATE, test "$enable_auth_negotiate" != "no")
1626 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1628 AC_ARG_ENABLE(auth-digest,
1629 AS_HELP_STRING([--enable-auth-digest="list of helpers"],
1630 [Enable the Digest authentication scheme, and build the specified helpers.
1631 Not providing an explicit list of helpers will attempt build of
1632 all possible helpers. Default is to do so.
1633 To disable the Digest authentication scheme, use --disable-auth-digest.
1634 To enable but build no helpers, specify "none".
1635 To see available helpers, see the helpers/digest_auth directory. ]),[
1636 #nothing to do, really
1638 if test "x$enable_auth_digest" = "x"; then
1639 enable_auth_digest=$enable_auth
1641 #conflicts with global
1642 if test "x$enable_auth_digest" != "xno" -a "x$enable_auth" = "xno" ; then
1643 AC_MSG_ERROR([Digest auth requested but auth disabled])
1645 #define list of modules to build
1646 if test "x$enable_auth_digest" = "xyes" ; then
1647 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/digest_auth],[enable_auth_digest])
1649 #handle the "none" special case
1650 if test "x$enable_auth_digest" = "xnone" ; then
1651 enable_auth_digest=""
1653 DIGEST_AUTH_HELPERS=""
1654 enable_auth_digest="`echo $enable_auth_digest| sed -e 's/,/ /g;s/ */ /g'`"
1655 if test "$enable_auth_digest" != "no" ; then
1656 AUTH_MODULES="$AUTH_MODULES digest"
1657 AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built])
1658 for helper in $enable_auth_digest ; do
1659 dir="$srcdir/helpers/digest_auth/$helper"
1660 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1661 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1662 elif test -d $srcdir/helpers/digest_auth/$helper ; then
1663 AC_MSG_NOTICE([Digest auth helper $helper ... found but cannot be built])
1667 AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
1668 AM_CONDITIONAL(ENABLE_AUTH_DIGEST, test "$enable_auth_digest" != "no")
1669 AC_SUBST(DIGEST_AUTH_HELPERS)
1671 dnl Authentication libraries to build
1672 dnl This list will not be needed when each auth library has its own Makefile
1673 dnl this is to be placed AFTER each auth module's handler
1675 for module in $AUTH_MODULES; do
1676 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD lib${module}.la"
1678 AC_SUBST(AUTH_MODULES)
1679 AC_SUBST(AUTH_LIBS_TO_BUILD)
1681 dnl Select logging daemon helpers to build
1682 squid_opt_logdaemon_helpers="auto"
1683 AC_ARG_ENABLE(log-daemon-helpers,
1684 AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"],
1685 [This option selects which logging daemon helpers to
1686 build and install as part of the normal build process
1687 For a list of available helpers see the helpers/log_daemon
1689 case "$enableval" in
1691 no) squid_opt_logdaemon_helpers="" ;;
1692 *) squid_opt_logdaemon_helpers="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;;
1695 if test "$squid_opt_logdaemon_helpers" = "auto" ; then
1696 squid_opt_logdaemon_helpers=""
1697 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/log_daemon],[squid_opt_logdaemon_helpers])
1699 for helper in $squid_opt_logdaemon_helpers ; do
1700 dir="$srcdir/helpers/log_daemon/$helper"
1701 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1702 LOG_DAEMON_HELPERS="$LOG_DAEMON_HELPERS $helper"
1703 elif test -d $srcdir/helpers/log_daemon/$helper ; then
1704 AC_MSG_NOTICE([Log daemon helper $helper ... found but cannot be built])
1707 AC_MSG_NOTICE([Log daemon helpers built: $LOG_DAEMON_HELPERS])
1708 AC_SUBST(LOG_DAEMON_HELPERS)
1711 dnl Check Kerberos/GSSAPI/SPNEGO
1713 SQUID_STATE_SAVE([krbsave])
1715 AC_ARG_WITH(krb5-config,
1716 [ --with-krb5-config=PATH specify path to krb5-config @<:@default=detect@:>@],
1719 yes) unset krb5confpath ;;
1720 no) krb5confpath=no ;;
1721 *) krb5confpath=$withval ;;
1724 if test x"$krb5confpath" != xno; then
1725 if test x"$krb5confpath" != x; then
1726 if ! test -x "$krb5confpath"; then
1727 AC_MSG_WARN([krb5-config '$krb5confpath' not executable, ignoring])
1728 AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no)
1729 krb5confpath=krb5-config
1731 krb5_config_path=`dirname $krb5confpath`
1732 AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no, $krb5_config_path)
1734 AC_CHECK_PROG(ac_krb5_config,krb5-config,yes,no)
1735 krb5confpath=krb5-config
1738 if test "$ac_krb5_config" = "yes" ; then
1739 ac_heimdal="`$krb5confpath --version 2>/dev/null | grep -i heimdal`"
1740 ac_solaris="`$krb5confpath --version 2>/dev/null | grep -i solaris`"
1741 if test "x$ac_heimdal" != "x" ; then
1742 AC_DEFINE(HAVE_HEIMDAL_KERBEROS,1,[Define to 1 if you have Heimdal Kerberos])
1744 AC_DEFINE(HAVE_MIT_KERBEROS,1,[Define to 1 if you have MIT Kerberos])
1746 if test "$ac_solaris" != "" ; then
1747 KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`"
1748 KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`"
1749 KRB5INCS="-I/usr/include/gssapi $KRB5INCS"
1750 KRB5LIBS="-L/usr/lib -R/usr/lib -lgss -lresolv -lsocket -lnsl $KRB5LIBS"
1752 KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`"
1753 KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`"
1754 KRB5INCS="`$krb5confpath --cflags gssapi 2>/dev/null` $KRB5INCS"
1755 KRB5LIBS="`$krb5confpath --libs gssapi 2>/dev/null` $KRB5LIBS"
1757 CPPFLAGS="$CPPFLAGS $KRB5INCS"
1758 LIBS="$LIBS $KRB5LIBS"
1759 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1760 if test "x$ac_heimdal" == "x" ; then
1761 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
1762 AC_CHECK_HEADERS(profile.h)
1764 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1766 SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
1767 if test x"$squid_cv_broken_krb5_h" = x"yes"; then
1768 AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if krb5.h is broken for C++])
1771 ac_com_error_message=no
1772 if test "x$ac_cv_header_com_err_h" == "xyes" ; then
1773 AC_EGREP_HEADER(error_message,com_err.h,ac_com_error_message=yes)
1774 elif test "x$ac_cv_header_et_com_err_h" == "xyes" ; then
1775 AC_EGREP_HEADER(error_message,et/com_err.h,ac_com_error_message=yes)
1778 SQUID_CHECK_MAX_SKEW_IN_KRB5_CONTEXT
1779 if test x"$squid_cv_max_skew_context" = x"yes"; then
1780 AC_DEFINE(HAVE_MAX_SKEW_IN_KRB5_CONTEXT, 1, [Define to 1 if max_skew in struct krb5_context])
1783 if test `echo $KRB5LIBS | grep -c com_err` -ne 0 -a "x$ac_com_error_message" == "xyes" ; then
1784 AC_CHECK_LIB(com_err,error_message,
1785 AC_DEFINE(HAVE_ERROR_MESSAGE,1,
1786 [Define to 1 if you have error_message]),)
1787 elif test "x$ac_com_error_message" == "xyes" ; then
1788 AC_CHECK_LIB(krb5,error_message,
1789 AC_DEFINE(HAVE_ERROR_MESSAGE,1,
1790 [Define to 1 if you have error_message]),)
1792 AC_CHECK_LIB(krb5,krb5_get_err_text,
1793 AC_DEFINE(HAVE_KRB5_GET_ERR_TEXT,1,
1794 [Define to 1 if you have krb5_get_err_text]),)
1795 AC_CHECK_LIB(krb5,krb5_get_error_message,
1796 AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE,1,
1797 [Define to 1 if you have krb5_get_error_message]),)
1798 AC_CHECK_LIB(krb5,krb5_kt_free_entry,
1799 AC_DEFINE(HAVE_KRB5_KT_FREE_ENTRY,1,
1800 [Define to 1 if you have krb5_kt_free_entry]),)
1801 AC_CHECK_LIB(krb5,krb5_get_init_creds_keytab,
1802 AC_DEFINE(HAVE_GET_INIT_CREDS_KEYTAB,1,
1803 [Define to 1 if you have krb5_get_init_creds_keytab]),)
1804 AC_CHECK_LIB(krb5,krb5_get_max_time_skew,
1805 AC_DEFINE(HAVE_KRB5_GET_MAX_TIME_SKEW,1,
1806 [Define to 1 if you have krb5_get_max_time_skew]),)
1807 AC_CHECK_LIB(krb5,krb5_get_profile,
1808 AC_DEFINE(HAVE_KRB5_GET_PROFILE,1,
1809 [Define to 1 if you have krb5_get_profile]),)
1810 AC_CHECK_LIB(krb5,profile_get_integer,
1811 AC_DEFINE(HAVE_PROFILE_GET_INTEGER,1,
1812 [Define to 1 if you have profile_get_integer]),)
1813 AC_CHECK_LIB(krb5,profile_release,
1814 AC_DEFINE(HAVE_PROFILE_RELEASE,1,
1815 [Define to 1 if you have profile_release]),)
1817 SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE
1818 if test "$squid_cv_memory_cache" = "yes" ; then
1819 AC_DEFINE(HAVE_KRB5_MEMORY_CACHE,1, [Define to 1 if you have MEMORY: cache support])
1822 SQUID_CHECK_WORKING_GSSAPI
1823 if test "$squid_cv_working_gssapi" = "yes" ; then
1824 AC_DEFINE(HAVE_GSSAPI, 1, [GSSAPI support])
1827 SQUID_CHECK_SPNEGO_SUPPORT
1828 if test "$squid_cv_have_spnego" = "yes" ; then
1829 AC_DEFINE(HAVE_SPNEGO,1, [Define to 1 if you have SPNEGO support])
1832 SQUID_CHECK_WORKING_KRB5
1833 if test "$squid_cv_working_krb5" = "yes" ; then
1834 AC_DEFINE(HAVE_KRB5, 1, [KRB5 support])
1840 SQUID_STATE_ROLLBACK([krbsave])
1841 AM_CONDITIONAL(HAVE_SPNEGO, test x"$squid_cv_have_spnego" = x"yes" )
1843 dnl Enable "NTLM fail open"
1844 AC_ARG_ENABLE(ntlm-fail-open,
1845 AS_HELP_STRING([--enable-ntlm-fail-open],
1846 [Enable NTLM fail open, where a helper that fails one of the
1847 Authentication steps can allow squid to still authenticate
1848 the user. This has security implications, and is deprecated]),
1850 SQUID_YESNO([$enableval],[--enable-ntlm-fail-open takes no argument])
1852 SQUID_DEFINE_BOOL(NTLM_FAIL_OPEN,${enable_ntlm_fail_open:=no},
1853 [Define if NTLM is allowed to fail gracefully when a helper has problems.])
1854 AC_MSG_NOTICE([ntlm-fail-open enabled: $enable_ntlm_fail_open])
1856 AC_ARG_ENABLE(external-acl-helpers,
1857 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
1858 [Enable external_acl helpers support and thelpers themselves.
1859 Default is to build all buildable helpers and enable support.
1860 To disable support, use --disable-external-acl-helpers.
1861 To build no helpers, specify "none".
1862 To see available helpers, see the helpers/external_acl
1864 #nothing to do, really
1866 if test "x${enable_external_acl_helpers:=yes}" = "xyes" ;then
1867 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/external_acl],
1868 [enable_external_acl_helpers])
1870 if test "x$enable_external_acl_helpers" = "xnone" ; then
1871 enable_external_acl_helpers=""
1873 EXTERNAL_ACL_HELPERS=""
1874 enable_external_acl_helpers="`echo $enable_external_acl_helpers| sed -e 's/,/ /g;s/ */ /g'`"
1875 if test "x$enable_external_acl_helpers" != "xno" ; then
1876 for helper in $enable_external_acl_helpers ; do
1877 dir="$srcdir/helpers/external_acl/$helper"
1878 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1879 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1881 AC_MSG_NOTICE([external acl helper $helper ... found but cannot be built])
1885 AC_MSG_NOTICE([External acl helpers built: $EXTERNAL_ACL_HELPERS])
1886 AC_SUBST(EXTERNAL_ACL_HELPERS)
1890 dnl Select url_rewrite helpers to build
1891 AC_ARG_ENABLE(url-rewrite-helpers,
1892 AC_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
1893 [This option selects which url_rewrite helpers to
1894 build and install as part of the normal build
1895 process. The default is to attempt the build of all possible
1896 helpers. Use --disable-url-rewrite-helpers to build none.
1897 For a list of available helpers see the
1898 helpers/url_rewrite directory.]),[
1900 if test "x${enable_url_rewrite_helpers:=yes}" = "xyes" ; then
1901 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/url_rewrite],
1902 [enable_url_rewrite_helpers])
1904 enable_url_rewrite_helpers="`echo $enable_url_rewrite_helpers| sed -e 's/,/ /g;s/ */ /g'`"
1905 AC_MSG_NOTICE([URL rewrite helper candidates: $enable_url_rewrite_helpers])
1906 URL_REWRITE_HELPERS=""
1907 if test "x$enable_url_rewrite_helpers" != "xno" ; then
1908 for helper in $enable_url_rewrite_helpers; do
1909 dir="$srcdir/helpers/url_rewrite/$helper"
1910 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1911 URL_REWRITE_HELPERS="$URL_REWRITE_HELPERS $helper"
1912 elif test -d $srcdir/helpers/ntlm_auth/$helper ; then
1913 AC_MSG_NOTICE([URL rewrite helper $helper ... found but cannot be built])
1915 AC_MSG_NOTICE([URL rewrite helper $helper ... not found])
1919 AC_MSG_NOTICE([URL rewrite helpers built: $URL_REWRITE_HELPERS])
1920 AC_SUBST(URL_REWRITE_HELPERS)
1923 AC_ARG_WITH(valgrind-debug,
1924 AS_HELP_STRING([--with-valgrind-debug],
1925 [Include debug instrumentation for use with valgrind]),
1927 SQUID_YESNO([$withval],
1928 [unrecognized argument to --with-valgrind-debug: $withval])
1929 if test $withval != "no" ; then
1930 AC_CHECK_HEADERS(valgrind/memcheck.h,[],[
1931 AC_MSG_ERROR([Valgrind support requested, needed headers not found.])
1935 SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no},
1936 [Valgrind memory debugger support])
1937 AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug])
1939 dnl Disable "memPools" code
1940 #AC_ARG_ENABLE(chunkedmempools,
1941 # AS_HELP_STRING([--enable-chunkedmempools],
1942 # [Enable experimental chunked memPools. Note that this option
1943 # simply sets the default behaviour. Specific classes can override this
1944 # at runtime, and only lib/MemPool.c needs to be altered
1945 # to change the squid-wide default for all classes.]), [
1946 #SQUID_YESNO([$enableval],
1947 # [--enable-chunkedmempools option takes no arguments])
1949 SQUID_DEFINE_BOOL(USE_CHUNKEDMEMPOOLS,${enable_chunkedmempools:=no},
1950 [Enable chunked Memory Pools support (experimental)])
1951 #AC_MSG_NOTICE([Chunked MemPools enabled: $enable_chunkedmempools])
1953 dnl Enable WIN32 Service compile mode
1954 AC_ARG_ENABLE(win32-service,
1955 AS_HELP_STRING([--enable-win32-service],
1956 [Compile Squid as a WIN32 Service.
1957 Works only on MS-Windows platforms]), [
1958 SQUID_YESNO([$enableval],
1959 [unrecognized argument to --enable-win32-service: $enableval])
1961 SQUID_DEFINE_BOOL(USE_WIN32_SERVICE,${enable_win32_service:=no},
1962 [Enable code supporting MS Windows service mode])
1963 AC_MSG_NOTICE([MS Windows service mode enabled: $enable_win32_service])
1966 # Check for Cyrus SASL
1967 if test "$squid_require_sasl" = "yes"; then
1968 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1969 AC_CHECK_LIB(sasl2,sasl_errstring,[LIBSASL="-lsasl2"],[
1970 AC_CHECK_LIB(sasl,sasl_errstring,[LIBSASL="-lsasl"], [
1971 AC_MSG_ERROR(Neither SASL nor SASL2 found)
1977 # Disable "unlinkd" code
1978 AC_ARG_ENABLE(unlinkd,
1979 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [
1980 SQUID_YESNO([$enableval],
1981 [unrecognized argument to --disable-unlinkd: $enableval])
1983 SQUID_DEFINE_BOOL(USE_UNLINKD,${enable_unlinkd:=yes},
1984 [Enable useage of unlinkd])
1985 AM_CONDITIONAL(ENABLE_UNLINKD,test "$enable_unlinkd" = "yes")
1986 AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd])
1988 # Enable backtraces on fatal errors
1989 AC_ARG_ENABLE(stacktraces,
1990 AS_HELP_STRING([--enable-stacktraces],
1991 [Enable automatic call backtrace on fatal errors]), [
1992 SQUID_YESNO([$enableval],
1993 [unrecognized argument to --enable-stacktraces: $enableval])
1995 SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no},
1996 [Print stack traces on fatal errors])
1997 AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces])
2000 # CPU Profiling options handling
2001 AC_ARG_ENABLE(cpu-profiling,
2002 AS_HELP_STRING([--enable-cpu-profiling],
2003 [Enable instrumentation to try and understand how CPU power
2004 is spent by squid, by enabling specific probes in selected
2006 New probes can only be added by modifying the source code.
2007 It is meant to help developers in optimizing performance
2008 of Squid internal functions.
2009 If you are not developer you should not enable this,
2010 as it slows squid down somewhat.
2011 See lib/Profiler.c for more details.]), [
2012 SQUID_YESNO([$enableval],
2013 [unrecognized argument to --enable-cpu-profiling: $enableval])
2015 SQUID_DEFINE_BOOL(USE_XPROF_STATS,${enable_cpu_profiling:=no},
2016 [Define to enable CPU profiling within Squid])
2017 AM_CONDITIONAL(ENABLE_XPROF_STATS,
2018 test $enable_cpu_profiling = "yes")
2019 AC_MSG_NOTICE([CPU profiling enabled: $enable_cpu_profiling])
2021 # Enable X-Accelerator-Vary for Vary support within an accelerator setup
2022 AC_ARG_ENABLE(x-accelerator-vary,
2023 AS_HELP_STRING([--enable-x-accelerator-vary],
2024 [Enable support for the X-Accelerator-Vary
2025 HTTP header. Can be used to indicate
2026 variance within an accelerator setup.
2027 Typically used together with other code
2028 that adds custom HTTP headers to the requests.]), [
2029 SQUID_YESNO([$enableval],
2030 [unrecognized argument to --enable-x-accelerator-vary: $enableval])
2032 SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no},
2033 [Enable support for the X-Accelerator-Vary HTTP header])
2034 AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary])
2037 AC_ARG_ENABLE(zph-qos,
2038 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]), [
2039 SQUID_YESNO([$enableval],
2040 [unrecognized argument to --enable-zph-qos: $enableval])
2042 SQUID_DEFINE_BOOL(USE_ZPH_QOS,${enable_zph_qos:=no},
2043 [Enable Zero Penalty Hit QOS. When set, Squid will alter the
2044 TOS field of HIT responses to help policing network traffic])
2045 AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos])
2047 dnl --with-maxfd present for compatibility with Squid-2.
2048 dnl undocumented in ./configure --help to encourage using the Squid-3 directive
2053 squid_filedescriptors_num=$withval
2056 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
2061 AC_ARG_WITH(filedescriptors,
2062 AS_HELP_STRING([--with-filedescriptors=NUMBER],
2063 [Force squid to support NUMBER filedescriptors]),
2067 squid_filedescriptors_num=$withval
2070 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
2075 if $CPPUNITCONFIG --help >/dev/null; then
2076 squid_cv_cppunit_version="`$CPPUNITCONFIG --version`"
2077 AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version])
2078 unset squid_cv_cppunit_version
2079 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2081 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2083 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
2085 SQUID_CPPUNIT_LIBS=''
2086 SQUID_CPPUNIT_INC=''
2089 AC_ARG_WITH(cppunit-basedir,
2090 AS_HELP_STRING([--with-cppunit-basedir=PATH],
2091 [Path where the cppunit headers are libraries can be found ]),
2092 [ if test -f $withval/include/cppunit/TestCase.h; then
2093 AC_MSG_NOTICE([Using cppunit includes from $withval])
2094 SQUID_CPPUNIT_INC="-I${withval}/include"
2096 AC_MSG_ERROR(Cannot find cppunit at $withval)
2098 if test -f $withval/lib/libcppunit.la; then
2099 AC_MSG_NOTICE([Using cppunit lib from $withval])
2100 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2101 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2103 AC_MSG_ERROR(Cannot find cppunit at $withval)
2106 AC_SUBST(SQUID_CPPUNIT_LIBS)
2107 AC_SUBST(SQUID_CPPUNIT_LA)
2108 AC_SUBST(SQUID_CPPUNIT_INC)
2110 # Force some compilers to use ANSI features
2114 if test "$ac_cv_prog_CC" = "cc" ; then
2115 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
2123 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2127 AC_MSG_NOTICE([Disabling ranlib for HP-UX...])
2132 dnl Check for headers
2163 linux/posix_types.h \
2165 machine/byte_swap.h \
2173 netinet/in_systm.h \
2174 netinet/ip_fil_compat.h \
2188 security/pam_appl.h \
2235 CHECK_STRUCT_PAM_CONV
2238 linux/netfilter_ipv4.h
2240 SQUID_DEFAULT_INCLUDES
2244 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2245 #if HAVE_NETINET_IN_H
2246 #include <netinet/in.h>
2250 dnl *BSD dont include the depenencies for all their net/ and netinet/ files
2251 dnl We must include a few basic type headers for them to work.
2259 netinet/ip_compat.h\
2260 netinet/ip_fil_compat.h\
2270 SQUID_BSDNET_INCLUDES)
2276 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2279 #include <sys/time.h>
2286 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2287 #if HAVE_SYS_TYPES_H
2288 #include <sys/types.h>
2294 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2295 #if HAVE_SYS_TYPES_H
2296 #include <sys/types.h>
2302 dnl Override rusage() detect on MinGW because is emulated in source code
2305 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2306 ac_cv_func_getrusage='yes'
2307 AC_MSG_NOTICE([Using own rusage on Windows.])
2310 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2312 #include <sys/time.h>
2314 #if HAVE_SYS_RESOURCE_H
2315 #include <sys/resource.h>
2320 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2321 #if HAVE_SYS_TYPES_H
2322 #include <sys/types.h>
2324 #include <netinet/in.h>
2325 #include <netinet/in_systm.h>
2326 #include <netinet/ip.h>
2327 #if defined (__linux__) || defined (__CYGWIN__)
2336 dnl Check for typedefs
2337 AC_CHECK_SIZEOF(void *)
2339 # check for a bunch of types
2353 #need the defines for PRId64
2354 AC_CHECK_SIZEOF(int64_t)
2355 AC_CHECK_SIZEOF(long)
2357 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2358 dnl that is incompatible with the updated Solaris header files.
2359 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2360 AC_CHECK_TYPE(pad128_t,
2361 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2362 ,SQUID_DEFAULT_INCLUDES)
2364 AC_CHECK_TYPE(upad128_t,
2365 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2366 ,SQUID_DEFAULT_INCLUDES)
2368 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2369 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2371 dnl Check for special functions
2374 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2375 #include <sys/types.h>
2376 #include <sys/socket.h>
2382 dnl Check for libcap header (assume its not broken unless
2383 AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],
2384 [disable usage of Linux capabilities library to control privileges]), [
2385 SQUID_YESNO([$withval],[unrecognized argument to --without-libcap: $withval])
2386 ],[with_libcap=auto])
2388 if test "x$with_libcap" != "xno"; then
2389 # cap_clear_flag is the most recent libcap function we require
2390 AC_CHECK_HEADERS(sys/capability.h)
2391 AC_CHECK_LIB(cap, cap_clear_flag)
2392 SQUID_CHECK_FUNCTIONAL_LIBCAP2
2394 # if it can't be supported..
2395 if test "x$ac_cv_header_sys_capability_h" = "no" -o \
2396 "x$ac_cv_lib_cap_cap_clear_flag" = "no"; then
2397 # and it was forced on: error
2398 if "x$with_libcap" = "yes" ; then
2399 AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
2401 # with_libcap is "auto"; it can't be supported. Disable.
2405 # header and lib are ok, we support
2411 SQUID_DEFINE_BOOL(USE_LIBCAP,$with_libcap,
2412 [use libcap to set capabilities required for TPROXY])
2413 AC_MSG_NOTICE([libcap support enabled: $with_libcap])
2414 SQUID_DEFINE_BOOL(LIBCAP_BROKEN,${squid_cv_sys_capability_works:=no},
2415 [libcap2 headers are broken and clashing with glibc])
2416 AC_MSG_NOTICE([libcap2 headers are ok: $squid_cv_sys_capability_works])
2419 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
2420 [mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2421 #include <sys/ipc.h>
2422 #include <sys/msg.h>])
2424 dnl Check for needed libraries
2425 AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
2426 AC_SEARCH_LIBS([res_init],[resolv])
2427 AC_SEARCH_LIBS([bind],[socket])
2428 AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
2429 AC_SEARCH_LIBS([strlcpy], [bsd])
2430 AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
2431 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2434 AC_MSG_CHECKING(for winsock)
2436 for curlib in ws2_32 wsock32; do
2437 LIBS="$LIBS -l$curlib"
2438 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>]], [[
2440 select(0,NULL,NULL,NULL,NULL);
2442 gethostname(NULL,0);
2443 ]])],[have_winsock=yes],[have_winsock=no])
2445 if test $have_winsock = yes; then
2446 ac_cv_func_select='yes'
2447 if test $curlib = ws2_32; then
2448 have_winsock=winsock2
2454 AC_MSG_RESULT($have_winsock)
2455 if test $have_winsock = winsock2; then
2456 AC_CHECK_HEADERS(winsock2.h)
2458 AC_CHECK_HEADERS(winsock.h)
2463 dnl Ripped from the Samba sources
2464 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2465 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2466 #include <sys/types.h>
2469 #include <sys/socket.h>
2470 #include <sys/un.h>]], [[
2471 struct sockaddr_un sunaddr;
2472 sunaddr.sun_family = AF_UNIX;
2473 ]])],[squid_cv_unixsocket=yes],[squid_cv_unixsocket=no])])
2474 if test x"$squid_cv_unixsocket" = x"yes"; then
2475 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2479 AC_CHECK_LIB(gnumalloc, main)
2480 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2481 AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc])
2482 ac_cv_func_mallinfo=no
2483 ac_cv_func_mallocblksize=no
2484 ac_cv_func_mallopt=no
2488 AC_MSG_NOTICE([skipping libmalloc check for $host])
2491 AC_MSG_NOTICE([skipping libmalloc check for $host])
2495 AC_CHECK_LIB(malloc, main)
2500 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2503 AC_MSG_NOTICE([Use MSVCRT for math functions.])
2506 dnl rint() is only used in old C code for now.
2508 AC_SEARCH_LIBS([rint],[m])
2513 dnl Enable IPv6 support
2514 AC_MSG_CHECKING([whether to enable IPv6])
2517 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
2518 [ case $enableval in
2526 AC_MSG_RESULT($use_ipng)
2528 if test "$use_ipng" != "no"; then
2530 dnl Solaris 10/11 requires -lsocket
2533 LIBS="$LIBS -lsocket"
2538 AC_CACHE_CHECK([if PF_INET6 is available], squid_cv_pf_inet6,
2539 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* PF_INET6 available check */
2540 # include <sys/types.h>
2541 # include <sys/socket.h>
2542 int main(int argc, char **argv) {
2543 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
2548 ]])],[squid_cv_pf_inet6="yes" ; SAVED_LIBS="$LIBS"],[squid_cv_pf_inet6="no"],[])
2553 # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
2554 # unless --enable-ipv6 is explicitly used. in which case it's a hard fail.
2555 if test "x$use_ipng" = "xyes" && test "x$squid_cv_pf_inet6" = "xno"; then
2556 AC_MSG_ERROR([IPv6 cannot be built on this system. Basic kernel definitions are missing.])
2557 elif test "x$use_ipng" = "xauto" && test "x$squid_cv_pf_inet6" = "xno"; then
2558 AC_MSG_WARN([IPv6 cannot be built on this system. Basic kernel definitions are missing.])
2561 if test "$use_ipng" != "no" && test "$squid_cv_pf_inet6" = "yes" ; then
2562 AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
2563 SET_IPV6_SETTINGS=""
2566 dnl Check for forced split-stack mode
2567 AC_MSG_CHECKING([for IPv6 split-stack requirement])
2568 AC_ARG_WITH(ipv6-split-stack,
2569 AS_HELP_STRING([--with-ipv6-split-stack],[Force-Enable experimental split-stack support for Windows XP and *BSD. Requires IPv6.]),
2571 AC_MSG_RESULT(yes)],
2572 [ AC_MSG_RESULT(no) ])
2574 dnl Check for IPv6 v4-mapping availability
2575 dnl Useful for other OS with hybrid-stack defaults turned OFF
2576 dnl But only usable if it actually works...
2577 if test "$use_v4mapped" = "yes" ; then
2578 AC_MSG_CHECKING([for IPv6 v4-mapping ability])
2579 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* IPPROTO_V4MAPPED is usable check */
2580 # include <sys/types.h>
2581 # include <sys/socket.h>
2582 # include <netinet/in.h>
2583 #if HAVE_NETINET_IN6_H
2584 # include <netinet/in6.h>
2586 int main(int argc, char **argv) {
2587 int s = socket(PF_INET6, SOCK_STREAM, 0);
2589 if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &tos, sizeof(int)) < 0)
2594 ]])],[ AC_MSG_RESULT(yes)
2596 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
2597 ],[ AC_MSG_RESULT(no)
2598 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets])
2603 dnl if we can't defer v4-mapping to the OS we are forced to split-stack
2605 AC_MSG_CHECKING([for IPv6 stack type/mode])
2606 if test "$use_v4mapped" = "yes"; then
2607 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2608 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations])
2609 AC_MSG_RESULT(mapping hybrid)
2611 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2612 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
2613 AC_MSG_RESULT(split-stack or BSD non-mapping dual-stack)
2616 dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2617 AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2618 ac_cv_have_sin6_len_in_struct_sai, [
2619 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2620 #include <sys/types.h>
2621 #include <sys/socket.h>
2622 #include <netinet/in.h>
2623 ]], [[ 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"
2626 if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2627 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2629 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2633 # IPv6 is not available, but is not explicitly required. Auto-Disable.
2634 AC_DEFINE(USE_IPV6,0,[Enable support for IPv6])
2635 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
2636 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
2637 SET_IPV6_SETTINGS="\#IPv6 Not Available: "
2639 AC_SUBST(SET_IPV6_SETTINGS)
2641 dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2642 AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2643 ac_cv_have_ss_len_in_struct_ss, [
2644 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2645 #include <sys/types.h>
2646 #include <sys/socket.h>
2647 #include <netinet/in.h>
2648 ]], [[ 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"
2651 if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2652 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2654 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2657 dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2658 AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2659 ac_cv_have_sin_len_in_struct_sai, [
2660 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2661 #include <sys/types.h>
2662 #include <sys/socket.h>
2663 #include <netinet/in.h>
2664 ]], [[ 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"
2667 if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
2668 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2670 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2673 dnl Check for libcrypt
2675 dnl Some of our helpers use crypt(3) which may be in libc, or in
2676 dnl libcrypt (eg FreeBSD)
2677 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2678 dnl Solaris10 provides MD5 natively through libmd5
2679 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
2682 # check for crypt, may require -lcrypt
2684 LIBS="$LIBS $CRYPTLIB"
2685 AC_CHECK_FUNCS(crypt)
2689 dnl Check for libdl, used by auth_modules/PAM
2690 if test "$with_dl" = "yes"; then
2691 AC_CHECK_LIB(dl, dlopen)
2694 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2695 dnl Robert Side <rside@aiinc.bc.ca>
2696 dnl Mon, 18 Jan 1999 17:48:00 GMT
2699 AC_CHECK_LIB(intl, strftime)
2703 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2704 dnl only with Windows LDAP libraries using -lwldap32
2712 dnl LDAP helpers need to know if -llber is needed or not
2713 AC_CHECK_LIB(lber, main, [LBERLIB="-llber"])
2720 dnl this is not fully functional if db.h is for a differend db version
2723 dnl check that dbopen is actually defined in the header
2724 dnl FIXME: in case of failure undef db-related includes etc.
2725 AC_CHECK_DECL(dbopen,,,[
2726 #if HAVE_SYS_TYPES_H
2727 #include <sys/types.h>
2739 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
2740 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2741 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2742 #if HAVE_SYS_TYPES_H
2743 #include <sys/types.h>
2752 #endif]], [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],[ac_cv_dbopen_libdb="yes"],[ac_cv_dbopen_libdb="no"])
2755 if test $ac_cv_dbopen_libdb = yes; then
2760 dnl System-specific library modifications
2764 if test "$GCC" = "yes"; then
2765 AC_MSG_NOTICE([Removing -O for gcc on $host])
2766 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2770 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
2771 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2772 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
2773 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2774 ac_cv_lib_nsl_main=no
2775 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
2776 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2778 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2779 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2780 dnl Please change your configure script. AIX doesn't need -lbsd.
2782 AC_MSG_NOTICE([Removing -lbsd for AIX...])
2783 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2786 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2787 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2788 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2790 [*-*-solaris2.[0-4]])
2791 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2793 [*-sony-newsos[56]*])
2794 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2798 # Remove optimization for GCC 2.95.[123]
2799 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2800 if test "$GCC" = "yes"; then
2801 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2804 AC_MSG_NOTICE([Removing -O for gcc on $host with GCC $GCCVER])
2805 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2810 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2813 if test `uname -v` = "2.03"; then
2814 AC_MSG_NOTICE([disabling mallinfo for $host])
2815 ac_cv_func_mallinfo=no
2820 dnl This has to be before AC_CHECK_FUNCS
2821 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2822 # when running configure.
2823 if test -z "$ac_cv_func_poll"; then
2827 AC_MSG_NOTICE([disabling poll for $host...])
2828 ac_cv_func_poll='no'
2831 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2832 # poll is problematic on Linux. We disable it
2833 # by default until Linux gets it right.
2834 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2835 if test $rev -lt 002002; then
2836 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
2837 ac_cv_func_poll='no'
2840 [powerpc-ibm-aix4.1.*])
2841 # Mike Laster (mlaster@metavillage.com) 19981021
2842 AC_MSG_NOTICE([disabling poll for $host...])
2843 ac_cv_func_poll='no'
2846 # Robert Side <rside@aiinc.bc.ca>
2847 # Mon, 18 Jan 1999 17:48:00 GMT
2848 AC_MSG_NOTICE([disabling poll for $host...])
2849 ac_cv_func_poll='no'
2854 dnl Override statfs() detect on MinGW becasue is emulated in source code
2857 ac_cv_func_statfs='yes'
2861 dnl Check for library functions
2863 backtrace_symbols_fd \
2893 pthread_attr_setschedparam \
2894 pthread_attr_setscope \
2895 pthread_setschedparam \
2923 dnl ... and some we provide local replacements for
2938 # Magic which checks whether we are forcing a type of comm loop we
2939 # are actually going to (ab)use.
2940 # Mostly ripped from squid-commloops, thanks to adrian and benno
2942 if test -n "$squid_opt_io_loop_engine"; then
2943 AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine])
2944 elif test "$enable_epoll" != "no" && test "$squid_cv_epoll_works" = "yes" ; then
2945 squid_opt_io_loop_engine="epoll"
2946 elif test "$enable_kqueue" != "no" && test "$ac_cv_func_kqueue" = "yes" ; then
2947 squid_opt_io_loop_engine="kqueue"
2948 elif test "$enable_poll" != "no" && test "$ac_cv_func_poll" = "yes" ; then
2949 squid_opt_io_loop_engine="poll"
2950 elif test "$enable_select" != "no" && test "$ac_cv_func_select" = "yes" ; then
2951 squid_opt_io_loop_engine="select"
2952 if test "$squid_host_os" = "mingw" ; then
2953 squid_opt_io_loop_engine="select_win32"
2956 AC_MSG_WARN([Eep! Cannot find poll, kqueue, epoll, or select!])
2957 AC_MSG_WARN([Will try select and hope for the best.])
2958 squid_opt_io_loop_engine="select"
2961 AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.])
2963 AM_CONDITIONAL([USE_POLL], [test $squid_opt_io_loop_engine = poll])
2964 AM_CONDITIONAL([USE_EPOLL], [test $squid_opt_io_loop_engine = epoll])
2965 AM_CONDITIONAL([USE_SELECT], [test $squid_opt_io_loop_engine = select])
2966 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $squid_opt_io_loop_engine = select_simple])
2967 AM_CONDITIONAL([USE_SELECT_WIN32], [test $squid_opt_io_loop_engine = select_win32])
2968 AM_CONDITIONAL([USE_KQUEUE], [test $squid_opt_io_loop_engine = kqueue])
2969 AM_CONDITIONAL([USE_DEVPOLL], [test $squid_opt_io_loop_engine = devpoll])
2971 case $squid_opt_io_loop_engine in
2972 epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;;
2973 poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;;
2974 kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;;
2975 select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;;
2976 select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;;
2979 AC_CACHE_CHECK(if setresuid is actually implemented, ac_cv_func_setresuid,
2980 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2982 int main(int argc, char **argv) {
2983 if(setresuid(-1,-1,-1)) {
2984 perror("setresuid:");
2989 ]])],[ac_cv_func_setresuid="yes"],[ac_cv_func_setresuid="no"],[])
2991 if test "$ac_cv_func_setresuid" = "yes" ; then
2992 AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Knowing that setresuid() exists is not enough, because RedHat 5.0 declares setresuid() but does not implement it.])
2995 SQUID_CHECK_FUNC_STRNSTR
2996 SQUID_CHECK_FUNC_VACOPY
2997 SQUID_CHECK_FUNC___VACOPY
3000 dnl IP-Filter support requires ipf header files. These aren't
3001 dnl installed by default, so we need to check for them
3002 if test "$enable_ipf_transparent" != "no" ; then
3003 AC_MSG_CHECKING(for availability of IP-Filter header files)
3004 # hold on to your hats...
3005 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3006 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
3007 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3008 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
3009 have_ipfilter_compat_header="yes"
3011 if test "$have_ipfilter_compat_header" = "yes" &&
3012 test "$ac_cv_header_ip_fil_h" = "yes" &&
3013 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3014 enable_ipf_transparent="yes"
3015 elif test "$have_ipfilter_compat_header" = "yes" &&
3016 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3017 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3018 enable_ipf_transparent="yes"
3020 enable_ipf_transparent="no"
3022 AC_MSG_RESULT($IPF_TRANSPARENT)
3024 AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent])
3025 SQUID_DEFINE_BOOL(IPF_TRANSPARENT,$enable_ipf_transparent,
3026 [Enable support for IPF-style transparent proxying])
3028 if test "$enable_ipf_transparent" = "yes" -a "$squid_host_os" = "solaris" ; then
3029 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3030 dnl Solaris minor version (8, 9, 10, ...)
3031 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3032 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3033 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3036 dnl PF support requires a header file.
3037 if test "$enable_pf_transparent" != "no" ; then
3038 if test "$ac_cv_header_net_pfvar_h" = "yes" -o \
3039 "$ac_cv_header_net_pf_pfvar_h" = "yes"; then
3040 if test "$enable_pf_transparent" = "auto" ; then
3041 enable_pf_transparent="yes"
3044 if test "$enable_pf_transparent" = "yes" ; then
3045 AC_MSG_ERROR([PF-based transparent proxy requested but needed header not found])
3047 enable_pf_transparent="no"
3050 SQUID_DEFINE_BOOL(PF_TRANSPARENT,$enable_pf_transparent,
3051 [Enable support for PF-style transparent proxying])
3053 if test "$enable_linux_netfilter" != "no" ; then
3054 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3055 if test "$enable_linux_netfilter" = "auto" ; then
3056 enable_linux_netfilter=yes
3059 if test "$enable_linux_netfilter" = "auto" ; then
3060 enable_linux_netfilter=no
3062 AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found])
3066 SQUID_DEFINE_BOOL(LINUX_NETFILTER,$enable_linux_netfilter,
3067 [Enable support for Transparent Proxy on Linux via Netfilter])
3069 dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3070 AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter])
3071 if test "$enable_linux_netfilter" = "yes" && test "$with_libcap" != "yes" ; then
3072 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3073 AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3074 AC_MSG_WARN([Reduced support to Interception Proxy])
3078 AC_ARG_ENABLE(gnuregex,
3079 AS_HELP_STRING([--enable-gnuregex],
3080 [Compile GNUregex. Unless you have reason to use
3081 this option, you should not enable it.
3082 This library file is usually only required on Windows and
3083 very old Unix boxes which do not have their own regex
3084 library built in.]),
3085 [USE_GNUREGEX=$enableval])
3086 if test -z "$USE_GNUREGEX" ; then
3088 *-sun-solaris2.[[0-4]])
3096 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3097 if test -z "$USE_GNUREGEX"; then
3098 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
3101 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
3102 #include <regex.h>]], [[regex_t t; regcomp(&t,"",0);]])],[USE_GNUREGEX="no"],[USE_GNUREGEX="yes"])
3105 AC_MSG_RESULT($USE_GNUREGEX)
3106 if test "$USE_GNUREGEX" = "yes"; then
3107 # override system regex with ours. Not good. But what was asked for.
3109 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
3114 dnl Not cached since people are likely to tune this
3115 AC_MSG_CHECKING(Default FD_SETSIZE value)
3116 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3127 #include <sys/time.h>
3129 #if HAVE_SYS_SELECT_H
3130 #include <sys/select.h>
3132 #if HAVE_SYS_TYPES_H
3133 #include <sys/types.h>
3136 #include <winsock.h>
3139 #include <winsock2.h>
3141 int main(int argc, char **argv) {
3142 FILE *fp = fopen("conftestval", "w");
3143 fprintf (fp, "%d\n", FD_SETSIZE);
3146 ]])],[DEFAULT_FD_SETSIZE=`cat conftestval`],[DEFAULT_FD_SETSIZE=256],[DEFAULT_FD_SETSIZE=256])
3147 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
3148 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
3151 dnl Not cached since people are likely to tune this
3152 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
3153 dnl damn! FreeBSD pthreads break dup2().
3155 if test -n "$squid_filedescriptors_num" ; then
3156 SQUID_MAXFD=$squid_filedescriptors_num
3157 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3160 i386-unknown-freebsd*)
3161 if echo "$LDFLAGS" | grep -q pthread; then
3162 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3165 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3169 #include <sys/time.h> /* needed on FreeBSD */
3170 #include <sys/param.h>
3171 #include <sys/resource.h>
3172 int main(int argc, char **argv) {
3175 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
3176 /* getrlimit and sysconf returns bogous values on cygwin32.
3177 * Number of fds is virtually unlimited in cygwin (sys/param.h)
3178 * __CYGWIN32__ is deprecated.
3184 #if defined(RLIMIT_NOFILE)
3185 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3186 perror("getrlimit: RLIMIT_NOFILE");
3188 #if defined(__APPLE__)
3189 /* asking for more than OPEN_MAX fails on Leopard */
3190 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3192 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3194 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3195 perror("setrlimit: RLIMIT_NOFILE");
3198 #elif defined(RLIMIT_OFILE)
3199 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3200 perror("getrlimit: RLIMIT_OFILE");
3202 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3203 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3204 perror("setrlimit: RLIMIT_OFILE");
3207 #endif /* RLIMIT_NOFILE */
3208 #endif /* HAVE_SETRLIMIT */
3209 /* by starting at 2^14, we will never get higher
3210 than 2^15 for SQUID_MAXFD */
3214 if (dup2(0, i) < 0) {
3222 #endif /* IF !DEF CYGWIN */
3223 fp = fopen("conftestval", "w");
3224 fprintf (fp, "%d\n", i & ~0x3F);
3227 ]])],[SQUID_MAXFD=`cat conftestval`],[SQUID_MAXFD=256],[SQUID_MAXFD=256])
3228 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3234 AC_MSG_RESULT($SQUID_MAXFD)
3236 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3237 if test "$SQUID_MAXFD" -lt 512 ; then
3238 AC_MSG_WARN([$SQUID_MAXFD may not be enough filedescriptors if your])
3239 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3240 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3241 AC_MSG_WARN([on how to increase your filedescriptor limit])
3245 if test `expr $SQUID_MAXFD % 64` != 0; then
3246 AC_MSG_WARN([$SQUID_MAXFD is not an multiple of 64. This may cause issues on certain platforms.])
3249 dnl Not cached since people are likely to tune this
3250 AC_MSG_CHECKING(Default UDP send buffer size)
3251 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3254 #include <sys/types.h>
3255 #if HAVE_SYS_SOCKET_H
3256 #include <sys/socket.h>
3258 #if HAVE_NETINET_IN_H
3259 #include <netinet/in.h>
3262 #include <winsock.h>
3265 #include <winsock2.h>
3267 int main(int argc, char **argv)
3271 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3272 int len=sizeof(int);
3274 WSAStartup(2, &wsaData);
3276 socklen_t len=sizeof(socklen_t);
3278 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3279 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3280 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3283 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3285 if (val<=0) return 1;
3286 fp = fopen("conftestval", "w");
3287 fprintf (fp, "%d\n", val);
3290 ]])],[SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_SNDBUF=16384],[SQUID_DETECT_UDP_SO_SNDBUF=16384])
3291 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3292 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3294 dnl Not cached since people are likely to tune this
3295 AC_MSG_CHECKING(Default UDP receive buffer size)
3296 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3299 #include <sys/types.h>
3300 #if HAVE_SYS_SOCKET_H
3301 #include <sys/socket.h>
3303 #if HAVE_NETINET_IN_H
3304 #include <netinet/in.h>
3307 #include <winsock.h>
3310 #include <winsock2.h>
3312 int main(int argc, char **argv)
3316 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3317 int len=sizeof(int);
3319 WSAStartup(2, &wsaData);
3321 socklen_t len=sizeof(socklen_t);
3323 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3324 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3325 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3328 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3330 if (val <= 0) return 1;
3331 fp = fopen("conftestval", "w");
3332 fprintf (fp, "%d\n", val);
3335 ]])],[SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_RCVBUF=16384],[SQUID_DETECT_UDP_SO_RCVBUF=16384])
3336 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3337 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3339 dnl Not cached since people are likely to tune this
3340 AC_MSG_CHECKING(Default TCP send buffer size)
3341 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3344 #include <sys/types.h>
3345 #if HAVE_SYS_SOCKET_H
3346 #include <sys/socket.h>
3348 #if HAVE_NETINET_IN_H
3349 #include <netinet/in.h>
3352 #include <winsock.h>
3355 #include <winsock2.h>
3357 int main(int argc, char **argv)
3361 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3362 int len=sizeof(int);
3364 WSAStartup(2, &wsaData);
3366 socklen_t len=sizeof(socklen_t);
3368 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3369 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3370 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3373 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3375 if (val <= 0) return 1;
3376 fp = fopen("conftestval", "w");
3377 fprintf (fp, "%d\n", val);
3380 ]])],[SQUID_TCP_SO_SNDBUF=`cat conftestval`],[SQUID_TCP_SO_SNDBUF=16384],[SQUID_TCP_SO_SNDBUF=16384])
3381 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3382 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3383 AC_MSG_NOTICE([Limiting send buffer size to 32K])
3384 SQUID_TCP_SO_SNDBUF=32768
3386 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3388 dnl Not cached since people are likely to tune this
3389 AC_MSG_CHECKING(Default TCP receive buffer size)
3390 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3393 #include <sys/types.h>
3394 #if HAVE_SYS_SOCKET_H
3395 #include <sys/socket.h>
3397 #if HAVE_NETINET_IN_H
3398 #include <netinet/in.h>
3401 #include <winsock.h>
3404 #include <winsock2.h>
3406 int main(int argc, char **argv)
3410 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3411 int len=sizeof(int);
3413 WSAStartup(2, &wsaData);
3415 socklen_t len=sizeof(socklen_t);
3417 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3418 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3419 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3422 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3424 if (val <= 0) return 1;
3425 fp = fopen("conftestval", "w");
3426 fprintf (fp, "%d\n", val);
3429 ]])],[SQUID_TCP_SO_RCVBUF=`cat conftestval`],[SQUID_TCP_SO_RCVBUF=16384],[SQUID_TCP_SO_RCVBUF=16384])
3430 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3431 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3432 AC_MSG_NOTICE([Limiting receive buffer size to 64K])
3433 SQUID_TCP_SO_RCVBUF=65535
3435 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3436 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3437 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"])
3439 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3440 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3443 dnl Hurd does not supply MAXPATHLEN. we may need to define it outselves.
3444 dnl Other system define it in system headers
3445 AC_CHECK_HEADERS([sys/param.h])
3446 AC_MSG_CHECKING(for MAXPATHLEN)
3447 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/param.h>]],[[int i = MAXPATHLEN;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
3448 AC_DEFINE(MAXPATHLEN,256,[If MAXPATHLEN has not been defined])])
3451 dnl Not cached since people are likely to change this
3452 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3453 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
3454 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],[AC_MSG_RESULT(no)])
3456 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3457 AC_MSG_CHECKING(for working statvfs() interface)
3458 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3461 #include <sys/types.h>
3462 #include <sys/statvfs.h>
3465 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3466 sfs.f_files = sfs.f_ffree = 0;
3467 statvfs("/tmp", &sfs);
3468 ]])],[ac_cv_func_statvfs=yes],[ac_cv_func_statvfs=no])
3469 AC_MSG_RESULT($ac_cv_func_statvfs)
3470 if test "$ac_cv_func_statvfs" = "yes" ; then
3471 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3475 dnl Detect what resolver fields we have available to use...
3476 AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3477 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3478 #if HAVE_SYS_TYPES_H
3479 #include <sys/types.h>
3481 #if HAVE_NETINET_IN_H
3482 #include <netinet/in.h>
3484 #if HAVE_ARPA_INET_H
3485 #include <arpa/inet.h>
3487 #if HAVE_ARPA_NAMESER_H
3488 #include <arpa/nameser.h>
3493 ]], [[_res_ext.nsaddr_list[[0]].s_addr;]])],[ac_cv_have_res_ext_nsaddr_list="yes"],[ac_cv_have_res_ext_nsaddr_list="no"]))
3494 if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3495 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3496 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3499 if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
3500 AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3501 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3502 #if HAVE_SYS_TYPES_H
3503 #include <sys/types.h>
3505 #if HAVE_NETINET_IN_H
3506 #include <netinet/in.h>
3508 #if HAVE_ARPA_INET_H
3509 #include <arpa/inet.h>
3511 #if HAVE_ARPA_NAMESER_H
3512 #include <arpa/nameser.h>
3517 ]], [[_res._u._ext.nsaddrs[[0]]->sin6_addr;]])],[ac_cv_have_res_ext_nsaddrs="yes"],[ac_cv_have_res_ext_nsaddrs="no"]))
3518 if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3519 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3520 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3524 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3525 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3526 #if HAVE_SYS_TYPES_H
3527 #include <sys/types.h>
3529 #if HAVE_NETINET_IN_H
3530 #include <netinet/in.h>
3532 #if HAVE_ARPA_INET_H
3533 #include <arpa/inet.h>
3535 #if HAVE_ARPA_NAMESER_H
3536 #include <arpa/nameser.h>
3541 ]], [[_res.nsaddr_list[[0]];]])],[ac_cv_have_res_nsaddr_list="yes"],[ac_cv_have_res_nsaddr_list="no"]))
3542 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3543 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3544 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3547 if test "$_SQUID_RES_NSADDR_LIST" = ""; then
3548 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3549 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3550 #if HAVE_SYS_TYPES_H
3551 #include <sys/types.h>
3553 #if HAVE_NETINET_IN_H
3554 #include <netinet/in.h>
3556 #if HAVE_ARPA_INET_H
3557 #include <arpa/inet.h>
3559 #if HAVE_ARPA_NAMESER_H
3560 #include <arpa/nameser.h>
3565 ]], [[_res.ns_list[[0]].addr;]])],[ac_cv_have_res_ns_list="yes"],[ac_cv_have_res_ns_list="no"]))
3566 if test $ac_cv_have_res_ns_list = "yes" ; then
3567 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3568 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3572 dnl Squid will usually attempt to translate when packaging or building from VCS
3573 use_translation="yes"
3574 AC_ARG_ENABLE(translation,
3575 AS_HELP_STRING([--disable-translation],[Prevent Squid generating localized error page templates and manuals.
3576 Which is usually tried, but may not be needed.]),
3577 [ if test "$enableval" = "no" ; then
3581 dnl Squid now has .po translation capability, given the right toolkit
3582 if test "$use_translation" = "yes" ; then
3583 AX_WITH_PROG([PO2HTML],[po2html])
3589 dnl Squid now has limited locale handling ...
3592 AC_ARG_ENABLE(auto-locale,
3593 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
3594 clients request headers.
3595 When disabled Squid requires explicit language configuration.]),
3596 [ if test "$enableval" = "no" ; then
3600 if test "$use_errlocale" = "yes" ; then
3601 AC_MSG_NOTICE([Enabling Multi-Language Support])
3602 AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
3604 AC_MSG_WARN([Disabling Multi-Language Support])
3605 AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
3608 dnl Need the debugging version of malloc if available
3610 if test "$ac_cv_lib_malloc_main" = "yes" ; then
3611 if test -r /usr/lib/debug/malloc.o ; then
3612 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3614 if test -r /usr/lib/debug/mallocmap.o ; then
3615 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3620 if test -z "$XTRA_LIBS"; then
3623 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3628 dnl Clean up after OSF/1 core dump bug
3635 libntlmauth/Makefile \
3643 src/adaptation/Makefile \
3644 src/adaptation/icap/Makefile \
3645 src/adaptation/ecap/Makefile \
3650 src/ident/Makefile \
3658 test-suite/Makefile \
3660 doc/manuals/Makefile \
3662 helpers/basic_auth/Makefile \
3663 helpers/basic_auth/DB/Makefile \
3664 helpers/basic_auth/getpwnam/Makefile \
3665 helpers/basic_auth/LDAP/Makefile \
3666 helpers/basic_auth/MSNT/Makefile \
3667 helpers/basic_auth/MSNT-multi-domain/Makefile \
3668 helpers/basic_auth/NCSA/Makefile \
3669 helpers/basic_auth/NIS/Makefile \
3670 helpers/basic_auth/PAM/Makefile \
3671 helpers/basic_auth/POP3/Makefile \
3672 helpers/basic_auth/RADIUS/Makefile \
3673 helpers/basic_auth/SASL/Makefile \
3674 helpers/basic_auth/SMB/Makefile \
3675 helpers/basic_auth/SSPI/Makefile \
3676 helpers/digest_auth/Makefile \
3677 helpers/digest_auth/eDirectory/Makefile \
3678 helpers/digest_auth/file/Makefile \
3679 helpers/digest_auth/LDAP/Makefile \
3680 helpers/ntlm_auth/Makefile \
3681 helpers/ntlm_auth/fake/Makefile \
3682 helpers/ntlm_auth/smb_lm/Makefile \
3683 helpers/ntlm_auth/SSPI/Makefile \
3684 helpers/negotiate_auth/Makefile \
3685 helpers/negotiate_auth/kerberos/Makefile \
3686 helpers/negotiate_auth/SSPI/Makefile \
3687 helpers/external_acl/Makefile \
3688 helpers/external_acl/ip_user/Makefile \
3689 helpers/external_acl/ldap_group/Makefile \
3690 helpers/external_acl/session/Makefile \
3691 helpers/external_acl/unix_group/Makefile \
3692 helpers/external_acl/wbinfo_group/Makefile \
3693 helpers/external_acl/mswin_ad_group/Makefile \
3694 helpers/external_acl/mswin_lm_group/Makefile \
3695 helpers/log_daemon/Makefile \
3696 helpers/log_daemon/file/Makefile \
3697 helpers/url_rewrite/Makefile \
3698 helpers/url_rewrite/fake/Makefile \
3702 AC_CONFIG_SUBDIRS(lib/libTrie)
3704 # must configure libltdl subdir unconditionally for "make distcheck" to work
3705 AC_CONFIG_SUBDIRS(libltdl)