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.227 2001/08/03 15:12:58 adrian Exp $
11 AC_CONFIG_HEADER(include/autoconf.h)
12 AC_REVISION($Revision: 1.227 $)dnl
13 AC_PREFIX_DEFAULT(/usr/local/squid)
14 AC_CONFIG_AUX_DIR(cfgaux)
20 LIBREGEX='' # libregex.a
22 dnl use directory structure of cached as default (hack)
23 if test "$libexecdir" = '${exec_prefix}/libexec' &&
24 test "$localstatedir" = '${prefix}/var'; then
25 libexecdir='${prefix}/libexec/squid'
26 localstatedir='${prefix}'
29 dnl use .exe suffix for executables on cygwin32 platform
30 dnl this should be expanded to a list of platform sensible support requirements.
31 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
48 if test -z "$CACHE_HTTP_PORT"; then
49 CACHE_HTTP_PORT="3128"
51 if test -z "$CACHE_ICP_PORT"; then
56 AC_SUBST(CACHE_HTTP_PORT)
57 AC_SUBST(CACHE_ICP_PORT)
59 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host")
61 dnl Set default LDFLAGS
62 if test -z "$LDFLAGS"; then
66 PRESET_CFLAGS="$CFLAGS"
71 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
74 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
78 dnl Set Default CFLAGS
79 if test -z "$PRESET_CFLAGS"; then
80 if test "$GCC" = "yes"; then
83 # sunos has too many warnings for this to be useful
87 # Motorola cc/ld does not like -02 but is ok on -O
88 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
91 CFLAGS="$CFLAGS -Wall"
97 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
98 CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \
99 -woff 1009,1014,1048,1110,1116,1185,1188,1204,1230,1233 \
100 -Wl,-woff,85,-woff,84,-woff,134 \
101 -nostdinc -I/usr/include -D_BSD_SIGNALS"
104 # Mogul says DEC compilers take both -g and -O2
105 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
115 if test -z "$PRESET_LDFLAGS"; then
116 if test "$GCC" = "yes"; then
125 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
126 LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32"
132 dnl Enable optional modules
133 AC_ARG_ENABLE(dlmalloc,
134 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
139 LIBDLMALLOC="libdlmalloc.a"
140 LIB_MALLOC="-L../lib -ldlmalloc"
141 echo "dlmalloc enabled"
145 echo "dlmalloc disabled"
147 *) use_dlmalloc="yes"
148 LIB_MALLOC="$enableval"
149 echo "dlmalloc enabled with $LIB_MALLOC"
152 if test "${use_dlmalloc-unset}" = unset; then
155 echo "Enabling dlmalloc for $host"
157 LIBDLMALLOC="libdlmalloc.a"
158 LIB_MALLOC="-L../lib -ldlmalloc"
162 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
163 # Ok. dlmalloc was enabled before, but state may be changed.
164 # we have to test these again
165 unset ac_cv_func_mallinfo
166 unset ac_cv_func_mallocblksize
167 unset ac_cv_func_free
168 unset ac_cv_func_realloc
169 unset ac_cv_func_memalign
170 unset ac_cv_func_valloc
171 unset ac_cv_func_pvalloc
172 unset ac_cv_func_calloc
173 unset ac_cv_func_cfree
174 unset ac_cv_func_malloc_trim
175 unset ac_cv_func_malloc_usable_size
176 unset ac_cv_func_malloc_stats
177 unset ac_cv_func_mallinfo
178 unset ac_cv_func_mallopt
179 unset ac_cv_lib_gnumalloc
180 unset ac_cv_header_gnumalloc_h
181 unset ac_cv_lib_malloc
182 unset ac_cv_enabled_dlmalloc
184 if test "$use_dlmalloc" = yes; then
185 ac_cv_func_mallinfo="yes"
186 ac_cv_func_mallocblksize="no"
187 ac_cv_func_free="yes"
188 ac_cv_func_realloc="yes"
189 ac_cv_func_memalign="yes"
190 ac_cv_func_valloc="yes"
191 ac_cv_func_pvalloc="yes"
192 ac_cv_func_calloc="yes"
193 ac_cv_func_cfree="yes"
194 ac_cv_func_malloc_trim="yes"
195 ac_cv_func_malloc_usable_size="yes"
196 ac_cv_func_malloc_stats="yes"
197 ac_cv_func_mallopt="yes"
198 ac_cv_lib_gnumalloc="no"
199 ac_cv_header_gnumalloc_h="no"
200 ac_cv_lib_malloc="no"
201 ac_cv_enabled_dlmalloc="yes"
204 AC_SUBST(LIBDLMALLOC)
207 AC_ARG_ENABLE(gnuregex,
208 [ --enable-gnuregex Compile GNUregex],
209 [USE_GNUREGEX=$enableval])
211 AC_ARG_ENABLE(xmalloc-debug,
212 [ --enable-xmalloc-debug Do some simple malloc debugging],
213 [ if test "$enableval" = "yes" ; then
214 echo "Malloc debugging enabled"
215 AC_DEFINE(XMALLOC_DEBUG)
219 AC_ARG_ENABLE(xmalloc-debug-trace,
220 [ --enable-xmalloc-debug-trace
221 Detailed trace of memory allocations],
222 [ if test "$enableval" = "yes" ; then
223 echo "Malloc debug trace enabled"
224 AC_DEFINE(XMALLOC_TRACE)
225 AC_DEFINE(XMALLOC_DEBUG)
229 AC_ARG_ENABLE(xmalloc-statistics,
230 [ --enable-xmalloc-statistics
231 Show malloc statistics in status page],
232 [ if test "$enableval" = "yes" ; then
233 echo "Malloc statistics enabled"
234 AC_DEFINE(XMALLOC_STATISTICS)
239 [ --enable-carp Enable CARP support],
240 [ if test "$enableval" = "yes" ; then
241 echo "CARP support enabled"
246 AC_ARG_ENABLE(async-io,
247 [ --enable-async-io[=N_THREADS]
249 --with-aio-threads=N_THREADS
251 --enable-storeio=ufs,aufs],
255 STORE_MODULES="ufs aufs"
260 async_io_threads=$enableval
262 STORE_MODULES="ufs aufs"
267 AC_ARG_WITH(aio-threads,
268 [ --with-aio-threads=N_THREADS
269 Tune the number of worker threads for the aufs object
271 [ async_io_threads=$withval ])
272 if test "$async_io_threads"; then
273 echo "With $async_io_threads AIO threads"
275 AC_DEFINE_UNQUOTED(ASYNC_IO_THREADS,$async_io_threads)
278 AC_ARG_WITH(pthreads,
279 [ --with-pthreads Use POSIX Threads],
280 [ if test "$enableval" = "yes"; then
284 if test "$with_pthreads"; then
286 SQUID_PTHREAD_LIB='$(PTHREADLIB)'
287 CFLAGS="$CFLAGS -D_REENTRANT"
289 i386-unknown-freebsd*)
290 if test "$GCC" = "yes" ; then
291 if test -z "$PRESET_LDFLAGS"; then
292 LDFLAGS="$LDFLAGS -pthread"
298 AC_SUBST(SQUID_PTHREAD_LIB)
300 AC_ARG_ENABLE(storeio,
301 [ --enable-storeio=\"list of modules\"
302 Build support for the list of store I/O modules.
303 The default is only to build the "ufs" module.
304 See src/fs for a list of available modules, or
305 Programmers Guide section <not yet written>
306 for details on how to build your custom store module],
309 for module in $srcdir/src/fs/*; do
310 if test -f $module/Makefile.in; then
311 STORE_MODULES="$STORE_MODULES `basename $module`"
317 *) STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
321 [ if test -z "$STORE_MODULES"; then
325 echo "Store modules built: $STORE_MODULES"
326 AC_SUBST(STORE_MODULES)
327 STORE_OBJS="fs/`echo $STORE_MODULES|sed -e 's% %.a fs/%g'`.a"
329 STORE_LIBS="`echo $STORE_OBJS|sed -e 's%fs/%%g'`"
332 dnl --enable-heap-replacement compability option
333 AC_ARG_ENABLE(heap-replacement,
334 [ --enable-heap-replacement
335 Backwards compability option. Please use the
336 new --enable-removal-policies directive instead.],
337 [ if test "$enableval" = "yes" ; then
338 echo "--enable-heap-replacement is obsolete. please use the new"
339 echo "--enable-removal-policies directive instead"
345 AC_ARG_ENABLE(removal-policies,
346 [ --enable-removal-policies=\"list of policies\"
347 Build support for the list of removal policies.
348 The default is only to build the "lru" module.
349 See src/repl for a list of available modules, or
350 Programmers Guide section 9.9 for details on how
351 to build your custom policy],
354 for module in $srcdir/src/repl/*; do
355 if test -f $module/Makefile.in; then
356 REPL_POLICIES="$REPL_POLICIES `basename $module`"
362 *) REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
366 [ if test -z "$REPL_POLICIES"; then
370 echo "Removal policies built: $REPL_POLICIES"
371 AC_SUBST(REPL_POLICIES)
372 REPL_OBJS="repl/`echo $REPL_POLICIES|sed -e 's% %.a repl/%g'`.a"
374 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
379 [ --enable-icmp Enable ICMP pinging],
380 [ if test "$enableval" = "yes" ; then
383 OPT_PINGER_EXE='$(OPT_PINGER_EXE)'
386 AC_SUBST(OPT_PINGER_EXE)
388 AC_ARG_ENABLE(delay-pools,
389 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
390 [ if test "$enableval" = "yes" ; then
391 echo "Delay pools enabled"
392 DELAY_OBJS='$(DELAY_OBJS)'
393 AC_DEFINE(DELAY_POOLS)
398 AC_ARG_ENABLE(mem-gen-trace,
399 [ --enable-mem-gen-trace Do trace of memory stuff],
400 [ if test "$enableval" = "yes" ; then
401 echo "Memory trace (to file) enabled"
402 AC_DEFINE(MEM_GEN_TRACE)
406 AC_ARG_ENABLE(useragent-log,
407 [ --enable-useragent-log Enable logging of User-Agent header],
408 [ if test "$enableval" = "yes" ; then
409 echo "User-Agent logging enabled"
410 AC_DEFINE(USE_USERAGENT_LOG)
414 AC_ARG_ENABLE(referer-log,
415 [ --enable-referer-log Enable logging of Referer header],
416 [ if test "$enableval" = "yes" ; then
417 echo "Referer logging enabled"
418 AC_DEFINE(USE_REFERER_LOG)
423 [ --disable-wccp Disable Web Cache Coordination Protocol],
424 [ if test "$enableval" = "no" ; then
425 echo "Web Cache Coordination Protocol disabled"
426 AC_DEFINE(USE_WCCP, 0)
428 AC_DEFINE(USE_WCCP, 1)
432 AC_ARG_ENABLE(kill-parent-hack,
433 [ --enable-kill-parent-hack
434 Kill parent on shutdown],
435 [ if test "$enableval" = "yes" ; then
436 echo "Kill parent on shutdown"
437 AC_DEFINE(KILL_PARENT_OPT)
442 [ --enable-snmp Enable SNMP monitoring],
443 [ if test "$enableval" = "yes" ; then
444 echo "SNMP monitoring enabled"
445 AC_DEFINE(SQUID_SNMP)
446 SNMPLIB='-L../snmplib -lsnmp'
447 SNMP_OBJS='$(SNMP_OBJS)'
448 SNMP_MAKEFILE=./snmplib/Makefile
454 AC_SUBST(makesnmplib)
456 AC_ARG_ENABLE(time-hack,
457 [ --enable-time-hack Update internal timestamp only once per second],
458 [ if test "$enableval" = "yes" ; then
459 echo "Update internal timestamp only once per second"
460 AC_DEFINE(ALARM_UPDATES_TIME)
464 AC_ARG_ENABLE(cachemgr-hostname,
465 [ --enable-cachemgr-hostname[=hostname]
466 Make cachemgr.cgi default to this host],
469 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()])
470 echo "Cachemgr default hostname == host where cachemgr runs"
476 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
477 echo "Cachemgr default hostname set to ${enableval}"
482 AC_ARG_ENABLE(arp-acl,
483 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
484 [ if test "$enableval" = "yes" ; then
485 echo "ARP ACL lists enabled (ether address)"
490 echo "WARNING: ARP ACL support is only currently supported on Linux"
491 echo " ethernet interfaces, probably won't work on $host."
495 AC_DEFINE(USE_ARP_ACL)
500 [ --enable-htcp Enable HTCP protocol],
501 [ if test "$enableval" = "yes" ; then
503 HTCP_OBJS='$(HTCP_OBJS)'
510 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
511 [ if test "$enableval" != "no"; then
512 echo "SSL gatewaying enabled"
514 SSL_OBJS='$(SSL_OBJS)'
515 SSLLIB='-lssl -lcrypto'
521 [ --with-openssl[=prefix]
522 Compile with the OpenSSL libraries. The path to
523 the OpenSSL development libraries and headers
524 installation can be specified if outside of the
525 system standard directories],
535 SSLLIBDIR="$with_ssl/lib"
536 SSLINC="-I$with_ssl/include"
541 if test -n "$USE_OPENSSL"; then
542 AC_DEFINE(USE_OPENSSL)
543 if test -z "$SSLLIB"; then
544 SSLLIB="-lcrypto" # for MD5 routines
547 if test -n "$SSLLIBDIR"; then
548 SSLLIB="-L$SSLLIBDIR $SSLLIB"
550 if test -n "$SSLINC"; then
551 CFLAGS="$CFLAGS $SSLINC"
556 AC_ARG_ENABLE(forw-via-db,
557 [ --enable-forw-via-db Enable Forw/Via database],
558 [ if test "$enableval" = "yes" ; then
559 echo "FORW-VIA enabled"
560 AC_DEFINE(FORW_VIA_DB)
564 AC_ARG_ENABLE(cache-digests,
565 [ --enable-cache-digests Use Cache Digests
566 see http://www.squid-cache.org/FAQ/FAQ-16.html],
567 [ if test "$enableval" = "yes" ; then
568 echo "USE_CACHE_DIGESTS enabled"
569 AC_DEFINE(USE_CACHE_DIGESTS)
573 dnl Select Error language
574 AC_ARG_ENABLE(err-language,
575 [ --enable-err-language=lang
576 Select language for Error pages (see errors dir) ],
578 if test -d $srcdir/errors/$enableval; then
579 ERR_LANGUAGE=$enableval
581 echo "ERROR! Unknown language $enableval, see errors/"
584 ],[ERR_LANGUAGE="English"])
585 AC_SUBST(ERR_LANGUAGE)
587 dnl Size of COSS memory buffer
588 AC_ARG_WITH(coss-membuf-size,
589 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
590 [ if test "$with_coss_membuf_size"; then
591 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
592 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size)
598 [ --enable-poll Enable poll() instead of select(). Normally poll
599 is preferred over select, but configure knows poll
600 is broken on some platforms. If you think you are
601 smarter than the configure script, you may enable
602 poll with this option.
603 --disable-poll Disable the use of poll().],
607 echo "Forcing poll() to be enabled"
608 ac_cv_func_poll='yes'
611 echo "Forcing poll() to be disabled"
617 dnl Disable HTTP violations
618 AC_ARG_ENABLE(http-violations,
619 [ --disable-http-violations
620 This allows you to remove code which is known to
621 violate the HTTP protocol specification.],
622 [ if test "$enableval" = "no" ; then
623 echo "Disabling HTTP Violations"
624 AC_DEFINE(HTTP_VIOLATIONS, 0)
626 AC_DEFINE(HTTP_VIOLATIONS, 1)
630 dnl Enable IP-Filter Transparent Proxy
631 AC_ARG_ENABLE(ipf-transparent,
632 [ --enable-ipf-transparent
633 Enable Transparent Proxy support for systems
634 using IP-Filter network address redirection.],
635 [ if test "$enableval" = "yes" ; then
636 echo "IP-Filter Transparent Proxy enabled"
637 AC_DEFINE(IPF_TRANSPARENT)
638 IPF_TRANSPARENT="yes"
642 dnl Enable Linux Netfilter (2.4) Transparent Proxy
643 AC_ARG_ENABLE(linux-netfilter,
644 [ --enable-linux-netfilter
645 Enable Transparent Proxy support for Linux 2.4.],
646 [ if test "$enableval" = "yes" ; then
647 echo "Linux-Netfilter Transparent Proxy enabled"
648 AC_DEFINE(LINUX_NETFILTER)
649 LINUX_NETFILTER="yes"
653 dnl Enable Leak Finding Functions
654 AC_ARG_ENABLE(leakfinder,
655 [ --enable-leakfinder
656 Enable Leak Finding code. Enabling this alone
657 does nothing; you also have to modify the source
658 code to use the leak finding functions. Probably
659 Useful for hackers only.],
660 [ if test "$enableval" = "yes" ; then
661 echo "Leak-Finding enabled"
662 AC_DEFINE(USE_LEAKFINDER)
663 LEAKFINDER_OBJS='$(LEAKFINDER_OBJS)'
667 AC_SUBST(LEAKFINDER_OBJS)
669 AC_ARG_ENABLE(ident-lookups,
670 [ --disable-ident-lookups
671 This allows you to remove code that performs
672 Ident (RFC 931) lookups.],
673 [ if test "$enableval" = "no" ; then
674 echo "Disabling Ident Lookups"
675 AC_DEFINE(USE_IDENT, 0)
677 AC_DEFINE(USE_IDENT, 1)
682 AC_ARG_ENABLE(internal-dns,
683 [ --disable-internal-dns This prevents Squid from directly sending and
684 receiving DNS messages, and instead enables the
685 old external 'dnsserver' processes.],
686 [ if test "$enableval" = "no" ; then
687 echo "Disabling Internal DNS queries"
691 if test "$use_dnsserver" = "yes"; then
692 AC_DEFINE(USE_DNSSERVERS)
693 OPT_DNSSERVER_EXE='$(OPT_DNSSERVER_EXE)'
697 DNS_OBJS='dns_internal.o'
699 AC_SUBST(OPT_DNSSERVER_EXE)
703 AC_ARG_ENABLE(truncate,
704 [ --enable-truncate This uses truncate() instead of unlink() when
705 removing cache files. Truncate gives a little
706 performance improvement, but may cause problems
707 when used with async I/O. Truncate uses more
708 filesystem inodes than unlink..],
709 [ if test "$enableval" = "yes" ; then
710 echo "Enabling truncate instead of unlink"
711 AC_DEFINE(USE_TRUNCATE)
715 dnl Enable underscore in hostnames
716 AC_ARG_ENABLE(underscores,
717 [ --enable-underscores Squid by default rejects any host names with _
718 in their name to conform with internet standards.
719 If you disagree with this you may allow _ in
720 hostnames by using this switch, provided that
721 the resolver library on the host where Squid runs
722 does not reject _ in hostnames...],
723 [ if test "$enableval" = "yes" ; then
724 echo "Enabling the use of underscores in host names"
725 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1)
730 dnl Select auth schemes modules to build
732 [ --enable-auth=\"list of auth scheme modules\"
733 Build support for the list of authentication schemes.
734 The default is to build support for the Basic scheme.
735 See src/auth for a list of available modules, or
736 Programmers Guide section authentication schemes
737 for details on how to build your custom auth scheme
741 for module in $srcdir/src/auth/*; do
742 if test -f $module/Makefile.in; then
743 AUTH_MODULES="$AUTH_MODULES `basename $module`"
749 *) AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
753 [ if test -z "$AUTH_MODULES"; then
757 echo "Auth scheme modules built: $AUTH_MODULES"
758 AC_SUBST(AUTH_MODULES)
759 AUTH_OBJS="auth/`echo $AUTH_MODULES|sed -e 's% %.a auth/%g'`.a"
761 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
764 dnl Select basic auth scheme helpers to build
765 BASIC_AUTH_HELPERS=""
766 AC_ARG_ENABLE(auth-modules,
767 [ --enable-auth-modules=\"list of helpers\"
768 Backwards compability alias for
769 --enable-basic-auth-helpers],
770 [ echo "--enable-auth-modules is obsolete. Please use the new"
771 echo "option --enable-basic-auth-helpers"
775 for helper in $srcdir/src/auth/basic/helpers/*; do
776 if test -f $helper/Makefile.in; then
777 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`"
784 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
787 AC_ARG_ENABLE(basic-auth-helpers,
788 [ --enable-basic-auth-helpers=\"list of helpers\"
789 This option selects which basic scheme proxy_auth
790 helpers to build and install as part of the normal
791 build process. For a list of available
792 helpers see the src/auth/basic/helpers directory.],
793 [ case "$enableval" in
795 BASIC_AUTH_HELPERS=""
796 for helper in $srcdir/src/auth/basic/helpers/*; do
797 if test -f $helper/Makefile.in; then
798 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`"
805 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
808 if test -n "$BASIC_AUTH_HELPERS"; then
809 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
811 AC_SUBST(BASIC_AUTH_HELPERS)
813 dnl Select ntlm auth helpers to build
815 AC_ARG_ENABLE(ntlm-auth-helpers,
816 [ --enable-ntlm-auth-helpers=\"list of helpers\"
817 This option selects which proxy_auth ntlm helpers
818 to build and install as part of the normal build
819 process. For a list of available modules see
820 the src/auth/ntlm/helpers directory.],
821 [ case "$enableval" in
823 for helper in $srcdir/src/auth/ntlm/helpers/*; do
824 if test -f $helper/Makefile.in; then
825 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS `basename $helper`"
832 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
835 if test -n "$NTLM_AUTH_HELPERS"; then
836 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
838 AC_SUBST(NTLM_AUTH_HELPERS)
840 dnl Select digest auth scheme helpers to build
842 AC_ARG_ENABLE(digest-auth-helpers,
843 [ --enable-digest-auth-helpers=\"list of helpers\"
844 This option selects which digest scheme authentication
845 helpers to build and install as part of the normal build
846 process. For a list of available modules see the
847 src/auth/digest/helpers directory.],
848 [ case "$enableval" in
850 for helper in $srcdir/src/auth/digest/helpers/*; do
851 if test -f $helper/Makefile.in; then
852 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS `basename $helper`"
859 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
862 if test -n "$DIGEST_AUTH_HELPERS"; then
863 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
865 AC_SUBST(DIGEST_AUTH_HELPERS)
867 dnl Enable "NTLM fail open"
868 AC_ARG_ENABLE(ntlm-fail-open,
869 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
870 Authentication steps can allow squid to still authenticate
872 [ if test "$enableval" = "yes" ; then
873 AC_DEFINE(NTLM_FAIL_OPEN)
877 dnl Disable "unlinkd" code
878 AC_ARG_ENABLE(unlinkd,
879 [ --disable-unlinkd Do not use unlinkd],
880 [ if test "$enableval" = "no" ; then
886 # Here we should probably use some magic depending on the selected
890 if test "$use_unlinkd" = "yes"; then
891 echo "unlinkd enabled"
892 AC_DEFINE(USE_UNLINKD)
893 OPT_UNLINKD_EXE='$(OPT_UNLINKD_EXE)'
894 UNLINKD_OBJS='unlinkd.o'
896 echo "unlinkd disabled"
900 AC_SUBST(OPT_UNLINKD_EXE)
901 AC_SUBST(UNLINKD_OBJS)
903 dnl Enable backtraces on fatal errors
904 AC_ARG_ENABLE(stacktraces,
905 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
906 [ if test "$enableval" = "yes" ; then
907 echo "Enabling automatic stack backtraces on fatal errors"
908 AC_DEFINE(PRINT_STACK_TRACE, 1)
912 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
913 AC_ARG_ENABLE(x_accelerator_vary,
914 [ --enable-x-accelerator-vary Enable support for the X-Accelerator-Vary
915 HTTP header. Can be used to indicate
916 variance within an accelerator setup.
917 Typically used together with other code
918 that adds custom HTTP headers to the requests.],
919 [ if test "$enableval" = "yes" ; then
920 echo "Enabling support for X-Accelerator-Vary"
921 AC_DEFINE(X_ACCELERATOR_VARY, 1)
925 # Force some compilers to use ANSI features
929 if test "$ac_cv_prog_CC" = "cc" ; then
930 echo "adding '-std1' to cc args for $host"
936 if test "$ac_cv_prog_CC" = "cc" ; then
937 echo "adding '-Ae' to cc args for $host"
944 dnl Check for programs
949 AC_PATH_PROG(SH, sh, /bin/sh)
950 AC_PATH_PROG(FALSE, false, /usr/bin/false)
951 AC_PATH_PROG(TRUE, true, /usr/bin/true)
952 AC_PATH_PROG(RM, rm, $FALSE)
953 AC_PATH_PROG(MV, mv, $FALSE)
954 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
955 AC_PATH_PROG(LN, ln, cp)
956 AC_PATH_PROG(PERL, perl, none)
957 AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
958 AC_PATH_PROG(AR, ar, $FALSE)
960 if test "$ac_cv_path_PERL" = "none"; then
961 echo "Perl is required to compile Squid"
962 echo "Please install Perl and then re-run configure"
968 echo "Disabling 'ranlib' for HP-UX..."
982 dnl Check for headers
1006 linux/netfilter_ipv4.h \
1013 netinet/if_ether.h \
1016 netinet/ip_compat.h \
1017 netinet/ip_fil_compat.h \
1064 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1065 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1067 ac_cv_have_ansi_prototypes="yes",
1068 ac_cv_have_ansi_prototypes="no")
1070 if test $ac_cv_have_ansi_prototypes = "yes" ; then
1071 AC_DEFINE(HAVE_ANSI_PROTOTYPES)
1074 AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [
1075 AC_TRY_COMPILE([#include <time.h>
1076 #include <sys/time.h>],
1078 foo.tm_gmtoff = 0;],
1079 ac_cv_have_tm_gmoff="yes",
1080 ac_cv_have_tm_gmoff="no")
1082 if test $ac_cv_have_tm_gmoff = "yes" ; then
1083 AC_DEFINE(HAVE_TM_GMTOFF)
1086 AC_CACHE_CHECK(for struct mallinfo,ac_cv_have_struct_mallinfo, [
1087 AC_TRY_COMPILE([#include <sys/types.h>
1091 [struct mallinfo foo;
1100 ac_cv_have_struct_mallinfo="yes",
1101 ac_cv_have_struct_mallinfo="no")
1103 if test $ac_cv_have_struct_mallinfo = "yes" ; then
1104 AC_DEFINE(HAVE_STRUCT_MALLINFO)
1107 AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [
1108 AC_TRY_COMPILE([#include <sys/types.h>
1109 #include <malloc.h>],
1110 [struct mallinfo foo;
1112 ac_cv_have_ext_mallinfo="yes",
1113 ac_cv_have_ext_mallinfo="no")
1115 if test $ac_cv_have_ext_mallinfo = "yes" ; then
1116 AC_DEFINE(HAVE_EXT_MALLINFO)
1119 AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [
1122 #include <sys/time.h>
1124 #if HAVE_SYS_RESOURCE_H
1125 #include <sys/resource.h>
1128 ac_cv_have_struct_rusage="yes",
1129 ac_cv_have_struct_rusage="no")
1131 if test $ac_cv_have_struct_rusage = "yes" ; then
1132 AC_DEFINE(HAVE_STRUCT_RUSAGE)
1135 AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [
1136 AC_TRY_COMPILE([#include <sys/types.h>
1137 #include <netinet/in.h>
1138 #include <netinet/in_systm.h>
1139 #include <netinet/ip.h>
1140 #if defined (__linux__) || defined (__CYGWIN__)
1150 ac_cv_have_ip_hl="yes",
1151 ac_cv_have_ip_hl="no")
1153 if test $ac_cv_have_ip_hl = "yes" ; then
1154 AC_DEFINE(HAVE_IP_HL)
1157 dnl Check for typedefs
1158 AC_CHECK_SIZEOF(void *)
1159 AC_CHECK_SIZEOF(short)
1160 AC_CHECK_SIZEOF(int)
1161 AC_CHECK_SIZEOF(long)
1162 AC_CHECK_SIZEOF(long long)
1163 AC_CHECK_SIZEOF(__int64)
1164 AC_CHECK_SIZEOF(int16_t)
1165 AC_CHECK_SIZEOF(uint16_t)
1166 AC_CHECK_SIZEOF(u_int16_t)
1167 AC_CHECK_SIZEOF(int32_t)
1168 AC_CHECK_SIZEOF(uint32_t)
1169 AC_CHECK_SIZEOF(u_int32_t)
1170 AC_CHECK_SIZEOF(int64_t)
1171 AC_CHECK_SIZEOF(uint64_t)
1172 AC_CHECK_SIZEOF(u_int64_t)
1175 if test "x$ac_cv_sizeof_short" = "x2"; then
1176 AC_CHECK_TYPE(int16_t,short)
1177 elif test "x$ac_cv_sizeof_int" = "x2"; then
1178 AC_CHECK_TYPE(int16_t,int)
1181 if test "x$ac_cv_sizeof_uint16_t" = "x2"; then
1182 AC_CHECK_TYPE(u_int16_t,uint16_t)
1183 elif test "x$ac_cv_sizeof_short" = "x2"; then
1184 AC_CHECK_TYPE(u_int16_t,unsigned short)
1185 elif test "x$ac_cv_sizeof_int" = "x2"; then
1186 AC_CHECK_TYPE(u_int16_t,unsigned int)
1189 if test "x$ac_cv_sizeof_int" = "x4"; then
1190 AC_CHECK_TYPE(int32_t,int)
1191 elif "x$ac_cv_sizeof_long" = "x4"; then
1192 AC_CHECK_TYPE(int32_t,long)
1195 if test "x$ac_cv_sizeof_uint32_t" = "x4"; then
1196 AC_CHECK_TYPE(u_int32_t,uint32_t)
1197 elif test "x$ac_cv_sizeof_int" = "x4"; then
1198 AC_CHECK_TYPE(u_int32_t,unsigned int)
1199 elif test "x$ac_cv_sizeof_long" = "x4"; then
1200 AC_CHECK_TYPE(u_int32_t,unsigned long)
1203 if test "x$ac_cv_sizeof_long" = "x8"; then
1204 AC_CHECK_TYPE(int64_t,long)
1205 elif test "x$ac_cv_sizeof_long_long" = "x8"; then
1206 AC_CHECK_TYPE(int64_t,long long)
1207 elif test "x$ac_cv_sizeof___int64" = "x8"; then
1208 AC_CHECK_TYPE(int64_t,__int64)
1211 if test "x$ac_cv_sizeof_uint64_t" = "x8"; then
1212 AC_CHECK_TYPE(u_int64_t,uint64_t)
1213 elif test "x$ac_cv_sizeof_long" = "x8"; then
1214 AC_CHECK_TYPE(u_int64_t,unsigned long)
1215 elif test "x$ac_cv_sizeof_long_long" = "x8"; then
1216 AC_CHECK_TYPE(u_int64_t,unsigned long long)
1217 elif test "x$ac_cv_sizeof___int64" = "x8"; then
1218 AC_CHECK_TYPE(int64_t,unsigned __int64)
1221 AC_CHECK_TYPE(pid_t, int)
1222 AC_CHECK_TYPE(size_t, unsigned int)
1223 AC_CHECK_TYPE(ssize_t, int)
1224 AC_CHECK_TYPE(off_t, int)
1225 AC_CHECK_TYPE(mode_t, u_short)
1226 AC_CHECK_TYPE(fd_mask, int)
1228 dnl Check for special functions
1232 dnl Check for type in sys/socket.h
1233 AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
1234 AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
1235 #include <sys/socket.h>
1240 ac_cv_type_socklen_t=yes,
1241 ac_cv_type_socklen_t=no)
1243 if test $ac_cv_type_socklen_t = no; then
1244 AC_DEFINE(socklen_t, int)
1247 dnl Check for mtyp_t in some headers
1248 AC_CACHE_CHECK(for mtyp_t, ac_cv_type_mtyp_t, [
1249 AC_EGREP_CPP([mtyp_t[^a-zA-Z_0-9]], [#include <sys/types.h>
1250 #include <sys/ipc.h>
1251 #include <sys/msg.h>],
1252 ac_cv_type_mtyp_t=yes,
1253 ac_cv_type_mtyp_t=no)
1255 if test $ac_cv_type_mtyp_t = no; then
1256 AC_DEFINE(mtyp_t, long)
1259 dnl Check for needed libraries
1260 AC_CHECK_LIB(nsl, main)
1261 AC_CHECK_LIB(socket, main)
1263 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
1264 echo "skipping libmalloc check (--enable-dlmalloc specified)"
1266 AC_CHECK_LIB(gnumalloc, main)
1267 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
1268 echo "Disabling extended malloc functions when using gnumalloc"
1269 ac_cv_func_mallinfo=no
1270 ac_cv_func_mallocblksize=no
1271 ac_cv_func_mallopt=no
1275 echo "skipping libmalloc check for $host"
1278 echo "skipping libmalloc check for $host"
1282 AC_CHECK_LIB(malloc, main)
1288 AC_CHECK_LIB(bsd, main)
1289 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
1290 AC_CHECK_LIB(bind, gethostbyname)
1291 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
1294 echo "skipping libresolv checks for $host"
1297 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
1298 AC_CHECK_LIB(resolv, main)
1302 AC_CHECK_LIB(m, main)
1304 dnl Check for libcrypt
1305 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
1306 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1309 dnl Check for libdl, used by auth_modules/PAM
1310 AC_CHECK_LIB(dl, dlopen, [DLLIB="-ldl"])
1313 dnl Check for pthreads
1314 dnl We use pthreads when doing ASYNC I/O
1315 AC_CHECK_LIB(pthread, main, [PTHREADLIB="-lpthread"])
1316 AC_SUBST(PTHREADLIB)
1318 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
1319 dnl Robert Side <rside@aiinc.bc.ca>
1320 dnl Mon, 18 Jan 1999 17:48:00 GMT
1323 AC_CHECK_LIB(intl, strftime)
1327 dnl System-specific library modifications
1331 if test "$GCC" = "yes"; then
1332 echo "Removing -O for gcc on $host"
1333 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1337 echo "Removing -lsocket for IRIX..."
1338 LIBS=`echo $LIBS | sed -e s/-lsocket//`
1339 echo "Removing -lnsl for IRIX..."
1340 LIBS=`echo $LIBS | sed -e s/-lnsl//`
1341 ac_cv_lib_nsl_main=no
1342 echo "Removing -lbsd for IRIX..."
1343 LIBS=`echo $LIBS | sed -e s/-lbsd//`
1345 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
1346 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
1347 dnl Please change your configure script. AIX doesn't need -lbsd.
1349 echo "Removing -lbsd for AIX..."
1350 LIBS=`echo $LIBS | sed -e s/-lbsd//`
1351 dnl From: mlaster@metavillage.com (Mike Laster)
1352 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
1353 dnl So using the internal versions generates a load of warnings
1355 echo "disabling snprintf/vsnprintf for $host"
1356 ac_cv_func_snprintf=no
1357 ac_cv_func_vsnprintf=no
1360 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
1361 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
1363 [*-*-solaris2.[0-4]])
1364 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
1366 [*-sony-newsos[56]*])
1367 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
1371 # Remove optimization for GCC 2.95.[123]
1372 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
1373 if test "$GCC" = "yes"; then
1374 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
1377 echo "Removing -O for gcc on $host with GCC $GCCVER"
1378 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1383 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
1386 if test `uname -v` = "2.03"; then
1387 echo "disabling mallinfo for $host"
1388 ac_cv_func_mallinfo=no
1393 dnl This has to be before AC_CHECK_FUNCS
1394 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
1395 # when running configure.
1396 if test -z "$ac_cv_func_poll"; then
1399 # John Kay (jkay@nlanr.net) 19970818
1400 echo "disabling poll for $host..."
1401 ac_cv_func_poll='no'
1405 echo "disabling poll for $host..."
1406 ac_cv_func_poll='no'
1409 # Henrik Nordstrom (hno@hem.passagen.se) 19980817
1410 # poll is problematic on Linux. We disable it
1411 # by default until Linux gets it right.
1412 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
1413 if test $rev -lt 002002; then
1414 echo "disabling poll for $host < 2.2..."
1415 ac_cv_func_poll='no'
1418 [powerpc-ibm-aix4.1.*])
1419 # Mike Laster (mlaster@metavillage.com) 19981021
1420 echo "disabling poll for $host..."
1421 ac_cv_func_poll='no'
1424 # Robert Side <rside@aiinc.bc.ca>
1425 # Mon, 18 Jan 1999 17:48:00 GMT
1426 echo "disabling poll for $host..."
1427 ac_cv_func_poll='no'
1432 dnl Check for library functions
1435 backtrace_symbols_fd \
1453 pthread_attr_setscope \
1454 pthread_setschedparam \
1455 pthread_attr_setschedparam \
1483 dnl Yay! Another Linux brokenness. Its not good enough
1484 dnl to know that setresuid() exists, because RedHat 5.0 declares
1485 dnl setresuid() but doesn't implement it.
1487 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
1491 if(setresuid(-1,-1,-1)) {
1492 perror("setresuid:");
1497 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
1499 if test "$ac_cv_func_setresuid" = "yes" ; then
1500 AC_DEFINE(HAVE_SETRESUID)
1503 dnl IP-Filter support requires ipf header files. These aren't
1504 dnl installed by default, so we need to check for them
1505 if test "$IPF_TRANSPARENT" ; then
1506 AC_MSG_CHECKING(if IP-Filter header files are installed)
1507 # hold on to your hats...
1508 if test "$ac_cv_header_ip_compat_h" = "yes" ||
1509 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
1510 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
1511 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
1512 have_ipfilter_compat_header="yes"
1514 if test "x$have_ipfilter_compat_header" = "xyes" &&
1515 test "$ac_cv_header_ip_fil_h" = "yes" &&
1516 test "$ac_cv_header_ip_nat_h" = "yes" ; then
1517 IPF_TRANSPARENT="yes"
1518 AC_DEFINE(IPF_TRANSPARENT, 1)
1519 elif test "$have_ipfilter_compat_header" = "yes" &&
1520 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
1521 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
1522 IPF_TRANSPARENT="yes"
1523 AC_DEFINE(IPF_TRANSPARENT, 1)
1525 IPF_TRANSPARENT="no"
1526 AC_DEFINE(IPF_TRANSPARENT, 0)
1528 AC_MSG_RESULT($IPF_TRANSPARENT)
1530 if test "$IPF_TRANSPARENT" = "no" ; then
1531 echo "WARNING: Cannot find necessary IP-Filter header files"
1532 echo " Transparent Proxy support WILL NOT be enabled"
1536 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
1537 dnl Shamelessly copied from above
1538 if test "$LINUX_NETFILTER" ; then
1539 AC_MSG_CHECKING(if Linux 2.4 kernel header files are installed)
1540 # hold on to your hats...
1541 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
1542 LINUX_NETFILTER="yes"
1543 AC_DEFINE(LINUX_NETFILTER, 1)
1545 LINUX_NETFILTER="no"
1546 AC_DEFINE(LINUX_NETFILTER, 0)
1548 AC_MSG_RESULT($LINUX_NETFILTER)
1550 if test "$LINUX_NETFILTER" = "no" ; then
1551 echo "WARNING: Cannot find necessary Linux 2.4 kernel header files"
1552 echo " Linux 2.4 Transparent Proxy support WILL NOT be enabled"
1556 if test -z "$USE_GNUREGEX" ; then
1558 *-sun-solaris2.[[0-4]])
1566 AC_MSG_CHECKING(if GNUregex needs to be compiled)
1567 if test -z "$USE_GNUREGEX"; then
1568 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
1571 AC_TRY_COMPILE([#include <sys/types.h>
1572 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
1577 AC_MSG_RESULT($USE_GNUREGEX)
1578 if test "$USE_GNUREGEX" = "yes"; then
1580 LIBREGEX="libregex.a"
1581 AC_DEFINE(USE_GNUREGEX)
1592 dnl Not cached since people are likely to tune this
1593 AC_MSG_CHECKING(Default FD_SETSIZE value)
1602 #include <sys/time.h>
1604 #if HAVE_SYS_SELECT_H
1605 #include <sys/select.h>
1607 #if HAVE_SYS_TYPES_H
1608 #include <sys/types.h>
1611 FILE *fp = fopen("conftestval", "w");
1612 fprintf (fp, "%d\n", FD_SETSIZE);
1616 DEFAULT_FD_SETSIZE=`cat conftestval`,
1617 DEFAULT_FD_SETSIZE=256,
1618 DEFAULT_FD_SETSIZE=256)
1619 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
1620 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
1622 dnl Not cached since people are likely to tune this
1623 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
1624 dnl damn! FreeBSD's pthreads breaks dup2().
1627 i386-unknown-freebsd*)
1628 if echo "$LDFLAGS" | grep -q pthread; then
1629 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
1635 #include <sys/time.h> /* needed on FreeBSD */
1636 #include <sys/param.h>
1637 #include <sys/resource.h>
1641 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
1642 /* getrlimit and sysconf returns bogous values on cygwin32.
1643 * Number of fds is virtually unlimited in cygwin (sys/param.h)
1644 * __CYGWIN32__ is deprecated.
1650 #if defined(RLIMIT_NOFILE)
1651 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
1652 perror("getrlimit: RLIMIT_NOFILE");
1654 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1655 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
1656 perror("setrlimit: RLIMIT_NOFILE");
1659 #elif defined(RLIMIT_OFILE)
1660 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
1661 perror("getrlimit: RLIMIT_OFILE");
1663 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1664 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
1665 perror("setrlimit: RLIMIT_OFILE");
1668 #endif /* RLIMIT_NOFILE */
1669 #endif /* HAVE_SETRLIMIT */
1670 /* by starting at 2^14, we will never get higher
1671 than 2^15 for SQUID_MAXFD */
1675 if (dup2(0, i) < 0) {
1683 #endif /* IF !DEF CYGWIN */
1684 fp = fopen("conftestval", "w");
1685 fprintf (fp, "%d\n", i);
1689 SQUID_MAXFD=`cat conftestval`,
1692 AC_MSG_RESULT($SQUID_MAXFD)
1693 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD)
1694 if test "$SQUID_MAXFD" -lt 512 ; then
1695 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
1696 echo " cache will be very busy. Please see the FAQ page"
1697 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
1698 echo " on how to increase your filedescriptor limit"
1703 dnl Not cached since people are likely to tune this
1704 AC_MSG_CHECKING(Default UDP send buffer size)
1708 #include <sys/types.h>
1709 #include <sys/socket.h>
1710 #include <netinet/in.h>
1714 int fd,val=0,len=sizeof(int);
1715 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
1716 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
1717 if (val<=0) exit(1);
1718 fp = fopen("conftestval", "w");
1719 fprintf (fp, "%d\n", val);
1723 SQUID_UDP_SO_SNDBUF=`cat conftestval`,
1724 SQUID_UDP_SO_SNDBUF=16384,
1725 SQUID_UDP_SO_SNDBUF=16384)
1726 AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF)
1727 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF)
1729 dnl Not cached since people are likely to tune this
1730 AC_MSG_CHECKING(Default UDP receive buffer size)
1734 #include <sys/types.h>
1735 #include <sys/socket.h>
1736 #include <netinet/in.h>
1740 int fd,val=0,len=sizeof(int);
1741 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
1742 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1743 if (val <= 0) exit(1);
1744 fp = fopen("conftestval", "w");
1745 fprintf (fp, "%d\n", val);
1749 SQUID_UDP_SO_RCVBUF=`cat conftestval`,
1750 SQUID_UDP_SO_RCVBUF=16384,
1751 SQUID_UDP_SO_RCVBUF=16384)
1752 AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF)
1753 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF)
1755 dnl Not cached since people are likely to tune this
1756 AC_MSG_CHECKING(Default TCP send buffer size)
1760 #include <sys/types.h>
1761 #include <sys/socket.h>
1762 #include <netinet/in.h>
1766 int fd,val=0,len=sizeof(int);
1767 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1768 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
1769 if (val <= 0) exit(1);
1770 fp = fopen("conftestval", "w");
1771 fprintf (fp, "%d\n", val);
1775 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1776 SQUID_TCP_SO_SNDBUF=16384,
1777 SQUID_TCP_SO_SNDBUF=16384)
1778 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
1779 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF)
1781 dnl Not cached since people are likely to tune this
1782 AC_MSG_CHECKING(Default TCP receive buffer size)
1786 #include <sys/types.h>
1787 #include <sys/socket.h>
1788 #include <netinet/in.h>
1792 int fd,val=0,len=sizeof(int);
1793 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1794 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1795 if (val <= 0) exit(1);
1796 fp = fopen("conftestval", "w");
1797 fprintf (fp, "%d\n", val);
1801 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1802 SQUID_TCP_SO_RCVBUF=16384,
1803 SQUID_TCP_SO_RCVBUF=16384)
1804 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
1805 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF)
1807 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
1808 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
1809 ac_cv_needs_sys_errlist="no",
1810 ac_cv_needs_sys_errlist="yes")
1812 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
1813 AC_DEFINE(NEED_SYS_ERRLIST)
1816 dnl Not cached since people are likely to change this
1817 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
1818 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
1820 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)],
1823 AC_MSG_CHECKING(if inet_ntoa() actually works)
1827 #include <sys/types.h>
1828 #include <netinet/in.h>
1829 #include <arpa/inet.h>
1834 in.s_addr = inet_addr("1.2.3.4");
1835 fp = fopen("conftestval", "w");
1836 fprintf (fp, "%s\n", inet_ntoa(in));
1840 INET_NTOA_RESULT=`cat conftestval`,
1841 INET_NTOA_RESULT="broken",
1842 INET_NTOA_RESULT="broken")
1843 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
1844 AC_MSG_RESULT("yes")
1847 echo "Will use our own inet_ntoa()."
1848 LIBOBJS="$LIBOBJS inet_ntoa.o"
1849 # echo "WARNING: This looks bad, and probably prevents Squid from working."
1850 # echo " If you're on IRIX and using GCC 2.8, you probably need"
1851 # echo " to use the IRIX C compiler instead."
1855 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
1856 AC_MSG_CHECKING(for working statvfs() interface)
1860 #include <sys/types.h>
1861 #include <sys/statvfs.h>
1865 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
1866 sfs.f_files = sfs.f_ffree = 0;
1867 statvfs("/tmp", &sfs);
1869 ac_cv_func_statvfs=yes,
1870 ac_cv_func_statvfs=no)
1871 AC_MSG_RESULT($ac_cv_func_statvfs)
1872 if test "$ac_cv_func_statvfs" = "yes" ; then
1873 AC_DEFINE(HAVE_STATVFS)
1877 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
1879 #if HAVE_SYS_TYPES_H
1880 #include <sys/types.h>
1882 #if HAVE_NETINET_IN_H
1883 #include <netinet/in.h>
1885 #if HAVE_ARPA_INET_H
1886 #include <arpa/inet.h>
1888 #if HAVE_ARPA_NAMESER_H
1889 #include <arpa/nameser.h>
1895 [_res.nsaddr_list[[0]];],
1896 ac_cv_have_res_nsaddr_list="yes",
1897 ac_cv_have_res_nsaddr_list="no"))
1898 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
1899 AC_DEFINE(HAVE_RES_NSADDR_LIST)
1902 if test $ac_cv_have_res_nsaddr_list = "no" ; then
1903 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
1905 #if HAVE_SYS_TYPES_H
1906 #include <sys/types.h>
1908 #if HAVE_NETINET_IN_H
1909 #include <netinet/in.h>
1911 #if HAVE_ARPA_INET_H
1912 #include <arpa/inet.h>
1914 #if HAVE_ARPA_NAMESER_H
1915 #include <arpa/nameser.h>
1921 [_res.ns_list[[0]].addr;],
1922 ac_cv_have_res_ns_list="yes",
1923 ac_cv_have_res_ns_list="no"))
1924 if test $ac_cv_have_res_ns_list = "yes" ; then
1925 AC_DEFINE(HAVE_RES_NS_LIST)
1929 dnl Need the debugging version of malloc if available
1931 if test "$ac_cv_lib_malloc_main" = "yes" ; then
1932 if test -r /usr/lib/debug/malloc.o ; then
1933 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
1935 if test -r /usr/lib/debug/mallocmap.o ; then
1936 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
1942 if test -z "$XTRA_LIBS"; then
1945 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
1950 dnl Clean up after OSF/1 core dump bug
1954 for fs in $STORE_MODULES none; do
1955 if test $fs != none; then
1956 FS_MAKEFILES="$FS_MAKEFILES ./src/fs/$fs/Makefile"
1960 for repl in $REPL_POLICIES none; do
1961 if test $repl != none; then
1962 REPL_MAKEFILES="$REPL_MAKEFILES ./src/repl/$repl/Makefile"
1966 dnl This could actually be used to find all the Makefiles..
1968 for auth in `find $srcdir/src/auth -type d -print`; do
1969 if test -f $auth/Makefile.in; then
1970 dir=`echo $auth | sed -e "s|^$srcdir/||"`
1971 AUTH_MAKEFILES="$AUTH_MAKEFILES ./$dir/Makefile"
1978 ./include/config.h \
1979 ./scripts/Makefile \
1980 ./scripts/RunCache \
1981 ./scripts/RunAccel \
1985 ./src/repl/Makefile \
1987 ./src/auth/Makefile \
1989 ./contrib/Makefile \