2 dnl Configuration input file for Squid
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 dnl Make the squid top srcdir available to sub-packages as --with-squid=PATH
42 new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir"
43 ac_configure_args="$new_configure_args"
46 use_loadable_modules=1
47 AC_MSG_CHECKING(whether to use loadable modules)
48 AC_ARG_ENABLE(loadable-modules,
49 AC_HELP_STRING( [--disable-loadable-modules], [do not support loadable modules]) ,
51 case "${enableval}" in
52 yes) use_loadable_modules=yes ;;
53 no) use_loadable_modules=no ;;
54 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
56 AC_MSG_RESULT([$use_loadable_modules, explicitly])
59 use_loadable_modules=yes;
60 AC_MSG_RESULT([$use_loadable_modules, implicitly])
64 AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
66 if test $use_loadable_modules = yes;
68 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
75 if test $use_loadable_modules = yes;
77 AC_LIBLTDL_CONVENIENCE(lib/libLtdl)
82 # Do we need these unconditionally for "make distcheck" to work?
86 if test $use_loadable_modules = yes;
88 # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
89 LIBADD_DL=${lt_cv_dlopen_libs}
98 LIBREGEX='' # libregex.a
100 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
104 if test -z "$EXEEXT"; then
107 # automake automatically adds .exe when installing binaries
112 dnl this should be expanded to a list of platform sensible support requirements.
113 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
115 mingw|mingw32|cygwin|cygwin32)
116 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
119 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
125 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
126 CFLAGS="$CFLAGS -mthreads"
127 CXXFLAGS="$CXXFLAGS -mthreads"
128 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
129 echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform"
130 echo "Please see PSAPI.DLL section on doc/win32-relnotes.html."
132 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
135 MINGW_LIBS="-lmingwex"
136 AM_CONDITIONAL(USE_IPC_WIN32, true)
140 AM_CONDITIONAL(USE_IPC_WIN32, false)
144 if test -z "$CACHE_HTTP_PORT"; then
145 CACHE_HTTP_PORT="3128"
147 if test -z "$CACHE_ICP_PORT"; then
148 CACHE_ICP_PORT="3130"
152 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
153 [What default TCP port to use for HTTP listening?])
154 AC_SUBST(CACHE_HTTP_PORT)
155 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
156 [What default UDP port to use for ICP listening?])
157 AC_SUBST(CACHE_ICP_PORT)
159 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
161 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
163 CACHE_EFFECTIVE_USER="nobody"
164 AC_ARG_WITH(default-user,
165 AC_HELP_STRING([--with-default-user=USER],
166 [System user account for squid permissions. Default: nobody]),
167 [ CACHE_EFFECTIVE_USER="$withval" ]
169 AC_SUBST(CACHE_EFFECTIVE_USER)
171 DEFAULT_LOG_DIR="$localstatedir/logs"
173 AC_HELP_STRING([--with-logdir=PATH],
174 Default location for squid logs. default: $DEFAULT_LOG_DIR),
177 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
180 DEFAULT_LOG_DIR="$withval"
185 AC_SUBST(DEFAULT_LOG_DIR)
187 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
190 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
194 if test "$GCC" = "yes"; then
195 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
196 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
199 if test $GCCVER2 -lt 300 ; then
200 echo "ERROR: GCC $GCCVER causes a coredump on $host"
201 echo "ERROR: Try a more recent GCC version"
210 dnl Set Default CFLAGS
211 if test -z "$PRESET_CFLAGS"; then
212 if test "$GCC" = "yes"; then
215 # sunos has too many warnings for this to be useful
219 # Motorola cc/ld does not like -02 but is ok on -O
220 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
223 CFLAGS="-Wall $CFLAGS"
229 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
230 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
231 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
232 -Wl,-woff,85,-woff,84,-woff,134 \
233 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
234 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
235 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
236 -Wl,-woff,85,-woff,84,-woff,134 \
237 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
240 # Mogul says DEC compilers take both -g and -O2
241 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
250 dnl set squid required flags
251 if test "$GCC" = "yes"; then
252 dnl Guido Serassio (serassio@squid-cache.org) 20070811
253 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
254 dnl -Wmissing-prototypes -Wmissing-declarations
255 dnl TODO: check if the problem will be present in any other newer MinGW release.
258 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
261 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
264 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
269 AC_SUBST(SQUID_CFLAGS)
270 AC_SUBST(SQUID_CXXFLAGS)
272 AC_TEST_CHECKFORHUGEOBJECTS
273 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
276 if test -z "$PRESET_LDFLAGS"; then
277 if test "$GCC" = "yes"; then
280 # Silence Linker warnings 84, 85 and 134
281 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
296 AC_ARG_ENABLE(gnuregex,
297 AC_HELP_STRING([--enable-gnuregex],
298 [Compile GNUregex. Unless you have reason to use
299 this option, you should not enable it.
300 This library file is usually only required on Windows and
301 very old Unix boxes which do not have their own regex
303 [USE_GNUREGEX=$enableval])
307 AC_ARG_ENABLE(optimizations,
308 AC_HELP_STRING([--disable-optimizations],
309 [Don't compile Squid with compiler optimizations enabled.
310 Optimization is good for production builds, but not
311 good for debugging. During development, use
312 --disable-optimizations to reduce compilation times
313 and allow easier debugging. This option implicitly
314 also enabled --disable-inline]),
315 [ if test "$enableval" = "no" ; then
316 echo "Disabling compiler optimizations (-O flag)"
317 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
318 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
323 AC_ARG_ENABLE(inline,
324 AC_HELP_STRING([--disable-inline],
325 [Don't compile trivial methods as inline. Squid
326 is coded with much of the code able to be inlined.
327 Inlining is good for production builds, but not
328 good for development. During development, use
329 --disable-inline to reduce compilation times and
330 allow incremental builds to be quick. For
331 production builds, or load tests, use
332 --enable-inline to have squid make all trivial
333 methods inlinable by the compiler.]),
334 [ if test "$enableval" = "no" ; then
339 if test "$SquidInline" = "yes" ; then
340 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
341 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
343 echo "Inlining optimization disabled"
344 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
347 AC_ARG_ENABLE(debug-cbdata,
348 AC_HELP_STRING([--enable-debug-cbdata],
349 [Provide some debug information in cbdata]),
350 [ if test "$enableval" = "yes" ; then
351 echo "cbdata debugging enabled"
352 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
356 dnl This is a developer only option.. developers know how to set defines
358 dnl AC_ARG_ENABLE(xmalloc-debug,
359 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
360 dnl [ if test "$enableval" = "yes" ; then
361 dnl echo "Malloc debugging enabled"
362 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
366 dnl This is a developer only option.. developers know how to set defines
368 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
369 dnl [ --enable-xmalloc-debug-trace
370 dnl Detailed trace of memory allocations],
371 dnl [ if test "$enableval" = "yes" ; then
372 dnl echo "Malloc debug trace enabled"
373 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
374 dnl AC_DEFINE(XMALLOC_DEBUG,1)
378 AC_ARG_ENABLE(xmalloc-statistics,
379 AC_HELP_STRING([--enable-xmalloc-statistics],
380 [Show malloc statistics in status page]),
381 [ if test "$enableval" = "yes" ; then
382 echo "Malloc statistics enabled"
383 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
387 AC_ARG_ENABLE(async-io,
388 AC_HELP_STRING([--enable-async-io[=N_THREADS]],
389 [Shorthand for "--with-aufs-threads=N_THREADS --with-pthreads
390 --enable-storeio=ufs,aufs"]),
394 STORE_MODULES="ufs aufs"
399 aufs_io_threads=$enableval
401 STORE_MODULES="ufs aufs"
406 AC_ARG_WITH(aufs-threads,
407 AC_HELP_STRING([--with-aufs-threads=N_THREADS],
408 [Tune the number of worker threads for the aufs object store.]),
411 aufs_io_threads=$withval
414 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
418 if test "$aufs_io_threads"; then
419 echo "With $aufs_io_threads aufs threads"
420 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
421 [Defines how many threads aufs uses for I/O])
424 AC_ARG_WITH(pthreads,
425 AC_HELP_STRING([--with-pthreads],[Use POSIX Threads]))
426 if test "$with_pthreads" = "yes"; then
431 AC_HELP_STRING([--with-aio],[Use POSIX AIO]))
432 if test "$with_aio" = "yes"; then
438 AC_HELP_STRING([--with-dl],[Use dynamic linking]))
439 if test "$with_dl" = "yes"; then
443 AC_ARG_ENABLE(storeio,
444 AC_HELP_STRING([--enable-storeio="list of modules"],
445 [Build support for the list of store I/O modules.
446 The default is only to build the "ufs" module.
447 See src/fs for a list of available modules, or
448 Programmers Guide section <not yet written>
449 for details on how to build your custom store module]),
452 for dir in $srcdir/src/fs/*; do
453 module="`basename $dir`"
454 if test -d "$dir" && test "$module" != CVS && test "$module" != coss; then
455 STORE_MODULES="$STORE_MODULES $module"
462 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
466 [ if test -z "$STORE_MODULES"; then
470 if test -n "$STORE_MODULES"; then
471 dnl ensure that all modules a) exist and b) only include once.
472 STORE_MODULES_FULL=$STORE_MODULES
475 for module in $STORE_MODULES_FULL; do
476 have_mod=`echo "$STORE_MODULES" | grep "$module"`
477 if test "$have_mod" != ""; then
478 echo "Removing duplicate $module from storeio"
479 elif test -d $srcdir/src/fs/$module; then
480 STORE_MODULES="$STORE_MODULES $module"
481 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
483 AC_MSG_ERROR(storeio $module does not exist)
486 echo "Store modules built: $STORE_MODULES"
488 dnl remove all but diskd - its the only module that needs to recurse
489 dnl into the sub directory
497 for fs in $STORE_MODULES none; do
502 NEED_DISKDAEMON="true"
507 NEED_DISKTHREADS="true"
512 dnl Automake om MinGW needs explicit exe extension
513 dnl for STORE_TESTS substition
515 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
519 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
524 dnl We have 'fake' modules - aufs and diskd - legacy.
525 for fs in $STORE_MODULES; do
530 STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
531 STORE_LIBS="$STORE_LIBS lib${fs}.a"
536 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
537 echo "adding UFS, as it contains core logic for diskd and aufs"
538 STORE_OBJS="$STORE_OBJS fs/libufs.a"
539 STORE_LIBS="$STORE_LIBS libufs.a"
540 STORE_MODULES="$STORE_MODULES ufs"
541 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
543 dnl Automake om MinGW needs explicit exe extension
544 dnl for STORE_TESTS substition
546 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
551 AC_SUBST(STORE_LINKOBJS)
552 AC_SUBST(STORE_TESTS)
554 AC_ARG_ENABLE(disk-io,
555 AC_HELP_STRING([--enable-disk-io="list of modules"],
556 [Build support for the list of disk I/O modules.
557 If unset only the "Blocking" module will be built.
558 Set without a value all available modules will be built.
559 See src/DiskIO for a list of available modules, or
560 Programmers Guide section on DiskIO
561 for details on how to build your custom disk module]),
564 for dir in $srcdir/src/DiskIO/*; do
565 module="`basename $dir`"
566 if test -d "$dir" && test "$module" != CVS; then
567 echo "Autodetected $module DiskIO module"
568 DISK_MODULES="$DISK_MODULES $module"
571 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
574 AC_DEFINE(USE_DISKIO,0,[DiskIO modules are expected to be available.])
577 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
578 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
582 [ if test -z "$DISK_MODULES"; then
583 DISK_MODULES="Blocking"
584 echo "Enabling Blocking DiskIO module (required default)"
585 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
588 if test -n "$DISK_MODULES"; then
589 for module in $DISK_MODULES; do
590 if test -d $srcdir/src/DiskIO/$module; then
593 AC_MSG_ERROR(disk-io $module does not exist)
596 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
598 for module in $DISK_MODULES; do
599 echo "Enabling $module DiskIO module"
600 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
603 for fs in $DISK_MODULES none; do
606 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
607 FOUND_DISKDAEMON="true"
610 FOUND_DISKTHREADS="true"
616 FOUND_BLOCKING="true"
620 if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
621 echo "adding Blocking, as it is used by an active, legacy Store Module"
622 DISK_LIBS="$DISK_LIBS libBlocking.a"
623 DISK_MODULES="$DISK_MODULES Blocking"
624 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
627 if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
628 echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
629 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
630 DISK_MODULES="$DISK_MODULES DiskDaemon"
631 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
632 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
635 if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
636 echo "adding DiskThreads, as it is used by an active, legacy Store Module"
637 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
638 DISK_MODULES="$DISK_MODULES DiskThreads"
639 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
642 if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
643 echo "adding AIO, as it is used by an active, legacy Store Module"
644 DISK_LIBS="$DISK_LIBS libAIO.a"
645 DISK_MODULES="$DISK_MODULES AIO"
646 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
648 echo "IO Modules built: $DISK_MODULES"
651 dnl we know what is being built. now add dependencies.
652 for fs in $DISK_MODULES none; do
655 if test -z "$with_pthreads"; then
659 echo "DiskThreads IO Module used, Windows threads support automatically enabled"
662 echo "DiskThreads IO Module used, pthreads support automatically enabled"
669 if test -z "$with_aio"; then
673 echo "Aio IO Module used, Windows overlapped I/O support automatically enabled"
676 echo "Aio IO Module used, aio support automatically enabled"
686 dnl We use AIO in the coss store
687 if test "$with_aio" = "yes"; then
688 dnl On some systems POSIX AIO functions are in libaio
689 AC_CHECK_LIB(rt, aio_read,
690 [DISK_LIBS="$DISK_LIBS -lrt"],
691 AC_CHECK_LIB(aio, aio_read,[DISK_LIBS="$DISK_LIBS -laio"])
695 dnl Check for pthreads
696 dnl We use pthreads when doing ASYNC I/O
697 if test "$with_pthreads" = "yes"; then
698 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
699 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
701 i386-unknown-freebsd*)
702 if test "$GCC" = "yes" ; then
703 if test -z "$PRESET_LDFLAGS"; then
704 LDFLAGS="$LDFLAGS -pthread"
709 if test "$GCC" = "yes" ; then
710 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
711 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
713 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
714 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
718 AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
719 [ AC_MSG_ERROR(pthread library required but cannot be found.) ])
722 AC_SUBST(DISK_MODULES)
724 AC_SUBST(DISK_PROGRAMS)
725 AC_SUBST(DISK_LINKOBJS)
726 AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
727 AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
730 dnl At lest one removal policy is always needed.
731 dnl 'lru' removal policy is currently hard-coded by name for tests
732 dnl so we must set it as default.
734 AC_ARG_ENABLE(removal-policies,
735 AC_HELP_STRING([--enable-removal-policies="list of policies"],
736 [Build support for the list of removal policies.
737 The default is only to build the "lru" module.
738 See src/repl for a list of available modules, or
739 Programmers Guide section 9.9 for details on how
740 to build your custom policy]),
743 for dir in $srcdir/src/repl/*; do
744 module="`basename $dir`"
745 if test -d "$dir" && test "$module" != CVS && test "$module" != "lru"; then
746 REPL_POLICIES="$REPL_POLICIES $module"
753 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
757 if test -n "$REPL_POLICIES"; then
758 for module in $REPL_POLICIES; do
759 if test -d $srcdir/src/repl/$module; then
762 AC_MSG_ERROR(Removal policy $module does not exist)
765 echo "Removal policies built: $REPL_POLICIES"
766 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
767 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
769 AC_SUBST(REPL_POLICIES)
773 AM_CONDITIONAL(ENABLE_PINGER, false)
775 AC_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
776 [ if test "$enableval" = "yes" ; then
778 AC_DEFINE(USE_ICMP,1,[Define to use Squid's ICMP and Network Measurement features (highly recommended!)])
779 AM_CONDITIONAL(ENABLE_PINGER, true)
783 AM_CONDITIONAL(USE_DELAY_POOLS, false)
784 AC_ARG_ENABLE(delay-pools,
785 AC_HELP_STRING([--enable-delay-pools],
786 [Enable delay pools to limit bandwidth usage]),
787 [ if test "$enableval" = "yes" ; then
788 echo "Delay pools enabled"
789 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
790 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
794 dnl disable generic/common adaptation support by default
797 AM_CONDITIONAL(USE_ESI, false)
799 AC_HELP_STRING([--enable-esi],
800 [Enable ESI for accelerators. Requires libexpat.
801 Enabling ESI will cause squid to follow the
802 Edge Acceleration Specification (www.esi.org).
803 This causes squid to IGNORE client Cache-Control headers.
804 DO NOT use this in a squid configured as a web proxy,
805 ONLY use it in a squid configured for webserver acceleration.]),
806 use_esi=$enableval, use_esi=no)
807 if test "$use_esi" = "yes" ; then
808 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
809 AM_CONDITIONAL(USE_ESI, true)
811 dnl Perform configuration consistency checks for ESI
812 dnl ESI support requires libexpat
813 AC_CHECK_LIB([expat], [main],
814 [ESI_LIBS="-lexpat"],
815 [AC_MSG_FAILURE([ESI support requires libexpat library, but no usable library was found])]
817 AC_CHECK_LIB([xml2], [main],
819 [AC_MSG_FAILURE([ESI support requires libxml2 library, but no usable library was found])]
821 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
824 AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
827 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
828 AC_ARG_ENABLE(icap-client,
829 AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
830 use_icap_client=$enableval, use_icap_client=no)
831 if test "$use_icap_client" = "yes" ; then
832 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
833 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
834 ICAP_LIBS="ICAP/libicap.la"
837 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
843 AC_MSG_CHECKING(whether to support eCAP)
845 AC_HELP_STRING([--enable-ecap],
846 [support loadable content adaptation modules]),
848 case "${enableval}" in
851 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
853 AC_MSG_RESULT([$use_ecap, explicitly])
857 AC_MSG_RESULT([$use_ecap, implicitly])
861 dnl Perform configuration consistency checks for eCAP
862 if test $use_ecap = yes;
864 dnl eCAP support requires loadable modules, which are enabled by default
865 if test "$use_loadable_modules" != "yes"
867 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
870 dnl eCAP support requires libecap
871 AC_CHECK_LIB([ecap], [main],
872 [ECAP_LIBS="-lecap"],
873 [AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])]
877 AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
878 if test $use_ecap = yes;
880 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
881 ECAP_LIBS="eCAP/libeCAP.la $ECAP_LIBS"
884 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
890 dnl enable adaptation if requested by specific adaptation mechanisms
891 AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
892 if test $use_adaptation = yes
894 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
895 ADAPTATION_LIBS="adaptation/libadaptation.la"
897 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
900 AC_SUBST(ADAPTATION_LIBS)
903 dnl This is a developer only option. Developers know how to set defines
905 dnl AC_ARG_ENABLE(mem-gen-trace,
906 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
907 dnl [ if test "$enableval" = "yes" ; then
908 dnl echo "Memory trace (to file) enabled"
909 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
913 AC_ARG_ENABLE(useragent-log,
914 AC_HELP_STRING([--enable-useragent-log],
915 [Enable logging of User-Agent header]),
916 [ if test "$enableval" = "yes" ; then
917 echo "User-Agent logging enabled"
918 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
919 By default, they are written to useragent.log in the Squid log
924 AC_ARG_ENABLE(referer-log,
925 AC_HELP_STRING([--enable-referer-log],[Enable logging of Referer header]),
926 [ if test "$enableval" = "yes" ; then
927 echo "Referer logging enabled"
928 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
929 By default, they are written to referer.log in the Squid log
936 AC_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]),
937 [ if test "$enableval" = "no" ; then
938 echo "Web Cache Coordination Protocol disabled"
942 if test $USE_WCCP = 1; then
943 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
947 AC_ARG_ENABLE(wccpv2,
948 AC_HELP_STRING([--disable-wccpv2],
949 [Disable Web Cache Coordination V2 Protocol]),
950 [ if test "$enableval" = "no" ; then
951 echo "Web Cache Coordination V2 Protocol disabled"
955 if test $USE_WCCPv2 = 1; then
956 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
959 AC_ARG_ENABLE(kill-parent-hack,
960 AC_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]),
961 [ if test "$enableval" = "yes" ; then
962 echo "Kill parent on shutdown"
963 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
964 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
971 AC_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]),
972 [ if test "$enableval" = "no" ; then
973 echo "SNMP monitoring disabled"
977 if test x"$USE_SNMP" = xtrue; then
978 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
979 SNMPLIB='../snmplib/libsnmp.a'
982 AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
984 AC_SUBST(makesnmplib)
986 AC_ARG_ENABLE(cachemgr-hostname,
987 AC_HELP_STRING([--enable-cachemgr-hostname=hostname],
988 [Make cachemgr.cgi default to this host.
989 If unspecified, uses the name of the build-host]),
992 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
993 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
994 echo "Cachemgr default hostname == host where cachemgr runs"
1000 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1001 echo "Cachemgr default hostname set to ${enableval}"
1006 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
1007 AC_ARG_ENABLE(arp-acl,
1008 AC_HELP_STRING([--enable-arp-acl],
1009 [Enable use of ARP ACL lists (ether address)]),
1010 [ if test "$enableval" = "yes" ; then
1011 echo "ARP ACL lists enabled (ether address)"
1024 LIBS="$LIBS -liphlpapi"
1027 LIBS="$LIBS -liphlpapi"
1030 echo "WARNING: ARP ACL support probably won't work on $host."
1034 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, ?).])
1035 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
1040 AM_CONDITIONAL(ENABLE_HTCP, false)
1042 AC_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]),
1043 [ if test "$enableval" = "no" ; then
1044 echo "HTCP support disabled"
1047 if test x$USE_HTCP = xtrue; then
1048 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1050 AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
1052 dnl SSL is not enabled by default.
1053 AM_CONDITIONAL(ENABLE_SSL, false)
1055 dnl Default is to use OpenSSL when available
1057 AC_HELP_STRING([--enable-ssl],[Enable ssl gatewaying support using OpenSSL]),
1058 [ if test "$enableval" != "no"; then
1059 echo "SSL gatewaying using OpenSSL enabled"
1060 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
1061 AM_CONDITIONAL(ENABLE_SSL, true)
1064 dnl Native Windows port of OpenSSL needs -lgdi32
1065 SSLLIB='-lssleay32 -leay32 -lgdi32'
1068 SSLLIB='-lssl -lcrypto'
1075 dnl User may specify OpenSSL is needed from a non-standard location
1076 AC_ARG_WITH(openssl,
1077 AC_HELP_STRING([--with-openssl{=PATH}],
1078 [Compile with the OpenSSL libraries. The path to
1079 the OpenSSL development libraries and headers
1080 installation can be specified if outside of the
1081 system standard directories]),
1083 case "$with_openssl" in
1091 SSLLIBDIR="$with_openssl/lib"
1092 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1096 if test -n "$USE_OPENSSL"; then
1097 echo "Using OpenSSL MD5 implementation"
1098 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)])
1099 if test -z "$SSLLIB"; then
1100 SSLLIB="-lcrypto" # for MD5 routines
1102 dnl This is a workaround for RedHat 9 brain damage..
1103 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
1104 echo "OpenSSL depends on Kerberos"
1105 SSLLIBDIR="/usr/kerberos/lib"
1106 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1109 if test -n "$SSLLIBDIR"; then
1110 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1115 AC_ARG_ENABLE(forw-via-db,
1116 AC_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]),
1117 [ if test "$enableval" = "yes" ; then
1118 echo "FORW-VIA enabled"
1119 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
1123 AC_ARG_ENABLE(cache-digests,
1124 AC_HELP_STRING([--enable-cache-digests],
1126 See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
1127 [ if test "$enableval" = "yes" ; then
1128 echo "USE_CACHE_DIGESTS enabled"
1129 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
1133 dnl Size of COSS memory buffer
1134 AC_ARG_WITH(coss-membuf-size,
1135 AC_HELP_STRING([--with-coss-membuf-size=size],
1136 [COSS membuf size (default 1048576 bytes)]),
1137 [ if test -n "$withval" -a "x$withval" != "xno" ; then
1138 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
1139 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
1143 dnl check for netio plugin stuff
1148 AC_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
1150 case "$enableval" in
1152 echo "Forcing poll() to be enabled"
1156 echo "Forcing poll() to be disabled"
1164 AC_ARG_ENABLE(select,
1165 AC_HELP_STRING([--disable-select],[Disable select(2) support.]),
1167 case "$enableval" in
1169 echo "Forcing select() to be enabled"
1170 SELECT_TYPE="select"
1173 echo "Forcing select() to be disabled"
1180 dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1182 AC_ARG_ENABLE(kqueue,
1183 AC_HELP_STRING([--enable-kqueue],[Enable kqueue(2) support (experimental).]),
1185 case "$enableval" in
1187 echo "Forcing kqueue() to be enabled"
1188 SELECT_TYPE="kqueue"
1189 AC_CHECK_HEADERS([sys/event.h],[],
1190 [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ])
1193 echo "Forcing kqueue() to be disabled"
1197 AC_CHECK_HEADERS([sys/event.h])
1204 AC_ARG_ENABLE(epoll,
1205 AC_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
1207 case "$enableval" in
1209 echo "Forcing epoll() to be enabled"
1211 dnl epoll requires header file and library to be installed
1212 AC_CHECK_HEADERS([sys/epoll.h],[],
1213 [ AC_MSG_ERROR([required sys/epoll.h header file is missing.]) ])
1214 AC_CHECK_LIB(epoll, epoll_ctl, [],
1215 [ AC_MSG_ERROR([required libepoll library is missing.]) ])
1218 echo "Forcing epoll() to be disabled"
1223 dnl epoll requires sys/epoll.h and libepoll
1224 if test -z "$disable_epoll"; then
1225 # Check for libepoll
1227 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
1228 AC_SUBST(EPOLL_LIBS)
1230 # Check for epoll_ctl, may need -lepoll
1232 LIBS="$LIBS $LIB_EPOLL"
1233 AC_CHECK_FUNCS(epoll_ctl)
1236 AC_CHECK_HEADERS([sys/epoll.h])
1238 dnl Verify that epoll really works
1239 if test $ac_cv_func_epoll_ctl = yes; then
1240 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
1242 #include <sys/epoll.h>
1245 int main(int argc, char **argv)
1247 int fd = epoll_create(256);
1249 perror("epoll_create:");
1254 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
1258 dnl Disable HTTP violations
1260 AC_ARG_ENABLE(http-violations,
1261 AC_HELP_STRING([--disable-http-violations],
1262 [This allows you to remove code which is known to
1263 violate the HTTP protocol specification.]),
1264 [ if test "$enableval" = "no" ; then
1265 echo "Disabling HTTP Violations"
1269 if test $http_violations = 1; then
1270 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.])
1272 AC_DEFINE(HTTP_VIOLATIONS, 0)
1275 dnl Enable IPFW Transparent Proxy
1276 AC_ARG_ENABLE(ipfw-transparent,
1277 AC_HELP_STRING([--enable-ipfw-transparent],
1278 [Enable Transparent Proxy support for systems
1279 using FreeBSD IPFW style redirection.]),
1280 [ if test "$enableval" = "yes" ; then
1281 echo "IPFW Transparent Proxy enabled"
1282 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1283 IPFW_TRANSPARENT="yes"
1285 AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1289 dnl Enable IP-Filter Transparent Proxy
1290 AC_ARG_ENABLE(ipf-transparent,
1291 AC_HELP_STRING([--enable-ipf-transparent],
1292 [Enable Transparent Proxy support for systems
1293 using IP-Filter network address redirection.]),
1294 [ if test "$enableval" = "yes" ; then
1295 echo "IP-Filter Transparent Proxy enabled"
1296 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.])
1297 IPF_TRANSPARENT="yes"
1299 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.])
1303 dnl Enable PF Transparent Proxy
1304 AC_ARG_ENABLE(pf-transparent,
1305 AC_HELP_STRING([--enable-pf-transparent],
1306 [Enable Transparent Proxy support for systems
1307 using PF network address redirection.]),
1308 [ if test "$enableval" = "yes" ; then
1309 echo "PF Transparent Proxy enabled"
1310 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1311 PF_TRANSPARENT="yes"
1313 AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1317 dnl Enable Linux Netfilter Transparent Proxy
1318 AC_ARG_ENABLE(linux-netfilter,
1319 AC_HELP_STRING([--enable-linux-netfilter],
1320 [Enable Transparent Proxy support for Linux (Netfilter)]),
1321 [ if test "$enableval" = "yes" ; then
1322 echo "Linux (Netfilter) Transparent Proxy enabled"
1323 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1324 LINUX_NETFILTER="yes"
1326 AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1330 dnl Enable Large file support
1334 AC_ARG_WITH(large-files,
1335 AC_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]),
1336 [ if test "x$withval" = "xyes"; then
1341 dnl UNIX Build environment
1342 dnl AC_HELP_STRING is not suited here because it doesn't allow to specify newlines
1343 AC_ARG_WITH(build-environment,
1344 [ --with-build-environment=model
1345 The build environment to use. Normally one of
1346 POSIX_V6_ILP32_OFF32 32 bits
1347 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1348 POSIX_V6_LP64_OFF64 64 bits
1349 POSIX_V6_LPBIG_OFFBIG large pointers and files
1350 XBS5_ILP32_OFF32 32 bits (legacy)
1351 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1352 XBS5_LP64_OFF64 64 bits (legacy)
1353 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1354 default The default for your OS],
1355 [ case "$withval" in
1357 echo "--with-build-environment expects a build environment string as used by getconf"
1361 buildmodel="$withval"
1366 if test $needlargefiles && test -z "$buildmodel"; then
1367 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
1368 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1373 if test -z "$buildmodel"; then
1374 echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
1378 case "$buildmodel" in
1380 if test "$needlargefiles"; then
1381 echo "Enabling -D_FILE_OFFSET_BITS=64"
1382 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1383 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1387 echo "Using $buildmodel build environment"
1388 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1391 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
1393 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1394 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1395 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1396 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1399 dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1400 dnl for LDFLAGS -xarch=generic64, but:
1401 dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1402 dnl For gcc "-xarch=generic64" must be replaced with "-m64"
1403 dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1405 if test "$GCC" = "yes"; then
1406 echo "Removing -Xa for gcc/g++ on $host"
1407 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1408 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1409 echo "Replacing -xarch=generic64 with -m64 for gcc/g++ on $host"
1410 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1411 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1412 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1414 echo "Removing -Usun on $host"
1415 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1416 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1419 dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1420 dnl so we must adjust something to avoid gcc errors.
1421 dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1422 dnl remove "-n32" from LDFLAGS
1423 dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1424 dnl "-64" from LDFLAGS
1426 if test "$GCC" = "yes"; then
1427 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1428 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1429 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1430 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1431 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1432 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1441 dnl Enable Linux transparent proxy support for obsolete TPROXY
1442 AC_ARG_ENABLE(linux-tproxy,
1443 AC_HELP_STRING([--enable-linux-tproxy],
1444 [Enable real Transparent Proxy support for Netfilter TPROXY
1446 [ if test "$enableval" = "yes" ; then
1447 echo "Linux Netfilter/TPROXY v2 enabled"
1448 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1450 if test -z "$LINUX_NETFILTER"; then
1451 echo "Linux-Netfilter Transparent Proxy automatically enabled"
1452 LINUX_NETFILTER="yes"
1455 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1459 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1460 dnl Enable Leak Finding Functions
1461 AC_ARG_ENABLE(leakfinder,
1462 AC_HELP_STRING([--enable-leakfinder],
1463 [Enable Leak Finding code. Enabling this alone
1464 does nothing; you also have to modify the source
1465 code to use the leak finding functions. Probably
1466 Useful for hackers only.]),
1467 [ if test "$enableval" = "yes" ; then
1468 echo "Leak-Finding enabled"
1469 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1470 USE_LEAKFINDER="yes"
1471 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1476 AC_ARG_ENABLE(follow-x-forwarded-for,
1477 AC_HELP_STRING([--enable-follow-x-forwarded-for],
1478 [Enable support for following the X-Forwarded-For
1479 HTTP header to try to find the IP address of the
1480 original or indirect client when a request has
1481 been forwarded through other proxies.]),
1482 [ if test "$enableval" = "yes" ; then
1483 echo "follow X-Forwarded-For enabled"
1487 if test $follow_xff = 1; then
1488 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1490 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1494 AC_ARG_ENABLE(ident-lookups,
1495 AC_HELP_STRING([--disable-ident-lookups],
1496 [This allows you to remove code that performs Ident (RFC 931) lookups.]),
1497 [ if test "$enableval" = "no" ; then
1498 echo "Disabling Ident Lookups"
1502 if test $use_ident = 1; then
1503 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1504 AM_CONDITIONAL(ENABLE_IDENT, true)
1506 AC_DEFINE(USE_IDENT, 0)
1507 AM_CONDITIONAL(ENABLE_IDENT, false)
1510 AM_CONDITIONAL(USE_DNSSERVER, false)
1512 AC_ARG_ENABLE(internal-dns,
1513 AC_HELP_STRING([--disable-internal-dns],
1514 [Prevents Squid from directly sending and receiving DNS messages,
1515 and instead enables the old external 'dnsserver' processes.]),
1516 [ if test "$enableval" = "no" ; then
1517 echo "Disabling Internal DNS queries"
1521 if test "$use_dnsserver" = "yes"; then
1522 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1523 AM_CONDITIONAL(USE_DNSSERVER, true)
1526 dnl Select Default hosts file location
1527 AC_ARG_ENABLE(default-hostsfile,
1528 AC_HELP_STRING([--enable-default-hostsfile=path],
1529 [Select default location for hosts file.
1530 See hosts_file directive in squid.conf for details]),
1532 if test "$enableval" != "none" ; then
1533 if test -f $enableval; then
1534 OPT_DEFAULT_HOSTS=$enableval
1536 echo "Warning Unable to find $enableval"
1540 OPT_DEFAULT_HOSTS="none"
1542 echo "Default hosts file set to: $enableval"
1543 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1544 AC_SUBST(OPT_DEFAULT_HOSTS)
1546 dnl Select auth schemes modules to build
1548 AC_HELP_STRING([--enable-auth="list of auth scheme modules"],
1549 [Build support for the list of authentication schemes.
1550 The default is to build support for the Basic scheme.
1551 See src/auth for a list of available modules, or
1552 Programmers Guide section authentication schemes
1553 for details on how to build your custom auth scheme
1555 [ case $enableval in
1557 for dir in $srcdir/src/auth/*; do
1558 module="`basename $dir`"
1559 if test -d "$dir" && test "$module" != CVS; then
1560 AUTH_MODULES="$AUTH_MODULES $module"
1567 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1571 [ if test -z "$AUTH_MODULES"; then
1572 AUTH_MODULES="ntlm basic digest negotiate"
1575 if test -n "$AUTH_MODULES"; then
1576 for module in $AUTH_MODULES; do
1577 if test -d $srcdir/src/auth/$module; then
1580 AC_MSG_ERROR(Auth scheme $module does not exist)
1582 eval AUTH_MODULE_${module}=yes
1584 echo "Auth scheme modules built: $AUTH_MODULES"
1585 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1586 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1588 echo "Auth scheme modules built: None"
1591 for module in $AUTH_MODULES; do
1592 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1594 AC_SUBST(AUTH_MODULES)
1596 AC_SUBST(AUTH_LINKOBJS)
1599 dnl bundled auth modules, in order to have handy defines for the cppunit testsuite
1600 test -n "$AUTH_MODULE_basic" && AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built])
1601 test -n "$AUTH_MODULE_digest" && AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built])
1602 test -n "$AUTH_MODULE_ntlm" && AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
1603 test -n "$AUTH_MODULE_negotiate" && AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built])
1605 dnl Select basic auth scheme helpers to build
1606 if test -n "$AUTH_MODULE_basic"; then
1607 BASIC_AUTH_HELPERS="all"
1609 AC_ARG_ENABLE(basic-auth-helpers,
1610 AC_HELP_STRING([--enable-basic-auth-helpers="list of helpers"],
1611 [This option selects which basic scheme proxy_auth
1612 helpers to build and install as part of the normal
1613 build process. For a list of available
1614 helpers see the helpers/basic_auth directory.]),
1615 [ case "$enableval" in
1617 BASIC_AUTH_HELPERS="all"
1620 BASIC_AUTH_HELPERS=""
1623 if test -z "$AUTH_MODULE_basic"; then
1624 echo "WARNING: Basic auth helpers selected without the basic scheme enabled"
1627 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1631 if test "$BASIC_AUTH_HELPERS" = "all" ; then
1632 BASIC_AUTH_HELPERS=""
1633 for dir in $srcdir/helpers/basic_auth/*; do
1634 helper="`basename $dir`"
1635 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1636 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1640 if test -n "$BASIC_AUTH_HELPERS"; then
1641 for helper in $BASIC_AUTH_HELPERS; do
1642 if test -d $srcdir/helpers/basic_auth/$helper; then
1649 AC_MSG_ERROR(Basic auth helper $helper does not exist)
1652 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1654 AC_SUBST(BASIC_AUTH_HELPERS)
1656 dnl Select ntlm auth helpers to build
1657 if test -n "$AUTH_MODULE_ntlm"; then
1658 NTLM_AUTH_HELPERS="all"
1660 AC_ARG_ENABLE(ntlm-auth-helpers,
1661 AC_HELP_STRING([--enable-ntlm-auth-helpers="list of helpers"],
1662 [This option selects which proxy_auth ntlm helpers
1663 to build and install as part of the normal build
1664 process. For a list of available helpers see
1665 the helpers/ntlm_auth directory.]),
1666 [ case "$enableval" in
1668 NTLM_AUTH_HELPERS="all"
1671 NTLM_AUTH_HELPERS=""
1674 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1678 if test "$NTLM_AUTH_HELPERS" = "all" ; then
1679 NTLM_AUTH_HELPERS=""
1680 for dir in $srcdir/helpers/ntlm_auth/*; do
1681 helper="`basename $dir`"
1682 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1683 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1687 if test -n "$NTLM_AUTH_HELPERS"; then
1688 for helper in $NTLM_AUTH_HELPERS; do
1689 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1692 AC_MSG_ERROR(NTLM Auth helper $helper does not exist)
1695 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1697 AC_SUBST(NTLM_AUTH_HELPERS)
1699 dnl Select negotiate auth helpers to build
1700 if test -n "$AUTH_MODULE_negotiate"; then
1701 NEGOTIATE_AUTH_HELPERS="all"
1703 AC_ARG_ENABLE(negotiate-auth-helpers,
1704 AC_HELP_STRING([--enable-negotiate-auth-helpers="list of helpers"],
1705 [This option selects which proxy_auth negotiate helpers
1706 to build and install as part of the normal build
1707 process. For a list of available helpers see
1708 the helpers/negotiate_auth directory.]),
1709 [ case "$enableval" in
1711 NEGOTIATE_AUTH_HELPERS="all"
1714 NEGOTIATE_AUTH_HELPERS=""
1717 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1721 if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1722 NEGOTIATE_AUTH_HELPERS=""
1723 for dir in $srcdir/helpers/negotiate_auth/*; do
1724 helper="`basename $dir`"
1725 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1726 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1730 if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1731 for helper in $NEGOTIATE_AUTH_HELPERS; do
1732 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1735 AC_MSG_ERROR(Negotiate Auth helper $helper does not exist)
1738 echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
1740 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1741 AC_CONFIG_SUBDIRS(helpers/negotiate_auth/squid_kerb_auth)
1743 dnl Select digest auth scheme helpers to build
1744 if test -n "$AUTH_MODULE_digest"; then
1745 DIGEST_AUTH_HELPERS=all
1747 AC_ARG_ENABLE(digest-auth-helpers,
1748 AC_HELP_STRING([--enable-digest-auth-helpers="list of helpers"],
1749 [This option selects which digest scheme authentication
1750 helpers to build and install as part of the normal build
1751 process. For a list of available helpers see the
1752 helpers/digest_auth directory.]),
1753 [ case "$enableval" in
1755 DIGEST_AUTH_HELPERS="all"
1758 DIGEST_AUTH_HELPERS=""
1761 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1765 if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1766 DIGEST_AUTH_HELPERS=""
1767 for dir in $srcdir/helpers/digest_auth/*; do
1768 helper="`basename $dir`"
1769 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1770 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1774 if test -n "$DIGEST_AUTH_HELPERS"; then
1775 for helper in $DIGEST_AUTH_HELPERS; do
1776 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1779 AC_MSG_ERROR(digest auth helper $helper does not exist)
1782 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1784 AC_SUBST(DIGEST_AUTH_HELPERS)
1786 dnl Enable "NTLM fail open"
1787 AC_ARG_ENABLE(ntlm-fail-open,
1788 AC_HELP_STRING([--enable-ntlm-fail-open],
1789 [Enable NTLM fail open, where a helper that fails one of the
1790 Authentication steps can allow squid to still authenticate
1792 [ if test "$enableval" = "yes" ; then
1793 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.])
1797 dnl Select external_acl helpers to build
1798 EXTERNAL_ACL_HELPERS=all
1799 AC_ARG_ENABLE(external-acl-helpers,
1800 AC_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
1801 [This option selects which external_acl helpers to
1802 build and install as part of the normal build
1803 process. For a list of available helpers see the
1804 helpers/external_acl directory.]),
1805 [ case "$enableval" in
1807 EXTERNAL_ACL_HELPERS=all
1810 EXTERNAL_ACL_HELPERS=""
1813 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1817 if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
1818 EXTERNAL_ACL_HELPERS=""
1819 for dir in $srcdir/helpers/external_acl/*; do
1820 helper="`basename $dir`"
1821 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1822 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1826 if test -n "$EXTERNAL_ACL_HELPERS"; then
1827 for helper in $EXTERNAL_ACL_HELPERS; do
1828 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1831 AC_MSG_ERROR(external acl helper $helper does not exist)
1834 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1836 AC_SUBST(EXTERNAL_ACL_HELPERS)
1838 AC_ARG_WITH(valgrind-debug,
1839 AC_HELP_STRING([--with-valgrind-debug],
1840 [Include debug instrumentation for use with valgrind]),
1849 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1853 if test $valgrind; then
1854 AC_CHECK_HEADERS(valgrind/memcheck.h,
1855 [ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
1856 echo "Valgrind debug support enabled" ],
1857 [ echo "Valgrind header not found. Valgrind support disabled." ]
1862 dnl Disable "memPools" code
1863 AC_ARG_ENABLE(mempools,
1864 AC_HELP_STRING([--disable-mempools],
1865 [Disable memPools. Note that this option now simply sets the
1866 default behaviour. Specific classes can override this at runtime, and
1867 only lib/MemPool.c needs to be altered to change the squid-wide
1868 default for all classes.]),
1869 [ if test "$enableval" = "no" ; then
1870 echo "memPools disabled"
1871 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1873 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1876 [ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1879 dnl Enable WIN32 Service compile mode
1880 AC_ARG_ENABLE(win32-service,
1881 AC_HELP_STRING([--enable-win32-service],
1882 [Compile Squid as a WIN32 Service.
1883 Works only on MS-Windows platforms (NT and up).]),
1884 [ if test "$enableval" = "yes" ; then
1885 echo "Enabling WIN32 run service mode"
1886 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1891 dnl Check for Cyrus SASL
1892 if test "$require_sasl" = "yes"; then
1893 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1894 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1898 if test "$ac_cv_header_sasl_h" = "yes"; then
1902 AC_MSG_ERROR(Neither SASL nor SASL2 found)
1908 dnl Disable "unlinkd" code
1909 AC_ARG_ENABLE(unlinkd,
1910 AC_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]),
1911 [ if test "$enableval" = "no" ; then
1917 # Here we should probably use some magic depending on the selected
1921 if test "$use_unlinkd" = "yes"; then
1922 echo "unlinkd enabled"
1923 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1924 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1926 echo "unlinkd disabled"
1927 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1930 dnl Enable backtraces on fatal errors
1931 AC_ARG_ENABLE(stacktraces,
1932 AC_HELP_STRING([--enable-stacktraces],
1933 [Enable automatic call backtrace on fatal errors]),
1934 [ if test "$enableval" = "yes" ; then
1935 echo "Enabling automatic stack backtraces on fatal errors"
1936 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1940 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1941 dnl Enable USE_XPROF_STATS
1942 AC_ARG_ENABLE(cpu-profiling,
1943 AC_HELP_STRING([--enable-cpu-profiling],
1944 [Enable instrumentation to try and understand how CPU power
1945 is spent by squid, by enabling specific probes in selected
1946 functions. New probes can only be added by modifying the source code.
1947 It is meant to help developers in optimizing performance
1948 of Squid internal functions.
1949 If you are not developer you shouldn't enable this,
1950 as it slows squid down somewhat. See lib/Profiler.c for more details.]),
1951 [ if test "$enableval" = "yes" ; then
1952 echo "Enabling cpu-profiling"
1953 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1954 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1958 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1959 AC_ARG_ENABLE(x_accelerator_vary,
1960 AC_HELP_STRING([--enable-x-accelerator-vary],
1961 [Enable support for the X-Accelerator-Vary
1962 HTTP header. Can be used to indicate
1963 variance within an accelerator setup.
1964 Typically used together with other code
1965 that adds custom HTTP headers to the requests.]),
1966 [ if test "$enableval" = "yes" ; then
1967 echo "Enabling support for X-Accelerator-Vary"
1968 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1972 dnl Enable IPv6 support
1973 AC_MSG_CHECKING([whether to enable IPv6])
1976 AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1977 [ if test "x$enableval" = "xyes" ; then
1983 ],[AC_MSG_RESULT(yes)])
1985 if test "$use_ipng" = "yes"; then
1987 dnl Solaris 10/11 requires -lsocket
1990 LIBS="$LIBS -lsocket"
1995 AC_CACHE_CHECK([if PF_INET6 is available], $use_ipng,
1997 [ /* PF_INET6 available check */
1998 # include <sys/types.h>
1999 # include <sys/socket.h>
2001 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
2007 [ AC_MSG_RESULT(yes)
2018 if test "$use_ipng" = "yes"; then
2020 AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
2022 dnl Check for IPv6 Windows Vista option
2023 dnl Also useful for other OS with hybrid-stack defaults turned OFF
2024 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
2026 dnl Check for Windows XP option
2027 AC_MSG_CHECKING([for IPv6 split-stack requirement])
2028 AC_ARG_WITH(ipv6-split-stack,
2029 AC_HELP_STRING([--with-ipv6-split-stack],
2030 [Enable experimental split-stack support for Windows XP. Requires IPv6.]),
2031 [ AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
2032 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2035 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(no)]
2038 dnl Check for IPv6-localhost option
2039 AC_MSG_CHECKING([for IPv6-Localhost requirement])
2040 AC_ARG_WITH(localhost-ipv6,
2041 AC_HELP_STRING([--with-localhost-ipv6],
2042 [WARNING: This is an RFC violation!
2043 Treat 127.0.0.1 and ::1 as identical and convert all inputs of localhost to ::1.
2044 This depends on IPv6 support and all applications squid contacts
2045 via localhost being IPv6 enabled.]),
2046 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [Convert IPv4-localhost requests to IPv6. Default: keep seperate.]) AC_MSG_RESULT(yes)],
2047 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [Convert IPv4-localhost requests to IPv6. Default: Keep seperate.]) AC_MSG_RESULT(no)]
2051 # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
2052 echo "WARNING: IPv6 is not available on this system."
2053 AC_DEFINE(USE_IPV6,0,[Enable support for IPv6])
2054 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
2055 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
2056 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
2059 AC_ARG_ENABLE(zph-qos,
2060 AC_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]),
2061 [ if test "$enableval" = "yes" ; then
2062 echo "ZPH QOS enabled"
2063 AC_DEFINE(USE_ZPH_QOS,1,
2064 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
2065 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
2069 dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2070 AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2071 ac_cv_have_ss_len_in_struct_ss, [
2073 #include <sys/types.h>
2074 #include <sys/socket.h>
2075 #include <netinet/in.h>
2077 [ struct sockaddr_storage s; s.ss_len = 1; ],
2078 [ ac_cv_have_ss_len_in_struct_ss="yes" ],
2079 [ ac_cv_have_ss_len_in_struct_ss="no" ]
2082 if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2083 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2085 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2088 dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2089 AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2090 ac_cv_have_sin_len_in_struct_sai, [
2092 #include <sys/types.h>
2093 #include <sys/socket.h>
2094 #include <netinet/in.h>
2096 [ struct sockaddr_in s; s.sin_len = 1; ],
2097 [ ac_cv_have_sin_len_in_struct_sai="yes" ],
2098 [ ac_cv_have_sin_len_in_struct_sai="no" ]
2101 if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
2102 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2104 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2107 dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2108 AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2109 ac_cv_have_sin6_len_in_struct_sai, [
2111 #include <sys/types.h>
2112 #include <sys/socket.h>
2113 #include <netinet/in.h>
2115 [ struct sockaddr_in6 s; s.sin6_len = 1; ],
2116 [ ac_cv_have_sin6_len_in_struct_sai="yes" ],
2117 [ ac_cv_have_sin6_len_in_struct_sai="no" ]
2120 if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2121 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2123 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2126 dnl --with-maxfd present for compatibility with Squid-2.
2127 dnl undocumented in ./configure --help to encourage using the Squid-3 directive.
2132 squid_filedescriptors_num=$withval
2135 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
2139 AC_ARG_WITH(filedescriptors,
2140 AC_HELP_STRING([--with-filedescriptors=NUMBER],
2141 [Force squid to support NUMBER filedescriptors]),
2145 squid_filedescriptors_num=$withval
2148 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
2153 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
2154 if $CPPUNITCONFIG --help >/dev/null; then
2155 echo "using system installed cppunit"
2156 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2158 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2160 echo "cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail."
2162 SQUID_CPPUNIT_LIBS=''
2163 SQUID_CPPUNIT_INC=''
2166 AC_ARG_WITH(cppunit-basedir,
2167 AC_HELP_STRING([--with-cppunit-basedir=PATH],
2168 [Path where the cppunit headers are libraries are found
2169 for unit testing.]),
2170 [ if test -f $withval/include/cppunit/TestCase.h; then
2171 echo "Using cppunit includes from $withval"
2172 SQUID_CPPUNIT_INC="-I${withval}/include"
2174 AC_MSG_ERROR(Cannot find cppunit at $withval)
2176 if test -f $withval/lib/libcppunit.la; then
2177 echo "Using cppunit lib from $withval"
2178 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2179 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2181 AC_MSG_ERROR(Cannot find cppunit at $withval)
2185 AC_SUBST(SQUID_CPPUNIT_LIBS)
2186 AC_SUBST(SQUID_CPPUNIT_LA)
2187 AC_SUBST(SQUID_CPPUNIT_INC)
2189 # Force some compilers to use ANSI features
2193 if test "$ac_cv_prog_CC" = "cc" ; then
2194 echo "adding '-std1' to cc args for $host"
2200 if test "$ac_cv_prog_CC" = "cc" ; then
2201 echo "adding '-Ae' to cc args for $host"
2208 dnl Check for programs
2212 AC_PATH_PROG(SH, sh, /bin/sh)
2213 AC_PATH_PROG(FALSE, false, /usr/bin/false)
2214 AC_PATH_PROG(TRUE, true, /usr/bin/true)
2215 AC_PATH_PROG(RM, rm, $FALSE)
2216 AC_PATH_PROG(MV, mv, $FALSE)
2217 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
2218 AC_PATH_PROG(LN, ln, cp)
2219 AC_PATH_PROG(PERL, perl, none)
2220 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2221 AC_PATH_PROG(AR, ar, $FALSE)
2223 if test "$ac_cv_path_PERL" = "none"; then
2224 echo "Perl is required to compile Squid"
2225 echo "Please install Perl and then re-run configure"
2231 echo "Disabling 'ranlib' for HP-UX..."
2245 dnl Check for headers
2277 netinet/in_systm.h \
2278 netinet/ip_fil_compat.h \
2336 linux/netfilter_ipv4.h \
2337 linux/netfilter_ipv4/ip_tproxy.h \
2339 SQUID_DEFAULT_INCLUDES
2343 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2344 #if HAVE_NETINET_IN_H
2345 #include <netinet/in.h>
2349 dnl *BSD dont include the depenencies for all their net/ and netinet/ files
2350 dnl We must include a few basic type headers for them to work.
2357 netinet/ip_compat.h\
2366 SQUID_BSDNET_INCLUDES)
2368 AC_CHECK_HEADERS([libxml/parser.h], [], [
2369 SAVED_CPPFLAGS="$CPPFLAGS"
2370 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2371 unset ac_cv_header_libxml_parser_h
2372 AC_CHECK_HEADERS([libxml/parser.h], [], [
2373 CPPFLAGS="$SAVED_CPPFLAGS"
2381 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2384 #include <sys/time.h>
2391 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2392 #if HAVE_SYS_TYPES_H
2393 #include <sys/types.h>
2399 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2400 #if HAVE_SYS_TYPES_H
2401 #include <sys/types.h>
2407 dnl Override rusage() detect on MinGW because is emulated in source code
2410 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2411 ac_cv_func_getrusage='yes'
2412 echo "Using own rusage on Windows."
2415 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2417 #include <sys/time.h>
2419 #if HAVE_SYS_RESOURCE_H
2420 #include <sys/resource.h>
2425 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2426 #if HAVE_SYS_TYPES_H
2427 #include <sys/types.h>
2429 #include <netinet/in.h>
2430 #include <netinet/in_systm.h>
2431 #include <netinet/ip.h>
2432 #if defined (__linux__) || defined (__CYGWIN__)
2441 dnl Check for typedefs
2442 AC_CHECK_SIZEOF(void *)
2444 dnl 8 bit integers - int8_t
2445 dnl if this is defined we trust it to be 8 bits
2446 AC_CHECK_TYPE(int8_t,[
2447 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2448 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2449 ],,SQUID_DEFAULT_INCLUDES)
2452 AC_CHECK_TYPE(char,[
2453 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2454 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2455 ],,SQUID_DEFAULT_INCLUDES)
2457 dnl unsigned 8 bit ints - u_int8_t
2458 dnl if this is defined we trust it to be 8 bits
2459 AC_CHECK_TYPE(u_int8_t,[
2460 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2461 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2462 ],,SQUID_DEFAULT_INCLUDES)
2465 dnl if this is defined we trust it to be 8 bits
2466 AC_CHECK_TYPE(uint8_t,[
2467 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2468 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2469 ],,SQUID_DEFAULT_INCLUDES)
2471 dnl 16 bit integers - int16_t
2472 dnl if this is defined we trust it to be 16 bits
2473 AC_CHECK_TYPE(int16_t,[
2474 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2475 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2476 ],,SQUID_DEFAULT_INCLUDES)
2479 AC_CHECK_TYPE(short,[
2480 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2481 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2482 ],,SQUID_DEFAULT_INCLUDES)
2486 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2487 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2488 ],,SQUID_DEFAULT_INCLUDES)
2490 dnl unsigned 16 bit ints - u_int16_t
2491 dnl if this is defined we trust it to be 16 bits
2492 AC_CHECK_TYPE(u_int16_t,[
2493 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2494 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2495 ],,SQUID_DEFAULT_INCLUDES)
2498 dnl if this is defined we trust it to be 16 bits
2499 AC_CHECK_TYPE(uint16_t,[
2500 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2501 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2502 ],,SQUID_DEFAULT_INCLUDES)
2504 dnl 32 bit signed int - int32_t
2505 dnl if this is defined we trust it to be 32 bits
2506 AC_CHECK_TYPE(int32_t,[
2507 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2508 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2509 ],,SQUID_DEFAULT_INCLUDES)
2512 AC_CHECK_TYPE(long,[
2513 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2514 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2515 ],,SQUID_DEFAULT_INCLUDES)
2517 dnl 32 bit unsigned int - u_int32_t
2518 dnl if this is defined we trust it to be 32 bits
2519 AC_CHECK_TYPE(u_int32_t,[
2520 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2521 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2522 ],,SQUID_DEFAULT_INCLUDES)
2525 dnl if this is defined we trust it to be 32 bits
2526 AC_CHECK_TYPE(uint32_t,[
2527 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2528 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2529 ],,SQUID_DEFAULT_INCLUDES)
2531 dnl 64 bit signed - int64_t
2532 dnl if this is defind we trust it to be 64 bits
2533 AC_CHECK_TYPE(int64_t,[
2534 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2535 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2536 ],,SQUID_DEFAULT_INCLUDES)
2539 dnl if this is defind we trust it to be 64 bits
2540 AC_CHECK_TYPE(__int64,[
2541 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2542 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2543 ],,SQUID_DEFAULT_INCLUDES)
2546 AC_CHECK_TYPE(long long,[
2547 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2548 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2549 ],,SQUID_DEFAULT_INCLUDES)
2551 dnl 64 bit unsigned - u_int64_t
2552 dnl if this is defind we trust it to be 64 bits
2553 AC_CHECK_TYPE(u_int64_t,[
2554 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2555 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2556 ],,SQUID_DEFAULT_INCLUDES)
2559 dnl if this is defind we trust it to be 64 bits
2560 AC_CHECK_TYPE(uint64_t,[
2561 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2562 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2563 ],,SQUID_DEFAULT_INCLUDES)
2565 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2566 dnl that is incompatible with the updated Solaris header files.
2567 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2568 AC_CHECK_TYPE(pad128_t,
2569 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2570 ,SQUID_DEFAULT_INCLUDES)
2572 AC_CHECK_TYPE(upad128_t,
2573 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2574 ,SQUID_DEFAULT_INCLUDES)
2576 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2577 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2578 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2579 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2580 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2581 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2582 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2583 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2585 dnl Check for special functions
2588 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2589 #include <sys/types.h>
2590 #include <sys/socket.h>
2596 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2597 #include <sys/ipc.h>
2598 #include <sys/msg.h>])
2600 dnl Check for needed libraries
2601 AC_CHECK_LIB(nsl, main)
2602 AC_CHECK_LIB(socket, main)
2603 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2606 AC_MSG_CHECKING(for winsock)
2608 for curlib in ws2_32 wsock32; do
2609 LIBS="$LIBS -l$curlib"
2611 char __attribute__((stdcall)) socket(int,int,int);
2612 char __attribute__((stdcall)) select(int,int,int,int,int);
2613 char __attribute__((stdcall)) closesocket(int);
2614 char __attribute__((stdcall)) gethostname(int,int);
2622 have_winsock=yes, have_winsock=no)
2624 if test $have_winsock = yes; then
2625 ac_cv_func_select='yes'
2626 if test $curlib = ws2_32; then
2627 have_winsock=winsock2
2633 AC_MSG_RESULT($have_winsock)
2634 if test $have_winsock = winsock2; then
2635 AC_CHECK_HEADERS(winsock2.h)
2637 AC_CHECK_HEADERS(winsock.h)
2642 dnl Ripped from the Samba sources
2643 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2645 #include <sys/types.h>
2648 #include <sys/socket.h>
2649 #include <sys/un.h>],
2651 struct sockaddr_un sunaddr;
2652 sunaddr.sun_family = AF_UNIX;
2654 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2655 if test x"$squid_cv_unixsocket" = x"yes"; then
2656 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2660 AC_CHECK_LIB(gnumalloc, main)
2661 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2662 echo "Disabling extended malloc functions when using gnumalloc"
2663 ac_cv_func_mallinfo=no
2664 ac_cv_func_mallocblksize=no
2665 ac_cv_func_mallopt=no
2669 echo "skipping libmalloc check for $host"
2672 echo "skipping libmalloc check for $host"
2676 AC_CHECK_LIB(malloc, main)
2681 AC_CHECK_LIB(bsd, main)
2682 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2683 AC_CHECK_LIB(bind, gethostbyname)
2684 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2687 echo "skipping libresolv checks for $host"
2690 AC_CHECK_LIB(resolv, main)
2696 echo "Use MSVCRT for math functions."
2699 AC_CHECK_LIB(m, main)
2703 dnl Check for libcrypt
2704 dnl Some of our helpers use crypt(3) which may be in libc, or in
2705 dnl libcrypt (eg FreeBSD)
2706 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2708 dnl Solaris10 provides MD5 natively through libmd5
2709 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
2713 dnl Check for libdl, used by auth_modules/PAM
2714 if test "$with_dl" = "yes"; then
2715 AC_CHECK_LIB(dl, dlopen)
2718 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2719 dnl Robert Side <rside@aiinc.bc.ca>
2720 dnl Mon, 18 Jan 1999 17:48:00 GMT
2723 AC_CHECK_LIB(intl, strftime)
2727 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2728 dnl only with Windows LDAP libraries using -lwldap32
2731 LIB_LDAP="-lwldap32"
2736 dnl LDAP helpers need to know if -llber is needed or not
2737 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2746 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
2747 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2749 #if HAVE_SYS_TYPES_H
2750 #include <sys/types.h>
2760 [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)],
2761 ac_cv_dbopen_libdb="yes",
2762 ac_cv_dbopen_libdb="no")
2765 if test $ac_cv_dbopen_libdb = yes; then
2770 dnl System-specific library modifications
2774 if test "$GCC" = "yes"; then
2775 echo "Removing -O for gcc on $host"
2776 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2780 echo "Removing -lsocket for IRIX..."
2781 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2782 echo "Removing -lnsl for IRIX..."
2783 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2784 ac_cv_lib_nsl_main=no
2785 echo "Removing -lbsd for IRIX..."
2786 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2788 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2789 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2790 dnl Please change your configure script. AIX doesn't need -lbsd.
2792 echo "Removing -lbsd for AIX..."
2793 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2796 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2797 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2798 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2800 [*-*-solaris2.[0-4]])
2801 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2803 [*-sony-newsos[56]*])
2804 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2808 # Remove optimization for GCC 2.95.[123]
2809 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2810 if test "$GCC" = "yes"; then
2811 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2814 echo "Removing -O for gcc on $host with GCC $GCCVER"
2815 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2820 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2823 if test `uname -v` = "2.03"; then
2824 echo "disabling mallinfo for $host"
2825 ac_cv_func_mallinfo=no
2830 dnl This has to be before AC_CHECK_FUNCS
2831 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2832 # when running configure.
2833 if test -z "$ac_cv_func_poll"; then
2836 # John Kay (jkay@nlanr.net) 19970818
2837 echo "disabling poll for $host..."
2838 ac_cv_func_poll='no'
2842 echo "disabling poll for $host..."
2843 ac_cv_func_poll='no'
2846 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2847 # poll is problematic on Linux. We disable it
2848 # by default until Linux gets it right.
2849 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2850 if test $rev -lt 002002; then
2851 echo "disabling poll for $host < 2.2..."
2852 ac_cv_func_poll='no'
2855 [powerpc-ibm-aix4.1.*])
2856 # Mike Laster (mlaster@metavillage.com) 19981021
2857 echo "disabling poll for $host..."
2858 ac_cv_func_poll='no'
2861 # Robert Side <rside@aiinc.bc.ca>
2862 # Mon, 18 Jan 1999 17:48:00 GMT
2863 echo "disabling poll for $host..."
2864 ac_cv_func_poll='no'
2869 dnl Override statfs() detect on MinGW becasue is emulated in source code
2872 ac_cv_func_statfs='yes'
2876 dnl Check for library functions
2878 backtrace_symbols_fd \
2908 pthread_attr_setschedparam \
2909 pthread_attr_setscope \
2910 pthread_setschedparam \
2940 dnl ... and some we provide local replacements for
2952 # check for crypt, may require -lcrypt
2954 LIBS="$LIBS $CRYPTLIB"
2955 AC_CHECK_FUNCS(crypt)
2958 dnl Magic which checks whether we are forcing a type of comm loop we
2959 dnl are actually going to (ab)use
2961 dnl Actually do the define magic now
2962 dnl mostly ripped from squid-commloops, thanks to adrian and benno
2964 if test -n "$SELECT_TYPE"; then
2965 : # Already decided above. Nothing to do here
2966 elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
2968 elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
2969 SELECT_TYPE="kqueue"
2970 elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
2972 elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
2975 SELECT_TYPE="select_win32"
2978 SELECT_TYPE="select"
2982 echo "Eep! Can't find poll, kqueue, epoll, or select!"
2983 echo "I'll try select and hope for the best."
2984 SELECT_TYPE="select"
2985 AC_DEFINE(USE_SELECT,1)
2988 echo "Using ${SELECT_TYPE} for the IO loop."
2990 AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2991 AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2992 AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2993 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2994 AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2995 AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2996 AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2998 case $SELECT_TYPE in
3000 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
3003 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
3006 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
3009 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
3012 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
3018 dnl Yay! Another Linux brokenness. Its not good enough
3019 dnl to know that setresuid() exists, because RedHat 5.0 declares
3020 dnl setresuid() but doesn't implement it.
3022 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
3026 if(setresuid(-1,-1,-1)) {
3027 perror("setresuid:");
3032 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
3034 if test "$ac_cv_func_setresuid" = "yes" ; then
3035 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.])
3038 dnl Yay! This one is a MacOSX brokenness. Its not good enough
3039 dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
3040 dnl copy that crashes with a buffer over-run!
3042 AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
3047 // we expect this to succeed, or crash on over-run.
3048 // if it passes otherwise we may need a better check.
3049 int main(int argc, char **argv)
3052 char *str = malloc(size);
3053 memset(str, 'x', size);
3054 strnstr(str, "fubar", size);
3057 ],ac_cv_func_strnstr="yes",ac_cv_func_strnstr="no")
3059 if test "$ac_cv_func_strnstr" = "yes" ; then
3060 AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
3062 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.])
3066 AM_CONDITIONAL(NEED_OWN_STRSEP, false)
3067 if test "$ac_cv_func_strsep" = "no" ; then
3068 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
3071 AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
3072 if test "$ac_cv_func_strtoll" = "no" ; then
3073 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
3077 dnl Test for va_copy
3079 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
3082 void f (int i, ...) {
3083 va_list args1, args2;
3084 va_start (args1, i);
3085 va_copy (args2, args1);
3086 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3088 va_end (args1); va_end (args2);
3094 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
3096 if test "$ac_cv_func_va_copy" = "yes" ; then
3097 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
3101 dnl Some systems support __va_copy
3103 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
3106 void f (int i, ...) {
3107 va_list args1, args2;
3108 va_start (args1, i);
3109 __va_copy (args2, args1);
3110 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3112 va_end (args1); va_end (args2);
3118 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
3120 if test "$ac_cv_func___va_copy" = "yes" ; then
3121 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
3124 dnl IP-Filter support requires ipf header files. These aren't
3125 dnl installed by default, so we need to check for them
3126 if test "$IPF_TRANSPARENT" ; then
3127 AC_MSG_CHECKING(if IP-Filter header files are installed)
3128 # hold on to your hats...
3129 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3130 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
3131 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3132 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
3133 have_ipfilter_compat_header="yes"
3135 if test "x$have_ipfilter_compat_header" = "xyes" &&
3136 test "$ac_cv_header_ip_fil_h" = "yes" &&
3137 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3138 IPF_TRANSPARENT="yes"
3139 AC_DEFINE(IPF_TRANSPARENT, 1)
3140 elif test "$have_ipfilter_compat_header" = "yes" &&
3141 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3142 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3143 IPF_TRANSPARENT="yes"
3144 AC_DEFINE(IPF_TRANSPARENT, 1)
3146 IPF_TRANSPARENT="no"
3147 AC_DEFINE(IPF_TRANSPARENT, 0)
3149 AC_MSG_RESULT($IPF_TRANSPARENT)
3151 if test "$IPF_TRANSPARENT" = "no" ; then
3152 echo "WARNING: Cannot find necessary IP-Filter header files"
3153 echo " Transparent Proxy support WILL NOT be enabled"
3155 elif test "$IPF_TRANSPARENT" = "yes" ; then
3156 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3157 dnl Solaris minor version (8, 9, 10, ...)
3160 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3161 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3162 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3169 dnl PF support requires a header file.
3170 if test "$PF_TRANSPARENT" ; then
3171 AC_MSG_CHECKING(if PF header file is installed)
3172 # hold on to your hats...
3173 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
3174 PF_TRANSPARENT="yes"
3175 AC_DEFINE(PF_TRANSPARENT, 1)
3178 AC_DEFINE(PF_TRANSPARENT, 0)
3180 AC_MSG_RESULT($PF_TRANSPARENT)
3182 if test "$PF_TRANSPARENT" = "no" ; then
3183 echo "WARNING: Cannot find necessary PF header file"
3184 echo " Transparent Proxy support WILL NOT be enabled"
3188 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3189 dnl Shamelessly copied from above
3190 if test "$LINUX_NETFILTER" ; then
3191 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
3192 # hold on to your hats...
3193 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3194 LINUX_NETFILTER="yes"
3195 AC_DEFINE(LINUX_NETFILTER, 1)
3197 LINUX_NETFILTER="no"
3198 AC_DEFINE(LINUX_NETFILTER, 0)
3200 AC_MSG_RESULT($LINUX_NETFILTER)
3202 if test "$LINUX_NETFILTER" = "no" ; then
3203 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
3204 echo " Linux Transparent and Intercepting Proxy support WILL NOT be enabled"
3208 dnl Linux Netfilter/TPROXYv2 support requires some specific header files
3209 dnl Shamelessly copied from shamelessly copied from above
3210 if test "$LINUX_TPROXY2" ; then
3211 AC_MSG_CHECKING(if TPROXYv2 header files are installed)
3212 # hold on to your hats...
3213 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
3215 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3218 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3220 AC_MSG_RESULT($LINUX_TPROXY2)
3221 if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3222 echo "WARNING: Cannot find TPROXY v2 headers, you need to patch the kernel with "
3223 echo "tproxy package from:"
3224 echo " - lynx http://www.balabit.com/downloads/files/tproxy/"
3225 echo "Or select the '--enable-linux-netfilter' option instead for Netfilter support."
3230 if test -z "$USE_GNUREGEX" ; then
3232 *-sun-solaris2.[[0-4]])
3240 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3241 if test -z "$USE_GNUREGEX"; then
3242 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
3245 AC_TRY_COMPILE([#include <sys/types.h>
3246 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
3251 AC_MSG_RESULT($USE_GNUREGEX)
3252 if test "$USE_GNUREGEX" = "yes"; then
3254 LIBREGEX="libregex.a"
3255 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
3260 dnl Not cached since people are likely to tune this
3261 AC_MSG_CHECKING(Default FD_SETSIZE value)
3270 #include <sys/time.h>
3272 #if HAVE_SYS_SELECT_H
3273 #include <sys/select.h>
3275 #if HAVE_SYS_TYPES_H
3276 #include <sys/types.h>
3279 #include <winsock.h>
3282 #include <winsock2.h>
3285 FILE *fp = fopen("conftestval", "w");
3286 fprintf (fp, "%d\n", FD_SETSIZE);
3290 DEFAULT_FD_SETSIZE=`cat conftestval`,
3291 DEFAULT_FD_SETSIZE=256,
3292 DEFAULT_FD_SETSIZE=256)
3293 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
3294 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
3297 dnl Not cached since people are likely to tune this
3298 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
3299 dnl damn! FreeBSD's pthreads breaks dup2().
3301 if test -n "$squid_filedescriptors_num" ; then
3302 SQUID_MAXFD=$squid_filedescriptors_num
3303 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3306 i386-unknown-freebsd*)
3307 if echo "$LDFLAGS" | grep -q pthread; then
3308 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3314 #include <sys/time.h> /* needed on FreeBSD */
3315 #include <sys/param.h>
3316 #include <sys/resource.h>
3320 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
3321 /* getrlimit and sysconf returns bogous values on cygwin32.
3322 * Number of fds is virtually unlimited in cygwin (sys/param.h)
3323 * __CYGWIN32__ is deprecated.
3329 #if defined(RLIMIT_NOFILE)
3330 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3331 perror("getrlimit: RLIMIT_NOFILE");
3333 #if defined(__APPLE__)
3334 /* asking for more than OPEN_MAX fails on Leopard */
3335 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3337 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3339 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3340 perror("setrlimit: RLIMIT_NOFILE");
3343 #elif defined(RLIMIT_OFILE)
3344 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3345 perror("getrlimit: RLIMIT_OFILE");
3347 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3348 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3349 perror("setrlimit: RLIMIT_OFILE");
3352 #endif /* RLIMIT_NOFILE */
3353 #endif /* HAVE_SETRLIMIT */
3354 /* by starting at 2^14, we will never get higher
3355 than 2^15 for SQUID_MAXFD */
3359 if (dup2(0, i) < 0) {
3367 #endif /* IF !DEF CYGWIN */
3368 fp = fopen("conftestval", "w");
3369 fprintf (fp, "%d\n", i & ~0x3F);
3373 SQUID_MAXFD=`cat conftestval`,
3376 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3382 AC_MSG_RESULT($SQUID_MAXFD)
3384 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3385 if test "$SQUID_MAXFD" -lt 512 ; then
3386 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
3387 echo " cache will be very busy. Please see the FAQ page"
3388 echo " http://wiki.squid-cache.org/SquidFaq/TroubleShooting"
3389 echo " on how to increase your filedescriptor limit"
3394 if test `expr $SQUID_MAXFD % 64` != 0; then
3395 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
3396 echo " on certain platforms."
3400 dnl Not cached since people are likely to tune this
3401 AC_MSG_CHECKING(Default UDP send buffer size)
3405 #include <sys/types.h>
3406 #if HAVE_SYS_SOCKET_H
3407 #include <sys/socket.h>
3409 #if HAVE_NETINET_IN_H
3410 #include <netinet/in.h>
3413 #include <winsock.h>
3416 #include <winsock2.h>
3421 int fd,val=0,len=sizeof(int);
3422 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3424 WSAStartup(2, &wsaData);
3426 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3427 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3428 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3431 if (val<=0) exit(1);
3432 fp = fopen("conftestval", "w");
3433 fprintf (fp, "%d\n", val);
3437 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3438 SQUID_DETECT_UDP_SO_SNDBUF=16384,
3439 SQUID_DETECT_UDP_SO_SNDBUF=16384)
3440 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3441 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3443 dnl Not cached since people are likely to tune this
3444 AC_MSG_CHECKING(Default UDP receive buffer size)
3448 #include <sys/types.h>
3449 #if HAVE_SYS_SOCKET_H
3450 #include <sys/socket.h>
3452 #if HAVE_NETINET_IN_H
3453 #include <netinet/in.h>
3456 #include <winsock.h>
3459 #include <winsock2.h>
3464 int fd,val=0,len=sizeof(int);
3465 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3467 WSAStartup(2, &wsaData);
3469 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3470 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3471 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3474 if (val <= 0) exit(1);
3475 fp = fopen("conftestval", "w");
3476 fprintf (fp, "%d\n", val);
3480 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3481 SQUID_DETECT_UDP_SO_RCVBUF=16384,
3482 SQUID_DETECT_UDP_SO_RCVBUF=16384)
3483 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3484 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3486 dnl Not cached since people are likely to tune this
3487 AC_MSG_CHECKING(Default TCP send buffer size)
3491 #include <sys/types.h>
3492 #if HAVE_SYS_SOCKET_H
3493 #include <sys/socket.h>
3495 #if HAVE_NETINET_IN_H
3496 #include <netinet/in.h>
3499 #include <winsock.h>
3502 #include <winsock2.h>
3507 int fd,val=0,len=sizeof(int);
3508 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3510 WSAStartup(2, &wsaData);
3512 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3513 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3514 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3517 if (val <= 0) exit(1);
3518 fp = fopen("conftestval", "w");
3519 fprintf (fp, "%d\n", val);
3523 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
3524 SQUID_TCP_SO_SNDBUF=16384,
3525 SQUID_TCP_SO_SNDBUF=16384)
3526 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3527 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3528 echo "Limiting send buffer size to 32K"
3529 SQUID_TCP_SO_SNDBUF=32768
3531 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3533 dnl Not cached since people are likely to tune this
3534 AC_MSG_CHECKING(Default TCP receive buffer size)
3538 #include <sys/types.h>
3539 #if HAVE_SYS_SOCKET_H
3540 #include <sys/socket.h>
3542 #if HAVE_NETINET_IN_H
3543 #include <netinet/in.h>
3546 #include <winsock.h>
3549 #include <winsock2.h>
3554 int fd,val=0,len=sizeof(int);
3555 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3557 WSAStartup(2, &wsaData);
3559 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3560 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3561 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3564 if (val <= 0) exit(1);
3565 fp = fopen("conftestval", "w");
3566 fprintf (fp, "%d\n", val);
3570 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
3571 SQUID_TCP_SO_RCVBUF=16384,
3572 SQUID_TCP_SO_RCVBUF=16384)
3573 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3574 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3575 echo "Limiting receive buffer size to 64K"
3576 SQUID_TCP_SO_RCVBUF=65535
3578 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3579 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3580 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
3581 ac_cv_needs_sys_errlist="no",
3582 ac_cv_needs_sys_errlist="yes")
3584 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3585 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3588 dnl Not cached since people are likely to change this
3589 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3590 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3592 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
3595 AC_MSG_CHECKING(if inet_ntoa() actually works)
3599 #include <sys/types.h>
3600 #include <netinet/in.h>
3601 #include <arpa/inet.h>
3606 in.s_addr = inet_addr("1.2.3.4");
3607 fp = fopen("conftestval", "w");
3608 fprintf (fp, "%s\n", inet_ntoa(in));
3612 INET_NTOA_RESULT=`cat conftestval`,
3613 INET_NTOA_RESULT="broken",
3614 INET_NTOA_RESULT="broken")
3615 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3616 AC_MSG_RESULT("yes")
3621 echo "Using Win32 resolver instead."
3624 echo "Will use our own inet_ntoa()."
3625 AC_LIBOBJ(inet_ntoa)
3626 # echo "WARNING: This looks bad, and probably prevents Squid from working."
3627 # echo " If you're on IRIX and using GCC 2.8, you probably need"
3628 # echo " to use the IRIX C compiler instead."
3634 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3635 AC_MSG_CHECKING(for working statvfs() interface)
3639 #include <sys/types.h>
3640 #include <sys/statvfs.h>
3644 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3645 sfs.f_files = sfs.f_ffree = 0;
3646 statvfs("/tmp", &sfs);
3648 ac_cv_func_statvfs=yes,
3649 ac_cv_func_statvfs=no)
3650 AC_MSG_RESULT($ac_cv_func_statvfs)
3651 if test "$ac_cv_func_statvfs" = "yes" ; then
3652 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3656 dnl Detect what resolver fields we have available to use...
3657 AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3659 #if HAVE_SYS_TYPES_H
3660 #include <sys/types.h>
3662 #if HAVE_NETINET_IN_H
3663 #include <netinet/in.h>
3665 #if HAVE_ARPA_INET_H
3666 #include <arpa/inet.h>
3668 #if HAVE_ARPA_NAMESER_H
3669 #include <arpa/nameser.h>
3675 [_res_ext.nsaddr_list[[0]].s_addr;],
3676 ac_cv_have_res_ext_nsaddr_list="yes",
3677 ac_cv_have_res_ext_nsaddr_list="no"))
3678 if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3679 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3680 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3683 if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
3684 AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3686 #if HAVE_SYS_TYPES_H
3687 #include <sys/types.h>
3689 #if HAVE_NETINET_IN_H
3690 #include <netinet/in.h>
3692 #if HAVE_ARPA_INET_H
3693 #include <arpa/inet.h>
3695 #if HAVE_ARPA_NAMESER_H
3696 #include <arpa/nameser.h>
3702 [_res._u._ext.nsaddrs[[0]]->sin6_addr;],
3703 ac_cv_have_res_ext_nsaddrs="yes",
3704 ac_cv_have_res_ext_nsaddrs="no"))
3705 if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3706 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3707 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3711 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3713 #if HAVE_SYS_TYPES_H
3714 #include <sys/types.h>
3716 #if HAVE_NETINET_IN_H
3717 #include <netinet/in.h>
3719 #if HAVE_ARPA_INET_H
3720 #include <arpa/inet.h>
3722 #if HAVE_ARPA_NAMESER_H
3723 #include <arpa/nameser.h>
3729 [_res.nsaddr_list[[0]];],
3730 ac_cv_have_res_nsaddr_list="yes",
3731 ac_cv_have_res_nsaddr_list="no"))
3732 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3733 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3734 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3737 if test "$_SQUID_RES_NSADDR_LIST" = ""; then
3738 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3740 #if HAVE_SYS_TYPES_H
3741 #include <sys/types.h>
3743 #if HAVE_NETINET_IN_H
3744 #include <netinet/in.h>
3746 #if HAVE_ARPA_INET_H
3747 #include <arpa/inet.h>
3749 #if HAVE_ARPA_NAMESER_H
3750 #include <arpa/nameser.h>
3756 [_res.ns_list[[0]].addr;],
3757 ac_cv_have_res_ns_list="yes",
3758 ac_cv_have_res_ns_list="no"))
3759 if test $ac_cv_have_res_ns_list = "yes" ; then
3760 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3761 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3765 dnl Squid now has .po translation capability, given the right toolkit
3766 AX_WITH_PROG([PO2HTML],[po2html])
3769 dnl Squid now has limited locale handling ...
3772 AC_ARG_ENABLE(auto-locale,
3773 AC_HELP_STRING([--disable-auto-locale],
3774 [This prevents Squid providing localized error pages based on the
3775 clients request headers.
3776 When disabled Squid requires explicit language configuration.]),
3777 [ if test "$enableval" = "no" ; then
3781 if test "$use_errlocale" = "yes" ; then
3782 echo "Enabling Multi-Language Support"
3783 AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
3785 echo "Disabling Multi-Language Support"
3786 AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
3789 dnl Need the debugging version of malloc if available
3791 if test "$ac_cv_lib_malloc_main" = "yes" ; then
3792 if test -r /usr/lib/debug/malloc.o ; then
3793 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3795 if test -r /usr/lib/debug/mallocmap.o ; then
3796 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3801 if test -z "$XTRA_LIBS"; then
3804 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3809 dnl Clean up after OSF/1 core dump bug
3822 src/adaptation/Makefile \
3831 test-suite/Makefile \
3834 helpers/basic_auth/Makefile \
3835 helpers/basic_auth/LDAP/Makefile \
3836 helpers/basic_auth/MSNT/Makefile \
3837 helpers/basic_auth/NCSA/Makefile \
3838 helpers/basic_auth/PAM/Makefile \
3839 helpers/basic_auth/SMB/Makefile \
3840 helpers/basic_auth/mswin_sspi/Makefile \
3841 helpers/basic_auth/YP/Makefile \
3842 helpers/basic_auth/getpwnam/Makefile \
3843 helpers/basic_auth/multi-domain-NTLM/Makefile \
3844 helpers/basic_auth/SASL/Makefile \
3845 helpers/basic_auth/POP3/Makefile \
3846 helpers/basic_auth/DB/Makefile \
3847 helpers/basic_auth/squid_radius_auth/Makefile \
3848 helpers/digest_auth/Makefile \
3849 helpers/digest_auth/password/Makefile \
3850 helpers/digest_auth/ldap/Makefile \
3851 helpers/digest_auth/eDirectory/Makefile \
3852 helpers/ntlm_auth/Makefile \
3853 helpers/ntlm_auth/fakeauth/Makefile \
3854 helpers/ntlm_auth/no_check/Makefile \
3855 helpers/ntlm_auth/smb_lm/Makefile \
3856 helpers/ntlm_auth/smb_lm/smbval/Makefile \
3857 helpers/ntlm_auth/mswin_sspi/Makefile \
3858 helpers/negotiate_auth/Makefile \
3859 helpers/negotiate_auth/mswin_sspi/Makefile \
3860 helpers/external_acl/Makefile \
3861 helpers/external_acl/ip_user/Makefile \
3862 helpers/external_acl/ldap_group/Makefile \
3863 helpers/external_acl/session/Makefile \
3864 helpers/external_acl/unix_group/Makefile \
3865 helpers/external_acl/wbinfo_group/Makefile \
3866 helpers/external_acl/mswin_ad_group/Makefile \
3867 helpers/external_acl/mswin_lm_group/Makefile \
3871 AC_CONFIG_SUBDIRS(lib/libTrie)
3873 # must configure libltdl subdir unconditionally for "make distcheck" to work
3874 AC_CONFIG_SUBDIRS(lib/libLtdl)