2 dnl Configuration input file for Squid
4 dnl $Id: configure.in,v 1.490 2007/12/14 23:11:41 amosjeffries Exp $
8 AC_INIT(Squid Web Proxy, 3.HEAD-IPv6-CVS, 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.490 $)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
40 LIBREGEX='' # libregex.a
42 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
46 if test -z "$EXEEXT"; then
49 # automake automatically adds .exe when installing binaries
54 dnl this should be expanded to a list of platform sensible support requirements.
55 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
57 mingw|mingw32|cygwin|cygwin32)
58 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
61 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
67 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
68 CFLAGS="$CFLAGS -mthreads"
69 CXXFLAGS="$CXXFLAGS -mthreads"
70 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
71 echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform"
72 echo "Please see PSAPI.DLL section on doc/win32-relnotes.html."
74 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
77 MINGW_LIBS="-lmingwex"
78 AM_CONDITIONAL(USE_IPC_WIN32, true)
82 AM_CONDITIONAL(USE_IPC_WIN32, false)
86 if test -z "$CACHE_HTTP_PORT"; then
87 CACHE_HTTP_PORT="3128"
89 if test -z "$CACHE_ICP_PORT"; then
94 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
95 [What default TCP port to use for HTTP listening?])
96 AC_SUBST(CACHE_HTTP_PORT)
97 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
98 [What default UDP port to use for ICP listening?])
99 AC_SUBST(CACHE_ICP_PORT)
101 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
103 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
105 CACHE_EFFECTIVE_USER="nobody"
106 AC_ARG_WITH(default-user,
107 [ --with-default-user=USER System user account for squid permissions.
109 [ CACHE_EFFECTIVE_USER="$withval" ]
111 AC_SUBST(CACHE_EFFECTIVE_USER)
113 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
116 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
120 if test "$GCC" = "yes"; then
121 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
122 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
125 if test $GCCVER2 -lt 300 ; then
126 echo "ERROR: GCC $GCCVER causes a coredump on $host"
127 echo "ERROR: Try a more recent GCC version"
136 dnl Set Default CFLAGS
137 if test -z "$PRESET_CFLAGS"; then
138 if test "$GCC" = "yes"; then
141 # sunos has too many warnings for this to be useful
145 # Motorola cc/ld does not like -02 but is ok on -O
146 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
149 CFLAGS="-Wall $CFLAGS"
155 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
156 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
157 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
158 -Wl,-woff,85,-woff,84,-woff,134 \
159 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
160 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
161 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
162 -Wl,-woff,85,-woff,84,-woff,134 \
163 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
166 # Mogul says DEC compilers take both -g and -O2
167 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
176 dnl set squid required flags
177 if test "$GCC" = "yes"; then
178 dnl Guido Serassio (serassio@squid-cache.org) 20070811
179 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
180 dnl -Wmissing-prototypes -Wmissing-declarations
181 dnl TODO: check if the problem will be present in any other newer MinGW release.
184 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
187 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
190 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
195 AC_SUBST(SQUID_CFLAGS)
196 AC_SUBST(SQUID_CXXFLAGS)
198 AC_TEST_CHECKFORHUGEOBJECTS
199 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
202 if test -z "$PRESET_LDFLAGS"; then
203 if test "$GCC" = "yes"; then
206 # Silence Linker warnings 84, 85 and 134
207 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
222 AC_ARG_ENABLE(gnuregex,
223 [ --enable-gnuregex Compile GNUregex. Unless you have reason to use this
224 option, you should not enable it. This library file
225 is usually only required on Windows and very old
226 Unix boxes which do not have their own regex library
228 [USE_GNUREGEX=$enableval])
232 AC_ARG_ENABLE(optimizations,
233 [ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
234 Optimization is good for production builds, but not
235 good for debugging. During development, use
236 --disable-optimizations to reduce compilation times
237 and allow easier debugging. This option implicitly
238 also enabled --disable-inline],
239 [ if test "$enableval" = "no" ; then
240 echo "Disabling compiler optimizations (-O flag)"
241 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
242 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
247 AC_ARG_ENABLE(inline,
248 [ --disable-inline Don't compile trivial methods as inline. Squid
249 is coded with much of the code able to be inlined.
250 Inlining is good for production builds, but not
251 good for development. During development, use
252 --disable-inline to reduce compilation times and
253 allow incremental builds to be quick. For
254 production builds, or load tests, use
255 --enable-inline to have squid make all trivial
256 methods inlinable by the compiler.],
257 [ if test "$enableval" = "no" ; then
262 if test "$SquidInline" = "yes" ; then
263 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
264 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
266 echo "Inlining optimization disabled"
267 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
270 AC_ARG_ENABLE(debug-cbdata,
271 [ --enable-debug-cbdata Provide some debug information in cbdata],
272 [ if test "$enableval" = "yes" ; then
273 echo "cbdata debugging enabled"
274 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
278 dnl This is a developer only option.. developers know how to set defines
280 dnl AC_ARG_ENABLE(xmalloc-debug,
281 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
282 dnl [ if test "$enableval" = "yes" ; then
283 dnl echo "Malloc debugging enabled"
284 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
288 dnl This is a developer only option.. developers know how to set defines
290 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
291 dnl [ --enable-xmalloc-debug-trace
292 dnl Detailed trace of memory allocations],
293 dnl [ if test "$enableval" = "yes" ; then
294 dnl echo "Malloc debug trace enabled"
295 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
296 dnl AC_DEFINE(XMALLOC_DEBUG,1)
300 AC_ARG_ENABLE(xmalloc-statistics,
301 [ --enable-xmalloc-statistics
302 Show malloc statistics in status page],
303 [ if test "$enableval" = "yes" ; then
304 echo "Malloc statistics enabled"
305 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
311 [ --disable-carp Disable CARP support],
312 [ if test "$enableval" = "no" ; then
317 if test $use_carp = 1; then
318 AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol])
321 AC_ARG_ENABLE(async-io,
322 [ --enable-async-io[=N_THREADS]
324 --with-aufs-threads=N_THREADS
326 --enable-storeio=ufs,aufs],
330 STORE_MODULES="ufs aufs"
335 aufs_io_threads=$enableval
337 STORE_MODULES="ufs aufs"
342 AC_ARG_WITH(aufs-threads,
343 [ --with-aufs-threads=N_THREADS
344 Tune the number of worker threads for the aufs object
348 aufs_io_threads=$withval
351 echo "ERROR: Invalid --with-aufs-threads argument"
356 if test "$aufs_io_threads"; then
357 echo "With $aufs_io_threads aufs threads"
358 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
359 [Defines how many threads aufs uses for I/O])
362 AC_ARG_WITH(pthreads,
363 [ --with-pthreads Use POSIX Threads])
364 if test "$with_pthreads" = "yes"; then
369 [ --with-aio Use POSIX AIO])
370 if test "$with_aio" = "yes"; then
375 [ --with-dl Use dynamic linking])
376 if test "$with_dl" = "yes"; then
380 AC_ARG_ENABLE(storeio,
381 [ --enable-storeio=\"list of modules\"
382 Build support for the list of store I/O modules.
383 The default is only to build the "ufs" module.
384 See src/fs for a list of available modules, or
385 Programmers Guide section <not yet written>
386 for details on how to build your custom store module],
389 for dir in $srcdir/src/fs/*; do
390 module="`basename $dir`"
391 if test -d "$dir" && test "$module" != CVS; then
392 STORE_MODULES="$STORE_MODULES $module"
399 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
403 [ if test -z "$STORE_MODULES"; then
407 if test -n "$STORE_MODULES"; then
408 for module in $STORE_MODULES; do
409 if test -d $srcdir/src/fs/$module; then
412 echo "ERROR: storeio $module does not exists"
416 echo "Store modules built: $STORE_MODULES"
418 for module in $STORE_MODULES; do
419 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
422 dnl remove all but diskd - its the only module that needs to recurse
423 dnl into the sub directory
431 for fs in $STORE_MODULES none; do
436 NEED_DISKDAEMON="true"
441 NEED_DISKTHREADS="true"
446 dnl Automake om MinGW needs explicit exe extension
447 dnl for STORE_TESTS substition
449 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
452 STORE_TESTS="$STORE_TESTS tests/testNull$EXEEXT"
456 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
461 dnl We have 'fake' modules - aufs and diskd - legacy.
462 for fs in $STORE_MODULES; do
467 STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
468 STORE_LIBS="$STORE_LIBS lib${fs}.a"
473 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
474 echo "adding UFS, as it contains core logic for diskd and aufs"
475 STORE_OBJS="$STORE_OBJS fs/libufs.a"
476 STORE_LIBS="$STORE_LIBS libufs.a"
477 STORE_MODULES="$STORE_MODULES ufs"
478 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
480 dnl Automake om MinGW needs explicit exe extension
481 dnl for STORE_TESTS substition
483 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
488 AC_SUBST(STORE_LINKOBJS)
489 AC_SUBST(STORE_TESTS)
491 AC_ARG_ENABLE(disk-io,
492 [ --enable-disk-io=\"list of modules\"
493 Build support for the list of disk I/O modules.
494 The default is only to build the "Blocking" module.
495 See src/DiskIO for a list of available modules, or
496 Programmers Guide section <not yet written>
497 for details on how to build your custom disk module],
500 for dir in $srcdir/src/DiskIO/*; do
501 module="`basename $dir`"
502 if test -d "$dir" && test "$module" != CVS; then
503 DISK_MODULES="$DISK_MODULES $module"
510 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
514 [ if test -z "$DISK_MODULES"; then
515 DISK_MODULES="Blocking"
518 if test -n "$DISK_MODULES"; then
519 for module in $DISK_MODULES; do
520 if test -d $srcdir/src/DiskIO/$module; then
523 echo "ERROR: disk-io $module does not exists"
527 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
529 for module in $DISK_MODULES; do
530 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
533 for fs in $DISK_MODULES none; do
536 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
537 FOUND_DISKDAEMON="true"
540 FOUND_DISKTHREADS="true"
546 FOUND_BLOCKING="true"
550 if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
551 echo "adding Blocking, as it is used by an active, legacy Store Module"
552 DISK_LIBS="$DISK_LIBS libBlocking.a"
553 DISK_MODULES="$DISK_MODULES Blocking"
554 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
557 if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
558 echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
559 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
560 DISK_MODULES="$DISK_MODULES DiskDaemon"
561 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
562 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
565 if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
566 echo "adding DiskThreads, as it is used by an active, legacy Store Module"
567 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
568 DISK_MODULES="$DISK_MODULES DiskThreads"
569 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
572 if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
573 echo "adding AIO, as it is used by an active, legacy Store Module"
574 DISK_LIBS="$DISK_LIBS libAIO.a"
575 DISK_MODULES="$DISK_MODULES AIO"
576 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
578 echo "IO Modules built: $DISK_MODULES"
581 dnl we know what is being built. now add dependencies.
582 for fs in $DISK_MODULES none; do
585 if test -z "$with_pthreads"; then
589 echo "DiskThreads IO Module used, Windows threads support automatically enabled"
592 echo "DiskThreads IO Module used, pthreads support automatically enabled"
599 if test -z "$with_aio"; then
603 echo "Aio IO Module used, Windows overlapped I/O support automatically enabled"
606 echo "Aio IO Module used, aio support automatically enabled"
616 AC_SUBST(DISK_PROGRAMS)
617 AC_SUBST(DISK_LINKOBJS)
618 AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
619 AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
621 AC_ARG_ENABLE(removal-policies,
622 [ --enable-removal-policies=\"list of policies\"
623 Build support for the list of removal policies.
624 The default is only to build the "lru" module.
625 See src/repl for a list of available modules, or
626 Programmers Guide section 9.9 for details on how
627 to build your custom policy],
630 for dir in $srcdir/src/repl/*; do
631 module="`basename $dir`"
632 if test -d "$dir" && test "$module" != CVS; then
633 REPL_POLICIES="$REPL_POLICIES $module"
640 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
644 [ if test -z "$REPL_POLICIES"; then
648 if test -n "$REPL_POLICIES"; then
649 for module in $REPL_POLICIES; do
650 if test -d $srcdir/src/repl/$module; then
653 echo "ERROR: Removal policy $module does not exists"
657 echo "Removal policies built: $REPL_POLICIES"
658 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
659 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
661 AC_SUBST(REPL_POLICIES)
665 AM_CONDITIONAL(ENABLE_PINGER, false)
667 [ --enable-icmp Enable ICMP pinging],
668 [ if test "$enableval" = "yes" ; then
670 AC_DEFINE(USE_ICMP,1,
671 [ Defined this to use Squid's ICMP features (highly recommended!)
672 When USE_ICMP is defined, Squid will send ICMP pings to origin server sites.])
673 AM_CONDITIONAL(ENABLE_PINGER, true)
677 AM_CONDITIONAL(USE_DELAY_POOLS, false)
678 AC_ARG_ENABLE(delay-pools,
679 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
680 [ if test "$enableval" = "yes" ; then
681 echo "Delay pools enabled"
682 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
683 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
687 AM_CONDITIONAL(USE_ESI, false)
689 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.]),
690 use_esi=$enableval, use_esi=no)
691 if test "$use_esi" = "yes" ; then
692 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
693 AM_CONDITIONAL(USE_ESI, true)
694 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
696 AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
699 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
700 AC_ARG_ENABLE(icap-client,
701 AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
702 use_icap_client=$enableval, use_icap_client=no)
703 if test "$use_icap_client" = "yes" ; then
704 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
705 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
706 ICAP_LIBS="ICAP/libicap.a"
708 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
713 dnl This is a developer only option. Developers know how to set defines
715 dnl AC_ARG_ENABLE(mem-gen-trace,
716 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
717 dnl [ if test "$enableval" = "yes" ; then
718 dnl echo "Memory trace (to file) enabled"
719 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
723 AC_ARG_ENABLE(useragent-log,
724 [ --enable-useragent-log Enable logging of User-Agent header],
725 [ if test "$enableval" = "yes" ; then
726 echo "User-Agent logging enabled"
727 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
728 By default, they are written to useragent.log in the Squid log
733 AC_ARG_ENABLE(referer-log,
734 [ --enable-referer-log Enable logging of Referer header],
735 [ if test "$enableval" = "yes" ; then
736 echo "Referer logging enabled"
737 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
738 By default, they are written to referer.log in the Squid log
745 [ --disable-wccp Disable Web Cache Coordination Protocol],
746 [ if test "$enableval" = "no" ; then
747 echo "Web Cache Coordination Protocol disabled"
751 if test $USE_WCCP = 1; then
752 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
756 AC_ARG_ENABLE(wccpv2,
757 [ --disable-wccpv2 Disable Web Cache Coordination V2 Protocol],
758 [ if test "$enableval" = "no" ; then
759 echo "Web Cache Coordination V2 Protocol disabled"
763 if test $USE_WCCPv2 = 1; then
764 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
767 AC_ARG_ENABLE(kill-parent-hack,
768 [ --enable-kill-parent-hack
769 Kill parent on shutdown],
770 [ if test "$enableval" = "yes" ; then
771 echo "Kill parent on shutdown"
772 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
773 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
780 [ --disable-snmp Disable SNMP monitoring support],
781 [ if test "$enableval" = "no" ; then
782 echo "SNMP monitoring disabled"
786 if test x"$USE_SNMP" = xtrue; then
787 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
788 SNMPLIB='../snmplib/libsnmp.a'
791 AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
793 AC_SUBST(makesnmplib)
795 AC_ARG_ENABLE(cachemgr-hostname,
796 [ --enable-cachemgr-hostname[=hostname]
797 Make cachemgr.cgi default to this host],
800 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
801 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
802 echo "Cachemgr default hostname == host where cachemgr runs"
808 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
809 echo "Cachemgr default hostname set to ${enableval}"
814 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
815 AC_ARG_ENABLE(arp-acl,
816 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
817 [ if test "$enableval" = "yes" ; then
818 echo "ARP ACL lists enabled (ether address)"
831 LIBS="$LIBS -liphlpapi"
834 LIBS="$LIBS -liphlpapi"
837 echo "WARNING: ARP ACL support probably won't work on $host."
841 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, ?).])
842 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
847 AM_CONDITIONAL(ENABLE_HTCP, false)
849 [ --disable-htcp Disable HTCP protocol support],
850 [ if test "$enableval" = "no" ; then
851 echo "HTCP support disabled"
854 if test x$USE_HTCP = xtrue; then
855 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
857 AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
859 dnl SSL is not enabled by default.
860 AM_CONDITIONAL(ENABLE_SSL, false)
862 dnl Default is to use OpenSSL when available
864 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
865 [ if test "$enableval" != "no"; then
866 echo "SSL gatewaying using OpenSSL enabled"
867 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
868 AM_CONDITIONAL(ENABLE_SSL, true)
871 dnl Native Windows port of OpenSSL needs -lgdi32
872 SSLLIB='-lssleay32 -leay32 -lgdi32'
875 SSLLIB='-lssl -lcrypto'
882 dnl User may specify OpenSSL is needed from a non-standard location
884 [ --with-openssl[=prefix]
885 Compile with the OpenSSL libraries. The path to
886 the OpenSSL development libraries and headers
887 installation can be specified if outside of the
888 system standard directories],
890 case "$with_openssl" in
898 SSLLIBDIR="$with_openssl/lib"
899 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
903 if test -n "$USE_OPENSSL"; then
904 echo "Using OpenSSL MD5 implementation"
905 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)])
906 if test -z "$SSLLIB"; then
907 SSLLIB="-lcrypto" # for MD5 routines
909 dnl This is a workaround for RedHat 9 brain damage..
910 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
911 echo "OpenSSL depends on Kerberos"
912 SSLLIBDIR="/usr/kerberos/lib"
913 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
916 if test -n "$SSLLIBDIR"; then
917 SSLLIB="-L$SSLLIBDIR $SSLLIB"
922 AC_ARG_ENABLE(forw-via-db,
923 [ --enable-forw-via-db Enable Forw/Via database],
924 [ if test "$enableval" = "yes" ; then
925 echo "FORW-VIA enabled"
926 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
930 AC_ARG_ENABLE(cache-digests,
931 [ --enable-cache-digests Use Cache Digests
932 see http://www.squid-cache.org/FAQ/FAQ-16.html],
933 [ if test "$enableval" = "yes" ; then
934 echo "USE_CACHE_DIGESTS enabled"
935 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
939 dnl Select Default Error language
940 AC_ARG_ENABLE(default-err-language,
941 [ --enable-default-err-language=lang
942 Select default language for Error pages (see
945 if test -d $srcdir/errors/$enableval; then
946 ERR_DEFAULT_LANGUAGE=$enableval
948 echo "ERROR! Unknown language $enableval, see errors/ directory"
951 ],[ERR_DEFAULT_LANGUAGE="English"])
952 AC_SUBST(ERR_DEFAULT_LANGUAGE)
954 dnl Select languages to be installed
955 AC_ARG_ENABLE(err-languages,
956 [ --enable-err-languages=\"lang1 lang2..\"
957 Select languages to be installed. (All will be
958 installed by default) ],
960 for l in $enableval; do
961 if test -d $srcdir/errors/$l; then :; else
962 echo "ERROR! Unknown language $$l, see errors/"
966 ERR_LANGUAGES=$enableval
969 for l in $srcdir/errors/*; do
970 if test -f $l/ERR_ACCESS_DENIED; then
971 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
975 AC_SUBST(ERR_LANGUAGES)
977 dnl Size of COSS memory buffer
978 AC_ARG_WITH(coss-membuf-size,
979 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
980 [ if test "$with_coss_membuf_size"; then
981 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
982 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
986 dnl check for netio plugin stuff
991 [ --disable-poll Disable poll() support. ],
996 echo "Forcing poll() to be enabled"
1000 echo "Forcing poll() to be disabled"
1008 AC_ARG_ENABLE(select,
1009 [ --disable-select Disable select() support. ],
1012 case "$enableval" in
1014 echo "Forcing select() to be enabled"
1015 SELECT_TYPE="select"
1018 echo "Forcing select() to be disabled"
1025 dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1027 AC_ARG_ENABLE(kqueue,
1028 [ --enable-kqueue Enable kqueue() support (experimental).],
1031 case "$enableval" in
1033 echo "Forcing kqueue() to be enabled"
1034 SELECT_TYPE="kqueue"
1037 echo "Forcing kqueue() to be disabled"
1045 AC_ARG_ENABLE(epoll,
1046 [ --disable-epoll Disable Linux epoll() support.],
1049 case "$enableval" in
1051 echo "Forcing epoll() to be enabled"
1055 echo "Forcing epoll() to be disabled"
1062 dnl Disable HTTP violations
1064 AC_ARG_ENABLE(http-violations,
1065 [ --disable-http-violations
1066 This allows you to remove code which is known to
1067 violate the HTTP protocol specification.],
1068 [ if test "$enableval" = "no" ; then
1069 echo "Disabling HTTP Violations"
1073 if test $http_violations = 1; then
1074 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.])
1076 AC_DEFINE(HTTP_VIOLATIONS, 0)
1079 dnl Enable IPFW Transparent Proxy
1080 AC_ARG_ENABLE(ipfw-transparent,
1081 [ --enable-ipfw-transparent
1082 Enable Transparent Proxy support for systems
1083 using FreeBSD IPFW style redirection.],
1084 [ if test "$enableval" = "yes" ; then
1085 echo "IPFW Transparent Proxy enabled"
1086 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1087 IPFW_TRANSPARENT="yes"
1091 dnl Enable IP-Filter Transparent Proxy
1092 AC_ARG_ENABLE(ipf-transparent,
1093 [ --enable-ipf-transparent
1094 Enable Transparent Proxy support for systems
1095 using IP-Filter network address redirection.],
1096 [ if test "$enableval" = "yes" ; then
1097 echo "IP-Filter Transparent Proxy enabled"
1098 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.])
1099 IPF_TRANSPARENT="yes"
1103 dnl Enable PF Transparent Proxy
1104 AC_ARG_ENABLE(pf-transparent,
1105 [ --enable-pf-transparent
1106 Enable Transparent Proxy support for systems
1107 using PF network address redirection.],
1108 [ if test "$enableval" = "yes" ; then
1109 echo "PF Transparent Proxy enabled"
1110 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1111 PF_TRANSPARENT="yes"
1115 dnl Enable Linux Netfilter Transparent Proxy
1116 AC_ARG_ENABLE(linux-netfilter,
1117 [ --enable-linux-netfilter
1118 Enable Transparent Proxy support for Linux (Netfilter) systems.],
1119 [ if test "$enableval" = "yes" ; then
1120 echo "Linux (Netfilter) Transparent Proxy enabled"
1121 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1122 LINUX_NETFILTER="yes"
1126 dnl Enable Large file support
1130 AC_ARG_WITH(large-files,
1131 [ --with-large-files Enable support for large files (logs etc).],
1132 [ if test "$withval" = yes; then
1137 dnl UNIX Build environment
1138 AC_ARG_WITH(build-environment,
1139 [ --with-build-environment=model
1140 The build environment to use. Normally one of
1141 POSIX_V6_ILP32_OFF32 32 bits
1142 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1143 POSIX_V6_LP64_OFF64 64 bits
1144 POSIX_V6_LPBIG_OFFBIG large pointers and files
1145 XBS5_ILP32_OFF32 32 bits (legacy)
1146 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1147 XBS5_LP64_OFF64 64 bits (legacy)
1148 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1149 default The default for your OS],
1150 [ case "$withval" in
1152 echo "--with-build-environment expects a build environment string as used by getconf"
1156 buildmodel="$withval"
1161 if test $needlargefiles && test -z "$buildmodel"; then
1162 for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG; do
1163 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1168 if test -z "$buildmodel"; then
1169 echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
1171 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1172 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1175 if test -n "$buildmodel" && test "$buildmodel" != "default"; then
1176 echo "Using $buildmodel build environment"
1177 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1180 echo "ERROR: Build environment $buildmodel not known to getconf."
1183 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1184 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1185 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1186 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1189 dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but:
1190 dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc
1191 dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun
1193 if test "$GCC" = "yes"; then
1194 echo "Removing -Xa for gcc on $host"
1195 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1196 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1198 echo "Removing -Usun on $host"
1199 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1200 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1203 dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1204 dnl so we must adjust something to avoid gcc errors.
1205 dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1206 dnl remove "-n32" from LDFLAGS
1207 dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1208 dnl "-64" from LDFLAGS
1210 if test "$GCC" = "yes"; then
1211 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1212 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1213 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1214 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1215 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1216 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1224 dnl Enable Linux transparent proxy support
1225 AC_ARG_ENABLE(linux-tproxy,
1226 [ --enable-linux-tproxy
1227 Enable real Transparent Proxy support for Netfilter TPROXY.],
1228 [ if test "$enableval" = "yes" ; then
1229 echo "Linux Netfilter/TPROXY enabled"
1230 AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.])
1232 if test -z "$LINUX_NETFILTER"; then
1233 echo "Linux-Netfilter Transparent Proxy automatically enabled"
1234 LINUX_NETFILTER="yes"
1239 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1240 dnl Enable Leak Finding Functions
1241 AC_ARG_ENABLE(leakfinder,
1242 [ --enable-leakfinder
1243 Enable Leak Finding code. Enabling this alone
1244 does nothing; you also have to modify the source
1245 code to use the leak finding functions. Probably
1246 Useful for hackers only.],
1247 [ if test "$enableval" = "yes" ; then
1248 echo "Leak-Finding enabled"
1249 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1250 USE_LEAKFINDER="yes"
1251 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1256 AC_ARG_ENABLE(ident-lookups,
1257 [ --disable-ident-lookups
1258 This allows you to remove code that performs
1259 Ident (RFC 931) lookups.],
1260 [ if test "$enableval" = "no" ; then
1261 echo "Disabling Ident Lookups"
1265 if test $use_ident = 1; then
1266 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1267 AM_CONDITIONAL(ENABLE_IDENT, true)
1269 AC_DEFINE(USE_IDENT, 0)
1270 AM_CONDITIONAL(ENABLE_IDENT, false)
1273 AM_CONDITIONAL(USE_DNSSERVER, false)
1275 AC_ARG_ENABLE(internal-dns,
1276 [ --disable-internal-dns This prevents Squid from directly sending and
1277 receiving DNS messages, and instead enables the
1278 old external 'dnsserver' processes.],
1279 [ if test "$enableval" = "no" ; then
1280 echo "Disabling Internal DNS queries"
1284 if test "$use_dnsserver" = "yes"; then
1285 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1286 AM_CONDITIONAL(USE_DNSSERVER, true)
1289 dnl Select Default hosts file location
1290 AC_ARG_ENABLE(default-hostsfile,
1291 [ --enable-default-hostsfile=path
1292 Select default location for hosts file.
1293 See hosts_file directive in squid.conf for details],
1295 if test "$enableval" != "none" ; then
1296 if test -f $enableval; then
1297 OPT_DEFAULT_HOSTS=$enableval
1299 echo "Warning Unable to find $enableval"
1303 OPT_DEFAULT_HOSTS="none"
1305 echo "Default hosts file set to: $enableval"
1306 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1307 AC_SUBST(OPT_DEFAULT_HOSTS)
1309 dnl Select auth schemes modules to build
1311 [ --enable-auth=\"list of auth scheme modules\"
1312 Build support for the list of authentication schemes.
1313 The default is to build support for the Basic scheme.
1314 See src/auth for a list of available modules, or
1315 Programmers Guide section authentication schemes
1316 for details on how to build your custom auth scheme
1318 [ case $enableval in
1320 for dir in $srcdir/src/auth/*; do
1321 module="`basename $dir`"
1322 if test -d "$dir" && test "$module" != CVS; then
1323 AUTH_MODULES="$AUTH_MODULES $module"
1330 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1334 [ if test -z "$AUTH_MODULES"; then
1335 AUTH_MODULES="ntlm basic digest negotiate"
1338 if test -n "$AUTH_MODULES"; then
1339 for module in $AUTH_MODULES; do
1340 if test -d $srcdir/src/auth/$module; then
1343 echo "ERROR: Auth scheme $module does not exists"
1346 eval AUTH_MODULE_${module}=yes
1348 echo "Auth scheme modules built: $AUTH_MODULES"
1349 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1350 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1352 echo "Auth scheme modules built: None"
1355 for module in $AUTH_MODULES; do
1356 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1358 AC_SUBST(AUTH_MODULES)
1360 AC_SUBST(AUTH_LINKOBJS)
1363 dnl Select basic auth scheme helpers to build
1364 if test -n "$AUTH_MODULE_basic"; then
1365 BASIC_AUTH_HELPERS="all"
1367 AC_ARG_ENABLE(basic-auth-helpers,
1368 [ --enable-basic-auth-helpers=\"list of helpers\"
1369 This option selects which basic scheme proxy_auth
1370 helpers to build and install as part of the normal
1371 build process. For a list of available
1372 helpers see the helpers/basic_auth directory.],
1373 [ case "$enableval" in
1375 BASIC_AUTH_HELPERS="all"
1378 BASIC_AUTH_HELPERS=""
1381 if test -z "$AUTH_MODULE_basic"; then
1382 echo "WARNING: Basic auth helpers selected without the basic scheme enabled"
1385 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1389 if test "$BASIC_AUTH_HELPERS" = "all" ; then
1390 BASIC_AUTH_HELPERS=""
1391 for dir in $srcdir/helpers/basic_auth/*; do
1392 helper="`basename $dir`"
1393 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1394 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1398 if test -n "$BASIC_AUTH_HELPERS"; then
1399 for helper in $BASIC_AUTH_HELPERS; do
1400 if test -d $srcdir/helpers/basic_auth/$helper; then
1407 echo "ERROR: Basic auth helper $helper does not exists"
1411 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1413 AC_SUBST(BASIC_AUTH_HELPERS)
1415 dnl Select ntlm auth helpers to build
1416 if test -n "$AUTH_MODULE_ntlm"; then
1417 NTLM_AUTH_HELPERS="all"
1419 AC_ARG_ENABLE(ntlm-auth-helpers,
1420 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1421 This option selects which proxy_auth ntlm helpers
1422 to build and install as part of the normal build
1423 process. For a list of available helpers see
1424 the helpers/ntlm_auth directory.],
1425 [ case "$enableval" in
1427 NTLM_AUTH_HELPERS="all"
1430 NTLM_AUTH_HELPERS=""
1433 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1437 if test "$NTLM_AUTH_HELPERS" = "all" ; then
1438 NTLM_AUTH_HELPERS=""
1439 for dir in $srcdir/helpers/ntlm_auth/*; do
1440 helper="`basename $dir`"
1441 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1442 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1446 if test -n "$NTLM_AUTH_HELPERS"; then
1447 for helper in $NTLM_AUTH_HELPERS; do
1448 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1451 echo "ERROR: NTLM Auth helper $helper does not exists"
1455 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1457 AC_SUBST(NTLM_AUTH_HELPERS)
1459 dnl Select negotiate auth helpers to build
1460 if test -n "$AUTH_MODULE_negotiate"; then
1461 NEGOTIATE_AUTH_HELPERS="all"
1463 AC_ARG_ENABLE(negotiate-auth-helpers,
1464 [ --enable-negotiate-auth-helpers=\"list of helpers\"
1465 This option selects which proxy_auth negotiate helpers
1466 to build and install as part of the normal build
1467 process. For a list of available helpers see
1468 the helpers/negotiate_auth directory.],
1469 [ case "$enableval" in
1471 NEGOTIATE_AUTH_HELPERS="all"
1474 NEGOTIATE_AUTH_HELPERS=""
1477 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1481 if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1482 NEGOTIATE_AUTH_HELPERS=""
1483 for dir in $srcdir/helpers/negotiate_auth/*; do
1484 helper="`basename $dir`"
1485 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1486 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1490 if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1491 for helper in $NEGOTIATE_AUTH_HELPERS; do
1492 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1495 echo "ERROR: Negotiate Auth helper $helper does not exists"
1499 echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
1501 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1503 dnl Select digest auth scheme helpers to build
1504 if test -n "$AUTH_MODULE_digest"; then
1505 DIGEST_AUTH_HELPERS=all
1507 AC_ARG_ENABLE(digest-auth-helpers,
1508 [ --enable-digest-auth-helpers=\"list of helpers\"
1509 This option selects which digest scheme authentication
1510 helpers to build and install as part of the normal build
1511 process. For a list of available helpers see the
1512 helpers/digest_auth directory.],
1513 [ case "$enableval" in
1515 DIGEST_AUTH_HELPERS="all"
1518 DIGEST_AUTH_HELPERS=""
1521 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1525 if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1526 DIGEST_AUTH_HELPERS=""
1527 for dir in $srcdir/helpers/digest_auth/*; do
1528 helper="`basename $dir`"
1529 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1530 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1534 if test -n "$DIGEST_AUTH_HELPERS"; then
1535 for helper in $DIGEST_AUTH_HELPERS; do
1536 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1539 echo "ERROR: digest auth helper $helper does not exists"
1543 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1545 AC_SUBST(DIGEST_AUTH_HELPERS)
1547 dnl Enable "NTLM fail open"
1548 AC_ARG_ENABLE(ntlm-fail-open,
1549 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1550 Authentication steps can allow squid to still authenticate
1552 [ if test "$enableval" = "yes" ; then
1553 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.])
1557 dnl Select external_acl helpers to build
1558 EXTERNAL_ACL_HELPERS=all
1559 AC_ARG_ENABLE(external-acl-helpers,
1560 [ --enable-external-acl-helpers=\"list of helpers\"
1561 This option selects which external_acl helpers to
1562 build and install as part of the normal build
1563 process. For a list of available helpers see the
1564 helpers/external_acl directory.],
1565 [ case "$enableval" in
1567 EXTERNAL_ACL_HELPERS=all
1570 EXTERNAL_ACL_HELPERS=""
1573 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1577 if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
1578 EXTERNAL_ACL_HELPERS=""
1579 for dir in $srcdir/helpers/external_acl/*; do
1580 helper="`basename $dir`"
1581 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1582 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1586 if test -n "$EXTERNAL_ACL_HELPERS"; then
1587 for helper in $EXTERNAL_ACL_HELPERS; do
1588 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1591 echo "ERROR: external acl helper $helper does not exists"
1595 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1597 AC_SUBST(EXTERNAL_ACL_HELPERS)
1599 AC_ARG_WITH(valgrind-debug,
1600 [ --with-valgrind-debug Include debug instrumentation for use with valgrind],
1609 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1613 if test $valgrind; then
1614 AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
1615 echo "Valgrind debug support enabled"
1619 dnl Disable "memPools" code
1620 AC_ARG_ENABLE(mempools,
1621 [ --disable-mempools Disable memPools. Note that this option now simply sets the
1622 default behaviour. Specific classes can override this at runtime, and
1623 only lib/MemPool.c needs to be altered to change the squid-wide
1624 default for all classes.],
1625 [ if test "$enableval" = "no" ; then
1626 echo "memPools disabled"
1627 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1629 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1632 [ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1635 dnl Enable WIN32 Service compile mode
1636 AC_ARG_ENABLE(win32-service,
1637 [ --enable-win32-service Compile Squid as a WIN32 Service
1638 Works only on Windows NT and Windows 2000 Platforms.],
1639 [ if test "$enableval" = "yes" ; then
1640 echo "Enabling WIN32 run service mode"
1641 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1646 dnl Check for Cyrus SASL
1647 if test "$require_sasl" = "yes"; then
1648 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1649 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1653 if test "$ac_cv_header_sasl_h" = "yes"; then
1657 echo "ERROR: Neither SASL nor SASL2 found"
1664 dnl Disable "unlinkd" code
1665 AC_ARG_ENABLE(unlinkd,
1666 [ --disable-unlinkd Do not use unlinkd],
1667 [ if test "$enableval" = "no" ; then
1673 # Here we should probably use some magic depending on the selected
1677 if test "$use_unlinkd" = "yes"; then
1678 echo "unlinkd enabled"
1679 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1680 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1682 echo "unlinkd disabled"
1683 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1686 dnl Enable backtraces on fatal errors
1687 AC_ARG_ENABLE(stacktraces,
1688 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1689 [ if test "$enableval" = "yes" ; then
1690 echo "Enabling automatic stack backtraces on fatal errors"
1691 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1695 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1696 dnl Enable USE_XPROF_STATS
1697 AC_ARG_ENABLE(cpu-profiling,
1698 [ --enable-cpu-profiling
1699 This option allows you to see which internal functions
1700 in Squid are consuming how much CPU. Compiles in probes
1701 that measure time spent in probed functions. Needs
1702 source modifications to add new probes. This is meant
1703 for developers to assist in performance optimisations
1704 of Squid internal functions.
1705 If you are not developer and not interested in the stats
1706 you shouldn't enable this, as overhead added, although
1707 small, is still overhead. See lib/Profiler.c for more.
1709 [ if test "$enableval" = "yes" ; then
1710 echo "Enabling cpu-profiling"
1711 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1712 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1716 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1717 AC_ARG_ENABLE(x_accelerator_vary,
1718 [ --enable-x-accelerator-vary
1719 Enable support for the X-Accelerator-Vary
1720 HTTP header. Can be used to indicate
1721 variance within an accelerator setup.
1722 Typically used together with other code
1723 that adds custom HTTP headers to the requests.],
1724 [ if test "$enableval" = "yes" ; then
1725 echo "Enabling support for X-Accelerator-Vary"
1726 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1730 dnl Enable IPv6 support
1731 AC_MSG_CHECKING([whether to enable IPv6])
1733 [ --enable-ipv6 Enable ipv6 support],
1734 [ AC_MSG_RESULT(yes)
1735 AC_CACHE_CHECK([if PF_INET6 is available], $enableval,
1737 [ /* PF_INET6 available check */
1738 # include <sys/types.h>
1739 # include <sys/socket.h>
1741 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
1747 [ AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
1750 [ AC_DEFINE(USE_IPV6,0,[0 == Disable support for IPv6])
1751 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[0 == Disable support for Split-Stack IPv6 Implementations])
1752 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[0 == Keep IPv4 and IPv6 Localhosts seperate.])
1753 AC_DEFINE(IPV6_SPECIAL_V4MAPPING,0,[0 == Leave all v4-mapping to OS Implementation])
1758 [ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6])
1759 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[ 0 == Disable support for Split-Stack IPv6 Implementations])
1760 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[ 0 == Keep IPv4 and IPv6 Localhosts seperate.])
1761 AC_DEFINE(IPV6_SPECIAL_V4MAPPING,0,[ 0 == Leave v4-mapping to OS Implementation])
1764 if test $ac_cv_enable_ipv6 ; then
1765 dnl Check for Windows XP option
1766 AC_MSG_CHECKING([for IPv6 split-stack requirement])
1767 AC_ARG_WITH(ipv6-split-stack,
1768 [ --with-ipv6-split-stack Require IPv6 split-stack support (Requires IPv6 Support)],
1769 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [ 1 == Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(yes)],
1770 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [ 0 == Disable support for split-stack IPv6 implementations]) AC_MSG_RESULT(no)]
1773 dnl Check for IPv6 Windows Vista option
1774 AC_MSG_CHECKING([for IPv6 v4-mapping requirement])
1775 AC_ARG_WITH(ipv4-mapped,
1776 [ --with-ipv4-mapped Hybrid-Stack OS require Squid to do any v4-mapping (Requires IPv6 Support)],
1777 [AC_DEFINE(IPV6_SPECIAL_V4MAPPING, 1, [ 1 == Perform v4-mapping internally]) AC_MSG_RESULT(yes)],
1778 [AC_DEFINE(IPV6_SPECIAL_V4MAPPING, 0, [ 0 == Leave all v4-mapping to the OS]) AC_MSG_RESULT(no)]
1781 dnl Check for IPv6-pure option
1782 AC_MSG_CHECKING([for IPv6-Localhost requirement])
1783 AC_ARG_WITH(localhost-ipv6,
1784 [ --with-localhost-ipv6 Prefer IPv6 localhost address over IPv4 (Requires IPv6 Support).
1785 Treats 127.0.0.1 and ::1 as identical and converts all inputs of to ::1
1786 This depends on Dual-Stack support in the OS and all applications
1787 squid contacts via localhost being IPv6 enabled.
1788 Default: OFF. Treats these two IP as different, squid.conf must
1789 define both 127.0.0.1 and ::1 for the localhost ACL, etc. ],
1790 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [ 1 == Convert IPv4-localhost requests to IPv6.]) AC_MSG_RESULT(yes)],
1791 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [ 0 == Keep IPv4 and IPv6 Localhosts seperate.]) AC_MSG_RESULT(no)]
1793 # end IPv6-only options
1796 AC_ARG_WITH(filedescriptors,
1797 [ --with-filedescriptors=NUMBER
1798 Force squid to support NUMBER filedescriptors],
1799 [ squid_filedescriptors_num=$withval ])
1801 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
1802 if $CPPUNITCONFIG --help >/dev/null; then
1803 echo "using system installed cppunit"
1804 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
1806 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
1808 echo "cppunit does not apear to be installed. squid does not require this, but code testing with 'make check' will fail."
1810 SQUID_CPPUNIT_LIBS=''
1811 SQUID_CPPUNIT_INC=''
1814 AC_ARG_WITH(cppunit-basedir,
1815 [ --with-cppunit-basedir=/path/to/cppunit-base
1816 Path where the cppunit headers are libraries are found
1819 [ if test -f $withval/include/cppunit/TestCase.h; then
1820 echo "Using cppunit includes from $withval"
1821 SQUID_CPPUNIT_INC="-I${withval}/include"
1823 echo "ERROR: Cannot find cppunit at $withval"
1826 if test -f $withval/lib/libcppunit.la; then
1827 echo "Using cppunit lib from $withval"
1828 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
1829 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
1831 echo "ERROR: Cannot find cppunit at $withval"
1835 AC_SUBST(SQUID_CPPUNIT_LIBS)
1836 AC_SUBST(SQUID_CPPUNIT_LA)
1837 AC_SUBST(SQUID_CPPUNIT_INC)
1839 # Force some compilers to use ANSI features
1843 if test "$ac_cv_prog_CC" = "cc" ; then
1844 echo "adding '-std1' to cc args for $host"
1850 if test "$ac_cv_prog_CC" = "cc" ; then
1851 echo "adding '-Ae' to cc args for $host"
1858 dnl Check for programs
1862 AC_PATH_PROG(SH, sh, /bin/sh)
1863 AC_PATH_PROG(FALSE, false, /usr/bin/false)
1864 AC_PATH_PROG(TRUE, true, /usr/bin/true)
1865 AC_PATH_PROG(RM, rm, $FALSE)
1866 AC_PATH_PROG(MV, mv, $FALSE)
1867 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
1868 AC_PATH_PROG(LN, ln, cp)
1869 AC_PATH_PROG(PERL, perl, none)
1870 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
1871 AC_PATH_PROG(AR, ar, $FALSE)
1873 if test "$ac_cv_path_PERL" = "none"; then
1874 echo "Perl is required to compile Squid"
1875 echo "Please install Perl and then re-run configure"
1881 echo "Disabling 'ranlib' for HP-UX..."
1895 dnl Check for headers
1929 netinet/in_systm.h \
1933 netinet/ip_fil_compat.h \
1991 linux/netfilter_ipv4.h \
1992 linux/netfilter_ipv4/ip_tproxy.h \
1994 SQUID_DEFAULT_INCLUDES
2000 AC_CHECK_HEADERS(net/if.h \
2002 netinet/ip_compat.h\
2007 resolv.h,,,SQUID_BSDNET_INCLUDES)
2009 AC_CHECK_HEADERS([libxml/parser.h], [], [
2010 SAVED_CPPFLAGS="$CPPFLAGS"
2011 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2012 unset ac_cv_header_libxml_parser_h
2013 AC_CHECK_HEADERS([libxml/parser.h], [], [
2014 CPPFLAGS="$SAVED_CPPFLAGS"
2022 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2025 #include <sys/time.h>
2032 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2033 #if HAVE_SYS_TYPES_H
2034 #include <sys/types.h>
2040 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2041 #if HAVE_SYS_TYPES_H
2042 #include <sys/types.h>
2048 dnl Override rusage() detect on MinGW because is emulated in source code
2051 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2052 ac_cv_func_getrusage='yes'
2053 echo "Using own rusage on Windows."
2056 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2058 #include <sys/time.h>
2060 #if HAVE_SYS_RESOURCE_H
2061 #include <sys/resource.h>
2066 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2067 #if HAVE_SYS_TYPES_H
2068 #include <sys/types.h>
2070 #include <netinet/in.h>
2071 #include <netinet/in_systm.h>
2072 #include <netinet/ip.h>
2073 #if defined (__linux__) || defined (__CYGWIN__)
2082 dnl Check for typedefs
2083 AC_CHECK_SIZEOF(void *)
2085 dnl 8 bit integers - int8_t
2086 dnl if this is defined we trust it to be 8 bits
2087 AC_CHECK_TYPE(int8_t,[
2088 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2089 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2090 ],,SQUID_DEFAULT_INCLUDES)
2093 AC_CHECK_TYPE(char,[
2094 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2095 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2096 ],,SQUID_DEFAULT_INCLUDES)
2098 dnl unsigned 8 bit ints - u_int8_t
2099 dnl if this is defined we trust it to be 8 bits
2100 AC_CHECK_TYPE(u_int8_t,[
2101 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2102 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2103 ],,SQUID_DEFAULT_INCLUDES)
2106 dnl if this is defined we trust it to be 8 bits
2107 AC_CHECK_TYPE(uint8_t,[
2108 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2109 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2110 ],,SQUID_DEFAULT_INCLUDES)
2112 dnl 16 bit integers - int16_t
2113 dnl if this is defined we trust it to be 16 bits
2114 AC_CHECK_TYPE(int16_t,[
2115 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2116 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2117 ],,SQUID_DEFAULT_INCLUDES)
2120 AC_CHECK_TYPE(short,[
2121 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2122 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2123 ],,SQUID_DEFAULT_INCLUDES)
2127 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2128 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2129 ],,SQUID_DEFAULT_INCLUDES)
2131 dnl unsigned 16 bit ints - u_int16_t
2132 dnl if this is defined we trust it to be 16 bits
2133 AC_CHECK_TYPE(u_int16_t,[
2134 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2135 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2136 ],,SQUID_DEFAULT_INCLUDES)
2139 dnl if this is defined we trust it to be 16 bits
2140 AC_CHECK_TYPE(uint16_t,[
2141 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2142 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2143 ],,SQUID_DEFAULT_INCLUDES)
2145 dnl 32 bit signed int - int32_t
2146 dnl if this is defined we trust it to be 32 bits
2147 AC_CHECK_TYPE(int32_t,[
2148 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2149 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2150 ],,SQUID_DEFAULT_INCLUDES)
2153 AC_CHECK_TYPE(long,[
2154 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2155 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2156 ],,SQUID_DEFAULT_INCLUDES)
2158 dnl 32 bit unsigned int - u_int32_t
2159 dnl if this is defined we trust it to be 32 bits
2160 AC_CHECK_TYPE(u_int32_t,[
2161 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2162 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2163 ],,SQUID_DEFAULT_INCLUDES)
2166 dnl if this is defined we trust it to be 32 bits
2167 AC_CHECK_TYPE(uint32_t,[
2168 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2169 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2170 ],,SQUID_DEFAULT_INCLUDES)
2172 dnl 64 bit signed - int64_t
2173 dnl if this is defind we trust it to be 64 bits
2174 AC_CHECK_TYPE(int64_t,[
2175 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2176 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2177 ],,SQUID_DEFAULT_INCLUDES)
2180 dnl if this is defind we trust it to be 64 bits
2181 AC_CHECK_TYPE(__int64,[
2182 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2183 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2184 ],,SQUID_DEFAULT_INCLUDES)
2187 AC_CHECK_TYPE(long long,[
2188 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2189 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2190 ],,SQUID_DEFAULT_INCLUDES)
2192 dnl 64 bit unsigned - u_int64_t
2193 dnl if this is defind we trust it to be 64 bits
2194 AC_CHECK_TYPE(u_int64_t,[
2195 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2196 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2197 ],,SQUID_DEFAULT_INCLUDES)
2200 dnl if this is defind we trust it to be 64 bits
2201 AC_CHECK_TYPE(uint64_t,[
2202 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2203 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2204 ],,SQUID_DEFAULT_INCLUDES)
2206 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2207 dnl that is incompatible with the updated Solaris header files.
2208 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2209 AC_CHECK_TYPE(pad128_t,
2210 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2211 ,SQUID_DEFAULT_INCLUDES)
2213 AC_CHECK_TYPE(upad128_t,
2214 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2215 ,SQUID_DEFAULT_INCLUDES)
2217 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2218 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2219 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2220 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2221 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2222 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2223 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2224 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2226 dnl Check for special functions
2229 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2230 #include <sys/types.h>
2231 #include <sys/socket.h>
2237 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2238 #include <sys/ipc.h>
2239 #include <sys/msg.h>])
2241 dnl Check for needed libraries
2242 AC_CHECK_LIB(nsl, main)
2243 AC_CHECK_LIB(socket, main)
2246 AC_MSG_CHECKING(for winsock)
2248 for curlib in ws2_32 wsock32; do
2249 LIBS="$LIBS -l$curlib"
2251 char __attribute__((stdcall)) socket(int,int,int);
2252 char __attribute__((stdcall)) select(int,int,int,int,int);
2253 char __attribute__((stdcall)) closesocket(int);
2254 char __attribute__((stdcall)) gethostname(int,int);
2262 have_winsock=yes, have_winsock=no)
2264 if test $have_winsock = yes; then
2265 ac_cv_func_select='yes'
2266 if test $curlib = ws2_32; then
2267 have_winsock=winsock2
2273 AC_MSG_RESULT($have_winsock)
2277 dnl Ripped from the Samba sources
2278 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2280 #include <sys/types.h>
2283 #include <sys/socket.h>
2284 #include <sys/un.h>],
2286 struct sockaddr_un sunaddr;
2287 sunaddr.sun_family = AF_UNIX;
2289 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2290 if test x"$squid_cv_unixsocket" = x"yes"; then
2291 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2295 AC_CHECK_LIB(gnumalloc, main)
2296 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2297 echo "Disabling extended malloc functions when using gnumalloc"
2298 ac_cv_func_mallinfo=no
2299 ac_cv_func_mallocblksize=no
2300 ac_cv_func_mallopt=no
2304 echo "skipping libmalloc check for $host"
2307 echo "skipping libmalloc check for $host"
2311 AC_CHECK_LIB(malloc, main)
2316 AC_CHECK_LIB(bsd, main)
2317 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2318 AC_CHECK_LIB(bind, gethostbyname)
2319 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2322 echo "skipping libresolv checks for $host"
2325 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
2326 AC_CHECK_LIB(resolv, main)
2332 echo "Use MSVCRT for math functions."
2335 AC_CHECK_LIB(m, main)
2339 dnl Check for libcrypt
2340 dnl Some of our helpers use crypt(3) which may be in libc, or in
2341 dnl libcrypt (eg FreeBSD)
2342 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2344 dnl Solaris10 provides MD5 natively through libmd5
2345 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
2349 dnl Check for libdl, used by auth_modules/PAM
2350 if test "$with_dl" = "yes"; then
2351 AC_CHECK_LIB(dl, dlopen)
2354 dnl Check for pthreads
2355 dnl We use pthreads when doing ASYNC I/O
2356 if test "$with_pthreads" = "yes"; then
2357 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2358 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
2360 i386-unknown-freebsd*)
2361 if test "$GCC" = "yes" ; then
2362 if test -z "$PRESET_LDFLAGS"; then
2363 LDFLAGS="$LDFLAGS -pthread"
2368 if test "$GCC" = "yes" ; then
2369 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2370 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
2372 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2373 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
2377 AC_CHECK_LIB(pthread, main)
2381 dnl We use AIO in the coss store
2382 if test "$with_aio" = "yes"; then
2383 dnl On some systems POSIX AIO functions are in libaio
2384 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
2387 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2388 dnl Robert Side <rside@aiinc.bc.ca>
2389 dnl Mon, 18 Jan 1999 17:48:00 GMT
2392 AC_CHECK_LIB(intl, strftime)
2396 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2397 dnl only with Windows LDAP libraries using -lwldap32
2400 LIB_LDAP="-lwldap32"
2405 dnl LDAP helpers need to know if -llber is needed or not
2406 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2415 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
2416 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2418 #if HAVE_SYS_TYPES_H
2419 #include <sys/types.h>
2429 [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)],
2430 ac_cv_dbopen_libdb="yes",
2431 ac_cv_dbopen_libdb="no")
2434 if test $ac_cv_dbopen_libdb = yes; then
2439 dnl System-specific library modifications
2443 if test "$GCC" = "yes"; then
2444 echo "Removing -O for gcc on $host"
2445 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2449 echo "Removing -lsocket for IRIX..."
2450 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2451 echo "Removing -lnsl for IRIX..."
2452 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2453 ac_cv_lib_nsl_main=no
2454 echo "Removing -lbsd for IRIX..."
2455 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2457 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2458 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2459 dnl Please change your configure script. AIX doesn't need -lbsd.
2461 echo "Removing -lbsd for AIX..."
2462 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2465 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2466 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2467 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2469 [*-*-solaris2.[0-4]])
2470 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2472 [*-sony-newsos[56]*])
2473 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2477 # Remove optimization for GCC 2.95.[123]
2478 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2479 if test "$GCC" = "yes"; then
2480 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2483 echo "Removing -O for gcc on $host with GCC $GCCVER"
2484 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2489 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2492 if test `uname -v` = "2.03"; then
2493 echo "disabling mallinfo for $host"
2494 ac_cv_func_mallinfo=no
2499 dnl This has to be before AC_CHECK_FUNCS
2500 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2501 # when running configure.
2502 if test -z "$ac_cv_func_poll"; then
2505 # John Kay (jkay@nlanr.net) 19970818
2506 echo "disabling poll for $host..."
2507 ac_cv_func_poll='no'
2511 echo "disabling poll for $host..."
2512 ac_cv_func_poll='no'
2515 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2516 # poll is problematic on Linux. We disable it
2517 # by default until Linux gets it right.
2518 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2519 if test $rev -lt 002002; then
2520 echo "disabling poll for $host < 2.2..."
2521 ac_cv_func_poll='no'
2524 [powerpc-ibm-aix4.1.*])
2525 # Mike Laster (mlaster@metavillage.com) 19981021
2526 echo "disabling poll for $host..."
2527 ac_cv_func_poll='no'
2530 # Robert Side <rside@aiinc.bc.ca>
2531 # Mon, 18 Jan 1999 17:48:00 GMT
2532 echo "disabling poll for $host..."
2533 ac_cv_func_poll='no'
2538 dnl Override statfs() detect on MinGW becasue is emulated in source code
2541 ac_cv_func_statfs='yes'
2545 dnl Check for library functions
2547 backtrace_symbols_fd \
2576 pthread_attr_setschedparam \
2577 pthread_attr_setscope \
2578 pthread_setschedparam \
2608 dnl ... and some we provide local replacements for
2620 # check for crypt, may require -lcrypt
2622 LIBS="$LIBS $CRYPTLIB"
2623 AC_CHECK_FUNCS(crypt)
2626 # Check for libepoll
2628 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
2629 AC_SUBST(EPOLL_LIBS)
2631 # Check for epoll_ctl, may need -lepoll
2633 LIBS="$LIBS $LIB_EPOLL"
2634 AC_CHECK_FUNCS(epoll_ctl)
2637 dnl Verify that epoll really works
2638 if test $ac_cv_func_epoll_ctl = yes; then
2639 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
2641 #include <sys/epoll.h>
2644 int main(int argc, char **argv)
2646 int fd = epoll_create(256);
2648 perror("epoll_create:");
2653 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
2656 dnl Magic which checks whether we are forcing a type of comm loop we
2657 dnl are actually going to (ab)use
2659 dnl Actually do the define magic now
2660 dnl mostly ripped from squid-commloops, thanks to adrian and benno
2662 if test -n "$SELECT_TYPE"; then
2663 : # Already decided above. Nothing to do here
2664 elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
2666 elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
2667 SELECT_TYPE="kqueue"
2668 elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
2670 elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
2673 SELECT_TYPE="select_win32"
2676 SELECT_TYPE="select"
2680 echo "Eep! Can't find poll, kqueue, epoll, or select!"
2681 echo "I'll try select and hope for the best."
2682 SELECT_TYPE="select"
2683 AC_DEFINE(USE_SELECT,1)
2686 echo "Using ${SELECT_TYPE} for the IO loop."
2688 AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2689 AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2690 AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2691 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2692 AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2693 AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2694 AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2696 case $SELECT_TYPE in
2698 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2701 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2704 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2707 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
2710 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2716 dnl Yay! Another Linux brokenness. Its not good enough
2717 dnl to know that setresuid() exists, because RedHat 5.0 declares
2718 dnl setresuid() but doesn't implement it.
2720 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2724 if(setresuid(-1,-1,-1)) {
2725 perror("setresuid:");
2730 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2732 if test "$ac_cv_func_setresuid" = "yes" ; then
2733 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.])
2736 AM_CONDITIONAL(NEED_OWN_STRSEP, false)
2737 if test "$ac_cv_func_strsep" = "no" ; then
2738 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
2741 AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
2742 if test "$ac_cv_func_strtoll" = "no" ; then
2743 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
2747 dnl Test for va_copy
2749 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
2752 void f (int i, ...) {
2753 va_list args1, args2;
2754 va_start (args1, i);
2755 va_copy (args2, args1);
2756 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2758 va_end (args1); va_end (args2);
2764 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
2766 if test "$ac_cv_func_va_copy" = "yes" ; then
2767 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
2771 dnl Some systems support __va_copy
2773 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
2776 void f (int i, ...) {
2777 va_list args1, args2;
2778 va_start (args1, i);
2779 __va_copy (args2, args1);
2780 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2782 va_end (args1); va_end (args2);
2788 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
2790 if test "$ac_cv_func___va_copy" = "yes" ; then
2791 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
2794 dnl IP-Filter support requires ipf header files. These aren't
2795 dnl installed by default, so we need to check for them
2796 if test "$IPF_TRANSPARENT" ; then
2797 AC_MSG_CHECKING(if IP-Filter header files are installed)
2798 # hold on to your hats...
2799 if test "$ac_cv_header_ip_compat_h" = "yes" ||
2800 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
2801 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
2802 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
2803 have_ipfilter_compat_header="yes"
2805 if test "x$have_ipfilter_compat_header" = "xyes" &&
2806 test "$ac_cv_header_ip_fil_h" = "yes" &&
2807 test "$ac_cv_header_ip_nat_h" = "yes" ; then
2808 IPF_TRANSPARENT="yes"
2809 AC_DEFINE(IPF_TRANSPARENT, 1)
2810 elif test "$have_ipfilter_compat_header" = "yes" &&
2811 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
2812 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
2813 IPF_TRANSPARENT="yes"
2814 AC_DEFINE(IPF_TRANSPARENT, 1)
2816 IPF_TRANSPARENT="no"
2817 AC_DEFINE(IPF_TRANSPARENT, 0)
2819 AC_MSG_RESULT($IPF_TRANSPARENT)
2821 if test "$IPF_TRANSPARENT" = "no" ; then
2822 echo "WARNING: Cannot find necessary IP-Filter header files"
2823 echo " Transparent Proxy support WILL NOT be enabled"
2825 elif test "$IPF_TRANSPARENT" = "yes" ; then
2826 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
2827 dnl Solaris minor version (8, 9, 10, ...)
2830 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
2831 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
2832 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
2839 dnl PF support requires a header file.
2840 if test "$PF_TRANSPARENT" ; then
2841 AC_MSG_CHECKING(if PF header file is installed)
2842 # hold on to your hats...
2843 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
2844 PF_TRANSPARENT="yes"
2845 AC_DEFINE(PF_TRANSPARENT, 1)
2848 AC_DEFINE(PF_TRANSPARENT, 0)
2850 AC_MSG_RESULT($PF_TRANSPARENT)
2852 if test "$PF_TRANSPARENT" = "no" ; then
2853 echo "WARNING: Cannot find necessary PF header file"
2854 echo " Transparent Proxy support WILL NOT be enabled"
2858 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
2859 dnl Shamelessly copied from above
2860 if test "$LINUX_NETFILTER" ; then
2861 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
2862 # hold on to your hats...
2863 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
2864 LINUX_NETFILTER="yes"
2865 AC_DEFINE(LINUX_NETFILTER, 1)
2867 LINUX_NETFILTER="no"
2868 AC_DEFINE(LINUX_NETFILTER, 0)
2870 AC_MSG_RESULT($LINUX_NETFILTER)
2872 if test "$LINUX_NETFILTER" = "no" ; then
2873 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
2874 echo " Linux Transparent Proxy support WILL NOT be enabled"
2878 dnl Linux Netfilter/TPROXY support requires some specific header files
2879 dnl Shamelessly copied from shamelessly copied from above
2880 if test "$LINUX_TPROXY" ; then
2881 AC_MSG_CHECKING(if TPROXY header files are installed)
2882 # hold on to your hats...
2883 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
2885 AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.])
2888 AC_DEFINE(LINUX_TPROXY, 0, [Enable real Transparent Proxy support for Netfilter TPROXY.])
2890 AC_MSG_RESULT($LINUX_TPROXY)
2892 if test "$LINUX_TPROXY" = "no" && test "$LINUX_NETFILTER" = "yes"; then
2893 echo "WARNING: Cannot find TPROXY headers, you need to install the"
2894 echo "tproxy package from:"
2895 echo " - lynx http://www.balabit.com/downloads/tproxy/"
2899 if test -z "$USE_GNUREGEX" ; then
2901 *-sun-solaris2.[[0-4]])
2909 AC_MSG_CHECKING(if GNUregex needs to be compiled)
2910 if test -z "$USE_GNUREGEX"; then
2911 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
2914 AC_TRY_COMPILE([#include <sys/types.h>
2915 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
2920 AC_MSG_RESULT($USE_GNUREGEX)
2921 if test "$USE_GNUREGEX" = "yes"; then
2923 LIBREGEX="libregex.a"
2924 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
2929 dnl Not cached since people are likely to tune this
2930 AC_MSG_CHECKING(Default FD_SETSIZE value)
2939 #include <sys/time.h>
2941 #if HAVE_SYS_SELECT_H
2942 #include <sys/select.h>
2944 #if HAVE_SYS_TYPES_H
2945 #include <sys/types.h>
2948 FILE *fp = fopen("conftestval", "w");
2949 fprintf (fp, "%d\n", FD_SETSIZE);
2953 DEFAULT_FD_SETSIZE=`cat conftestval`,
2954 DEFAULT_FD_SETSIZE=256,
2955 DEFAULT_FD_SETSIZE=256)
2956 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
2957 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
2960 dnl Not cached since people are likely to tune this
2961 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
2962 dnl damn! FreeBSD's pthreads breaks dup2().
2963 if test -n "$squid_filedescriptors_num" ; then
2964 SQUID_MAXFD=$squid_filedescriptors_num
2965 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
2969 i386-unknown-freebsd*)
2970 if echo "$LDFLAGS" | grep -q pthread; then
2971 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
2977 #include <sys/time.h> /* needed on FreeBSD */
2978 #include <sys/param.h>
2979 #include <sys/resource.h>
2983 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
2984 /* getrlimit and sysconf returns bogous values on cygwin32.
2985 * Number of fds is virtually unlimited in cygwin (sys/param.h)
2986 * __CYGWIN32__ is deprecated.
2992 #if defined(RLIMIT_NOFILE)
2993 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
2994 perror("getrlimit: RLIMIT_NOFILE");
2996 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2997 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
2998 perror("setrlimit: RLIMIT_NOFILE");
3001 #elif defined(RLIMIT_OFILE)
3002 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3003 perror("getrlimit: RLIMIT_OFILE");
3005 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3006 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3007 perror("setrlimit: RLIMIT_OFILE");
3010 #endif /* RLIMIT_NOFILE */
3011 #endif /* HAVE_SETRLIMIT */
3012 /* by starting at 2^14, we will never get higher
3013 than 2^15 for SQUID_MAXFD */
3017 if (dup2(0, i) < 0) {
3025 #endif /* IF !DEF CYGWIN */
3026 fp = fopen("conftestval", "w");
3027 fprintf (fp, "%d\n", i & ~0x3F);
3031 SQUID_MAXFD=`cat conftestval`,
3034 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3040 AC_MSG_RESULT($SQUID_MAXFD)
3042 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3043 if test "$SQUID_MAXFD" -lt 512 ; then
3044 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
3045 echo " cache will be very busy. Please see the FAQ page"
3046 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
3047 echo " on how to increase your filedescriptor limit"
3052 if test `expr $SQUID_MAXFD % 64` != 0; then
3053 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
3054 echo " on certain platforms."
3058 dnl Not cached since people are likely to tune this
3059 AC_MSG_CHECKING(Default UDP send buffer size)
3063 #include <sys/types.h>
3064 #include <sys/socket.h>
3065 #include <netinet/in.h>
3069 int fd,val=0,len=sizeof(int);
3070 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3071 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3072 if (val<=0) exit(1);
3073 fp = fopen("conftestval", "w");
3074 fprintf (fp, "%d\n", val);
3078 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3079 SQUID_DETECT_UDP_SO_SNDBUF=16384,
3080 SQUID_DETECT_UDP_SO_SNDBUF=16384)
3081 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3082 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3084 dnl Not cached since people are likely to tune this
3085 AC_MSG_CHECKING(Default UDP receive buffer size)
3089 #include <sys/types.h>
3090 #include <sys/socket.h>
3091 #include <netinet/in.h>
3095 int fd,val=0,len=sizeof(int);
3096 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3097 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3098 if (val <= 0) exit(1);
3099 fp = fopen("conftestval", "w");
3100 fprintf (fp, "%d\n", val);
3104 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3105 SQUID_DETECT_UDP_SO_RCVBUF=16384,
3106 SQUID_DETECT_UDP_SO_RCVBUF=16384)
3107 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3108 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3110 dnl Not cached since people are likely to tune this
3111 AC_MSG_CHECKING(Default TCP send buffer size)
3115 #include <sys/types.h>
3116 #include <sys/socket.h>
3117 #include <netinet/in.h>
3121 int fd,val=0,len=sizeof(int);
3122 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3123 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3124 if (val <= 0) exit(1);
3125 fp = fopen("conftestval", "w");
3126 fprintf (fp, "%d\n", val);
3130 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
3131 SQUID_TCP_SO_SNDBUF=16384,
3132 SQUID_TCP_SO_SNDBUF=16384)
3133 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3134 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3135 echo "Limiting send buffer size to 32K"
3136 SQUID_TCP_SO_SNDBUF=32768
3138 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3140 dnl Not cached since people are likely to tune this
3141 AC_MSG_CHECKING(Default TCP receive buffer size)
3145 #include <sys/types.h>
3146 #include <sys/socket.h>
3147 #include <netinet/in.h>
3151 int fd,val=0,len=sizeof(int);
3152 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3153 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3154 if (val <= 0) exit(1);
3155 fp = fopen("conftestval", "w");
3156 fprintf (fp, "%d\n", val);
3160 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
3161 SQUID_TCP_SO_RCVBUF=16384,
3162 SQUID_TCP_SO_RCVBUF=16384)
3163 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3164 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3165 echo "Limiting receive buffer size to 64K"
3166 SQUID_TCP_SO_RCVBUF=65535
3168 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3169 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3170 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
3171 ac_cv_needs_sys_errlist="no",
3172 ac_cv_needs_sys_errlist="yes")
3174 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3175 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3178 dnl Not cached since people are likely to change this
3179 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3180 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3182 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
3185 AC_MSG_CHECKING(if inet_ntoa() actually works)
3189 #include <sys/types.h>
3190 #include <netinet/in.h>
3191 #include <arpa/inet.h>
3196 in.s_addr = inet_addr("1.2.3.4");
3197 fp = fopen("conftestval", "w");
3198 fprintf (fp, "%s\n", inet_ntoa(in));
3202 INET_NTOA_RESULT=`cat conftestval`,
3203 INET_NTOA_RESULT="broken",
3204 INET_NTOA_RESULT="broken")
3205 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3206 AC_MSG_RESULT("yes")
3211 echo "Using Win32 resolver instead."
3214 echo "Will use our own inet_ntoa()."
3215 AC_LIBOBJ(inet_ntoa)
3216 # echo "WARNING: This looks bad, and probably prevents Squid from working."
3217 # echo " If you're on IRIX and using GCC 2.8, you probably need"
3218 # echo " to use the IRIX C compiler instead."
3224 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3225 AC_MSG_CHECKING(for working statvfs() interface)
3229 #include <sys/types.h>
3230 #include <sys/statvfs.h>
3234 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3235 sfs.f_files = sfs.f_ffree = 0;
3236 statvfs("/tmp", &sfs);
3238 ac_cv_func_statvfs=yes,
3239 ac_cv_func_statvfs=no)
3240 AC_MSG_RESULT($ac_cv_func_statvfs)
3241 if test "$ac_cv_func_statvfs" = "yes" ; then
3242 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3246 dnl Detect what resolver fields we have available to use...
3247 AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3249 #if HAVE_SYS_TYPES_H
3250 #include <sys/types.h>
3252 #if HAVE_NETINET_IN_H
3253 #include <netinet/in.h>
3255 #if HAVE_ARPA_INET_H
3256 #include <arpa/inet.h>
3258 #if HAVE_ARPA_NAMESER_H
3259 #include <arpa/nameser.h>
3265 [_res_ext.nsaddr_list[[0]].s_addr;],
3266 ac_cv_have_res_ext_nsaddr_list="yes",
3267 ac_cv_have_res_ext_nsaddr_list="no"))
3268 if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3269 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3270 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3273 if test "$_SQUID_RES_NSADDR6_LIST" == ""; then
3274 AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3276 #if HAVE_SYS_TYPES_H
3277 #include <sys/types.h>
3279 #if HAVE_NETINET_IN_H
3280 #include <netinet/in.h>
3282 #if HAVE_ARPA_INET_H
3283 #include <arpa/inet.h>
3285 #if HAVE_ARPA_NAMESER_H
3286 #include <arpa/nameser.h>
3292 [_res._u._ext.nsaddrs[[0]]->sin6_addr;],
3293 ac_cv_have_res_ext_nsaddrs="yes",
3294 ac_cv_have_res_ext_nsaddrs="no"))
3295 if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3296 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3297 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3301 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3303 #if HAVE_SYS_TYPES_H
3304 #include <sys/types.h>
3306 #if HAVE_NETINET_IN_H
3307 #include <netinet/in.h>
3309 #if HAVE_ARPA_INET_H
3310 #include <arpa/inet.h>
3312 #if HAVE_ARPA_NAMESER_H
3313 #include <arpa/nameser.h>
3319 [_res.nsaddr_list[[0]];],
3320 ac_cv_have_res_nsaddr_list="yes",
3321 ac_cv_have_res_nsaddr_list="no"))
3322 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3323 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3324 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3327 if test "$_SQUID_RES_NSADDR_LIST" == ""; then
3328 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3330 #if HAVE_SYS_TYPES_H
3331 #include <sys/types.h>
3333 #if HAVE_NETINET_IN_H
3334 #include <netinet/in.h>
3336 #if HAVE_ARPA_INET_H
3337 #include <arpa/inet.h>
3339 #if HAVE_ARPA_NAMESER_H
3340 #include <arpa/nameser.h>
3346 [_res.ns_list[[0]].addr;],
3347 ac_cv_have_res_ns_list="yes",
3348 ac_cv_have_res_ns_list="no"))
3349 if test $ac_cv_have_res_ns_list = "yes" ; then
3350 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3351 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3355 dnl Need the debugging version of malloc if available
3357 if test "$ac_cv_lib_malloc_main" = "yes" ; then
3358 if test -r /usr/lib/debug/malloc.o ; then
3359 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3361 if test -r /usr/lib/debug/mallocmap.o ; then
3362 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3368 if test -z "$XTRA_LIBS"; then
3371 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3376 dnl Clean up after OSF/1 core dump bug
3393 test-suite/Makefile \
3396 helpers/basic_auth/Makefile \
3397 helpers/basic_auth/LDAP/Makefile \
3398 helpers/basic_auth/MSNT/Makefile \
3399 helpers/basic_auth/NCSA/Makefile \
3400 helpers/basic_auth/PAM/Makefile \
3401 helpers/basic_auth/SMB/Makefile \
3402 helpers/basic_auth/mswin_sspi/Makefile \
3403 helpers/basic_auth/YP/Makefile \
3404 helpers/basic_auth/getpwnam/Makefile \
3405 helpers/basic_auth/multi-domain-NTLM/Makefile \
3406 helpers/basic_auth/SASL/Makefile \
3407 helpers/basic_auth/POP3/Makefile \
3408 helpers/basic_auth/DB/Makefile \
3409 helpers/basic_auth/squid_radius_auth/Makefile \
3410 helpers/digest_auth/Makefile \
3411 helpers/digest_auth/password/Makefile \
3412 helpers/digest_auth/ldap/Makefile \
3413 helpers/digest_auth/eDirectory/Makefile \
3414 helpers/ntlm_auth/Makefile \
3415 helpers/ntlm_auth/fakeauth/Makefile \
3416 helpers/ntlm_auth/no_check/Makefile \
3417 helpers/ntlm_auth/SMB/Makefile \
3418 helpers/ntlm_auth/SMB/smbval/Makefile \
3419 helpers/ntlm_auth/mswin_sspi/Makefile \
3420 helpers/negotiate_auth/Makefile \
3421 helpers/negotiate_auth/mswin_sspi/Makefile \
3422 helpers/negotiate_auth/squid_kerb_auth/Makefile \
3423 helpers/external_acl/Makefile \
3424 helpers/external_acl/ip_user/Makefile \
3425 helpers/external_acl/ldap_group/Makefile \
3426 helpers/external_acl/session/Makefile \
3427 helpers/external_acl/unix_group/Makefile \
3428 helpers/external_acl/wbinfo_group/Makefile \
3429 helpers/external_acl/mswin_lm_group/Makefile \
3433 AC_CONFIG_SUBDIRS(lib/libTrie)