2 dnl Configuration input file for Squid
4 dnl $Id: configure.in,v 1.468 2007/08/27 09:43:44 hno Exp $
8 AC_INIT(Squid Web Proxy, 3.0.PRE6-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.468 $)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 [If you want to use Squid's ICMP features (highly recommended!) then
672 define this. When USE_ICMP is defined, Squid will send ICMP pings
673 to origin server sites. This information is used in numerous ways:
674 - Sent in ICP replies so neighbor caches know how close
675 you are to the source.
676 - For finding the closest instance of a URN.
677 - With the 'test_reachability' option. Squid will return
678 ICP_OP_MISS_NOFETCH for sites which it cannot ping.])
679 AM_CONDITIONAL(ENABLE_PINGER, true)
683 AM_CONDITIONAL(USE_DELAY_POOLS, false)
684 AC_ARG_ENABLE(delay-pools,
685 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
686 [ if test "$enableval" = "yes" ; then
687 echo "Delay pools enabled"
688 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
689 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
693 AM_CONDITIONAL(USE_ESI, false)
695 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.]),
696 ac_cv_use_esi=$enableval, ac_cv_use_esi=no)
697 AC_CACHE_CHECK(whether to enable ESI,ac_cv_use_esi, ac_cv_use_esi=no)
698 if test "$ac_cv_use_esi" = "yes" ; then
699 AC_DEFINE(ESI,1,[Compile the ESI processor and Surrogate header support])
700 AM_CONDITIONAL(USE_ESI, true)
701 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
703 AC_DEFINE(ESI,0,[Compile the ESI processor and Surrogate header support])
706 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
707 AC_ARG_ENABLE(icap-client,
708 AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
709 ac_cv_use_icap_client=$enableval, ac_cv_use_icap_client=no)
710 AC_CACHE_CHECK(whether to enable the ICAP client,ac_cv_use_icap_client, ac_cv_use_icap_client=no)
711 if test "$ac_cv_use_icap_client" = "yes" ; then
712 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
713 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
714 ICAP_LIBS="ICAP/libicap.a"
716 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
721 dnl This is a developer only option. Developers know how to set defines
723 dnl AC_ARG_ENABLE(mem-gen-trace,
724 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
725 dnl [ if test "$enableval" = "yes" ; then
726 dnl echo "Memory trace (to file) enabled"
727 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
731 AC_ARG_ENABLE(useragent-log,
732 [ --enable-useragent-log Enable logging of User-Agent header],
733 [ if test "$enableval" = "yes" ; then
734 echo "User-Agent logging enabled"
735 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
736 By default, they are written to useragent.log in the Squid log
741 AC_ARG_ENABLE(referer-log,
742 [ --enable-referer-log Enable logging of Referer header],
743 [ if test "$enableval" = "yes" ; then
744 echo "Referer logging enabled"
745 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
746 By default, they are written to referer.log in the Squid log
753 [ --disable-wccp Disable Web Cache Coordination Protocol],
754 [ if test "$enableval" = "no" ; then
755 echo "Web Cache Coordination Protocol disabled"
759 if test $USE_WCCP = 1; then
760 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
764 AC_ARG_ENABLE(wccpv2,
765 [ --disable-wccpv2 Disable Web Cache Coordination V2 Protocol],
766 [ if test "$enableval" = "no" ; then
767 echo "Web Cache Coordination V2 Protocol disabled"
771 if test $USE_WCCPv2 = 1; then
772 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
775 AC_ARG_ENABLE(kill-parent-hack,
776 [ --enable-kill-parent-hack
777 Kill parent on shutdown],
778 [ if test "$enableval" = "yes" ; then
779 echo "Kill parent on shutdown"
780 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
781 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
786 AM_CONDITIONAL(USE_SNMP, false)
788 [ --enable-snmp Enable SNMP monitoring],
789 [ if test "$enableval" = "yes" ; then
790 echo "SNMP monitoring enabled"
791 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
792 SNMPLIB='../snmplib/libsnmp.a'
793 AM_CONDITIONAL(USE_SNMP, true)
794 SNMP_MAKEFILE=./snmplib/Makefile
799 AC_SUBST(makesnmplib)
801 AC_ARG_ENABLE(cachemgr-hostname,
802 [ --enable-cachemgr-hostname[=hostname]
803 Make cachemgr.cgi default to this host],
806 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
807 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
808 echo "Cachemgr default hostname == host where cachemgr runs"
814 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
815 echo "Cachemgr default hostname set to ${enableval}"
820 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
821 AC_ARG_ENABLE(arp-acl,
822 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
823 [ if test "$enableval" = "yes" ; then
824 echo "ARP ACL lists enabled (ether address)"
837 LIBS="$LIBS -liphlpapi"
840 LIBS="$LIBS -liphlpapi"
843 echo "WARNING: ARP ACL support probably won't work on $host."
847 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, ?).])
848 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
852 AM_CONDITIONAL(ENABLE_HTCP, false)
854 [ --enable-htcp Enable HTCP protocol],
855 [ if test "$enableval" = "yes" ; then
857 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
858 AM_CONDITIONAL(ENABLE_HTCP, true)
862 AM_CONDITIONAL(ENABLE_SSL, false)
865 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
866 [ if test "$enableval" != "no"; then
867 echo "SSL gatewaying using OpenSSL enabled"
868 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
869 AM_CONDITIONAL(ENABLE_SSL, true)
872 dnl Native Windows port of OpenSSL needs -lgdi32
873 SSLLIB='-lssleay32 -leay32 -lgdi32'
876 SSLLIB='-lssl -lcrypto'
883 AM_CONDITIONAL(NEED_OWN_MD5, true)
886 [ --with-openssl[=prefix]
887 Compile with the OpenSSL libraries. The path to
888 the OpenSSL development libraries and headers
889 installation can be specified if outside of the
890 system standard directories],
892 case "$with_openssl" in
900 SSLLIBDIR="$with_openssl/lib"
901 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
906 if test -n "$USE_OPENSSL"; then
907 echo "Using OpenSSL MD5 implementation"
908 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)])
909 AM_CONDITIONAL(NEED_OWN_MD5, false)
910 if test -z "$SSLLIB"; then
911 SSLLIB="-lcrypto" # for MD5 routines
913 dnl This is a workaround for RedHat 9 brain damage..
914 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
915 echo "OpenSSL depends on Kerberos"
916 SSLLIBDIR="/usr/kerberos/lib"
917 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
920 if test -n "$SSLLIBDIR"; then
921 SSLLIB="-L$SSLLIBDIR $SSLLIB"
925 AC_ARG_ENABLE(forw-via-db,
926 [ --enable-forw-via-db Enable Forw/Via database],
927 [ if test "$enableval" = "yes" ; then
928 echo "FORW-VIA enabled"
929 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
933 AC_ARG_ENABLE(cache-digests,
934 [ --enable-cache-digests Use Cache Digests
935 see http://www.squid-cache.org/FAQ/FAQ-16.html],
936 [ if test "$enableval" = "yes" ; then
937 echo "USE_CACHE_DIGESTS enabled"
938 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
942 dnl Select Default Error language
943 AC_ARG_ENABLE(default-err-language,
944 [ --enable-default-err-language=lang
945 Select default language for Error pages (see
948 if test -d $srcdir/errors/$enableval; then
949 ERR_DEFAULT_LANGUAGE=$enableval
951 echo "ERROR! Unknown language $enableval, see errors/ directory"
954 ],[ERR_DEFAULT_LANGUAGE="English"])
955 AC_SUBST(ERR_DEFAULT_LANGUAGE)
957 dnl Select languages to be installed
958 AC_ARG_ENABLE(err-languages,
959 [ --enable-err-languages=\"lang1 lang2..\"
960 Select languages to be installed. (All will be
961 installed by default) ],
963 for l in $enableval; do
964 if test -d $srcdir/errors/$l; then :; else
965 echo "ERROR! Unknown language $$l, see errors/"
969 ERR_LANGUAGES=$enableval
972 for l in $srcdir/errors/*; do
973 if test -f $l/ERR_ACCESS_DENIED; then
974 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
978 AC_SUBST(ERR_LANGUAGES)
980 dnl Size of COSS memory buffer
981 AC_ARG_WITH(coss-membuf-size,
982 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
983 [ if test "$with_coss_membuf_size"; then
984 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
985 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
989 dnl check for netio plugin stuff
992 [ --enable-poll Enable poll() support.
993 --disable-poll Disable poll() support. ],
998 echo "Forcing poll() to be enabled"
999 ac_cv_func_poll='yes'
1003 echo "Forcing poll() to be disabled"
1004 ac_cv_func_poll='no'
1010 AC_ARG_ENABLE(select,
1011 [ --enable-select Enable select() support.
1012 --disable-select Disable select() support. ],
1015 case "$enableval" in
1017 echo "Forcing select() to be enabled"
1018 ac_cv_func_select='yes'
1019 SELECT_TYPE="select"
1022 echo "Forcing select() to be disabled"
1023 ac_cv_func_select='no'
1029 AC_ARG_ENABLE(kqueue,
1030 [ --enable-kqueue Enable kqueue() support (experimental).
1031 --disable-kqueue Disable kqueue() support. ],
1034 case "$enableval" in
1036 echo "Forcing kqueue() to be enabled"
1037 ac_cv_func_kqueue='yes'
1038 SELECT_TYPE="kqueue"
1041 echo "Forcing kqueue() to be disabled"
1042 ac_cv_func_kqueue='no'
1048 AC_ARG_ENABLE(epoll,
1049 [ --enable-epoll Enable epoll() support.
1050 --disable-epoll Disable epoll() support. ],
1053 case "$enableval" in
1055 echo "Forcing epoll() to be enabled"
1056 ac_cv_func_epoll_ctl='yes'
1060 echo "Forcing epoll() to be disabled"
1061 ac_cv_func_epoll_ctl='no'
1067 dnl Disable HTTP violations
1069 AC_ARG_ENABLE(http-violations,
1070 [ --disable-http-violations
1071 This allows you to remove code which is known to
1072 violate the HTTP protocol specification.],
1073 [ if test "$enableval" = "no" ; then
1074 echo "Disabling HTTP Violations"
1078 if test $http_violations = 1; then
1079 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.])
1081 AC_DEFINE(HTTP_VIOLATIONS, 0)
1084 dnl Enable IPFW Transparent Proxy
1085 AC_ARG_ENABLE(ipfw-transparent,
1086 [ --enable-ipfw-transparent
1087 Enable Transparent Proxy support for systems
1088 using FreeBSD IPFW style redirection.],
1089 [ if test "$enableval" = "yes" ; then
1090 echo "IPFW Transparent Proxy enabled"
1091 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1092 IPFW_TRANSPARENT="yes"
1096 dnl Enable IP-Filter Transparent Proxy
1097 AC_ARG_ENABLE(ipf-transparent,
1098 [ --enable-ipf-transparent
1099 Enable Transparent Proxy support for systems
1100 using IP-Filter network address redirection.],
1101 [ if test "$enableval" = "yes" ; then
1102 echo "IP-Filter Transparent Proxy enabled"
1103 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.])
1104 IPF_TRANSPARENT="yes"
1108 dnl Enable PF Transparent Proxy
1109 AC_ARG_ENABLE(pf-transparent,
1110 [ --enable-pf-transparent
1111 Enable Transparent Proxy support for systems
1112 using PF network address redirection.],
1113 [ if test "$enableval" = "yes" ; then
1114 echo "PF Transparent Proxy enabled"
1115 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1116 PF_TRANSPARENT="yes"
1120 dnl Enable Linux Netfilter Transparent Proxy
1121 AC_ARG_ENABLE(linux-netfilter,
1122 [ --enable-linux-netfilter
1123 Enable Transparent Proxy support for Linux (Netfilter) systems.],
1124 [ if test "$enableval" = "yes" ; then
1125 echo "Linux (Netfilter) Transparent Proxy enabled"
1126 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1127 LINUX_NETFILTER="yes"
1131 dnl Enable Large file support
1135 AC_ARG_WITH(large-files,
1136 [ --with-large-files Enable support for large files (logs etc). Still
1138 [ if test "$withval" = yes; then
1143 dnl UNIX Build environment
1144 AC_ARG_WITH(build-environment,
1145 [ --with-build-environment=model
1146 The build environment to use. Normally one of
1147 POSIX_V6_ILP32_OFF32 32 bits
1148 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1149 POSIX_V6_LP64_OFF64 64 bits
1150 POSIX_V6_LPBIG_OFFBIG large pointers and files
1151 XBS5_ILP32_OFF32 32 bits (legacy)
1152 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1153 XBS5_LP64_OFF64 64 bits (legacy)
1154 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1155 default The default for your OS],
1156 [ case "$withval" in
1158 echo "--with-build-environment expects a build environment string as used by getconf"
1162 buildmodel="$withval"
1167 if test $needlargefiles && test -z "$buildmodel"; then
1168 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
1169 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1174 if test -z "$buildmodel"; then
1175 echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
1177 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1178 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1181 if test -n "$buildmodel" && test "$buildmodel" != "default"; then
1182 echo "Using $buildmodel build environment"
1183 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1186 echo "ERROR: Build environment $buildmodel not known to getconf."
1189 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1190 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1191 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1192 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1195 dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but:
1196 dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc
1197 dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun
1199 if test "$GCC" = "yes"; then
1200 echo "Removing -Xa for gcc on $host"
1201 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1202 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1204 echo "Removing -Usun on $host"
1205 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1206 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1209 dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1210 dnl so we must adjust something to avoid gcc errors.
1211 dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1212 dnl remove "-n32" from LDFLAGS
1213 dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1214 dnl "-64" from LDFLAGS
1216 if test "$GCC" = "yes"; then
1217 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1218 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1219 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1220 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1221 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1222 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1230 dnl Enable Linux transparent proxy support
1231 AC_ARG_ENABLE(linux-tproxy,
1232 [ --enable-linux-tproxy
1233 Enable real Transparent Proxy support for Netfilter TPROXY.],
1234 [ if test "$enableval" = "yes" ; then
1235 echo "Linux Netfilter/TPROXY enabled"
1236 AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.])
1238 if test -z "$LINUX_NETFILTER"; then
1239 echo "Linux-Netfilter Transparent Proxy automatically enabled"
1240 LINUX_NETFILTER="yes"
1245 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1246 dnl Enable Leak Finding Functions
1247 AC_ARG_ENABLE(leakfinder,
1248 [ --enable-leakfinder
1249 Enable Leak Finding code. Enabling this alone
1250 does nothing; you also have to modify the source
1251 code to use the leak finding functions. Probably
1252 Useful for hackers only.],
1253 [ if test "$enableval" = "yes" ; then
1254 echo "Leak-Finding enabled"
1255 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1256 USE_LEAKFINDER="yes"
1257 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1262 AC_ARG_ENABLE(ident-lookups,
1263 [ --disable-ident-lookups
1264 This allows you to remove code that performs
1265 Ident (RFC 931) lookups.],
1266 [ if test "$enableval" = "no" ; then
1267 echo "Disabling Ident Lookups"
1271 if test $use_ident = 1; then
1272 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1273 AM_CONDITIONAL(ENABLE_IDENT, true)
1275 AC_DEFINE(USE_IDENT, 0)
1276 AM_CONDITIONAL(ENABLE_IDENT, false)
1279 AM_CONDITIONAL(USE_DNSSERVER, false)
1281 AC_ARG_ENABLE(internal-dns,
1282 [ --disable-internal-dns This prevents Squid from directly sending and
1283 receiving DNS messages, and instead enables the
1284 old external 'dnsserver' processes.],
1285 [ if test "$enableval" = "no" ; then
1286 echo "Disabling Internal DNS queries"
1290 if test "$use_dnsserver" = "yes"; then
1291 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1292 AM_CONDITIONAL(USE_DNSSERVER, true)
1295 dnl Select Default hosts file location
1296 AC_ARG_ENABLE(default-hostsfile,
1297 [ --enable-default-hostsfile=path
1298 Select default location for hosts file.
1299 See hosts_file directive in squid.conf for details],
1301 if test "$enableval" != "none" ; then
1302 if test -f $enableval; then
1303 OPT_DEFAULT_HOSTS=$enableval
1305 echo "Warning Unable to find $enableval"
1309 OPT_DEFAULT_HOSTS="none"
1311 echo "Default hosts file set to: $enableval"
1312 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1313 AC_SUBST(OPT_DEFAULT_HOSTS)
1315 dnl Select auth schemes modules to build
1317 [ --enable-auth=\"list of auth scheme modules\"
1318 Build support for the list of authentication schemes.
1319 The default is to build support for the Basic scheme.
1320 See src/auth for a list of available modules, or
1321 Programmers Guide section authentication schemes
1322 for details on how to build your custom auth scheme
1324 [ case $enableval in
1326 for dir in $srcdir/src/auth/*; do
1327 module="`basename $dir`"
1328 if test -d "$dir" && test "$module" != CVS; then
1329 AUTH_MODULES="$AUTH_MODULES $module"
1336 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1340 [ if test -z "$AUTH_MODULES"; then
1341 AUTH_MODULES="ntlm basic digest negotiate"
1344 if test -n "$AUTH_MODULES"; then
1345 for module in $AUTH_MODULES; do
1346 if test -d $srcdir/src/auth/$module; then
1349 echo "ERROR: Auth scheme $module does not exists"
1352 eval AUTH_MODULE_${module}=yes
1354 echo "Auth scheme modules built: $AUTH_MODULES"
1355 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1356 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1358 echo "Auth scheme modules built: None"
1361 for module in $AUTH_MODULES; do
1362 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1364 AC_SUBST(AUTH_MODULES)
1366 AC_SUBST(AUTH_LINKOBJS)
1369 dnl Select basic auth scheme helpers to build
1370 if test -n "$AUTH_MODULE_basic"; then
1371 BASIC_AUTH_HELPERS="all"
1373 AC_ARG_ENABLE(basic-auth-helpers,
1374 [ --enable-basic-auth-helpers=\"list of helpers\"
1375 This option selects which basic scheme proxy_auth
1376 helpers to build and install as part of the normal
1377 build process. For a list of available
1378 helpers see the helpers/basic_auth directory.],
1379 [ case "$enableval" in
1381 BASIC_AUTH_HELPERS="all"
1384 BASIC_AUTH_HELPERS=""
1387 if test -z "$AUTH_MODULE_basic"; then
1388 echo "WARNING: Basic auth helpers selected without the basic scheme enabled"
1391 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1395 if test "$BASIC_AUTH_HELPERS" = "all" ; then
1396 BASIC_AUTH_HELPERS=""
1397 for dir in $srcdir/helpers/basic_auth/*; do
1398 helper="`basename $dir`"
1399 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1400 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1404 if test -n "$BASIC_AUTH_HELPERS"; then
1405 for helper in $BASIC_AUTH_HELPERS; do
1406 if test -d $srcdir/helpers/basic_auth/$helper; then
1413 echo "ERROR: Basic auth helper $helper does not exists"
1417 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1419 AC_SUBST(BASIC_AUTH_HELPERS)
1421 dnl Select ntlm auth helpers to build
1422 if test -n "$AUTH_MODULE_ntlm"; then
1423 NTLM_AUTH_HELPERS="all"
1425 AC_ARG_ENABLE(ntlm-auth-helpers,
1426 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1427 This option selects which proxy_auth ntlm helpers
1428 to build and install as part of the normal build
1429 process. For a list of available helpers see
1430 the helpers/ntlm_auth directory.],
1431 [ case "$enableval" in
1433 NTLM_AUTH_HELPERS="all"
1436 NTLM_AUTH_HELPERS=""
1439 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1443 if test "$NTLM_AUTH_HELPERS" = "all" ; then
1444 NTLM_AUTH_HELPERS=""
1445 for dir in $srcdir/helpers/ntlm_auth/*; do
1446 helper="`basename $dir`"
1447 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1448 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1452 if test -n "$NTLM_AUTH_HELPERS"; then
1453 for helper in $NTLM_AUTH_HELPERS; do
1454 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1457 echo "ERROR: NTLM Auth helper $helper does not exists"
1461 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1463 AC_SUBST(NTLM_AUTH_HELPERS)
1465 dnl Select negotiate auth helpers to build
1466 if test -n "$AUTH_MODULE_negotiate"; then
1467 NEGOTIATE_AUTH_HELPERS="all"
1469 AC_ARG_ENABLE(negotiate-auth-helpers,
1470 [ --enable-negotiate-auth-helpers=\"list of helpers\"
1471 This option selects which proxy_auth negotiate helpers
1472 to build and install as part of the normal build
1473 process. For a list of available helpers see
1474 the helpers/negotiate_auth directory.],
1475 [ case "$enableval" in
1477 NEGOTIATE_AUTH_HELPERS="all"
1480 NEGOTIATE_AUTH_HELPERS=""
1483 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1487 if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1488 NEGOTIATE_AUTH_HELPERS=""
1489 for dir in $srcdir/helpers/negotiate_auth/*; do
1490 helper="`basename $dir`"
1491 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1492 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1496 if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1497 for helper in $NEGOTIATE_AUTH_HELPERS; do
1498 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1501 echo "ERROR: Negotiate Auth helper $helper does not exists"
1505 echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
1507 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1509 dnl Select digest auth scheme helpers to build
1510 if test -n "$AUTH_MODULE_digest"; then
1511 DIGEST_AUTH_HELPERS=all
1513 AC_ARG_ENABLE(digest-auth-helpers,
1514 [ --enable-digest-auth-helpers=\"list of helpers\"
1515 This option selects which digest scheme authentication
1516 helpers to build and install as part of the normal build
1517 process. For a list of available helpers see the
1518 helpers/digest_auth directory.],
1519 [ case "$enableval" in
1521 DIGEST_AUTH_HELPERS="all"
1524 DIGEST_AUTH_HELPERS=""
1527 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1531 if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1532 DIGEST_AUTH_HELPERS=""
1533 for dir in $srcdir/helpers/digest_auth/*; do
1534 helper="`basename $dir`"
1535 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1536 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1540 if test -n "$DIGEST_AUTH_HELPERS"; then
1541 for helper in $DIGEST_AUTH_HELPERS; do
1542 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1545 echo "ERROR: digest auth helper $helper does not exists"
1549 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1551 AC_SUBST(DIGEST_AUTH_HELPERS)
1553 dnl Enable "NTLM fail open"
1554 AC_ARG_ENABLE(ntlm-fail-open,
1555 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1556 Authentication steps can allow squid to still authenticate
1558 [ if test "$enableval" = "yes" ; then
1559 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.])
1563 dnl Select external_acl helpers to build
1564 EXTERNAL_ACL_HELPERS=all
1565 AC_ARG_ENABLE(external-acl-helpers,
1566 [ --enable-external-acl-helpers=\"list of helpers\"
1567 This option selects which external_acl helpers to
1568 build and install as part of the normal build
1569 process. For a list of available helpers see the
1570 helpers/external_acl directory.],
1571 [ case "$enableval" in
1573 EXTERNAL_ACL_HELPERS=all
1576 EXTERNAL_ACL_HELPERS=""
1579 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1583 if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
1584 EXTERNAL_ACL_HELPERS=""
1585 for dir in $srcdir/helpers/external_acl/*; do
1586 helper="`basename $dir`"
1587 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1588 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1592 if test -n "$EXTERNAL_ACL_HELPERS"; then
1593 for helper in $EXTERNAL_ACL_HELPERS; do
1594 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1597 echo "ERROR: external acl helper $helper does not exists"
1601 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1603 AC_SUBST(EXTERNAL_ACL_HELPERS)
1605 AC_ARG_WITH(valgrind,
1606 [ --with-valgrind Include debug instrumentation for use with valgrind],
1615 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1619 if test $valgrind; then
1620 AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
1621 echo "Valgrind debug support enabled"
1625 dnl Disable "memPools" code
1626 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1627 AC_ARG_ENABLE(mempools,
1628 [ --disable-mempools Disable memPools. Note that this option now simply sets the
1629 default behaviour. Specific classes can override this at runtime, and
1630 only lib/MemPool.c needs to be altered to change the squid-wide
1631 default for all classes.],
1632 [ if test "$enableval" = "no" ; then
1633 echo "memPools disabled"
1634 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1638 dnl Enable WIN32 Service compile mode
1639 AC_ARG_ENABLE(win32-service,
1640 [ --enable-win32-service Compile Squid as a WIN32 Service
1641 Works only on Windows NT and Windows 2000 Platforms.],
1642 [ if test "$enableval" = "yes" ; then
1643 echo "Enabling WIN32 run service mode"
1644 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1649 dnl Check for Cyrus SASL
1650 if test "$require_sasl" = "yes"; then
1651 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1652 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1656 if test "$ac_cv_header_sasl_h" = "yes"; then
1660 echo "ERROR: Neither SASL nor SASL2 found"
1667 dnl Disable "unlinkd" code
1668 AC_ARG_ENABLE(unlinkd,
1669 [ --disable-unlinkd Do not use unlinkd],
1670 [ if test "$enableval" = "no" ; then
1676 # Here we should probably use some magic depending on the selected
1680 if test "$use_unlinkd" = "yes"; then
1681 echo "unlinkd enabled"
1682 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1683 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1685 echo "unlinkd disabled"
1686 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1689 dnl Enable backtraces on fatal errors
1690 AC_ARG_ENABLE(stacktraces,
1691 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1692 [ if test "$enableval" = "yes" ; then
1693 echo "Enabling automatic stack backtraces on fatal errors"
1694 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1698 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1699 dnl Enable USE_XPROF_STATS
1700 AC_ARG_ENABLE(cpu-profiling,
1701 [ --enable-cpu-profiling
1702 This option allows you to see which internal functions
1703 in Squid are consuming how much CPU. Compiles in probes
1704 that measure time spent in probed functions. Needs
1705 source modifications to add new probes. This is meant
1706 for developers to assist in performance optimisations
1707 of Squid internal functions.
1708 If you are not developer and not interested in the stats
1709 you shouldn't enable this, as overhead added, although
1710 small, is still overhead. See lib/Profiler.c for more.
1712 [ if test "$enableval" = "yes" ; then
1713 echo "Enabling cpu-profiling"
1714 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1715 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1719 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1720 AC_ARG_ENABLE(x_accelerator_vary,
1721 [ --enable-x-accelerator-vary
1722 Enable support for the X-Accelerator-Vary
1723 HTTP header. Can be used to indicate
1724 variance within an accelerator setup.
1725 Typically used together with other code
1726 that adds custom HTTP headers to the requests.],
1727 [ if test "$enableval" = "yes" ; then
1728 echo "Enabling support for X-Accelerator-Vary"
1729 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1733 AC_ARG_WITH(filedescriptors,
1734 [ --with-filedescriptors=NUMBER
1735 Force squid to support NUMBER filedescriptors],
1736 [ squid_filedescriptors_num=$withval ])
1738 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
1739 if $CPPUNITCONFIG --help >/dev/null; then
1740 echo "using system installed cppunit"
1741 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
1743 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
1745 echo "cppunit does not apear to be installed. squid does not require this, but code testing with 'make check' will fail."
1747 SQUID_CPPUNIT_LIBS=''
1748 SQUID_CPPUNIT_INC=''
1751 AC_ARG_WITH(cppunit-basedir,
1752 [ --with-cppunit-basedir=/path/to/cppunit-base
1753 Path where the cppunit headers are libraries are found
1756 [ if test -f $withval/include/cppunit/TestCase.h; then
1757 echo "Using cppunit includes from $withval"
1758 SQUID_CPPUNIT_INC="-I${withval}/include"
1760 echo "ERROR: Cannot find cppunit at $withval"
1763 if test -f $withval/lib/libcppunit.la; then
1764 echo "Using cppunit lib from $withval"
1765 SQUID_CPPUNIT_LA="-I${withval}/lib/libcppunit.la"
1766 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
1768 echo "ERROR: Cannot find cppunit at $withval"
1772 AC_SUBST(SQUID_CPPUNIT_LIBS)
1773 AC_SUBST(SQUID_CPPUNIT_LA)
1774 AC_SUBST(SQUID_CPPUNIT_INC)
1776 # Force some compilers to use ANSI features
1780 if test "$ac_cv_prog_CC" = "cc" ; then
1781 echo "adding '-std1' to cc args for $host"
1787 if test "$ac_cv_prog_CC" = "cc" ; then
1788 echo "adding '-Ae' to cc args for $host"
1795 dnl Check for programs
1799 AC_PATH_PROG(SH, sh, /bin/sh)
1800 AC_PATH_PROG(FALSE, false, /usr/bin/false)
1801 AC_PATH_PROG(TRUE, true, /usr/bin/true)
1802 AC_PATH_PROG(RM, rm, $FALSE)
1803 AC_PATH_PROG(MV, mv, $FALSE)
1804 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
1805 AC_PATH_PROG(LN, ln, cp)
1806 AC_PATH_PROG(PERL, perl, none)
1807 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
1808 AC_PATH_PROG(AR, ar, $FALSE)
1810 if test "$ac_cv_path_PERL" = "none"; then
1811 echo "Perl is required to compile Squid"
1812 echo "Please install Perl and then re-run configure"
1818 echo "Disabling 'ranlib' for HP-UX..."
1832 dnl Check for headers
1865 netinet/ip_fil_compat.h \
1920 linux/netfilter_ipv4.h \
1921 linux/netfilter_ipv4/ip_tproxy.h \
1923 SQUID_DEFAULT_INCLUDES
1929 AC_CHECK_HEADERS(net/if.h \
1931 netinet/ip_compat.h\
1936 resolv.h,,,SQUID_BSDNET_INCLUDES)
1938 AC_CHECK_HEADERS([libxml/parser.h], [], [
1939 SAVED_CPPFLAGS="$CPPFLAGS"
1940 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
1941 unset ac_cv_header_libxml_parser_h
1942 AC_CHECK_HEADERS([libxml/parser.h], [], [
1943 CPPFLAGS="$SAVED_CPPFLAGS"
1950 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1951 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1953 ac_cv_have_ansi_prototypes="yes",
1954 ac_cv_have_ansi_prototypes="no")
1956 if test $ac_cv_have_ansi_prototypes = "yes" ; then
1957 AC_DEFINE(HAVE_ANSI_PROTOTYPES,1,[Define if your compiler supports prototyping])
1961 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
1964 #include <sys/time.h>
1971 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
1972 #if HAVE_SYS_TYPES_H
1973 #include <sys/types.h>
1979 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
1980 #if HAVE_SYS_TYPES_H
1981 #include <sys/types.h>
1987 dnl Override rusage() detect on MinGW because is emulated in source code
1990 AC_DEFINE(HAVE_STRUCT_RUSAGE)
1991 ac_cv_func_getrusage='yes'
1992 echo "Using own rusage on Windows."
1995 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
1997 #include <sys/time.h>
1999 #if HAVE_SYS_RESOURCE_H
2000 #include <sys/resource.h>
2005 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2006 #if HAVE_SYS_TYPES_H
2007 #include <sys/types.h>
2009 #include <netinet/in.h>
2010 #include <netinet/in_systm.h>
2011 #include <netinet/ip.h>
2012 #if defined (__linux__) || defined (__CYGWIN__)
2021 dnl Check for typedefs
2022 AC_CHECK_SIZEOF(void *)
2024 dnl 8 bit integers - int8_t
2025 dnl if this is defined we trust it to be 8 bits
2026 AC_CHECK_TYPE(int8_t,[
2027 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2028 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2029 ],,SQUID_DEFAULT_INCLUDES)
2032 AC_CHECK_TYPE(char,[
2033 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2034 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2035 ],,SQUID_DEFAULT_INCLUDES)
2037 dnl unsigned 8 bit ints - u_int8_t
2038 dnl if this is defined we trust it to be 8 bits
2039 AC_CHECK_TYPE(u_int8_t,[
2040 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2041 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2042 ],,SQUID_DEFAULT_INCLUDES)
2045 dnl if this is defined we trust it to be 8 bits
2046 AC_CHECK_TYPE(uint8_t,[
2047 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2048 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2049 ],,SQUID_DEFAULT_INCLUDES)
2051 dnl 16 bit integers - int16_t
2052 dnl if this is defined we trust it to be 16 bits
2053 AC_CHECK_TYPE(int16_t,[
2054 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2055 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2056 ],,SQUID_DEFAULT_INCLUDES)
2059 AC_CHECK_TYPE(short,[
2060 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2061 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2062 ],,SQUID_DEFAULT_INCLUDES)
2066 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2067 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2068 ],,SQUID_DEFAULT_INCLUDES)
2070 dnl unsigned 16 bit ints - u_int16_t
2071 dnl if this is defined we trust it to be 16 bits
2072 AC_CHECK_TYPE(u_int16_t,[
2073 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2074 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2075 ],,SQUID_DEFAULT_INCLUDES)
2078 dnl if this is defined we trust it to be 16 bits
2079 AC_CHECK_TYPE(uint16_t,[
2080 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2081 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2082 ],,SQUID_DEFAULT_INCLUDES)
2084 dnl 32 bit signed int - int32_t
2085 dnl if this is defined we trust it to be 32 bits
2086 AC_CHECK_TYPE(int32_t,[
2087 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2088 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2089 ],,SQUID_DEFAULT_INCLUDES)
2092 AC_CHECK_TYPE(long,[
2093 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2094 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2095 ],,SQUID_DEFAULT_INCLUDES)
2097 dnl 32 bit unsigned int - u_int32_t
2098 dnl if this is defined we trust it to be 32 bits
2099 AC_CHECK_TYPE(u_int32_t,[
2100 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2101 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2102 ],,SQUID_DEFAULT_INCLUDES)
2105 dnl if this is defined we trust it to be 32 bits
2106 AC_CHECK_TYPE(uint32_t,[
2107 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2108 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2109 ],,SQUID_DEFAULT_INCLUDES)
2111 dnl 64 bit signed - int64_t
2112 dnl if this is defind we trust it to be 64 bits
2113 AC_CHECK_TYPE(int64_t,[
2114 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2115 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2116 ],,SQUID_DEFAULT_INCLUDES)
2119 dnl if this is defind we trust it to be 64 bits
2120 AC_CHECK_TYPE(__int64,[
2121 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2122 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2123 ],,SQUID_DEFAULT_INCLUDES)
2126 AC_CHECK_TYPE(long long,[
2127 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2128 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2129 ],,SQUID_DEFAULT_INCLUDES)
2131 dnl 64 bit unsigned - u_int64_t
2132 dnl if this is defind we trust it to be 64 bits
2133 AC_CHECK_TYPE(u_int64_t,[
2134 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2135 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2136 ],,SQUID_DEFAULT_INCLUDES)
2139 dnl if this is defind we trust it to be 64 bits
2140 AC_CHECK_TYPE(uint64_t,[
2141 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2142 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2143 ],,SQUID_DEFAULT_INCLUDES)
2145 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2146 dnl that is incompatible with the updated Solaris header files.
2147 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2148 AC_CHECK_TYPE(pad128_t,
2149 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2150 ,SQUID_DEFAULT_INCLUDES)
2152 AC_CHECK_TYPE(upad128_t,
2153 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2154 ,SQUID_DEFAULT_INCLUDES)
2156 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2157 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2158 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2159 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2160 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2161 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2162 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2163 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2165 dnl Check for special functions
2168 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2169 #include <sys/types.h>
2170 #include <sys/socket.h>
2176 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2177 #include <sys/ipc.h>
2178 #include <sys/msg.h>])
2180 dnl Check for needed libraries
2181 AC_CHECK_LIB(nsl, main)
2182 AC_CHECK_LIB(socket, main)
2185 AC_MSG_CHECKING(for winsock)
2187 for curlib in ws2_32 wsock32; do
2188 LIBS="$LIBS -l$curlib"
2190 char __attribute__((stdcall)) socket(int,int,int);
2191 char __attribute__((stdcall)) select(int,int,int,int,int);
2192 char __attribute__((stdcall)) closesocket(int);
2193 char __attribute__((stdcall)) gethostname(int,int);
2201 have_winsock=yes, have_winsock=no)
2203 if test $have_winsock = yes; then
2204 ac_cv_func_select='yes'
2205 if test $curlib = ws2_32; then
2206 have_winsock=winsock2
2212 AC_MSG_RESULT($have_winsock)
2216 dnl Ripped from the Samba sources
2217 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2219 #include <sys/types.h>
2222 #include <sys/socket.h>
2223 #include <sys/un.h>],
2225 struct sockaddr_un sunaddr;
2226 sunaddr.sun_family = AF_UNIX;
2228 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2229 if test x"$squid_cv_unixsocket" = x"yes"; then
2230 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2234 AC_CHECK_LIB(gnumalloc, main)
2235 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2236 echo "Disabling extended malloc functions when using gnumalloc"
2237 ac_cv_func_mallinfo=no
2238 ac_cv_func_mallocblksize=no
2239 ac_cv_func_mallopt=no
2243 echo "skipping libmalloc check for $host"
2246 echo "skipping libmalloc check for $host"
2250 AC_CHECK_LIB(malloc, main)
2255 AC_CHECK_LIB(bsd, main)
2256 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2257 AC_CHECK_LIB(bind, gethostbyname)
2258 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2261 echo "skipping libresolv checks for $host"
2264 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
2265 AC_CHECK_LIB(resolv, main)
2271 echo "Use MSVCRT for math functions."
2274 AC_CHECK_LIB(m, main)
2278 dnl Check for libcrypt
2279 dnl Some of our helpers use crypt(3) which may be in libc, or in
2280 dnl libcrypt (eg FreeBSD)
2281 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2284 dnl Check for libdl, used by auth_modules/PAM
2285 if test "$with_dl" = "yes"; then
2286 AC_CHECK_LIB(dl, dlopen)
2289 dnl Check for pthreads
2290 dnl We use pthreads when doing ASYNC I/O
2291 if test "$with_pthreads" = "yes"; then
2292 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2293 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
2295 i386-unknown-freebsd*)
2296 if test "$GCC" = "yes" ; then
2297 if test -z "$PRESET_LDFLAGS"; then
2298 LDFLAGS="$LDFLAGS -pthread"
2303 if test "$GCC" = "yes" ; then
2304 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2305 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
2307 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2308 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
2312 AC_CHECK_LIB(pthread, main)
2316 dnl We use AIO in the coss store
2317 if test "$with_aio" = "yes"; then
2318 dnl On some systems POSIX AIO functions are in libaio
2319 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
2322 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2323 dnl Robert Side <rside@aiinc.bc.ca>
2324 dnl Mon, 18 Jan 1999 17:48:00 GMT
2327 AC_CHECK_LIB(intl, strftime)
2331 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2332 dnl only with Windows LDAP libraries using -lwldap32
2335 LIB_LDAP="-lwldap32"
2340 dnl LDAP helpers need to know if -llber is needed or not
2341 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2350 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
2351 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2353 #if HAVE_SYS_TYPES_H
2354 #include <sys/types.h>
2364 [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)],
2365 ac_cv_dbopen_libdb="yes",
2366 ac_cv_dbopen_libdb="no")
2369 if test $ac_cv_dbopen_libdb = yes; then
2374 dnl System-specific library modifications
2378 if test "$GCC" = "yes"; then
2379 echo "Removing -O for gcc on $host"
2380 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2384 echo "Removing -lsocket for IRIX..."
2385 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2386 echo "Removing -lnsl for IRIX..."
2387 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2388 ac_cv_lib_nsl_main=no
2389 echo "Removing -lbsd for IRIX..."
2390 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2392 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2393 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2394 dnl Please change your configure script. AIX doesn't need -lbsd.
2396 echo "Removing -lbsd for AIX..."
2397 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2399 dnl From: mlaster@metavillage.com (Mike Laster)
2400 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
2401 dnl So using the internal versions generates a load of warnings
2404 echo "disabling snprintf/vsnprintf for $host"
2405 ac_cv_func_snprintf=no
2406 ac_cv_func_vsnprintf=no
2411 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2412 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2413 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2415 [*-*-solaris2.[0-4]])
2416 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2418 [*-sony-newsos[56]*])
2419 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2423 # Remove optimization for GCC 2.95.[123]
2424 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2425 if test "$GCC" = "yes"; then
2426 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2429 echo "Removing -O for gcc on $host with GCC $GCCVER"
2430 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2435 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2438 if test `uname -v` = "2.03"; then
2439 echo "disabling mallinfo for $host"
2440 ac_cv_func_mallinfo=no
2445 dnl This has to be before AC_CHECK_FUNCS
2446 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2447 # when running configure.
2448 if test -z "$ac_cv_func_poll"; then
2451 # John Kay (jkay@nlanr.net) 19970818
2452 echo "disabling poll for $host..."
2453 ac_cv_func_poll='no'
2457 echo "disabling poll for $host..."
2458 ac_cv_func_poll='no'
2461 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2462 # poll is problematic on Linux. We disable it
2463 # by default until Linux gets it right.
2464 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2465 if test $rev -lt 002002; then
2466 echo "disabling poll for $host < 2.2..."
2467 ac_cv_func_poll='no'
2470 [powerpc-ibm-aix4.1.*])
2471 # Mike Laster (mlaster@metavillage.com) 19981021
2472 echo "disabling poll for $host..."
2473 ac_cv_func_poll='no'
2476 # Robert Side <rside@aiinc.bc.ca>
2477 # Mon, 18 Jan 1999 17:48:00 GMT
2478 echo "disabling poll for $host..."
2479 ac_cv_func_poll='no'
2484 dnl Override statfs() detect on MinGW becasue is emulated in source code
2487 ac_cv_func_statfs='yes'
2491 dnl Check for library functions
2493 backtrace_symbols_fd \
2522 pthread_attr_setschedparam \
2523 pthread_attr_setscope \
2524 pthread_setschedparam \
2553 dnl ... and some we provide local replacements for
2561 # check for crypt, may require -lcrypt
2563 LIBS="$LIBS $CRYPTLIB"
2564 AC_CHECK_FUNCS(crypt)
2567 # Check for libepoll
2569 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
2570 AC_SUBST(EPOLL_LIBS)
2572 # Check for epoll_ctl, may need -lepoll
2574 LIBS="$LIBS $LIB_EPOLL"
2575 AC_CHECK_FUNCS(epoll_ctl)
2578 dnl Verify that epoll really works
2579 if test $ac_cv_func_epoll_ctl = yes; then
2580 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
2582 #include <sys/epoll.h>
2585 int main(int argc, char **argv)
2587 int fd = epoll_create(256);
2589 perror("epoll_create:");
2594 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
2595 if test ac_cv_epoll_works = no && test ac_force_epoll = yes; then
2596 echo "Error - no epoll found";
2597 echo "Try running 'sh ./scripts/get_epoll-lib.sh'";
2598 echo "then run configure again";
2603 dnl Magic which checks whether we are forcing a type of comm loop we
2604 dnl are actually going to (ab)use
2606 dnl Actually do the define magic now
2607 dnl mostly ripped from squid-commloops, thanks to adrian and benno
2609 if test -n "$SELECT_TYPE"; then
2610 : # Already decided above. Nothing to do here
2611 elif test "$ac_cv_epoll_works" = "yes" ; then
2613 #comm_kqueue a bit broken. Don't enable automatically
2614 #elif test "$ac_cv_func_kqueue" = "yes" ; then
2615 # SELECT_TYPE="kqueue"
2616 elif test "$ac_cv_func_poll" = "yes" ; then
2618 elif test "$ac_cv_func_select" = "yes" ; then
2621 SELECT_TYPE="select_win32"
2624 SELECT_TYPE="select"
2628 echo "Eep! Can't find poll, kqueue, epoll, or select!"
2629 echo "I'll try select and hope for the best."
2630 SELECT_TYPE="select"
2631 AC_DEFINE(USE_SELECT,1)
2634 echo "Using ${SELECT_TYPE} for the IO loop."
2636 AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2637 AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2638 AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2639 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2640 AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2641 AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2642 AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2644 case $SELECT_TYPE in
2646 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2649 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2652 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2655 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
2658 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2664 dnl Yay! Another Linux brokenness. Its not good enough
2665 dnl to know that setresuid() exists, because RedHat 5.0 declares
2666 dnl setresuid() but doesn't implement it.
2668 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2672 if(setresuid(-1,-1,-1)) {
2673 perror("setresuid:");
2678 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2680 if test "$ac_cv_func_setresuid" = "yes" ; then
2681 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.])
2684 AM_CONDITIONAL(NEED_OWN_SNPRINTF, false)
2685 if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then
2686 AM_CONDITIONAL(NEED_OWN_SNPRINTF, true)
2689 AM_CONDITIONAL(NEED_OWN_STRSEP, false)
2690 if test "$ac_cv_func_strsep" = "no" ; then
2691 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
2694 AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
2695 if test "$ac_cv_func_strtoll" = "no" ; then
2696 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
2700 dnl Test for va_copy
2702 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
2705 void f (int i, ...) {
2706 va_list args1, args2;
2707 va_start (args1, i);
2708 va_copy (args2, args1);
2709 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2711 va_end (args1); va_end (args2);
2717 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
2719 if test "$ac_cv_func_va_copy" = "yes" ; then
2720 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
2724 dnl Some systems support __va_copy
2726 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
2729 void f (int i, ...) {
2730 va_list args1, args2;
2731 va_start (args1, i);
2732 __va_copy (args2, args1);
2733 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2735 va_end (args1); va_end (args2);
2741 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
2743 if test "$ac_cv_func___va_copy" = "yes" ; then
2744 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
2747 dnl IP-Filter support requires ipf header files. These aren't
2748 dnl installed by default, so we need to check for them
2749 if test "$IPF_TRANSPARENT" ; then
2750 AC_MSG_CHECKING(if IP-Filter header files are installed)
2751 # hold on to your hats...
2752 if test "$ac_cv_header_ip_compat_h" = "yes" ||
2753 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
2754 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
2755 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
2756 have_ipfilter_compat_header="yes"
2758 if test "x$have_ipfilter_compat_header" = "xyes" &&
2759 test "$ac_cv_header_ip_fil_h" = "yes" &&
2760 test "$ac_cv_header_ip_nat_h" = "yes" ; then
2761 IPF_TRANSPARENT="yes"
2762 AC_DEFINE(IPF_TRANSPARENT, 1)
2763 elif test "$have_ipfilter_compat_header" = "yes" &&
2764 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
2765 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
2766 IPF_TRANSPARENT="yes"
2767 AC_DEFINE(IPF_TRANSPARENT, 1)
2769 IPF_TRANSPARENT="no"
2770 AC_DEFINE(IPF_TRANSPARENT, 0)
2772 AC_MSG_RESULT($IPF_TRANSPARENT)
2774 if test "$IPF_TRANSPARENT" = "no" ; then
2775 echo "WARNING: Cannot find necessary IP-Filter header files"
2776 echo " Transparent Proxy support WILL NOT be enabled"
2778 elif test "$IPF_TRANSPARENT" = "yes" ; then
2779 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
2780 dnl Solaris minor version (8, 9, 10, ...)
2783 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
2784 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
2785 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
2792 dnl PF support requires a header file.
2793 if test "$PF_TRANSPARENT" ; then
2794 AC_MSG_CHECKING(if PF header file is installed)
2795 # hold on to your hats...
2796 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
2797 PF_TRANSPARENT="yes"
2798 AC_DEFINE(PF_TRANSPARENT, 1)
2801 AC_DEFINE(PF_TRANSPARENT, 0)
2803 AC_MSG_RESULT($PF_TRANSPARENT)
2805 if test "$PF_TRANSPARENT" = "no" ; then
2806 echo "WARNING: Cannot find necessary PF header file"
2807 echo " Transparent Proxy support WILL NOT be enabled"
2811 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
2812 dnl Shamelessly copied from above
2813 if test "$LINUX_NETFILTER" ; then
2814 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
2815 # hold on to your hats...
2816 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
2817 LINUX_NETFILTER="yes"
2818 AC_DEFINE(LINUX_NETFILTER, 1)
2820 LINUX_NETFILTER="no"
2821 AC_DEFINE(LINUX_NETFILTER, 0)
2823 AC_MSG_RESULT($LINUX_NETFILTER)
2825 if test "$LINUX_NETFILTER" = "no" ; then
2826 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
2827 echo " Linux Transparent Proxy support WILL NOT be enabled"
2831 dnl Linux Netfilter/TPROXY support requires some specific header files
2832 dnl Shamelessly copied from shamelessly copied from above
2833 if test "$LINUX_TPROXY" ; then
2834 AC_MSG_CHECKING(if TPROXY header files are installed)
2835 # hold on to your hats...
2836 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
2838 AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.])
2841 AC_DEFINE(LINUX_TPROXY, 0, [Enable real Transparent Proxy support for Netfilter TPROXY.])
2843 AC_MSG_RESULT($LINUX_TPROXY)
2845 if test "$LINUX_TPROXY" = "no" && test "$LINUX_NETFILTER" = "yes"; then
2846 echo "WARNING: Cannot find TPROXY headers, you need to install the"
2847 echo "tproxy package from:"
2848 echo " - lynx http://www.balabit.com/downloads/tproxy/"
2852 if test -z "$USE_GNUREGEX" ; then
2854 *-sun-solaris2.[[0-4]])
2862 AC_MSG_CHECKING(if GNUregex needs to be compiled)
2863 if test -z "$USE_GNUREGEX"; then
2864 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
2867 AC_TRY_COMPILE([#include <sys/types.h>
2868 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
2873 AC_MSG_RESULT($USE_GNUREGEX)
2874 if test "$USE_GNUREGEX" = "yes"; then
2876 LIBREGEX="libregex.a"
2877 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
2882 dnl Not cached since people are likely to tune this
2883 AC_MSG_CHECKING(Default FD_SETSIZE value)
2892 #include <sys/time.h>
2894 #if HAVE_SYS_SELECT_H
2895 #include <sys/select.h>
2897 #if HAVE_SYS_TYPES_H
2898 #include <sys/types.h>
2901 FILE *fp = fopen("conftestval", "w");
2902 fprintf (fp, "%d\n", FD_SETSIZE);
2906 DEFAULT_FD_SETSIZE=`cat conftestval`,
2907 DEFAULT_FD_SETSIZE=256,
2908 DEFAULT_FD_SETSIZE=256)
2909 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
2910 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
2913 dnl Not cached since people are likely to tune this
2914 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
2915 dnl damn! FreeBSD's pthreads breaks dup2().
2916 if test -n "$squid_filedescriptors_num" ; then
2917 SQUID_MAXFD=$squid_filedescriptors_num
2918 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
2922 i386-unknown-freebsd*)
2923 if echo "$LDFLAGS" | grep -q pthread; then
2924 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
2930 #include <sys/time.h> /* needed on FreeBSD */
2931 #include <sys/param.h>
2932 #include <sys/resource.h>
2936 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
2937 /* getrlimit and sysconf returns bogous values on cygwin32.
2938 * Number of fds is virtually unlimited in cygwin (sys/param.h)
2939 * __CYGWIN32__ is deprecated.
2945 #if defined(RLIMIT_NOFILE)
2946 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
2947 perror("getrlimit: RLIMIT_NOFILE");
2949 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2950 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
2951 perror("setrlimit: RLIMIT_NOFILE");
2954 #elif defined(RLIMIT_OFILE)
2955 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
2956 perror("getrlimit: RLIMIT_OFILE");
2958 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2959 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
2960 perror("setrlimit: RLIMIT_OFILE");
2963 #endif /* RLIMIT_NOFILE */
2964 #endif /* HAVE_SETRLIMIT */
2965 /* by starting at 2^14, we will never get higher
2966 than 2^15 for SQUID_MAXFD */
2970 if (dup2(0, i) < 0) {
2978 #endif /* IF !DEF CYGWIN */
2979 fp = fopen("conftestval", "w");
2980 fprintf (fp, "%d\n", i & ~0x3F);
2984 SQUID_MAXFD=`cat conftestval`,
2987 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
2993 AC_MSG_RESULT($SQUID_MAXFD)
2995 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
2996 if test "$SQUID_MAXFD" -lt 512 ; then
2997 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
2998 echo " cache will be very busy. Please see the FAQ page"
2999 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
3000 echo " on how to increase your filedescriptor limit"
3005 if test `expr $SQUID_MAXFD % 64` != 0; then
3006 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
3007 echo " on certain platforms."
3011 dnl Not cached since people are likely to tune this
3012 AC_MSG_CHECKING(Default UDP send buffer size)
3016 #include <sys/types.h>
3017 #include <sys/socket.h>
3018 #include <netinet/in.h>
3022 int fd,val=0,len=sizeof(int);
3023 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3024 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3025 if (val<=0) exit(1);
3026 fp = fopen("conftestval", "w");
3027 fprintf (fp, "%d\n", val);
3031 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3032 SQUID_DETECT_UDP_SO_SNDBUF=16384,
3033 SQUID_DETECT_UDP_SO_SNDBUF=16384)
3034 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3035 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3037 dnl Not cached since people are likely to tune this
3038 AC_MSG_CHECKING(Default UDP receive buffer size)
3042 #include <sys/types.h>
3043 #include <sys/socket.h>
3044 #include <netinet/in.h>
3048 int fd,val=0,len=sizeof(int);
3049 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3050 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3051 if (val <= 0) exit(1);
3052 fp = fopen("conftestval", "w");
3053 fprintf (fp, "%d\n", val);
3057 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3058 SQUID_DETECT_UDP_SO_RCVBUF=16384,
3059 SQUID_DETECT_UDP_SO_RCVBUF=16384)
3060 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3061 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3063 dnl Not cached since people are likely to tune this
3064 AC_MSG_CHECKING(Default TCP send buffer size)
3068 #include <sys/types.h>
3069 #include <sys/socket.h>
3070 #include <netinet/in.h>
3074 int fd,val=0,len=sizeof(int);
3075 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3076 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3077 if (val <= 0) exit(1);
3078 fp = fopen("conftestval", "w");
3079 fprintf (fp, "%d\n", val);
3083 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
3084 SQUID_TCP_SO_SNDBUF=16384,
3085 SQUID_TCP_SO_SNDBUF=16384)
3086 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3087 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3088 echo "Limiting send buffer size to 32K"
3089 SQUID_TCP_SO_SNDBUF=32768
3091 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3093 dnl Not cached since people are likely to tune this
3094 AC_MSG_CHECKING(Default TCP receive buffer size)
3098 #include <sys/types.h>
3099 #include <sys/socket.h>
3100 #include <netinet/in.h>
3104 int fd,val=0,len=sizeof(int);
3105 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3106 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3107 if (val <= 0) exit(1);
3108 fp = fopen("conftestval", "w");
3109 fprintf (fp, "%d\n", val);
3113 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
3114 SQUID_TCP_SO_RCVBUF=16384,
3115 SQUID_TCP_SO_RCVBUF=16384)
3116 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3117 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3118 echo "Limiting receive buffer size to 64K"
3119 SQUID_TCP_SO_RCVBUF=65535
3121 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3122 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3123 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
3124 ac_cv_needs_sys_errlist="no",
3125 ac_cv_needs_sys_errlist="yes")
3127 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3128 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3131 dnl Not cached since people are likely to change this
3132 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3133 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3135 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
3138 AC_MSG_CHECKING(if inet_ntoa() actually works)
3142 #include <sys/types.h>
3143 #include <netinet/in.h>
3144 #include <arpa/inet.h>
3149 in.s_addr = inet_addr("1.2.3.4");
3150 fp = fopen("conftestval", "w");
3151 fprintf (fp, "%s\n", inet_ntoa(in));
3155 INET_NTOA_RESULT=`cat conftestval`,
3156 INET_NTOA_RESULT="broken",
3157 INET_NTOA_RESULT="broken")
3158 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3159 AC_MSG_RESULT("yes")
3164 echo "Using Win32 resolver instead."
3167 echo "Will use our own inet_ntoa()."
3168 AC_LIBOBJ(inet_ntoa)
3169 # echo "WARNING: This looks bad, and probably prevents Squid from working."
3170 # echo " If you're on IRIX and using GCC 2.8, you probably need"
3171 # echo " to use the IRIX C compiler instead."
3177 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3178 AC_MSG_CHECKING(for working statvfs() interface)
3182 #include <sys/types.h>
3183 #include <sys/statvfs.h>
3187 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3188 sfs.f_files = sfs.f_ffree = 0;
3189 statvfs("/tmp", &sfs);
3191 ac_cv_func_statvfs=yes,
3192 ac_cv_func_statvfs=no)
3193 AC_MSG_RESULT($ac_cv_func_statvfs)
3194 if test "$ac_cv_func_statvfs" = "yes" ; then
3195 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3199 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3201 #if HAVE_SYS_TYPES_H
3202 #include <sys/types.h>
3204 #if HAVE_NETINET_IN_H
3205 #include <netinet/in.h>
3207 #if HAVE_ARPA_INET_H
3208 #include <arpa/inet.h>
3210 #if HAVE_ARPA_NAMESER_H
3211 #include <arpa/nameser.h>
3217 [_res.nsaddr_list[[0]];],
3218 ac_cv_have_res_nsaddr_list="yes",
3219 ac_cv_have_res_nsaddr_list="no"))
3220 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3221 AC_DEFINE(HAVE_RES_NSADDR_LIST,1,[If _res structure has nsaddr_list member])
3224 if test $ac_cv_have_res_nsaddr_list = "no" ; then
3225 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3227 #if HAVE_SYS_TYPES_H
3228 #include <sys/types.h>
3230 #if HAVE_NETINET_IN_H
3231 #include <netinet/in.h>
3233 #if HAVE_ARPA_INET_H
3234 #include <arpa/inet.h>
3236 #if HAVE_ARPA_NAMESER_H
3237 #include <arpa/nameser.h>
3243 [_res.ns_list[[0]].addr;],
3244 ac_cv_have_res_ns_list="yes",
3245 ac_cv_have_res_ns_list="no"))
3246 if test $ac_cv_have_res_ns_list = "yes" ; then
3247 AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
3251 dnl Need the debugging version of malloc if available
3253 if test "$ac_cv_lib_malloc_main" = "yes" ; then
3254 if test -r /usr/lib/debug/malloc.o ; then
3255 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3257 if test -r /usr/lib/debug/mallocmap.o ; then
3258 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3264 if test -z "$XTRA_LIBS"; then
3267 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3272 dnl Clean up after OSF/1 core dump bug
3289 test-suite/Makefile \
3292 helpers/basic_auth/Makefile \
3293 helpers/basic_auth/LDAP/Makefile \
3294 helpers/basic_auth/MSNT/Makefile \
3295 helpers/basic_auth/NCSA/Makefile \
3296 helpers/basic_auth/PAM/Makefile \
3297 helpers/basic_auth/SMB/Makefile \
3298 helpers/basic_auth/mswin_sspi/Makefile \
3299 helpers/basic_auth/YP/Makefile \
3300 helpers/basic_auth/getpwnam/Makefile \
3301 helpers/basic_auth/multi-domain-NTLM/Makefile \
3302 helpers/basic_auth/SASL/Makefile \
3303 helpers/basic_auth/POP3/Makefile \
3304 helpers/basic_auth/DB/Makefile \
3305 helpers/basic_auth/squid_radius_auth/Makefile \
3306 helpers/digest_auth/Makefile \
3307 helpers/digest_auth/password/Makefile \
3308 helpers/digest_auth/ldap/Makefile \
3309 helpers/digest_auth/eDirectory/Makefile \
3310 helpers/ntlm_auth/Makefile \
3311 helpers/ntlm_auth/fakeauth/Makefile \
3312 helpers/ntlm_auth/no_check/Makefile \
3313 helpers/ntlm_auth/SMB/Makefile \
3314 helpers/ntlm_auth/SMB/smbval/Makefile \
3315 helpers/ntlm_auth/mswin_sspi/Makefile \
3316 helpers/negotiate_auth/Makefile \
3317 helpers/negotiate_auth/mswin_sspi/Makefile \
3318 helpers/negotiate_auth/squid_kerb_auth/Makefile \
3319 helpers/external_acl/Makefile \
3320 helpers/external_acl/ip_user/Makefile \
3321 helpers/external_acl/ldap_group/Makefile \
3322 helpers/external_acl/session/Makefile \
3323 helpers/external_acl/unix_group/Makefile \
3324 helpers/external_acl/wbinfo_group/Makefile \
3325 helpers/external_acl/mswin_lm_group/Makefile \
3329 AC_CONFIG_SUBDIRS(lib/libTrie)