2 dnl Configuration input file for Squid
4 dnl $Id: configure.in,v 1.497 2008/02/17 09:24:49 serassio Exp $
8 AC_INIT(Squid Web Proxy, 3.HEAD-BZR, http://www.squid-cache.org/bugs/, squid)
10 AM_CONFIG_HEADER(include/autoconf.h)
11 AC_CONFIG_AUX_DIR(cfgaux)
12 AC_CONFIG_SRCDIR([src/main.cc])
13 AM_INIT_AUTOMAKE([tar-ustar])
14 AC_REVISION($Revision: 1.497 $)dnl
15 AC_PREFIX_DEFAULT(/usr/local/squid)
18 PRESET_CFLAGS="$CFLAGS"
19 PRESET_LDFLAGS="$LDFLAGS"
21 dnl Set default LDFLAGS
22 if test -z "$LDFLAGS"; then
34 use_loadable_modules=1
35 AC_MSG_CHECKING(whether to use loadable modules)
36 AC_ARG_ENABLE(loadable-modules,
39 [--disable-loadable-modules],
40 [do not support loadable modules])
43 case "${enableval}" in
44 yes) use_loadable_modules=yes ;;
45 no) use_loadable_modules=no ;;
46 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
48 AC_MSG_RESULT([$use_loadable_modules, explicitly])
51 use_loadable_modules=yes;
52 AC_MSG_RESULT([$use_loadable_modules, implicitly])
56 AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
58 if test $use_loadable_modules = yes;
60 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
67 if test $use_loadable_modules = yes;
69 AC_LIBLTDL_CONVENIENCE(lib/libLtdl)
74 # Do we need these unconditionally for "make distcheck" to work?
78 if test $use_loadable_modules = yes;
80 # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
81 LIBADD_DL=${lt_cv_dlopen_libs}
90 LIBREGEX='' # libregex.a
92 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
96 if test -z "$EXEEXT"; then
99 # automake automatically adds .exe when installing binaries
104 dnl this should be expanded to a list of platform sensible support requirements.
105 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
107 mingw|mingw32|cygwin|cygwin32)
108 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
111 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
117 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
118 CFLAGS="$CFLAGS -mthreads"
119 CXXFLAGS="$CXXFLAGS -mthreads"
120 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
121 echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform"
122 echo "Please see PSAPI.DLL section on doc/win32-relnotes.html."
124 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
127 MINGW_LIBS="-lmingwex"
128 AM_CONDITIONAL(USE_IPC_WIN32, true)
132 AM_CONDITIONAL(USE_IPC_WIN32, false)
136 if test -z "$CACHE_HTTP_PORT"; then
137 CACHE_HTTP_PORT="3128"
139 if test -z "$CACHE_ICP_PORT"; then
140 CACHE_ICP_PORT="3130"
144 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
145 [What default TCP port to use for HTTP listening?])
146 AC_SUBST(CACHE_HTTP_PORT)
147 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
148 [What default UDP port to use for ICP listening?])
149 AC_SUBST(CACHE_ICP_PORT)
151 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
153 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
155 CACHE_EFFECTIVE_USER="nobody"
156 AC_ARG_WITH(default-user,
157 [ --with-default-user=USER System user account for squid permissions.
159 [ CACHE_EFFECTIVE_USER="$withval" ]
161 AC_SUBST(CACHE_EFFECTIVE_USER)
163 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
166 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
170 if test "$GCC" = "yes"; then
171 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
172 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
175 if test $GCCVER2 -lt 300 ; then
176 echo "ERROR: GCC $GCCVER causes a coredump on $host"
177 echo "ERROR: Try a more recent GCC version"
186 dnl Set Default CFLAGS
187 if test -z "$PRESET_CFLAGS"; then
188 if test "$GCC" = "yes"; then
191 # sunos has too many warnings for this to be useful
195 # Motorola cc/ld does not like -02 but is ok on -O
196 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
199 CFLAGS="-Wall $CFLAGS"
205 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
206 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
207 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
208 -Wl,-woff,85,-woff,84,-woff,134 \
209 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
210 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
211 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
212 -Wl,-woff,85,-woff,84,-woff,134 \
213 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
216 # Mogul says DEC compilers take both -g and -O2
217 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
226 dnl set squid required flags
227 if test "$GCC" = "yes"; then
228 dnl Guido Serassio (serassio@squid-cache.org) 20070811
229 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
230 dnl -Wmissing-prototypes -Wmissing-declarations
231 dnl TODO: check if the problem will be present in any other newer MinGW release.
234 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
237 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
240 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
245 AC_SUBST(SQUID_CFLAGS)
246 AC_SUBST(SQUID_CXXFLAGS)
248 AC_TEST_CHECKFORHUGEOBJECTS
249 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
252 if test -z "$PRESET_LDFLAGS"; then
253 if test "$GCC" = "yes"; then
256 # Silence Linker warnings 84, 85 and 134
257 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
272 AC_ARG_ENABLE(gnuregex,
273 [ --enable-gnuregex Compile GNUregex. Unless you have reason to use this
274 option, you should not enable it. This library file
275 is usually only required on Windows and very old
276 Unix boxes which do not have their own regex library
278 [USE_GNUREGEX=$enableval])
282 AC_ARG_ENABLE(optimizations,
283 [ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
284 Optimization is good for production builds, but not
285 good for debugging. During development, use
286 --disable-optimizations to reduce compilation times
287 and allow easier debugging. This option implicitly
288 also enabled --disable-inline],
289 [ if test "$enableval" = "no" ; then
290 echo "Disabling compiler optimizations (-O flag)"
291 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
292 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
297 AC_ARG_ENABLE(inline,
298 [ --disable-inline Don't compile trivial methods as inline. Squid
299 is coded with much of the code able to be inlined.
300 Inlining is good for production builds, but not
301 good for development. During development, use
302 --disable-inline to reduce compilation times and
303 allow incremental builds to be quick. For
304 production builds, or load tests, use
305 --enable-inline to have squid make all trivial
306 methods inlinable by the compiler.],
307 [ if test "$enableval" = "no" ; then
312 if test "$SquidInline" = "yes" ; then
313 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
314 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
316 echo "Inlining optimization disabled"
317 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
320 AC_ARG_ENABLE(debug-cbdata,
321 [ --enable-debug-cbdata Provide some debug information in cbdata],
322 [ if test "$enableval" = "yes" ; then
323 echo "cbdata debugging enabled"
324 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
328 dnl This is a developer only option.. developers know how to set defines
330 dnl AC_ARG_ENABLE(xmalloc-debug,
331 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
332 dnl [ if test "$enableval" = "yes" ; then
333 dnl echo "Malloc debugging enabled"
334 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
338 dnl This is a developer only option.. developers know how to set defines
340 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
341 dnl [ --enable-xmalloc-debug-trace
342 dnl Detailed trace of memory allocations],
343 dnl [ if test "$enableval" = "yes" ; then
344 dnl echo "Malloc debug trace enabled"
345 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
346 dnl AC_DEFINE(XMALLOC_DEBUG,1)
350 AC_ARG_ENABLE(xmalloc-statistics,
351 [ --enable-xmalloc-statistics
352 Show malloc statistics in status page],
353 [ if test "$enableval" = "yes" ; then
354 echo "Malloc statistics enabled"
355 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
359 AC_ARG_ENABLE(async-io,
360 [ --enable-async-io[=N_THREADS]
362 --with-aufs-threads=N_THREADS
364 --enable-storeio=ufs,aufs],
368 STORE_MODULES="ufs aufs"
373 aufs_io_threads=$enableval
375 STORE_MODULES="ufs aufs"
380 AC_ARG_WITH(aufs-threads,
381 [ --with-aufs-threads=N_THREADS
382 Tune the number of worker threads for the aufs object
386 aufs_io_threads=$withval
389 echo "ERROR: Invalid --with-aufs-threads argument"
394 if test "$aufs_io_threads"; then
395 echo "With $aufs_io_threads aufs threads"
396 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
397 [Defines how many threads aufs uses for I/O])
400 AC_ARG_WITH(pthreads,
401 [ --with-pthreads Use POSIX Threads])
402 if test "$with_pthreads" = "yes"; then
407 [ --with-aio Use POSIX AIO])
408 if test "$with_aio" = "yes"; then
413 [ --with-dl Use dynamic linking])
414 if test "$with_dl" = "yes"; then
418 AC_ARG_ENABLE(storeio,
419 [ --enable-storeio=\"list of modules\"
420 Build support for the list of store I/O modules.
421 The default is only to build the "ufs" module.
422 See src/fs for a list of available modules, or
423 Programmers Guide section <not yet written>
424 for details on how to build your custom store module],
427 for dir in $srcdir/src/fs/*; do
428 module="`basename $dir`"
429 if test -d "$dir" && test "$module" != CVS; then
430 STORE_MODULES="$STORE_MODULES $module"
437 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
441 [ if test -z "$STORE_MODULES"; then
445 if test -n "$STORE_MODULES"; then
446 for module in $STORE_MODULES; do
447 if test -d $srcdir/src/fs/$module; then
450 echo "ERROR: storeio $module does not exists"
454 echo "Store modules built: $STORE_MODULES"
456 for module in $STORE_MODULES; do
457 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
460 dnl remove all but diskd - its the only module that needs to recurse
461 dnl into the sub directory
469 for fs in $STORE_MODULES none; do
474 NEED_DISKDAEMON="true"
479 NEED_DISKTHREADS="true"
484 dnl Automake om MinGW needs explicit exe extension
485 dnl for STORE_TESTS substition
487 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
491 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
496 dnl We have 'fake' modules - aufs and diskd - legacy.
497 for fs in $STORE_MODULES; do
502 STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
503 STORE_LIBS="$STORE_LIBS lib${fs}.a"
508 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
509 echo "adding UFS, as it contains core logic for diskd and aufs"
510 STORE_OBJS="$STORE_OBJS fs/libufs.a"
511 STORE_LIBS="$STORE_LIBS libufs.a"
512 STORE_MODULES="$STORE_MODULES ufs"
513 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
515 dnl Automake om MinGW needs explicit exe extension
516 dnl for STORE_TESTS substition
518 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
523 AC_SUBST(STORE_LINKOBJS)
524 AC_SUBST(STORE_TESTS)
526 AC_ARG_ENABLE(disk-io,
527 [ --enable-disk-io=\"list of modules\"
528 Build support for the list of disk I/O modules.
529 The default is only to build the "Blocking" module.
530 See src/DiskIO for a list of available modules, or
531 Programmers Guide section <not yet written>
532 for details on how to build your custom disk module],
535 for dir in $srcdir/src/DiskIO/*; do
536 module="`basename $dir`"
537 if test -d "$dir" && test "$module" != CVS; then
538 DISK_MODULES="$DISK_MODULES $module"
545 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
549 [ if test -z "$DISK_MODULES"; then
550 DISK_MODULES="Blocking"
553 if test -n "$DISK_MODULES"; then
554 for module in $DISK_MODULES; do
555 if test -d $srcdir/src/DiskIO/$module; then
558 echo "ERROR: disk-io $module does not exists"
562 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
564 for module in $DISK_MODULES; do
565 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
568 for fs in $DISK_MODULES none; do
571 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
572 FOUND_DISKDAEMON="true"
575 FOUND_DISKTHREADS="true"
581 FOUND_BLOCKING="true"
585 if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
586 echo "adding Blocking, as it is used by an active, legacy Store Module"
587 DISK_LIBS="$DISK_LIBS libBlocking.a"
588 DISK_MODULES="$DISK_MODULES Blocking"
589 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
592 if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
593 echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
594 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
595 DISK_MODULES="$DISK_MODULES DiskDaemon"
596 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
597 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
600 if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
601 echo "adding DiskThreads, as it is used by an active, legacy Store Module"
602 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
603 DISK_MODULES="$DISK_MODULES DiskThreads"
604 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
607 if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
608 echo "adding AIO, as it is used by an active, legacy Store Module"
609 DISK_LIBS="$DISK_LIBS libAIO.a"
610 DISK_MODULES="$DISK_MODULES AIO"
611 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
613 echo "IO Modules built: $DISK_MODULES"
616 dnl we know what is being built. now add dependencies.
617 for fs in $DISK_MODULES none; do
620 if test -z "$with_pthreads"; then
624 echo "DiskThreads IO Module used, Windows threads support automatically enabled"
627 echo "DiskThreads IO Module used, pthreads support automatically enabled"
634 if test -z "$with_aio"; then
638 echo "Aio IO Module used, Windows overlapped I/O support automatically enabled"
641 echo "Aio IO Module used, aio support automatically enabled"
651 AC_SUBST(DISK_PROGRAMS)
652 AC_SUBST(DISK_LINKOBJS)
653 AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
654 AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
656 AC_ARG_ENABLE(removal-policies,
657 [ --enable-removal-policies=\"list of policies\"
658 Build support for the list of removal policies.
659 The default is only to build the "lru" module.
660 See src/repl for a list of available modules, or
661 Programmers Guide section 9.9 for details on how
662 to build your custom policy],
665 for dir in $srcdir/src/repl/*; do
666 module="`basename $dir`"
667 if test -d "$dir" && test "$module" != CVS; then
668 REPL_POLICIES="$REPL_POLICIES $module"
675 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
679 [ if test -z "$REPL_POLICIES"; then
683 if test -n "$REPL_POLICIES"; then
684 for module in $REPL_POLICIES; do
685 if test -d $srcdir/src/repl/$module; then
688 echo "ERROR: Removal policy $module does not exists"
692 echo "Removal policies built: $REPL_POLICIES"
693 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
694 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
696 AC_SUBST(REPL_POLICIES)
700 AM_CONDITIONAL(ENABLE_PINGER, false)
702 [ --enable-icmp Enable ICMP pinging],
703 [ if test "$enableval" = "yes" ; then
705 AC_DEFINE(USE_ICMP,1,
706 [ Defined this to use Squid's ICMP features (highly recommended!)
707 When USE_ICMP is defined, Squid will send ICMP pings to origin server sites.])
708 AM_CONDITIONAL(ENABLE_PINGER, true)
712 AM_CONDITIONAL(USE_DELAY_POOLS, false)
713 AC_ARG_ENABLE(delay-pools,
714 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
715 [ if test "$enableval" = "yes" ; then
716 echo "Delay pools enabled"
717 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
718 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
722 dnl disable generic/common adaptation support by default
725 AM_CONDITIONAL(USE_ESI, false)
727 AC_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat. Enabling ESI will cause squid to follow the Edge Acceleration Specification (www.esi.org). This causes squid to IGNORE client Cache-Control headers. DO NOT use this in a squid configured as a web proxy, ONLY use it in a squid configured for webserver acceleration.]),
728 use_esi=$enableval, use_esi=no)
729 if test "$use_esi" = "yes" ; then
730 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
731 AM_CONDITIONAL(USE_ESI, true)
732 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
734 AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
737 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
738 AC_ARG_ENABLE(icap-client,
739 AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
740 use_icap_client=$enableval, use_icap_client=no)
741 if test "$use_icap_client" = "yes" ; then
742 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
743 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
744 ICAP_LIBS="ICAP/libicap.la"
747 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
753 AC_MSG_CHECKING(whether to support eCAP)
758 [support loadable content adaptation modules])
761 case "${enableval}" in
764 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
766 AC_MSG_RESULT([$use_ecap, explicitly])
770 AC_MSG_RESULT([$use_ecap, implicitly])
774 dnl Perform configuration consistency checks for eCAP
775 if test $use_ecap = yes;
777 dnl eCAP support requires loadable modules, which are enabled by default
778 if test "$use_loadable_modules" != "yes"
781 eCAP support requires loadable modules. Please do not use
782 --disable-loadable-modules with --enable-ecap.]);
786 AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
787 if test $use_ecap = yes;
789 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
790 ECAP_LIBS="eCAP/libeCAP.la"
793 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
799 dnl enable adaptation if requested by specific adaptation mechanisms
800 AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
801 if test $use_adaptation = yes
803 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
804 ADAPTATION_LIBS="adaptation/libadaptation.la"
806 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
809 AC_SUBST(ADAPTATION_LIBS)
812 dnl This is a developer only option. Developers know how to set defines
814 dnl AC_ARG_ENABLE(mem-gen-trace,
815 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
816 dnl [ if test "$enableval" = "yes" ; then
817 dnl echo "Memory trace (to file) enabled"
818 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
822 AC_ARG_ENABLE(useragent-log,
823 [ --enable-useragent-log Enable logging of User-Agent header],
824 [ if test "$enableval" = "yes" ; then
825 echo "User-Agent logging enabled"
826 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
827 By default, they are written to useragent.log in the Squid log
832 AC_ARG_ENABLE(referer-log,
833 [ --enable-referer-log Enable logging of Referer header],
834 [ if test "$enableval" = "yes" ; then
835 echo "Referer logging enabled"
836 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
837 By default, they are written to referer.log in the Squid log
844 [ --disable-wccp Disable Web Cache Coordination Protocol],
845 [ if test "$enableval" = "no" ; then
846 echo "Web Cache Coordination Protocol disabled"
850 if test $USE_WCCP = 1; then
851 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
855 AC_ARG_ENABLE(wccpv2,
856 [ --disable-wccpv2 Disable Web Cache Coordination V2 Protocol],
857 [ if test "$enableval" = "no" ; then
858 echo "Web Cache Coordination V2 Protocol disabled"
862 if test $USE_WCCPv2 = 1; then
863 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
866 AC_ARG_ENABLE(kill-parent-hack,
867 [ --enable-kill-parent-hack
868 Kill parent on shutdown],
869 [ if test "$enableval" = "yes" ; then
870 echo "Kill parent on shutdown"
871 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
872 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
879 [ --disable-snmp Disable SNMP monitoring support],
880 [ if test "$enableval" = "no" ; then
881 echo "SNMP monitoring disabled"
885 if test x"$USE_SNMP" = xtrue; then
886 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
887 SNMPLIB='../snmplib/libsnmp.a'
890 AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
892 AC_SUBST(makesnmplib)
894 AC_ARG_ENABLE(cachemgr-hostname,
895 [ --enable-cachemgr-hostname[=hostname]
896 Make cachemgr.cgi default to this host],
899 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
900 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
901 echo "Cachemgr default hostname == host where cachemgr runs"
907 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
908 echo "Cachemgr default hostname set to ${enableval}"
913 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
914 AC_ARG_ENABLE(arp-acl,
915 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
916 [ if test "$enableval" = "yes" ; then
917 echo "ARP ACL lists enabled (ether address)"
930 LIBS="$LIBS -liphlpapi"
933 LIBS="$LIBS -liphlpapi"
936 echo "WARNING: ARP ACL support probably won't work on $host."
940 AC_DEFINE(USE_ARP_ACL,1,[Define this to include code which lets you specify access control elements based on ethernet hardware addresses. This code uses functions found in 4.4 BSD derviations (e.g. FreeBSD, ?).])
941 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
946 AM_CONDITIONAL(ENABLE_HTCP, false)
948 [ --disable-htcp Disable HTCP protocol support],
949 [ if test "$enableval" = "no" ; then
950 echo "HTCP support disabled"
953 if test x$USE_HTCP = xtrue; then
954 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
956 AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
958 dnl SSL is not enabled by default.
959 AM_CONDITIONAL(ENABLE_SSL, false)
961 dnl Default is to use OpenSSL when available
963 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
964 [ if test "$enableval" != "no"; then
965 echo "SSL gatewaying using OpenSSL enabled"
966 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
967 AM_CONDITIONAL(ENABLE_SSL, true)
970 dnl Native Windows port of OpenSSL needs -lgdi32
971 SSLLIB='-lssleay32 -leay32 -lgdi32'
974 SSLLIB='-lssl -lcrypto'
981 dnl User may specify OpenSSL is needed from a non-standard location
983 [ --with-openssl[=prefix]
984 Compile with the OpenSSL libraries. The path to
985 the OpenSSL development libraries and headers
986 installation can be specified if outside of the
987 system standard directories],
989 case "$with_openssl" in
997 SSLLIBDIR="$with_openssl/lib"
998 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1002 if test -n "$USE_OPENSSL"; then
1003 echo "Using OpenSSL MD5 implementation"
1004 AC_DEFINE(USE_OPENSSL,1,[Define this to make use of the OpenSSL libraries for MD5 calculation rather than Squid's own MD5 implementation or if building with SSL encryption (USE_SSL)])
1005 if test -z "$SSLLIB"; then
1006 SSLLIB="-lcrypto" # for MD5 routines
1008 dnl This is a workaround for RedHat 9 brain damage..
1009 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
1010 echo "OpenSSL depends on Kerberos"
1011 SSLLIBDIR="/usr/kerberos/lib"
1012 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1015 if test -n "$SSLLIBDIR"; then
1016 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1021 AC_ARG_ENABLE(forw-via-db,
1022 [ --enable-forw-via-db Enable Forw/Via database],
1023 [ if test "$enableval" = "yes" ; then
1024 echo "FORW-VIA enabled"
1025 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
1029 AC_ARG_ENABLE(cache-digests,
1030 [ --enable-cache-digests Use Cache Digests
1031 see http://www.squid-cache.org/FAQ/FAQ-16.html],
1032 [ if test "$enableval" = "yes" ; then
1033 echo "USE_CACHE_DIGESTS enabled"
1034 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
1038 dnl Select Default Error language
1039 AC_ARG_ENABLE(default-err-language,
1040 [ --enable-default-err-language=lang
1041 Select default language for Error pages (see
1042 errors directory) ],
1044 if test -d $srcdir/errors/$enableval; then
1045 ERR_DEFAULT_LANGUAGE=$enableval
1047 echo "ERROR! Unknown language $enableval, see errors/ directory"
1050 ],[ERR_DEFAULT_LANGUAGE="English"])
1051 AC_SUBST(ERR_DEFAULT_LANGUAGE)
1053 dnl Select languages to be installed
1054 AC_ARG_ENABLE(err-languages,
1055 [ --enable-err-languages=\"lang1 lang2..\"
1056 Select languages to be installed. (All will be
1057 installed by default) ],
1059 for l in $enableval; do
1060 if test -d $srcdir/errors/$l; then :; else
1061 echo "ERROR! Unknown language $$l, see errors/"
1065 ERR_LANGUAGES=$enableval
1068 for l in $srcdir/errors/*; do
1069 if test -f $l/ERR_ACCESS_DENIED; then
1070 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
1074 AC_SUBST(ERR_LANGUAGES)
1076 dnl Size of COSS memory buffer
1077 AC_ARG_WITH(coss-membuf-size,
1078 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
1079 [ if test "$with_coss_membuf_size"; then
1080 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
1081 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
1085 dnl check for netio plugin stuff
1090 [ --disable-poll Disable poll() support. ],
1093 case "$enableval" in
1095 echo "Forcing poll() to be enabled"
1099 echo "Forcing poll() to be disabled"
1107 AC_ARG_ENABLE(select,
1108 [ --disable-select Disable select() support. ],
1111 case "$enableval" in
1113 echo "Forcing select() to be enabled"
1114 SELECT_TYPE="select"
1117 echo "Forcing select() to be disabled"
1124 dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1126 AC_ARG_ENABLE(kqueue,
1127 [ --enable-kqueue Enable kqueue() support (experimental).],
1130 case "$enableval" in
1132 echo "Forcing kqueue() to be enabled"
1133 SELECT_TYPE="kqueue"
1136 echo "Forcing kqueue() to be disabled"
1144 AC_ARG_ENABLE(epoll,
1145 [ --disable-epoll Disable Linux epoll() support.],
1148 case "$enableval" in
1150 echo "Forcing epoll() to be enabled"
1154 echo "Forcing epoll() to be disabled"
1161 dnl Disable HTTP violations
1163 AC_ARG_ENABLE(http-violations,
1164 [ --disable-http-violations
1165 This allows you to remove code which is known to
1166 violate the HTTP protocol specification.],
1167 [ if test "$enableval" = "no" ; then
1168 echo "Disabling HTTP Violations"
1172 if test $http_violations = 1; then
1173 AC_DEFINE(HTTP_VIOLATIONS, 1,[By default (for now anyway) Squid includes options which allows the cache administrator to violate the HTTP protocol specification in terms of cache behaviour. Setting this to '0' will disable such code.])
1175 AC_DEFINE(HTTP_VIOLATIONS, 0)
1178 dnl Enable IPFW Transparent Proxy
1179 AC_ARG_ENABLE(ipfw-transparent,
1180 [ --enable-ipfw-transparent
1181 Enable Transparent Proxy support for systems
1182 using FreeBSD IPFW style redirection.],
1183 [ if test "$enableval" = "yes" ; then
1184 echo "IPFW Transparent Proxy enabled"
1185 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1186 IPFW_TRANSPARENT="yes"
1188 AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1192 dnl Enable IP-Filter Transparent Proxy
1193 AC_ARG_ENABLE(ipf-transparent,
1194 [ --enable-ipf-transparent
1195 Enable Transparent Proxy support for systems
1196 using IP-Filter network address redirection.],
1197 [ if test "$enableval" = "yes" ; then
1198 echo "IP-Filter Transparent Proxy enabled"
1199 AC_DEFINE(IPF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.])
1200 IPF_TRANSPARENT="yes"
1202 AC_DEFINE(IPF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.])
1206 dnl Enable PF Transparent Proxy
1207 AC_ARG_ENABLE(pf-transparent,
1208 [ --enable-pf-transparent
1209 Enable Transparent Proxy support for systems
1210 using PF network address redirection.],
1211 [ if test "$enableval" = "yes" ; then
1212 echo "PF Transparent Proxy enabled"
1213 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1214 PF_TRANSPARENT="yes"
1216 AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1220 dnl Enable Linux Netfilter Transparent Proxy
1221 AC_ARG_ENABLE(linux-netfilter,
1222 [ --enable-linux-netfilter
1223 Enable Transparent Proxy support for Linux (Netfilter) systems.],
1224 [ if test "$enableval" = "yes" ; then
1225 echo "Linux (Netfilter) Transparent Proxy enabled"
1226 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1227 LINUX_NETFILTER="yes"
1229 AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1233 dnl Enable Large file support
1237 AC_ARG_WITH(large-files,
1238 [ --with-large-files Enable support for large files (logs etc).],
1239 [ if test "$withval" = yes; then
1244 dnl UNIX Build environment
1245 AC_ARG_WITH(build-environment,
1246 [ --with-build-environment=model
1247 The build environment to use. Normally one of
1248 POSIX_V6_ILP32_OFF32 32 bits
1249 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1250 POSIX_V6_LP64_OFF64 64 bits
1251 POSIX_V6_LPBIG_OFFBIG large pointers and files
1252 XBS5_ILP32_OFF32 32 bits (legacy)
1253 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1254 XBS5_LP64_OFF64 64 bits (legacy)
1255 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1256 default The default for your OS],
1257 [ case "$withval" in
1259 echo "--with-build-environment expects a build environment string as used by getconf"
1263 buildmodel="$withval"
1268 if test $needlargefiles && test -z "$buildmodel"; then
1269 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
1270 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1275 if test -z "$buildmodel"; then
1276 echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
1280 case "$buildmodel" in
1282 if test "$needlargefiles"; then
1283 echo "Enabling -D_FILE_OFFSET_BITS=64"
1284 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1285 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1289 echo "Using $buildmodel build environment"
1290 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1293 echo "ERROR: Build environment $buildmodel not known to getconf."
1296 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1297 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1298 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1299 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1302 dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1303 dnl for LDFLAGS -xarch=generic64, but:
1304 dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1305 dnl For gcc "-xarch=generic64" must be replaced with "-m64"
1306 dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1308 if test "$GCC" = "yes"; then
1309 echo "Removing -Xa for gcc on $host"
1310 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1311 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1312 echo "Replacing -xarch=generic64 with -m64 for gcc on $host"
1313 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1314 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1316 echo "Removing -Usun on $host"
1317 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1318 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1321 dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1322 dnl so we must adjust something to avoid gcc errors.
1323 dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1324 dnl remove "-n32" from LDFLAGS
1325 dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1326 dnl "-64" from LDFLAGS
1328 if test "$GCC" = "yes"; then
1329 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1330 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1331 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1332 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1333 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1334 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1343 dnl Enable Linux transparent proxy support for obsolete TPROXY
1344 AC_ARG_ENABLE(linux-tproxy,
1345 [ --enable-linux-tproxy
1346 Enable real Transparent Proxy support for Netfilter TPROXY (version 2).],
1347 [ if test "$enableval" = "yes" ; then
1348 echo "Linux Netfilter/TPROXY v2 enabled"
1349 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1351 if test -z "$LINUX_NETFILTER"; then
1352 echo "Linux-Netfilter Transparent Proxy automatically enabled"
1353 LINUX_NETFILTER="yes"
1356 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1360 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1361 dnl Enable Leak Finding Functions
1362 AC_ARG_ENABLE(leakfinder,
1363 [ --enable-leakfinder
1364 Enable Leak Finding code. Enabling this alone
1365 does nothing; you also have to modify the source
1366 code to use the leak finding functions. Probably
1367 Useful for hackers only.],
1368 [ if test "$enableval" = "yes" ; then
1369 echo "Leak-Finding enabled"
1370 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1371 USE_LEAKFINDER="yes"
1372 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1377 AC_ARG_ENABLE(follow-x-forwarded-for,
1378 [ --enable-follow-x-forwarded-for
1379 Enable support for following the X-Forwarded-For
1380 HTTP header to try to find the IP address of the
1381 original or indirect client when a request has
1382 been forwarded through other proxies.],
1383 [ if test "$enableval" = "yes" ; then
1384 echo "follow X-Forwarded-For enabled"
1388 if test $follow_xff = 1; then
1389 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1391 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1395 AC_ARG_ENABLE(ident-lookups,
1396 [ --disable-ident-lookups
1397 This allows you to remove code that performs
1398 Ident (RFC 931) lookups.],
1399 [ if test "$enableval" = "no" ; then
1400 echo "Disabling Ident Lookups"
1404 if test $use_ident = 1; then
1405 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1406 AM_CONDITIONAL(ENABLE_IDENT, true)
1408 AC_DEFINE(USE_IDENT, 0)
1409 AM_CONDITIONAL(ENABLE_IDENT, false)
1412 AM_CONDITIONAL(USE_DNSSERVER, false)
1414 AC_ARG_ENABLE(internal-dns,
1415 [ --disable-internal-dns This prevents Squid from directly sending and
1416 receiving DNS messages, and instead enables the
1417 old external 'dnsserver' processes.],
1418 [ if test "$enableval" = "no" ; then
1419 echo "Disabling Internal DNS queries"
1423 if test "$use_dnsserver" = "yes"; then
1424 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1425 AM_CONDITIONAL(USE_DNSSERVER, true)
1428 dnl Select Default hosts file location
1429 AC_ARG_ENABLE(default-hostsfile,
1430 [ --enable-default-hostsfile=path
1431 Select default location for hosts file.
1432 See hosts_file directive in squid.conf for details],
1434 if test "$enableval" != "none" ; then
1435 if test -f $enableval; then
1436 OPT_DEFAULT_HOSTS=$enableval
1438 echo "Warning Unable to find $enableval"
1442 OPT_DEFAULT_HOSTS="none"
1444 echo "Default hosts file set to: $enableval"
1445 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1446 AC_SUBST(OPT_DEFAULT_HOSTS)
1448 dnl Select auth schemes modules to build
1450 [ --enable-auth=\"list of auth scheme modules\"
1451 Build support for the list of authentication schemes.
1452 The default is to build support for the Basic scheme.
1453 See src/auth for a list of available modules, or
1454 Programmers Guide section authentication schemes
1455 for details on how to build your custom auth scheme
1457 [ case $enableval in
1459 for dir in $srcdir/src/auth/*; do
1460 module="`basename $dir`"
1461 if test -d "$dir" && test "$module" != CVS; then
1462 AUTH_MODULES="$AUTH_MODULES $module"
1469 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1473 [ if test -z "$AUTH_MODULES"; then
1474 AUTH_MODULES="ntlm basic digest negotiate"
1477 if test -n "$AUTH_MODULES"; then
1478 for module in $AUTH_MODULES; do
1479 if test -d $srcdir/src/auth/$module; then
1482 echo "ERROR: Auth scheme $module does not exists"
1485 eval AUTH_MODULE_${module}=yes
1487 echo "Auth scheme modules built: $AUTH_MODULES"
1488 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1489 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1491 echo "Auth scheme modules built: None"
1494 for module in $AUTH_MODULES; do
1495 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1497 AC_SUBST(AUTH_MODULES)
1499 AC_SUBST(AUTH_LINKOBJS)
1502 dnl Select basic auth scheme helpers to build
1503 if test -n "$AUTH_MODULE_basic"; then
1504 BASIC_AUTH_HELPERS="all"
1506 AC_ARG_ENABLE(basic-auth-helpers,
1507 [ --enable-basic-auth-helpers=\"list of helpers\"
1508 This option selects which basic scheme proxy_auth
1509 helpers to build and install as part of the normal
1510 build process. For a list of available
1511 helpers see the helpers/basic_auth directory.],
1512 [ case "$enableval" in
1514 BASIC_AUTH_HELPERS="all"
1517 BASIC_AUTH_HELPERS=""
1520 if test -z "$AUTH_MODULE_basic"; then
1521 echo "WARNING: Basic auth helpers selected without the basic scheme enabled"
1524 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1528 if test "$BASIC_AUTH_HELPERS" = "all" ; then
1529 BASIC_AUTH_HELPERS=""
1530 for dir in $srcdir/helpers/basic_auth/*; do
1531 helper="`basename $dir`"
1532 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1533 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1537 if test -n "$BASIC_AUTH_HELPERS"; then
1538 for helper in $BASIC_AUTH_HELPERS; do
1539 if test -d $srcdir/helpers/basic_auth/$helper; then
1546 echo "ERROR: Basic auth helper $helper does not exists"
1550 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1552 AC_SUBST(BASIC_AUTH_HELPERS)
1554 dnl Select ntlm auth helpers to build
1555 if test -n "$AUTH_MODULE_ntlm"; then
1556 NTLM_AUTH_HELPERS="all"
1558 AC_ARG_ENABLE(ntlm-auth-helpers,
1559 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1560 This option selects which proxy_auth ntlm helpers
1561 to build and install as part of the normal build
1562 process. For a list of available helpers see
1563 the helpers/ntlm_auth directory.],
1564 [ case "$enableval" in
1566 NTLM_AUTH_HELPERS="all"
1569 NTLM_AUTH_HELPERS=""
1572 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1576 if test "$NTLM_AUTH_HELPERS" = "all" ; then
1577 NTLM_AUTH_HELPERS=""
1578 for dir in $srcdir/helpers/ntlm_auth/*; do
1579 helper="`basename $dir`"
1580 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1581 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1585 if test -n "$NTLM_AUTH_HELPERS"; then
1586 for helper in $NTLM_AUTH_HELPERS; do
1587 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1590 echo "ERROR: NTLM Auth helper $helper does not exists"
1594 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1596 AC_SUBST(NTLM_AUTH_HELPERS)
1598 dnl Select negotiate auth helpers to build
1599 if test -n "$AUTH_MODULE_negotiate"; then
1600 NEGOTIATE_AUTH_HELPERS="all"
1602 AC_ARG_ENABLE(negotiate-auth-helpers,
1603 [ --enable-negotiate-auth-helpers=\"list of helpers\"
1604 This option selects which proxy_auth negotiate helpers
1605 to build and install as part of the normal build
1606 process. For a list of available helpers see
1607 the helpers/negotiate_auth directory.],
1608 [ case "$enableval" in
1610 NEGOTIATE_AUTH_HELPERS="all"
1613 NEGOTIATE_AUTH_HELPERS=""
1616 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1620 if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1621 NEGOTIATE_AUTH_HELPERS=""
1622 for dir in $srcdir/helpers/negotiate_auth/*; do
1623 helper="`basename $dir`"
1624 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1625 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1629 if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1630 for helper in $NEGOTIATE_AUTH_HELPERS; do
1631 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1634 echo "ERROR: Negotiate Auth helper $helper does not exists"
1638 echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
1640 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1642 dnl Select digest auth scheme helpers to build
1643 if test -n "$AUTH_MODULE_digest"; then
1644 DIGEST_AUTH_HELPERS=all
1646 AC_ARG_ENABLE(digest-auth-helpers,
1647 [ --enable-digest-auth-helpers=\"list of helpers\"
1648 This option selects which digest scheme authentication
1649 helpers to build and install as part of the normal build
1650 process. For a list of available helpers see the
1651 helpers/digest_auth directory.],
1652 [ case "$enableval" in
1654 DIGEST_AUTH_HELPERS="all"
1657 DIGEST_AUTH_HELPERS=""
1660 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1664 if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1665 DIGEST_AUTH_HELPERS=""
1666 for dir in $srcdir/helpers/digest_auth/*; do
1667 helper="`basename $dir`"
1668 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1669 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1673 if test -n "$DIGEST_AUTH_HELPERS"; then
1674 for helper in $DIGEST_AUTH_HELPERS; do
1675 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1678 echo "ERROR: digest auth helper $helper does not exists"
1682 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1684 AC_SUBST(DIGEST_AUTH_HELPERS)
1686 dnl Enable "NTLM fail open"
1687 AC_ARG_ENABLE(ntlm-fail-open,
1688 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1689 Authentication steps can allow squid to still authenticate
1691 [ if test "$enableval" = "yes" ; then
1692 AC_DEFINE(NTLM_FAIL_OPEN,1,[Define if NTLM is allowed to fail gracefully when a helper has problems. WARNING: This has security implications. DO NOT enable unless you KNOW you need it.])
1696 dnl Select external_acl helpers to build
1697 EXTERNAL_ACL_HELPERS=all
1698 AC_ARG_ENABLE(external-acl-helpers,
1699 [ --enable-external-acl-helpers=\"list of helpers\"
1700 This option selects which external_acl helpers to
1701 build and install as part of the normal build
1702 process. For a list of available helpers see the
1703 helpers/external_acl directory.],
1704 [ case "$enableval" in
1706 EXTERNAL_ACL_HELPERS=all
1709 EXTERNAL_ACL_HELPERS=""
1712 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1716 if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
1717 EXTERNAL_ACL_HELPERS=""
1718 for dir in $srcdir/helpers/external_acl/*; do
1719 helper="`basename $dir`"
1720 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1721 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1725 if test -n "$EXTERNAL_ACL_HELPERS"; then
1726 for helper in $EXTERNAL_ACL_HELPERS; do
1727 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1730 echo "ERROR: external acl helper $helper does not exists"
1734 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1736 AC_SUBST(EXTERNAL_ACL_HELPERS)
1738 AC_ARG_WITH(valgrind-debug,
1739 [ --with-valgrind-debug Include debug instrumentation for use with valgrind],
1748 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1752 if test $valgrind; then
1753 AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
1754 echo "Valgrind debug support enabled"
1758 dnl Disable "memPools" code
1759 AC_ARG_ENABLE(mempools,
1760 [ --disable-mempools Disable memPools. Note that this option now simply sets the
1761 default behaviour. Specific classes can override this at runtime, and
1762 only lib/MemPool.c needs to be altered to change the squid-wide
1763 default for all classes.],
1764 [ if test "$enableval" = "no" ; then
1765 echo "memPools disabled"
1766 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1768 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1771 [ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1774 dnl Enable WIN32 Service compile mode
1775 AC_ARG_ENABLE(win32-service,
1776 [ --enable-win32-service Compile Squid as a WIN32 Service
1777 Works only on Windows NT and Windows 2000 Platforms.],
1778 [ if test "$enableval" = "yes" ; then
1779 echo "Enabling WIN32 run service mode"
1780 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1785 dnl Check for Cyrus SASL
1786 if test "$require_sasl" = "yes"; then
1787 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1788 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1792 if test "$ac_cv_header_sasl_h" = "yes"; then
1796 echo "ERROR: Neither SASL nor SASL2 found"
1803 dnl Disable "unlinkd" code
1804 AC_ARG_ENABLE(unlinkd,
1805 [ --disable-unlinkd Do not use unlinkd],
1806 [ if test "$enableval" = "no" ; then
1812 # Here we should probably use some magic depending on the selected
1816 if test "$use_unlinkd" = "yes"; then
1817 echo "unlinkd enabled"
1818 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1819 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1821 echo "unlinkd disabled"
1822 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1825 dnl Enable backtraces on fatal errors
1826 AC_ARG_ENABLE(stacktraces,
1827 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1828 [ if test "$enableval" = "yes" ; then
1829 echo "Enabling automatic stack backtraces on fatal errors"
1830 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1834 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1835 dnl Enable USE_XPROF_STATS
1836 AC_ARG_ENABLE(cpu-profiling,
1837 [ --enable-cpu-profiling
1838 This option allows you to see which internal functions
1839 in Squid are consuming how much CPU. Compiles in probes
1840 that measure time spent in probed functions. Needs
1841 source modifications to add new probes. This is meant
1842 for developers to assist in performance optimisations
1843 of Squid internal functions.
1844 If you are not developer and not interested in the stats
1845 you shouldn't enable this, as overhead added, although
1846 small, is still overhead. See lib/Profiler.c for more.
1848 [ if test "$enableval" = "yes" ; then
1849 echo "Enabling cpu-profiling"
1850 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1851 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1855 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1856 AC_ARG_ENABLE(x_accelerator_vary,
1857 [ --enable-x-accelerator-vary
1858 Enable support for the X-Accelerator-Vary
1859 HTTP header. Can be used to indicate
1860 variance within an accelerator setup.
1861 Typically used together with other code
1862 that adds custom HTTP headers to the requests.],
1863 [ if test "$enableval" = "yes" ; then
1864 echo "Enabling support for X-Accelerator-Vary"
1865 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1869 dnl Enable IPv6 support
1870 AC_MSG_CHECKING([whether to enable IPv6])
1873 [ --enable-ipv6 Enable ipv6 support],
1874 [ AC_MSG_RESULT(yes)
1875 AC_CACHE_CHECK([if PF_INET6 is available], $enableval,
1877 [ /* PF_INET6 available check */
1878 # include <sys/types.h>
1879 # include <sys/socket.h>
1881 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
1887 [ AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
1891 [ AC_DEFINE(USE_IPV6,0,[0 == Disable support for IPv6])
1892 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
1893 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
1894 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
1899 [ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6])
1900 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
1901 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
1902 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
1906 if test "$use_ipng" = "yes"; then
1908 dnl Check for Windows XP option
1909 AC_MSG_CHECKING([for IPv6 split-stack requirement])
1910 AC_ARG_WITH(ipv6-split-stack,
1911 [ --with-ipv6-split-stack Require IPv6 split-stack support. Requires IPv6 Support.],
1912 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(yes)],
1913 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(no)]
1916 dnl Check for IPv6 Windows Vista option
1917 dnl Also useful for other OS
1918 AC_MSG_CHECKING([for IPv6 v4-mapping requirement])
1919 AC_ARG_WITH(ipv4-mapped,
1920 [ --with-ipv4-mapped Hybrid-Stack OS require Squid to do any v4-mapping. Requires IPv6 Support.],
1921 [AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets]) AC_MSG_RESULT(yes)],
1922 [AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets]) AC_MSG_RESULT(no)]
1925 dnl Check for IPv6-pure option
1926 AC_MSG_CHECKING([for IPv6-Localhost requirement])
1927 AC_ARG_WITH(localhost-ipv6,
1928 [ --with-localhost-ipv6 Prefer IPv6 localhost address over IPv4. Requires IPv6 Support.
1929 Treats 127.0.0.1 and ::1 as identical and converts all inputs of to ::1
1930 This depends on Dual-Stack support in the OS and all applications
1931 squid contacts via localhost being IPv6 enabled.
1932 Default: OFF. Treats these two IP as different, squid.conf must
1933 define both 127.0.0.1 and ::1 for the localhost ACL, etc. ],
1934 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [Convert IPv4-localhost requests to IPv6. Default: keep seperate.]) AC_MSG_RESULT(yes)],
1935 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [Convert IPv4-localhost requests to IPv6. Default: Keep seperate.]) AC_MSG_RESULT(no)]
1938 # end IPv6-only options
1941 AC_ARG_ENABLE(zph-qos,
1942 [ --enable-zph-qos Enable ZPH QOS support],
1943 [ if test "$enableval" = "yes" ; then
1944 echo "ZPH QOS enabled"
1945 AC_DEFINE(USE_ZPH_QOS,1,
1946 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
1947 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
1951 dnl Optional CNAME-Recursion by Internal DNS engine
1952 AC_MSG_CHECKING([whether DNS CNAME recursion wanted])
1953 AC_ARG_WITH(dns-cname,
1954 [ --with-dns-cname Enable CNAME-Recursion in Internal DNS stub.],
1955 [AC_DEFINE(DNS_CNAME, 1, [ 1 == Enable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(yes)],
1956 [AC_DEFINE(DNS_CNAME, 0, [ 0 == Disable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(no)]
1959 dnl Check whether this OS defines ss_len as a member of sockaddr_storage
1960 AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
1961 ac_cv_have_ss_len_in_struct_ss, [
1963 #include <sys/types.h>
1964 #include <sys/socket.h>
1965 #include <netinet/in.h>
1967 [ struct sockaddr_storage s; s.ss_len = 1; ],
1968 [ ac_cv_have_ss_len_in_struct_ss="yes" ],
1969 [ ac_cv_have_ss_len_in_struct_ss="no" ]
1972 if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
1973 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
1975 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
1978 dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
1979 AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
1980 ac_cv_have_sin_len_in_struct_sai, [
1982 #include <sys/types.h>
1983 #include <sys/socket.h>
1985 [ struct sockaddr_in s; s.sin_len = 1; ],
1986 [ ac_cv_have_sin_len_in_struct_sai="yes" ],
1987 [ ac_cv_have_sin_len_in_struct_sai="no" ]
1990 if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
1991 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
1993 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
1996 dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
1997 AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
1998 ac_cv_have_sin6_len_in_struct_sai, [
2000 #include <sys/types.h>
2001 #include <sys/socket.h>
2003 [ struct sockaddr_in6 s; s.sin6_len = 1; ],
2004 [ ac_cv_have_sin6_len_in_struct_sai="yes" ],
2005 [ ac_cv_have_sin6_len_in_struct_sai="no" ]
2008 if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2009 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2011 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2015 AC_ARG_WITH(filedescriptors,
2016 [ --with-filedescriptors=NUMBER
2017 Force squid to support NUMBER filedescriptors],
2018 [ squid_filedescriptors_num=$withval ])
2020 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
2021 if $CPPUNITCONFIG --help >/dev/null; then
2022 echo "using system installed cppunit"
2023 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2025 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2027 echo "cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail."
2029 SQUID_CPPUNIT_LIBS=''
2030 SQUID_CPPUNIT_INC=''
2033 AC_ARG_WITH(cppunit-basedir,
2034 [ --with-cppunit-basedir=/path/to/cppunit-base
2035 Path where the cppunit headers are libraries are found
2038 [ if test -f $withval/include/cppunit/TestCase.h; then
2039 echo "Using cppunit includes from $withval"
2040 SQUID_CPPUNIT_INC="-I${withval}/include"
2042 echo "ERROR: Cannot find cppunit at $withval"
2045 if test -f $withval/lib/libcppunit.la; then
2046 echo "Using cppunit lib from $withval"
2047 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2048 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2050 echo "ERROR: Cannot find cppunit at $withval"
2054 AC_SUBST(SQUID_CPPUNIT_LIBS)
2055 AC_SUBST(SQUID_CPPUNIT_LA)
2056 AC_SUBST(SQUID_CPPUNIT_INC)
2058 # Force some compilers to use ANSI features
2062 if test "$ac_cv_prog_CC" = "cc" ; then
2063 echo "adding '-std1' to cc args for $host"
2069 if test "$ac_cv_prog_CC" = "cc" ; then
2070 echo "adding '-Ae' to cc args for $host"
2077 dnl Check for programs
2081 AC_PATH_PROG(SH, sh, /bin/sh)
2082 AC_PATH_PROG(FALSE, false, /usr/bin/false)
2083 AC_PATH_PROG(TRUE, true, /usr/bin/true)
2084 AC_PATH_PROG(RM, rm, $FALSE)
2085 AC_PATH_PROG(MV, mv, $FALSE)
2086 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
2087 AC_PATH_PROG(LN, ln, cp)
2088 AC_PATH_PROG(PERL, perl, none)
2089 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2090 AC_PATH_PROG(AR, ar, $FALSE)
2092 if test "$ac_cv_path_PERL" = "none"; then
2093 echo "Perl is required to compile Squid"
2094 echo "Please install Perl and then re-run configure"
2100 echo "Disabling 'ranlib' for HP-UX..."
2114 dnl Check for headers
2146 netinet/in_systm.h \
2147 netinet/ip_fil_compat.h \
2205 linux/netfilter_ipv4.h \
2206 linux/netfilter_ipv4/ip_tproxy.h \
2208 SQUID_DEFAULT_INCLUDES
2212 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2213 #if HAVE_NETINET_IN_H
2214 #include <netinet/in.h>
2218 dnl *BSD dont include the depenencies for all their net/ and netinet/ files
2219 dnl We must include a few basic type headers for them to work.
2226 netinet/ip_compat.h\
2235 SQUID_BSDNET_INCLUDES)
2237 AC_CHECK_HEADERS([libxml/parser.h], [], [
2238 SAVED_CPPFLAGS="$CPPFLAGS"
2239 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2240 unset ac_cv_header_libxml_parser_h
2241 AC_CHECK_HEADERS([libxml/parser.h], [], [
2242 CPPFLAGS="$SAVED_CPPFLAGS"
2250 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2253 #include <sys/time.h>
2260 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2261 #if HAVE_SYS_TYPES_H
2262 #include <sys/types.h>
2268 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2269 #if HAVE_SYS_TYPES_H
2270 #include <sys/types.h>
2276 dnl Override rusage() detect on MinGW because is emulated in source code
2279 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2280 ac_cv_func_getrusage='yes'
2281 echo "Using own rusage on Windows."
2284 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2286 #include <sys/time.h>
2288 #if HAVE_SYS_RESOURCE_H
2289 #include <sys/resource.h>
2294 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2295 #if HAVE_SYS_TYPES_H
2296 #include <sys/types.h>
2298 #include <netinet/in.h>
2299 #include <netinet/in_systm.h>
2300 #include <netinet/ip.h>
2301 #if defined (__linux__) || defined (__CYGWIN__)
2310 dnl Check for typedefs
2311 AC_CHECK_SIZEOF(void *)
2313 dnl 8 bit integers - int8_t
2314 dnl if this is defined we trust it to be 8 bits
2315 AC_CHECK_TYPE(int8_t,[
2316 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2317 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2318 ],,SQUID_DEFAULT_INCLUDES)
2321 AC_CHECK_TYPE(char,[
2322 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2323 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2324 ],,SQUID_DEFAULT_INCLUDES)
2326 dnl unsigned 8 bit ints - u_int8_t
2327 dnl if this is defined we trust it to be 8 bits
2328 AC_CHECK_TYPE(u_int8_t,[
2329 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2330 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2331 ],,SQUID_DEFAULT_INCLUDES)
2334 dnl if this is defined we trust it to be 8 bits
2335 AC_CHECK_TYPE(uint8_t,[
2336 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2337 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2338 ],,SQUID_DEFAULT_INCLUDES)
2340 dnl 16 bit integers - int16_t
2341 dnl if this is defined we trust it to be 16 bits
2342 AC_CHECK_TYPE(int16_t,[
2343 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2344 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2345 ],,SQUID_DEFAULT_INCLUDES)
2348 AC_CHECK_TYPE(short,[
2349 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2350 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2351 ],,SQUID_DEFAULT_INCLUDES)
2355 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2356 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2357 ],,SQUID_DEFAULT_INCLUDES)
2359 dnl unsigned 16 bit ints - u_int16_t
2360 dnl if this is defined we trust it to be 16 bits
2361 AC_CHECK_TYPE(u_int16_t,[
2362 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2363 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2364 ],,SQUID_DEFAULT_INCLUDES)
2367 dnl if this is defined we trust it to be 16 bits
2368 AC_CHECK_TYPE(uint16_t,[
2369 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2370 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2371 ],,SQUID_DEFAULT_INCLUDES)
2373 dnl 32 bit signed int - int32_t
2374 dnl if this is defined we trust it to be 32 bits
2375 AC_CHECK_TYPE(int32_t,[
2376 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2377 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2378 ],,SQUID_DEFAULT_INCLUDES)
2381 AC_CHECK_TYPE(long,[
2382 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2383 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2384 ],,SQUID_DEFAULT_INCLUDES)
2386 dnl 32 bit unsigned int - u_int32_t
2387 dnl if this is defined we trust it to be 32 bits
2388 AC_CHECK_TYPE(u_int32_t,[
2389 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2390 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2391 ],,SQUID_DEFAULT_INCLUDES)
2394 dnl if this is defined we trust it to be 32 bits
2395 AC_CHECK_TYPE(uint32_t,[
2396 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2397 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2398 ],,SQUID_DEFAULT_INCLUDES)
2400 dnl 64 bit signed - int64_t
2401 dnl if this is defind we trust it to be 64 bits
2402 AC_CHECK_TYPE(int64_t,[
2403 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2404 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2405 ],,SQUID_DEFAULT_INCLUDES)
2408 dnl if this is defind we trust it to be 64 bits
2409 AC_CHECK_TYPE(__int64,[
2410 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2411 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2412 ],,SQUID_DEFAULT_INCLUDES)
2415 AC_CHECK_TYPE(long long,[
2416 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2417 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2418 ],,SQUID_DEFAULT_INCLUDES)
2420 dnl 64 bit unsigned - u_int64_t
2421 dnl if this is defind we trust it to be 64 bits
2422 AC_CHECK_TYPE(u_int64_t,[
2423 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2424 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2425 ],,SQUID_DEFAULT_INCLUDES)
2428 dnl if this is defind we trust it to be 64 bits
2429 AC_CHECK_TYPE(uint64_t,[
2430 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2431 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2432 ],,SQUID_DEFAULT_INCLUDES)
2434 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2435 dnl that is incompatible with the updated Solaris header files.
2436 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2437 AC_CHECK_TYPE(pad128_t,
2438 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2439 ,SQUID_DEFAULT_INCLUDES)
2441 AC_CHECK_TYPE(upad128_t,
2442 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2443 ,SQUID_DEFAULT_INCLUDES)
2445 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2446 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2447 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2448 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2449 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2450 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2451 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2452 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2454 dnl Check for special functions
2457 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2458 #include <sys/types.h>
2459 #include <sys/socket.h>
2465 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2466 #include <sys/ipc.h>
2467 #include <sys/msg.h>])
2469 dnl Check for needed libraries
2470 AC_CHECK_LIB(nsl, main)
2471 AC_CHECK_LIB(socket, main)
2472 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2475 AC_MSG_CHECKING(for winsock)
2477 for curlib in ws2_32 wsock32; do
2478 LIBS="$LIBS -l$curlib"
2480 char __attribute__((stdcall)) socket(int,int,int);
2481 char __attribute__((stdcall)) select(int,int,int,int,int);
2482 char __attribute__((stdcall)) closesocket(int);
2483 char __attribute__((stdcall)) gethostname(int,int);
2491 have_winsock=yes, have_winsock=no)
2493 if test $have_winsock = yes; then
2494 ac_cv_func_select='yes'
2495 if test $curlib = ws2_32; then
2496 have_winsock=winsock2
2502 AC_MSG_RESULT($have_winsock)
2503 if test $have_winsock = winsock2; then
2504 AC_CHECK_HEADERS(winsock2.h)
2506 AC_CHECK_HEADERS(winsock.h)
2511 dnl Ripped from the Samba sources
2512 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2514 #include <sys/types.h>
2517 #include <sys/socket.h>
2518 #include <sys/un.h>],
2520 struct sockaddr_un sunaddr;
2521 sunaddr.sun_family = AF_UNIX;
2523 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2524 if test x"$squid_cv_unixsocket" = x"yes"; then
2525 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2529 AC_CHECK_LIB(gnumalloc, main)
2530 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2531 echo "Disabling extended malloc functions when using gnumalloc"
2532 ac_cv_func_mallinfo=no
2533 ac_cv_func_mallocblksize=no
2534 ac_cv_func_mallopt=no
2538 echo "skipping libmalloc check for $host"
2541 echo "skipping libmalloc check for $host"
2545 AC_CHECK_LIB(malloc, main)
2550 AC_CHECK_LIB(bsd, main)
2551 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2552 AC_CHECK_LIB(bind, gethostbyname)
2553 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2556 echo "skipping libresolv checks for $host"
2559 AC_CHECK_LIB(resolv, main)
2565 echo "Use MSVCRT for math functions."
2568 AC_CHECK_LIB(m, main)
2572 dnl Check for libcrypt
2573 dnl Some of our helpers use crypt(3) which may be in libc, or in
2574 dnl libcrypt (eg FreeBSD)
2575 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2577 dnl Solaris10 provides MD5 natively through libmd5
2578 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
2582 dnl Check for libdl, used by auth_modules/PAM
2583 if test "$with_dl" = "yes"; then
2584 AC_CHECK_LIB(dl, dlopen)
2587 dnl Check for pthreads
2588 dnl We use pthreads when doing ASYNC I/O
2589 if test "$with_pthreads" = "yes"; then
2590 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2591 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
2593 i386-unknown-freebsd*)
2594 if test "$GCC" = "yes" ; then
2595 if test -z "$PRESET_LDFLAGS"; then
2596 LDFLAGS="$LDFLAGS -pthread"
2601 if test "$GCC" = "yes" ; then
2602 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2603 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
2605 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2606 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
2610 AC_CHECK_LIB(pthread, main)
2614 dnl We use AIO in the coss store
2615 if test "$with_aio" = "yes"; then
2616 dnl On some systems POSIX AIO functions are in libaio
2617 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
2620 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2621 dnl Robert Side <rside@aiinc.bc.ca>
2622 dnl Mon, 18 Jan 1999 17:48:00 GMT
2625 AC_CHECK_LIB(intl, strftime)
2629 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2630 dnl only with Windows LDAP libraries using -lwldap32
2633 LIB_LDAP="-lwldap32"
2638 dnl LDAP helpers need to know if -llber is needed or not
2639 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2648 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
2649 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2651 #if HAVE_SYS_TYPES_H
2652 #include <sys/types.h>
2662 [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)],
2663 ac_cv_dbopen_libdb="yes",
2664 ac_cv_dbopen_libdb="no")
2667 if test $ac_cv_dbopen_libdb = yes; then
2672 dnl System-specific library modifications
2676 if test "$GCC" = "yes"; then
2677 echo "Removing -O for gcc on $host"
2678 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2682 echo "Removing -lsocket for IRIX..."
2683 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2684 echo "Removing -lnsl for IRIX..."
2685 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2686 ac_cv_lib_nsl_main=no
2687 echo "Removing -lbsd for IRIX..."
2688 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2690 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2691 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2692 dnl Please change your configure script. AIX doesn't need -lbsd.
2694 echo "Removing -lbsd for AIX..."
2695 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2698 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2699 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2700 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2702 [*-*-solaris2.[0-4]])
2703 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2705 [*-sony-newsos[56]*])
2706 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2710 # Remove optimization for GCC 2.95.[123]
2711 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2712 if test "$GCC" = "yes"; then
2713 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2716 echo "Removing -O for gcc on $host with GCC $GCCVER"
2717 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2722 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2725 if test `uname -v` = "2.03"; then
2726 echo "disabling mallinfo for $host"
2727 ac_cv_func_mallinfo=no
2732 dnl This has to be before AC_CHECK_FUNCS
2733 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2734 # when running configure.
2735 if test -z "$ac_cv_func_poll"; then
2738 # John Kay (jkay@nlanr.net) 19970818
2739 echo "disabling poll for $host..."
2740 ac_cv_func_poll='no'
2744 echo "disabling poll for $host..."
2745 ac_cv_func_poll='no'
2748 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2749 # poll is problematic on Linux. We disable it
2750 # by default until Linux gets it right.
2751 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2752 if test $rev -lt 002002; then
2753 echo "disabling poll for $host < 2.2..."
2754 ac_cv_func_poll='no'
2757 [powerpc-ibm-aix4.1.*])
2758 # Mike Laster (mlaster@metavillage.com) 19981021
2759 echo "disabling poll for $host..."
2760 ac_cv_func_poll='no'
2763 # Robert Side <rside@aiinc.bc.ca>
2764 # Mon, 18 Jan 1999 17:48:00 GMT
2765 echo "disabling poll for $host..."
2766 ac_cv_func_poll='no'
2771 dnl Override statfs() detect on MinGW becasue is emulated in source code
2774 ac_cv_func_statfs='yes'
2778 dnl Check for library functions
2780 backtrace_symbols_fd \
2810 pthread_attr_setschedparam \
2811 pthread_attr_setscope \
2812 pthread_setschedparam \
2842 dnl ... and some we provide local replacements for
2854 # check for crypt, may require -lcrypt
2856 LIBS="$LIBS $CRYPTLIB"
2857 AC_CHECK_FUNCS(crypt)
2860 # Check for libepoll
2862 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
2863 AC_SUBST(EPOLL_LIBS)
2865 # Check for epoll_ctl, may need -lepoll
2867 LIBS="$LIBS $LIB_EPOLL"
2868 AC_CHECK_FUNCS(epoll_ctl)
2871 dnl Verify that epoll really works
2872 if test $ac_cv_func_epoll_ctl = yes; then
2873 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
2875 #include <sys/epoll.h>
2878 int main(int argc, char **argv)
2880 int fd = epoll_create(256);
2882 perror("epoll_create:");
2887 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
2890 dnl Magic which checks whether we are forcing a type of comm loop we
2891 dnl are actually going to (ab)use
2893 dnl Actually do the define magic now
2894 dnl mostly ripped from squid-commloops, thanks to adrian and benno
2896 if test -n "$SELECT_TYPE"; then
2897 : # Already decided above. Nothing to do here
2898 elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
2900 elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
2901 SELECT_TYPE="kqueue"
2902 elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
2904 elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
2907 SELECT_TYPE="select_win32"
2910 SELECT_TYPE="select"
2914 echo "Eep! Can't find poll, kqueue, epoll, or select!"
2915 echo "I'll try select and hope for the best."
2916 SELECT_TYPE="select"
2917 AC_DEFINE(USE_SELECT,1)
2920 echo "Using ${SELECT_TYPE} for the IO loop."
2922 AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2923 AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2924 AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2925 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2926 AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2927 AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2928 AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2930 case $SELECT_TYPE in
2932 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2935 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2938 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2941 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
2944 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2950 dnl Yay! Another Linux brokenness. Its not good enough
2951 dnl to know that setresuid() exists, because RedHat 5.0 declares
2952 dnl setresuid() but doesn't implement it.
2954 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2958 if(setresuid(-1,-1,-1)) {
2959 perror("setresuid:");
2964 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2966 if test "$ac_cv_func_setresuid" = "yes" ; then
2967 AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Its not good enough to know that setresuid() exists, because RedHat 5.0 declare setresuid() but doesn't implement it.])
2970 dnl Yay! This one is a MacOSX brokenness. Its not good enough
2971 dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
2972 dnl copy that crashes with a buffer over-run!
2974 AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
2979 // we expect this to succeed, or crash on over-run.
2980 // if it passes otherwise we may need a better check.
2981 int main(int argc, char **argv)
2984 char *str = malloc(size);
2985 memset(str, 'x', size);
2986 strnstr(str, "fubar", size);
2989 ],ac_cv_func_strnstr="yes",ac_cv_func_strnstr="no")
2991 if test "$ac_cv_func_strnstr" = "yes" ; then
2992 AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
2994 AC_DEFINE(HAVE_STRNSTR,0,[Yay! A MacOS X brokenness. Its not good enough to know that strnstr() exists, because MacOSX 10.4 and earlier may have a buffer overrun.])
2998 AM_CONDITIONAL(NEED_OWN_STRSEP, false)
2999 if test "$ac_cv_func_strsep" = "no" ; then
3000 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
3003 AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
3004 if test "$ac_cv_func_strtoll" = "no" ; then
3005 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
3009 dnl Test for va_copy
3011 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
3014 void f (int i, ...) {
3015 va_list args1, args2;
3016 va_start (args1, i);
3017 va_copy (args2, args1);
3018 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3020 va_end (args1); va_end (args2);
3026 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
3028 if test "$ac_cv_func_va_copy" = "yes" ; then
3029 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
3033 dnl Some systems support __va_copy
3035 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
3038 void f (int i, ...) {
3039 va_list args1, args2;
3040 va_start (args1, i);
3041 __va_copy (args2, args1);
3042 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3044 va_end (args1); va_end (args2);
3050 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
3052 if test "$ac_cv_func___va_copy" = "yes" ; then
3053 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
3056 dnl IP-Filter support requires ipf header files. These aren't
3057 dnl installed by default, so we need to check for them
3058 if test "$IPF_TRANSPARENT" ; then
3059 AC_MSG_CHECKING(if IP-Filter header files are installed)
3060 # hold on to your hats...
3061 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3062 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
3063 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3064 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
3065 have_ipfilter_compat_header="yes"
3067 if test "x$have_ipfilter_compat_header" = "xyes" &&
3068 test "$ac_cv_header_ip_fil_h" = "yes" &&
3069 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3070 IPF_TRANSPARENT="yes"
3071 AC_DEFINE(IPF_TRANSPARENT, 1)
3072 elif test "$have_ipfilter_compat_header" = "yes" &&
3073 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3074 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3075 IPF_TRANSPARENT="yes"
3076 AC_DEFINE(IPF_TRANSPARENT, 1)
3078 IPF_TRANSPARENT="no"
3079 AC_DEFINE(IPF_TRANSPARENT, 0)
3081 AC_MSG_RESULT($IPF_TRANSPARENT)
3083 if test "$IPF_TRANSPARENT" = "no" ; then
3084 echo "WARNING: Cannot find necessary IP-Filter header files"
3085 echo " Transparent Proxy support WILL NOT be enabled"
3087 elif test "$IPF_TRANSPARENT" = "yes" ; then
3088 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3089 dnl Solaris minor version (8, 9, 10, ...)
3092 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3093 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3094 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3101 dnl PF support requires a header file.
3102 if test "$PF_TRANSPARENT" ; then
3103 AC_MSG_CHECKING(if PF header file is installed)
3104 # hold on to your hats...
3105 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
3106 PF_TRANSPARENT="yes"
3107 AC_DEFINE(PF_TRANSPARENT, 1)
3110 AC_DEFINE(PF_TRANSPARENT, 0)
3112 AC_MSG_RESULT($PF_TRANSPARENT)
3114 if test "$PF_TRANSPARENT" = "no" ; then
3115 echo "WARNING: Cannot find necessary PF header file"
3116 echo " Transparent Proxy support WILL NOT be enabled"
3120 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3121 dnl Shamelessly copied from above
3122 if test "$LINUX_NETFILTER" ; then
3123 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
3124 # hold on to your hats...
3125 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3126 LINUX_NETFILTER="yes"
3127 AC_DEFINE(LINUX_NETFILTER, 1)
3129 LINUX_NETFILTER="no"
3130 AC_DEFINE(LINUX_NETFILTER, 0)
3132 AC_MSG_RESULT($LINUX_NETFILTER)
3134 if test "$LINUX_NETFILTER" = "no" ; then
3135 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
3136 echo " Linux Transparent and Intercepting Proxy support WILL NOT be enabled"
3140 dnl Linux Netfilter/TPROXYv2 support requires some specific header files
3141 dnl Shamelessly copied from shamelessly copied from above
3142 if test "$LINUX_TPROXY2" ; then
3143 AC_MSG_CHECKING(if TPROXYv2 header files are installed)
3144 # hold on to your hats...
3145 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
3147 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3150 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3152 AC_MSG_RESULT($LINUX_TPROXY2)
3153 if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3154 echo "WARNING: Cannot find TPROXY v2 headers, you need to install the"
3155 echo "tproxy package from:"
3156 echo " - lynx http://www.balabit.com/downloads/tproxy/"
3157 echo "Or select the '--enable-linux-netfilter' option instead for Netfilter support."
3162 if test -z "$USE_GNUREGEX" ; then
3164 *-sun-solaris2.[[0-4]])
3172 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3173 if test -z "$USE_GNUREGEX"; then
3174 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
3177 AC_TRY_COMPILE([#include <sys/types.h>
3178 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
3183 AC_MSG_RESULT($USE_GNUREGEX)
3184 if test "$USE_GNUREGEX" = "yes"; then
3186 LIBREGEX="libregex.a"
3187 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
3192 dnl Not cached since people are likely to tune this
3193 AC_MSG_CHECKING(Default FD_SETSIZE value)
3202 #include <sys/time.h>
3204 #if HAVE_SYS_SELECT_H
3205 #include <sys/select.h>
3207 #if HAVE_SYS_TYPES_H
3208 #include <sys/types.h>
3211 #include <winsock.h>
3214 #include <winsock2.h>
3217 FILE *fp = fopen("conftestval", "w");
3218 fprintf (fp, "%d\n", FD_SETSIZE);
3222 DEFAULT_FD_SETSIZE=`cat conftestval`,
3223 DEFAULT_FD_SETSIZE=256,
3224 DEFAULT_FD_SETSIZE=256)
3225 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
3226 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
3229 dnl Not cached since people are likely to tune this
3230 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
3231 dnl damn! FreeBSD's pthreads breaks dup2().
3233 if test -n "$squid_filedescriptors_num" ; then
3234 SQUID_MAXFD=$squid_filedescriptors_num
3235 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3238 i386-unknown-freebsd*)
3239 if echo "$LDFLAGS" | grep -q pthread; then
3240 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3246 #include <sys/time.h> /* needed on FreeBSD */
3247 #include <sys/param.h>
3248 #include <sys/resource.h>
3252 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
3253 /* getrlimit and sysconf returns bogous values on cygwin32.
3254 * Number of fds is virtually unlimited in cygwin (sys/param.h)
3255 * __CYGWIN32__ is deprecated.
3261 #if defined(RLIMIT_NOFILE)
3262 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3263 perror("getrlimit: RLIMIT_NOFILE");
3265 #if defined(__APPLE__)
3266 /* asking for more than OPEN_MAX fails on Leopard */
3267 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3269 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3271 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3272 perror("setrlimit: RLIMIT_NOFILE");
3275 #elif defined(RLIMIT_OFILE)
3276 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3277 perror("getrlimit: RLIMIT_OFILE");
3279 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3280 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3281 perror("setrlimit: RLIMIT_OFILE");
3284 #endif /* RLIMIT_NOFILE */
3285 #endif /* HAVE_SETRLIMIT */
3286 /* by starting at 2^14, we will never get higher
3287 than 2^15 for SQUID_MAXFD */
3291 if (dup2(0, i) < 0) {
3299 #endif /* IF !DEF CYGWIN */
3300 fp = fopen("conftestval", "w");
3301 fprintf (fp, "%d\n", i & ~0x3F);
3305 SQUID_MAXFD=`cat conftestval`,
3308 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3314 AC_MSG_RESULT($SQUID_MAXFD)
3316 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3317 if test "$SQUID_MAXFD" -lt 512 ; then
3318 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
3319 echo " cache will be very busy. Please see the FAQ page"
3320 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
3321 echo " on how to increase your filedescriptor limit"
3326 if test `expr $SQUID_MAXFD % 64` != 0; then
3327 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
3328 echo " on certain platforms."
3332 dnl Not cached since people are likely to tune this
3333 AC_MSG_CHECKING(Default UDP send buffer size)
3337 #include <sys/types.h>
3338 #if HAVE_SYS_SOCKET_H
3339 #include <sys/socket.h>
3341 #if HAVE_NETINET_IN_H
3342 #include <netinet/in.h>
3345 #include <winsock.h>
3348 #include <winsock2.h>
3353 int fd,val=0,len=sizeof(int);
3354 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3356 WSAStartup(2, &wsaData);
3358 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3359 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3360 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3363 if (val<=0) exit(1);
3364 fp = fopen("conftestval", "w");
3365 fprintf (fp, "%d\n", val);
3369 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3370 SQUID_DETECT_UDP_SO_SNDBUF=16384,
3371 SQUID_DETECT_UDP_SO_SNDBUF=16384)
3372 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3373 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3375 dnl Not cached since people are likely to tune this
3376 AC_MSG_CHECKING(Default UDP receive buffer size)
3380 #include <sys/types.h>
3381 #if HAVE_SYS_SOCKET_H
3382 #include <sys/socket.h>
3384 #if HAVE_NETINET_IN_H
3385 #include <netinet/in.h>
3388 #include <winsock.h>
3391 #include <winsock2.h>
3396 int fd,val=0,len=sizeof(int);
3397 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3399 WSAStartup(2, &wsaData);
3401 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3402 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3403 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3406 if (val <= 0) exit(1);
3407 fp = fopen("conftestval", "w");
3408 fprintf (fp, "%d\n", val);
3412 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3413 SQUID_DETECT_UDP_SO_RCVBUF=16384,
3414 SQUID_DETECT_UDP_SO_RCVBUF=16384)
3415 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3416 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3418 dnl Not cached since people are likely to tune this
3419 AC_MSG_CHECKING(Default TCP send buffer size)
3423 #include <sys/types.h>
3424 #if HAVE_SYS_SOCKET_H
3425 #include <sys/socket.h>
3427 #if HAVE_NETINET_IN_H
3428 #include <netinet/in.h>
3431 #include <winsock.h>
3434 #include <winsock2.h>
3439 int fd,val=0,len=sizeof(int);
3440 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3442 WSAStartup(2, &wsaData);
3444 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3445 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3446 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3449 if (val <= 0) exit(1);
3450 fp = fopen("conftestval", "w");
3451 fprintf (fp, "%d\n", val);
3455 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
3456 SQUID_TCP_SO_SNDBUF=16384,
3457 SQUID_TCP_SO_SNDBUF=16384)
3458 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3459 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3460 echo "Limiting send buffer size to 32K"
3461 SQUID_TCP_SO_SNDBUF=32768
3463 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3465 dnl Not cached since people are likely to tune this
3466 AC_MSG_CHECKING(Default TCP receive buffer size)
3470 #include <sys/types.h>
3471 #if HAVE_SYS_SOCKET_H
3472 #include <sys/socket.h>
3474 #if HAVE_NETINET_IN_H
3475 #include <netinet/in.h>
3478 #include <winsock.h>
3481 #include <winsock2.h>
3486 int fd,val=0,len=sizeof(int);
3487 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3489 WSAStartup(2, &wsaData);
3491 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3492 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3493 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3496 if (val <= 0) exit(1);
3497 fp = fopen("conftestval", "w");
3498 fprintf (fp, "%d\n", val);
3502 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
3503 SQUID_TCP_SO_RCVBUF=16384,
3504 SQUID_TCP_SO_RCVBUF=16384)
3505 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3506 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3507 echo "Limiting receive buffer size to 64K"
3508 SQUID_TCP_SO_RCVBUF=65535
3510 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3511 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3512 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
3513 ac_cv_needs_sys_errlist="no",
3514 ac_cv_needs_sys_errlist="yes")
3516 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3517 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3520 dnl Not cached since people are likely to change this
3521 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3522 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3524 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
3527 AC_MSG_CHECKING(if inet_ntoa() actually works)
3531 #include <sys/types.h>
3532 #include <netinet/in.h>
3533 #include <arpa/inet.h>
3538 in.s_addr = inet_addr("1.2.3.4");
3539 fp = fopen("conftestval", "w");
3540 fprintf (fp, "%s\n", inet_ntoa(in));
3544 INET_NTOA_RESULT=`cat conftestval`,
3545 INET_NTOA_RESULT="broken",
3546 INET_NTOA_RESULT="broken")
3547 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3548 AC_MSG_RESULT("yes")
3553 echo "Using Win32 resolver instead."
3556 echo "Will use our own inet_ntoa()."
3557 AC_LIBOBJ(inet_ntoa)
3558 # echo "WARNING: This looks bad, and probably prevents Squid from working."
3559 # echo " If you're on IRIX and using GCC 2.8, you probably need"
3560 # echo " to use the IRIX C compiler instead."
3566 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3567 AC_MSG_CHECKING(for working statvfs() interface)
3571 #include <sys/types.h>
3572 #include <sys/statvfs.h>
3576 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3577 sfs.f_files = sfs.f_ffree = 0;
3578 statvfs("/tmp", &sfs);
3580 ac_cv_func_statvfs=yes,
3581 ac_cv_func_statvfs=no)
3582 AC_MSG_RESULT($ac_cv_func_statvfs)
3583 if test "$ac_cv_func_statvfs" = "yes" ; then
3584 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3588 dnl Detect what resolver fields we have available to use...
3589 AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3591 #if HAVE_SYS_TYPES_H
3592 #include <sys/types.h>
3594 #if HAVE_NETINET_IN_H
3595 #include <netinet/in.h>
3597 #if HAVE_ARPA_INET_H
3598 #include <arpa/inet.h>
3600 #if HAVE_ARPA_NAMESER_H
3601 #include <arpa/nameser.h>
3607 [_res_ext.nsaddr_list[[0]].s_addr;],
3608 ac_cv_have_res_ext_nsaddr_list="yes",
3609 ac_cv_have_res_ext_nsaddr_list="no"))
3610 if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3611 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3612 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3615 if test "$_SQUID_RES_NSADDR6_LIST" == ""; then
3616 AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3618 #if HAVE_SYS_TYPES_H
3619 #include <sys/types.h>
3621 #if HAVE_NETINET_IN_H
3622 #include <netinet/in.h>
3624 #if HAVE_ARPA_INET_H
3625 #include <arpa/inet.h>
3627 #if HAVE_ARPA_NAMESER_H
3628 #include <arpa/nameser.h>
3634 [_res._u._ext.nsaddrs[[0]]->sin6_addr;],
3635 ac_cv_have_res_ext_nsaddrs="yes",
3636 ac_cv_have_res_ext_nsaddrs="no"))
3637 if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3638 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3639 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3643 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3645 #if HAVE_SYS_TYPES_H
3646 #include <sys/types.h>
3648 #if HAVE_NETINET_IN_H
3649 #include <netinet/in.h>
3651 #if HAVE_ARPA_INET_H
3652 #include <arpa/inet.h>
3654 #if HAVE_ARPA_NAMESER_H
3655 #include <arpa/nameser.h>
3661 [_res.nsaddr_list[[0]];],
3662 ac_cv_have_res_nsaddr_list="yes",
3663 ac_cv_have_res_nsaddr_list="no"))
3664 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3665 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3666 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3669 if test "$_SQUID_RES_NSADDR_LIST" == ""; then
3670 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3672 #if HAVE_SYS_TYPES_H
3673 #include <sys/types.h>
3675 #if HAVE_NETINET_IN_H
3676 #include <netinet/in.h>
3678 #if HAVE_ARPA_INET_H
3679 #include <arpa/inet.h>
3681 #if HAVE_ARPA_NAMESER_H
3682 #include <arpa/nameser.h>
3688 [_res.ns_list[[0]].addr;],
3689 ac_cv_have_res_ns_list="yes",
3690 ac_cv_have_res_ns_list="no"))
3691 if test $ac_cv_have_res_ns_list = "yes" ; then
3692 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3693 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3697 dnl Squid now has limited locale handling ...
3699 AC_ARG_WITH(po2html,
3700 [ --without-po2html Translation toolkit is required to auto-build translated
3701 error pages. If it is not present this option can be used
3702 to run the 'make dist' target without translating.
3703 A drop-in bundle of pre-translated files is available from
3704 http://www.squid-cache.org/Versions/v3/HEAD/
3706 [ if test "$enableval" != "yes" ; then
3707 echo "Disabling Translation Toolkit dependency"
3711 AC_SUBST(DO_TRANSLATE)
3714 dnl Need the debugging version of malloc if available
3716 if test "$ac_cv_lib_malloc_main" = "yes" ; then
3717 if test -r /usr/lib/debug/malloc.o ; then
3718 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3720 if test -r /usr/lib/debug/mallocmap.o ; then
3721 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3727 if test -z "$XTRA_LIBS"; then
3730 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3735 dnl Clean up after OSF/1 core dump bug
3748 src/adaptation/Makefile \
3755 test-suite/Makefile \
3758 helpers/basic_auth/Makefile \
3759 helpers/basic_auth/LDAP/Makefile \
3760 helpers/basic_auth/MSNT/Makefile \
3761 helpers/basic_auth/NCSA/Makefile \
3762 helpers/basic_auth/PAM/Makefile \
3763 helpers/basic_auth/SMB/Makefile \
3764 helpers/basic_auth/mswin_sspi/Makefile \
3765 helpers/basic_auth/YP/Makefile \
3766 helpers/basic_auth/getpwnam/Makefile \
3767 helpers/basic_auth/multi-domain-NTLM/Makefile \
3768 helpers/basic_auth/SASL/Makefile \
3769 helpers/basic_auth/POP3/Makefile \
3770 helpers/basic_auth/DB/Makefile \
3771 helpers/basic_auth/squid_radius_auth/Makefile \
3772 helpers/digest_auth/Makefile \
3773 helpers/digest_auth/password/Makefile \
3774 helpers/digest_auth/ldap/Makefile \
3775 helpers/digest_auth/eDirectory/Makefile \
3776 helpers/ntlm_auth/Makefile \
3777 helpers/ntlm_auth/fakeauth/Makefile \
3778 helpers/ntlm_auth/no_check/Makefile \
3779 helpers/ntlm_auth/SMB/Makefile \
3780 helpers/ntlm_auth/SMB/smbval/Makefile \
3781 helpers/ntlm_auth/mswin_sspi/Makefile \
3782 helpers/negotiate_auth/Makefile \
3783 helpers/negotiate_auth/mswin_sspi/Makefile \
3784 helpers/negotiate_auth/squid_kerb_auth/Makefile \
3785 helpers/external_acl/Makefile \
3786 helpers/external_acl/ip_user/Makefile \
3787 helpers/external_acl/ldap_group/Makefile \
3788 helpers/external_acl/session/Makefile \
3789 helpers/external_acl/unix_group/Makefile \
3790 helpers/external_acl/wbinfo_group/Makefile \
3791 helpers/external_acl/mswin_ad_group/Makefile \
3792 helpers/external_acl/mswin_lm_group/Makefile \
3796 AC_CONFIG_SUBDIRS(lib/libTrie)
3798 # must configure libltdl subdir unconditionally for "make distcheck" to work
3799 AC_CONFIG_SUBDIRS(lib/libLtdl)