2 dnl Configuration input file for Squid
4 dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
6 dnl $Id: configure.in,v 1.373 2005/04/23 20:40:50 serassio Exp $
12 AC_CONFIG_SRCDIR([src/main.cc])
13 AC_CONFIG_AUX_DIR(cfgaux)
14 AM_INIT_AUTOMAKE(squid, 3.0-PRE3-CVS)
15 AM_CONFIG_HEADER(include/autoconf.h)
16 AC_REVISION($Revision: 1.373 $)dnl
17 AC_PREFIX_DEFAULT(/usr/local/squid)
20 dnl Set default LDFLAGS
21 if test -z "$LDFLAGS"; then
25 PRESET_CFLAGS="$CFLAGS"
39 LIBREGEX='' # libregex.a
41 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
45 if test -z "$EXEEXT"; then
48 # automake automatically adds .exe when installing binaries
53 dnl this should be expanded to a list of platform sensible support requirements.
54 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
57 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
60 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
64 if test -z "$CACHE_HTTP_PORT"; then
65 CACHE_HTTP_PORT="3128"
67 if test -z "$CACHE_ICP_PORT"; then
72 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
73 [What default TCP port to use for HTTP listening?])
74 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
75 [What default UDP port to use for ICP listening?])
77 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
79 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
84 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
87 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
91 dnl Set Default CFLAGS
92 if test -z "$PRESET_CFLAGS"; then
93 if test "$GCC" = "yes"; then
96 # sunos has too many warnings for this to be useful
100 # Motorola cc/ld does not like -02 but is ok on -O
101 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
104 CFLAGS="$CFLAGS -Wall"
110 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
111 CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \
112 -woff 1009,1014,1110,1116,1185,1188,1204,1230,1233 \
113 -Wl,-woff,85,-woff,84,-woff,134 \
114 -nostdinc -I/usr/include -D_BSD_SIGNALS"
117 # Mogul says DEC compilers take both -g and -O2
118 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
127 dnl set squid required flags
128 if test "$GCC" = "yes"; then
129 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
130 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
135 AC_SUBST(SQUID_CFLAGS)
136 AC_SUBST(SQUID_CXXFLAGS)
138 AC_TEST_CHECKFORHUGEOBJECTS
139 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
142 if test -z "$PRESET_LDFLAGS"; then
143 if test "$GCC" = "yes"; then
152 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
153 LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32"
159 dnl Enable optional modules
160 AC_ARG_ENABLE(dlmalloc,
161 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
166 LIBDLMALLOC="libdlmalloc.a"
167 LIB_MALLOC="-L../lib -ldlmalloc"
168 echo "dlmalloc enabled"
172 echo "dlmalloc disabled"
174 *) use_dlmalloc="yes"
175 LIB_MALLOC="$enableval"
176 echo "dlmalloc enabled with $LIB_MALLOC"
179 if test "${use_dlmalloc-unset}" = unset; then
182 echo "Enabling dlmalloc for $host"
184 LIBDLMALLOC="libdlmalloc.a"
185 LIB_MALLOC="-L../lib -ldlmalloc"
188 echo "Enabling dlmalloc for $host"
190 LIBDLMALLOC="libdlmalloc.a"
191 LIB_MALLOC="-L../lib -ldlmalloc"
195 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
196 # Ok. dlmalloc was enabled before, but state may be changed.
197 # we have to test these again
198 unset ac_cv_func_mallinfo
199 unset ac_cv_func_mallocblksize
200 unset ac_cv_func_free
201 unset ac_cv_func_realloc
202 unset ac_cv_func_memalign
203 unset ac_cv_func_valloc
204 unset ac_cv_func_pvalloc
205 unset ac_cv_func_calloc
206 unset ac_cv_func_cfree
207 unset ac_cv_func_malloc_trim
208 unset ac_cv_func_malloc_usable_size
209 unset ac_cv_func_malloc_stats
210 unset ac_cv_func_mallinfo
211 unset ac_cv_func_mallopt
212 unset ac_cv_lib_gnumalloc
213 unset ac_cv_header_gnumalloc_h
214 unset ac_cv_lib_malloc
215 unset ac_cv_enabled_dlmalloc
217 if test "$use_dlmalloc" = yes; then
218 ac_cv_func_mallinfo="yes"
219 ac_cv_func_mallocblksize="no"
220 ac_cv_func_free="yes"
221 ac_cv_func_realloc="yes"
222 ac_cv_func_memalign="yes"
223 ac_cv_func_valloc="yes"
224 ac_cv_func_pvalloc="yes"
225 ac_cv_func_calloc="yes"
226 ac_cv_func_cfree="yes"
227 ac_cv_func_malloc_trim="yes"
228 ac_cv_func_malloc_usable_size="yes"
229 ac_cv_func_malloc_stats="yes"
230 ac_cv_func_mallopt="yes"
231 ac_cv_lib_gnumalloc="no"
232 ac_cv_header_gnumalloc_h="no"
233 ac_cv_lib_malloc="no"
234 ac_cv_enabled_dlmalloc="yes"
235 AC_DEFINE(USE_DLMALLOC, 1, [Compile & use the malloc package by Doug Lea])
238 AC_SUBST(LIBDLMALLOC)
241 AC_ARG_ENABLE(gnuregex,
242 [ --enable-gnuregex Compile GNUregex],
243 [USE_GNUREGEX=$enableval])
247 AC_ARG_ENABLE(optimizations,
248 [ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
249 Optimization is good for production builds, but not
250 good for debugging. During development, use
251 --disable-optimizations to reduce compilation times
252 and allow easier debugging. This option implicitly
253 also enabled --disable-inline],
254 [ if test "$enableval" = "no" ; then
255 echo "Disabling compiler optimizations (-O flag)"
256 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
257 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
262 AC_ARG_ENABLE(inline,
263 [ --disable-inline Don't compile trivial methods as inline. Squid
264 is coded with much of the code able to be inlined.
265 Inlining is good for production builds, but not
266 good for development. During development, use
267 --disable-inline to reduce compilation times and
268 allow incremental builds to be quick. For
269 production builds, or load tests, use
270 --enable-inline to have squid make all trivial
271 methods inlinable by the compiler.],
272 [ if test "$enableval" = "no" ; then
277 if test "$SquidInline" = "yes" ; then
278 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
279 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
281 echo "Inlining optimization disabled"
282 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
285 AC_ARG_ENABLE(debug-cbdata,
286 [ --enable-debug-cbdata Provide some debug information in cbdata],
287 [ if test "$enableval" = "yes" ; then
288 echo "cbdata debugging enabled"
289 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
293 dnl This is a developer only option.. developers know how to set defines
295 dnl AC_ARG_ENABLE(xmalloc-debug,
296 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
297 dnl [ if test "$enableval" = "yes" ; then
298 dnl echo "Malloc debugging enabled"
299 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
303 dnl This is a developer only option.. developers know how to set defines
305 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
306 dnl [ --enable-xmalloc-debug-trace
307 dnl Detailed trace of memory allocations],
308 dnl [ if test "$enableval" = "yes" ; then
309 dnl echo "Malloc debug trace enabled"
310 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
311 dnl AC_DEFINE(XMALLOC_DEBUG,1)
315 AC_ARG_ENABLE(xmalloc-statistics,
316 [ --enable-xmalloc-statistics
317 Show malloc statistics in status page],
318 [ if test "$enableval" = "yes" ; then
319 echo "Malloc statistics enabled"
320 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
326 [ --disable-carp Disable CARP support],
327 [ if test "$enableval" = "no" ; then
332 if test $use_carp = 1; then
333 AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol])
335 AC_DEFINE(USE_CARP, 1)
338 AC_ARG_ENABLE(async-io,
339 [ --enable-async-io[=N_THREADS]
341 --with-aufs-threads=N_THREADS
343 --enable-storeio=ufs,aufs],
347 STORE_MODULES="ufs aufs"
352 aufs_io_threads=$enableval
354 STORE_MODULES="ufs aufs"
359 AC_ARG_WITH(aufs-threads,
360 [ --with-aufs-threads=N_THREADS
361 Tune the number of worker threads for the aufs object
365 aufs_io_threads=$withval
368 echo "ERROR: Invalid --with-aufs-threads argument"
373 if test "$aufs_io_threads"; then
374 echo "With $aufs_io_threads aufs threads"
375 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
376 [Defines how many threads aufs uses for I/O])
379 AC_ARG_WITH(pthreads,
380 [ --with-pthreads Use POSIX Threads])
381 if test "$with_pthreads" = "yes"; then
386 [ --with-aio Use POSIX AIO])
387 if test "$with_aio" = "yes"; then
392 [ --with-dl Use dynamic linking])
393 if test "$with_dl" = "yes"; then
397 AC_ARG_ENABLE(storeio,
398 [ --enable-storeio=\"list of modules\"
399 Build support for the list of store I/O modules.
400 The default is only to build the "ufs" module.
401 See src/fs for a list of available modules, or
402 Programmers Guide section <not yet written>
403 for details on how to build your custom store module],
406 for dir in $srcdir/src/fs/*; do
407 module="`basename $dir`"
408 if test -d "$dir" && test "$module" != CVS; then
409 STORE_MODULES="$STORE_MODULES $module"
416 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
420 [ if test -z "$STORE_MODULES"; then
424 if test -n "$STORE_MODULES"; then
425 for module in $STORE_MODULES; do
426 if test -d $srcdir/src/fs/$module; then
429 echo "ERROR: storeio $module does not exists"
433 echo "Store modules built: $STORE_MODULES"
435 for module in $STORE_MODULES; do
436 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
439 dnl remove all but diskd - its the only module that needs to recurse
440 dnl into the sub directory
447 for fs in $STORE_MODULES none; do
452 NEED_DISKDAEMON="true"
457 NEED_DISKTHREADS="true"
468 dnl We have 'fake' modules - aufs and diskd - legacy.
469 for fs in $STORE_MODULES; do
474 STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
475 STORE_LIBS="$STORE_LIBS lib${fs}.a"
480 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
481 echo "adding UFS, as it contains core logic for diskd and aufs"
482 STORE_OBJS="$STORE_OBJS fs/libufs.a"
483 STORE_LIBS="$STORE_LIBS libufs.a"
484 STORE_MODULES="$STORE_MODULES ufs"
485 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
490 AC_SUBST(STORE_LINKOBJS)
492 AC_ARG_ENABLE(disk-io,
493 [ --enable-disk-io=\"list of modules\"
494 Build support for the list of disk I/O modules.
495 The default is only to build the "Blocking" module.
496 See src/DiskIO for a list of available modules, or
497 Programmers Guide section <not yet written>
498 for details on how to build your custom disk module],
501 for dir in $srcdir/src/DiskIO/*; do
502 module="`basename $dir`"
503 if test -d "$dir" && test "$module" != CVS; then
504 DISK_MODULES="$DISK_MODULES $module"
511 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
515 [ if test -z "$DISK_MODULES"; then
516 DISK_MODULES="Blocking"
519 if test -n "$DISK_MODULES"; then
520 for module in $DISK_MODULES; do
521 if test -d $srcdir/src/DiskIO/$module; then
524 echo "ERROR: disk-io $module does not exists"
528 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
530 for module in $DISK_MODULES; do
531 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
534 for fs in $DISK_MODULES none; do
537 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
538 FOUND_DISKDAEMON="true"
541 FOUND_DISKTHREADS="true"
547 FOUND_BLOCKING="true"
551 if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
552 echo "adding Blocking, as it is used by an active, legacy Store Module"
553 DISK_LIBS="$DISK_LIBS libBlocking.a"
554 DISK_MODULES="$DISK_MODULES Blocking"
555 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
558 if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
559 echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
560 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
561 DISK_MODULES="$DISK_MODULES DiskDaemon"
562 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
563 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
566 if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
567 echo "adding DiskThreads, as it is used by an active, legacy Store Module"
568 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
569 DISK_MODULES="$DISK_MODULES DiskThreads"
570 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"
579 dnl we know what is being built. now add dependencies.
580 for fs in $DISK_MODULES none; do
583 if test -z "$with_pthreads"; then
584 echo "DiskThreads IO Module used, pthreads support automatically enabled"
589 if test -z "$with_aio"; then
590 echo "Aio IO Module used, aio support automatically enabled"
598 AC_SUBST(DISK_PROGRAMS)
599 AC_SUBST(DISK_LINKOBJS)
601 AC_ARG_ENABLE(removal-policies,
602 [ --enable-removal-policies=\"list of policies\"
603 Build support for the list of removal policies.
604 The default is only to build the "lru" module.
605 See src/repl for a list of available modules, or
606 Programmers Guide section 9.9 for details on how
607 to build your custom policy],
610 for dir in $srcdir/src/repl/*; do
611 module="`basename $dir`"
612 if test -d "$dir" && test "$module" != CVS; then
613 REPL_POLICIES="$REPL_POLICIES $module"
620 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
624 [ if test -z "$REPL_POLICIES"; then
628 if test -n "$REPL_POLICIES"; then
629 for module in $REPL_POLICIES; do
630 if test -d $srcdir/src/repl/$module; then
633 echo "ERROR: Removal policy $module does not exists"
637 echo "Removal policies built: $REPL_POLICIES"
638 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
639 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
641 AC_SUBST(REPL_POLICIES)
645 AM_CONDITIONAL(ENABLE_PINGER, false)
647 [ --enable-icmp Enable ICMP pinging],
648 [ if test "$enableval" = "yes" ; then
650 AC_DEFINE(USE_ICMP,1,
651 [If you want to use Squid's ICMP features (highly recommended!) then
652 define this. When USE_ICMP is defined, Squid will send ICMP pings
653 to origin server sites. This information is used in numerous ways:
654 - Sent in ICP replies so neighbor caches know how close
655 you are to the source.
656 - For finding the closest instance of a URN.
657 - With the 'test_reachability' option. Squid will return
658 ICP_OP_MISS_NOFETCH for sites which it cannot ping.])
659 AM_CONDITIONAL(ENABLE_PINGER, true)
663 AM_CONDITIONAL(USE_DELAY_POOLS, false)
664 AC_ARG_ENABLE(delay-pools,
665 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
666 [ if test "$enableval" = "yes" ; then
667 echo "Delay pools enabled"
668 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
669 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
673 AM_CONDITIONAL(USE_ESI, false)
675 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.]),
676 ac_cv_use_esi=$enableval, ac_cv_use_esi=no)
677 AC_CACHE_CHECK(whether to enable ESI,ac_cv_use_esi, ac_cv_use_esi=no)
678 if test "$ac_cv_use_esi" = "yes" ; then
679 AC_DEFINE(ESI,1,[Compile the ESI processor and Surrogate header support])
680 AM_CONDITIONAL(USE_ESI, true)
681 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
683 AC_DEFINE(ESI,0,[Compile the ESI processor and Surrogate header support])
686 dnl This is a developer only option. Developers know how to set defines
688 dnl AC_ARG_ENABLE(mem-gen-trace,
689 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
690 dnl [ if test "$enableval" = "yes" ; then
691 dnl echo "Memory trace (to file) enabled"
692 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
696 AC_ARG_ENABLE(useragent-log,
697 [ --enable-useragent-log Enable logging of User-Agent header],
698 [ if test "$enableval" = "yes" ; then
699 echo "User-Agent logging enabled"
700 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
701 By default, they are written to useragent.log in the Squid log
706 AC_ARG_ENABLE(referer-log,
707 [ --enable-referer-log Enable logging of Referer header],
708 [ if test "$enableval" = "yes" ; then
709 echo "Referer logging enabled"
710 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
711 By default, they are written to referer.log in the Squid log
718 [ --disable-wccp Disable Web Cache Coordination Protocol],
719 [ if test "$enableval" = "no" ; then
720 echo "Web Cache Coordination Protocol disabled"
724 if test $use_wccp = 1; then
725 AC_DEFINE(USE_WCCP, 1,[Define to enable WCCP])
727 AC_DEFINE(USE_WCCP, 0)
730 AC_ARG_ENABLE(kill-parent-hack,
731 [ --enable-kill-parent-hack
732 Kill parent on shutdown],
733 [ if test "$enableval" = "yes" ; then
734 echo "Kill parent on shutdown"
735 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
736 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
741 AM_CONDITIONAL(USE_SNMP, false)
743 [ --enable-snmp Enable SNMP monitoring],
744 [ if test "$enableval" = "yes" ; then
745 echo "SNMP monitoring enabled"
746 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
747 SNMPLIB='-L../snmplib -lsnmp'
748 AM_CONDITIONAL(USE_SNMP, true)
749 SNMP_MAKEFILE=./snmplib/Makefile
754 AC_SUBST(makesnmplib)
756 AC_ARG_ENABLE(cachemgr-hostname,
757 [ --enable-cachemgr-hostname[=hostname]
758 Make cachemgr.cgi default to this host],
761 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
762 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
763 echo "Cachemgr default hostname == host where cachemgr runs"
769 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
770 echo "Cachemgr default hostname set to ${enableval}"
775 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
776 AC_ARG_ENABLE(arp-acl,
777 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
778 [ if test "$enableval" = "yes" ; then
779 echo "ARP ACL lists enabled (ether address)"
788 LIBS="$LIBS -liphlpapi"
791 LIBS="$LIBS -liphlpapi"
794 echo "WARNING: ARP ACL support probably won't work on $host."
798 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, ?).])
799 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
803 AM_CONDITIONAL(ENABLE_HTCP, false)
805 [ --enable-htcp Enable HTCP protocol],
806 [ if test "$enableval" = "yes" ; then
808 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
809 AM_CONDITIONAL(ENABLE_HTCP, true)
813 AM_CONDITIONAL(ENABLE_SSL, false)
816 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
817 [ if test "$enableval" != "no"; then
818 echo "SSL gatewaying using OpenSSL enabled"
819 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
820 AM_CONDITIONAL(ENABLE_SSL, true)
821 SSLLIB='-lssl -lcrypto'
826 AM_CONDITIONAL(NEED_OWN_MD5, true)
829 [ --with-openssl[=prefix]
830 Compile with the OpenSSL libraries. The path to
831 the OpenSSL development libraries and headers
832 installation can be specified if outside of the
833 system standard directories],
835 case "$with_openssl" in
843 SSLLIBDIR="$with_openssl/lib"
844 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
849 if test -n "$USE_OPENSSL"; then
850 echo "Using OpenSSL MD5 implementation"
851 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)])
852 AM_CONDITIONAL(NEED_OWN_MD5, false)
853 if test -z "$SSLLIB"; then
854 SSLLIB="-lcrypto" # for MD5 routines
856 dnl This is a workaround for RedHat 9 brain damage..
857 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
858 echo "OpenSSL depends on Kerberos"
859 SSLLIBDIR="/usr/kerberos/lib"
860 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
863 if test -n "$SSLLIBDIR"; then
864 SSLLIB="-L$SSLLIBDIR $SSLLIB"
868 AC_ARG_ENABLE(forw-via-db,
869 [ --enable-forw-via-db Enable Forw/Via database],
870 [ if test "$enableval" = "yes" ; then
871 echo "FORW-VIA enabled"
872 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
876 AC_ARG_ENABLE(cache-digests,
877 [ --enable-cache-digests Use Cache Digests
878 see http://www.squid-cache.org/FAQ/FAQ-16.html],
879 [ if test "$enableval" = "yes" ; then
880 echo "USE_CACHE_DIGESTS enabled"
881 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
885 dnl Select Default Error language
886 AC_ARG_ENABLE(default-err-language,
887 [ --enable-default-err-language=lang
888 Select default language for Error pages (see
891 if test -d $srcdir/errors/$enableval; then
892 ERR_DEFAULT_LANGUAGE=$enableval
894 echo "ERROR! Unknown language $enableval, see errors/ directory"
897 ],[ERR_DEFAULT_LANGUAGE="English"])
898 AC_SUBST(ERR_DEFAULT_LANGUAGE)
900 dnl Select languages to be installed
901 AC_ARG_ENABLE(err-languages,
902 [ --enable-err-languages=\"lang1 lang2..\"
903 Select languages to be installed. (All will be
904 installed by default) ],
906 for l in $enableval; do
907 if test -d $srcdir/errors/$l; then :; else
908 echo "ERROR! Unknown language $$l, see errors/"
912 ERR_LANGUAGES=$enableval
915 for l in $srcdir/errors/*; do
916 if test -f $l/ERR_ACCESS_DENIED; then
917 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
921 AC_SUBST(ERR_LANGUAGES)
923 dnl Size of COSS memory buffer
924 AC_ARG_WITH(coss-membuf-size,
925 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
926 [ if test "$with_coss_membuf_size"; then
927 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
928 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
932 dnl check for netio plugin stuff
935 [ --enable-poll Enable poll() support.
936 --disable-poll Disable poll() support. ],
941 echo "Forcing poll() to be enabled"
942 ac_cv_func_poll='yes'
945 echo "Forcing poll() to be disabled"
952 AC_ARG_ENABLE(select,
953 [ --enable-select Enable select() support.
954 --disable-select Disable select() support. ],
959 echo "Forcing select() to be enabled"
960 ac_cv_func_select='yes'
963 echo "Forcing select() to be disabled"
964 ac_cv_func_select='no'
970 AC_ARG_ENABLE(kqueue,
971 [ --enable-kqueue Enable kqueue() support.
972 --disable-kqueue Disable kqueue() support. ],
977 echo "Forcing kqueue() to be enabled"
978 ac_cv_func_kqueue='yes'
981 echo "Forcing kqueue() to be disabled"
982 ac_cv_func_kqueue='no'
989 [ --enable-epoll Enable epoll() support.
990 --disable-epoll Disable epoll() support. ],
995 echo "Forcing epoll() to be enabled"
996 ac_cv_func_epoll='yes'
999 echo "Forcing epoll() to be disabled"
1000 ac_cv_func_epoll='no'
1006 dnl Disable HTTP violations
1008 AC_ARG_ENABLE(http-violations,
1009 [ --disable-http-violations
1010 This allows you to remove code which is known to
1011 violate the HTTP protocol specification.],
1012 [ if test "$enableval" = "no" ; then
1013 echo "Disabling HTTP Violations"
1017 if test $http_violations = 1; then
1018 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.])
1020 AC_DEFINE(HTTP_VIOLATIONS, 0)
1023 dnl Enable IP-Filter Transparent Proxy
1024 AC_ARG_ENABLE(ipf-transparent,
1025 [ --enable-ipf-transparent
1026 Enable Transparent Proxy support for systems
1027 using IP-Filter network address redirection.],
1028 [ if test "$enableval" = "yes" ; then
1029 echo "IP-Filter Transparent Proxy enabled"
1030 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.])
1031 IPF_TRANSPARENT="yes"
1035 dnl Enable PF Transparent Proxy
1036 AC_ARG_ENABLE(pf-transparent,
1037 [ --enable-pf-transparent
1038 Enable Transparent Proxy support for systems
1039 using PF network address redirection.],
1040 [ if test "$enableval" = "yes" ; then
1041 echo "PF Transparent Proxy enabled"
1042 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1043 PF_TRANSPARENT="yes"
1047 dnl Enable Linux Netfilter Transparent Proxy
1048 AC_ARG_ENABLE(linux-netfilter,
1049 [ --enable-linux-netfilter
1050 Enable Transparent Proxy support for Linux (Netfilter) systems.],
1051 [ if test "$enableval" = "yes" ; then
1052 echo "Linux (Netfilter) Transparent Proxy enabled"
1053 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1054 LINUX_NETFILTER="yes"
1058 dnl Enable Large file support
1059 AC_ARG_ENABLE(large-files,
1060 [ --enable-large-files Enable support for large files (>2GB). Still
1062 [ if test "$enableval" = "yes" ; then
1063 echo "Large file support enabled"
1064 SQUID_CFLAGS="$SQUID_CFLAGS -D_FILE_OFFSET_BITS=64"
1065 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_FILE_OFFSET_BITS=64"
1069 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1070 dnl Enable Leak Finding Functions
1071 AC_ARG_ENABLE(leakfinder,
1072 [ --enable-leakfinder
1073 Enable Leak Finding code. Enabling this alone
1074 does nothing; you also have to modify the source
1075 code to use the leak finding functions. Probably
1076 Useful for hackers only.],
1077 [ if test "$enableval" = "yes" ; then
1078 echo "Leak-Finding enabled"
1079 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1080 USE_LEAKFINDER="yes"
1081 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1086 AC_ARG_ENABLE(ident-lookups,
1087 [ --disable-ident-lookups
1088 This allows you to remove code that performs
1089 Ident (RFC 931) lookups.],
1090 [ if test "$enableval" = "no" ; then
1091 echo "Disabling Ident Lookups"
1095 if test $use_ident = 1; then
1096 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1097 AM_CONDITIONAL(ENABLE_IDENT, true)
1099 AC_DEFINE(USE_IDENT, 0)
1100 AM_CONDITIONAL(ENABLE_IDENT, false)
1103 AM_CONDITIONAL(USE_DNSSERVER, false)
1105 AC_ARG_ENABLE(internal-dns,
1106 [ --disable-internal-dns This prevents Squid from directly sending and
1107 receiving DNS messages, and instead enables the
1108 old external 'dnsserver' processes.],
1109 [ if test "$enableval" = "no" ; then
1110 echo "Disabling Internal DNS queries"
1114 if test "$use_dnsserver" = "yes"; then
1115 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1116 AM_CONDITIONAL(USE_DNSSERVER, true)
1119 AC_ARG_ENABLE(truncate,
1120 [ --enable-truncate This uses truncate() instead of unlink() when
1121 removing cache files. Truncate gives a little
1122 performance improvement, but may cause problems
1123 when used with async I/O. Truncate uses more
1124 filesystem inodes than unlink..],
1125 [ if test "$enableval" = "yes" ; then
1126 echo "Enabling truncate instead of unlink"
1127 AC_DEFINE(USE_TRUNCATE,1,[Do we want to use truncate(2) or unlink(2)?])
1131 dnl Disable hostname checks
1132 AC_ARG_ENABLE(hostname-checks,
1133 [ --enable-hostname-checks
1134 Tells Squid to rejects any host names with
1135 odd characters in their name to conform with
1136 internet standards. This was the default in
1137 prior Squid versions, but since Squid-3 Squid
1138 no longer tries to police the use of DNS],
1139 [ if test "$enableval" = "yes"; then
1140 echo "Enabling hostname sanity checks"
1141 AC_DEFINE(CHECK_HOSTNAMES, 1, [Enable hostname sanity checks])
1145 dnl Enable underscore in hostnames
1146 AC_ARG_ENABLE(underscores,
1147 [ --enable-underscores Squid by default rejects any host names with _
1148 in their name to conform with internet standards.
1149 If you disagree with this you may allow _ in
1150 hostnames by using this switch, provided that
1151 the resolver library on the host where Squid runs
1152 does not reject _ in hostnames...],
1153 [ if test "$enableval" = "yes" ; then
1154 echo "Enabling the use of underscores in host names"
1155 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1,[Allow underscores in host names])
1159 dnl Select Default hosts file location
1160 AC_ARG_ENABLE(default-hostsfile,
1161 [ --enable-default-hostsfile=path
1162 Select default location for hosts file.
1163 See hosts_file directive in squid.conf for details],
1165 if test "$enableval" != "none" ; then
1166 if test -f $enableval; then
1167 OPT_DEFAULT_HOSTS=$enableval
1169 echo "Warning Unable to find $enableval"
1173 OPT_DEFAULT_HOSTS="none"
1175 echo "Default hosts file set to: $enableval"
1176 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1177 AC_SUBST(OPT_DEFAULT_HOSTS)
1179 dnl Select auth schemes modules to build
1181 [ --enable-auth=\"list of auth scheme modules\"
1182 Build support for the list of authentication schemes.
1183 The default is to build support for the Basic scheme.
1184 See src/auth for a list of available modules, or
1185 Programmers Guide section authentication schemes
1186 for details on how to build your custom auth scheme
1188 [ case $enableval in
1190 for dir in $srcdir/src/auth/*; do
1191 module="`basename $dir`"
1192 if test -d "$dir" && test "$module" != CVS; then
1193 AUTH_MODULES="$AUTH_MODULES $module"
1200 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1204 [ if test -z "$AUTH_MODULES"; then
1205 AUTH_MODULES="basic digest ntlm"
1208 if test -n "$AUTH_MODULES"; then
1209 for module in $AUTH_MODULES; do
1210 if test -d $srcdir/src/auth/$module; then
1213 echo "ERROR: Auth scheme $module does not exists"
1217 echo "Auth scheme modules built: $AUTH_MODULES"
1218 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1219 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1222 for module in $AUTH_MODULES; do
1223 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1225 AC_SUBST(AUTH_MODULES)
1227 AC_SUBST(AUTH_LINKOBJS)
1230 dnl Select basic auth scheme helpers to build
1231 BASIC_AUTH_HELPERS=""
1232 AC_ARG_ENABLE(basic-auth-helpers,
1233 [ --enable-basic-auth-helpers=\"list of helpers\"
1234 This option selects which basic scheme proxy_auth
1235 helpers to build and install as part of the normal
1236 build process. For a list of available
1237 helpers see the helpers/basic_auth directory.],
1238 [ case "$enableval" in
1240 for dir in $srcdir/helpers/basic_auth/*; do
1241 helper="`basename $dir`"
1242 if test -d "$dir" && test "$helper" != CVS; then
1243 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1250 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1254 if test -n "$BASIC_AUTH_HELPERS"; then
1255 for helper in $BASIC_AUTH_HELPERS; do
1256 if test -d $srcdir/helpers/basic_auth/$helper; then
1263 echo "ERROR: Basic auth helper $helper does not exists"
1267 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1269 AC_SUBST(BASIC_AUTH_HELPERS)
1271 dnl Select ntlm auth helpers to build
1273 AC_ARG_ENABLE(ntlm-auth-helpers,
1274 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1275 This option selects which proxy_auth ntlm helpers
1276 to build and install as part of the normal build
1277 process. For a list of available helpers see
1278 the helpers/ntlm_auth directory.],
1279 [ case "$enableval" in
1281 for dir in $srcdir/helpers/ntlm_auth/*; do
1282 helper="`basename $dir`"
1283 if test -d "$dir" && test "$helper" != CVS; then
1284 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1291 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1295 if test -n "$NTLM_AUTH_HELPERS"; then
1296 for helper in $NTLM_AUTH_HELPERS; do
1297 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1300 echo "ERROR: NTLM Auth helper $helper does not exists"
1304 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1306 AC_SUBST(NTLM_AUTH_HELPERS)
1308 dnl Select digest auth scheme helpers to build
1309 DIGEST_AUTH_HELPERS=
1310 AC_ARG_ENABLE(digest-auth-helpers,
1311 [ --enable-digest-auth-helpers=\"list of helpers\"
1312 This option selects which digest scheme authentication
1313 helpers to build and install as part of the normal build
1314 process. For a list of available helpers see the
1315 helpers/digest_auth directory.],
1316 [ case "$enableval" in
1318 for dir in $srcdir/helpers/digest_auth/*; do
1319 helper="`basename $dir`"
1320 if test -d "$dir" && test "$helper" != CVS; then
1321 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1328 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1332 if test -n "$DIGEST_AUTH_HELPERS"; then
1333 for helper in $DIGEST_AUTH_HELPERS; do
1334 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1337 echo "ERROR: digest auth helper $helper does not exists"
1341 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1343 AC_SUBST(DIGEST_AUTH_HELPERS)
1345 dnl Enable "NTLM fail open"
1346 AC_ARG_ENABLE(ntlm-fail-open,
1347 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1348 Authentication steps can allow squid to still authenticate
1350 [ if test "$enableval" = "yes" ; then
1351 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.])
1355 dnl Select external_acl helpers to build
1356 EXTERNAL_ACL_HELPERS=
1357 AC_ARG_ENABLE(external-acl-helpers,
1358 [ --enable-external-acl-helpers=\"list of helpers\"
1359 This option selects which external_acl helpers to
1360 build and install as part of the normal build
1361 process. For a list of available helpers see the
1362 helpers/external_acl directory.],
1363 [ case "$enableval" in
1365 for dir in $srcdir/helpers/external_acl/*; do
1366 helper="`basename $dir`"
1367 if test -d "$dir" && test "$helper" != CVS; then
1368 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1375 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1379 if test -n "$EXTERNAL_ACL_HELPERS"; then
1380 for helper in $EXTERNAL_ACL_HELPERS; do
1381 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1384 echo "ERROR: external acl helper $helper does not exists"
1388 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1390 AC_SUBST(EXTERNAL_ACL_HELPERS)
1392 dnl Disable "memPools" code
1393 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1394 AC_ARG_ENABLE(mempools,
1395 [ --disable-mempools Disable memPools. Note that this option now simply sets the
1396 default behaviour. Specific classes can override this at runtime, and
1397 only lib/MemPool.c needs to be altered to change the squid-wide
1398 default for all classes.],
1399 [ if test "$enableval" = "no" ; then
1400 echo "memPools disabled"
1401 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1405 dnl Enable WIN32 Service compile mode
1406 AC_ARG_ENABLE(win32-service,
1407 [ --enable-win32-service Compile Squid as a WIN32 Service
1408 Works only on Windows NT and Windows 2000 Platforms.],
1409 [ if test "$enableval" = "yes" ; then
1410 echo "Enabling WIN32 run service mode"
1411 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1416 SAMBASOURCES='$(top_srcdir)/include/samba'
1417 AC_ARG_WITH(samba-sources,
1418 [ --with-samba-sources=/path/to/samba-source-tree
1419 Path where the correct Samba source files can be
1420 found while building winbind helpers. (defaults to
1421 use internal copies of the headers from Samba-2.2.7)
1423 [ if test -f $withval/source/nsswitch/winbind_nss_config.h; then
1424 echo "Using Samba sources from $withval"
1425 SAMBASOURCES="$withval/source"
1427 echo "ERROR: Cannot find Samba sources at $withval"
1431 AC_SUBST(SAMBASOURCES)
1433 dnl Check for Cyrus SASL
1434 if test "$require_sasl" = "yes"; then
1435 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1436 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1440 if test "$ac_cv_header_sasl_h" = "yes"; then
1444 echo "ERROR: Neither SASL nor SASL2 found"
1451 dnl Disable "unlinkd" code
1452 AC_ARG_ENABLE(unlinkd,
1453 [ --disable-unlinkd Do not use unlinkd],
1454 [ if test "$enableval" = "no" ; then
1460 # Here we should probably use some magic depending on the selected
1464 if test "$use_unlinkd" = "yes"; then
1465 echo "unlinkd enabled"
1466 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1467 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1469 echo "unlinkd disabled"
1470 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1473 dnl Enable backtraces on fatal errors
1474 AC_ARG_ENABLE(stacktraces,
1475 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1476 [ if test "$enableval" = "yes" ; then
1477 echo "Enabling automatic stack backtraces on fatal errors"
1478 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1482 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1483 dnl Enable USE_XPROF_STATS
1484 AC_ARG_ENABLE(cpu-profiling,
1485 [ --enable-cpu-profiling
1486 This option allows you to see which internal functions
1487 in Squid are consuming how much CPU. Compiles in probes
1488 that measure time spent in probed functions. Needs
1489 source modifications to add new probes. This is meant
1490 for developers to assist in performance optimisations
1491 of Squid internal functions.
1492 If you are not developer and not interested in the stats
1493 you shouldn't enable this, as overhead added, although
1494 small, is still overhead. See lib/Profiler.c for more.
1496 [ if test "$enableval" = "yes" ; then
1497 echo "Enabling cpu-profiling"
1498 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1499 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1503 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1504 AC_ARG_ENABLE(x_accelerator_vary,
1505 [ --enable-x-accelerator-vary
1506 Enable support for the X-Accelerator-Vary
1507 HTTP header. Can be used to indicate
1508 variance within an accelerator setup.
1509 Typically used together with other code
1510 that adds custom HTTP headers to the requests.],
1511 [ if test "$enableval" = "yes" ; then
1512 echo "Enabling support for X-Accelerator-Vary"
1513 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1517 AC_ARG_WITH(filedescriptors,
1518 [ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors],
1519 [ squid_filedescriptors_num=$withval ])
1521 # FIXME, try linking in a test program first, then if that fails try probing etc.
1522 SQUID_CPPUNIT_DIR='cppunit-1.10.0'
1523 SQUID_CPPUNIT_LA='$(top_builddir)/lib/cppunit-1.10.0/src/cppunit/libcppunit.la'
1524 SQUID_CPPUNIT_INC='-I$(top_builddir)/lib/cppunit-1.10.0/include -I $(top_srcdir)/lib/cppunit-1.10.0/include'
1525 if test -f /usr/include/cppunit/TestCase.h; then
1526 echo "using system installed cppunit"
1527 SQUID_CPPUNIT_DIR=''
1528 SQUID_CPPUNIT_LA='/usr/lib/libcppunit.la'
1529 SQUID_CPPUNIT_INC=''
1531 AC_ARG_WITH(cppunit-basedir,
1532 [ --with-cppunit-basedir=/path/to/cppunit-base
1533 Path where the cppunit headers are libraries are found
1534 for unit testing. (defaults to use internal copies -
1537 [ if test -f $withval/include/cppunit/TestCase.h; then
1538 echo "Using cppunit includes from $withval"
1539 SQUID_CPPUNIT_INC="-I${withval}/include"
1541 echo "ERROR: Cannot find cppunit at $withval"
1544 if test -f $withval/lib/libcppunit.la; then
1545 echo "Using cppunit lib from $withval"
1546 SQUID_CPPUNIT_LA="-I${withval}/lib/libcppunit.la"
1548 echo "ERROR: Cannot find cppunit at $withval"
1551 SQUID_CPPUNIT_DIR=''
1553 AC_SUBST(SQUID_CPPUNIT_LA)
1554 AC_SUBST(SQUID_CPPUNIT_INC)
1555 AC_SUBST(SQUID_CPPUNIT_DIR)
1557 # Force some compilers to use ANSI features
1561 if test "$ac_cv_prog_CC" = "cc" ; then
1562 echo "adding '-std1' to cc args for $host"
1568 if test "$ac_cv_prog_CC" = "cc" ; then
1569 echo "adding '-Ae' to cc args for $host"
1576 dnl Check for programs
1580 AC_PATH_PROG(SH, sh, /bin/sh)
1581 AC_PATH_PROG(FALSE, false, /usr/bin/false)
1582 AC_PATH_PROG(TRUE, true, /usr/bin/true)
1583 AC_PATH_PROG(RM, rm, $FALSE)
1584 AC_PATH_PROG(MV, mv, $FALSE)
1585 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
1586 AC_PATH_PROG(LN, ln, cp)
1587 AC_PATH_PROG(PERL, perl, none)
1588 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
1589 AC_PATH_PROG(AR, ar, $FALSE)
1591 if test "$ac_cv_path_PERL" = "none"; then
1592 echo "Perl is required to compile Squid"
1593 echo "Please install Perl and then re-run configure"
1599 echo "Disabling 'ranlib' for HP-UX..."
1613 dnl Check for headers
1645 netinet/ip_fil_compat.h \
1694 AC_CHECK_HEADERS(linux/netfilter_ipv4.h,,,
1695 SQUID_DEFAULT_INCLUDES
1701 AC_CHECK_HEADERS(net/if.h \
1703 netinet/ip_compat.h\
1707 resolv.h,,,SQUID_BSDNET_INCLUDES)
1712 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1713 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1715 ac_cv_have_ansi_prototypes="yes",
1716 ac_cv_have_ansi_prototypes="no")
1718 if test $ac_cv_have_ansi_prototypes = "yes" ; then
1719 AC_DEFINE(HAVE_ANSI_PROTOTYPES,1,[Define if your compiler supports prototyping])
1723 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
1726 #include <sys/time.h>
1733 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
1734 #if HAVE_SYS_TYPES_H
1735 #include <sys/types.h>
1741 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
1742 #if HAVE_SYS_TYPES_H
1743 #include <sys/types.h>
1749 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
1751 #include <sys/time.h>
1753 #if HAVE_SYS_RESOURCE_H
1754 #include <sys/resource.h>
1757 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
1758 #if HAVE_SYS_TYPES_H
1759 #include <sys/types.h>
1761 #include <netinet/in.h>
1762 #include <netinet/in_systm.h>
1763 #include <netinet/ip.h>
1764 #if defined (__linux__) || defined (__CYGWIN__)
1773 dnl Check for typedefs
1774 AC_CHECK_SIZEOF(void *)
1776 dnl 16 bit integers - int16_t and u_int16_t
1777 dnl if this is defined we trust it to be 16 bits
1778 AC_CHECK_TYPE(int16_t,
1779 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers]),
1780 ,SQUID_DEFAULT_INCLUDES)
1783 AC_CHECK_TYPE(short,[
1784 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1785 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
1786 ],,SQUID_DEFAULT_INCLUDES)
1790 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1791 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
1792 ],,SQUID_DEFAULT_INCLUDES)
1794 dnl unsigned 16 bit ints - u_int16_t
1795 dnl if this is defined we trust it to be 16 bits
1796 AC_CHECK_TYPE(u_int16_t,
1797 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers]),
1798 ,SQUID_DEFAULT_INCLUDES)
1801 dnl if this is defined we trust it to be 16 bits
1802 AC_CHECK_TYPE(uint16_t,
1803 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers]),
1804 ,SQUID_DEFAULT_INCLUDES)
1806 dnl 32 bit signed int - int32_t
1807 dnl if this is defined we trust it to be 32 bits
1808 AC_CHECK_TYPE(int32_t,
1809 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers]),
1810 ,SQUID_DEFAULT_INCLUDES)
1813 AC_CHECK_TYPE(long,[
1814 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1815 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
1816 ],,SQUID_DEFAULT_INCLUDES)
1818 dnl 32 bit unsigned int - u_int32_t
1819 dnl if this is defined we trust it to be 32 bits
1820 AC_CHECK_TYPE(u_int32_t,
1821 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers]),
1822 ,SQUID_DEFAULT_INCLUDES)
1825 dnl if this is defined we trust it to be 32 bits
1826 AC_CHECK_TYPE(uint32_t,
1827 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers]),
1828 ,SQUID_DEFAULT_INCLUDES)
1830 dnl 64 bit signed - int64_t
1831 dnl if this is defind we trust it to be 64 bits
1832 AC_CHECK_TYPE(int64_t,
1833 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers]),
1834 ,SQUID_DEFAULT_INCLUDES)
1837 dnl if this is defind we trust it to be 64 bits
1838 AC_CHECK_TYPE(__int64,
1839 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers]),
1840 ,SQUID_DEFAULT_INCLUDES)
1843 AC_CHECK_TYPE(long long,[
1844 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1845 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
1846 ],,SQUID_DEFAULT_INCLUDES)
1848 dnl 64 bit unsigned - u_int64_t
1849 dnl if this is defind we trust it to be 64 bits
1850 AC_CHECK_TYPE(u_int64_t,
1851 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers]),
1852 ,SQUID_DEFAULT_INCLUDES)
1855 dnl if this is defind we trust it to be 64 bits
1856 AC_CHECK_TYPE(uint64_t,
1857 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers]),
1858 ,SQUID_DEFAULT_INCLUDES)
1860 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1861 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1862 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1863 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1864 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1865 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1866 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1867 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1869 dnl Check for special functions
1872 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
1873 #include <sys/types.h>
1874 #include <sys/socket.h>
1880 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
1881 #include <sys/ipc.h>
1882 #include <sys/msg.h>])
1884 dnl Check for needed libraries
1885 AC_CHECK_LIB(nsl, main)
1886 AC_CHECK_LIB(socket, main)
1888 dnl Ripped from the Samba sources
1889 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
1891 #include <sys/types.h>
1894 #include <sys/socket.h>
1895 #include <sys/un.h>],
1897 struct sockaddr_un sunaddr;
1898 sunaddr.sun_family = AF_UNIX;
1900 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
1901 if test x"$squid_cv_unixsocket" = x"yes"; then
1902 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
1906 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
1907 echo "skipping libmalloc check (--enable-dlmalloc specified)"
1909 AC_CHECK_LIB(gnumalloc, main)
1910 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
1911 echo "Disabling extended malloc functions when using gnumalloc"
1912 ac_cv_func_mallinfo=no
1913 ac_cv_func_mallocblksize=no
1914 ac_cv_func_mallopt=no
1918 echo "skipping libmalloc check for $host"
1921 echo "skipping libmalloc check for $host"
1925 AC_CHECK_LIB(malloc, main)
1931 AC_CHECK_LIB(bsd, main)
1932 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
1933 AC_CHECK_LIB(bind, gethostbyname)
1934 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
1937 echo "skipping libresolv checks for $host"
1940 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
1941 AC_CHECK_LIB(resolv, main)
1945 AC_CHECK_LIB(m, main)
1947 dnl Check for libcrypt
1948 dnl Some of our helpers use crypt(3) which may be in libc, or in
1949 dnl libcrypt (eg FreeBSD)
1950 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1953 dnl Check for libdl, used by auth_modules/PAM
1954 if test "$with_dl" = "yes"; then
1955 AC_CHECK_LIB(dl, dlopen)
1958 dnl Check for pthreads
1959 dnl We use pthreads when doing ASYNC I/O
1960 if test "$with_pthreads" = "yes"; then
1961 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
1962 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
1964 i386-unknown-freebsd*)
1965 if test "$GCC" = "yes" ; then
1966 if test -z "$PRESET_LDFLAGS"; then
1967 LDFLAGS="$LDFLAGS -pthread"
1972 if test "$GCC" = "yes" ; then
1973 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
1974 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
1976 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
1977 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
1981 AC_CHECK_LIB(pthread, main)
1985 dnl We use AIO in the coss store
1986 if test "$with_aio" = "yes"; then
1987 AC_CHECK_LIB(rt, aio_read)
1990 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
1991 dnl Robert Side <rside@aiinc.bc.ca>
1992 dnl Mon, 18 Jan 1999 17:48:00 GMT
1995 AC_CHECK_LIB(intl, strftime)
1999 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2000 dnl only with Windows LDAP libraries using -lwldap32
2003 LIB_LDAP="-lwldap32"
2008 dnl LDAP helpers need to know if -llber is needed or not
2009 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2015 dnl System-specific library modifications
2019 if test "$GCC" = "yes"; then
2020 echo "Removing -O for gcc on $host"
2021 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2025 echo "Removing -lsocket for IRIX..."
2026 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2027 echo "Removing -lnsl for IRIX..."
2028 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2029 ac_cv_lib_nsl_main=no
2030 echo "Removing -lbsd for IRIX..."
2031 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2033 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2034 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2035 dnl Please change your configure script. AIX doesn't need -lbsd.
2037 echo "Removing -lbsd for AIX..."
2038 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2040 dnl From: mlaster@metavillage.com (Mike Laster)
2041 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
2042 dnl So using the internal versions generates a load of warnings
2045 echo "disabling snprintf/vsnprintf for $host"
2046 ac_cv_func_snprintf=no
2047 ac_cv_func_vsnprintf=no
2052 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2053 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2054 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2056 [*-*-solaris2.[0-4]])
2057 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2059 [*-sony-newsos[56]*])
2060 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2064 # Remove optimization for GCC 2.95.[123]
2065 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2066 if test "$GCC" = "yes"; then
2067 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2070 echo "Removing -O for gcc on $host with GCC $GCCVER"
2071 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2076 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2079 if test `uname -v` = "2.03"; then
2080 echo "disabling mallinfo for $host"
2081 ac_cv_func_mallinfo=no
2086 dnl This has to be before AC_CHECK_FUNCS
2087 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2088 # when running configure.
2089 if test -z "$ac_cv_func_poll"; then
2092 # John Kay (jkay@nlanr.net) 19970818
2093 echo "disabling poll for $host..."
2094 ac_cv_func_poll='no'
2098 echo "disabling poll for $host..."
2099 ac_cv_func_poll='no'
2102 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2103 # poll is problematic on Linux. We disable it
2104 # by default until Linux gets it right.
2105 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2106 if test $rev -lt 002002; then
2107 echo "disabling poll for $host < 2.2..."
2108 ac_cv_func_poll='no'
2111 [powerpc-ibm-aix4.1.*])
2112 # Mike Laster (mlaster@metavillage.com) 19981021
2113 echo "disabling poll for $host..."
2114 ac_cv_func_poll='no'
2117 # Robert Side <rside@aiinc.bc.ca>
2118 # Mon, 18 Jan 1999 17:48:00 GMT
2119 echo "disabling poll for $host..."
2120 ac_cv_func_poll='no'
2125 dnl Check for library functions
2127 backtrace_symbols_fd \
2154 pthread_attr_setschedparam \
2155 pthread_attr_setscope \
2156 pthread_setschedparam \
2184 dnl Magic which checks whether we are forcing a type of comm loop we
2185 dnl are actually going to (ab)use
2187 dnl Actually do the define magic now
2188 dnl mostly ripped from squid-commloops, thanks to adrian and benno
2190 if test "$ac_cv_func_kqueue" = "yes" ; then
2191 SELECT_TYPE="kqueue"
2192 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2193 elif test "$ac_cv_func_epoll" = "yes" ; then
2195 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2196 AC_CHECK_LIB(epoll, epoll_create, [EPOLL_LIBS="-lepoll"])
2197 AC_SUBST(EPOLL_LIBS)
2198 elif test "$ac_cv_func_poll" = "yes" ; then
2200 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2201 elif test "$ac_cv_func_select" = "yes" ; then
2202 SELECT_TYPE="select"
2203 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2205 echo "Eep! Can't find poll, kqueue, epoll, or select!"
2206 echo "I'll try select and hope for the best."
2207 SELECT_TYPE="select"
2208 AC_DEFINE(USE_SELECT,1)
2210 echo "Using ${SELECT_TYPE} for select loop."
2213 dnl Yay! Another Linux brokenness. Its not good enough
2214 dnl to know that setresuid() exists, because RedHat 5.0 declares
2215 dnl setresuid() but doesn't implement it.
2217 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2221 if(setresuid(-1,-1,-1)) {
2222 perror("setresuid:");
2227 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2229 if test "$ac_cv_func_setresuid" = "yes" ; then
2230 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.])
2233 AM_CONDITIONAL(NEED_OWN_SNPRINTF, false)
2234 if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then
2235 AM_CONDITIONAL(NEED_OWN_SNPRINTF, true)
2239 dnl Test for va_copy
2241 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
2244 void f (int i, ...) {
2245 va_list args1, args2;
2246 va_start (args1, i);
2247 va_copy (args2, args1);
2248 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2250 va_end (args1); va_end (args2);
2256 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
2258 if test "$ac_cv_func_va_copy" = "yes" ; then
2259 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
2263 dnl Some systems support __va_copy
2265 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
2268 void f (int i, ...) {
2269 va_list args1, args2;
2270 va_start (args1, i);
2271 __va_copy (args2, args1);
2272 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2274 va_end (args1); va_end (args2);
2280 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
2282 if test "$ac_cv_func___va_copy" = "yes" ; then
2283 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
2286 dnl IP-Filter support requires ipf header files. These aren't
2287 dnl installed by default, so we need to check for them
2288 if test "$IPF_TRANSPARENT" ; then
2289 AC_MSG_CHECKING(if IP-Filter header files are installed)
2290 # hold on to your hats...
2291 if test "$ac_cv_header_ip_compat_h" = "yes" ||
2292 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
2293 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
2294 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
2295 have_ipfilter_compat_header="yes"
2297 if test "x$have_ipfilter_compat_header" = "xyes" &&
2298 test "$ac_cv_header_ip_fil_h" = "yes" &&
2299 test "$ac_cv_header_ip_nat_h" = "yes" ; then
2300 IPF_TRANSPARENT="yes"
2301 AC_DEFINE(IPF_TRANSPARENT, 1)
2302 elif test "$have_ipfilter_compat_header" = "yes" &&
2303 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
2304 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
2305 IPF_TRANSPARENT="yes"
2306 AC_DEFINE(IPF_TRANSPARENT, 1)
2308 IPF_TRANSPARENT="no"
2309 AC_DEFINE(IPF_TRANSPARENT, 0)
2311 AC_MSG_RESULT($IPF_TRANSPARENT)
2313 if test "$IPF_TRANSPARENT" = "no" ; then
2314 echo "WARNING: Cannot find necessary IP-Filter header files"
2315 echo " Transparent Proxy support WILL NOT be enabled"
2319 dnl PF support requires a header file.
2320 if test "$PF_TRANSPARENT" ; then
2321 AC_MSG_CHECKING(if PF header file is installed)
2322 # hold on to your hats...
2323 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
2324 PF_TRANSPARENT="yes"
2325 AC_DEFINE(PF_TRANSPARENT, 1)
2328 AC_DEFINE(PF_TRANSPARENT, 0)
2330 AC_MSG_RESULT($PF_TRANSPARENT)
2332 if test "$PF_TRANSPARENT" = "no" ; then
2333 echo "WARNING: Cannot find necessary PF header file"
2334 echo " Transparent Proxy support WILL NOT be enabled"
2338 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
2339 dnl Shamelessly copied from above
2340 if test "$LINUX_NETFILTER" ; then
2341 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
2342 # hold on to your hats...
2343 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
2344 LINUX_NETFILTER="yes"
2345 AC_DEFINE(LINUX_NETFILTER, 1)
2347 LINUX_NETFILTER="no"
2348 AC_DEFINE(LINUX_NETFILTER, 0)
2350 AC_MSG_RESULT($LINUX_NETFILTER)
2352 if test "$LINUX_NETFILTER" = "no" ; then
2353 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
2354 echo " Linux Transparent Proxy support WILL NOT be enabled"
2358 if test -z "$USE_GNUREGEX" ; then
2360 *-sun-solaris2.[[0-4]])
2368 AC_MSG_CHECKING(if GNUregex needs to be compiled)
2369 if test -z "$USE_GNUREGEX"; then
2370 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
2373 AC_TRY_COMPILE([#include <sys/types.h>
2374 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
2379 AC_MSG_RESULT($USE_GNUREGEX)
2380 if test "$USE_GNUREGEX" = "yes"; then
2382 LIBREGEX="libregex.a"
2383 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
2395 dnl Not cached since people are likely to tune this
2396 AC_MSG_CHECKING(Default FD_SETSIZE value)
2405 #include <sys/time.h>
2407 #if HAVE_SYS_SELECT_H
2408 #include <sys/select.h>
2410 #if HAVE_SYS_TYPES_H
2411 #include <sys/types.h>
2414 FILE *fp = fopen("conftestval", "w");
2415 fprintf (fp, "%d\n", FD_SETSIZE);
2419 DEFAULT_FD_SETSIZE=`cat conftestval`,
2420 DEFAULT_FD_SETSIZE=256,
2421 DEFAULT_FD_SETSIZE=256)
2422 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
2423 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
2426 dnl Not cached since people are likely to tune this
2427 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
2428 dnl damn! FreeBSD's pthreads breaks dup2().
2429 if test -n "$squid_filedescriptors_num" ; then
2430 SQUID_MAXFD=$squid_filedescriptors_num
2431 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
2435 i386-unknown-freebsd*)
2436 if echo "$LDFLAGS" | grep -q pthread; then
2437 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
2443 #include <sys/time.h> /* needed on FreeBSD */
2444 #include <sys/param.h>
2445 #include <sys/resource.h>
2449 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
2450 /* getrlimit and sysconf returns bogous values on cygwin32.
2451 * Number of fds is virtually unlimited in cygwin (sys/param.h)
2452 * __CYGWIN32__ is deprecated.
2458 #if defined(RLIMIT_NOFILE)
2459 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
2460 perror("getrlimit: RLIMIT_NOFILE");
2462 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2463 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
2464 perror("setrlimit: RLIMIT_NOFILE");
2467 #elif defined(RLIMIT_OFILE)
2468 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
2469 perror("getrlimit: RLIMIT_OFILE");
2471 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2472 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
2473 perror("setrlimit: RLIMIT_OFILE");
2476 #endif /* RLIMIT_NOFILE */
2477 #endif /* HAVE_SETRLIMIT */
2478 /* by starting at 2^14, we will never get higher
2479 than 2^15 for SQUID_MAXFD */
2483 if (dup2(0, i) < 0) {
2491 #endif /* IF !DEF CYGWIN */
2492 fp = fopen("conftestval", "w");
2493 fprintf (fp, "%d\n", i & ~0x3F);
2497 SQUID_MAXFD=`cat conftestval`,
2500 AC_MSG_RESULT($SQUID_MAXFD)
2502 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
2503 if test "$SQUID_MAXFD" -lt 512 ; then
2504 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
2505 echo " cache will be very busy. Please see the FAQ page"
2506 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
2507 echo " on how to increase your filedescriptor limit"
2512 if test `expr $SQUID_MAXFD % 64` != 0; then
2513 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
2514 echo " on certain platforms."
2518 dnl Not cached since people are likely to tune this
2519 AC_MSG_CHECKING(Default UDP send buffer size)
2523 #include <sys/types.h>
2524 #include <sys/socket.h>
2525 #include <netinet/in.h>
2529 int fd,val=0,len=sizeof(int);
2530 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2531 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2532 if (val<=0) exit(1);
2533 fp = fopen("conftestval", "w");
2534 fprintf (fp, "%d\n", val);
2538 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
2539 SQUID_DETECT_UDP_SO_SNDBUF=16384,
2540 SQUID_DETECT_UDP_SO_SNDBUF=16384)
2541 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
2542 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
2544 dnl Not cached since people are likely to tune this
2545 AC_MSG_CHECKING(Default UDP receive buffer size)
2549 #include <sys/types.h>
2550 #include <sys/socket.h>
2551 #include <netinet/in.h>
2555 int fd,val=0,len=sizeof(int);
2556 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2557 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2558 if (val <= 0) exit(1);
2559 fp = fopen("conftestval", "w");
2560 fprintf (fp, "%d\n", val);
2564 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
2565 SQUID_DETECT_UDP_SO_RCVBUF=16384,
2566 SQUID_DETECT_UDP_SO_RCVBUF=16384)
2567 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
2568 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
2570 dnl Not cached since people are likely to tune this
2571 AC_MSG_CHECKING(Default TCP send buffer size)
2575 #include <sys/types.h>
2576 #include <sys/socket.h>
2577 #include <netinet/in.h>
2581 int fd,val=0,len=sizeof(int);
2582 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2583 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2584 if (val <= 0) exit(1);
2585 fp = fopen("conftestval", "w");
2586 fprintf (fp, "%d\n", val);
2590 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
2591 SQUID_TCP_SO_SNDBUF=16384,
2592 SQUID_TCP_SO_SNDBUF=16384)
2593 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2594 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
2595 echo "Limiting send buffer size to 32K"
2596 SQUID_TCP_SO_SNDBUF=32768
2598 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
2600 dnl Not cached since people are likely to tune this
2601 AC_MSG_CHECKING(Default TCP receive buffer size)
2605 #include <sys/types.h>
2606 #include <sys/socket.h>
2607 #include <netinet/in.h>
2611 int fd,val=0,len=sizeof(int);
2612 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2613 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2614 if (val <= 0) exit(1);
2615 fp = fopen("conftestval", "w");
2616 fprintf (fp, "%d\n", val);
2620 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
2621 SQUID_TCP_SO_RCVBUF=16384,
2622 SQUID_TCP_SO_RCVBUF=16384)
2623 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2624 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
2625 echo "Limiting receive buffer size to 64K"
2626 SQUID_TCP_SO_RCVBUF=65535
2628 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
2629 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
2630 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
2631 ac_cv_needs_sys_errlist="no",
2632 ac_cv_needs_sys_errlist="yes")
2634 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
2635 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
2638 dnl Not cached since people are likely to change this
2639 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
2640 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
2642 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
2645 AC_MSG_CHECKING(if inet_ntoa() actually works)
2649 #include <sys/types.h>
2650 #include <netinet/in.h>
2651 #include <arpa/inet.h>
2656 in.s_addr = inet_addr("1.2.3.4");
2657 fp = fopen("conftestval", "w");
2658 fprintf (fp, "%s\n", inet_ntoa(in));
2662 INET_NTOA_RESULT=`cat conftestval`,
2663 INET_NTOA_RESULT="broken",
2664 INET_NTOA_RESULT="broken")
2665 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
2666 AC_MSG_RESULT("yes")
2669 echo "Will use our own inet_ntoa()."
2670 AC_LIBOBJ(inet_ntoa)
2671 # echo "WARNING: This looks bad, and probably prevents Squid from working."
2672 # echo " If you're on IRIX and using GCC 2.8, you probably need"
2673 # echo " to use the IRIX C compiler instead."
2677 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
2678 AC_MSG_CHECKING(for working statvfs() interface)
2682 #include <sys/types.h>
2683 #include <sys/statvfs.h>
2687 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
2688 sfs.f_files = sfs.f_ffree = 0;
2689 statvfs("/tmp", &sfs);
2691 ac_cv_func_statvfs=yes,
2692 ac_cv_func_statvfs=no)
2693 AC_MSG_RESULT($ac_cv_func_statvfs)
2694 if test "$ac_cv_func_statvfs" = "yes" ; then
2695 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
2699 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
2701 #if HAVE_SYS_TYPES_H
2702 #include <sys/types.h>
2704 #if HAVE_NETINET_IN_H
2705 #include <netinet/in.h>
2707 #if HAVE_ARPA_INET_H
2708 #include <arpa/inet.h>
2710 #if HAVE_ARPA_NAMESER_H
2711 #include <arpa/nameser.h>
2717 [_res.nsaddr_list[[0]];],
2718 ac_cv_have_res_nsaddr_list="yes",
2719 ac_cv_have_res_nsaddr_list="no"))
2720 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
2721 AC_DEFINE(HAVE_RES_NSADDR_LIST,1,[If _res structure has nsaddr_list member])
2724 if test $ac_cv_have_res_nsaddr_list = "no" ; then
2725 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
2727 #if HAVE_SYS_TYPES_H
2728 #include <sys/types.h>
2730 #if HAVE_NETINET_IN_H
2731 #include <netinet/in.h>
2733 #if HAVE_ARPA_INET_H
2734 #include <arpa/inet.h>
2736 #if HAVE_ARPA_NAMESER_H
2737 #include <arpa/nameser.h>
2743 [_res.ns_list[[0]].addr;],
2744 ac_cv_have_res_ns_list="yes",
2745 ac_cv_have_res_ns_list="no"))
2746 if test $ac_cv_have_res_ns_list = "yes" ; then
2747 AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
2751 dnl Need the debugging version of malloc if available
2753 if test "$ac_cv_lib_malloc_main" = "yes" ; then
2754 if test -r /usr/lib/debug/malloc.o ; then
2755 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
2757 if test -r /usr/lib/debug/mallocmap.o ; then
2758 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
2764 if test -z "$XTRA_LIBS"; then
2767 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
2772 dnl Clean up after OSF/1 core dump bug
2789 test-suite/Makefile \
2792 helpers/basic_auth/Makefile \
2793 helpers/basic_auth/LDAP/Makefile \
2794 helpers/basic_auth/MSNT/Makefile \
2795 helpers/basic_auth/NCSA/Makefile \
2796 helpers/basic_auth/PAM/Makefile \
2797 helpers/basic_auth/SMB/Makefile \
2798 helpers/basic_auth/YP/Makefile \
2799 helpers/basic_auth/getpwnam/Makefile \
2800 helpers/basic_auth/multi-domain-NTLM/Makefile \
2801 helpers/basic_auth/SASL/Makefile \
2802 helpers/basic_auth/winbind/Makefile \
2803 helpers/digest_auth/Makefile \
2804 helpers/digest_auth/password/Makefile \
2805 helpers/ntlm_auth/Makefile \
2806 helpers/ntlm_auth/fakeauth/Makefile \
2807 helpers/ntlm_auth/no_check/Makefile \
2808 helpers/ntlm_auth/SMB/Makefile \
2809 helpers/ntlm_auth/SMB/smbval/Makefile \
2810 helpers/ntlm_auth/winbind/Makefile \
2811 helpers/external_acl/Makefile \
2812 helpers/external_acl/ip_user/Makefile \
2813 helpers/external_acl/ldap_group/Makefile \
2814 helpers/external_acl/unix_group/Makefile \
2815 helpers/external_acl/wbinfo_group/Makefile \
2816 helpers/external_acl/winbind_group/Makefile
2819 AC_CONFIG_SUBDIRS(lib/libTrie)
2820 AC_CONFIG_SUBDIRS(lib/cppunit-1.10.0)