2 dnl Configuration input file for Squid
4 dnl $Id: configure.in,v 1.497 2008/02/17 09:24:49 serassio Exp $
8 AC_INIT(Squid Web Proxy, 3.HEAD-BZR, http://www.squid-cache.org/bugs/, squid)
10 AM_CONFIG_HEADER(include/autoconf.h)
11 AC_CONFIG_AUX_DIR(cfgaux)
12 AC_CONFIG_SRCDIR([src/main.cc])
13 AM_INIT_AUTOMAKE([tar-ustar])
14 AC_REVISION($Revision: 1.497 $)dnl
15 AC_PREFIX_DEFAULT(/usr/local/squid)
18 PRESET_CFLAGS="$CFLAGS"
19 PRESET_LDFLAGS="$LDFLAGS"
21 dnl Set default LDFLAGS
22 if test -z "$LDFLAGS"; then
33 dnl Make location configure settings available to the code
34 dnl Pass squid data directory (icons, errors etc) base location to code files as a compiler define
35 CFLAGS="-DDEFAULT_SQUID_DATA_DIR=\\\"$datadir\\\" $CFLAGS"
36 CXXFLAGS="-DDEFAULT_SQUID_DATA_DIR=\\\"$datadir\\\" $CXXFLAGS"
37 dnl Pass squid.conf directory base location to code files as a compiler define
38 CFLAGS="-DDEFAULT_SQUID_CONFIG_DIR=\\\"$sysconfdir\\\" $CFLAGS"
39 CXXFLAGS="-DDEFAULT_SQUID_CONFIG_DIR=\\\"$sysconfdir\\\" $CXXFLAGS"
41 use_loadable_modules=1
42 AC_MSG_CHECKING(whether to use loadable modules)
43 AC_ARG_ENABLE(loadable-modules,
46 [--disable-loadable-modules],
47 [do not support loadable modules])
50 case "${enableval}" in
51 yes) use_loadable_modules=yes ;;
52 no) use_loadable_modules=no ;;
53 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
55 AC_MSG_RESULT([$use_loadable_modules, explicitly])
58 use_loadable_modules=yes;
59 AC_MSG_RESULT([$use_loadable_modules, implicitly])
63 AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
65 if test $use_loadable_modules = yes;
67 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
74 if test $use_loadable_modules = yes;
76 AC_LIBLTDL_CONVENIENCE(lib/libLtdl)
81 # Do we need these unconditionally for "make distcheck" to work?
85 if test $use_loadable_modules = yes;
87 # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
88 LIBADD_DL=${lt_cv_dlopen_libs}
97 LIBREGEX='' # libregex.a
99 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
103 if test -z "$EXEEXT"; then
106 # automake automatically adds .exe when installing binaries
111 dnl this should be expanded to a list of platform sensible support requirements.
112 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
114 mingw|mingw32|cygwin|cygwin32)
115 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
118 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
124 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
125 CFLAGS="$CFLAGS -mthreads"
126 CXXFLAGS="$CXXFLAGS -mthreads"
127 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
128 echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform"
129 echo "Please see PSAPI.DLL section on doc/win32-relnotes.html."
131 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
134 MINGW_LIBS="-lmingwex"
135 AM_CONDITIONAL(USE_IPC_WIN32, true)
139 AM_CONDITIONAL(USE_IPC_WIN32, false)
143 if test -z "$CACHE_HTTP_PORT"; then
144 CACHE_HTTP_PORT="3128"
146 if test -z "$CACHE_ICP_PORT"; then
147 CACHE_ICP_PORT="3130"
151 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
152 [What default TCP port to use for HTTP listening?])
153 AC_SUBST(CACHE_HTTP_PORT)
154 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
155 [What default UDP port to use for ICP listening?])
156 AC_SUBST(CACHE_ICP_PORT)
158 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
160 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
162 CACHE_EFFECTIVE_USER="nobody"
163 AC_ARG_WITH(default-user,
164 [ --with-default-user=USER System user account for squid permissions.
166 [ CACHE_EFFECTIVE_USER="$withval" ]
168 AC_SUBST(CACHE_EFFECTIVE_USER)
170 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
173 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
177 if test "$GCC" = "yes"; then
178 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
179 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
182 if test $GCCVER2 -lt 300 ; then
183 echo "ERROR: GCC $GCCVER causes a coredump on $host"
184 echo "ERROR: Try a more recent GCC version"
193 dnl Set Default CFLAGS
194 if test -z "$PRESET_CFLAGS"; then
195 if test "$GCC" = "yes"; then
198 # sunos has too many warnings for this to be useful
202 # Motorola cc/ld does not like -02 but is ok on -O
203 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
206 CFLAGS="-Wall $CFLAGS"
212 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
213 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
214 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
215 -Wl,-woff,85,-woff,84,-woff,134 \
216 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
217 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
218 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
219 -Wl,-woff,85,-woff,84,-woff,134 \
220 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
223 # Mogul says DEC compilers take both -g and -O2
224 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
233 dnl set squid required flags
234 if test "$GCC" = "yes"; then
235 dnl Guido Serassio (serassio@squid-cache.org) 20070811
236 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
237 dnl -Wmissing-prototypes -Wmissing-declarations
238 dnl TODO: check if the problem will be present in any other newer MinGW release.
241 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
244 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
247 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
252 AC_SUBST(SQUID_CFLAGS)
253 AC_SUBST(SQUID_CXXFLAGS)
255 AC_TEST_CHECKFORHUGEOBJECTS
256 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
259 if test -z "$PRESET_LDFLAGS"; then
260 if test "$GCC" = "yes"; then
263 # Silence Linker warnings 84, 85 and 134
264 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
279 AC_ARG_ENABLE(gnuregex,
280 [ --enable-gnuregex Compile GNUregex. Unless you have reason to use this
281 option, you should not enable it. This library file
282 is usually only required on Windows and very old
283 Unix boxes which do not have their own regex library
285 [USE_GNUREGEX=$enableval])
289 AC_ARG_ENABLE(optimizations,
290 [ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
291 Optimization is good for production builds, but not
292 good for debugging. During development, use
293 --disable-optimizations to reduce compilation times
294 and allow easier debugging. This option implicitly
295 also enabled --disable-inline],
296 [ if test "$enableval" = "no" ; then
297 echo "Disabling compiler optimizations (-O flag)"
298 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
299 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
304 AC_ARG_ENABLE(inline,
305 [ --disable-inline Don't compile trivial methods as inline. Squid
306 is coded with much of the code able to be inlined.
307 Inlining is good for production builds, but not
308 good for development. During development, use
309 --disable-inline to reduce compilation times and
310 allow incremental builds to be quick. For
311 production builds, or load tests, use
312 --enable-inline to have squid make all trivial
313 methods inlinable by the compiler.],
314 [ if test "$enableval" = "no" ; then
319 if test "$SquidInline" = "yes" ; then
320 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
321 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
323 echo "Inlining optimization disabled"
324 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
327 AC_ARG_ENABLE(debug-cbdata,
328 [ --enable-debug-cbdata Provide some debug information in cbdata],
329 [ if test "$enableval" = "yes" ; then
330 echo "cbdata debugging enabled"
331 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
335 dnl This is a developer only option.. developers know how to set defines
337 dnl AC_ARG_ENABLE(xmalloc-debug,
338 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
339 dnl [ if test "$enableval" = "yes" ; then
340 dnl echo "Malloc debugging enabled"
341 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
345 dnl This is a developer only option.. developers know how to set defines
347 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
348 dnl [ --enable-xmalloc-debug-trace
349 dnl Detailed trace of memory allocations],
350 dnl [ if test "$enableval" = "yes" ; then
351 dnl echo "Malloc debug trace enabled"
352 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
353 dnl AC_DEFINE(XMALLOC_DEBUG,1)
357 AC_ARG_ENABLE(xmalloc-statistics,
358 [ --enable-xmalloc-statistics
359 Show malloc statistics in status page],
360 [ if test "$enableval" = "yes" ; then
361 echo "Malloc statistics enabled"
362 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
366 AC_ARG_ENABLE(async-io,
367 [ --enable-async-io[=N_THREADS]
369 --with-aufs-threads=N_THREADS
371 --enable-storeio=ufs,aufs],
375 STORE_MODULES="ufs aufs"
380 aufs_io_threads=$enableval
382 STORE_MODULES="ufs aufs"
387 AC_ARG_WITH(aufs-threads,
388 [ --with-aufs-threads=N_THREADS
389 Tune the number of worker threads for the aufs object
393 aufs_io_threads=$withval
396 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
400 if test "$aufs_io_threads"; then
401 echo "With $aufs_io_threads aufs threads"
402 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
403 [Defines how many threads aufs uses for I/O])
406 AC_ARG_WITH(pthreads,
407 [ --with-pthreads Use POSIX Threads])
408 if test "$with_pthreads" = "yes"; then
413 [ --with-aio Use POSIX AIO])
414 if test "$with_aio" = "yes"; then
419 [ --with-dl Use dynamic linking])
420 if test "$with_dl" = "yes"; then
424 AC_ARG_ENABLE(storeio,
425 [ --enable-storeio=\"list of modules\"
426 Build support for the list of store I/O modules.
427 The default is only to build the "ufs" module.
428 See src/fs for a list of available modules, or
429 Programmers Guide section <not yet written>
430 for details on how to build your custom store module],
433 for dir in $srcdir/src/fs/*; do
434 module="`basename $dir`"
435 if test -d "$dir" && test "$module" != CVS; then
436 STORE_MODULES="$STORE_MODULES $module"
443 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
447 [ if test -z "$STORE_MODULES"; then
451 if test -n "$STORE_MODULES"; then
452 for module in $STORE_MODULES; do
453 if test -d $srcdir/src/fs/$module; then
456 AC_MSG_ERROR(storeio $module does not exist)
459 echo "Store modules built: $STORE_MODULES"
461 for module in $STORE_MODULES; do
462 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
465 dnl remove all but diskd - its the only module that needs to recurse
466 dnl into the sub directory
474 for fs in $STORE_MODULES none; do
479 NEED_DISKDAEMON="true"
484 NEED_DISKTHREADS="true"
489 dnl Automake om MinGW needs explicit exe extension
490 dnl for STORE_TESTS substition
492 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
496 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
501 dnl We have 'fake' modules - aufs and diskd - legacy.
502 for fs in $STORE_MODULES; do
507 STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
508 STORE_LIBS="$STORE_LIBS lib${fs}.a"
513 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
514 echo "adding UFS, as it contains core logic for diskd and aufs"
515 STORE_OBJS="$STORE_OBJS fs/libufs.a"
516 STORE_LIBS="$STORE_LIBS libufs.a"
517 STORE_MODULES="$STORE_MODULES ufs"
518 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
520 dnl Automake om MinGW needs explicit exe extension
521 dnl for STORE_TESTS substition
523 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
528 AC_SUBST(STORE_LINKOBJS)
529 AC_SUBST(STORE_TESTS)
531 AC_ARG_ENABLE(disk-io,
532 [ --enable-disk-io=\"list of modules\"
533 Build support for the list of disk I/O modules.
534 The default is only to build the "Blocking" module.
535 See src/DiskIO for a list of available modules, or
536 Programmers Guide section <not yet written>
537 for details on how to build your custom disk module],
540 for dir in $srcdir/src/DiskIO/*; do
541 module="`basename $dir`"
542 if test -d "$dir" && test "$module" != CVS; then
543 DISK_MODULES="$DISK_MODULES $module"
550 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
554 [ if test -z "$DISK_MODULES"; then
555 DISK_MODULES="Blocking"
558 if test -n "$DISK_MODULES"; then
559 for module in $DISK_MODULES; do
560 if test -d $srcdir/src/DiskIO/$module; then
563 AC_MSG_ERROR(disk-io $module does not exist)
566 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
568 for module in $DISK_MODULES; do
569 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
572 for fs in $DISK_MODULES none; do
575 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
576 FOUND_DISKDAEMON="true"
579 FOUND_DISKTHREADS="true"
585 FOUND_BLOCKING="true"
589 if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
590 echo "adding Blocking, as it is used by an active, legacy Store Module"
591 DISK_LIBS="$DISK_LIBS libBlocking.a"
592 DISK_MODULES="$DISK_MODULES Blocking"
593 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
596 if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
597 echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
598 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
599 DISK_MODULES="$DISK_MODULES DiskDaemon"
600 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
601 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
604 if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
605 echo "adding DiskThreads, as it is used by an active, legacy Store Module"
606 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
607 DISK_MODULES="$DISK_MODULES DiskThreads"
608 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
611 if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
612 echo "adding AIO, as it is used by an active, legacy Store Module"
613 DISK_LIBS="$DISK_LIBS libAIO.a"
614 DISK_MODULES="$DISK_MODULES AIO"
615 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
617 echo "IO Modules built: $DISK_MODULES"
620 dnl we know what is being built. now add dependencies.
621 for fs in $DISK_MODULES none; do
624 if test -z "$with_pthreads"; then
628 echo "DiskThreads IO Module used, Windows threads support automatically enabled"
631 echo "DiskThreads IO Module used, pthreads support automatically enabled"
638 if test -z "$with_aio"; then
642 echo "Aio IO Module used, Windows overlapped I/O support automatically enabled"
645 echo "Aio IO Module used, aio support automatically enabled"
655 AC_SUBST(DISK_PROGRAMS)
656 AC_SUBST(DISK_LINKOBJS)
657 AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
658 AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
660 AC_ARG_ENABLE(removal-policies,
661 [ --enable-removal-policies=\"list of policies\"
662 Build support for the list of removal policies.
663 The default is only to build the "lru" module.
664 See src/repl for a list of available modules, or
665 Programmers Guide section 9.9 for details on how
666 to build your custom policy],
669 for dir in $srcdir/src/repl/*; do
670 module="`basename $dir`"
671 if test -d "$dir" && test "$module" != CVS; then
672 REPL_POLICIES="$REPL_POLICIES $module"
679 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
683 [ if test -z "$REPL_POLICIES"; then
687 if test -n "$REPL_POLICIES"; then
688 for module in $REPL_POLICIES; do
689 if test -d $srcdir/src/repl/$module; then
692 AC_MSG_ERROR(Removal policy $module does not exist)
695 echo "Removal policies built: $REPL_POLICIES"
696 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
697 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
699 AC_SUBST(REPL_POLICIES)
703 AM_CONDITIONAL(ENABLE_PINGER, false)
705 [ --enable-icmp Enable ICMP pinging],
706 [ if test "$enableval" = "yes" ; then
708 AC_DEFINE(USE_ICMP,1,
709 [ Defined this to use Squid's ICMP features (highly recommended!)
710 When USE_ICMP is defined, Squid will send ICMP pings to origin server sites.])
711 AM_CONDITIONAL(ENABLE_PINGER, true)
715 AM_CONDITIONAL(USE_DELAY_POOLS, false)
716 AC_ARG_ENABLE(delay-pools,
717 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
718 [ if test "$enableval" = "yes" ; then
719 echo "Delay pools enabled"
720 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
721 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
725 dnl disable generic/common adaptation support by default
728 AM_CONDITIONAL(USE_ESI, false)
730 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.]),
731 use_esi=$enableval, use_esi=no)
732 if test "$use_esi" = "yes" ; then
733 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
734 AM_CONDITIONAL(USE_ESI, true)
735 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
737 AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
740 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
741 AC_ARG_ENABLE(icap-client,
742 AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
743 use_icap_client=$enableval, use_icap_client=no)
744 if test "$use_icap_client" = "yes" ; then
745 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
746 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
747 ICAP_LIBS="ICAP/libicap.la"
750 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
756 AC_MSG_CHECKING(whether to support eCAP)
761 [support loadable content adaptation modules])
764 case "${enableval}" in
767 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
769 AC_MSG_RESULT([$use_ecap, explicitly])
773 AC_MSG_RESULT([$use_ecap, implicitly])
777 dnl Perform configuration consistency checks for eCAP
778 if test $use_ecap = yes;
780 dnl eCAP support requires loadable modules, which are enabled by default
781 if test "$use_loadable_modules" != "yes"
784 eCAP support requires loadable modules. Please do not use
785 --disable-loadable-modules with --enable-ecap.]);
789 AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
790 if test $use_ecap = yes;
792 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
793 ECAP_LIBS="eCAP/libeCAP.la"
796 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
802 dnl enable adaptation if requested by specific adaptation mechanisms
803 AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
804 if test $use_adaptation = yes
806 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
807 ADAPTATION_LIBS="adaptation/libadaptation.la"
809 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
812 AC_SUBST(ADAPTATION_LIBS)
815 dnl This is a developer only option. Developers know how to set defines
817 dnl AC_ARG_ENABLE(mem-gen-trace,
818 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
819 dnl [ if test "$enableval" = "yes" ; then
820 dnl echo "Memory trace (to file) enabled"
821 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
825 AC_ARG_ENABLE(useragent-log,
826 [ --enable-useragent-log Enable logging of User-Agent header],
827 [ if test "$enableval" = "yes" ; then
828 echo "User-Agent logging enabled"
829 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
830 By default, they are written to useragent.log in the Squid log
835 AC_ARG_ENABLE(referer-log,
836 [ --enable-referer-log Enable logging of Referer header],
837 [ if test "$enableval" = "yes" ; then
838 echo "Referer logging enabled"
839 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
840 By default, they are written to referer.log in the Squid log
847 [ --disable-wccp Disable Web Cache Coordination Protocol],
848 [ if test "$enableval" = "no" ; then
849 echo "Web Cache Coordination Protocol disabled"
853 if test $USE_WCCP = 1; then
854 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
858 AC_ARG_ENABLE(wccpv2,
859 [ --disable-wccpv2 Disable Web Cache Coordination V2 Protocol],
860 [ if test "$enableval" = "no" ; then
861 echo "Web Cache Coordination V2 Protocol disabled"
865 if test $USE_WCCPv2 = 1; then
866 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
869 AC_ARG_ENABLE(kill-parent-hack,
870 [ --enable-kill-parent-hack
871 Kill parent on shutdown],
872 [ if test "$enableval" = "yes" ; then
873 echo "Kill parent on shutdown"
874 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
875 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
882 [ --disable-snmp Disable SNMP monitoring support],
883 [ if test "$enableval" = "no" ; then
884 echo "SNMP monitoring disabled"
888 if test x"$USE_SNMP" = xtrue; then
889 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
890 SNMPLIB='../snmplib/libsnmp.a'
893 AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
895 AC_SUBST(makesnmplib)
897 AC_ARG_ENABLE(cachemgr-hostname,
898 [ --enable-cachemgr-hostname[=hostname]
899 Make cachemgr.cgi default to this host],
902 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
903 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
904 echo "Cachemgr default hostname == host where cachemgr runs"
910 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
911 echo "Cachemgr default hostname set to ${enableval}"
916 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
917 AC_ARG_ENABLE(arp-acl,
918 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
919 [ if test "$enableval" = "yes" ; then
920 echo "ARP ACL lists enabled (ether address)"
933 LIBS="$LIBS -liphlpapi"
936 LIBS="$LIBS -liphlpapi"
939 echo "WARNING: ARP ACL support probably won't work on $host."
943 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, ?).])
944 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
949 AM_CONDITIONAL(ENABLE_HTCP, false)
951 [ --disable-htcp Disable HTCP protocol support],
952 [ if test "$enableval" = "no" ; then
953 echo "HTCP support disabled"
956 if test x$USE_HTCP = xtrue; then
957 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
959 AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
961 dnl SSL is not enabled by default.
962 AM_CONDITIONAL(ENABLE_SSL, false)
964 dnl Default is to use OpenSSL when available
966 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
967 [ if test "$enableval" != "no"; then
968 echo "SSL gatewaying using OpenSSL enabled"
969 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
970 AM_CONDITIONAL(ENABLE_SSL, true)
973 dnl Native Windows port of OpenSSL needs -lgdi32
974 SSLLIB='-lssleay32 -leay32 -lgdi32'
977 SSLLIB='-lssl -lcrypto'
984 dnl User may specify OpenSSL is needed from a non-standard location
986 [ --with-openssl[=prefix]
987 Compile with the OpenSSL libraries. The path to
988 the OpenSSL development libraries and headers
989 installation can be specified if outside of the
990 system standard directories],
992 case "$with_openssl" in
1000 SSLLIBDIR="$with_openssl/lib"
1001 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1005 if test -n "$USE_OPENSSL"; then
1006 echo "Using OpenSSL MD5 implementation"
1007 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)])
1008 if test -z "$SSLLIB"; then
1009 SSLLIB="-lcrypto" # for MD5 routines
1011 dnl This is a workaround for RedHat 9 brain damage..
1012 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
1013 echo "OpenSSL depends on Kerberos"
1014 SSLLIBDIR="/usr/kerberos/lib"
1015 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1018 if test -n "$SSLLIBDIR"; then
1019 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1024 AC_ARG_ENABLE(forw-via-db,
1025 [ --enable-forw-via-db Enable Forw/Via database],
1026 [ if test "$enableval" = "yes" ; then
1027 echo "FORW-VIA enabled"
1028 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
1032 AC_ARG_ENABLE(cache-digests,
1033 [ --enable-cache-digests Use Cache Digests
1034 see http://www.squid-cache.org/FAQ/FAQ-16.html],
1035 [ if test "$enableval" = "yes" ; then
1036 echo "USE_CACHE_DIGESTS enabled"
1037 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
1041 dnl Size of COSS memory buffer
1042 AC_ARG_WITH(coss-membuf-size,
1043 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
1044 [ if test -n "$withval" -a "x$withval" != "xno" ; then
1045 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
1046 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
1050 dnl check for netio plugin stuff
1055 [ --disable-poll Disable poll() support. ],
1058 case "$enableval" in
1060 echo "Forcing poll() to be enabled"
1064 echo "Forcing poll() to be disabled"
1072 AC_ARG_ENABLE(select,
1073 [ --disable-select Disable select() support. ],
1076 case "$enableval" in
1078 echo "Forcing select() to be enabled"
1079 SELECT_TYPE="select"
1082 echo "Forcing select() to be disabled"
1089 dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1091 AC_ARG_ENABLE(kqueue,
1092 [ --enable-kqueue Enable kqueue() support (experimental).],
1095 case "$enableval" in
1097 echo "Forcing kqueue() to be enabled"
1098 SELECT_TYPE="kqueue"
1101 echo "Forcing kqueue() to be disabled"
1109 AC_ARG_ENABLE(epoll,
1110 [ --disable-epoll Disable Linux epoll() support.],
1113 case "$enableval" in
1115 echo "Forcing epoll() to be enabled"
1119 echo "Forcing epoll() to be disabled"
1126 dnl Disable HTTP violations
1128 AC_ARG_ENABLE(http-violations,
1129 [ --disable-http-violations
1130 This allows you to remove code which is known to
1131 violate the HTTP protocol specification.],
1132 [ if test "$enableval" = "no" ; then
1133 echo "Disabling HTTP Violations"
1137 if test $http_violations = 1; then
1138 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.])
1140 AC_DEFINE(HTTP_VIOLATIONS, 0)
1143 dnl Enable IPFW Transparent Proxy
1144 AC_ARG_ENABLE(ipfw-transparent,
1145 [ --enable-ipfw-transparent
1146 Enable Transparent Proxy support for systems
1147 using FreeBSD IPFW style redirection.],
1148 [ if test "$enableval" = "yes" ; then
1149 echo "IPFW Transparent Proxy enabled"
1150 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1151 IPFW_TRANSPARENT="yes"
1153 AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1157 dnl Enable IP-Filter Transparent Proxy
1158 AC_ARG_ENABLE(ipf-transparent,
1159 [ --enable-ipf-transparent
1160 Enable Transparent Proxy support for systems
1161 using IP-Filter network address redirection.],
1162 [ if test "$enableval" = "yes" ; then
1163 echo "IP-Filter Transparent Proxy enabled"
1164 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.])
1165 IPF_TRANSPARENT="yes"
1167 AC_DEFINE(IPF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.])
1171 dnl Enable PF Transparent Proxy
1172 AC_ARG_ENABLE(pf-transparent,
1173 [ --enable-pf-transparent
1174 Enable Transparent Proxy support for systems
1175 using PF network address redirection.],
1176 [ if test "$enableval" = "yes" ; then
1177 echo "PF Transparent Proxy enabled"
1178 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1179 PF_TRANSPARENT="yes"
1181 AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1185 dnl Enable Linux Netfilter Transparent Proxy
1186 AC_ARG_ENABLE(linux-netfilter,
1187 [ --enable-linux-netfilter
1188 Enable Transparent Proxy support for Linux (Netfilter) systems.],
1189 [ if test "$enableval" = "yes" ; then
1190 echo "Linux (Netfilter) Transparent Proxy enabled"
1191 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1192 LINUX_NETFILTER="yes"
1194 AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1198 dnl Enable Large file support
1202 AC_ARG_WITH(large-files,
1203 [ --with-large-files Enable support for large files (logs etc).],
1204 [ if test "x$withval" = "xyes"; then
1209 dnl UNIX Build environment
1210 AC_ARG_WITH(build-environment,
1211 [ --with-build-environment=model
1212 The build environment to use. Normally one of
1213 POSIX_V6_ILP32_OFF32 32 bits
1214 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1215 POSIX_V6_LP64_OFF64 64 bits
1216 POSIX_V6_LPBIG_OFFBIG large pointers and files
1217 XBS5_ILP32_OFF32 32 bits (legacy)
1218 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1219 XBS5_LP64_OFF64 64 bits (legacy)
1220 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1221 default The default for your OS],
1222 [ case "$withval" in
1224 echo "--with-build-environment expects a build environment string as used by getconf"
1228 buildmodel="$withval"
1233 if test $needlargefiles && test -z "$buildmodel"; then
1234 for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do
1235 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1240 if test -z "$buildmodel"; then
1241 echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
1245 case "$buildmodel" in
1247 if test "$needlargefiles"; then
1248 echo "Enabling -D_FILE_OFFSET_BITS=64"
1249 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1250 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1254 echo "Using $buildmodel build environment"
1255 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1258 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
1260 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1261 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1262 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1263 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1266 dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1267 dnl for LDFLAGS -xarch=generic64, but:
1268 dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1269 dnl For gcc "-xarch=generic64" must be replaced with "-m64"
1270 dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1272 if test "$GCC" = "yes"; then
1273 echo "Removing -Xa for gcc on $host"
1274 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1275 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1276 echo "Replacing -xarch=generic64 with -m64 for gcc on $host"
1277 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1278 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1280 echo "Removing -Usun on $host"
1281 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1282 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1285 dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1286 dnl so we must adjust something to avoid gcc errors.
1287 dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1288 dnl remove "-n32" from LDFLAGS
1289 dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1290 dnl "-64" from LDFLAGS
1292 if test "$GCC" = "yes"; then
1293 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1294 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1295 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1296 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1297 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1298 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1307 dnl Enable Linux transparent proxy support for obsolete TPROXY
1308 AC_ARG_ENABLE(linux-tproxy,
1309 [ --enable-linux-tproxy
1310 Enable real Transparent Proxy support for Netfilter TPROXY (version 2).],
1311 [ if test "$enableval" = "yes" ; then
1312 echo "Linux Netfilter/TPROXY v2 enabled"
1313 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1315 if test -z "$LINUX_NETFILTER"; then
1316 echo "Linux-Netfilter Transparent Proxy automatically enabled"
1317 LINUX_NETFILTER="yes"
1320 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1324 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1325 dnl Enable Leak Finding Functions
1326 AC_ARG_ENABLE(leakfinder,
1327 [ --enable-leakfinder
1328 Enable Leak Finding code. Enabling this alone
1329 does nothing; you also have to modify the source
1330 code to use the leak finding functions. Probably
1331 Useful for hackers only.],
1332 [ if test "$enableval" = "yes" ; then
1333 echo "Leak-Finding enabled"
1334 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1335 USE_LEAKFINDER="yes"
1336 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1341 AC_ARG_ENABLE(follow-x-forwarded-for,
1342 [ --enable-follow-x-forwarded-for
1343 Enable support for following the X-Forwarded-For
1344 HTTP header to try to find the IP address of the
1345 original or indirect client when a request has
1346 been forwarded through other proxies.],
1347 [ if test "$enableval" = "yes" ; then
1348 echo "follow X-Forwarded-For enabled"
1352 if test $follow_xff = 1; then
1353 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1355 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1359 AC_ARG_ENABLE(ident-lookups,
1360 [ --disable-ident-lookups
1361 This allows you to remove code that performs
1362 Ident (RFC 931) lookups.],
1363 [ if test "$enableval" = "no" ; then
1364 echo "Disabling Ident Lookups"
1368 if test $use_ident = 1; then
1369 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1370 AM_CONDITIONAL(ENABLE_IDENT, true)
1372 AC_DEFINE(USE_IDENT, 0)
1373 AM_CONDITIONAL(ENABLE_IDENT, false)
1376 AM_CONDITIONAL(USE_DNSSERVER, false)
1378 AC_ARG_ENABLE(internal-dns,
1379 [ --disable-internal-dns This prevents Squid from directly sending and
1380 receiving DNS messages, and instead enables the
1381 old external 'dnsserver' processes.],
1382 [ if test "$enableval" = "no" ; then
1383 echo "Disabling Internal DNS queries"
1387 if test "$use_dnsserver" = "yes"; then
1388 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1389 AM_CONDITIONAL(USE_DNSSERVER, true)
1392 dnl Select Default hosts file location
1393 AC_ARG_ENABLE(default-hostsfile,
1394 [ --enable-default-hostsfile=path
1395 Select default location for hosts file.
1396 See hosts_file directive in squid.conf for details],
1398 if test "$enableval" != "none" ; then
1399 if test -f $enableval; then
1400 OPT_DEFAULT_HOSTS=$enableval
1402 echo "Warning Unable to find $enableval"
1406 OPT_DEFAULT_HOSTS="none"
1408 echo "Default hosts file set to: $enableval"
1409 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1410 AC_SUBST(OPT_DEFAULT_HOSTS)
1412 dnl Select auth schemes modules to build
1414 [ --enable-auth=\"list of auth scheme modules\"
1415 Build support for the list of authentication schemes.
1416 The default is to build support for the Basic scheme.
1417 See src/auth for a list of available modules, or
1418 Programmers Guide section authentication schemes
1419 for details on how to build your custom auth scheme
1421 [ case $enableval in
1423 for dir in $srcdir/src/auth/*; do
1424 module="`basename $dir`"
1425 if test -d "$dir" && test "$module" != CVS; then
1426 AUTH_MODULES="$AUTH_MODULES $module"
1433 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1437 [ if test -z "$AUTH_MODULES"; then
1438 AUTH_MODULES="ntlm basic digest negotiate"
1441 if test -n "$AUTH_MODULES"; then
1442 for module in $AUTH_MODULES; do
1443 if test -d $srcdir/src/auth/$module; then
1446 AC_MSG_ERROR(Auth scheme $module does not exist)
1448 eval AUTH_MODULE_${module}=yes
1450 echo "Auth scheme modules built: $AUTH_MODULES"
1451 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1452 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1454 echo "Auth scheme modules built: None"
1457 for module in $AUTH_MODULES; do
1458 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1460 AC_SUBST(AUTH_MODULES)
1462 AC_SUBST(AUTH_LINKOBJS)
1465 dnl Select basic auth scheme helpers to build
1466 if test -n "$AUTH_MODULE_basic"; then
1467 BASIC_AUTH_HELPERS="all"
1469 AC_ARG_ENABLE(basic-auth-helpers,
1470 [ --enable-basic-auth-helpers=\"list of helpers\"
1471 This option selects which basic scheme proxy_auth
1472 helpers to build and install as part of the normal
1473 build process. For a list of available
1474 helpers see the helpers/basic_auth directory.],
1475 [ case "$enableval" in
1477 BASIC_AUTH_HELPERS="all"
1480 BASIC_AUTH_HELPERS=""
1483 if test -z "$AUTH_MODULE_basic"; then
1484 echo "WARNING: Basic auth helpers selected without the basic scheme enabled"
1487 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1491 if test "$BASIC_AUTH_HELPERS" = "all" ; then
1492 BASIC_AUTH_HELPERS=""
1493 for dir in $srcdir/helpers/basic_auth/*; do
1494 helper="`basename $dir`"
1495 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1496 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1500 if test -n "$BASIC_AUTH_HELPERS"; then
1501 for helper in $BASIC_AUTH_HELPERS; do
1502 if test -d $srcdir/helpers/basic_auth/$helper; then
1509 AC_MSG_ERROR(Basic auth helper $helper does not exist)
1512 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1514 AC_SUBST(BASIC_AUTH_HELPERS)
1516 dnl Select ntlm auth helpers to build
1517 if test -n "$AUTH_MODULE_ntlm"; then
1518 NTLM_AUTH_HELPERS="all"
1520 AC_ARG_ENABLE(ntlm-auth-helpers,
1521 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1522 This option selects which proxy_auth ntlm helpers
1523 to build and install as part of the normal build
1524 process. For a list of available helpers see
1525 the helpers/ntlm_auth directory.],
1526 [ case "$enableval" in
1528 NTLM_AUTH_HELPERS="all"
1531 NTLM_AUTH_HELPERS=""
1534 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1538 if test "$NTLM_AUTH_HELPERS" = "all" ; then
1539 NTLM_AUTH_HELPERS=""
1540 for dir in $srcdir/helpers/ntlm_auth/*; do
1541 helper="`basename $dir`"
1542 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1543 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1547 if test -n "$NTLM_AUTH_HELPERS"; then
1548 for helper in $NTLM_AUTH_HELPERS; do
1549 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1552 AC_MSG_ERROR(NTLM Auth helper $helper does not exist)
1555 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1557 AC_SUBST(NTLM_AUTH_HELPERS)
1559 dnl Select negotiate auth helpers to build
1560 if test -n "$AUTH_MODULE_negotiate"; then
1561 NEGOTIATE_AUTH_HELPERS="all"
1563 AC_ARG_ENABLE(negotiate-auth-helpers,
1564 [ --enable-negotiate-auth-helpers=\"list of helpers\"
1565 This option selects which proxy_auth negotiate helpers
1566 to build and install as part of the normal build
1567 process. For a list of available helpers see
1568 the helpers/negotiate_auth directory.],
1569 [ case "$enableval" in
1571 NEGOTIATE_AUTH_HELPERS="all"
1574 NEGOTIATE_AUTH_HELPERS=""
1577 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1581 if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1582 NEGOTIATE_AUTH_HELPERS=""
1583 for dir in $srcdir/helpers/negotiate_auth/*; do
1584 helper="`basename $dir`"
1585 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1586 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1590 if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1591 for helper in $NEGOTIATE_AUTH_HELPERS; do
1592 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1595 AC_MSG_ERROR(Negotiate Auth helper $helper does not exist)
1598 echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
1600 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1602 dnl Select digest auth scheme helpers to build
1603 if test -n "$AUTH_MODULE_digest"; then
1604 DIGEST_AUTH_HELPERS=all
1606 AC_ARG_ENABLE(digest-auth-helpers,
1607 [ --enable-digest-auth-helpers=\"list of helpers\"
1608 This option selects which digest scheme authentication
1609 helpers to build and install as part of the normal build
1610 process. For a list of available helpers see the
1611 helpers/digest_auth directory.],
1612 [ case "$enableval" in
1614 DIGEST_AUTH_HELPERS="all"
1617 DIGEST_AUTH_HELPERS=""
1620 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1624 if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1625 DIGEST_AUTH_HELPERS=""
1626 for dir in $srcdir/helpers/digest_auth/*; do
1627 helper="`basename $dir`"
1628 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1629 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1633 if test -n "$DIGEST_AUTH_HELPERS"; then
1634 for helper in $DIGEST_AUTH_HELPERS; do
1635 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1638 AC_MSG_ERROR(digest auth helper $helper does not exist)
1641 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1643 AC_SUBST(DIGEST_AUTH_HELPERS)
1645 dnl Enable "NTLM fail open"
1646 AC_ARG_ENABLE(ntlm-fail-open,
1647 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1648 Authentication steps can allow squid to still authenticate
1650 [ if test "$enableval" = "yes" ; then
1651 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.])
1655 dnl Select external_acl helpers to build
1656 EXTERNAL_ACL_HELPERS=all
1657 AC_ARG_ENABLE(external-acl-helpers,
1658 [ --enable-external-acl-helpers=\"list of helpers\"
1659 This option selects which external_acl helpers to
1660 build and install as part of the normal build
1661 process. For a list of available helpers see the
1662 helpers/external_acl directory.],
1663 [ case "$enableval" in
1665 EXTERNAL_ACL_HELPERS=all
1668 EXTERNAL_ACL_HELPERS=""
1671 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1675 if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
1676 EXTERNAL_ACL_HELPERS=""
1677 for dir in $srcdir/helpers/external_acl/*; do
1678 helper="`basename $dir`"
1679 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1680 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1684 if test -n "$EXTERNAL_ACL_HELPERS"; then
1685 for helper in $EXTERNAL_ACL_HELPERS; do
1686 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1689 AC_MSG_ERROR(external acl helper $helper does not exist)
1692 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1694 AC_SUBST(EXTERNAL_ACL_HELPERS)
1696 AC_ARG_WITH(valgrind-debug,
1697 [ --with-valgrind-debug Include debug instrumentation for use with valgrind],
1706 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1710 if test $valgrind; then
1711 AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
1712 echo "Valgrind debug support enabled"
1716 dnl Disable "memPools" code
1717 AC_ARG_ENABLE(mempools,
1718 [ --disable-mempools Disable memPools. Note that this option now simply sets the
1719 default behaviour. Specific classes can override this at runtime, and
1720 only lib/MemPool.c needs to be altered to change the squid-wide
1721 default for all classes.],
1722 [ if test "$enableval" = "no" ; then
1723 echo "memPools disabled"
1724 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1726 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1729 [ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1732 dnl Enable WIN32 Service compile mode
1733 AC_ARG_ENABLE(win32-service,
1734 [ --enable-win32-service Compile Squid as a WIN32 Service
1735 Works only on Windows NT and Windows 2000 Platforms.],
1736 [ if test "$enableval" = "yes" ; then
1737 echo "Enabling WIN32 run service mode"
1738 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1743 dnl Check for Cyrus SASL
1744 if test "$require_sasl" = "yes"; then
1745 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1746 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1750 if test "$ac_cv_header_sasl_h" = "yes"; then
1754 AC_MSG_ERROR(Neither SASL nor SASL2 found)
1760 dnl Disable "unlinkd" code
1761 AC_ARG_ENABLE(unlinkd,
1762 [ --disable-unlinkd Do not use unlinkd],
1763 [ if test "$enableval" = "no" ; then
1769 # Here we should probably use some magic depending on the selected
1773 if test "$use_unlinkd" = "yes"; then
1774 echo "unlinkd enabled"
1775 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1776 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1778 echo "unlinkd disabled"
1779 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1782 dnl Enable backtraces on fatal errors
1783 AC_ARG_ENABLE(stacktraces,
1784 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1785 [ if test "$enableval" = "yes" ; then
1786 echo "Enabling automatic stack backtraces on fatal errors"
1787 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1791 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1792 dnl Enable USE_XPROF_STATS
1793 AC_ARG_ENABLE(cpu-profiling,
1794 [ --enable-cpu-profiling
1795 This option allows you to see which internal functions
1796 in Squid are consuming how much CPU. Compiles in probes
1797 that measure time spent in probed functions. Needs
1798 source modifications to add new probes. This is meant
1799 for developers to assist in performance optimisations
1800 of Squid internal functions.
1801 If you are not developer and not interested in the stats
1802 you shouldn't enable this, as overhead added, although
1803 small, is still overhead. See lib/Profiler.c for more.
1805 [ if test "$enableval" = "yes" ; then
1806 echo "Enabling cpu-profiling"
1807 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1808 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1812 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1813 AC_ARG_ENABLE(x_accelerator_vary,
1814 [ --enable-x-accelerator-vary
1815 Enable support for the X-Accelerator-Vary
1816 HTTP header. Can be used to indicate
1817 variance within an accelerator setup.
1818 Typically used together with other code
1819 that adds custom HTTP headers to the requests.],
1820 [ if test "$enableval" = "yes" ; then
1821 echo "Enabling support for X-Accelerator-Vary"
1822 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1826 dnl Enable IPv6 support
1827 AC_MSG_CHECKING([whether to enable IPv6])
1830 [ --enable-ipv6 Enable ipv6 support],
1831 [ AC_MSG_RESULT(yes)
1832 AC_CACHE_CHECK([if PF_INET6 is available], $enableval,
1834 [ /* PF_INET6 available check */
1835 # include <sys/types.h>
1836 # include <sys/socket.h>
1838 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
1844 [ AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
1848 [ AC_DEFINE(USE_IPV6,0,[0 == Disable support for IPv6])
1849 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
1850 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
1851 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
1856 [ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6])
1857 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
1858 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
1859 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
1863 if test "$use_ipng" = "yes"; then
1865 dnl Check for Windows XP option
1866 AC_MSG_CHECKING([for IPv6 split-stack requirement])
1867 AC_ARG_WITH(ipv6-split-stack,
1868 [ --with-ipv6-split-stack Require IPv6 split-stack support. Requires IPv6 Support.],
1869 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(yes)],
1870 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(no)]
1873 dnl Check for IPv6 Windows Vista option
1874 dnl Also useful for other OS
1875 AC_MSG_CHECKING([for IPv6 v4-mapping requirement])
1876 AC_ARG_WITH(ipv4-mapped,
1877 [ --with-ipv4-mapped Hybrid-Stack OS require Squid to do any v4-mapping. Requires IPv6 Support.],
1878 [AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets]) AC_MSG_RESULT(yes)],
1879 [AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets]) AC_MSG_RESULT(no)]
1882 dnl Check for IPv6-pure option
1883 AC_MSG_CHECKING([for IPv6-Localhost requirement])
1884 AC_ARG_WITH(localhost-ipv6,
1885 [ --with-localhost-ipv6 Prefer IPv6 localhost address over IPv4. Requires IPv6 Support.
1886 Treats 127.0.0.1 and ::1 as identical and converts all inputs of to ::1
1887 This depends on Dual-Stack support in the OS and all applications
1888 squid contacts via localhost being IPv6 enabled.
1889 Default: OFF. Treats these two IP as different, squid.conf must
1890 define both 127.0.0.1 and ::1 for the localhost ACL, etc. ],
1891 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [Convert IPv4-localhost requests to IPv6. Default: keep seperate.]) AC_MSG_RESULT(yes)],
1892 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [Convert IPv4-localhost requests to IPv6. Default: Keep seperate.]) AC_MSG_RESULT(no)]
1895 # end IPv6-only options
1898 AC_ARG_ENABLE(zph-qos,
1899 [ --enable-zph-qos Enable ZPH QOS support],
1900 [ if test "$enableval" = "yes" ; then
1901 echo "ZPH QOS enabled"
1902 AC_DEFINE(USE_ZPH_QOS,1,
1903 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
1904 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
1908 dnl Optional CNAME-Recursion by Internal DNS engine
1909 AC_MSG_CHECKING([whether DNS CNAME recursion wanted])
1910 AC_ARG_WITH(dns-cname,
1911 [ --with-dns-cname Enable CNAME-Recursion in Internal DNS stub.],
1912 [AC_DEFINE(DNS_CNAME, 1, [ 1 == Enable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(yes)],
1913 [AC_DEFINE(DNS_CNAME, 0, [ 0 == Disable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(no)]
1916 dnl Check whether this OS defines ss_len as a member of sockaddr_storage
1917 AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
1918 ac_cv_have_ss_len_in_struct_ss, [
1920 #include <sys/types.h>
1921 #include <sys/socket.h>
1922 #include <netinet/in.h>
1924 [ struct sockaddr_storage s; s.ss_len = 1; ],
1925 [ ac_cv_have_ss_len_in_struct_ss="yes" ],
1926 [ ac_cv_have_ss_len_in_struct_ss="no" ]
1929 if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
1930 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
1932 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
1935 dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
1936 AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
1937 ac_cv_have_sin_len_in_struct_sai, [
1939 #include <sys/types.h>
1940 #include <sys/socket.h>
1942 [ struct sockaddr_in s; s.sin_len = 1; ],
1943 [ ac_cv_have_sin_len_in_struct_sai="yes" ],
1944 [ ac_cv_have_sin_len_in_struct_sai="no" ]
1947 if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
1948 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
1950 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
1953 dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
1954 AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
1955 ac_cv_have_sin6_len_in_struct_sai, [
1957 #include <sys/types.h>
1958 #include <sys/socket.h>
1960 [ struct sockaddr_in6 s; s.sin6_len = 1; ],
1961 [ ac_cv_have_sin6_len_in_struct_sai="yes" ],
1962 [ ac_cv_have_sin6_len_in_struct_sai="no" ]
1965 if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
1966 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
1968 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
1972 AC_ARG_WITH(filedescriptors,
1973 [ --with-filedescriptors=NUMBER
1974 Force squid to support NUMBER filedescriptors],
1978 squid_filedescriptors_num=$withval
1981 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
1986 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
1987 if $CPPUNITCONFIG --help >/dev/null; then
1988 echo "using system installed cppunit"
1989 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
1991 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
1993 echo "cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail."
1995 SQUID_CPPUNIT_LIBS=''
1996 SQUID_CPPUNIT_INC=''
1999 AC_ARG_WITH(cppunit-basedir,
2000 [ --with-cppunit-basedir=/path/to/cppunit-base
2001 Path where the cppunit headers are libraries are found
2004 [ if test -f $withval/include/cppunit/TestCase.h; then
2005 echo "Using cppunit includes from $withval"
2006 SQUID_CPPUNIT_INC="-I${withval}/include"
2008 AC_MSG_ERROR(Cannot find cppunit at $withval)
2010 if test -f $withval/lib/libcppunit.la; then
2011 echo "Using cppunit lib from $withval"
2012 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2013 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2015 AC_MSG_ERROR(Cannot find cppunit at $withval)
2019 AC_SUBST(SQUID_CPPUNIT_LIBS)
2020 AC_SUBST(SQUID_CPPUNIT_LA)
2021 AC_SUBST(SQUID_CPPUNIT_INC)
2023 # Force some compilers to use ANSI features
2027 if test "$ac_cv_prog_CC" = "cc" ; then
2028 echo "adding '-std1' to cc args for $host"
2034 if test "$ac_cv_prog_CC" = "cc" ; then
2035 echo "adding '-Ae' to cc args for $host"
2042 dnl Check for programs
2046 AC_PATH_PROG(SH, sh, /bin/sh)
2047 AC_PATH_PROG(FALSE, false, /usr/bin/false)
2048 AC_PATH_PROG(TRUE, true, /usr/bin/true)
2049 AC_PATH_PROG(RM, rm, $FALSE)
2050 AC_PATH_PROG(MV, mv, $FALSE)
2051 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
2052 AC_PATH_PROG(LN, ln, cp)
2053 AC_PATH_PROG(PERL, perl, none)
2054 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2055 AC_PATH_PROG(AR, ar, $FALSE)
2057 if test "$ac_cv_path_PERL" = "none"; then
2058 echo "Perl is required to compile Squid"
2059 echo "Please install Perl and then re-run configure"
2065 echo "Disabling 'ranlib' for HP-UX..."
2079 dnl Check for headers
2111 netinet/in_systm.h \
2112 netinet/ip_fil_compat.h \
2170 linux/netfilter_ipv4.h \
2171 linux/netfilter_ipv4/ip_tproxy.h \
2173 SQUID_DEFAULT_INCLUDES
2177 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2178 #if HAVE_NETINET_IN_H
2179 #include <netinet/in.h>
2183 dnl *BSD dont include the depenencies for all their net/ and netinet/ files
2184 dnl We must include a few basic type headers for them to work.
2191 netinet/ip_compat.h\
2200 SQUID_BSDNET_INCLUDES)
2202 AC_CHECK_HEADERS([libxml/parser.h], [], [
2203 SAVED_CPPFLAGS="$CPPFLAGS"
2204 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2205 unset ac_cv_header_libxml_parser_h
2206 AC_CHECK_HEADERS([libxml/parser.h], [], [
2207 CPPFLAGS="$SAVED_CPPFLAGS"
2215 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2218 #include <sys/time.h>
2225 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2226 #if HAVE_SYS_TYPES_H
2227 #include <sys/types.h>
2233 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2234 #if HAVE_SYS_TYPES_H
2235 #include <sys/types.h>
2241 dnl Override rusage() detect on MinGW because is emulated in source code
2244 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2245 ac_cv_func_getrusage='yes'
2246 echo "Using own rusage on Windows."
2249 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2251 #include <sys/time.h>
2253 #if HAVE_SYS_RESOURCE_H
2254 #include <sys/resource.h>
2259 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2260 #if HAVE_SYS_TYPES_H
2261 #include <sys/types.h>
2263 #include <netinet/in.h>
2264 #include <netinet/in_systm.h>
2265 #include <netinet/ip.h>
2266 #if defined (__linux__) || defined (__CYGWIN__)
2275 dnl Check for typedefs
2276 AC_CHECK_SIZEOF(void *)
2278 dnl 8 bit integers - int8_t
2279 dnl if this is defined we trust it to be 8 bits
2280 AC_CHECK_TYPE(int8_t,[
2281 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2282 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2283 ],,SQUID_DEFAULT_INCLUDES)
2286 AC_CHECK_TYPE(char,[
2287 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2288 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2289 ],,SQUID_DEFAULT_INCLUDES)
2291 dnl unsigned 8 bit ints - u_int8_t
2292 dnl if this is defined we trust it to be 8 bits
2293 AC_CHECK_TYPE(u_int8_t,[
2294 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2295 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2296 ],,SQUID_DEFAULT_INCLUDES)
2299 dnl if this is defined we trust it to be 8 bits
2300 AC_CHECK_TYPE(uint8_t,[
2301 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2302 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2303 ],,SQUID_DEFAULT_INCLUDES)
2305 dnl 16 bit integers - int16_t
2306 dnl if this is defined we trust it to be 16 bits
2307 AC_CHECK_TYPE(int16_t,[
2308 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2309 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2310 ],,SQUID_DEFAULT_INCLUDES)
2313 AC_CHECK_TYPE(short,[
2314 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2315 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2316 ],,SQUID_DEFAULT_INCLUDES)
2320 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2321 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2322 ],,SQUID_DEFAULT_INCLUDES)
2324 dnl unsigned 16 bit ints - u_int16_t
2325 dnl if this is defined we trust it to be 16 bits
2326 AC_CHECK_TYPE(u_int16_t,[
2327 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2328 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2329 ],,SQUID_DEFAULT_INCLUDES)
2332 dnl if this is defined we trust it to be 16 bits
2333 AC_CHECK_TYPE(uint16_t,[
2334 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2335 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2336 ],,SQUID_DEFAULT_INCLUDES)
2338 dnl 32 bit signed int - int32_t
2339 dnl if this is defined we trust it to be 32 bits
2340 AC_CHECK_TYPE(int32_t,[
2341 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2342 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2343 ],,SQUID_DEFAULT_INCLUDES)
2346 AC_CHECK_TYPE(long,[
2347 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2348 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2349 ],,SQUID_DEFAULT_INCLUDES)
2351 dnl 32 bit unsigned int - u_int32_t
2352 dnl if this is defined we trust it to be 32 bits
2353 AC_CHECK_TYPE(u_int32_t,[
2354 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2355 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2356 ],,SQUID_DEFAULT_INCLUDES)
2359 dnl if this is defined we trust it to be 32 bits
2360 AC_CHECK_TYPE(uint32_t,[
2361 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2362 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2363 ],,SQUID_DEFAULT_INCLUDES)
2365 dnl 64 bit signed - int64_t
2366 dnl if this is defind we trust it to be 64 bits
2367 AC_CHECK_TYPE(int64_t,[
2368 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2369 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2370 ],,SQUID_DEFAULT_INCLUDES)
2373 dnl if this is defind we trust it to be 64 bits
2374 AC_CHECK_TYPE(__int64,[
2375 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2376 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2377 ],,SQUID_DEFAULT_INCLUDES)
2380 AC_CHECK_TYPE(long long,[
2381 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2382 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2383 ],,SQUID_DEFAULT_INCLUDES)
2385 dnl 64 bit unsigned - u_int64_t
2386 dnl if this is defind we trust it to be 64 bits
2387 AC_CHECK_TYPE(u_int64_t,[
2388 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2389 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2390 ],,SQUID_DEFAULT_INCLUDES)
2393 dnl if this is defind we trust it to be 64 bits
2394 AC_CHECK_TYPE(uint64_t,[
2395 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2396 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2397 ],,SQUID_DEFAULT_INCLUDES)
2399 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2400 dnl that is incompatible with the updated Solaris header files.
2401 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2402 AC_CHECK_TYPE(pad128_t,
2403 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2404 ,SQUID_DEFAULT_INCLUDES)
2406 AC_CHECK_TYPE(upad128_t,
2407 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2408 ,SQUID_DEFAULT_INCLUDES)
2410 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2411 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2412 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2413 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2414 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2415 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2416 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2417 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2419 dnl Check for special functions
2422 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2423 #include <sys/types.h>
2424 #include <sys/socket.h>
2430 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2431 #include <sys/ipc.h>
2432 #include <sys/msg.h>])
2434 dnl Check for needed libraries
2435 AC_CHECK_LIB(nsl, main)
2436 AC_CHECK_LIB(socket, main)
2437 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2440 AC_MSG_CHECKING(for winsock)
2442 for curlib in ws2_32 wsock32; do
2443 LIBS="$LIBS -l$curlib"
2445 char __attribute__((stdcall)) socket(int,int,int);
2446 char __attribute__((stdcall)) select(int,int,int,int,int);
2447 char __attribute__((stdcall)) closesocket(int);
2448 char __attribute__((stdcall)) gethostname(int,int);
2456 have_winsock=yes, have_winsock=no)
2458 if test $have_winsock = yes; then
2459 ac_cv_func_select='yes'
2460 if test $curlib = ws2_32; then
2461 have_winsock=winsock2
2467 AC_MSG_RESULT($have_winsock)
2468 if test $have_winsock = winsock2; then
2469 AC_CHECK_HEADERS(winsock2.h)
2471 AC_CHECK_HEADERS(winsock.h)
2476 dnl Ripped from the Samba sources
2477 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2479 #include <sys/types.h>
2482 #include <sys/socket.h>
2483 #include <sys/un.h>],
2485 struct sockaddr_un sunaddr;
2486 sunaddr.sun_family = AF_UNIX;
2488 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2489 if test x"$squid_cv_unixsocket" = x"yes"; then
2490 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2494 AC_CHECK_LIB(gnumalloc, main)
2495 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2496 echo "Disabling extended malloc functions when using gnumalloc"
2497 ac_cv_func_mallinfo=no
2498 ac_cv_func_mallocblksize=no
2499 ac_cv_func_mallopt=no
2503 echo "skipping libmalloc check for $host"
2506 echo "skipping libmalloc check for $host"
2510 AC_CHECK_LIB(malloc, main)
2515 AC_CHECK_LIB(bsd, main)
2516 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2517 AC_CHECK_LIB(bind, gethostbyname)
2518 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2521 echo "skipping libresolv checks for $host"
2524 AC_CHECK_LIB(resolv, main)
2530 echo "Use MSVCRT for math functions."
2533 AC_CHECK_LIB(m, main)
2537 dnl Check for libcrypt
2538 dnl Some of our helpers use crypt(3) which may be in libc, or in
2539 dnl libcrypt (eg FreeBSD)
2540 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2542 dnl Solaris10 provides MD5 natively through libmd5
2543 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
2547 dnl Check for libdl, used by auth_modules/PAM
2548 if test "$with_dl" = "yes"; then
2549 AC_CHECK_LIB(dl, dlopen)
2552 dnl Check for pthreads
2553 dnl We use pthreads when doing ASYNC I/O
2554 if test "$with_pthreads" = "yes"; then
2555 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2556 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
2558 i386-unknown-freebsd*)
2559 if test "$GCC" = "yes" ; then
2560 if test -z "$PRESET_LDFLAGS"; then
2561 LDFLAGS="$LDFLAGS -pthread"
2566 if test "$GCC" = "yes" ; then
2567 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2568 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
2570 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2571 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
2575 AC_CHECK_LIB(pthread, main)
2579 dnl We use AIO in the coss store
2580 if test "$with_aio" = "yes"; then
2581 dnl On some systems POSIX AIO functions are in libaio
2582 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
2585 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2586 dnl Robert Side <rside@aiinc.bc.ca>
2587 dnl Mon, 18 Jan 1999 17:48:00 GMT
2590 AC_CHECK_LIB(intl, strftime)
2594 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2595 dnl only with Windows LDAP libraries using -lwldap32
2598 LIB_LDAP="-lwldap32"
2603 dnl LDAP helpers need to know if -llber is needed or not
2604 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2613 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
2614 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2616 #if HAVE_SYS_TYPES_H
2617 #include <sys/types.h>
2627 [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)],
2628 ac_cv_dbopen_libdb="yes",
2629 ac_cv_dbopen_libdb="no")
2632 if test $ac_cv_dbopen_libdb = yes; then
2637 dnl System-specific library modifications
2641 if test "$GCC" = "yes"; then
2642 echo "Removing -O for gcc on $host"
2643 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2647 echo "Removing -lsocket for IRIX..."
2648 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2649 echo "Removing -lnsl for IRIX..."
2650 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2651 ac_cv_lib_nsl_main=no
2652 echo "Removing -lbsd for IRIX..."
2653 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2655 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2656 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2657 dnl Please change your configure script. AIX doesn't need -lbsd.
2659 echo "Removing -lbsd for AIX..."
2660 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2663 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2664 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2665 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2667 [*-*-solaris2.[0-4]])
2668 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2670 [*-sony-newsos[56]*])
2671 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2675 # Remove optimization for GCC 2.95.[123]
2676 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2677 if test "$GCC" = "yes"; then
2678 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2681 echo "Removing -O for gcc on $host with GCC $GCCVER"
2682 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2687 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2690 if test `uname -v` = "2.03"; then
2691 echo "disabling mallinfo for $host"
2692 ac_cv_func_mallinfo=no
2697 dnl This has to be before AC_CHECK_FUNCS
2698 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2699 # when running configure.
2700 if test -z "$ac_cv_func_poll"; then
2703 # John Kay (jkay@nlanr.net) 19970818
2704 echo "disabling poll for $host..."
2705 ac_cv_func_poll='no'
2709 echo "disabling poll for $host..."
2710 ac_cv_func_poll='no'
2713 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2714 # poll is problematic on Linux. We disable it
2715 # by default until Linux gets it right.
2716 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2717 if test $rev -lt 002002; then
2718 echo "disabling poll for $host < 2.2..."
2719 ac_cv_func_poll='no'
2722 [powerpc-ibm-aix4.1.*])
2723 # Mike Laster (mlaster@metavillage.com) 19981021
2724 echo "disabling poll for $host..."
2725 ac_cv_func_poll='no'
2728 # Robert Side <rside@aiinc.bc.ca>
2729 # Mon, 18 Jan 1999 17:48:00 GMT
2730 echo "disabling poll for $host..."
2731 ac_cv_func_poll='no'
2736 dnl Override statfs() detect on MinGW becasue is emulated in source code
2739 ac_cv_func_statfs='yes'
2743 dnl Check for library functions
2745 backtrace_symbols_fd \
2775 pthread_attr_setschedparam \
2776 pthread_attr_setscope \
2777 pthread_setschedparam \
2807 dnl ... and some we provide local replacements for
2819 # check for crypt, may require -lcrypt
2821 LIBS="$LIBS $CRYPTLIB"
2822 AC_CHECK_FUNCS(crypt)
2825 # Check for libepoll
2827 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
2828 AC_SUBST(EPOLL_LIBS)
2830 # Check for epoll_ctl, may need -lepoll
2832 LIBS="$LIBS $LIB_EPOLL"
2833 AC_CHECK_FUNCS(epoll_ctl)
2836 dnl Verify that epoll really works
2837 if test $ac_cv_func_epoll_ctl = yes; then
2838 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
2840 #include <sys/epoll.h>
2843 int main(int argc, char **argv)
2845 int fd = epoll_create(256);
2847 perror("epoll_create:");
2852 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
2855 dnl Magic which checks whether we are forcing a type of comm loop we
2856 dnl are actually going to (ab)use
2858 dnl Actually do the define magic now
2859 dnl mostly ripped from squid-commloops, thanks to adrian and benno
2861 if test -n "$SELECT_TYPE"; then
2862 : # Already decided above. Nothing to do here
2863 elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
2865 elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
2866 SELECT_TYPE="kqueue"
2867 elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
2869 elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
2872 SELECT_TYPE="select_win32"
2875 SELECT_TYPE="select"
2879 echo "Eep! Can't find poll, kqueue, epoll, or select!"
2880 echo "I'll try select and hope for the best."
2881 SELECT_TYPE="select"
2882 AC_DEFINE(USE_SELECT,1)
2885 echo "Using ${SELECT_TYPE} for the IO loop."
2887 AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2888 AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2889 AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2890 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2891 AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2892 AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2893 AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2895 case $SELECT_TYPE in
2897 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2900 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2903 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2906 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
2909 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2915 dnl Yay! Another Linux brokenness. Its not good enough
2916 dnl to know that setresuid() exists, because RedHat 5.0 declares
2917 dnl setresuid() but doesn't implement it.
2919 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2923 if(setresuid(-1,-1,-1)) {
2924 perror("setresuid:");
2929 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2931 if test "$ac_cv_func_setresuid" = "yes" ; then
2932 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.])
2935 dnl Yay! This one is a MacOSX brokenness. Its not good enough
2936 dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
2937 dnl copy that crashes with a buffer over-run!
2939 AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
2944 // we expect this to succeed, or crash on over-run.
2945 // if it passes otherwise we may need a better check.
2946 int main(int argc, char **argv)
2949 char *str = malloc(size);
2950 memset(str, 'x', size);
2951 strnstr(str, "fubar", size);
2954 ],ac_cv_func_strnstr="yes",ac_cv_func_strnstr="no")
2956 if test "$ac_cv_func_strnstr" = "yes" ; then
2957 AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
2959 AC_DEFINE(HAVE_STRNSTR,0,[Yay! A MacOS X brokenness. Its not good enough to know that strnstr() exists, because MacOSX 10.4 and earlier may have a buffer overrun.])
2963 AM_CONDITIONAL(NEED_OWN_STRSEP, false)
2964 if test "$ac_cv_func_strsep" = "no" ; then
2965 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
2968 AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
2969 if test "$ac_cv_func_strtoll" = "no" ; then
2970 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
2974 dnl Test for va_copy
2976 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
2979 void f (int i, ...) {
2980 va_list args1, args2;
2981 va_start (args1, i);
2982 va_copy (args2, args1);
2983 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2985 va_end (args1); va_end (args2);
2991 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
2993 if test "$ac_cv_func_va_copy" = "yes" ; then
2994 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
2998 dnl Some systems support __va_copy
3000 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
3003 void f (int i, ...) {
3004 va_list args1, args2;
3005 va_start (args1, i);
3006 __va_copy (args2, args1);
3007 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3009 va_end (args1); va_end (args2);
3015 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
3017 if test "$ac_cv_func___va_copy" = "yes" ; then
3018 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
3021 dnl IP-Filter support requires ipf header files. These aren't
3022 dnl installed by default, so we need to check for them
3023 if test "$IPF_TRANSPARENT" ; then
3024 AC_MSG_CHECKING(if IP-Filter header files are installed)
3025 # hold on to your hats...
3026 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3027 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
3028 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3029 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
3030 have_ipfilter_compat_header="yes"
3032 if test "x$have_ipfilter_compat_header" = "xyes" &&
3033 test "$ac_cv_header_ip_fil_h" = "yes" &&
3034 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3035 IPF_TRANSPARENT="yes"
3036 AC_DEFINE(IPF_TRANSPARENT, 1)
3037 elif test "$have_ipfilter_compat_header" = "yes" &&
3038 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3039 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3040 IPF_TRANSPARENT="yes"
3041 AC_DEFINE(IPF_TRANSPARENT, 1)
3043 IPF_TRANSPARENT="no"
3044 AC_DEFINE(IPF_TRANSPARENT, 0)
3046 AC_MSG_RESULT($IPF_TRANSPARENT)
3048 if test "$IPF_TRANSPARENT" = "no" ; then
3049 echo "WARNING: Cannot find necessary IP-Filter header files"
3050 echo " Transparent Proxy support WILL NOT be enabled"
3052 elif test "$IPF_TRANSPARENT" = "yes" ; then
3053 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3054 dnl Solaris minor version (8, 9, 10, ...)
3057 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3058 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3059 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3066 dnl PF support requires a header file.
3067 if test "$PF_TRANSPARENT" ; then
3068 AC_MSG_CHECKING(if PF header file is installed)
3069 # hold on to your hats...
3070 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
3071 PF_TRANSPARENT="yes"
3072 AC_DEFINE(PF_TRANSPARENT, 1)
3075 AC_DEFINE(PF_TRANSPARENT, 0)
3077 AC_MSG_RESULT($PF_TRANSPARENT)
3079 if test "$PF_TRANSPARENT" = "no" ; then
3080 echo "WARNING: Cannot find necessary PF header file"
3081 echo " Transparent Proxy support WILL NOT be enabled"
3085 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3086 dnl Shamelessly copied from above
3087 if test "$LINUX_NETFILTER" ; then
3088 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
3089 # hold on to your hats...
3090 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3091 LINUX_NETFILTER="yes"
3092 AC_DEFINE(LINUX_NETFILTER, 1)
3094 LINUX_NETFILTER="no"
3095 AC_DEFINE(LINUX_NETFILTER, 0)
3097 AC_MSG_RESULT($LINUX_NETFILTER)
3099 if test "$LINUX_NETFILTER" = "no" ; then
3100 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
3101 echo " Linux Transparent and Intercepting Proxy support WILL NOT be enabled"
3105 dnl Linux Netfilter/TPROXYv2 support requires some specific header files
3106 dnl Shamelessly copied from shamelessly copied from above
3107 if test "$LINUX_TPROXY2" ; then
3108 AC_MSG_CHECKING(if TPROXYv2 header files are installed)
3109 # hold on to your hats...
3110 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
3112 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3115 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3117 AC_MSG_RESULT($LINUX_TPROXY2)
3118 if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3119 echo "WARNING: Cannot find TPROXY v2 headers, you need to install the"
3120 echo "tproxy package from:"
3121 echo " - lynx http://www.balabit.com/downloads/tproxy/"
3122 echo "Or select the '--enable-linux-netfilter' option instead for Netfilter support."
3127 if test -z "$USE_GNUREGEX" ; then
3129 *-sun-solaris2.[[0-4]])
3137 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3138 if test -z "$USE_GNUREGEX"; then
3139 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
3142 AC_TRY_COMPILE([#include <sys/types.h>
3143 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
3148 AC_MSG_RESULT($USE_GNUREGEX)
3149 if test "$USE_GNUREGEX" = "yes"; then
3151 LIBREGEX="libregex.a"
3152 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
3157 dnl Not cached since people are likely to tune this
3158 AC_MSG_CHECKING(Default FD_SETSIZE value)
3167 #include <sys/time.h>
3169 #if HAVE_SYS_SELECT_H
3170 #include <sys/select.h>
3172 #if HAVE_SYS_TYPES_H
3173 #include <sys/types.h>
3176 #include <winsock.h>
3179 #include <winsock2.h>
3182 FILE *fp = fopen("conftestval", "w");
3183 fprintf (fp, "%d\n", FD_SETSIZE);
3187 DEFAULT_FD_SETSIZE=`cat conftestval`,
3188 DEFAULT_FD_SETSIZE=256,
3189 DEFAULT_FD_SETSIZE=256)
3190 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
3191 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
3194 dnl Not cached since people are likely to tune this
3195 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
3196 dnl damn! FreeBSD's pthreads breaks dup2().
3198 if test -n "$squid_filedescriptors_num" ; then
3199 SQUID_MAXFD=$squid_filedescriptors_num
3200 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3203 i386-unknown-freebsd*)
3204 if echo "$LDFLAGS" | grep -q pthread; then
3205 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3211 #include <sys/time.h> /* needed on FreeBSD */
3212 #include <sys/param.h>
3213 #include <sys/resource.h>
3217 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
3218 /* getrlimit and sysconf returns bogous values on cygwin32.
3219 * Number of fds is virtually unlimited in cygwin (sys/param.h)
3220 * __CYGWIN32__ is deprecated.
3226 #if defined(RLIMIT_NOFILE)
3227 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3228 perror("getrlimit: RLIMIT_NOFILE");
3230 #if defined(__APPLE__)
3231 /* asking for more than OPEN_MAX fails on Leopard */
3232 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3234 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3236 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3237 perror("setrlimit: RLIMIT_NOFILE");
3240 #elif defined(RLIMIT_OFILE)
3241 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3242 perror("getrlimit: RLIMIT_OFILE");
3244 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3245 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3246 perror("setrlimit: RLIMIT_OFILE");
3249 #endif /* RLIMIT_NOFILE */
3250 #endif /* HAVE_SETRLIMIT */
3251 /* by starting at 2^14, we will never get higher
3252 than 2^15 for SQUID_MAXFD */
3256 if (dup2(0, i) < 0) {
3264 #endif /* IF !DEF CYGWIN */
3265 fp = fopen("conftestval", "w");
3266 fprintf (fp, "%d\n", i & ~0x3F);
3270 SQUID_MAXFD=`cat conftestval`,
3273 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3279 AC_MSG_RESULT($SQUID_MAXFD)
3281 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3282 if test "$SQUID_MAXFD" -lt 512 ; then
3283 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
3284 echo " cache will be very busy. Please see the FAQ page"
3285 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
3286 echo " on how to increase your filedescriptor limit"
3291 if test `expr $SQUID_MAXFD % 64` != 0; then
3292 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
3293 echo " on certain platforms."
3297 dnl Not cached since people are likely to tune this
3298 AC_MSG_CHECKING(Default UDP send buffer size)
3302 #include <sys/types.h>
3303 #if HAVE_SYS_SOCKET_H
3304 #include <sys/socket.h>
3306 #if HAVE_NETINET_IN_H
3307 #include <netinet/in.h>
3310 #include <winsock.h>
3313 #include <winsock2.h>
3318 int fd,val=0,len=sizeof(int);
3319 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3321 WSAStartup(2, &wsaData);
3323 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3324 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3325 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3328 if (val<=0) exit(1);
3329 fp = fopen("conftestval", "w");
3330 fprintf (fp, "%d\n", val);
3334 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3335 SQUID_DETECT_UDP_SO_SNDBUF=16384,
3336 SQUID_DETECT_UDP_SO_SNDBUF=16384)
3337 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3338 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3340 dnl Not cached since people are likely to tune this
3341 AC_MSG_CHECKING(Default UDP receive buffer size)
3345 #include <sys/types.h>
3346 #if HAVE_SYS_SOCKET_H
3347 #include <sys/socket.h>
3349 #if HAVE_NETINET_IN_H
3350 #include <netinet/in.h>
3353 #include <winsock.h>
3356 #include <winsock2.h>
3361 int fd,val=0,len=sizeof(int);
3362 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3364 WSAStartup(2, &wsaData);
3366 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3367 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3368 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3371 if (val <= 0) exit(1);
3372 fp = fopen("conftestval", "w");
3373 fprintf (fp, "%d\n", val);
3377 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3378 SQUID_DETECT_UDP_SO_RCVBUF=16384,
3379 SQUID_DETECT_UDP_SO_RCVBUF=16384)
3380 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3381 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3383 dnl Not cached since people are likely to tune this
3384 AC_MSG_CHECKING(Default TCP send buffer size)
3388 #include <sys/types.h>
3389 #if HAVE_SYS_SOCKET_H
3390 #include <sys/socket.h>
3392 #if HAVE_NETINET_IN_H
3393 #include <netinet/in.h>
3396 #include <winsock.h>
3399 #include <winsock2.h>
3404 int fd,val=0,len=sizeof(int);
3405 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3407 WSAStartup(2, &wsaData);
3409 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3410 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3411 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3414 if (val <= 0) exit(1);
3415 fp = fopen("conftestval", "w");
3416 fprintf (fp, "%d\n", val);
3420 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
3421 SQUID_TCP_SO_SNDBUF=16384,
3422 SQUID_TCP_SO_SNDBUF=16384)
3423 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3424 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3425 echo "Limiting send buffer size to 32K"
3426 SQUID_TCP_SO_SNDBUF=32768
3428 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3430 dnl Not cached since people are likely to tune this
3431 AC_MSG_CHECKING(Default TCP receive buffer size)
3435 #include <sys/types.h>
3436 #if HAVE_SYS_SOCKET_H
3437 #include <sys/socket.h>
3439 #if HAVE_NETINET_IN_H
3440 #include <netinet/in.h>
3443 #include <winsock.h>
3446 #include <winsock2.h>
3451 int fd,val=0,len=sizeof(int);
3452 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3454 WSAStartup(2, &wsaData);
3456 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3457 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3458 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3461 if (val <= 0) exit(1);
3462 fp = fopen("conftestval", "w");
3463 fprintf (fp, "%d\n", val);
3467 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
3468 SQUID_TCP_SO_RCVBUF=16384,
3469 SQUID_TCP_SO_RCVBUF=16384)
3470 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3471 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3472 echo "Limiting receive buffer size to 64K"
3473 SQUID_TCP_SO_RCVBUF=65535
3475 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3476 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3477 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
3478 ac_cv_needs_sys_errlist="no",
3479 ac_cv_needs_sys_errlist="yes")
3481 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3482 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3485 dnl Not cached since people are likely to change this
3486 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3487 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3489 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
3492 AC_MSG_CHECKING(if inet_ntoa() actually works)
3496 #include <sys/types.h>
3497 #include <netinet/in.h>
3498 #include <arpa/inet.h>
3503 in.s_addr = inet_addr("1.2.3.4");
3504 fp = fopen("conftestval", "w");
3505 fprintf (fp, "%s\n", inet_ntoa(in));
3509 INET_NTOA_RESULT=`cat conftestval`,
3510 INET_NTOA_RESULT="broken",
3511 INET_NTOA_RESULT="broken")
3512 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3513 AC_MSG_RESULT("yes")
3518 echo "Using Win32 resolver instead."
3521 echo "Will use our own inet_ntoa()."
3522 AC_LIBOBJ(inet_ntoa)
3523 # echo "WARNING: This looks bad, and probably prevents Squid from working."
3524 # echo " If you're on IRIX and using GCC 2.8, you probably need"
3525 # echo " to use the IRIX C compiler instead."
3531 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3532 AC_MSG_CHECKING(for working statvfs() interface)
3536 #include <sys/types.h>
3537 #include <sys/statvfs.h>
3541 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3542 sfs.f_files = sfs.f_ffree = 0;
3543 statvfs("/tmp", &sfs);
3545 ac_cv_func_statvfs=yes,
3546 ac_cv_func_statvfs=no)
3547 AC_MSG_RESULT($ac_cv_func_statvfs)
3548 if test "$ac_cv_func_statvfs" = "yes" ; then
3549 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3553 dnl Detect what resolver fields we have available to use...
3554 AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3556 #if HAVE_SYS_TYPES_H
3557 #include <sys/types.h>
3559 #if HAVE_NETINET_IN_H
3560 #include <netinet/in.h>
3562 #if HAVE_ARPA_INET_H
3563 #include <arpa/inet.h>
3565 #if HAVE_ARPA_NAMESER_H
3566 #include <arpa/nameser.h>
3572 [_res_ext.nsaddr_list[[0]].s_addr;],
3573 ac_cv_have_res_ext_nsaddr_list="yes",
3574 ac_cv_have_res_ext_nsaddr_list="no"))
3575 if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3576 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3577 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3580 if test "$_SQUID_RES_NSADDR6_LIST" == ""; then
3581 AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3583 #if HAVE_SYS_TYPES_H
3584 #include <sys/types.h>
3586 #if HAVE_NETINET_IN_H
3587 #include <netinet/in.h>
3589 #if HAVE_ARPA_INET_H
3590 #include <arpa/inet.h>
3592 #if HAVE_ARPA_NAMESER_H
3593 #include <arpa/nameser.h>
3599 [_res._u._ext.nsaddrs[[0]]->sin6_addr;],
3600 ac_cv_have_res_ext_nsaddrs="yes",
3601 ac_cv_have_res_ext_nsaddrs="no"))
3602 if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3603 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3604 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3608 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3610 #if HAVE_SYS_TYPES_H
3611 #include <sys/types.h>
3613 #if HAVE_NETINET_IN_H
3614 #include <netinet/in.h>
3616 #if HAVE_ARPA_INET_H
3617 #include <arpa/inet.h>
3619 #if HAVE_ARPA_NAMESER_H
3620 #include <arpa/nameser.h>
3626 [_res.nsaddr_list[[0]];],
3627 ac_cv_have_res_nsaddr_list="yes",
3628 ac_cv_have_res_nsaddr_list="no"))
3629 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3630 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3631 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3634 if test "$_SQUID_RES_NSADDR_LIST" == ""; then
3635 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3637 #if HAVE_SYS_TYPES_H
3638 #include <sys/types.h>
3640 #if HAVE_NETINET_IN_H
3641 #include <netinet/in.h>
3643 #if HAVE_ARPA_INET_H
3644 #include <arpa/inet.h>
3646 #if HAVE_ARPA_NAMESER_H
3647 #include <arpa/nameser.h>
3653 [_res.ns_list[[0]].addr;],
3654 ac_cv_have_res_ns_list="yes",
3655 ac_cv_have_res_ns_list="no"))
3656 if test $ac_cv_have_res_ns_list = "yes" ; then
3657 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3658 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3662 dnl Squid now has .po translation capability, given the right toolkit
3663 AX_WITH_PROG([PO2HTML],[po2html])
3666 dnl Squid now has limited locale handling ...
3668 AC_ARG_ENABLE(auto-locale,
3669 [ --enable-auto-locale This enables squid to lookup translated error pages
3670 based on the clients request headers. Without it squid
3671 is limited to a single language set in squid.conf],
3672 [ if test "$enableval" = "yes" ; then
3673 echo "Enabling Multi-Language Support"
3674 AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
3676 echo "Disabling Multi-Language Support"
3677 AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
3682 dnl Need the debugging version of malloc if available
3684 if test "$ac_cv_lib_malloc_main" = "yes" ; then
3685 if test -r /usr/lib/debug/malloc.o ; then
3686 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3688 if test -r /usr/lib/debug/mallocmap.o ; then
3689 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3695 if test -z "$XTRA_LIBS"; then
3698 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3703 dnl Clean up after OSF/1 core dump bug
3716 src/adaptation/Makefile \
3723 test-suite/Makefile \
3726 helpers/basic_auth/Makefile \
3727 helpers/basic_auth/LDAP/Makefile \
3728 helpers/basic_auth/MSNT/Makefile \
3729 helpers/basic_auth/NCSA/Makefile \
3730 helpers/basic_auth/PAM/Makefile \
3731 helpers/basic_auth/SMB/Makefile \
3732 helpers/basic_auth/mswin_sspi/Makefile \
3733 helpers/basic_auth/YP/Makefile \
3734 helpers/basic_auth/getpwnam/Makefile \
3735 helpers/basic_auth/multi-domain-NTLM/Makefile \
3736 helpers/basic_auth/SASL/Makefile \
3737 helpers/basic_auth/POP3/Makefile \
3738 helpers/basic_auth/DB/Makefile \
3739 helpers/basic_auth/squid_radius_auth/Makefile \
3740 helpers/digest_auth/Makefile \
3741 helpers/digest_auth/password/Makefile \
3742 helpers/digest_auth/ldap/Makefile \
3743 helpers/digest_auth/eDirectory/Makefile \
3744 helpers/ntlm_auth/Makefile \
3745 helpers/ntlm_auth/fakeauth/Makefile \
3746 helpers/ntlm_auth/no_check/Makefile \
3747 helpers/ntlm_auth/SMB/Makefile \
3748 helpers/ntlm_auth/SMB/smbval/Makefile \
3749 helpers/ntlm_auth/mswin_sspi/Makefile \
3750 helpers/negotiate_auth/Makefile \
3751 helpers/negotiate_auth/mswin_sspi/Makefile \
3752 helpers/negotiate_auth/squid_kerb_auth/Makefile \
3753 helpers/external_acl/Makefile \
3754 helpers/external_acl/ip_user/Makefile \
3755 helpers/external_acl/ldap_group/Makefile \
3756 helpers/external_acl/session/Makefile \
3757 helpers/external_acl/unix_group/Makefile \
3758 helpers/external_acl/wbinfo_group/Makefile \
3759 helpers/external_acl/mswin_ad_group/Makefile \
3760 helpers/external_acl/mswin_lm_group/Makefile \
3764 AC_CONFIG_SUBDIRS(lib/libTrie)
3766 # must configure libltdl subdir unconditionally for "make distcheck" to work
3767 AC_CONFIG_SUBDIRS(lib/libLtdl)