2 dnl Configuration input file for Squid
4 dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
6 dnl $Id: configure.in,v 1.342 2003/07/28 20:41:05 robertc Exp $
12 AC_CONFIG_SRCDIR([src/main.cc])
13 AC_CONFIG_AUX_DIR(cfgaux)
14 AM_INIT_AUTOMAKE(squid, 3.0-PRE2-CVS)
15 AM_CONFIG_HEADER(include/autoconf.h)
16 AC_REVISION($Revision: 1.342 $)dnl
17 AC_PREFIX_DEFAULT(/usr/local/squid)
20 dnl Set default LDFLAGS
21 if test -z "$LDFLAGS"; then
25 PRESET_CFLAGS="$CFLAGS"
37 LIBREGEX='' # libregex.a
39 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
43 if test -z "$EXEEXT"; then
46 # automake automatically adds .exe when installing binaries
51 dnl this should be expanded to a list of platform sensible support requirements.
52 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
55 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
58 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
62 if test -z "$CACHE_HTTP_PORT"; then
63 CACHE_HTTP_PORT="3128"
65 if test -z "$CACHE_ICP_PORT"; then
70 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
71 [What default TCP port to use for HTTP listening?])
72 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
73 [What default UDP port to use for ICP listening?])
75 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
77 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
82 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
85 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
89 dnl Set Default CFLAGS
90 if test -z "$PRESET_CFLAGS"; then
91 if test "$GCC" = "yes"; then
94 # sunos has too many warnings for this to be useful
98 # Motorola cc/ld does not like -02 but is ok on -O
99 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
102 CFLAGS="$CFLAGS -Wall"
108 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
109 CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \
110 -woff 1009,1014,1110,1116,1185,1188,1204,1230,1233 \
111 -Wl,-woff,85,-woff,84,-woff,134 \
112 -nostdinc -I/usr/include -D_BSD_SIGNALS"
115 # Mogul says DEC compilers take both -g and -O2
116 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
125 dnl set squid required flags
126 if test "$GCC" = "yes"; then
127 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
128 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wcomments"
133 AC_SUBST(SQUID_CFLAGS)
134 AC_SUBST(SQUID_CXXFLAGS)
137 if test -z "$PRESET_LDFLAGS"; then
138 if test "$GCC" = "yes"; then
147 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
148 LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32"
154 dnl Enable optional modules
155 AC_ARG_ENABLE(dlmalloc,
156 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
161 LIBDLMALLOC="libdlmalloc.a"
162 LIB_MALLOC="-L../lib -ldlmalloc"
163 echo "dlmalloc enabled"
167 echo "dlmalloc disabled"
169 *) use_dlmalloc="yes"
170 LIB_MALLOC="$enableval"
171 echo "dlmalloc enabled with $LIB_MALLOC"
174 if test "${use_dlmalloc-unset}" = unset; then
177 echo "Enabling dlmalloc for $host"
179 LIBDLMALLOC="libdlmalloc.a"
180 LIB_MALLOC="-L../lib -ldlmalloc"
183 echo "Enabling dlmalloc for $host"
185 LIBDLMALLOC="libdlmalloc.a"
186 LIB_MALLOC="-L../lib -ldlmalloc"
190 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
191 # Ok. dlmalloc was enabled before, but state may be changed.
192 # we have to test these again
193 unset ac_cv_func_mallinfo
194 unset ac_cv_func_mallocblksize
195 unset ac_cv_func_free
196 unset ac_cv_func_realloc
197 unset ac_cv_func_memalign
198 unset ac_cv_func_valloc
199 unset ac_cv_func_pvalloc
200 unset ac_cv_func_calloc
201 unset ac_cv_func_cfree
202 unset ac_cv_func_malloc_trim
203 unset ac_cv_func_malloc_usable_size
204 unset ac_cv_func_malloc_stats
205 unset ac_cv_func_mallinfo
206 unset ac_cv_func_mallopt
207 unset ac_cv_lib_gnumalloc
208 unset ac_cv_header_gnumalloc_h
209 unset ac_cv_lib_malloc
210 unset ac_cv_enabled_dlmalloc
212 if test "$use_dlmalloc" = yes; then
213 ac_cv_func_mallinfo="yes"
214 ac_cv_func_mallocblksize="no"
215 ac_cv_func_free="yes"
216 ac_cv_func_realloc="yes"
217 ac_cv_func_memalign="yes"
218 ac_cv_func_valloc="yes"
219 ac_cv_func_pvalloc="yes"
220 ac_cv_func_calloc="yes"
221 ac_cv_func_cfree="yes"
222 ac_cv_func_malloc_trim="yes"
223 ac_cv_func_malloc_usable_size="yes"
224 ac_cv_func_malloc_stats="yes"
225 ac_cv_func_mallopt="yes"
226 ac_cv_lib_gnumalloc="no"
227 ac_cv_header_gnumalloc_h="no"
228 ac_cv_lib_malloc="no"
229 ac_cv_enabled_dlmalloc="yes"
230 AC_DEFINE(USE_DLMALLOC, 1, [Compile & use the malloc package by Doug Lea])
233 AC_SUBST(LIBDLMALLOC)
236 AC_ARG_ENABLE(gnuregex,
237 [ --enable-gnuregex Compile GNUregex],
238 [USE_GNUREGEX=$enableval])
242 AC_ARG_ENABLE(optimizations,
243 [ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
244 Optimization is good for production builds, but not
245 good for debugging. During development, use
246 --disable-optimizations to reduce compilation times
247 and allow easier debugging. This option implicitly
248 also enabled --disable-inline],
249 [ if test "$enableval" = "no" ; then
250 echo "Disabling compiler optimizations (-O flag)"
251 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
252 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
257 AC_ARG_ENABLE(inline,
258 [ --disable-inline Don't compile trivial methods as inline. Squid
259 is coded with much of the code able to be inlined.
260 Inlining is good for production builds, but not
261 good for development. During development, use
262 --disable-inline to reduce compilation times and
263 allow incremental builds to be quick. For
264 production builds, or load tests, use
265 --enable-inline to have squid make all trivial
266 methods inlinable by the compiler.],
267 [ if test "$enableval" = "no" ; then
272 if test "$SquidInline" = "yes" ; then
273 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
274 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
276 echo "Inlining optimization disabled"
277 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
280 AC_ARG_ENABLE(debug-cbdata,
281 [ --enable-debug-cbdata Provide some debug information in cbdata],
282 [ if test "$enableval" = "yes" ; then
283 echo "cbdata debugging enabled"
284 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
288 dnl This is a developer only option.. developers know how to set defines
290 dnl AC_ARG_ENABLE(xmalloc-debug,
291 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
292 dnl [ if test "$enableval" = "yes" ; then
293 dnl echo "Malloc debugging enabled"
294 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
298 dnl This is a developer only option.. developers know how to set defines
300 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
301 dnl [ --enable-xmalloc-debug-trace
302 dnl Detailed trace of memory allocations],
303 dnl [ if test "$enableval" = "yes" ; then
304 dnl echo "Malloc debug trace enabled"
305 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
306 dnl AC_DEFINE(XMALLOC_DEBUG,1)
310 AC_ARG_ENABLE(xmalloc-statistics,
311 [ --enable-xmalloc-statistics
312 Show malloc statistics in status page],
313 [ if test "$enableval" = "yes" ; then
314 echo "Malloc statistics enabled"
315 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
321 [ --disable-carp Disable CARP support],
322 [ if test "$enableval" = "no" ; then
327 if test $use_carp = 1; then
328 AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol])
330 AC_DEFINE(USE_CARP, 1)
333 AC_ARG_ENABLE(async-io,
334 [ --enable-async-io[=N_THREADS]
336 --with-aufs-threads=N_THREADS
338 --enable-storeio=ufs,aufs],
342 STORE_MODULES="ufs aufs"
347 aufs_io_threads=$enableval
349 STORE_MODULES="ufs aufs"
354 AC_ARG_WITH(aufs-threads,
355 [ --with-aufs-threads=N_THREADS
356 Tune the number of worker threads for the aufs object
360 aufs_io_threads=$withval
363 echo "ERROR: Invalid --with-aufs-threads argument"
368 if test "$aufs_io_threads"; then
369 echo "With $aufs_io_threads aufs threads"
370 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
371 [Defines how many threads aufs uses for I/O])
374 AC_ARG_WITH(pthreads,
375 [ --with-pthreads Use POSIX Threads])
376 if test "$with_pthreads" = "yes"; then
381 [ --with-aio Use POSIX AIO])
382 if test "$with_aio" = "yes"; then
387 [ --with-dl Use dynamic linking])
388 if test "$with_dl" = "yes"; then
392 AC_ARG_ENABLE(storeio,
393 [ --enable-storeio=\"list of modules\"
394 Build support for the list of store I/O modules.
395 The default is only to build the "ufs" module.
396 See src/fs for a list of available modules, or
397 Programmers Guide section <not yet written>
398 for details on how to build your custom store module],
401 for dir in $srcdir/src/fs/*; do
402 module="`basename $dir`"
403 if test -d "$dir" && test "$module" != CVS; then
404 STORE_MODULES="$STORE_MODULES $module"
411 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
415 [ if test -z "$STORE_MODULES"; then
419 if test -n "$STORE_MODULES"; then
420 for module in $STORE_MODULES; do
421 if test -d $srcdir/src/fs/$module; then
424 echo "ERROR: storeio $module does not exists"
428 echo "Store modules built: $STORE_MODULES"
429 STORE_OBJS="fs/lib`echo $STORE_MODULES|sed -e 's% %.a fs/lib%g'`.a"
430 STORE_LIBS="`echo $STORE_OBJS|sed -e 's%fs/%%g'`"
432 for module in $STORE_MODULES; do
433 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
436 dnl remove all but diskd - its the only module that needs to recurse
437 dnl into the sub directory
438 STORE_MODULE_SUBDIRS=
441 for fs in $STORE_MODULES none; do
444 STORE_MODULE_SUBDIRS="$STORE_MODULE_SUBDIRS $fs"
445 STORE_PROGRAMS="$STORE_PROGRAMS diskd/diskd"
449 if test -z "$with_pthreads"; then
450 echo "aufs store used, pthreads support automatically enabled"
456 if test -z "$with_aio"; then
457 echo "coss store used, aio support automatically enabled"
466 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
467 echo "adding UFS, as it contains core logic for diskd and aufs"
468 STORE_OBJS="$STORE_OBJS fs/libufs.a"
469 STORE_LIBS="$STORE_LIBS libufs.a"
470 STORE_MODULES="$STORE_MODULES ufs"
471 STORE_LINKOBJS="$STORE_SOURCE fs/ufs/StoreFSufs.o"
476 AC_SUBST(STORE_PROGRAMS)
477 AC_SUBST(STORE_MODULE_SUBDIRS)
478 AC_SUBST(STORE_LINKOBJS)
480 AC_ARG_ENABLE(removal-policies,
481 [ --enable-removal-policies=\"list of policies\"
482 Build support for the list of removal policies.
483 The default is only to build the "lru" module.
484 See src/repl for a list of available modules, or
485 Programmers Guide section 9.9 for details on how
486 to build your custom policy],
489 for dir in $srcdir/src/repl/*; do
490 module="`basename $dir`"
491 if test -d "$dir" && test "$module" != CVS; then
492 REPL_POLICIES="$REPL_POLICIES $module"
499 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
503 [ if test -z "$REPL_POLICIES"; then
507 if test -n "$REPL_POLICIES"; then
508 for module in $REPL_POLICIES; do
509 if test -d $srcdir/src/repl/$module; then
512 echo "ERROR: Removal policy $module does not exists"
516 echo "Removal policies built: $REPL_POLICIES"
517 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
518 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
520 AC_SUBST(REPL_POLICIES)
524 AM_CONDITIONAL(ENABLE_PINGER, false)
526 [ --enable-icmp Enable ICMP pinging],
527 [ if test "$enableval" = "yes" ; then
529 AC_DEFINE(USE_ICMP,1,
530 [If you want to use Squid's ICMP features (highly recommended!) then
531 define this. When USE_ICMP is defined, Squid will send ICMP pings
532 to origin server sites. This information is used in numerous ways:
533 - Sent in ICP replies so neighbor caches know how close
534 you are to the source.
535 - For finding the closest instance of a URN.
536 - With the 'test_reachability' option. Squid will return
537 ICP_OP_MISS_NOFETCH for sites which it cannot ping.])
538 AM_CONDITIONAL(ENABLE_PINGER, true)
542 AM_CONDITIONAL(USE_DELAY_POOLS, false)
543 AC_ARG_ENABLE(delay-pools,
544 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
545 [ if test "$enableval" = "yes" ; then
546 echo "Delay pools enabled"
547 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
548 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
552 AM_CONDITIONAL(USE_ESI, false)
554 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.]),
555 ac_cv_use_esi=$enableval, ac_cv_use_esi=no)
556 AC_CACHE_CHECK(whether to enable ESI,ac_cv_use_esi, ac_cv_use_esi=no)
557 if test "$ac_cv_use_esi" = "yes" ; then
558 AC_DEFINE(ESI,1,[Compile the ESI processor and Surrogate header support])
559 AM_CONDITIONAL(USE_ESI, true)
560 XTRA_LIBS="$XTRA_LIBS -lexpat"
562 AC_DEFINE(ESI,0,[Compile the ESI processor and Surrogate header support])
565 dnl This is a developer only option. Developers know how to set defines
567 dnl AC_ARG_ENABLE(mem-gen-trace,
568 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
569 dnl [ if test "$enableval" = "yes" ; then
570 dnl echo "Memory trace (to file) enabled"
571 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
575 AC_ARG_ENABLE(useragent-log,
576 [ --enable-useragent-log Enable logging of User-Agent header],
577 [ if test "$enableval" = "yes" ; then
578 echo "User-Agent logging enabled"
579 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
580 By default, they are written to useragent.log in the Squid log
585 AC_ARG_ENABLE(referer-log,
586 [ --enable-referer-log Enable logging of Referer header],
587 [ if test "$enableval" = "yes" ; then
588 echo "Referer logging enabled"
589 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
590 By default, they are written to referer.log in the Squid log
597 [ --disable-wccp Disable Web Cache Coordination Protocol],
598 [ if test "$enableval" = "no" ; then
599 echo "Web Cache Coordination Protocol disabled"
603 if test $use_wccp = 1; then
604 AC_DEFINE(USE_WCCP, 1,[Define to enable WCCP])
606 AC_DEFINE(USE_WCCP, 0)
609 AC_ARG_ENABLE(kill-parent-hack,
610 [ --enable-kill-parent-hack
611 Kill parent on shutdown],
612 [ if test "$enableval" = "yes" ; then
613 echo "Kill parent on shutdown"
614 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
615 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
620 AM_CONDITIONAL(USE_SNMP, false)
622 [ --enable-snmp Enable SNMP monitoring],
623 [ if test "$enableval" = "yes" ; then
624 echo "SNMP monitoring enabled"
625 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
626 SNMPLIB='-L../snmplib -lsnmp'
627 AM_CONDITIONAL(USE_SNMP, true)
628 SNMP_MAKEFILE=./snmplib/Makefile
633 AC_SUBST(makesnmplib)
635 AC_ARG_ENABLE(cachemgr-hostname,
636 [ --enable-cachemgr-hostname[=hostname]
637 Make cachemgr.cgi default to this host],
640 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
641 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
642 echo "Cachemgr default hostname == host where cachemgr runs"
648 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
649 echo "Cachemgr default hostname set to ${enableval}"
654 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
655 AC_ARG_ENABLE(arp-acl,
656 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
657 [ if test "$enableval" = "yes" ; then
658 echo "ARP ACL lists enabled (ether address)"
665 echo "WARNING: ARP ACL support probably won't work on $host."
669 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, ?).])
670 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
674 AM_CONDITIONAL(ENABLE_HTCP, false)
676 [ --enable-htcp Enable HTCP protocol],
677 [ if test "$enableval" = "yes" ; then
679 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
680 AM_CONDITIONAL(ENABLE_HTCP, true)
684 AM_CONDITIONAL(ENABLE_SSL, false)
687 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
688 [ if test "$enableval" != "no"; then
689 echo "SSL gatewaying using OpenSSL enabled"
690 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
691 AM_CONDITIONAL(ENABLE_SSL, true)
692 SSLLIB='-lssl -lcrypto'
697 AM_CONDITIONAL(NEED_OWN_MD5, true)
700 [ --with-openssl[=prefix]
701 Compile with the OpenSSL libraries. The path to
702 the OpenSSL development libraries and headers
703 installation can be specified if outside of the
704 system standard directories],
706 case "$with_openssl" in
714 SSLLIBDIR="$with_openssl/lib"
715 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
720 if test -n "$USE_OPENSSL"; then
721 echo "Using OpenSSL MD5 implementation"
722 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)])
723 AM_CONDITIONAL(NEED_OWN_MD5, false)
724 if test -z "$SSLLIB"; then
725 SSLLIB="-lcrypto" # for MD5 routines
727 dnl This is a workaround for RedHat 9 brain damage..
728 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
729 echo "OpenSSL depends on Kerberos"
730 SSLLIBDIR="/usr/kerberos/lib"
731 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
734 if test -n "$SSLLIBDIR"; then
735 SSLLIB="-L$SSLLIBDIR $SSLLIB"
739 AC_ARG_ENABLE(forw-via-db,
740 [ --enable-forw-via-db Enable Forw/Via database],
741 [ if test "$enableval" = "yes" ; then
742 echo "FORW-VIA enabled"
743 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
747 AC_ARG_ENABLE(cache-digests,
748 [ --enable-cache-digests Use Cache Digests
749 see http://www.squid-cache.org/FAQ/FAQ-16.html],
750 [ if test "$enableval" = "yes" ; then
751 echo "USE_CACHE_DIGESTS enabled"
752 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
756 dnl Select Default Error language
757 AC_ARG_ENABLE(default-err-language,
758 [ --enable-default-err-language=lang
759 Select default language for Error pages (see
762 if test -d $srcdir/errors/$enableval; then
763 ERR_DEFAULT_LANGUAGE=$enableval
765 echo "ERROR! Unknown language $enableval, see errors/ directory"
768 ],[ERR_DEFAULT_LANGUAGE="English"])
769 AC_SUBST(ERR_DEFAULT_LANGUAGE)
771 dnl Select languages to be installed
772 AC_ARG_ENABLE(err-languages,
773 [ --enable-err-languages=\"lang1 lang2..\"
774 Select languages to be installed. (All will be
775 installed by default) ],
777 for l in $enableval; do
778 if test -d $srcdir/errors/$l; then :; else
779 echo "ERROR! Unknown language $$l, see errors/"
783 ERR_LANGUAGES=$enableval
786 for l in $srcdir/errors/*; do
787 if test -f $l/ERR_ACCESS_DENIED; then
788 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
792 AC_SUBST(ERR_LANGUAGES)
794 dnl Size of COSS memory buffer
795 AC_ARG_WITH(coss-membuf-size,
796 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
797 [ if test "$with_coss_membuf_size"; then
798 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
799 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
803 dnl check for netio plugin stuff
806 [ --enable-poll Enable poll() support.
807 --disable-poll Disable poll() support. ],
812 echo "Forcing poll() to be enabled"
813 ac_cv_func_poll='yes'
816 echo "Forcing poll() to be disabled"
823 AC_ARG_ENABLE(select,
824 [ --enable-select Enable select() support.
825 --disable-select Disable select() support. ],
830 echo "Forcing select() to be enabled"
831 ac_cv_func_select='yes'
834 echo "Forcing select() to be disabled"
835 ac_cv_func_select='no'
841 AC_ARG_ENABLE(kqueue,
842 [ --enable-kqueue Enable kqueue() support.
843 --disable-kqueue Disable kqueue() support. ],
848 echo "Forcing kqueue() to be enabled"
849 ac_cv_func_kqueue='yes'
852 echo "Forcing kqueue() to be disabled"
853 ac_cv_func_kqueue='no'
859 AM_CONDITIONAL(USE_EPOLL, false)
860 AC_DEFINE(USE_EPOLL,0,[Use epoll type polling])
862 [ --enable-epoll Enable epoll() support.
863 --disable-epoll Disable epoll() support. ],
868 echo "Forcing epoll() to be enabled"
869 ac_cv_func_epoll='yes'
870 if test -z "$EPOLL_LIBS"; then
874 AM_CONDITIONAL(USE_EPOLL, true)
877 echo "Forcing epoll() to be disabled"
878 ac_cv_func_epoll='no'
884 dnl Disable HTTP violations
886 AC_ARG_ENABLE(http-violations,
887 [ --disable-http-violations
888 This allows you to remove code which is known to
889 violate the HTTP protocol specification.],
890 [ if test "$enableval" = "no" ; then
891 echo "Disabling HTTP Violations"
895 if test $http_violations = 1; then
896 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.])
898 AC_DEFINE(HTTP_VIOLATIONS, 0)
901 dnl Enable IP-Filter Transparent Proxy
902 AC_ARG_ENABLE(ipf-transparent,
903 [ --enable-ipf-transparent
904 Enable Transparent Proxy support for systems
905 using IP-Filter network address redirection.],
906 [ if test "$enableval" = "yes" ; then
907 echo "IP-Filter Transparent Proxy enabled"
908 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.])
909 IPF_TRANSPARENT="yes"
913 dnl Enable PF Transparent Proxy
914 AC_ARG_ENABLE(pf-transparent,
915 [ --enable-pf-transparent
916 Enable Transparent Proxy support for systems
917 using PF network address redirection.],
918 [ if test "$enableval" = "yes" ; then
919 echo "PF Transparent Proxy enabled"
920 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
925 dnl Enable Linux Netfilter (2.4) Transparent Proxy
926 AC_ARG_ENABLE(linux-netfilter,
927 [ --enable-linux-netfilter
928 Enable Transparent Proxy support for Linux 2.4.],
929 [ if test "$enableval" = "yes" ; then
930 echo "Linux-Netfilter Transparent Proxy enabled"
931 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux 2.4 systems])
932 LINUX_NETFILTER="yes"
936 dnl Enable Large file support
937 AC_ARG_ENABLE(large-files,
938 [ --enable-large-files Enable support for large files (>2GB). Still
940 [ if test "$enableval" = "yes" ; then
941 echo "Large file support enabled"
942 CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
943 CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
947 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
948 dnl Enable Leak Finding Functions
949 AC_ARG_ENABLE(leakfinder,
950 [ --enable-leakfinder
951 Enable Leak Finding code. Enabling this alone
952 does nothing; you also have to modify the source
953 code to use the leak finding functions. Probably
954 Useful for hackers only.],
955 [ if test "$enableval" = "yes" ; then
956 echo "Leak-Finding enabled"
957 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
959 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
964 AC_ARG_ENABLE(ident-lookups,
965 [ --disable-ident-lookups
966 This allows you to remove code that performs
967 Ident (RFC 931) lookups.],
968 [ if test "$enableval" = "no" ; then
969 echo "Disabling Ident Lookups"
973 if test $use_ident = 1; then
974 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
975 AM_CONDITIONAL(ENABLE_IDENT, true)
977 AC_DEFINE(USE_IDENT, 0)
978 AM_CONDITIONAL(ENABLE_IDENT, false)
981 AM_CONDITIONAL(USE_DNSSERVER, false)
983 AC_ARG_ENABLE(internal-dns,
984 [ --disable-internal-dns This prevents Squid from directly sending and
985 receiving DNS messages, and instead enables the
986 old external 'dnsserver' processes.],
987 [ if test "$enableval" = "no" ; then
988 echo "Disabling Internal DNS queries"
992 if test "$use_dnsserver" = "yes"; then
993 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
994 AM_CONDITIONAL(USE_DNSSERVER, true)
997 AC_ARG_ENABLE(truncate,
998 [ --enable-truncate This uses truncate() instead of unlink() when
999 removing cache files. Truncate gives a little
1000 performance improvement, but may cause problems
1001 when used with async I/O. Truncate uses more
1002 filesystem inodes than unlink..],
1003 [ if test "$enableval" = "yes" ; then
1004 echo "Enabling truncate instead of unlink"
1005 AC_DEFINE(USE_TRUNCATE,1,[Do we want to use truncate(2) or unlink(2)?])
1009 dnl Disable hostname checks
1010 enable_hostname_checks=0
1011 AC_ARG_ENABLE(hostname_checks,
1012 [ --enable-hostname-checks
1013 Tells Squid to rejects any host names with
1014 odd characters in their name to conform with
1015 internet standards. This was the default in
1016 prior Squid versions, but since Squid-3 Squid
1017 no longer tries to police the use of DNS],
1018 [ if test "$enableval" = "yes"; then
1019 echo "Enabling hostname sanity checks"
1020 enable_hostname_checks=1
1023 if test "$enable_hostname_checks" = 1; then
1024 AC_DEFINE(CHECK_HOSTNAMES, 1, [Enable hostname sanity checks])
1027 dnl Enable underscore in hostnames
1028 AC_ARG_ENABLE(underscores,
1029 [ --enable-underscores Squid by default rejects any host names with _
1030 in their name to conform with internet standards.
1031 If you disagree with this you may allow _ in
1032 hostnames by using this switch, provided that
1033 the resolver library on the host where Squid runs
1034 does not reject _ in hostnames...],
1035 [ if test "$enableval" = "yes" ; then
1036 echo "Enabling the use of underscores in host names"
1037 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1,[Allow underscores in host names])
1041 dnl Select Default hosts file location
1042 AC_ARG_ENABLE(default-hostsfile,
1043 [ --enable-default-hostsfile=path
1044 Select default location for hosts file.
1045 See hosts_file directive in squid.conf for details],
1047 if test "$enableval" != "none" ; then
1048 if test -f $enableval; then
1049 OPT_DEFAULT_HOSTS=$enableval
1051 echo "Warning Unable to find $enableval"
1055 OPT_DEFAULT_HOSTS="none"
1057 echo "Default hosts file set to: $enableval"
1058 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1059 AC_SUBST(OPT_DEFAULT_HOSTS)
1061 dnl Select auth schemes modules to build
1063 [ --enable-auth=\"list of auth scheme modules\"
1064 Build support for the list of authentication schemes.
1065 The default is to build support for the Basic scheme.
1066 See src/auth for a list of available modules, or
1067 Programmers Guide section authentication schemes
1068 for details on how to build your custom auth scheme
1070 [ case $enableval in
1072 for dir in $srcdir/src/auth/*; do
1073 module="`basename $dir`"
1074 if test -d "$dir" && test "$module" != CVS; then
1075 AUTH_MODULES="$AUTH_MODULES $module"
1082 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1086 [ if test -z "$AUTH_MODULES"; then
1087 AUTH_MODULES="basic"
1090 if test -n "$AUTH_MODULES"; then
1091 for module in $AUTH_MODULES; do
1092 if test -d $srcdir/src/auth/$module; then
1095 echo "ERROR: Auth scheme $module does not exists"
1099 echo "Auth scheme modules built: $AUTH_MODULES"
1100 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1101 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1103 AC_SUBST(AUTH_MODULES)
1107 dnl Select basic auth scheme helpers to build
1108 BASIC_AUTH_HELPERS=""
1109 AC_ARG_ENABLE(basic-auth-helpers,
1110 [ --enable-basic-auth-helpers=\"list of helpers\"
1111 This option selects which basic scheme proxy_auth
1112 helpers to build and install as part of the normal
1113 build process. For a list of available
1114 helpers see the helpers/basic_auth directory.],
1115 [ case "$enableval" in
1117 for dir in $srcdir/helpers/basic_auth/*; do
1118 helper="`basename $dir`"
1119 if test -d "$dir" && test "$helper" != CVS; then
1120 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1127 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1131 if test -n "$BASIC_AUTH_HELPERS"; then
1132 for helper in $BASIC_AUTH_HELPERS; do
1133 if test -d $srcdir/helpers/basic_auth/$helper; then
1136 echo "ERROR: Basic auth helper $helper does not exists"
1140 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1142 AC_SUBST(BASIC_AUTH_HELPERS)
1144 dnl Select ntlm auth helpers to build
1146 AC_ARG_ENABLE(ntlm-auth-helpers,
1147 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1148 This option selects which proxy_auth ntlm helpers
1149 to build and install as part of the normal build
1150 process. For a list of available helpers see
1151 the helpers/ntlm_auth directory.],
1152 [ case "$enableval" in
1154 for dir in $srcdir/helpers/ntlm_auth/*; do
1155 helper="`basename $dir`"
1156 if test -d "$dir" && test "$helper" != CVS; then
1157 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1164 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1168 if test -n "$NTLM_AUTH_HELPERS"; then
1169 for helper in $NTLM_AUTH_HELPERS; do
1170 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1173 echo "ERROR: NTLM Auth helper $helper does not exists"
1177 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1179 AC_SUBST(NTLM_AUTH_HELPERS)
1181 dnl Select digest auth scheme helpers to build
1182 DIGEST_AUTH_HELPERS=
1183 AC_ARG_ENABLE(digest-auth-helpers,
1184 [ --enable-digest-auth-helpers=\"list of helpers\"
1185 This option selects which digest scheme authentication
1186 helpers to build and install as part of the normal build
1187 process. For a list of available helpers see the
1188 helpers/digest_auth directory.],
1189 [ case "$enableval" in
1191 for dir in $srcdir/helpers/digest_auth/*; do
1192 helper="`basename $dir`"
1193 if test -d "$dir" && test "$helper" != CVS; then
1194 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1201 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1205 if test -n "$DIGEST_AUTH_HELPERS"; then
1206 for helper in $DIGEST_AUTH_HELPERS; do
1207 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1210 echo "ERROR: digest auth helper $helper does not exists"
1214 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1216 AC_SUBST(DIGEST_AUTH_HELPERS)
1218 dnl Enable "NTLM fail open"
1219 AC_ARG_ENABLE(ntlm-fail-open,
1220 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1221 Authentication steps can allow squid to still authenticate
1223 [ if test "$enableval" = "yes" ; then
1224 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.])
1228 dnl Select external_acl helpers to build
1229 EXTERNAL_ACL_HELPERS=
1230 AC_ARG_ENABLE(external-acl-helpers,
1231 [ --enable-external-acl-helpers=\"list of helpers\"
1232 This option selects which external_acl helpers to
1233 build and install as part of the normal build
1234 process. For a list of available helpers see the
1235 helpers/external_acl directory.],
1236 [ case "$enableval" in
1238 for dir in $srcdir/helpers/external_acl/*; do
1239 helper="`basename $dir`"
1240 if test -d "$dir" && test "$helper" != CVS; then
1241 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1248 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1252 if test -n "$EXTERNAL_ACL_HELPERS"; then
1253 for helper in $EXTERNAL_ACL_HELPERS; do
1254 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1257 echo "ERROR: external acl helper $helper does not exists"
1261 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1263 AC_SUBST(EXTERNAL_ACL_HELPERS)
1265 dnl Disable "memPools" code
1266 AC_ARG_ENABLE(mempools,
1267 [ --disable-mempools Disable memPools],
1268 [ if test "$enableval" = "no" ; then
1269 echo "memPools disabled"
1270 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1274 dnl Enable WIN32 Service compile mode
1275 AC_ARG_ENABLE(win32-service,
1276 [ --enable-win32-service Compile Squid as a WIN32 Service
1277 Works only on Windows NT and Windows 2000 Platforms.],
1278 [ if test "$enableval" = "yes" ; then
1279 echo "Enabling WIN32 run service mode"
1280 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1285 SAMBASOURCES='$(top_srcdir)/include/samba'
1286 AC_ARG_WITH(samba-sources,
1287 [ --with-samba-sources=/path/to/samba-source-tree
1288 Path where the correct Samba source files can be
1289 found while building winbind helpers. (defaults to
1290 use internal copies of the headers from Samba-2.2.7)
1292 [ if test -f $withval/source/nsswitch/winbind_nss_config.h; then
1293 echo "Using Samba sources from $withval"
1294 SAMBASOURCES="$withval/source"
1296 echo "ERROR: Cannot find Samba sources at $withval"
1300 AC_SUBST(SAMBASOURCES)
1302 dnl Disable "unlinkd" code
1303 AC_ARG_ENABLE(unlinkd,
1304 [ --disable-unlinkd Do not use unlinkd],
1305 [ if test "$enableval" = "no" ; then
1311 # Here we should probably use some magic depending on the selected
1315 if test "$use_unlinkd" = "yes"; then
1316 echo "unlinkd enabled"
1317 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1318 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1320 echo "unlinkd disabled"
1321 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1324 dnl Enable backtraces on fatal errors
1325 AC_ARG_ENABLE(stacktraces,
1326 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1327 [ if test "$enableval" = "yes" ; then
1328 echo "Enabling automatic stack backtraces on fatal errors"
1329 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1333 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1334 dnl Enable USE_XPROF_STATS
1335 AC_ARG_ENABLE(cpu-profiling,
1336 [ --enable-cpu-profiling
1337 This option allows you to see which internal functions
1338 in Squid are consuming how much CPU. Compiles in probes
1339 that measure time spent in probed functions. Needs
1340 source modifications to add new probes. This is meant
1341 for developers to assist in performance optimisations
1342 of Squid internal functions.
1343 If you are not developer and not interested in the stats
1344 you shouldn't enable this, as overhead added, although
1345 small, is still overhead. See lib/Profiler.c for more.
1347 [ if test "$enableval" = "yes" ; then
1348 echo "Enabling cpu-profiling"
1349 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1350 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1354 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1355 AC_ARG_ENABLE(x_accelerator_vary,
1356 [ --enable-x-accelerator-vary
1357 Enable support for the X-Accelerator-Vary
1358 HTTP header. Can be used to indicate
1359 variance within an accelerator setup.
1360 Typically used together with other code
1361 that adds custom HTTP headers to the requests.],
1362 [ if test "$enableval" = "yes" ; then
1363 echo "Enabling support for X-Accelerator-Vary"
1364 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1368 AC_ARG_WITH(filedescriptors,
1369 [ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors],
1370 [ squid_filedescriptors_num=$withval ])
1372 # Force some compilers to use ANSI features
1376 if test "$ac_cv_prog_CC" = "cc" ; then
1377 echo "adding '-std1' to cc args for $host"
1383 if test "$ac_cv_prog_CC" = "cc" ; then
1384 echo "adding '-Ae' to cc args for $host"
1391 dnl Check for programs
1396 AC_PATH_PROG(SH, sh, /bin/sh)
1397 AC_PATH_PROG(FALSE, false, /usr/bin/false)
1398 AC_PATH_PROG(TRUE, true, /usr/bin/true)
1399 AC_PATH_PROG(RM, rm, $FALSE)
1400 AC_PATH_PROG(MV, mv, $FALSE)
1401 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
1402 AC_PATH_PROG(LN, ln, cp)
1403 AC_PATH_PROG(PERL, perl, none)
1404 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
1405 AC_PATH_PROG(AR, ar, $FALSE)
1407 if test "$ac_cv_path_PERL" = "none"; then
1408 echo "Perl is required to compile Squid"
1409 echo "Please install Perl and then re-run configure"
1415 echo "Disabling 'ranlib' for HP-UX..."
1429 dnl Check for headers
1460 netinet/ip_fil_compat.h \
1507 AC_CHECK_HEADERS(linux/netfilter_ipv4.h,,,
1508 SQUID_DEFAULT_INCLUDES
1514 AC_CHECK_HEADERS(net/if.h \
1516 netinet/ip_compat.h\
1520 resolv.h,,,SQUID_BSDNET_INCLUDES)
1525 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1526 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1528 ac_cv_have_ansi_prototypes="yes",
1529 ac_cv_have_ansi_prototypes="no")
1531 if test $ac_cv_have_ansi_prototypes = "yes" ; then
1532 AC_DEFINE(HAVE_ANSI_PROTOTYPES,1,[Define if your compiler supports prototyping])
1536 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
1539 #include <sys/time.h>
1546 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
1547 #if HAVE_SYS_TYPES_H
1548 #include <sys/types.h>
1554 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
1555 #if HAVE_SYS_TYPES_H
1556 #include <sys/types.h>
1562 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
1564 #include <sys/time.h>
1566 #if HAVE_SYS_RESOURCE_H
1567 #include <sys/resource.h>
1570 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
1571 #if HAVE_SYS_TYPES_H
1572 #include <sys/types.h>
1574 #include <netinet/in.h>
1575 #include <netinet/in_systm.h>
1576 #include <netinet/ip.h>
1577 #if defined (__linux__) || defined (__CYGWIN__)
1586 dnl Check for typedefs
1587 AC_CHECK_SIZEOF(void *)
1589 dnl 16 bit integers - int16_t and u_int16_t
1590 dnl if this is defined we trust it to be 16 bits
1591 AC_CHECK_TYPE(int16_t,
1592 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers]),
1593 ,SQUID_DEFAULT_INCLUDES)
1596 AC_CHECK_TYPE(short,[
1597 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1598 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
1599 ],,SQUID_DEFAULT_INCLUDES)
1603 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1604 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
1605 ],,SQUID_DEFAULT_INCLUDES)
1607 dnl unsigned 16 bit ints - u_int16_t
1608 dnl if this is defined we trust it to be 16 bits
1609 AC_CHECK_TYPE(u_int16_t,
1610 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers]),
1611 ,SQUID_DEFAULT_INCLUDES)
1614 dnl if this is defined we trust it to be 16 bits
1615 AC_CHECK_TYPE(uint16_t,
1616 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers]),
1617 ,SQUID_DEFAULT_INCLUDES)
1619 dnl 32 bit signed int - int32_t
1620 dnl if this is defined we trust it to be 32 bits
1621 AC_CHECK_TYPE(int32_t,
1622 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers]),
1623 ,SQUID_DEFAULT_INCLUDES)
1626 AC_CHECK_TYPE(long,[
1627 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1628 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
1629 ],,SQUID_DEFAULT_INCLUDES)
1631 dnl 32 bit unsigned int - u_int32_t
1632 dnl if this is defined we trust it to be 32 bits
1633 AC_CHECK_TYPE(u_int32_t,
1634 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers]),
1635 ,SQUID_DEFAULT_INCLUDES)
1638 dnl if this is defined we trust it to be 32 bits
1639 AC_CHECK_TYPE(uint32_t,
1640 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers]),
1641 ,SQUID_DEFAULT_INCLUDES)
1643 dnl 64 bit signed - int64_t
1644 dnl if this is defind we trust it to be 64 bits
1645 AC_CHECK_TYPE(int64_t,
1646 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers]),
1647 ,SQUID_DEFAULT_INCLUDES)
1650 dnl if this is defind we trust it to be 64 bits
1651 AC_CHECK_TYPE(__int64,
1652 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers]),
1653 ,SQUID_DEFAULT_INCLUDES)
1656 AC_CHECK_TYPE(long long,[
1657 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1658 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
1659 ],,SQUID_DEFAULT_INCLUDES)
1661 dnl 64 bit unsigned - u_int64_t
1662 dnl if this is defind we trust it to be 64 bits
1663 AC_CHECK_TYPE(u_int64_t,
1664 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers]),
1665 ,SQUID_DEFAULT_INCLUDES)
1668 dnl if this is defind we trust it to be 64 bits
1669 AC_CHECK_TYPE(uint64_t,
1670 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers]),
1671 ,SQUID_DEFAULT_INCLUDES)
1673 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1674 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1675 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1676 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1677 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1678 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1679 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1680 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1682 dnl Check for special functions
1685 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
1686 #include <sys/types.h>
1687 #include <sys/socket.h>
1693 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
1694 #include <sys/ipc.h>
1695 #include <sys/msg.h>])
1697 dnl Check for needed libraries
1698 AC_CHECK_LIB(nsl, main)
1699 AC_CHECK_LIB(socket, main)
1701 dnl Ripped from the Samba sources
1702 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
1704 #include <sys/types.h>
1707 #include <sys/socket.h>
1708 #include <sys/un.h>],
1710 struct sockaddr_un sunaddr;
1711 sunaddr.sun_family = AF_UNIX;
1713 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
1714 if test x"$squid_cv_unixsocket" = x"yes"; then
1715 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
1719 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
1720 echo "skipping libmalloc check (--enable-dlmalloc specified)"
1722 AC_CHECK_LIB(gnumalloc, main)
1723 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
1724 echo "Disabling extended malloc functions when using gnumalloc"
1725 ac_cv_func_mallinfo=no
1726 ac_cv_func_mallocblksize=no
1727 ac_cv_func_mallopt=no
1731 echo "skipping libmalloc check for $host"
1734 echo "skipping libmalloc check for $host"
1738 AC_CHECK_LIB(malloc, main)
1744 AC_CHECK_LIB(bsd, main)
1745 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
1746 AC_CHECK_LIB(bind, gethostbyname)
1747 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
1750 echo "skipping libresolv checks for $host"
1753 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
1754 AC_CHECK_LIB(resolv, main)
1758 AC_CHECK_LIB(m, main)
1760 dnl Check for libcrypt
1761 dnl Some of our helpers use crypt(3) which may be in libc, or in
1762 dnl libcrypt (eg FreeBSD)
1763 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1766 dnl Check for libdl, used by auth_modules/PAM
1767 if test "$with_dl" = "yes"; then
1768 AC_CHECK_LIB(dl, dlopen)
1771 dnl Check for pthreads
1772 dnl We use pthreads when doing ASYNC I/O
1773 if test "$with_pthreads" = "yes"; then
1774 CFLAGS="$CFLAGS -D_REENTRANT"
1775 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
1777 i386-unknown-freebsd*)
1778 if test "$GCC" = "yes" ; then
1779 if test -z "$PRESET_LDFLAGS"; then
1780 LDFLAGS="$LDFLAGS -pthread"
1785 if test "$GCC" = "yes" ; then
1786 CFLAGS="$CFLAGS -pthreads"
1787 CXXFLAGS="$CXXFLAGS -pthreads"
1789 CFLAGS="$CFLAGS -mt"
1790 CXXFLAGS="$CXXFLAGS -mt"
1794 AC_CHECK_LIB(pthread, main)
1798 dnl We use AIO in the coss store
1799 if test "$with_aio" = "yes"; then
1800 AC_CHECK_LIB(rt, aio_read)
1803 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
1804 dnl Robert Side <rside@aiinc.bc.ca>
1805 dnl Mon, 18 Jan 1999 17:48:00 GMT
1808 AC_CHECK_LIB(intl, strftime)
1812 dnl System-specific library modifications
1816 if test "$GCC" = "yes"; then
1817 echo "Removing -O for gcc on $host"
1818 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1822 echo "Removing -lsocket for IRIX..."
1823 LIBS=`echo $LIBS | sed -e s/-lsocket//`
1824 echo "Removing -lnsl for IRIX..."
1825 LIBS=`echo $LIBS | sed -e s/-lnsl//`
1826 ac_cv_lib_nsl_main=no
1827 echo "Removing -lbsd for IRIX..."
1828 LIBS=`echo $LIBS | sed -e s/-lbsd//`
1830 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
1831 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
1832 dnl Please change your configure script. AIX doesn't need -lbsd.
1834 echo "Removing -lbsd for AIX..."
1835 LIBS=`echo $LIBS | sed -e s/-lbsd//`
1837 dnl From: mlaster@metavillage.com (Mike Laster)
1838 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
1839 dnl So using the internal versions generates a load of warnings
1842 echo "disabling snprintf/vsnprintf for $host"
1843 ac_cv_func_snprintf=no
1844 ac_cv_func_vsnprintf=no
1849 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
1850 CXXFLAGS="$CXXFLAGS -D_SQUID_MOTOROLA_"
1851 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
1853 [*-*-solaris2.[0-4]])
1854 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
1856 [*-sony-newsos[56]*])
1857 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
1861 # Remove optimization for GCC 2.95.[123]
1862 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
1863 if test "$GCC" = "yes"; then
1864 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
1867 echo "Removing -O for gcc on $host with GCC $GCCVER"
1868 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1873 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
1876 if test `uname -v` = "2.03"; then
1877 echo "disabling mallinfo for $host"
1878 ac_cv_func_mallinfo=no
1883 dnl This has to be before AC_CHECK_FUNCS
1884 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
1885 # when running configure.
1886 if test -z "$ac_cv_func_poll"; then
1889 # John Kay (jkay@nlanr.net) 19970818
1890 echo "disabling poll for $host..."
1891 ac_cv_func_poll='no'
1895 echo "disabling poll for $host..."
1896 ac_cv_func_poll='no'
1899 # Henrik Nordstrom (hno@squid-cache.org) 19980817
1900 # poll is problematic on Linux. We disable it
1901 # by default until Linux gets it right.
1902 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
1903 if test $rev -lt 002002; then
1904 echo "disabling poll for $host < 2.2..."
1905 ac_cv_func_poll='no'
1908 [powerpc-ibm-aix4.1.*])
1909 # Mike Laster (mlaster@metavillage.com) 19981021
1910 echo "disabling poll for $host..."
1911 ac_cv_func_poll='no'
1914 # Robert Side <rside@aiinc.bc.ca>
1915 # Mon, 18 Jan 1999 17:48:00 GMT
1916 echo "disabling poll for $host..."
1917 ac_cv_func_poll='no'
1922 dnl Check for library functions
1924 backtrace_symbols_fd \
1947 pthread_attr_setschedparam \
1948 pthread_attr_setscope \
1949 pthread_setschedparam \
1977 dnl Magic which checks whether we are forcing a type of comm loop we
1978 dnl are actually going to (ab)use
1980 dnl Actually do the define magic now
1981 dnl mostly ripped from squid-commloops, thanks to adrian and benno
1983 if test "$ac_cv_func_poll" = "yes" ; then
1985 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
1986 elif test "$ac_cv_func_select" = "yes" ; then
1987 SELECT_TYPE="select"
1988 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
1989 elif test "$ac_cv_func_kqueue" = "yes" ; then
1990 SELECT_TYPE="kqueue"
1991 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
1992 elif test "$ac_cv_func_epoll" = "yes" ; then
1994 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
1996 echo "Eep! Can't find poll, kqueue, epoll, or select!"
1997 echo "I'll try select and hope for the best."
1998 SELECT_TYPE="select"
1999 AC_DEFINE(USE_SELECT,1)
2001 echo "Using ${SELECT_TYPE} for select loop."
2004 dnl Yay! Another Linux brokenness. Its not good enough
2005 dnl to know that setresuid() exists, because RedHat 5.0 declares
2006 dnl setresuid() but doesn't implement it.
2008 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2012 if(setresuid(-1,-1,-1)) {
2013 perror("setresuid:");
2018 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2020 if test "$ac_cv_func_setresuid" = "yes" ; then
2021 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.])
2024 AM_CONDITIONAL(NEED_OWN_SNPRINTF, false)
2025 if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then
2026 AM_CONDITIONAL(NEED_OWN_SNPRINTF, true)
2029 dnl IP-Filter support requires ipf header files. These aren't
2030 dnl installed by default, so we need to check for them
2031 if test "$IPF_TRANSPARENT" ; then
2032 AC_MSG_CHECKING(if IP-Filter header files are installed)
2033 # hold on to your hats...
2034 if test "$ac_cv_header_ip_compat_h" = "yes" ||
2035 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
2036 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
2037 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
2038 have_ipfilter_compat_header="yes"
2040 if test "x$have_ipfilter_compat_header" = "xyes" &&
2041 test "$ac_cv_header_ip_fil_h" = "yes" &&
2042 test "$ac_cv_header_ip_nat_h" = "yes" ; then
2043 IPF_TRANSPARENT="yes"
2044 AC_DEFINE(IPF_TRANSPARENT, 1)
2045 elif test "$have_ipfilter_compat_header" = "yes" &&
2046 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
2047 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
2048 IPF_TRANSPARENT="yes"
2049 AC_DEFINE(IPF_TRANSPARENT, 1)
2051 IPF_TRANSPARENT="no"
2052 AC_DEFINE(IPF_TRANSPARENT, 0)
2054 AC_MSG_RESULT($IPF_TRANSPARENT)
2056 if test "$IPF_TRANSPARENT" = "no" ; then
2057 echo "WARNING: Cannot find necessary IP-Filter header files"
2058 echo " Transparent Proxy support WILL NOT be enabled"
2062 dnl PF support requires a header file.
2063 if test "$PF_TRANSPARENT" ; then
2064 AC_MSG_CHECKING(if PF header file is installed)
2065 # hold on to your hats...
2066 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
2067 PF_TRANSPARENT="yes"
2068 AC_DEFINE(PF_TRANSPARENT, 1)
2071 AC_DEFINE(PF_TRANSPARENT, 0)
2073 AC_MSG_RESULT($PF_TRANSPARENT)
2075 if test "$PF_TRANSPARENT" = "no" ; then
2076 echo "WARNING: Cannot find necessary PF header file"
2077 echo " Transparent Proxy support WILL NOT be enabled"
2081 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
2082 dnl Shamelessly copied from above
2083 if test "$LINUX_NETFILTER" ; then
2084 AC_MSG_CHECKING(if Linux 2.4 kernel header files are installed)
2085 # hold on to your hats...
2086 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
2087 LINUX_NETFILTER="yes"
2088 AC_DEFINE(LINUX_NETFILTER, 1)
2090 LINUX_NETFILTER="no"
2091 AC_DEFINE(LINUX_NETFILTER, 0)
2093 AC_MSG_RESULT($LINUX_NETFILTER)
2095 if test "$LINUX_NETFILTER" = "no" ; then
2096 echo "WARNING: Cannot find necessary Linux 2.4 kernel header files"
2097 echo " Linux 2.4 Transparent Proxy support WILL NOT be enabled"
2101 if test -z "$USE_GNUREGEX" ; then
2103 *-sun-solaris2.[[0-4]])
2111 AC_MSG_CHECKING(if GNUregex needs to be compiled)
2112 if test -z "$USE_GNUREGEX"; then
2113 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
2116 AC_TRY_COMPILE([#include <sys/types.h>
2117 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
2122 AC_MSG_RESULT($USE_GNUREGEX)
2123 if test "$USE_GNUREGEX" = "yes"; then
2125 LIBREGEX="libregex.a"
2126 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
2137 dnl Not cached since people are likely to tune this
2138 AC_MSG_CHECKING(Default FD_SETSIZE value)
2147 #include <sys/time.h>
2149 #if HAVE_SYS_SELECT_H
2150 #include <sys/select.h>
2152 #if HAVE_SYS_TYPES_H
2153 #include <sys/types.h>
2156 FILE *fp = fopen("conftestval", "w");
2157 fprintf (fp, "%d\n", FD_SETSIZE);
2161 DEFAULT_FD_SETSIZE=`cat conftestval`,
2162 DEFAULT_FD_SETSIZE=256,
2163 DEFAULT_FD_SETSIZE=256)
2164 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
2165 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
2168 dnl Not cached since people are likely to tune this
2169 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
2170 dnl damn! FreeBSD's pthreads breaks dup2().
2171 if test -n "$squid_filedescriptors_num" ; then
2172 SQUID_MAXFD=$squid_filedescriptors_num
2173 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
2177 i386-unknown-freebsd*)
2178 if echo "$LDFLAGS" | grep -q pthread; then
2179 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
2185 #include <sys/time.h> /* needed on FreeBSD */
2186 #include <sys/param.h>
2187 #include <sys/resource.h>
2191 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
2192 /* getrlimit and sysconf returns bogous values on cygwin32.
2193 * Number of fds is virtually unlimited in cygwin (sys/param.h)
2194 * __CYGWIN32__ is deprecated.
2200 #if defined(RLIMIT_NOFILE)
2201 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
2202 perror("getrlimit: RLIMIT_NOFILE");
2204 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2205 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
2206 perror("setrlimit: RLIMIT_NOFILE");
2209 #elif defined(RLIMIT_OFILE)
2210 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
2211 perror("getrlimit: RLIMIT_OFILE");
2213 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2214 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
2215 perror("setrlimit: RLIMIT_OFILE");
2218 #endif /* RLIMIT_NOFILE */
2219 #endif /* HAVE_SETRLIMIT */
2220 /* by starting at 2^14, we will never get higher
2221 than 2^15 for SQUID_MAXFD */
2225 if (dup2(0, i) < 0) {
2233 #endif /* IF !DEF CYGWIN */
2234 fp = fopen("conftestval", "w");
2235 fprintf (fp, "%d\n", i);
2239 SQUID_MAXFD=`cat conftestval`,
2242 AC_MSG_RESULT($SQUID_MAXFD)
2244 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
2245 if test "$SQUID_MAXFD" -lt 512 ; then
2246 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
2247 echo " cache will be very busy. Please see the FAQ page"
2248 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
2249 echo " on how to increase your filedescriptor limit"
2254 dnl Not cached since people are likely to tune this
2255 AC_MSG_CHECKING(Default UDP send buffer size)
2259 #include <sys/types.h>
2260 #include <sys/socket.h>
2261 #include <netinet/in.h>
2265 int fd,val=0,len=sizeof(int);
2266 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2267 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2268 if (val<=0) exit(1);
2269 fp = fopen("conftestval", "w");
2270 fprintf (fp, "%d\n", val);
2274 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
2275 SQUID_DETECT_UDP_SO_SNDBUF=16384,
2276 SQUID_DETECT_UDP_SO_SNDBUF=16384)
2277 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
2278 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
2280 dnl Not cached since people are likely to tune this
2281 AC_MSG_CHECKING(Default UDP receive buffer size)
2285 #include <sys/types.h>
2286 #include <sys/socket.h>
2287 #include <netinet/in.h>
2291 int fd,val=0,len=sizeof(int);
2292 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2293 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2294 if (val <= 0) exit(1);
2295 fp = fopen("conftestval", "w");
2296 fprintf (fp, "%d\n", val);
2300 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
2301 SQUID_DETECT_UDP_SO_RCVBUF=16384,
2302 SQUID_DETECT_UDP_SO_RCVBUF=16384)
2303 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
2304 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
2306 dnl Not cached since people are likely to tune this
2307 AC_MSG_CHECKING(Default TCP send buffer size)
2311 #include <sys/types.h>
2312 #include <sys/socket.h>
2313 #include <netinet/in.h>
2317 int fd,val=0,len=sizeof(int);
2318 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2319 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2320 if (val <= 0) exit(1);
2321 fp = fopen("conftestval", "w");
2322 fprintf (fp, "%d\n", val);
2326 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
2327 SQUID_TCP_SO_SNDBUF=16384,
2328 SQUID_TCP_SO_SNDBUF=16384)
2329 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2330 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
2332 dnl Not cached since people are likely to tune this
2333 AC_MSG_CHECKING(Default TCP receive buffer size)
2337 #include <sys/types.h>
2338 #include <sys/socket.h>
2339 #include <netinet/in.h>
2343 int fd,val=0,len=sizeof(int);
2344 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2345 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2346 if (val <= 0) exit(1);
2347 fp = fopen("conftestval", "w");
2348 fprintf (fp, "%d\n", val);
2352 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
2353 SQUID_TCP_SO_RCVBUF=16384,
2354 SQUID_TCP_SO_RCVBUF=16384)
2355 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2356 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
2358 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
2359 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
2360 ac_cv_needs_sys_errlist="no",
2361 ac_cv_needs_sys_errlist="yes")
2363 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
2364 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
2367 dnl Not cached since people are likely to change this
2368 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
2369 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
2371 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
2374 AC_MSG_CHECKING(if inet_ntoa() actually works)
2378 #include <sys/types.h>
2379 #include <netinet/in.h>
2380 #include <arpa/inet.h>
2385 in.s_addr = inet_addr("1.2.3.4");
2386 fp = fopen("conftestval", "w");
2387 fprintf (fp, "%s\n", inet_ntoa(in));
2391 INET_NTOA_RESULT=`cat conftestval`,
2392 INET_NTOA_RESULT="broken",
2393 INET_NTOA_RESULT="broken")
2394 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
2395 AC_MSG_RESULT("yes")
2398 echo "Will use our own inet_ntoa()."
2399 AC_LIBOBJ(inet_ntoa)
2400 # echo "WARNING: This looks bad, and probably prevents Squid from working."
2401 # echo " If you're on IRIX and using GCC 2.8, you probably need"
2402 # echo " to use the IRIX C compiler instead."
2406 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
2407 AC_MSG_CHECKING(for working statvfs() interface)
2411 #include <sys/types.h>
2412 #include <sys/statvfs.h>
2416 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
2417 sfs.f_files = sfs.f_ffree = 0;
2418 statvfs("/tmp", &sfs);
2420 ac_cv_func_statvfs=yes,
2421 ac_cv_func_statvfs=no)
2422 AC_MSG_RESULT($ac_cv_func_statvfs)
2423 if test "$ac_cv_func_statvfs" = "yes" ; then
2424 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
2428 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
2430 #if HAVE_SYS_TYPES_H
2431 #include <sys/types.h>
2433 #if HAVE_NETINET_IN_H
2434 #include <netinet/in.h>
2436 #if HAVE_ARPA_INET_H
2437 #include <arpa/inet.h>
2439 #if HAVE_ARPA_NAMESER_H
2440 #include <arpa/nameser.h>
2446 [_res.nsaddr_list[[0]];],
2447 ac_cv_have_res_nsaddr_list="yes",
2448 ac_cv_have_res_nsaddr_list="no"))
2449 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
2450 AC_DEFINE(HAVE_RES_NSADDR_LIST,1,[If _res structure has nsaddr_list member])
2453 if test $ac_cv_have_res_nsaddr_list = "no" ; then
2454 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
2456 #if HAVE_SYS_TYPES_H
2457 #include <sys/types.h>
2459 #if HAVE_NETINET_IN_H
2460 #include <netinet/in.h>
2462 #if HAVE_ARPA_INET_H
2463 #include <arpa/inet.h>
2465 #if HAVE_ARPA_NAMESER_H
2466 #include <arpa/nameser.h>
2472 [_res.ns_list[[0]].addr;],
2473 ac_cv_have_res_ns_list="yes",
2474 ac_cv_have_res_ns_list="no"))
2475 if test $ac_cv_have_res_ns_list = "yes" ; then
2476 AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
2480 dnl Need the debugging version of malloc if available
2482 if test "$ac_cv_lib_malloc_main" = "yes" ; then
2483 if test -r /usr/lib/debug/malloc.o ; then
2484 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
2486 if test -r /usr/lib/debug/mallocmap.o ; then
2487 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
2493 if test -z "$XTRA_LIBS"; then
2496 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
2501 dnl Clean up after OSF/1 core dump bug
2518 test-suite/Makefile \
2521 helpers/basic_auth/Makefile \
2522 helpers/basic_auth/LDAP/Makefile \
2523 helpers/basic_auth/MSNT/Makefile \
2524 helpers/basic_auth/NCSA/Makefile \
2525 helpers/basic_auth/PAM/Makefile \
2526 helpers/basic_auth/SMB/Makefile \
2527 helpers/basic_auth/YP/Makefile \
2528 helpers/basic_auth/getpwnam/Makefile \
2529 helpers/basic_auth/multi-domain-NTLM/Makefile \
2530 helpers/basic_auth/SASL/Makefile \
2531 helpers/basic_auth/winbind/Makefile \
2532 helpers/digest_auth/Makefile \
2533 helpers/digest_auth/password/Makefile \
2534 helpers/ntlm_auth/Makefile \
2535 helpers/ntlm_auth/fakeauth/Makefile \
2536 helpers/ntlm_auth/no_check/Makefile \
2537 helpers/ntlm_auth/SMB/Makefile \
2538 helpers/ntlm_auth/SMB/smbval/Makefile \
2539 helpers/ntlm_auth/winbind/Makefile \
2540 helpers/external_acl/Makefile \
2541 helpers/external_acl/ip_user/Makefile \
2542 helpers/external_acl/ldap_group/Makefile \
2543 helpers/external_acl/unix_group/Makefile \
2544 helpers/external_acl/wbinfo_group/Makefile \
2545 helpers/external_acl/winbind_group/Makefile
2548 AC_CONFIG_SUBDIRS(lib/libTrie)