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.384 2005/08/28 10:45:32 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.384 $)dnl
17 AC_PREFIX_DEFAULT(/usr/local/squid)
20 dnl Set default LDFLAGS
21 if test -z "$LDFLAGS"; then
25 PRESET_CFLAGS="$CFLAGS"
41 LIBREGEX='' # libregex.a
43 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
47 if test -z "$EXEEXT"; then
50 # automake automatically adds .exe when installing binaries
55 dnl this should be expanded to a list of platform sensible support requirements.
56 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
58 mingw|mingw32|cygwin|cygwin32)
59 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
62 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
68 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
69 CFLAGS="$CFLAGS -mthreads"
70 CXXFLAGS="$CXXFLAGS -mthreads"
71 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
72 echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform"
73 echo "Please see PSAPI.DLL section on doc/win32-relnotes.html."
75 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
81 if test -z "$CACHE_HTTP_PORT"; then
82 CACHE_HTTP_PORT="3128"
84 if test -z "$CACHE_ICP_PORT"; then
89 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
90 [What default TCP port to use for HTTP listening?])
91 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
92 [What default UDP port to use for ICP listening?])
94 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
96 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
101 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
104 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
108 if test "$GCC" = "yes"; then
109 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
110 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
113 if test $GCCVER2 -lt 300 ; then
114 echo "ERROR: GCC $GCCVER causes a coredump on $host"
115 echo "ERROR: Try a more recent GCC version"
124 dnl Set Default CFLAGS
125 if test -z "$PRESET_CFLAGS"; then
126 if test "$GCC" = "yes"; then
129 # sunos has too many warnings for this to be useful
133 # Motorola cc/ld does not like -02 but is ok on -O
134 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
137 CFLAGS="$CFLAGS -Wall"
143 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
144 CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \
145 -woff 1009,1014,1110,1116,1185,1188,1204,1230,1233 \
146 -Wl,-woff,85,-woff,84,-woff,134 \
147 -nostdinc -I/usr/include -D_BSD_SIGNALS"
150 # Mogul says DEC compilers take both -g and -O2
151 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
160 dnl set squid required flags
161 if test "$GCC" = "yes"; then
162 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
163 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
168 AC_SUBST(SQUID_CFLAGS)
169 AC_SUBST(SQUID_CXXFLAGS)
171 AC_TEST_CHECKFORHUGEOBJECTS
172 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
175 if test -z "$PRESET_LDFLAGS"; then
176 if test "$GCC" = "yes"; then
185 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
186 LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32"
192 dnl Enable optional modules
193 AC_ARG_ENABLE(dlmalloc,
194 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
199 LIBDLMALLOC="libdlmalloc.a"
200 LIB_MALLOC="-L../lib -ldlmalloc"
201 echo "dlmalloc enabled"
205 echo "dlmalloc disabled"
207 *) use_dlmalloc="yes"
208 LIB_MALLOC="$enableval"
209 echo "dlmalloc enabled with $LIB_MALLOC"
212 if test "${use_dlmalloc-unset}" = unset; then
215 echo "Enabling dlmalloc for $host"
217 LIBDLMALLOC="libdlmalloc.a"
218 LIB_MALLOC="-L../lib -ldlmalloc"
221 echo "Enabling dlmalloc for $host"
223 LIBDLMALLOC="libdlmalloc.a"
224 LIB_MALLOC="-L../lib -ldlmalloc"
228 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
229 # Ok. dlmalloc was enabled before, but state may be changed.
230 # we have to test these again
231 unset ac_cv_func_mallinfo
232 unset ac_cv_func_mallocblksize
233 unset ac_cv_func_free
234 unset ac_cv_func_realloc
235 unset ac_cv_func_memalign
236 unset ac_cv_func_valloc
237 unset ac_cv_func_pvalloc
238 unset ac_cv_func_calloc
239 unset ac_cv_func_cfree
240 unset ac_cv_func_malloc_trim
241 unset ac_cv_func_malloc_usable_size
242 unset ac_cv_func_malloc_stats
243 unset ac_cv_func_mallinfo
244 unset ac_cv_func_mallopt
245 unset ac_cv_lib_gnumalloc
246 unset ac_cv_header_gnumalloc_h
247 unset ac_cv_lib_malloc
248 unset ac_cv_enabled_dlmalloc
250 if test "$use_dlmalloc" = yes; then
251 ac_cv_func_mallinfo="yes"
252 ac_cv_func_mallocblksize="no"
253 ac_cv_func_free="yes"
254 ac_cv_func_realloc="yes"
255 ac_cv_func_memalign="yes"
256 ac_cv_func_valloc="yes"
257 ac_cv_func_pvalloc="yes"
258 ac_cv_func_calloc="yes"
259 ac_cv_func_cfree="yes"
260 ac_cv_func_malloc_trim="yes"
261 ac_cv_func_malloc_usable_size="yes"
262 ac_cv_func_malloc_stats="yes"
263 ac_cv_func_mallopt="yes"
264 ac_cv_lib_gnumalloc="no"
265 ac_cv_header_gnumalloc_h="no"
266 ac_cv_lib_malloc="no"
267 ac_cv_enabled_dlmalloc="yes"
268 AC_DEFINE(USE_DLMALLOC, 1, [Compile & use the malloc package by Doug Lea])
271 AC_SUBST(LIBDLMALLOC)
274 AC_ARG_ENABLE(gnuregex,
275 [ --enable-gnuregex Compile GNUregex. Unless you have reason to use this
276 option, you should not enable it. This library file
277 is usually only required on Windows and very old
278 Unix boxes which do not have their own regex library
280 [USE_GNUREGEX=$enableval])
284 AC_ARG_ENABLE(optimizations,
285 [ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
286 Optimization is good for production builds, but not
287 good for debugging. During development, use
288 --disable-optimizations to reduce compilation times
289 and allow easier debugging. This option implicitly
290 also enabled --disable-inline],
291 [ if test "$enableval" = "no" ; then
292 echo "Disabling compiler optimizations (-O flag)"
293 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
294 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
299 AC_ARG_ENABLE(inline,
300 [ --disable-inline Don't compile trivial methods as inline. Squid
301 is coded with much of the code able to be inlined.
302 Inlining is good for production builds, but not
303 good for development. During development, use
304 --disable-inline to reduce compilation times and
305 allow incremental builds to be quick. For
306 production builds, or load tests, use
307 --enable-inline to have squid make all trivial
308 methods inlinable by the compiler.],
309 [ if test "$enableval" = "no" ; then
314 if test "$SquidInline" = "yes" ; then
315 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
316 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
318 echo "Inlining optimization disabled"
319 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
322 AC_ARG_ENABLE(debug-cbdata,
323 [ --enable-debug-cbdata Provide some debug information in cbdata],
324 [ if test "$enableval" = "yes" ; then
325 echo "cbdata debugging enabled"
326 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
330 dnl This is a developer only option.. developers know how to set defines
332 dnl AC_ARG_ENABLE(xmalloc-debug,
333 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
334 dnl [ if test "$enableval" = "yes" ; then
335 dnl echo "Malloc debugging enabled"
336 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
340 dnl This is a developer only option.. developers know how to set defines
342 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
343 dnl [ --enable-xmalloc-debug-trace
344 dnl Detailed trace of memory allocations],
345 dnl [ if test "$enableval" = "yes" ; then
346 dnl echo "Malloc debug trace enabled"
347 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
348 dnl AC_DEFINE(XMALLOC_DEBUG,1)
352 AC_ARG_ENABLE(xmalloc-statistics,
353 [ --enable-xmalloc-statistics
354 Show malloc statistics in status page],
355 [ if test "$enableval" = "yes" ; then
356 echo "Malloc statistics enabled"
357 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
363 [ --disable-carp Disable CARP support],
364 [ if test "$enableval" = "no" ; then
369 if test $use_carp = 1; then
370 AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol])
372 AC_DEFINE(USE_CARP, 1)
375 AC_ARG_ENABLE(async-io,
376 [ --enable-async-io[=N_THREADS]
378 --with-aufs-threads=N_THREADS
380 --enable-storeio=ufs,aufs],
384 STORE_MODULES="ufs aufs"
389 aufs_io_threads=$enableval
391 STORE_MODULES="ufs aufs"
396 AC_ARG_WITH(aufs-threads,
397 [ --with-aufs-threads=N_THREADS
398 Tune the number of worker threads for the aufs object
402 aufs_io_threads=$withval
405 echo "ERROR: Invalid --with-aufs-threads argument"
410 if test "$aufs_io_threads"; then
411 echo "With $aufs_io_threads aufs threads"
412 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
413 [Defines how many threads aufs uses for I/O])
416 AC_ARG_WITH(pthreads,
417 [ --with-pthreads Use POSIX Threads])
418 if test "$with_pthreads" = "yes"; then
423 [ --with-aio Use POSIX AIO])
424 if test "$with_aio" = "yes"; then
429 [ --with-dl Use dynamic linking])
430 if test "$with_dl" = "yes"; then
434 AC_ARG_ENABLE(storeio,
435 [ --enable-storeio=\"list of modules\"
436 Build support for the list of store I/O modules.
437 The default is only to build the "ufs" module.
438 See src/fs for a list of available modules, or
439 Programmers Guide section <not yet written>
440 for details on how to build your custom store module],
443 for dir in $srcdir/src/fs/*; do
444 module="`basename $dir`"
445 if test -d "$dir" && test "$module" != CVS; then
446 STORE_MODULES="$STORE_MODULES $module"
453 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
457 [ if test -z "$STORE_MODULES"; then
461 if test -n "$STORE_MODULES"; then
462 for module in $STORE_MODULES; do
463 if test -d $srcdir/src/fs/$module; then
466 echo "ERROR: storeio $module does not exists"
470 echo "Store modules built: $STORE_MODULES"
472 for module in $STORE_MODULES; do
473 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
476 dnl remove all but diskd - its the only module that needs to recurse
477 dnl into the sub directory
484 for fs in $STORE_MODULES none; do
489 NEED_DISKDAEMON="true"
494 NEED_DISKTHREADS="true"
505 dnl We have 'fake' modules - aufs and diskd - legacy.
506 for fs in $STORE_MODULES; do
511 STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
512 STORE_LIBS="$STORE_LIBS lib${fs}.a"
517 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
518 echo "adding UFS, as it contains core logic for diskd and aufs"
519 STORE_OBJS="$STORE_OBJS fs/libufs.a"
520 STORE_LIBS="$STORE_LIBS libufs.a"
521 STORE_MODULES="$STORE_MODULES ufs"
522 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
527 AC_SUBST(STORE_LINKOBJS)
529 AC_ARG_ENABLE(disk-io,
530 [ --enable-disk-io=\"list of modules\"
531 Build support for the list of disk I/O modules.
532 The default is only to build the "Blocking" module.
533 See src/DiskIO for a list of available modules, or
534 Programmers Guide section <not yet written>
535 for details on how to build your custom disk module],
538 for dir in $srcdir/src/DiskIO/*; do
539 module="`basename $dir`"
540 if test -d "$dir" && test "$module" != CVS; then
541 DISK_MODULES="$DISK_MODULES $module"
548 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
552 [ if test -z "$DISK_MODULES"; then
553 DISK_MODULES="Blocking"
556 if test -n "$DISK_MODULES"; then
557 for module in $DISK_MODULES; do
558 if test -d $srcdir/src/DiskIO/$module; then
561 echo "ERROR: disk-io $module does not exists"
565 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
567 for module in $DISK_MODULES; do
568 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
571 for fs in $DISK_MODULES none; do
574 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
575 FOUND_DISKDAEMON="true"
578 FOUND_DISKTHREADS="true"
584 FOUND_BLOCKING="true"
588 if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
589 echo "adding Blocking, as it is used by an active, legacy Store Module"
590 DISK_LIBS="$DISK_LIBS libBlocking.a"
591 DISK_MODULES="$DISK_MODULES Blocking"
592 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
595 if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
596 echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
597 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
598 DISK_MODULES="$DISK_MODULES DiskDaemon"
599 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
600 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
603 if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
604 echo "adding DiskThreads, as it is used by an active, legacy Store Module"
605 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
606 DISK_MODULES="$DISK_MODULES DiskThreads"
607 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
609 if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
610 echo "adding AIO, as it is used by an active, legacy Store Module"
611 DISK_LIBS="$DISK_LIBS libAIO.a"
612 DISK_MODULES="$DISK_MODULES AIO"
613 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
615 echo "IO Modules built: $DISK_MODULES"
616 dnl we know what is being built. now add dependencies.
617 for fs in $DISK_MODULES none; do
620 if test -z "$with_pthreads"; then
621 echo "DiskThreads IO Module used, pthreads support automatically enabled"
626 if test -z "$with_aio"; then
627 echo "Aio IO Module used, aio support automatically enabled"
635 AC_SUBST(DISK_PROGRAMS)
636 AC_SUBST(DISK_LINKOBJS)
638 AC_ARG_ENABLE(removal-policies,
639 [ --enable-removal-policies=\"list of policies\"
640 Build support for the list of removal policies.
641 The default is only to build the "lru" module.
642 See src/repl for a list of available modules, or
643 Programmers Guide section 9.9 for details on how
644 to build your custom policy],
647 for dir in $srcdir/src/repl/*; do
648 module="`basename $dir`"
649 if test -d "$dir" && test "$module" != CVS; then
650 REPL_POLICIES="$REPL_POLICIES $module"
657 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
661 [ if test -z "$REPL_POLICIES"; then
665 if test -n "$REPL_POLICIES"; then
666 for module in $REPL_POLICIES; do
667 if test -d $srcdir/src/repl/$module; then
670 echo "ERROR: Removal policy $module does not exists"
674 echo "Removal policies built: $REPL_POLICIES"
675 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
676 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
678 AC_SUBST(REPL_POLICIES)
682 AM_CONDITIONAL(ENABLE_PINGER, false)
684 [ --enable-icmp Enable ICMP pinging],
685 [ if test "$enableval" = "yes" ; then
687 AC_DEFINE(USE_ICMP,1,
688 [If you want to use Squid's ICMP features (highly recommended!) then
689 define this. When USE_ICMP is defined, Squid will send ICMP pings
690 to origin server sites. This information is used in numerous ways:
691 - Sent in ICP replies so neighbor caches know how close
692 you are to the source.
693 - For finding the closest instance of a URN.
694 - With the 'test_reachability' option. Squid will return
695 ICP_OP_MISS_NOFETCH for sites which it cannot ping.])
696 AM_CONDITIONAL(ENABLE_PINGER, true)
700 AM_CONDITIONAL(USE_DELAY_POOLS, false)
701 AC_ARG_ENABLE(delay-pools,
702 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
703 [ if test "$enableval" = "yes" ; then
704 echo "Delay pools enabled"
705 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
706 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
710 AM_CONDITIONAL(USE_ESI, false)
712 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.]),
713 ac_cv_use_esi=$enableval, ac_cv_use_esi=no)
714 AC_CACHE_CHECK(whether to enable ESI,ac_cv_use_esi, ac_cv_use_esi=no)
715 if test "$ac_cv_use_esi" = "yes" ; then
716 AC_DEFINE(ESI,1,[Compile the ESI processor and Surrogate header support])
717 AM_CONDITIONAL(USE_ESI, true)
718 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
720 AC_DEFINE(ESI,0,[Compile the ESI processor and Surrogate header support])
723 dnl This is a developer only option. Developers know how to set defines
725 dnl AC_ARG_ENABLE(mem-gen-trace,
726 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
727 dnl [ if test "$enableval" = "yes" ; then
728 dnl echo "Memory trace (to file) enabled"
729 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
733 AC_ARG_ENABLE(useragent-log,
734 [ --enable-useragent-log Enable logging of User-Agent header],
735 [ if test "$enableval" = "yes" ; then
736 echo "User-Agent logging enabled"
737 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
738 By default, they are written to useragent.log in the Squid log
743 AC_ARG_ENABLE(referer-log,
744 [ --enable-referer-log Enable logging of Referer header],
745 [ if test "$enableval" = "yes" ; then
746 echo "Referer logging enabled"
747 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
748 By default, they are written to referer.log in the Squid log
755 [ --disable-wccp Disable Web Cache Coordination Protocol],
756 [ if test "$enableval" = "no" ; then
757 echo "Web Cache Coordination Protocol disabled"
761 if test $use_wccp = 1; then
762 AC_DEFINE(USE_WCCP, 1,[Define to enable WCCP])
764 AC_DEFINE(USE_WCCP, 0)
767 AC_ARG_ENABLE(kill-parent-hack,
768 [ --enable-kill-parent-hack
769 Kill parent on shutdown],
770 [ if test "$enableval" = "yes" ; then
771 echo "Kill parent on shutdown"
772 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
773 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
778 AM_CONDITIONAL(USE_SNMP, false)
780 [ --enable-snmp Enable SNMP monitoring],
781 [ if test "$enableval" = "yes" ; then
782 echo "SNMP monitoring enabled"
783 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
784 SNMPLIB='-L../snmplib -lsnmp'
785 AM_CONDITIONAL(USE_SNMP, true)
786 SNMP_MAKEFILE=./snmplib/Makefile
791 AC_SUBST(makesnmplib)
793 AC_ARG_ENABLE(cachemgr-hostname,
794 [ --enable-cachemgr-hostname[=hostname]
795 Make cachemgr.cgi default to this host],
798 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
799 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
800 echo "Cachemgr default hostname == host where cachemgr runs"
806 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
807 echo "Cachemgr default hostname set to ${enableval}"
812 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
813 AC_ARG_ENABLE(arp-acl,
814 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
815 [ if test "$enableval" = "yes" ; then
816 echo "ARP ACL lists enabled (ether address)"
825 LIBS="$LIBS -liphlpapi"
828 LIBS="$LIBS -liphlpapi"
831 echo "WARNING: ARP ACL support probably won't work on $host."
835 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, ?).])
836 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
840 AM_CONDITIONAL(ENABLE_HTCP, false)
842 [ --enable-htcp Enable HTCP protocol],
843 [ if test "$enableval" = "yes" ; then
845 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
846 AM_CONDITIONAL(ENABLE_HTCP, true)
850 AM_CONDITIONAL(ENABLE_SSL, false)
853 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
854 [ if test "$enableval" != "no"; then
855 echo "SSL gatewaying using OpenSSL enabled"
856 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
857 AM_CONDITIONAL(ENABLE_SSL, true)
860 dnl Native Windows port of OpenSSL needs -lgdi32
861 SSLLIB='-lssl -lcrypto -lgdi32'
864 SSLLIB='-lssl -lcrypto'
871 AM_CONDITIONAL(NEED_OWN_MD5, true)
874 [ --with-openssl[=prefix]
875 Compile with the OpenSSL libraries. The path to
876 the OpenSSL development libraries and headers
877 installation can be specified if outside of the
878 system standard directories],
880 case "$with_openssl" in
888 SSLLIBDIR="$with_openssl/lib"
889 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
894 if test -n "$USE_OPENSSL"; then
895 echo "Using OpenSSL MD5 implementation"
896 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)])
897 AM_CONDITIONAL(NEED_OWN_MD5, false)
898 if test -z "$SSLLIB"; then
899 SSLLIB="-lcrypto" # for MD5 routines
901 dnl This is a workaround for RedHat 9 brain damage..
902 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
903 echo "OpenSSL depends on Kerberos"
904 SSLLIBDIR="/usr/kerberos/lib"
905 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
908 if test -n "$SSLLIBDIR"; then
909 SSLLIB="-L$SSLLIBDIR $SSLLIB"
913 AC_ARG_ENABLE(forw-via-db,
914 [ --enable-forw-via-db Enable Forw/Via database],
915 [ if test "$enableval" = "yes" ; then
916 echo "FORW-VIA enabled"
917 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
921 AC_ARG_ENABLE(cache-digests,
922 [ --enable-cache-digests Use Cache Digests
923 see http://www.squid-cache.org/FAQ/FAQ-16.html],
924 [ if test "$enableval" = "yes" ; then
925 echo "USE_CACHE_DIGESTS enabled"
926 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
930 dnl Select Default Error language
931 AC_ARG_ENABLE(default-err-language,
932 [ --enable-default-err-language=lang
933 Select default language for Error pages (see
936 if test -d $srcdir/errors/$enableval; then
937 ERR_DEFAULT_LANGUAGE=$enableval
939 echo "ERROR! Unknown language $enableval, see errors/ directory"
942 ],[ERR_DEFAULT_LANGUAGE="English"])
943 AC_SUBST(ERR_DEFAULT_LANGUAGE)
945 dnl Select languages to be installed
946 AC_ARG_ENABLE(err-languages,
947 [ --enable-err-languages=\"lang1 lang2..\"
948 Select languages to be installed. (All will be
949 installed by default) ],
951 for l in $enableval; do
952 if test -d $srcdir/errors/$l; then :; else
953 echo "ERROR! Unknown language $$l, see errors/"
957 ERR_LANGUAGES=$enableval
960 for l in $srcdir/errors/*; do
961 if test -f $l/ERR_ACCESS_DENIED; then
962 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
966 AC_SUBST(ERR_LANGUAGES)
968 dnl Size of COSS memory buffer
969 AC_ARG_WITH(coss-membuf-size,
970 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
971 [ if test "$with_coss_membuf_size"; then
972 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
973 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
977 dnl check for netio plugin stuff
980 [ --enable-poll Enable poll() support.
981 --disable-poll Disable poll() support. ],
986 echo "Forcing poll() to be enabled"
987 ac_cv_func_poll='yes'
990 echo "Forcing poll() to be disabled"
997 AC_ARG_ENABLE(select,
998 [ --enable-select Enable select() support.
999 --disable-select Disable select() support. ],
1002 case "$enableval" in
1004 echo "Forcing select() to be enabled"
1005 ac_cv_func_select='yes'
1008 echo "Forcing select() to be disabled"
1009 ac_cv_func_select='no'
1015 AC_ARG_ENABLE(kqueue,
1016 [ --enable-kqueue Enable kqueue() support.
1017 --disable-kqueue Disable kqueue() support. ],
1020 case "$enableval" in
1022 echo "Forcing kqueue() to be enabled"
1023 ac_cv_func_kqueue='yes'
1026 echo "Forcing kqueue() to be disabled"
1027 ac_cv_func_kqueue='no'
1033 AC_ARG_ENABLE(epoll,
1034 [ --enable-epoll Enable epoll() support.
1035 --disable-epoll Disable epoll() support. ],
1038 case "$enableval" in
1040 echo "Forcing epoll() to be enabled"
1041 ac_cv_func_epoll='yes'
1044 echo "Forcing epoll() to be disabled"
1045 ac_cv_func_epoll='no'
1051 dnl Disable HTTP violations
1053 AC_ARG_ENABLE(http-violations,
1054 [ --disable-http-violations
1055 This allows you to remove code which is known to
1056 violate the HTTP protocol specification.],
1057 [ if test "$enableval" = "no" ; then
1058 echo "Disabling HTTP Violations"
1062 if test $http_violations = 1; then
1063 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.])
1065 AC_DEFINE(HTTP_VIOLATIONS, 0)
1068 dnl Enable IP-Filter Transparent Proxy
1069 AC_ARG_ENABLE(ipf-transparent,
1070 [ --enable-ipf-transparent
1071 Enable Transparent Proxy support for systems
1072 using IP-Filter network address redirection.],
1073 [ if test "$enableval" = "yes" ; then
1074 echo "IP-Filter Transparent Proxy enabled"
1075 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.])
1076 IPF_TRANSPARENT="yes"
1080 dnl Enable PF Transparent Proxy
1081 AC_ARG_ENABLE(pf-transparent,
1082 [ --enable-pf-transparent
1083 Enable Transparent Proxy support for systems
1084 using PF network address redirection.],
1085 [ if test "$enableval" = "yes" ; then
1086 echo "PF Transparent Proxy enabled"
1087 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1088 PF_TRANSPARENT="yes"
1092 dnl Enable Linux Netfilter Transparent Proxy
1093 AC_ARG_ENABLE(linux-netfilter,
1094 [ --enable-linux-netfilter
1095 Enable Transparent Proxy support for Linux (Netfilter) systems.],
1096 [ if test "$enableval" = "yes" ; then
1097 echo "Linux (Netfilter) Transparent Proxy enabled"
1098 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1099 LINUX_NETFILTER="yes"
1103 dnl Enable Large file support
1104 AC_ARG_ENABLE(large-files,
1105 [ --enable-large-files Enable support for large files (>2GB). Still
1107 [ if test "$enableval" = "yes" ; then
1108 echo "Large file support enabled"
1109 SQUID_CFLAGS="$SQUID_CFLAGS -D_FILE_OFFSET_BITS=64"
1110 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_FILE_OFFSET_BITS=64"
1114 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1115 dnl Enable Leak Finding Functions
1116 AC_ARG_ENABLE(leakfinder,
1117 [ --enable-leakfinder
1118 Enable Leak Finding code. Enabling this alone
1119 does nothing; you also have to modify the source
1120 code to use the leak finding functions. Probably
1121 Useful for hackers only.],
1122 [ if test "$enableval" = "yes" ; then
1123 echo "Leak-Finding enabled"
1124 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1125 USE_LEAKFINDER="yes"
1126 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1131 AC_ARG_ENABLE(ident-lookups,
1132 [ --disable-ident-lookups
1133 This allows you to remove code that performs
1134 Ident (RFC 931) lookups.],
1135 [ if test "$enableval" = "no" ; then
1136 echo "Disabling Ident Lookups"
1140 if test $use_ident = 1; then
1141 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1142 AM_CONDITIONAL(ENABLE_IDENT, true)
1144 AC_DEFINE(USE_IDENT, 0)
1145 AM_CONDITIONAL(ENABLE_IDENT, false)
1148 AM_CONDITIONAL(USE_DNSSERVER, false)
1150 AC_ARG_ENABLE(internal-dns,
1151 [ --disable-internal-dns This prevents Squid from directly sending and
1152 receiving DNS messages, and instead enables the
1153 old external 'dnsserver' processes.],
1154 [ if test "$enableval" = "no" ; then
1155 echo "Disabling Internal DNS queries"
1159 if test "$use_dnsserver" = "yes"; then
1160 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1161 AM_CONDITIONAL(USE_DNSSERVER, true)
1164 AC_ARG_ENABLE(truncate,
1165 [ --enable-truncate This uses truncate() instead of unlink() when
1166 removing cache files. Truncate gives a little
1167 performance improvement, but may cause problems
1168 when used with async I/O. Truncate uses more
1169 filesystem inodes than unlink..],
1170 [ if test "$enableval" = "yes" ; then
1171 echo "Enabling truncate instead of unlink"
1172 AC_DEFINE(USE_TRUNCATE,1,[Do we want to use truncate(2) or unlink(2)?])
1176 dnl Disable hostname checks
1177 AC_ARG_ENABLE(hostname-checks,
1178 [ --enable-hostname-checks
1179 Tells Squid to rejects any host names with
1180 odd characters in their name to conform with
1181 internet standards. This was the default in
1182 prior Squid versions, but since Squid-3 Squid
1183 no longer tries to police the use of DNS],
1184 [ if test "$enableval" = "yes"; then
1185 echo "Enabling hostname sanity checks"
1186 AC_DEFINE(CHECK_HOSTNAMES, 1, [Enable hostname sanity checks])
1190 dnl Enable underscore in hostnames
1191 AC_ARG_ENABLE(underscores,
1192 [ --enable-underscores Squid by default rejects any host names with _
1193 in their name to conform with internet standards.
1194 If you disagree with this you may allow _ in
1195 hostnames by using this switch, provided that
1196 the resolver library on the host where Squid runs
1197 does not reject _ in hostnames...],
1198 [ if test "$enableval" = "yes" ; then
1199 echo "Enabling the use of underscores in host names"
1200 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1,[Allow underscores in host names])
1204 dnl Select Default hosts file location
1205 AC_ARG_ENABLE(default-hostsfile,
1206 [ --enable-default-hostsfile=path
1207 Select default location for hosts file.
1208 See hosts_file directive in squid.conf for details],
1210 if test "$enableval" != "none" ; then
1211 if test -f $enableval; then
1212 OPT_DEFAULT_HOSTS=$enableval
1214 echo "Warning Unable to find $enableval"
1218 OPT_DEFAULT_HOSTS="none"
1220 echo "Default hosts file set to: $enableval"
1221 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1222 AC_SUBST(OPT_DEFAULT_HOSTS)
1224 dnl Select auth schemes modules to build
1226 [ --enable-auth=\"list of auth scheme modules\"
1227 Build support for the list of authentication schemes.
1228 The default is to build support for the Basic scheme.
1229 See src/auth for a list of available modules, or
1230 Programmers Guide section authentication schemes
1231 for details on how to build your custom auth scheme
1233 [ case $enableval in
1235 for dir in $srcdir/src/auth/*; do
1236 module="`basename $dir`"
1237 if test -d "$dir" && test "$module" != CVS; then
1238 AUTH_MODULES="$AUTH_MODULES $module"
1245 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1249 [ if test -z "$AUTH_MODULES"; then
1250 AUTH_MODULES="basic digest ntlm"
1253 if test -n "$AUTH_MODULES"; then
1254 for module in $AUTH_MODULES; do
1255 if test -d $srcdir/src/auth/$module; then
1258 echo "ERROR: Auth scheme $module does not exists"
1262 echo "Auth scheme modules built: $AUTH_MODULES"
1263 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1264 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1267 for module in $AUTH_MODULES; do
1268 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1270 AC_SUBST(AUTH_MODULES)
1272 AC_SUBST(AUTH_LINKOBJS)
1275 dnl Select basic auth scheme helpers to build
1276 BASIC_AUTH_HELPERS=""
1277 AC_ARG_ENABLE(basic-auth-helpers,
1278 [ --enable-basic-auth-helpers=\"list of helpers\"
1279 This option selects which basic scheme proxy_auth
1280 helpers to build and install as part of the normal
1281 build process. For a list of available
1282 helpers see the helpers/basic_auth directory.],
1283 [ case "$enableval" in
1285 for dir in $srcdir/helpers/basic_auth/*; do
1286 helper="`basename $dir`"
1287 if test -d "$dir" && test "$helper" != CVS; then
1288 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1295 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1299 if test -n "$BASIC_AUTH_HELPERS"; then
1300 for helper in $BASIC_AUTH_HELPERS; do
1301 if test -d $srcdir/helpers/basic_auth/$helper; then
1308 echo "ERROR: Basic auth helper $helper does not exists"
1312 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1314 AC_SUBST(BASIC_AUTH_HELPERS)
1316 dnl Select ntlm auth helpers to build
1318 AC_ARG_ENABLE(ntlm-auth-helpers,
1319 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1320 This option selects which proxy_auth ntlm helpers
1321 to build and install as part of the normal build
1322 process. For a list of available helpers see
1323 the helpers/ntlm_auth directory.],
1324 [ case "$enableval" in
1326 for dir in $srcdir/helpers/ntlm_auth/*; do
1327 helper="`basename $dir`"
1328 if test -d "$dir" && test "$helper" != CVS; then
1329 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1336 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1340 if test -n "$NTLM_AUTH_HELPERS"; then
1341 for helper in $NTLM_AUTH_HELPERS; do
1342 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1345 echo "ERROR: NTLM Auth helper $helper does not exists"
1349 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1351 AC_SUBST(NTLM_AUTH_HELPERS)
1353 dnl Select digest auth scheme helpers to build
1354 DIGEST_AUTH_HELPERS=
1355 AC_ARG_ENABLE(digest-auth-helpers,
1356 [ --enable-digest-auth-helpers=\"list of helpers\"
1357 This option selects which digest scheme authentication
1358 helpers to build and install as part of the normal build
1359 process. For a list of available helpers see the
1360 helpers/digest_auth directory.],
1361 [ case "$enableval" in
1363 for dir in $srcdir/helpers/digest_auth/*; do
1364 helper="`basename $dir`"
1365 if test -d "$dir" && test "$helper" != CVS; then
1366 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1373 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1377 if test -n "$DIGEST_AUTH_HELPERS"; then
1378 for helper in $DIGEST_AUTH_HELPERS; do
1379 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1382 echo "ERROR: digest auth helper $helper does not exists"
1386 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1388 AC_SUBST(DIGEST_AUTH_HELPERS)
1390 dnl Enable "NTLM fail open"
1391 AC_ARG_ENABLE(ntlm-fail-open,
1392 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1393 Authentication steps can allow squid to still authenticate
1395 [ if test "$enableval" = "yes" ; then
1396 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.])
1400 dnl Select external_acl helpers to build
1401 EXTERNAL_ACL_HELPERS=
1402 AC_ARG_ENABLE(external-acl-helpers,
1403 [ --enable-external-acl-helpers=\"list of helpers\"
1404 This option selects which external_acl helpers to
1405 build and install as part of the normal build
1406 process. For a list of available helpers see the
1407 helpers/external_acl directory.],
1408 [ case "$enableval" in
1410 for dir in $srcdir/helpers/external_acl/*; do
1411 helper="`basename $dir`"
1412 if test -d "$dir" && test "$helper" != CVS; then
1413 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1420 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1424 if test -n "$EXTERNAL_ACL_HELPERS"; then
1425 for helper in $EXTERNAL_ACL_HELPERS; do
1426 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1429 echo "ERROR: external acl helper $helper does not exists"
1433 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1435 AC_SUBST(EXTERNAL_ACL_HELPERS)
1437 dnl Disable "memPools" code
1438 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1439 AC_ARG_ENABLE(mempools,
1440 [ --disable-mempools Disable memPools. Note that this option now simply sets the
1441 default behaviour. Specific classes can override this at runtime, and
1442 only lib/MemPool.c needs to be altered to change the squid-wide
1443 default for all classes.],
1444 [ if test "$enableval" = "no" ; then
1445 echo "memPools disabled"
1446 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1450 dnl Enable WIN32 Service compile mode
1451 AC_ARG_ENABLE(win32-service,
1452 [ --enable-win32-service Compile Squid as a WIN32 Service
1453 Works only on Windows NT and Windows 2000 Platforms.],
1454 [ if test "$enableval" = "yes" ; then
1455 echo "Enabling WIN32 run service mode"
1456 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1461 dnl Check for Cyrus SASL
1462 if test "$require_sasl" = "yes"; then
1463 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1464 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1468 if test "$ac_cv_header_sasl_h" = "yes"; then
1472 echo "ERROR: Neither SASL nor SASL2 found"
1479 dnl Disable "unlinkd" code
1480 AC_ARG_ENABLE(unlinkd,
1481 [ --disable-unlinkd Do not use unlinkd],
1482 [ if test "$enableval" = "no" ; then
1488 # Here we should probably use some magic depending on the selected
1492 if test "$use_unlinkd" = "yes"; then
1493 echo "unlinkd enabled"
1494 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1495 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1497 echo "unlinkd disabled"
1498 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1501 dnl Enable backtraces on fatal errors
1502 AC_ARG_ENABLE(stacktraces,
1503 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1504 [ if test "$enableval" = "yes" ; then
1505 echo "Enabling automatic stack backtraces on fatal errors"
1506 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1510 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1511 dnl Enable USE_XPROF_STATS
1512 AC_ARG_ENABLE(cpu-profiling,
1513 [ --enable-cpu-profiling
1514 This option allows you to see which internal functions
1515 in Squid are consuming how much CPU. Compiles in probes
1516 that measure time spent in probed functions. Needs
1517 source modifications to add new probes. This is meant
1518 for developers to assist in performance optimisations
1519 of Squid internal functions.
1520 If you are not developer and not interested in the stats
1521 you shouldn't enable this, as overhead added, although
1522 small, is still overhead. See lib/Profiler.c for more.
1524 [ if test "$enableval" = "yes" ; then
1525 echo "Enabling cpu-profiling"
1526 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1527 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1531 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1532 AC_ARG_ENABLE(x_accelerator_vary,
1533 [ --enable-x-accelerator-vary
1534 Enable support for the X-Accelerator-Vary
1535 HTTP header. Can be used to indicate
1536 variance within an accelerator setup.
1537 Typically used together with other code
1538 that adds custom HTTP headers to the requests.],
1539 [ if test "$enableval" = "yes" ; then
1540 echo "Enabling support for X-Accelerator-Vary"
1541 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1545 AC_ARG_WITH(filedescriptors,
1546 [ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors],
1547 [ squid_filedescriptors_num=$withval ])
1549 # FIXME, try linking in a test program first, then if that fails try probing etc.
1550 SQUID_CPPUNIT_DIR='cppunit-1.10.0'
1551 SQUID_CPPUNIT_LA='$(top_builddir)/lib/cppunit-1.10.0/src/cppunit/libcppunit.la'
1552 SQUID_CPPUNIT_INC='-I$(top_builddir)/lib/cppunit-1.10.0/include -I $(top_srcdir)/lib/cppunit-1.10.0/include'
1553 if test -f /usr/include/cppunit/TestCase.h; then
1554 echo "using system installed cppunit"
1555 SQUID_CPPUNIT_DIR=''
1556 SQUID_CPPUNIT_LA='/usr/lib/libcppunit.la'
1557 SQUID_CPPUNIT_INC=''
1559 AC_ARG_WITH(cppunit-basedir,
1560 [ --with-cppunit-basedir=/path/to/cppunit-base
1561 Path where the cppunit headers are libraries are found
1562 for unit testing. (defaults to use internal copies -
1565 [ if test -f $withval/include/cppunit/TestCase.h; then
1566 echo "Using cppunit includes from $withval"
1567 SQUID_CPPUNIT_INC="-I${withval}/include"
1569 echo "ERROR: Cannot find cppunit at $withval"
1572 if test -f $withval/lib/libcppunit.la; then
1573 echo "Using cppunit lib from $withval"
1574 SQUID_CPPUNIT_LA="-I${withval}/lib/libcppunit.la"
1576 echo "ERROR: Cannot find cppunit at $withval"
1579 SQUID_CPPUNIT_DIR=''
1581 AC_SUBST(SQUID_CPPUNIT_LA)
1582 AC_SUBST(SQUID_CPPUNIT_INC)
1583 AC_SUBST(SQUID_CPPUNIT_DIR)
1585 # Force some compilers to use ANSI features
1589 if test "$ac_cv_prog_CC" = "cc" ; then
1590 echo "adding '-std1' to cc args for $host"
1596 if test "$ac_cv_prog_CC" = "cc" ; then
1597 echo "adding '-Ae' to cc args for $host"
1604 dnl Check for programs
1608 AC_PATH_PROG(SH, sh, /bin/sh)
1609 AC_PATH_PROG(FALSE, false, /usr/bin/false)
1610 AC_PATH_PROG(TRUE, true, /usr/bin/true)
1611 AC_PATH_PROG(RM, rm, $FALSE)
1612 AC_PATH_PROG(MV, mv, $FALSE)
1613 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
1614 AC_PATH_PROG(LN, ln, cp)
1615 AC_PATH_PROG(PERL, perl, none)
1616 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
1617 AC_PATH_PROG(AR, ar, $FALSE)
1619 if test "$ac_cv_path_PERL" = "none"; then
1620 echo "Perl is required to compile Squid"
1621 echo "Please install Perl and then re-run configure"
1627 echo "Disabling 'ranlib' for HP-UX..."
1641 dnl Check for headers
1673 netinet/ip_fil_compat.h \
1722 AC_CHECK_HEADERS(linux/netfilter_ipv4.h,,,
1723 SQUID_DEFAULT_INCLUDES
1729 AC_CHECK_HEADERS(net/if.h \
1731 netinet/ip_compat.h\
1735 resolv.h,,,SQUID_BSDNET_INCLUDES)
1740 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1741 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1743 ac_cv_have_ansi_prototypes="yes",
1744 ac_cv_have_ansi_prototypes="no")
1746 if test $ac_cv_have_ansi_prototypes = "yes" ; then
1747 AC_DEFINE(HAVE_ANSI_PROTOTYPES,1,[Define if your compiler supports prototyping])
1751 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
1754 #include <sys/time.h>
1761 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
1762 #if HAVE_SYS_TYPES_H
1763 #include <sys/types.h>
1769 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
1770 #if HAVE_SYS_TYPES_H
1771 #include <sys/types.h>
1777 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
1779 #include <sys/time.h>
1781 #if HAVE_SYS_RESOURCE_H
1782 #include <sys/resource.h>
1785 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
1786 #if HAVE_SYS_TYPES_H
1787 #include <sys/types.h>
1789 #include <netinet/in.h>
1790 #include <netinet/in_systm.h>
1791 #include <netinet/ip.h>
1792 #if defined (__linux__) || defined (__CYGWIN__)
1801 dnl Check for typedefs
1802 AC_CHECK_SIZEOF(void *)
1804 dnl 16 bit integers - int16_t and u_int16_t
1805 dnl if this is defined we trust it to be 16 bits
1806 AC_CHECK_TYPE(int16_t,
1807 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers]),
1808 ,SQUID_DEFAULT_INCLUDES)
1811 AC_CHECK_TYPE(short,[
1812 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1813 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
1814 ],,SQUID_DEFAULT_INCLUDES)
1818 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1819 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
1820 ],,SQUID_DEFAULT_INCLUDES)
1822 dnl unsigned 16 bit ints - u_int16_t
1823 dnl if this is defined we trust it to be 16 bits
1824 AC_CHECK_TYPE(u_int16_t,
1825 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers]),
1826 ,SQUID_DEFAULT_INCLUDES)
1829 dnl if this is defined we trust it to be 16 bits
1830 AC_CHECK_TYPE(uint16_t,
1831 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers]),
1832 ,SQUID_DEFAULT_INCLUDES)
1834 dnl 32 bit signed int - int32_t
1835 dnl if this is defined we trust it to be 32 bits
1836 AC_CHECK_TYPE(int32_t,
1837 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers]),
1838 ,SQUID_DEFAULT_INCLUDES)
1841 AC_CHECK_TYPE(long,[
1842 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1843 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
1844 ],,SQUID_DEFAULT_INCLUDES)
1846 dnl 32 bit unsigned int - u_int32_t
1847 dnl if this is defined we trust it to be 32 bits
1848 AC_CHECK_TYPE(u_int32_t,
1849 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers]),
1850 ,SQUID_DEFAULT_INCLUDES)
1853 dnl if this is defined we trust it to be 32 bits
1854 AC_CHECK_TYPE(uint32_t,
1855 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers]),
1856 ,SQUID_DEFAULT_INCLUDES)
1858 dnl 64 bit signed - int64_t
1859 dnl if this is defind we trust it to be 64 bits
1860 AC_CHECK_TYPE(int64_t,
1861 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers]),
1862 ,SQUID_DEFAULT_INCLUDES)
1865 dnl if this is defind we trust it to be 64 bits
1866 AC_CHECK_TYPE(__int64,
1867 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers]),
1868 ,SQUID_DEFAULT_INCLUDES)
1871 AC_CHECK_TYPE(long long,[
1872 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1873 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
1874 ],,SQUID_DEFAULT_INCLUDES)
1876 dnl 64 bit unsigned - u_int64_t
1877 dnl if this is defind we trust it to be 64 bits
1878 AC_CHECK_TYPE(u_int64_t,
1879 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers]),
1880 ,SQUID_DEFAULT_INCLUDES)
1883 dnl if this is defind we trust it to be 64 bits
1884 AC_CHECK_TYPE(uint64_t,
1885 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers]),
1886 ,SQUID_DEFAULT_INCLUDES)
1888 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
1889 dnl that is incompatible with the updated Solaris header files.
1890 dnl For this reason, we must check if pad128_t and upad128_t are defined.
1891 AC_CHECK_TYPE(pad128_t,
1892 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
1893 ,SQUID_DEFAULT_INCLUDES)
1895 AC_CHECK_TYPE(upad128_t,
1896 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
1897 ,SQUID_DEFAULT_INCLUDES)
1899 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1900 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1901 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1902 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1903 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1904 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1905 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1906 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1908 dnl Check for special functions
1911 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
1912 #include <sys/types.h>
1913 #include <sys/socket.h>
1919 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
1920 #include <sys/ipc.h>
1921 #include <sys/msg.h>])
1923 dnl Check for needed libraries
1924 AC_CHECK_LIB(nsl, main)
1925 AC_CHECK_LIB(socket, main)
1928 AC_MSG_CHECKING(for winsock)
1930 for curlib in ws2_32 wsock32; do
1931 LIBS="$LIBS -l$curlib"
1933 char __attribute__((stdcall)) socket(int,int,int);
1934 char __attribute__((stdcall)) select(int,int,int,int,int);
1935 char __attribute__((stdcall)) closesocket(int);
1936 char __attribute__((stdcall)) gethostname(int,int);
1944 have_winsock=yes, have_winsock=no)
1946 if test $have_winsock = yes; then
1947 ac_cv_func_select='yes'
1948 if test $curlib = ws2_32; then
1949 have_winsock=winsock2
1955 AC_MSG_RESULT($have_winsock)
1959 dnl Ripped from the Samba sources
1960 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
1962 #include <sys/types.h>
1965 #include <sys/socket.h>
1966 #include <sys/un.h>],
1968 struct sockaddr_un sunaddr;
1969 sunaddr.sun_family = AF_UNIX;
1971 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
1972 if test x"$squid_cv_unixsocket" = x"yes"; then
1973 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
1977 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
1978 echo "skipping libmalloc check (--enable-dlmalloc specified)"
1980 AC_CHECK_LIB(gnumalloc, main)
1981 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
1982 echo "Disabling extended malloc functions when using gnumalloc"
1983 ac_cv_func_mallinfo=no
1984 ac_cv_func_mallocblksize=no
1985 ac_cv_func_mallopt=no
1989 echo "skipping libmalloc check for $host"
1992 echo "skipping libmalloc check for $host"
1996 AC_CHECK_LIB(malloc, main)
2002 AC_CHECK_LIB(bsd, main)
2003 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2004 AC_CHECK_LIB(bind, gethostbyname)
2005 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2008 echo "skipping libresolv checks for $host"
2011 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
2012 AC_CHECK_LIB(resolv, main)
2016 AC_CHECK_LIB(m, main)
2018 dnl Check for libcrypt
2019 dnl Some of our helpers use crypt(3) which may be in libc, or in
2020 dnl libcrypt (eg FreeBSD)
2021 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2024 dnl Check for libdl, used by auth_modules/PAM
2025 if test "$with_dl" = "yes"; then
2026 AC_CHECK_LIB(dl, dlopen)
2029 dnl Check for pthreads
2030 dnl We use pthreads when doing ASYNC I/O
2031 if test "$with_pthreads" = "yes"; then
2032 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2033 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
2035 i386-unknown-freebsd*)
2036 if test "$GCC" = "yes" ; then
2037 if test -z "$PRESET_LDFLAGS"; then
2038 LDFLAGS="$LDFLAGS -pthread"
2043 if test "$GCC" = "yes" ; then
2044 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2045 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
2047 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2048 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
2052 AC_CHECK_LIB(pthread, main)
2056 dnl We use AIO in the coss store
2057 if test "$with_aio" = "yes"; then
2058 dnl On some systems POSIX AIO functions are in libaio
2059 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
2062 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2063 dnl Robert Side <rside@aiinc.bc.ca>
2064 dnl Mon, 18 Jan 1999 17:48:00 GMT
2067 AC_CHECK_LIB(intl, strftime)
2071 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2072 dnl only with Windows LDAP libraries using -lwldap32
2075 LIB_LDAP="-lwldap32"
2080 dnl LDAP helpers need to know if -llber is needed or not
2081 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2087 dnl System-specific library modifications
2091 if test "$GCC" = "yes"; then
2092 echo "Removing -O for gcc on $host"
2093 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2097 echo "Removing -lsocket for IRIX..."
2098 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2099 echo "Removing -lnsl for IRIX..."
2100 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2101 ac_cv_lib_nsl_main=no
2102 echo "Removing -lbsd for IRIX..."
2103 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2105 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2106 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2107 dnl Please change your configure script. AIX doesn't need -lbsd.
2109 echo "Removing -lbsd for AIX..."
2110 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2112 dnl From: mlaster@metavillage.com (Mike Laster)
2113 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
2114 dnl So using the internal versions generates a load of warnings
2117 echo "disabling snprintf/vsnprintf for $host"
2118 ac_cv_func_snprintf=no
2119 ac_cv_func_vsnprintf=no
2124 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2125 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2126 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2128 [*-*-solaris2.[0-4]])
2129 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2131 [*-sony-newsos[56]*])
2132 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2136 # Remove optimization for GCC 2.95.[123]
2137 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2138 if test "$GCC" = "yes"; then
2139 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2142 echo "Removing -O for gcc on $host with GCC $GCCVER"
2143 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2148 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2151 if test `uname -v` = "2.03"; then
2152 echo "disabling mallinfo for $host"
2153 ac_cv_func_mallinfo=no
2158 dnl This has to be before AC_CHECK_FUNCS
2159 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2160 # when running configure.
2161 if test -z "$ac_cv_func_poll"; then
2164 # John Kay (jkay@nlanr.net) 19970818
2165 echo "disabling poll for $host..."
2166 ac_cv_func_poll='no'
2170 echo "disabling poll for $host..."
2171 ac_cv_func_poll='no'
2174 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2175 # poll is problematic on Linux. We disable it
2176 # by default until Linux gets it right.
2177 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2178 if test $rev -lt 002002; then
2179 echo "disabling poll for $host < 2.2..."
2180 ac_cv_func_poll='no'
2183 [powerpc-ibm-aix4.1.*])
2184 # Mike Laster (mlaster@metavillage.com) 19981021
2185 echo "disabling poll for $host..."
2186 ac_cv_func_poll='no'
2189 # Robert Side <rside@aiinc.bc.ca>
2190 # Mon, 18 Jan 1999 17:48:00 GMT
2191 echo "disabling poll for $host..."
2192 ac_cv_func_poll='no'
2197 dnl Check for library functions
2199 backtrace_symbols_fd \
2226 pthread_attr_setschedparam \
2227 pthread_attr_setscope \
2228 pthread_setschedparam \
2256 dnl Magic which checks whether we are forcing a type of comm loop we
2257 dnl are actually going to (ab)use
2259 dnl Actually do the define magic now
2260 dnl mostly ripped from squid-commloops, thanks to adrian and benno
2262 if test "$ac_cv_func_kqueue" = "yes" ; then
2263 SELECT_TYPE="kqueue"
2264 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2265 elif test "$ac_cv_func_epoll" = "yes" ; then
2267 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2268 AC_CHECK_LIB(epoll, epoll_create, [EPOLL_LIBS="-lepoll"])
2269 AC_SUBST(EPOLL_LIBS)
2270 elif test "$ac_cv_func_poll" = "yes" ; then
2272 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2273 elif test "$ac_cv_func_select" = "yes" ; then
2274 SELECT_TYPE="select"
2275 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2277 echo "Eep! Can't find poll, kqueue, epoll, or select!"
2278 echo "I'll try select and hope for the best."
2279 SELECT_TYPE="select"
2280 AC_DEFINE(USE_SELECT,1)
2282 echo "Using ${SELECT_TYPE} for select loop."
2285 dnl Yay! Another Linux brokenness. Its not good enough
2286 dnl to know that setresuid() exists, because RedHat 5.0 declares
2287 dnl setresuid() but doesn't implement it.
2289 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2293 if(setresuid(-1,-1,-1)) {
2294 perror("setresuid:");
2299 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2301 if test "$ac_cv_func_setresuid" = "yes" ; then
2302 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.])
2305 AM_CONDITIONAL(NEED_OWN_SNPRINTF, false)
2306 if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then
2307 AM_CONDITIONAL(NEED_OWN_SNPRINTF, true)
2311 dnl Test for va_copy
2313 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
2316 void f (int i, ...) {
2317 va_list args1, args2;
2318 va_start (args1, i);
2319 va_copy (args2, args1);
2320 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2322 va_end (args1); va_end (args2);
2328 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
2330 if test "$ac_cv_func_va_copy" = "yes" ; then
2331 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
2335 dnl Some systems support __va_copy
2337 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
2340 void f (int i, ...) {
2341 va_list args1, args2;
2342 va_start (args1, i);
2343 __va_copy (args2, args1);
2344 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2346 va_end (args1); va_end (args2);
2352 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
2354 if test "$ac_cv_func___va_copy" = "yes" ; then
2355 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
2358 dnl IP-Filter support requires ipf header files. These aren't
2359 dnl installed by default, so we need to check for them
2360 if test "$IPF_TRANSPARENT" ; then
2361 AC_MSG_CHECKING(if IP-Filter header files are installed)
2362 # hold on to your hats...
2363 if test "$ac_cv_header_ip_compat_h" = "yes" ||
2364 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
2365 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
2366 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
2367 have_ipfilter_compat_header="yes"
2369 if test "x$have_ipfilter_compat_header" = "xyes" &&
2370 test "$ac_cv_header_ip_fil_h" = "yes" &&
2371 test "$ac_cv_header_ip_nat_h" = "yes" ; then
2372 IPF_TRANSPARENT="yes"
2373 AC_DEFINE(IPF_TRANSPARENT, 1)
2374 elif test "$have_ipfilter_compat_header" = "yes" &&
2375 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
2376 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
2377 IPF_TRANSPARENT="yes"
2378 AC_DEFINE(IPF_TRANSPARENT, 1)
2380 IPF_TRANSPARENT="no"
2381 AC_DEFINE(IPF_TRANSPARENT, 0)
2383 AC_MSG_RESULT($IPF_TRANSPARENT)
2385 if test "$IPF_TRANSPARENT" = "no" ; then
2386 echo "WARNING: Cannot find necessary IP-Filter header files"
2387 echo " Transparent Proxy support WILL NOT be enabled"
2389 elif test "$IPF_TRANSPARENT" = "yes" ; then
2390 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
2391 dnl Solaris minor version (8, 9, 10, ...)
2394 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
2395 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
2396 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
2403 dnl PF support requires a header file.
2404 if test "$PF_TRANSPARENT" ; then
2405 AC_MSG_CHECKING(if PF header file is installed)
2406 # hold on to your hats...
2407 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
2408 PF_TRANSPARENT="yes"
2409 AC_DEFINE(PF_TRANSPARENT, 1)
2412 AC_DEFINE(PF_TRANSPARENT, 0)
2414 AC_MSG_RESULT($PF_TRANSPARENT)
2416 if test "$PF_TRANSPARENT" = "no" ; then
2417 echo "WARNING: Cannot find necessary PF header file"
2418 echo " Transparent Proxy support WILL NOT be enabled"
2422 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
2423 dnl Shamelessly copied from above
2424 if test "$LINUX_NETFILTER" ; then
2425 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
2426 # hold on to your hats...
2427 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
2428 LINUX_NETFILTER="yes"
2429 AC_DEFINE(LINUX_NETFILTER, 1)
2431 LINUX_NETFILTER="no"
2432 AC_DEFINE(LINUX_NETFILTER, 0)
2434 AC_MSG_RESULT($LINUX_NETFILTER)
2436 if test "$LINUX_NETFILTER" = "no" ; then
2437 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
2438 echo " Linux Transparent Proxy support WILL NOT be enabled"
2442 if test -z "$USE_GNUREGEX" ; then
2444 *-sun-solaris2.[[0-4]])
2452 AC_MSG_CHECKING(if GNUregex needs to be compiled)
2453 if test -z "$USE_GNUREGEX"; then
2454 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
2457 AC_TRY_COMPILE([#include <sys/types.h>
2458 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
2463 AC_MSG_RESULT($USE_GNUREGEX)
2464 if test "$USE_GNUREGEX" = "yes"; then
2466 LIBREGEX="libregex.a"
2467 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
2479 dnl Not cached since people are likely to tune this
2480 AC_MSG_CHECKING(Default FD_SETSIZE value)
2489 #include <sys/time.h>
2491 #if HAVE_SYS_SELECT_H
2492 #include <sys/select.h>
2494 #if HAVE_SYS_TYPES_H
2495 #include <sys/types.h>
2498 FILE *fp = fopen("conftestval", "w");
2499 fprintf (fp, "%d\n", FD_SETSIZE);
2503 DEFAULT_FD_SETSIZE=`cat conftestval`,
2504 DEFAULT_FD_SETSIZE=256,
2505 DEFAULT_FD_SETSIZE=256)
2506 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
2507 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
2510 dnl Not cached since people are likely to tune this
2511 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
2512 dnl damn! FreeBSD's pthreads breaks dup2().
2513 if test -n "$squid_filedescriptors_num" ; then
2514 SQUID_MAXFD=$squid_filedescriptors_num
2515 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
2519 i386-unknown-freebsd*)
2520 if echo "$LDFLAGS" | grep -q pthread; then
2521 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
2527 #include <sys/time.h> /* needed on FreeBSD */
2528 #include <sys/param.h>
2529 #include <sys/resource.h>
2533 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
2534 /* getrlimit and sysconf returns bogous values on cygwin32.
2535 * Number of fds is virtually unlimited in cygwin (sys/param.h)
2536 * __CYGWIN32__ is deprecated.
2542 #if defined(RLIMIT_NOFILE)
2543 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
2544 perror("getrlimit: RLIMIT_NOFILE");
2546 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2547 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
2548 perror("setrlimit: RLIMIT_NOFILE");
2551 #elif defined(RLIMIT_OFILE)
2552 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
2553 perror("getrlimit: RLIMIT_OFILE");
2555 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2556 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
2557 perror("setrlimit: RLIMIT_OFILE");
2560 #endif /* RLIMIT_NOFILE */
2561 #endif /* HAVE_SETRLIMIT */
2562 /* by starting at 2^14, we will never get higher
2563 than 2^15 for SQUID_MAXFD */
2567 if (dup2(0, i) < 0) {
2575 #endif /* IF !DEF CYGWIN */
2576 fp = fopen("conftestval", "w");
2577 fprintf (fp, "%d\n", i & ~0x3F);
2581 SQUID_MAXFD=`cat conftestval`,
2584 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
2590 AC_MSG_RESULT($SQUID_MAXFD)
2592 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
2593 if test "$SQUID_MAXFD" -lt 512 ; then
2594 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
2595 echo " cache will be very busy. Please see the FAQ page"
2596 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
2597 echo " on how to increase your filedescriptor limit"
2602 if test `expr $SQUID_MAXFD % 64` != 0; then
2603 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
2604 echo " on certain platforms."
2608 dnl Not cached since people are likely to tune this
2609 AC_MSG_CHECKING(Default UDP send buffer size)
2613 #include <sys/types.h>
2614 #include <sys/socket.h>
2615 #include <netinet/in.h>
2619 int fd,val=0,len=sizeof(int);
2620 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2621 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2622 if (val<=0) exit(1);
2623 fp = fopen("conftestval", "w");
2624 fprintf (fp, "%d\n", val);
2628 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
2629 SQUID_DETECT_UDP_SO_SNDBUF=16384,
2630 SQUID_DETECT_UDP_SO_SNDBUF=16384)
2631 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
2632 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
2634 dnl Not cached since people are likely to tune this
2635 AC_MSG_CHECKING(Default UDP receive buffer size)
2639 #include <sys/types.h>
2640 #include <sys/socket.h>
2641 #include <netinet/in.h>
2645 int fd,val=0,len=sizeof(int);
2646 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2647 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2648 if (val <= 0) exit(1);
2649 fp = fopen("conftestval", "w");
2650 fprintf (fp, "%d\n", val);
2654 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
2655 SQUID_DETECT_UDP_SO_RCVBUF=16384,
2656 SQUID_DETECT_UDP_SO_RCVBUF=16384)
2657 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
2658 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
2660 dnl Not cached since people are likely to tune this
2661 AC_MSG_CHECKING(Default TCP send buffer size)
2665 #include <sys/types.h>
2666 #include <sys/socket.h>
2667 #include <netinet/in.h>
2671 int fd,val=0,len=sizeof(int);
2672 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2673 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2674 if (val <= 0) exit(1);
2675 fp = fopen("conftestval", "w");
2676 fprintf (fp, "%d\n", val);
2680 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
2681 SQUID_TCP_SO_SNDBUF=16384,
2682 SQUID_TCP_SO_SNDBUF=16384)
2683 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2684 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
2685 echo "Limiting send buffer size to 32K"
2686 SQUID_TCP_SO_SNDBUF=32768
2688 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
2690 dnl Not cached since people are likely to tune this
2691 AC_MSG_CHECKING(Default TCP receive buffer size)
2695 #include <sys/types.h>
2696 #include <sys/socket.h>
2697 #include <netinet/in.h>
2701 int fd,val=0,len=sizeof(int);
2702 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2703 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2704 if (val <= 0) exit(1);
2705 fp = fopen("conftestval", "w");
2706 fprintf (fp, "%d\n", val);
2710 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
2711 SQUID_TCP_SO_RCVBUF=16384,
2712 SQUID_TCP_SO_RCVBUF=16384)
2713 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2714 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
2715 echo "Limiting receive buffer size to 64K"
2716 SQUID_TCP_SO_RCVBUF=65535
2718 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
2719 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
2720 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
2721 ac_cv_needs_sys_errlist="no",
2722 ac_cv_needs_sys_errlist="yes")
2724 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
2725 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
2728 dnl Not cached since people are likely to change this
2729 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
2730 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
2732 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
2735 AC_MSG_CHECKING(if inet_ntoa() actually works)
2739 #include <sys/types.h>
2740 #include <netinet/in.h>
2741 #include <arpa/inet.h>
2746 in.s_addr = inet_addr("1.2.3.4");
2747 fp = fopen("conftestval", "w");
2748 fprintf (fp, "%s\n", inet_ntoa(in));
2752 INET_NTOA_RESULT=`cat conftestval`,
2753 INET_NTOA_RESULT="broken",
2754 INET_NTOA_RESULT="broken")
2755 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
2756 AC_MSG_RESULT("yes")
2761 echo "Using Win32 resolver instead."
2764 echo "Will use our own inet_ntoa()."
2765 AC_LIBOBJ(inet_ntoa)
2766 # echo "WARNING: This looks bad, and probably prevents Squid from working."
2767 # echo " If you're on IRIX and using GCC 2.8, you probably need"
2768 # echo " to use the IRIX C compiler instead."
2774 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
2775 AC_MSG_CHECKING(for working statvfs() interface)
2779 #include <sys/types.h>
2780 #include <sys/statvfs.h>
2784 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
2785 sfs.f_files = sfs.f_ffree = 0;
2786 statvfs("/tmp", &sfs);
2788 ac_cv_func_statvfs=yes,
2789 ac_cv_func_statvfs=no)
2790 AC_MSG_RESULT($ac_cv_func_statvfs)
2791 if test "$ac_cv_func_statvfs" = "yes" ; then
2792 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
2796 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
2798 #if HAVE_SYS_TYPES_H
2799 #include <sys/types.h>
2801 #if HAVE_NETINET_IN_H
2802 #include <netinet/in.h>
2804 #if HAVE_ARPA_INET_H
2805 #include <arpa/inet.h>
2807 #if HAVE_ARPA_NAMESER_H
2808 #include <arpa/nameser.h>
2814 [_res.nsaddr_list[[0]];],
2815 ac_cv_have_res_nsaddr_list="yes",
2816 ac_cv_have_res_nsaddr_list="no"))
2817 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
2818 AC_DEFINE(HAVE_RES_NSADDR_LIST,1,[If _res structure has nsaddr_list member])
2821 if test $ac_cv_have_res_nsaddr_list = "no" ; then
2822 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
2824 #if HAVE_SYS_TYPES_H
2825 #include <sys/types.h>
2827 #if HAVE_NETINET_IN_H
2828 #include <netinet/in.h>
2830 #if HAVE_ARPA_INET_H
2831 #include <arpa/inet.h>
2833 #if HAVE_ARPA_NAMESER_H
2834 #include <arpa/nameser.h>
2840 [_res.ns_list[[0]].addr;],
2841 ac_cv_have_res_ns_list="yes",
2842 ac_cv_have_res_ns_list="no"))
2843 if test $ac_cv_have_res_ns_list = "yes" ; then
2844 AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
2848 dnl Need the debugging version of malloc if available
2850 if test "$ac_cv_lib_malloc_main" = "yes" ; then
2851 if test -r /usr/lib/debug/malloc.o ; then
2852 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
2854 if test -r /usr/lib/debug/mallocmap.o ; then
2855 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
2861 if test -z "$XTRA_LIBS"; then
2864 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
2869 dnl Clean up after OSF/1 core dump bug
2886 test-suite/Makefile \
2889 helpers/basic_auth/Makefile \
2890 helpers/basic_auth/LDAP/Makefile \
2891 helpers/basic_auth/MSNT/Makefile \
2892 helpers/basic_auth/NCSA/Makefile \
2893 helpers/basic_auth/PAM/Makefile \
2894 helpers/basic_auth/SMB/Makefile \
2895 helpers/basic_auth/YP/Makefile \
2896 helpers/basic_auth/getpwnam/Makefile \
2897 helpers/basic_auth/multi-domain-NTLM/Makefile \
2898 helpers/basic_auth/SASL/Makefile \
2899 helpers/digest_auth/Makefile \
2900 helpers/digest_auth/password/Makefile \
2901 helpers/ntlm_auth/Makefile \
2902 helpers/ntlm_auth/fakeauth/Makefile \
2903 helpers/ntlm_auth/no_check/Makefile \
2904 helpers/ntlm_auth/SMB/Makefile \
2905 helpers/ntlm_auth/SMB/smbval/Makefile \
2906 helpers/external_acl/Makefile \
2907 helpers/external_acl/ip_user/Makefile \
2908 helpers/external_acl/ldap_group/Makefile \
2909 helpers/external_acl/unix_group/Makefile \
2910 helpers/external_acl/wbinfo_group/Makefile
2913 AC_CONFIG_SUBDIRS(lib/libTrie)
2914 AC_CONFIG_SUBDIRS(lib/cppunit-1.10.0)