2 dnl Configuration input file for Squid
4 dnl $Id: configure.in,v 1.464 2007/08/17 18:56:24 serassio Exp $
8 AC_INIT(Squid Web Proxy, 3.0.PRE6-CVS, http://www.squid-cache.org/bugs/, squid)
10 AM_CONFIG_HEADER(include/autoconf.h)
11 AC_CONFIG_AUX_DIR(cfgaux)
12 AC_CONFIG_SRCDIR([src/main.cc])
13 AM_INIT_AUTOMAKE([tar-ustar])
14 AC_REVISION($Revision: 1.464 $)dnl
15 AC_PREFIX_DEFAULT(/usr/local/squid)
18 PRESET_CFLAGS="$CFLAGS"
19 PRESET_LDFLAGS="$LDFLAGS"
21 dnl Set default LDFLAGS
22 if test -z "$LDFLAGS"; then
40 LIBREGEX='' # libregex.a
42 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
46 if test -z "$EXEEXT"; then
49 # automake automatically adds .exe when installing binaries
54 dnl this should be expanded to a list of platform sensible support requirements.
55 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
57 mingw|mingw32|cygwin|cygwin32)
58 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
61 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
67 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
68 CFLAGS="$CFLAGS -mthreads"
69 CXXFLAGS="$CXXFLAGS -mthreads"
70 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
71 echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform"
72 echo "Please see PSAPI.DLL section on doc/win32-relnotes.html."
74 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
77 MINGW_LIBS="-lmingwex"
78 AM_CONDITIONAL(USE_IPC_WIN32, true)
82 AM_CONDITIONAL(USE_IPC_WIN32, false)
86 if test -z "$CACHE_HTTP_PORT"; then
87 CACHE_HTTP_PORT="3128"
89 if test -z "$CACHE_ICP_PORT"; then
94 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
95 [What default TCP port to use for HTTP listening?])
96 AC_SUBST(CACHE_HTTP_PORT)
97 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
98 AC_SUBST(CACHE_ICP_PORT)
99 [What default UDP port to use for ICP listening?])
101 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
103 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
105 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
108 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
112 if test "$GCC" = "yes"; then
113 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
114 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
117 if test $GCCVER2 -lt 300 ; then
118 echo "ERROR: GCC $GCCVER causes a coredump on $host"
119 echo "ERROR: Try a more recent GCC version"
128 dnl Set Default CFLAGS
129 if test -z "$PRESET_CFLAGS"; then
130 if test "$GCC" = "yes"; then
133 # sunos has too many warnings for this to be useful
137 # Motorola cc/ld does not like -02 but is ok on -O
138 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
141 CFLAGS="-Wall $CFLAGS"
147 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
148 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
149 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
150 -Wl,-woff,85,-woff,84,-woff,134 \
151 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
152 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
153 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
154 -Wl,-woff,85,-woff,84,-woff,134 \
155 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
158 # Mogul says DEC compilers take both -g and -O2
159 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
168 dnl set squid required flags
169 if test "$GCC" = "yes"; then
170 dnl Guido Serassio (serassio@squid-cache.org) 20070811
171 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
172 dnl -Wmissing-prototypes -Wmissing-declarations
173 dnl TODO: check if the problem will be present in any other newer MinGW release.
176 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
179 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
182 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
187 AC_SUBST(SQUID_CFLAGS)
188 AC_SUBST(SQUID_CXXFLAGS)
190 AC_TEST_CHECKFORHUGEOBJECTS
191 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
194 if test -z "$PRESET_LDFLAGS"; then
195 if test "$GCC" = "yes"; then
198 # Silence Linker warnings 84, 85 and 134
199 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
214 dnl Enable optional modules
215 AC_ARG_ENABLE(dlmalloc,
216 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
221 LIBDLMALLOC="libdlmalloc.a"
222 LIB_MALLOC="-L../lib -ldlmalloc"
223 echo "dlmalloc enabled"
227 echo "dlmalloc disabled"
229 *) use_dlmalloc="yes"
230 LIB_MALLOC="$enableval"
231 echo "dlmalloc enabled with $LIB_MALLOC"
234 if test "${use_dlmalloc-unset}" = unset; then
237 echo "Enabling dlmalloc for $host"
239 LIBDLMALLOC="libdlmalloc.a"
240 LIB_MALLOC="-L../lib -ldlmalloc"
243 echo "Enabling dlmalloc for $host"
245 LIBDLMALLOC="libdlmalloc.a"
246 LIB_MALLOC="-L../lib -ldlmalloc"
250 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
251 # Ok. dlmalloc was enabled before, but state may be changed.
252 # we have to test these again
253 unset ac_cv_func_mallinfo
254 unset ac_cv_func_mallocblksize
255 unset ac_cv_func_free
256 unset ac_cv_func_realloc
257 unset ac_cv_func_memalign
258 unset ac_cv_func_valloc
259 unset ac_cv_func_pvalloc
260 unset ac_cv_func_calloc
261 unset ac_cv_func_cfree
262 unset ac_cv_func_malloc_trim
263 unset ac_cv_func_malloc_usable_size
264 unset ac_cv_func_malloc_stats
265 unset ac_cv_func_mallinfo
266 unset ac_cv_func_mallopt
267 unset ac_cv_lib_gnumalloc
268 unset ac_cv_header_gnumalloc_h
269 unset ac_cv_lib_malloc
270 unset ac_cv_enabled_dlmalloc
272 if test "$use_dlmalloc" = yes; then
273 ac_cv_func_mallinfo="yes"
274 ac_cv_func_mallocblksize="no"
275 ac_cv_func_free="yes"
276 ac_cv_func_realloc="yes"
277 ac_cv_func_memalign="yes"
278 ac_cv_func_valloc="yes"
279 ac_cv_func_pvalloc="yes"
280 ac_cv_func_calloc="yes"
281 ac_cv_func_cfree="yes"
282 ac_cv_func_malloc_trim="yes"
283 ac_cv_func_malloc_usable_size="yes"
284 ac_cv_func_malloc_stats="yes"
285 ac_cv_func_mallopt="yes"
286 ac_cv_lib_gnumalloc="no"
287 ac_cv_header_gnumalloc_h="no"
288 ac_cv_lib_malloc="no"
289 ac_cv_enabled_dlmalloc="yes"
290 AC_DEFINE(USE_DLMALLOC, 1, [Compile & use the malloc package by Doug Lea])
293 AC_SUBST(LIBDLMALLOC)
296 AC_ARG_ENABLE(gnuregex,
297 [ --enable-gnuregex Compile GNUregex. Unless you have reason to use this
298 option, you should not enable it. This library file
299 is usually only required on Windows and very old
300 Unix boxes which do not have their own regex library
302 [USE_GNUREGEX=$enableval])
306 AC_ARG_ENABLE(optimizations,
307 [ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
308 Optimization is good for production builds, but not
309 good for debugging. During development, use
310 --disable-optimizations to reduce compilation times
311 and allow easier debugging. This option implicitly
312 also enabled --disable-inline],
313 [ if test "$enableval" = "no" ; then
314 echo "Disabling compiler optimizations (-O flag)"
315 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
316 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
321 AC_ARG_ENABLE(inline,
322 [ --disable-inline Don't compile trivial methods as inline. Squid
323 is coded with much of the code able to be inlined.
324 Inlining is good for production builds, but not
325 good for development. During development, use
326 --disable-inline to reduce compilation times and
327 allow incremental builds to be quick. For
328 production builds, or load tests, use
329 --enable-inline to have squid make all trivial
330 methods inlinable by the compiler.],
331 [ if test "$enableval" = "no" ; then
336 if test "$SquidInline" = "yes" ; then
337 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
338 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
340 echo "Inlining optimization disabled"
341 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
344 AC_ARG_ENABLE(debug-cbdata,
345 [ --enable-debug-cbdata Provide some debug information in cbdata],
346 [ if test "$enableval" = "yes" ; then
347 echo "cbdata debugging enabled"
348 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
352 dnl This is a developer only option.. developers know how to set defines
354 dnl AC_ARG_ENABLE(xmalloc-debug,
355 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
356 dnl [ if test "$enableval" = "yes" ; then
357 dnl echo "Malloc debugging enabled"
358 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
362 dnl This is a developer only option.. developers know how to set defines
364 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
365 dnl [ --enable-xmalloc-debug-trace
366 dnl Detailed trace of memory allocations],
367 dnl [ if test "$enableval" = "yes" ; then
368 dnl echo "Malloc debug trace enabled"
369 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
370 dnl AC_DEFINE(XMALLOC_DEBUG,1)
374 AC_ARG_ENABLE(xmalloc-statistics,
375 [ --enable-xmalloc-statistics
376 Show malloc statistics in status page],
377 [ if test "$enableval" = "yes" ; then
378 echo "Malloc statistics enabled"
379 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
385 [ --disable-carp Disable CARP support],
386 [ if test "$enableval" = "no" ; then
391 if test $use_carp = 1; then
392 AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol])
395 AC_ARG_ENABLE(async-io,
396 [ --enable-async-io[=N_THREADS]
398 --with-aufs-threads=N_THREADS
400 --enable-storeio=ufs,aufs],
404 STORE_MODULES="ufs aufs"
409 aufs_io_threads=$enableval
411 STORE_MODULES="ufs aufs"
416 AC_ARG_WITH(aufs-threads,
417 [ --with-aufs-threads=N_THREADS
418 Tune the number of worker threads for the aufs object
422 aufs_io_threads=$withval
425 echo "ERROR: Invalid --with-aufs-threads argument"
430 if test "$aufs_io_threads"; then
431 echo "With $aufs_io_threads aufs threads"
432 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
433 [Defines how many threads aufs uses for I/O])
436 AC_ARG_WITH(pthreads,
437 [ --with-pthreads Use POSIX Threads])
438 if test "$with_pthreads" = "yes"; then
443 [ --with-aio Use POSIX AIO])
444 if test "$with_aio" = "yes"; then
449 [ --with-dl Use dynamic linking])
450 if test "$with_dl" = "yes"; then
454 AC_ARG_ENABLE(storeio,
455 [ --enable-storeio=\"list of modules\"
456 Build support for the list of store I/O modules.
457 The default is only to build the "ufs" module.
458 See src/fs for a list of available modules, or
459 Programmers Guide section <not yet written>
460 for details on how to build your custom store module],
463 for dir in $srcdir/src/fs/*; do
464 module="`basename $dir`"
465 if test -d "$dir" && test "$module" != CVS; then
466 STORE_MODULES="$STORE_MODULES $module"
473 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
477 [ if test -z "$STORE_MODULES"; then
481 if test -n "$STORE_MODULES"; then
482 for module in $STORE_MODULES; do
483 if test -d $srcdir/src/fs/$module; then
486 echo "ERROR: storeio $module does not exists"
490 echo "Store modules built: $STORE_MODULES"
492 for module in $STORE_MODULES; do
493 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
496 dnl remove all but diskd - its the only module that needs to recurse
497 dnl into the sub directory
505 for fs in $STORE_MODULES none; do
510 NEED_DISKDAEMON="true"
515 NEED_DISKTHREADS="true"
520 dnl Automake om MinGW needs explicit exe extension
521 dnl for STORE_TESTS substition
523 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
526 STORE_TESTS="$STORE_TESTS tests/testNull$EXEEXT"
530 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
535 dnl We have 'fake' modules - aufs and diskd - legacy.
536 for fs in $STORE_MODULES; do
541 STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
542 STORE_LIBS="$STORE_LIBS lib${fs}.a"
547 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
548 echo "adding UFS, as it contains core logic for diskd and aufs"
549 STORE_OBJS="$STORE_OBJS fs/libufs.a"
550 STORE_LIBS="$STORE_LIBS libufs.a"
551 STORE_MODULES="$STORE_MODULES ufs"
552 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
554 dnl Automake om MinGW needs explicit exe extension
555 dnl for STORE_TESTS substition
557 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
562 AC_SUBST(STORE_LINKOBJS)
563 AC_SUBST(STORE_TESTS)
565 AC_ARG_ENABLE(disk-io,
566 [ --enable-disk-io=\"list of modules\"
567 Build support for the list of disk I/O modules.
568 The default is only to build the "Blocking" module.
569 See src/DiskIO for a list of available modules, or
570 Programmers Guide section <not yet written>
571 for details on how to build your custom disk module],
574 for dir in $srcdir/src/DiskIO/*; do
575 module="`basename $dir`"
576 if test -d "$dir" && test "$module" != CVS; then
577 DISK_MODULES="$DISK_MODULES $module"
584 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
588 [ if test -z "$DISK_MODULES"; then
589 DISK_MODULES="Blocking"
592 if test -n "$DISK_MODULES"; then
593 for module in $DISK_MODULES; do
594 if test -d $srcdir/src/DiskIO/$module; then
597 echo "ERROR: disk-io $module does not exists"
601 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
603 for module in $DISK_MODULES; do
604 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
607 for fs in $DISK_MODULES none; do
610 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
611 FOUND_DISKDAEMON="true"
614 FOUND_DISKTHREADS="true"
620 FOUND_BLOCKING="true"
624 if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
625 echo "adding Blocking, as it is used by an active, legacy Store Module"
626 DISK_LIBS="$DISK_LIBS libBlocking.a"
627 DISK_MODULES="$DISK_MODULES Blocking"
628 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
631 if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
632 echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
633 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
634 DISK_MODULES="$DISK_MODULES DiskDaemon"
635 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
636 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
639 if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
640 echo "adding DiskThreads, as it is used by an active, legacy Store Module"
641 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
642 DISK_MODULES="$DISK_MODULES DiskThreads"
643 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
646 if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
647 echo "adding AIO, as it is used by an active, legacy Store Module"
648 DISK_LIBS="$DISK_LIBS libAIO.a"
649 DISK_MODULES="$DISK_MODULES AIO"
650 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
652 echo "IO Modules built: $DISK_MODULES"
655 dnl we know what is being built. now add dependencies.
656 for fs in $DISK_MODULES none; do
659 if test -z "$with_pthreads"; then
663 echo "DiskThreads IO Module used, Windows threads support automatically enabled"
666 echo "DiskThreads IO Module used, pthreads support automatically enabled"
673 if test -z "$with_aio"; then
677 echo "Aio IO Module used, Windows overlapped I/O support automatically enabled"
680 echo "Aio IO Module used, aio support automatically enabled"
690 AC_SUBST(DISK_PROGRAMS)
691 AC_SUBST(DISK_LINKOBJS)
692 AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
693 AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
695 AC_ARG_ENABLE(removal-policies,
696 [ --enable-removal-policies=\"list of policies\"
697 Build support for the list of removal policies.
698 The default is only to build the "lru" module.
699 See src/repl for a list of available modules, or
700 Programmers Guide section 9.9 for details on how
701 to build your custom policy],
704 for dir in $srcdir/src/repl/*; do
705 module="`basename $dir`"
706 if test -d "$dir" && test "$module" != CVS; then
707 REPL_POLICIES="$REPL_POLICIES $module"
714 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
718 [ if test -z "$REPL_POLICIES"; then
722 if test -n "$REPL_POLICIES"; then
723 for module in $REPL_POLICIES; do
724 if test -d $srcdir/src/repl/$module; then
727 echo "ERROR: Removal policy $module does not exists"
731 echo "Removal policies built: $REPL_POLICIES"
732 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
733 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
735 AC_SUBST(REPL_POLICIES)
739 AM_CONDITIONAL(ENABLE_PINGER, false)
741 [ --enable-icmp Enable ICMP pinging],
742 [ if test "$enableval" = "yes" ; then
744 AC_DEFINE(USE_ICMP,1,
745 [If you want to use Squid's ICMP features (highly recommended!) then
746 define this. When USE_ICMP is defined, Squid will send ICMP pings
747 to origin server sites. This information is used in numerous ways:
748 - Sent in ICP replies so neighbor caches know how close
749 you are to the source.
750 - For finding the closest instance of a URN.
751 - With the 'test_reachability' option. Squid will return
752 ICP_OP_MISS_NOFETCH for sites which it cannot ping.])
753 AM_CONDITIONAL(ENABLE_PINGER, true)
757 AM_CONDITIONAL(USE_DELAY_POOLS, false)
758 AC_ARG_ENABLE(delay-pools,
759 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
760 [ if test "$enableval" = "yes" ; then
761 echo "Delay pools enabled"
762 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
763 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
767 AM_CONDITIONAL(USE_ESI, false)
769 AC_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat. Enabling ESI will cause squid to follow the Edge Acceleration Specification (www.esi.org). This causes squid to IGNORE client Cache-Control headers. DO NOT use this in a squid configured as a web proxy, ONLY use it in a squid configured for webserver acceleration.]),
770 ac_cv_use_esi=$enableval, ac_cv_use_esi=no)
771 AC_CACHE_CHECK(whether to enable ESI,ac_cv_use_esi, ac_cv_use_esi=no)
772 if test "$ac_cv_use_esi" = "yes" ; then
773 AC_DEFINE(ESI,1,[Compile the ESI processor and Surrogate header support])
774 AM_CONDITIONAL(USE_ESI, true)
775 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
777 AC_DEFINE(ESI,0,[Compile the ESI processor and Surrogate header support])
780 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
781 AC_ARG_ENABLE(icap-client,
782 AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
783 ac_cv_use_icap_client=$enableval, ac_cv_use_icap_client=no)
784 AC_CACHE_CHECK(whether to enable the ICAP client,ac_cv_use_icap_client, ac_cv_use_icap_client=no)
785 if test "$ac_cv_use_icap_client" = "yes" ; then
786 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
787 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
788 ICAP_LIBS="ICAP/libicap.a"
790 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
795 dnl This is a developer only option. Developers know how to set defines
797 dnl AC_ARG_ENABLE(mem-gen-trace,
798 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
799 dnl [ if test "$enableval" = "yes" ; then
800 dnl echo "Memory trace (to file) enabled"
801 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
805 AC_ARG_ENABLE(useragent-log,
806 [ --enable-useragent-log Enable logging of User-Agent header],
807 [ if test "$enableval" = "yes" ; then
808 echo "User-Agent logging enabled"
809 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
810 By default, they are written to useragent.log in the Squid log
815 AC_ARG_ENABLE(referer-log,
816 [ --enable-referer-log Enable logging of Referer header],
817 [ if test "$enableval" = "yes" ; then
818 echo "Referer logging enabled"
819 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
820 By default, they are written to referer.log in the Squid log
827 [ --disable-wccp Disable Web Cache Coordination Protocol],
828 [ if test "$enableval" = "no" ; then
829 echo "Web Cache Coordination Protocol disabled"
833 if test $USE_WCCP = 1; then
834 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
838 AC_ARG_ENABLE(wccpv2,
839 [ --disable-wccpv2 Disable Web Cache Coordination V2 Protocol],
840 [ if test "$enableval" = "no" ; then
841 echo "Web Cache Coordination V2 Protocol disabled"
845 if test $USE_WCCPv2 = 1; then
846 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
849 AC_ARG_ENABLE(kill-parent-hack,
850 [ --enable-kill-parent-hack
851 Kill parent on shutdown],
852 [ if test "$enableval" = "yes" ; then
853 echo "Kill parent on shutdown"
854 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
855 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
860 AM_CONDITIONAL(USE_SNMP, false)
862 [ --enable-snmp Enable SNMP monitoring],
863 [ if test "$enableval" = "yes" ; then
864 echo "SNMP monitoring enabled"
865 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
866 SNMPLIB='../snmplib/libsnmp.a'
867 AM_CONDITIONAL(USE_SNMP, true)
868 SNMP_MAKEFILE=./snmplib/Makefile
873 AC_SUBST(makesnmplib)
875 AC_ARG_ENABLE(cachemgr-hostname,
876 [ --enable-cachemgr-hostname[=hostname]
877 Make cachemgr.cgi default to this host],
880 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
881 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
882 echo "Cachemgr default hostname == host where cachemgr runs"
888 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
889 echo "Cachemgr default hostname set to ${enableval}"
894 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
895 AC_ARG_ENABLE(arp-acl,
896 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
897 [ if test "$enableval" = "yes" ; then
898 echo "ARP ACL lists enabled (ether address)"
911 LIBS="$LIBS -liphlpapi"
914 LIBS="$LIBS -liphlpapi"
917 echo "WARNING: ARP ACL support probably won't work on $host."
921 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, ?).])
922 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
926 AM_CONDITIONAL(ENABLE_HTCP, false)
928 [ --enable-htcp Enable HTCP protocol],
929 [ if test "$enableval" = "yes" ; then
931 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
932 AM_CONDITIONAL(ENABLE_HTCP, true)
936 AM_CONDITIONAL(ENABLE_SSL, false)
939 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
940 [ if test "$enableval" != "no"; then
941 echo "SSL gatewaying using OpenSSL enabled"
942 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
943 AM_CONDITIONAL(ENABLE_SSL, true)
946 dnl Native Windows port of OpenSSL needs -lgdi32
947 SSLLIB='-lssleay32 -leay32 -lgdi32'
950 SSLLIB='-lssl -lcrypto'
957 AM_CONDITIONAL(NEED_OWN_MD5, true)
960 [ --with-openssl[=prefix]
961 Compile with the OpenSSL libraries. The path to
962 the OpenSSL development libraries and headers
963 installation can be specified if outside of the
964 system standard directories],
966 case "$with_openssl" in
974 SSLLIBDIR="$with_openssl/lib"
975 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
980 if test -n "$USE_OPENSSL"; then
981 echo "Using OpenSSL MD5 implementation"
982 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)])
983 AM_CONDITIONAL(NEED_OWN_MD5, false)
984 if test -z "$SSLLIB"; then
985 SSLLIB="-lcrypto" # for MD5 routines
987 dnl This is a workaround for RedHat 9 brain damage..
988 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
989 echo "OpenSSL depends on Kerberos"
990 SSLLIBDIR="/usr/kerberos/lib"
991 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
994 if test -n "$SSLLIBDIR"; then
995 SSLLIB="-L$SSLLIBDIR $SSLLIB"
999 AC_ARG_ENABLE(forw-via-db,
1000 [ --enable-forw-via-db Enable Forw/Via database],
1001 [ if test "$enableval" = "yes" ; then
1002 echo "FORW-VIA enabled"
1003 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
1007 AC_ARG_ENABLE(cache-digests,
1008 [ --enable-cache-digests Use Cache Digests
1009 see http://www.squid-cache.org/FAQ/FAQ-16.html],
1010 [ if test "$enableval" = "yes" ; then
1011 echo "USE_CACHE_DIGESTS enabled"
1012 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
1016 dnl Select Default Error language
1017 AC_ARG_ENABLE(default-err-language,
1018 [ --enable-default-err-language=lang
1019 Select default language for Error pages (see
1020 errors directory) ],
1022 if test -d $srcdir/errors/$enableval; then
1023 ERR_DEFAULT_LANGUAGE=$enableval
1025 echo "ERROR! Unknown language $enableval, see errors/ directory"
1028 ],[ERR_DEFAULT_LANGUAGE="English"])
1029 AC_SUBST(ERR_DEFAULT_LANGUAGE)
1031 dnl Select languages to be installed
1032 AC_ARG_ENABLE(err-languages,
1033 [ --enable-err-languages=\"lang1 lang2..\"
1034 Select languages to be installed. (All will be
1035 installed by default) ],
1037 for l in $enableval; do
1038 if test -d $srcdir/errors/$l; then :; else
1039 echo "ERROR! Unknown language $$l, see errors/"
1043 ERR_LANGUAGES=$enableval
1046 for l in $srcdir/errors/*; do
1047 if test -f $l/ERR_ACCESS_DENIED; then
1048 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
1052 AC_SUBST(ERR_LANGUAGES)
1054 dnl Size of COSS memory buffer
1055 AC_ARG_WITH(coss-membuf-size,
1056 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
1057 [ if test "$with_coss_membuf_size"; then
1058 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
1059 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
1063 dnl check for netio plugin stuff
1066 [ --enable-poll Enable poll() support.
1067 --disable-poll Disable poll() support. ],
1070 case "$enableval" in
1072 echo "Forcing poll() to be enabled"
1073 ac_cv_func_poll='yes'
1077 echo "Forcing poll() to be disabled"
1078 ac_cv_func_poll='no'
1084 AC_ARG_ENABLE(select,
1085 [ --enable-select Enable select() support.
1086 --disable-select Disable select() support. ],
1089 case "$enableval" in
1091 echo "Forcing select() to be enabled"
1092 ac_cv_func_select='yes'
1093 SELECT_TYPE="select"
1096 echo "Forcing select() to be disabled"
1097 ac_cv_func_select='no'
1103 AC_ARG_ENABLE(kqueue,
1104 [ --enable-kqueue Enable kqueue() support (experimental).
1105 --disable-kqueue Disable kqueue() support. ],
1108 case "$enableval" in
1110 echo "Forcing kqueue() to be enabled"
1111 ac_cv_func_kqueue='yes'
1112 SELECT_TYPE="kqueue"
1115 echo "Forcing kqueue() to be disabled"
1116 ac_cv_func_kqueue='no'
1122 AC_ARG_ENABLE(epoll,
1123 [ --enable-epoll Enable epoll() support.
1124 --disable-epoll Disable epoll() support. ],
1127 case "$enableval" in
1129 echo "Forcing epoll() to be enabled"
1130 ac_cv_func_epoll_ctl='yes'
1134 echo "Forcing epoll() to be disabled"
1135 ac_cv_func_epoll_ctl='no'
1141 dnl Disable HTTP violations
1143 AC_ARG_ENABLE(http-violations,
1144 [ --disable-http-violations
1145 This allows you to remove code which is known to
1146 violate the HTTP protocol specification.],
1147 [ if test "$enableval" = "no" ; then
1148 echo "Disabling HTTP Violations"
1152 if test $http_violations = 1; then
1153 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.])
1155 AC_DEFINE(HTTP_VIOLATIONS, 0)
1158 dnl Enable IPFW Transparent Proxy
1159 AC_ARG_ENABLE(ipfw-transparent,
1160 [ --enable-ipfw-transparent
1161 Enable Transparent Proxy support for systems
1162 using FreeBSD IPFW style redirection.],
1163 [ if test "$enableval" = "yes" ; then
1164 echo "IPFW Transparent Proxy enabled"
1165 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1166 IPFW_TRANSPARENT="yes"
1170 dnl Enable IP-Filter Transparent Proxy
1171 AC_ARG_ENABLE(ipf-transparent,
1172 [ --enable-ipf-transparent
1173 Enable Transparent Proxy support for systems
1174 using IP-Filter network address redirection.],
1175 [ if test "$enableval" = "yes" ; then
1176 echo "IP-Filter Transparent Proxy enabled"
1177 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.])
1178 IPF_TRANSPARENT="yes"
1182 dnl Enable PF Transparent Proxy
1183 AC_ARG_ENABLE(pf-transparent,
1184 [ --enable-pf-transparent
1185 Enable Transparent Proxy support for systems
1186 using PF network address redirection.],
1187 [ if test "$enableval" = "yes" ; then
1188 echo "PF Transparent Proxy enabled"
1189 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1190 PF_TRANSPARENT="yes"
1194 dnl Enable Linux Netfilter Transparent Proxy
1195 AC_ARG_ENABLE(linux-netfilter,
1196 [ --enable-linux-netfilter
1197 Enable Transparent Proxy support for Linux (Netfilter) systems.],
1198 [ if test "$enableval" = "yes" ; then
1199 echo "Linux (Netfilter) Transparent Proxy enabled"
1200 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1201 LINUX_NETFILTER="yes"
1205 dnl Enable Large file support
1209 AC_ARG_WITH(large-files,
1210 [ --with-large-files Enable support for large files (logs etc). Still
1212 [ if test "$withval" = yes; then
1217 dnl UNIX Build environment
1218 AC_ARG_WITH(build-environment,
1219 [ --with-build-environment=model
1220 The build environment to use. Normally one of
1221 POSIX_V6_ILP32_OFF32 32 bits
1222 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1223 POSIX_V6_LP64_OFF64 64 bits
1224 POSIX_V6_LPBIG_OFFBIG large pointers and files
1225 XBS5_ILP32_OFF32 32 bits (legacy)
1226 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1227 XBS5_LP64_OFF64 64 bits (legacy)
1228 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1229 default The default for your OS],
1230 [ case "$withval" in
1232 echo "--with-build-environment expects a build environment string as used by getconf"
1236 buildmodel="$withval"
1241 if test $needlargefiles && test -z "$buildmodel"; then
1242 for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG; do
1243 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1248 if test -z "$buildmodel"; then
1249 echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
1251 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1252 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1255 if test -n "$buildmodel" && test "$buildmodel" != "default"; then
1256 echo "Using $buildmodel build environment"
1257 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1260 echo "ERROR: Build environment $buildmodel not known to getconf."
1263 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1264 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1265 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1266 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1269 dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but:
1270 dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc
1271 dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun
1273 if test "$GCC" = "yes"; then
1274 echo "Removing -Xa for gcc on $host"
1275 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1276 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1278 echo "Removing -Usun on $host"
1279 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1280 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1283 dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1284 dnl so we must adjust something to avoid gcc errors.
1285 dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1286 dnl remove "-n32" from LDFLAGS
1287 dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1288 dnl "-64" from LDFLAGS
1290 if test "$GCC" = "yes"; then
1291 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1292 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1293 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1294 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1295 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1296 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1304 dnl Enable Linux transparent proxy support
1305 AC_ARG_ENABLE(linux-tproxy,
1306 [ --enable-linux-tproxy
1307 Enable real Transparent Proxy support for Netfilter TPROXY.],
1308 [ if test "$enableval" = "yes" ; then
1309 echo "Linux Netfilter/TPROXY enabled"
1310 AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.])
1312 if test -z "$LINUX_NETFILTER"; then
1313 echo "Linux-Netfilter Transparent Proxy automatically enabled"
1314 LINUX_NETFILTER="yes"
1319 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1320 dnl Enable Leak Finding Functions
1321 AC_ARG_ENABLE(leakfinder,
1322 [ --enable-leakfinder
1323 Enable Leak Finding code. Enabling this alone
1324 does nothing; you also have to modify the source
1325 code to use the leak finding functions. Probably
1326 Useful for hackers only.],
1327 [ if test "$enableval" = "yes" ; then
1328 echo "Leak-Finding enabled"
1329 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1330 USE_LEAKFINDER="yes"
1331 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1336 AC_ARG_ENABLE(ident-lookups,
1337 [ --disable-ident-lookups
1338 This allows you to remove code that performs
1339 Ident (RFC 931) lookups.],
1340 [ if test "$enableval" = "no" ; then
1341 echo "Disabling Ident Lookups"
1345 if test $use_ident = 1; then
1346 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1347 AM_CONDITIONAL(ENABLE_IDENT, true)
1349 AC_DEFINE(USE_IDENT, 0)
1350 AM_CONDITIONAL(ENABLE_IDENT, false)
1353 AM_CONDITIONAL(USE_DNSSERVER, false)
1355 AC_ARG_ENABLE(internal-dns,
1356 [ --disable-internal-dns This prevents Squid from directly sending and
1357 receiving DNS messages, and instead enables the
1358 old external 'dnsserver' processes.],
1359 [ if test "$enableval" = "no" ; then
1360 echo "Disabling Internal DNS queries"
1364 if test "$use_dnsserver" = "yes"; then
1365 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1366 AM_CONDITIONAL(USE_DNSSERVER, true)
1369 dnl Select Default hosts file location
1370 AC_ARG_ENABLE(default-hostsfile,
1371 [ --enable-default-hostsfile=path
1372 Select default location for hosts file.
1373 See hosts_file directive in squid.conf for details],
1375 if test "$enableval" != "none" ; then
1376 if test -f $enableval; then
1377 OPT_DEFAULT_HOSTS=$enableval
1379 echo "Warning Unable to find $enableval"
1383 OPT_DEFAULT_HOSTS="none"
1385 echo "Default hosts file set to: $enableval"
1386 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1387 AC_SUBST(OPT_DEFAULT_HOSTS)
1389 dnl Select auth schemes modules to build
1391 [ --enable-auth=\"list of auth scheme modules\"
1392 Build support for the list of authentication schemes.
1393 The default is to build support for the Basic scheme.
1394 See src/auth for a list of available modules, or
1395 Programmers Guide section authentication schemes
1396 for details on how to build your custom auth scheme
1398 [ case $enableval in
1400 for dir in $srcdir/src/auth/*; do
1401 module="`basename $dir`"
1402 if test -d "$dir" && test "$module" != CVS; then
1403 AUTH_MODULES="$AUTH_MODULES $module"
1410 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1414 [ if test -z "$AUTH_MODULES"; then
1415 AUTH_MODULES="ntlm basic digest negotiate"
1418 if test -n "$AUTH_MODULES"; then
1419 for module in $AUTH_MODULES; do
1420 if test -d $srcdir/src/auth/$module; then
1423 echo "ERROR: Auth scheme $module does not exists"
1426 eval AUTH_MODULE_${module}=yes
1428 echo "Auth scheme modules built: $AUTH_MODULES"
1429 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1430 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1432 echo "Auth scheme modules built: None"
1435 for module in $AUTH_MODULES; do
1436 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1438 AC_SUBST(AUTH_MODULES)
1440 AC_SUBST(AUTH_LINKOBJS)
1443 dnl Select basic auth scheme helpers to build
1444 if test -n "$AUTH_MODULE_basic"; then
1445 BASIC_AUTH_HELPERS="all"
1447 AC_ARG_ENABLE(basic-auth-helpers,
1448 [ --enable-basic-auth-helpers=\"list of helpers\"
1449 This option selects which basic scheme proxy_auth
1450 helpers to build and install as part of the normal
1451 build process. For a list of available
1452 helpers see the helpers/basic_auth directory.],
1453 [ case "$enableval" in
1455 BASIC_AUTH_HELPERS="all"
1458 BASIC_AUTH_HELPERS=""
1461 if test -z "$AUTH_MODULE_basic"; then
1462 echo "WARNING: Basic auth helpers selected without the basic scheme enabled"
1465 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1469 if test "$BASIC_AUTH_HELPERS" = "all" ; then
1470 BASIC_AUTH_HELPERS=""
1471 for dir in $srcdir/helpers/basic_auth/*; do
1472 helper="`basename $dir`"
1473 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1474 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1478 if test -n "$BASIC_AUTH_HELPERS"; then
1479 for helper in $BASIC_AUTH_HELPERS; do
1480 if test -d $srcdir/helpers/basic_auth/$helper; then
1487 echo "ERROR: Basic auth helper $helper does not exists"
1491 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1493 AC_SUBST(BASIC_AUTH_HELPERS)
1495 dnl Select ntlm auth helpers to build
1496 if test -n "$AUTH_MODULE_ntlm"; then
1497 NTLM_AUTH_HELPERS="all"
1499 AC_ARG_ENABLE(ntlm-auth-helpers,
1500 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1501 This option selects which proxy_auth ntlm helpers
1502 to build and install as part of the normal build
1503 process. For a list of available helpers see
1504 the helpers/ntlm_auth directory.],
1505 [ case "$enableval" in
1507 NTLM_AUTH_HELPERS="all"
1510 NTLM_AUTH_HELPERS=""
1513 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1517 if test "$NTLM_AUTH_HELPERS" = "all" ; then
1518 NTLM_AUTH_HELPERS=""
1519 for dir in $srcdir/helpers/ntlm_auth/*; do
1520 helper="`basename $dir`"
1521 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1522 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1526 if test -n "$NTLM_AUTH_HELPERS"; then
1527 for helper in $NTLM_AUTH_HELPERS; do
1528 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1531 echo "ERROR: NTLM Auth helper $helper does not exists"
1535 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1537 AC_SUBST(NTLM_AUTH_HELPERS)
1539 dnl Select negotiate auth helpers to build
1540 if test -n "$AUTH_MODULE_negotiate"; then
1541 NEGOTIATE_AUTH_HELPERS="all"
1543 AC_ARG_ENABLE(negotiate-auth-helpers,
1544 [ --enable-negotiate-auth-helpers=\"list of helpers\"
1545 This option selects which proxy_auth negotiate helpers
1546 to build and install as part of the normal build
1547 process. For a list of available helpers see
1548 the helpers/negotiate_auth directory.],
1549 [ case "$enableval" in
1551 NEGOTIATE_AUTH_HELPERS="all"
1554 NEGOTIATE_AUTH_HELPERS=""
1557 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1561 if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1562 NEGOTIATE_AUTH_HELPERS=""
1563 for dir in $srcdir/helpers/negotiate_auth/*; do
1564 helper="`basename $dir`"
1565 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1566 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1570 if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1571 for helper in $NEGOTIATE_AUTH_HELPERS; do
1572 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1575 echo "ERROR: Negotiate Auth helper $helper does not exists"
1579 echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
1581 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1583 dnl Select digest auth scheme helpers to build
1584 if test -n "$AUTH_MODULE_digest"; then
1585 DIGEST_AUTH_HELPERS=all
1587 AC_ARG_ENABLE(digest-auth-helpers,
1588 [ --enable-digest-auth-helpers=\"list of helpers\"
1589 This option selects which digest scheme authentication
1590 helpers to build and install as part of the normal build
1591 process. For a list of available helpers see the
1592 helpers/digest_auth directory.],
1593 [ case "$enableval" in
1595 DIGEST_AUTH_HELPERS="all"
1598 DIGEST_AUTH_HELPERS=""
1601 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1605 if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1606 DIGEST_AUTH_HELPERS=""
1607 for dir in $srcdir/helpers/digest_auth/*; do
1608 helper="`basename $dir`"
1609 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1610 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1614 if test -n "$DIGEST_AUTH_HELPERS"; then
1615 for helper in $DIGEST_AUTH_HELPERS; do
1616 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1619 echo "ERROR: digest auth helper $helper does not exists"
1623 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1625 AC_SUBST(DIGEST_AUTH_HELPERS)
1627 dnl Enable "NTLM fail open"
1628 AC_ARG_ENABLE(ntlm-fail-open,
1629 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1630 Authentication steps can allow squid to still authenticate
1632 [ if test "$enableval" = "yes" ; then
1633 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.])
1637 dnl Select external_acl helpers to build
1638 EXTERNAL_ACL_HELPERS=all
1639 AC_ARG_ENABLE(external-acl-helpers,
1640 [ --enable-external-acl-helpers=\"list of helpers\"
1641 This option selects which external_acl helpers to
1642 build and install as part of the normal build
1643 process. For a list of available helpers see the
1644 helpers/external_acl directory.],
1645 [ case "$enableval" in
1647 EXTERNAL_ACL_HELPERS=all
1650 EXTERNAL_ACL_HELPERS=""
1653 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1657 if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
1658 EXTERNAL_ACL_HELPERS=""
1659 for dir in $srcdir/helpers/external_acl/*; do
1660 helper="`basename $dir`"
1661 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1662 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1666 if test -n "$EXTERNAL_ACL_HELPERS"; then
1667 for helper in $EXTERNAL_ACL_HELPERS; do
1668 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1671 echo "ERROR: external acl helper $helper does not exists"
1675 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1677 AC_SUBST(EXTERNAL_ACL_HELPERS)
1679 AC_ARG_WITH(valgrind,
1680 [ --with-valgrind Include debug instrumentation for use with valgrind],
1689 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1693 if test $valgrind; then
1694 AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
1695 echo "Valgrind debug support enabled"
1699 dnl Disable "memPools" code
1700 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
1701 AC_ARG_ENABLE(mempools,
1702 [ --disable-mempools Disable memPools. Note that this option now simply sets the
1703 default behaviour. Specific classes can override this at runtime, and
1704 only lib/MemPool.c needs to be altered to change the squid-wide
1705 default for all classes.],
1706 [ if test "$enableval" = "no" ; then
1707 echo "memPools disabled"
1708 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1712 dnl Enable WIN32 Service compile mode
1713 AC_ARG_ENABLE(win32-service,
1714 [ --enable-win32-service Compile Squid as a WIN32 Service
1715 Works only on Windows NT and Windows 2000 Platforms.],
1716 [ if test "$enableval" = "yes" ; then
1717 echo "Enabling WIN32 run service mode"
1718 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1723 dnl Check for Cyrus SASL
1724 if test "$require_sasl" = "yes"; then
1725 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1726 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1730 if test "$ac_cv_header_sasl_h" = "yes"; then
1734 echo "ERROR: Neither SASL nor SASL2 found"
1741 dnl Disable "unlinkd" code
1742 AC_ARG_ENABLE(unlinkd,
1743 [ --disable-unlinkd Do not use unlinkd],
1744 [ if test "$enableval" = "no" ; then
1750 # Here we should probably use some magic depending on the selected
1754 if test "$use_unlinkd" = "yes"; then
1755 echo "unlinkd enabled"
1756 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1757 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1759 echo "unlinkd disabled"
1760 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1763 dnl Enable backtraces on fatal errors
1764 AC_ARG_ENABLE(stacktraces,
1765 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1766 [ if test "$enableval" = "yes" ; then
1767 echo "Enabling automatic stack backtraces on fatal errors"
1768 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1772 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1773 dnl Enable USE_XPROF_STATS
1774 AC_ARG_ENABLE(cpu-profiling,
1775 [ --enable-cpu-profiling
1776 This option allows you to see which internal functions
1777 in Squid are consuming how much CPU. Compiles in probes
1778 that measure time spent in probed functions. Needs
1779 source modifications to add new probes. This is meant
1780 for developers to assist in performance optimisations
1781 of Squid internal functions.
1782 If you are not developer and not interested in the stats
1783 you shouldn't enable this, as overhead added, although
1784 small, is still overhead. See lib/Profiler.c for more.
1786 [ if test "$enableval" = "yes" ; then
1787 echo "Enabling cpu-profiling"
1788 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1789 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1793 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1794 AC_ARG_ENABLE(x_accelerator_vary,
1795 [ --enable-x-accelerator-vary
1796 Enable support for the X-Accelerator-Vary
1797 HTTP header. Can be used to indicate
1798 variance within an accelerator setup.
1799 Typically used together with other code
1800 that adds custom HTTP headers to the requests.],
1801 [ if test "$enableval" = "yes" ; then
1802 echo "Enabling support for X-Accelerator-Vary"
1803 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1807 AC_ARG_WITH(filedescriptors,
1808 [ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors],
1809 [ squid_filedescriptors_num=$withval ])
1811 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
1812 if $CPPUNITCONFIG --help >/dev/null; then
1813 echo "using system installed cppunit"
1814 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
1816 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
1818 echo "cppunit does not apear to be installed. squid does not require this, but code testing with 'make check' will fail."
1820 SQUID_CPPUNIT_LIBS=''
1821 SQUID_CPPUNIT_INC=''
1824 AC_ARG_WITH(cppunit-basedir,
1825 [ --with-cppunit-basedir=/path/to/cppunit-base
1826 Path where the cppunit headers are libraries are found
1829 [ if test -f $withval/include/cppunit/TestCase.h; then
1830 echo "Using cppunit includes from $withval"
1831 SQUID_CPPUNIT_INC="-I${withval}/include"
1833 echo "ERROR: Cannot find cppunit at $withval"
1836 if test -f $withval/lib/libcppunit.la; then
1837 echo "Using cppunit lib from $withval"
1838 SQUID_CPPUNIT_LA="-I${withval}/lib/libcppunit.la"
1839 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
1841 echo "ERROR: Cannot find cppunit at $withval"
1845 AC_SUBST(SQUID_CPPUNIT_LIBS)
1846 AC_SUBST(SQUID_CPPUNIT_LA)
1847 AC_SUBST(SQUID_CPPUNIT_INC)
1849 # Force some compilers to use ANSI features
1853 if test "$ac_cv_prog_CC" = "cc" ; then
1854 echo "adding '-std1' to cc args for $host"
1860 if test "$ac_cv_prog_CC" = "cc" ; then
1861 echo "adding '-Ae' to cc args for $host"
1868 dnl Check for programs
1872 AC_PATH_PROG(SH, sh, /bin/sh)
1873 AC_PATH_PROG(FALSE, false, /usr/bin/false)
1874 AC_PATH_PROG(TRUE, true, /usr/bin/true)
1875 AC_PATH_PROG(RM, rm, $FALSE)
1876 AC_PATH_PROG(MV, mv, $FALSE)
1877 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
1878 AC_PATH_PROG(LN, ln, cp)
1879 AC_PATH_PROG(PERL, perl, none)
1880 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
1881 AC_PATH_PROG(AR, ar, $FALSE)
1883 if test "$ac_cv_path_PERL" = "none"; then
1884 echo "Perl is required to compile Squid"
1885 echo "Please install Perl and then re-run configure"
1891 echo "Disabling 'ranlib' for HP-UX..."
1905 dnl Check for headers
1938 netinet/ip_fil_compat.h \
1993 linux/netfilter_ipv4.h \
1994 linux/netfilter_ipv4/ip_tproxy.h \
1996 SQUID_DEFAULT_INCLUDES
2002 AC_CHECK_HEADERS(net/if.h \
2004 netinet/ip_compat.h\
2009 resolv.h,,,SQUID_BSDNET_INCLUDES)
2011 AC_CHECK_HEADERS([libxml/parser.h], [], [
2012 SAVED_CPPFLAGS="$CPPFLAGS"
2013 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2014 unset ac_cv_header_libxml_parser_h
2015 AC_CHECK_HEADERS([libxml/parser.h], [], [
2016 CPPFLAGS="$SAVED_CPPFLAGS"
2023 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
2024 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
2026 ac_cv_have_ansi_prototypes="yes",
2027 ac_cv_have_ansi_prototypes="no")
2029 if test $ac_cv_have_ansi_prototypes = "yes" ; then
2030 AC_DEFINE(HAVE_ANSI_PROTOTYPES,1,[Define if your compiler supports prototyping])
2034 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2037 #include <sys/time.h>
2044 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2045 #if HAVE_SYS_TYPES_H
2046 #include <sys/types.h>
2052 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2053 #if HAVE_SYS_TYPES_H
2054 #include <sys/types.h>
2060 dnl Override rusage() detect on MinGW because is emulated in source code
2063 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2064 ac_cv_func_getrusage='yes'
2065 echo "Using own rusage on Windows."
2068 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2070 #include <sys/time.h>
2072 #if HAVE_SYS_RESOURCE_H
2073 #include <sys/resource.h>
2078 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2079 #if HAVE_SYS_TYPES_H
2080 #include <sys/types.h>
2082 #include <netinet/in.h>
2083 #include <netinet/in_systm.h>
2084 #include <netinet/ip.h>
2085 #if defined (__linux__) || defined (__CYGWIN__)
2094 dnl Check for typedefs
2095 AC_CHECK_SIZEOF(void *)
2097 dnl 8 bit integers - int8_t
2098 dnl if this is defined we trust it to be 8 bits
2099 AC_CHECK_TYPE(int8_t,[
2100 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2101 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2102 ],,SQUID_DEFAULT_INCLUDES)
2105 AC_CHECK_TYPE(char,[
2106 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2107 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2108 ],,SQUID_DEFAULT_INCLUDES)
2110 dnl unsigned 8 bit ints - u_int8_t
2111 dnl if this is defined we trust it to be 8 bits
2112 AC_CHECK_TYPE(u_int8_t,[
2113 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2114 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2115 ],,SQUID_DEFAULT_INCLUDES)
2118 dnl if this is defined we trust it to be 8 bits
2119 AC_CHECK_TYPE(uint8_t,[
2120 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2121 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2122 ],,SQUID_DEFAULT_INCLUDES)
2124 dnl 16 bit integers - int16_t
2125 dnl if this is defined we trust it to be 16 bits
2126 AC_CHECK_TYPE(int16_t,[
2127 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2128 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2129 ],,SQUID_DEFAULT_INCLUDES)
2132 AC_CHECK_TYPE(short,[
2133 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2134 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2135 ],,SQUID_DEFAULT_INCLUDES)
2139 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2140 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2141 ],,SQUID_DEFAULT_INCLUDES)
2143 dnl unsigned 16 bit ints - u_int16_t
2144 dnl if this is defined we trust it to be 16 bits
2145 AC_CHECK_TYPE(u_int16_t,[
2146 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2147 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2148 ],,SQUID_DEFAULT_INCLUDES)
2151 dnl if this is defined we trust it to be 16 bits
2152 AC_CHECK_TYPE(uint16_t,[
2153 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2154 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2155 ],,SQUID_DEFAULT_INCLUDES)
2157 dnl 32 bit signed int - int32_t
2158 dnl if this is defined we trust it to be 32 bits
2159 AC_CHECK_TYPE(int32_t,[
2160 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2161 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2162 ],,SQUID_DEFAULT_INCLUDES)
2165 AC_CHECK_TYPE(long,[
2166 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2167 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2168 ],,SQUID_DEFAULT_INCLUDES)
2170 dnl 32 bit unsigned int - u_int32_t
2171 dnl if this is defined we trust it to be 32 bits
2172 AC_CHECK_TYPE(u_int32_t,[
2173 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2174 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2175 ],,SQUID_DEFAULT_INCLUDES)
2178 dnl if this is defined we trust it to be 32 bits
2179 AC_CHECK_TYPE(uint32_t,[
2180 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2181 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2182 ],,SQUID_DEFAULT_INCLUDES)
2184 dnl 64 bit signed - int64_t
2185 dnl if this is defind we trust it to be 64 bits
2186 AC_CHECK_TYPE(int64_t,[
2187 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2188 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2189 ],,SQUID_DEFAULT_INCLUDES)
2192 dnl if this is defind we trust it to be 64 bits
2193 AC_CHECK_TYPE(__int64,[
2194 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2195 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2196 ],,SQUID_DEFAULT_INCLUDES)
2199 AC_CHECK_TYPE(long long,[
2200 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2201 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2202 ],,SQUID_DEFAULT_INCLUDES)
2204 dnl 64 bit unsigned - u_int64_t
2205 dnl if this is defind we trust it to be 64 bits
2206 AC_CHECK_TYPE(u_int64_t,[
2207 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2208 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2209 ],,SQUID_DEFAULT_INCLUDES)
2212 dnl if this is defind we trust it to be 64 bits
2213 AC_CHECK_TYPE(uint64_t,[
2214 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2215 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2216 ],,SQUID_DEFAULT_INCLUDES)
2218 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2219 dnl that is incompatible with the updated Solaris header files.
2220 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2221 AC_CHECK_TYPE(pad128_t,
2222 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2223 ,SQUID_DEFAULT_INCLUDES)
2225 AC_CHECK_TYPE(upad128_t,
2226 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2227 ,SQUID_DEFAULT_INCLUDES)
2229 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2230 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2231 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2232 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2233 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2234 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2235 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2236 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2238 dnl Check for special functions
2241 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2242 #include <sys/types.h>
2243 #include <sys/socket.h>
2249 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2250 #include <sys/ipc.h>
2251 #include <sys/msg.h>])
2253 dnl Check for needed libraries
2254 AC_CHECK_LIB(nsl, main)
2255 AC_CHECK_LIB(socket, main)
2258 AC_MSG_CHECKING(for winsock)
2260 for curlib in ws2_32 wsock32; do
2261 LIBS="$LIBS -l$curlib"
2263 char __attribute__((stdcall)) socket(int,int,int);
2264 char __attribute__((stdcall)) select(int,int,int,int,int);
2265 char __attribute__((stdcall)) closesocket(int);
2266 char __attribute__((stdcall)) gethostname(int,int);
2274 have_winsock=yes, have_winsock=no)
2276 if test $have_winsock = yes; then
2277 ac_cv_func_select='yes'
2278 if test $curlib = ws2_32; then
2279 have_winsock=winsock2
2285 AC_MSG_RESULT($have_winsock)
2289 dnl Ripped from the Samba sources
2290 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2292 #include <sys/types.h>
2295 #include <sys/socket.h>
2296 #include <sys/un.h>],
2298 struct sockaddr_un sunaddr;
2299 sunaddr.sun_family = AF_UNIX;
2301 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2302 if test x"$squid_cv_unixsocket" = x"yes"; then
2303 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2307 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
2308 echo "skipping libmalloc check (--enable-dlmalloc specified)"
2310 AC_CHECK_LIB(gnumalloc, main)
2311 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2312 echo "Disabling extended malloc functions when using gnumalloc"
2313 ac_cv_func_mallinfo=no
2314 ac_cv_func_mallocblksize=no
2315 ac_cv_func_mallopt=no
2319 echo "skipping libmalloc check for $host"
2322 echo "skipping libmalloc check for $host"
2326 AC_CHECK_LIB(malloc, main)
2332 AC_CHECK_LIB(bsd, main)
2333 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2334 AC_CHECK_LIB(bind, gethostbyname)
2335 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2338 echo "skipping libresolv checks for $host"
2341 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
2342 AC_CHECK_LIB(resolv, main)
2348 echo "Use MSVCRT for math functions."
2351 AC_CHECK_LIB(m, main)
2355 dnl Check for libcrypt
2356 dnl Some of our helpers use crypt(3) which may be in libc, or in
2357 dnl libcrypt (eg FreeBSD)
2358 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2361 dnl Check for libdl, used by auth_modules/PAM
2362 if test "$with_dl" = "yes"; then
2363 AC_CHECK_LIB(dl, dlopen)
2366 dnl Check for pthreads
2367 dnl We use pthreads when doing ASYNC I/O
2368 if test "$with_pthreads" = "yes"; then
2369 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2370 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
2372 i386-unknown-freebsd*)
2373 if test "$GCC" = "yes" ; then
2374 if test -z "$PRESET_LDFLAGS"; then
2375 LDFLAGS="$LDFLAGS -pthread"
2380 if test "$GCC" = "yes" ; then
2381 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2382 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
2384 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2385 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
2389 AC_CHECK_LIB(pthread, main)
2393 dnl We use AIO in the coss store
2394 if test "$with_aio" = "yes"; then
2395 dnl On some systems POSIX AIO functions are in libaio
2396 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
2399 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2400 dnl Robert Side <rside@aiinc.bc.ca>
2401 dnl Mon, 18 Jan 1999 17:48:00 GMT
2404 AC_CHECK_LIB(intl, strftime)
2408 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2409 dnl only with Windows LDAP libraries using -lwldap32
2412 LIB_LDAP="-lwldap32"
2417 dnl LDAP helpers need to know if -llber is needed or not
2418 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2427 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
2428 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2430 #if HAVE_SYS_TYPES_H
2431 #include <sys/types.h>
2441 [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)],
2442 ac_cv_dbopen_libdb="yes",
2443 ac_cv_dbopen_libdb="no")
2446 if test $ac_cv_dbopen_libdb = yes; then
2451 dnl System-specific library modifications
2455 if test "$GCC" = "yes"; then
2456 echo "Removing -O for gcc on $host"
2457 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2461 echo "Removing -lsocket for IRIX..."
2462 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2463 echo "Removing -lnsl for IRIX..."
2464 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2465 ac_cv_lib_nsl_main=no
2466 echo "Removing -lbsd for IRIX..."
2467 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2469 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2470 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2471 dnl Please change your configure script. AIX doesn't need -lbsd.
2473 echo "Removing -lbsd for AIX..."
2474 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2476 dnl From: mlaster@metavillage.com (Mike Laster)
2477 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
2478 dnl So using the internal versions generates a load of warnings
2481 echo "disabling snprintf/vsnprintf for $host"
2482 ac_cv_func_snprintf=no
2483 ac_cv_func_vsnprintf=no
2488 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2489 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2490 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2492 [*-*-solaris2.[0-4]])
2493 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2495 [*-sony-newsos[56]*])
2496 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2500 # Remove optimization for GCC 2.95.[123]
2501 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2502 if test "$GCC" = "yes"; then
2503 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2506 echo "Removing -O for gcc on $host with GCC $GCCVER"
2507 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2512 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
2515 if test `uname -v` = "2.03"; then
2516 echo "disabling mallinfo for $host"
2517 ac_cv_func_mallinfo=no
2522 dnl This has to be before AC_CHECK_FUNCS
2523 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2524 # when running configure.
2525 if test -z "$ac_cv_func_poll"; then
2528 # John Kay (jkay@nlanr.net) 19970818
2529 echo "disabling poll for $host..."
2530 ac_cv_func_poll='no'
2534 echo "disabling poll for $host..."
2535 ac_cv_func_poll='no'
2538 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2539 # poll is problematic on Linux. We disable it
2540 # by default until Linux gets it right.
2541 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2542 if test $rev -lt 002002; then
2543 echo "disabling poll for $host < 2.2..."
2544 ac_cv_func_poll='no'
2547 [powerpc-ibm-aix4.1.*])
2548 # Mike Laster (mlaster@metavillage.com) 19981021
2549 echo "disabling poll for $host..."
2550 ac_cv_func_poll='no'
2553 # Robert Side <rside@aiinc.bc.ca>
2554 # Mon, 18 Jan 1999 17:48:00 GMT
2555 echo "disabling poll for $host..."
2556 ac_cv_func_poll='no'
2561 dnl Override statfs() detect on MinGW becasue is emulated in source code
2564 ac_cv_func_statfs='yes'
2568 dnl Check for library functions
2570 backtrace_symbols_fd \
2599 pthread_attr_setschedparam \
2600 pthread_attr_setscope \
2601 pthread_setschedparam \
2631 # check for crypt, may require -lcrypt
2633 LIBS="$LIBS $CRYPTLIB"
2634 AC_CHECK_FUNCS(crypt)
2637 # Check for libepoll
2639 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
2640 AC_SUBST(EPOLL_LIBS)
2642 # Check for epoll_ctl, may need -lepoll
2644 LIBS="$LIBS $LIB_EPOLL"
2645 AC_CHECK_FUNCS(epoll_ctl)
2648 dnl Verify that epoll really works
2649 if test $ac_cv_func_epoll_ctl = yes; then
2650 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
2652 #include <sys/epoll.h>
2655 int main(int argc, char **argv)
2657 int fd = epoll_create(256);
2659 perror("epoll_create:");
2664 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
2665 if test ac_cv_epoll_works = no && test ac_force_epoll = yes; then
2666 echo "Error - no epoll found";
2667 echo "Try running 'sh ./scripts/get_epoll-lib.sh'";
2668 echo "then run configure again";
2673 dnl Magic which checks whether we are forcing a type of comm loop we
2674 dnl are actually going to (ab)use
2676 dnl Actually do the define magic now
2677 dnl mostly ripped from squid-commloops, thanks to adrian and benno
2679 if test -n "$SELECT_TYPE"; then
2680 : # Already decided above. Nothing to do here
2681 elif test "$ac_cv_epoll_works" = "yes" ; then
2683 #comm_kqueue a bit broken. Don't enable automatically
2684 #elif test "$ac_cv_func_kqueue" = "yes" ; then
2685 # SELECT_TYPE="kqueue"
2686 elif test "$ac_cv_func_poll" = "yes" ; then
2688 elif test "$ac_cv_func_select" = "yes" ; then
2691 SELECT_TYPE="select_win32"
2694 SELECT_TYPE="select"
2698 echo "Eep! Can't find poll, kqueue, epoll, or select!"
2699 echo "I'll try select and hope for the best."
2700 SELECT_TYPE="select"
2701 AC_DEFINE(USE_SELECT,1)
2704 echo "Using ${SELECT_TYPE} for the IO loop."
2706 AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2707 AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2708 AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2709 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2710 AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2711 AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2712 AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2714 case $SELECT_TYPE in
2716 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2719 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2722 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2725 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
2728 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2734 dnl Yay! Another Linux brokenness. Its not good enough
2735 dnl to know that setresuid() exists, because RedHat 5.0 declares
2736 dnl setresuid() but doesn't implement it.
2738 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2742 if(setresuid(-1,-1,-1)) {
2743 perror("setresuid:");
2748 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2750 if test "$ac_cv_func_setresuid" = "yes" ; then
2751 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.])
2754 AM_CONDITIONAL(NEED_OWN_SNPRINTF, false)
2755 if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then
2756 AM_CONDITIONAL(NEED_OWN_SNPRINTF, true)
2759 AM_CONDITIONAL(NEED_OWN_STRSEP, false)
2760 if test "$ac_cv_func_strsep" = "no" ; then
2761 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
2764 AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
2765 if test "$ac_cv_func_strtoll" = "no" ; then
2766 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
2770 dnl Test for va_copy
2772 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
2775 void f (int i, ...) {
2776 va_list args1, args2;
2777 va_start (args1, i);
2778 va_copy (args2, args1);
2779 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2781 va_end (args1); va_end (args2);
2787 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
2789 if test "$ac_cv_func_va_copy" = "yes" ; then
2790 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
2794 dnl Some systems support __va_copy
2796 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
2799 void f (int i, ...) {
2800 va_list args1, args2;
2801 va_start (args1, i);
2802 __va_copy (args2, args1);
2803 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2805 va_end (args1); va_end (args2);
2811 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
2813 if test "$ac_cv_func___va_copy" = "yes" ; then
2814 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
2817 dnl IP-Filter support requires ipf header files. These aren't
2818 dnl installed by default, so we need to check for them
2819 if test "$IPF_TRANSPARENT" ; then
2820 AC_MSG_CHECKING(if IP-Filter header files are installed)
2821 # hold on to your hats...
2822 if test "$ac_cv_header_ip_compat_h" = "yes" ||
2823 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
2824 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
2825 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
2826 have_ipfilter_compat_header="yes"
2828 if test "x$have_ipfilter_compat_header" = "xyes" &&
2829 test "$ac_cv_header_ip_fil_h" = "yes" &&
2830 test "$ac_cv_header_ip_nat_h" = "yes" ; then
2831 IPF_TRANSPARENT="yes"
2832 AC_DEFINE(IPF_TRANSPARENT, 1)
2833 elif test "$have_ipfilter_compat_header" = "yes" &&
2834 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
2835 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
2836 IPF_TRANSPARENT="yes"
2837 AC_DEFINE(IPF_TRANSPARENT, 1)
2839 IPF_TRANSPARENT="no"
2840 AC_DEFINE(IPF_TRANSPARENT, 0)
2842 AC_MSG_RESULT($IPF_TRANSPARENT)
2844 if test "$IPF_TRANSPARENT" = "no" ; then
2845 echo "WARNING: Cannot find necessary IP-Filter header files"
2846 echo " Transparent Proxy support WILL NOT be enabled"
2848 elif test "$IPF_TRANSPARENT" = "yes" ; then
2849 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
2850 dnl Solaris minor version (8, 9, 10, ...)
2853 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
2854 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
2855 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
2862 dnl PF support requires a header file.
2863 if test "$PF_TRANSPARENT" ; then
2864 AC_MSG_CHECKING(if PF header file is installed)
2865 # hold on to your hats...
2866 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
2867 PF_TRANSPARENT="yes"
2868 AC_DEFINE(PF_TRANSPARENT, 1)
2871 AC_DEFINE(PF_TRANSPARENT, 0)
2873 AC_MSG_RESULT($PF_TRANSPARENT)
2875 if test "$PF_TRANSPARENT" = "no" ; then
2876 echo "WARNING: Cannot find necessary PF header file"
2877 echo " Transparent Proxy support WILL NOT be enabled"
2881 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
2882 dnl Shamelessly copied from above
2883 if test "$LINUX_NETFILTER" ; then
2884 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
2885 # hold on to your hats...
2886 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
2887 LINUX_NETFILTER="yes"
2888 AC_DEFINE(LINUX_NETFILTER, 1)
2890 LINUX_NETFILTER="no"
2891 AC_DEFINE(LINUX_NETFILTER, 0)
2893 AC_MSG_RESULT($LINUX_NETFILTER)
2895 if test "$LINUX_NETFILTER" = "no" ; then
2896 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
2897 echo " Linux Transparent Proxy support WILL NOT be enabled"
2901 dnl Linux Netfilter/TPROXY support requires some specific header files
2902 dnl Shamelessly copied from shamelessly copied from above
2903 if test "$LINUX_TPROXY" ; then
2904 AC_MSG_CHECKING(if TPROXY header files are installed)
2905 # hold on to your hats...
2906 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
2908 AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.])
2911 AC_DEFINE(LINUX_TPROXY, 0, [Enable real Transparent Proxy support for Netfilter TPROXY.])
2913 AC_MSG_RESULT($LINUX_TPROXY)
2915 if test "$LINUX_TPROXY" = "no" && test "$LINUX_NETFILTER" = "yes"; then
2916 echo "WARNING: Cannot find TPROXY headers, you need to install the"
2917 echo "tproxy package from:"
2918 echo " - lynx http://www.balabit.com/downloads/tproxy/"
2922 if test -z "$USE_GNUREGEX" ; then
2924 *-sun-solaris2.[[0-4]])
2932 AC_MSG_CHECKING(if GNUregex needs to be compiled)
2933 if test -z "$USE_GNUREGEX"; then
2934 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
2937 AC_TRY_COMPILE([#include <sys/types.h>
2938 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
2943 AC_MSG_RESULT($USE_GNUREGEX)
2944 if test "$USE_GNUREGEX" = "yes"; then
2946 LIBREGEX="libregex.a"
2947 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
2959 dnl Not cached since people are likely to tune this
2960 AC_MSG_CHECKING(Default FD_SETSIZE value)
2969 #include <sys/time.h>
2971 #if HAVE_SYS_SELECT_H
2972 #include <sys/select.h>
2974 #if HAVE_SYS_TYPES_H
2975 #include <sys/types.h>
2978 FILE *fp = fopen("conftestval", "w");
2979 fprintf (fp, "%d\n", FD_SETSIZE);
2983 DEFAULT_FD_SETSIZE=`cat conftestval`,
2984 DEFAULT_FD_SETSIZE=256,
2985 DEFAULT_FD_SETSIZE=256)
2986 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
2987 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
2990 dnl Not cached since people are likely to tune this
2991 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
2992 dnl damn! FreeBSD's pthreads breaks dup2().
2993 if test -n "$squid_filedescriptors_num" ; then
2994 SQUID_MAXFD=$squid_filedescriptors_num
2995 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
2999 i386-unknown-freebsd*)
3000 if echo "$LDFLAGS" | grep -q pthread; then
3001 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3007 #include <sys/time.h> /* needed on FreeBSD */
3008 #include <sys/param.h>
3009 #include <sys/resource.h>
3013 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
3014 /* getrlimit and sysconf returns bogous values on cygwin32.
3015 * Number of fds is virtually unlimited in cygwin (sys/param.h)
3016 * __CYGWIN32__ is deprecated.
3022 #if defined(RLIMIT_NOFILE)
3023 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3024 perror("getrlimit: RLIMIT_NOFILE");
3026 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3027 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3028 perror("setrlimit: RLIMIT_NOFILE");
3031 #elif defined(RLIMIT_OFILE)
3032 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3033 perror("getrlimit: RLIMIT_OFILE");
3035 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3036 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3037 perror("setrlimit: RLIMIT_OFILE");
3040 #endif /* RLIMIT_NOFILE */
3041 #endif /* HAVE_SETRLIMIT */
3042 /* by starting at 2^14, we will never get higher
3043 than 2^15 for SQUID_MAXFD */
3047 if (dup2(0, i) < 0) {
3055 #endif /* IF !DEF CYGWIN */
3056 fp = fopen("conftestval", "w");
3057 fprintf (fp, "%d\n", i & ~0x3F);
3061 SQUID_MAXFD=`cat conftestval`,
3064 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3070 AC_MSG_RESULT($SQUID_MAXFD)
3072 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3073 if test "$SQUID_MAXFD" -lt 512 ; then
3074 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
3075 echo " cache will be very busy. Please see the FAQ page"
3076 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
3077 echo " on how to increase your filedescriptor limit"
3082 if test `expr $SQUID_MAXFD % 64` != 0; then
3083 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
3084 echo " on certain platforms."
3088 dnl Not cached since people are likely to tune this
3089 AC_MSG_CHECKING(Default UDP send buffer size)
3093 #include <sys/types.h>
3094 #include <sys/socket.h>
3095 #include <netinet/in.h>
3099 int fd,val=0,len=sizeof(int);
3100 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3101 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3102 if (val<=0) exit(1);
3103 fp = fopen("conftestval", "w");
3104 fprintf (fp, "%d\n", val);
3108 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3109 SQUID_DETECT_UDP_SO_SNDBUF=16384,
3110 SQUID_DETECT_UDP_SO_SNDBUF=16384)
3111 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3112 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3114 dnl Not cached since people are likely to tune this
3115 AC_MSG_CHECKING(Default UDP receive buffer size)
3119 #include <sys/types.h>
3120 #include <sys/socket.h>
3121 #include <netinet/in.h>
3125 int fd,val=0,len=sizeof(int);
3126 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3127 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3128 if (val <= 0) exit(1);
3129 fp = fopen("conftestval", "w");
3130 fprintf (fp, "%d\n", val);
3134 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3135 SQUID_DETECT_UDP_SO_RCVBUF=16384,
3136 SQUID_DETECT_UDP_SO_RCVBUF=16384)
3137 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3138 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3140 dnl Not cached since people are likely to tune this
3141 AC_MSG_CHECKING(Default TCP send buffer size)
3145 #include <sys/types.h>
3146 #include <sys/socket.h>
3147 #include <netinet/in.h>
3151 int fd,val=0,len=sizeof(int);
3152 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3153 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3154 if (val <= 0) exit(1);
3155 fp = fopen("conftestval", "w");
3156 fprintf (fp, "%d\n", val);
3160 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
3161 SQUID_TCP_SO_SNDBUF=16384,
3162 SQUID_TCP_SO_SNDBUF=16384)
3163 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3164 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3165 echo "Limiting send buffer size to 32K"
3166 SQUID_TCP_SO_SNDBUF=32768
3168 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3170 dnl Not cached since people are likely to tune this
3171 AC_MSG_CHECKING(Default TCP receive buffer size)
3175 #include <sys/types.h>
3176 #include <sys/socket.h>
3177 #include <netinet/in.h>
3181 int fd,val=0,len=sizeof(int);
3182 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3183 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3184 if (val <= 0) exit(1);
3185 fp = fopen("conftestval", "w");
3186 fprintf (fp, "%d\n", val);
3190 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
3191 SQUID_TCP_SO_RCVBUF=16384,
3192 SQUID_TCP_SO_RCVBUF=16384)
3193 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3194 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3195 echo "Limiting receive buffer size to 64K"
3196 SQUID_TCP_SO_RCVBUF=65535
3198 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3199 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3200 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
3201 ac_cv_needs_sys_errlist="no",
3202 ac_cv_needs_sys_errlist="yes")
3204 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3205 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3208 dnl Not cached since people are likely to change this
3209 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3210 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3212 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
3215 AC_MSG_CHECKING(if inet_ntoa() actually works)
3219 #include <sys/types.h>
3220 #include <netinet/in.h>
3221 #include <arpa/inet.h>
3226 in.s_addr = inet_addr("1.2.3.4");
3227 fp = fopen("conftestval", "w");
3228 fprintf (fp, "%s\n", inet_ntoa(in));
3232 INET_NTOA_RESULT=`cat conftestval`,
3233 INET_NTOA_RESULT="broken",
3234 INET_NTOA_RESULT="broken")
3235 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3236 AC_MSG_RESULT("yes")
3241 echo "Using Win32 resolver instead."
3244 echo "Will use our own inet_ntoa()."
3245 AC_LIBOBJ(inet_ntoa)
3246 # echo "WARNING: This looks bad, and probably prevents Squid from working."
3247 # echo " If you're on IRIX and using GCC 2.8, you probably need"
3248 # echo " to use the IRIX C compiler instead."
3254 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3255 AC_MSG_CHECKING(for working statvfs() interface)
3259 #include <sys/types.h>
3260 #include <sys/statvfs.h>
3264 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3265 sfs.f_files = sfs.f_ffree = 0;
3266 statvfs("/tmp", &sfs);
3268 ac_cv_func_statvfs=yes,
3269 ac_cv_func_statvfs=no)
3270 AC_MSG_RESULT($ac_cv_func_statvfs)
3271 if test "$ac_cv_func_statvfs" = "yes" ; then
3272 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3276 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3278 #if HAVE_SYS_TYPES_H
3279 #include <sys/types.h>
3281 #if HAVE_NETINET_IN_H
3282 #include <netinet/in.h>
3284 #if HAVE_ARPA_INET_H
3285 #include <arpa/inet.h>
3287 #if HAVE_ARPA_NAMESER_H
3288 #include <arpa/nameser.h>
3294 [_res.nsaddr_list[[0]];],
3295 ac_cv_have_res_nsaddr_list="yes",
3296 ac_cv_have_res_nsaddr_list="no"))
3297 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3298 AC_DEFINE(HAVE_RES_NSADDR_LIST,1,[If _res structure has nsaddr_list member])
3301 if test $ac_cv_have_res_nsaddr_list = "no" ; then
3302 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3304 #if HAVE_SYS_TYPES_H
3305 #include <sys/types.h>
3307 #if HAVE_NETINET_IN_H
3308 #include <netinet/in.h>
3310 #if HAVE_ARPA_INET_H
3311 #include <arpa/inet.h>
3313 #if HAVE_ARPA_NAMESER_H
3314 #include <arpa/nameser.h>
3320 [_res.ns_list[[0]].addr;],
3321 ac_cv_have_res_ns_list="yes",
3322 ac_cv_have_res_ns_list="no"))
3323 if test $ac_cv_have_res_ns_list = "yes" ; then
3324 AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
3328 dnl Need the debugging version of malloc if available
3330 if test "$ac_cv_lib_malloc_main" = "yes" ; then
3331 if test -r /usr/lib/debug/malloc.o ; then
3332 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3334 if test -r /usr/lib/debug/mallocmap.o ; then
3335 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3341 if test -z "$XTRA_LIBS"; then
3344 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3349 dnl Clean up after OSF/1 core dump bug
3366 test-suite/Makefile \
3369 helpers/basic_auth/Makefile \
3370 helpers/basic_auth/LDAP/Makefile \
3371 helpers/basic_auth/MSNT/Makefile \
3372 helpers/basic_auth/NCSA/Makefile \
3373 helpers/basic_auth/PAM/Makefile \
3374 helpers/basic_auth/SMB/Makefile \
3375 helpers/basic_auth/mswin_sspi/Makefile \
3376 helpers/basic_auth/YP/Makefile \
3377 helpers/basic_auth/getpwnam/Makefile \
3378 helpers/basic_auth/multi-domain-NTLM/Makefile \
3379 helpers/basic_auth/SASL/Makefile \
3380 helpers/basic_auth/POP3/Makefile \
3381 helpers/basic_auth/DB/Makefile \
3382 helpers/basic_auth/squid_radius_auth/Makefile \
3383 helpers/digest_auth/Makefile \
3384 helpers/digest_auth/password/Makefile \
3385 helpers/digest_auth/ldap/Makefile \
3386 helpers/digest_auth/eDirectory/Makefile \
3387 helpers/ntlm_auth/Makefile \
3388 helpers/ntlm_auth/fakeauth/Makefile \
3389 helpers/ntlm_auth/no_check/Makefile \
3390 helpers/ntlm_auth/SMB/Makefile \
3391 helpers/ntlm_auth/SMB/smbval/Makefile \
3392 helpers/ntlm_auth/mswin_sspi/Makefile \
3393 helpers/negotiate_auth/Makefile \
3394 helpers/negotiate_auth/mswin_sspi/Makefile \
3395 helpers/negotiate_auth/squid_kerb_auth/Makefile \
3396 helpers/external_acl/Makefile \
3397 helpers/external_acl/ip_user/Makefile \
3398 helpers/external_acl/ldap_group/Makefile \
3399 helpers/external_acl/session/Makefile \
3400 helpers/external_acl/unix_group/Makefile \
3401 helpers/external_acl/wbinfo_group/Makefile \
3402 helpers/external_acl/mswin_lm_group/Makefile \
3406 AC_CONFIG_SUBDIRS(lib/libTrie)