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.182 1999/12/30 17:35:50 wessels Exp $
11 AC_CONFIG_HEADER(include/autoconf.h)
12 AC_REVISION($Revision: 1.182 $)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'; then
24 libexecdir='${bindir}'
25 localstatedir='${prefix}'
29 dnl use .exe suffix for executables on cygwin32 platform
43 if test -z "$CACHE_HTTP_PORT"; then
44 CACHE_HTTP_PORT="3128"
46 if test -z "$CACHE_ICP_PORT"; then
51 AC_SUBST(CACHE_HTTP_PORT)
52 AC_SUBST(CACHE_ICP_PORT)
54 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host")
56 dnl Set default LDFLAGS
57 if test -z "$LDFLAGS"; then
61 PRESET_CFLAGS="$CFLAGS"
66 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
69 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
73 dnl Set Default CFLAGS
74 if test -z "$PRESET_CFLAGS"; then
75 if test "$GCC" = "yes"; then
78 # sunos has too many warnings for this to be useful
82 # Motorola cc/ld does not like -02 but is ok on -O
83 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
86 CFLAGS="$CFLAGS -Wall"
92 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
93 CFLAGS="$CFLAGS -n32 -mips4 -O3 -OPT:Olimit=0:space=OFF \
94 -woff 1009,1014,1048,1110,1116,1185,1188,1204,1230,1233 \
95 -Wl,-woff,85,-woff,84,-woff,134 \
96 -nostdinc -I/usr/include -D_BSD_SIGNALS"
99 # Mogul says DEC compilers take both -g and -O2
100 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
110 if test -z "$PRESET_LDFLAGS"; then
111 if test "$GCC" = "yes"; then
120 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
121 LDFLAGS="-n32 -mips4 -nostdlib -L/usr/lib32"
127 dnl Enable optional modules
128 AC_ARG_ENABLE(dlmalloc,
129 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
134 LIBDLMALLOC="libdlmalloc.a"
135 LIB_MALLOC="-L../lib -ldlmalloc"
136 echo "dlmalloc enabled"
140 echo "dlmalloc disabled"
142 *) use_dlmalloc="yes"
143 LIB_MALLOC="$enableval"
144 echo "dlmalloc enabled with $LIB_MALLOC"
147 if test "${use_dlmalloc-unset}" = unset; then
150 echo "Enabling dlmalloc for $host"
155 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
156 # Ok. dlmalloc was enabled before, but state may be changed.
157 # we have to test these again
158 unset ac_cv_func_mallinfo
159 unset ac_cv_func_mallocblksize
160 unset ac_cv_func_free
161 unset ac_cv_func_realloc
162 unset ac_cv_func_memalign
163 unset ac_cv_func_valloc
164 unset ac_cv_func_pvalloc
165 unset ac_cv_func_calloc
166 unset ac_cv_func_cfree
167 unset ac_cv_func_malloc_trim
168 unset ac_cv_func_malloc_usable_size
169 unset ac_cv_func_malloc_stats
170 unset ac_cv_func_mallinfo
171 unset ac_cv_func_mallopt
172 unset ac_cv_lib_gnumalloc
173 unset ac_cv_header_gnumalloc_h
174 unset ac_cv_lib_malloc
175 unset ac_cv_enabled_dlmalloc
177 if test "$use_dlmalloc" = yes; then
178 ac_cv_func_mallinfo="yes"
179 ac_cv_func_mallocblksize="no"
180 ac_cv_func_free="yes"
181 ac_cv_func_realloc="yes"
182 ac_cv_func_memalign="yes"
183 ac_cv_func_valloc="yes"
184 ac_cv_func_pvalloc="yes"
185 ac_cv_func_calloc="yes"
186 ac_cv_func_cfree="yes"
187 ac_cv_func_malloc_trim="yes"
188 ac_cv_func_malloc_usable_size="yes"
189 ac_cv_func_malloc_stats="yes"
190 ac_cv_func_mallopt="yes"
191 ac_cv_lib_gnumalloc="no"
192 ac_cv_header_gnumalloc_h="no"
193 ac_cv_lib_malloc="no"
194 ac_cv_enabled_dlmalloc="yes"
197 AC_SUBST(LIBDLMALLOC)
200 AC_ARG_ENABLE(gnuregex,
201 [ --enable-gnuregex Compile GNUregex],
202 [USE_GNUREGEX=$enableval])
204 AC_ARG_ENABLE(xmalloc_debug,
205 [ --enable-xmalloc-debug Do some simple malloc debugging],
206 [ if test "$enableval" = "yes" ; then
207 echo "Malloc debugging enabled"
208 AC_DEFINE(XMALLOC_DEBUG)
212 AC_ARG_ENABLE(xmalloc_debug_trace,
213 [ --enable-xmalloc-debug-trace
214 Detailed trace of memory allocations],
215 [ if test "$enableval" = "yes" ; then
216 echo "Malloc debug trace enabled"
217 AC_DEFINE(XMALLOC_TRACE)
218 AC_DEFINE(XMALLOC_DEBUG)
222 AC_ARG_ENABLE(xmalloc_statistics,
223 [ --enable-xmalloc-statistics
224 Show malloc statistics in status page],
225 [ if test "$enableval" = "yes" ; then
226 echo "Malloc statistics enabled"
227 AC_DEFINE(XMALLOC_STATISTICS)
232 [ --enable-carp Enable CARP support],
233 [ if test "$enableval" = "yes" ; then
234 echo "CARP support enabled"
239 AC_ARG_ENABLE(async_io,
240 [ --enable-async-io[=N_THREADS]
241 Do ASYNC disk I/O using threads.
242 N_THREADS is the number of worker threads
243 defaults to 16. See also src/squid.h for
244 some additional platform tuning],
245 [ case "$enableval" in
254 AC_DEFINE_UNQUOTED(NUMTHREADS, $enableval)
259 if test -n "$async_io" ; then
260 echo "Async I/O enabled"
262 AC_DEFINE(USE_ASYNC_IO)
263 ASYNC_OBJS='$(ASYNC_OBJS)'
264 SQUID_PTHREAD_LIB='$(PTHREADLIB)'
265 CFLAGS="$CFLAGS -D_REENTRANT"
267 i386-unknown-freebsd*)
268 if test "$GCC" = "yes" ; then
269 if test -z "$PRESET_LDFLAGS"; then
270 LDFLAGS="$LDFLAGS -pthread"
277 AC_SUBST(SQUID_PTHREAD_LIB)
280 [ --enable-icmp Enable ICMP pinging],
281 [ if test "$enableval" = "yes" ; then
287 AC_ARG_ENABLE(delay_pools,
288 [ --enable-delay-pools Enable delay pools to limit bandwith usage],
289 [ if test "$enableval" = "yes" ; then
290 echo "Delay pools enabled"
291 DELAY_OBJS='$(DELAY_OBJS)'
292 AC_DEFINE(DELAY_POOLS)
297 AC_ARG_ENABLE(mem-gen-trace,
298 [ --enable-mem-gen-trace Do trace of memory stuff],
299 [ if test "$enableval" = "yes" ; then
300 echo "Memory trace (to file) enabled"
301 AC_DEFINE(MEM_GEN_TRACE)
305 AC_ARG_ENABLE(useragent_log,
306 [ --enable-useragent-log Enable logging of User-Agent header],
307 [ if test "$enableval" = "yes" ; then
308 echo "User-Agent logging enabled"
309 AC_DEFINE(USE_USERAGENT_LOG)
314 [ --disable-wccp Disable Web Cache Coordination Protocol],
315 [ if test "$enableval" = "no" ; then
316 echo "Web Cache Coordination Protocol disabled"
317 AC_DEFINE(USE_WCCP, 0)
319 AC_DEFINE(USE_WCCP, 1)
323 AC_ARG_ENABLE(kill_parent_hack,
324 [ --enable-kill-parent-hack
325 Kill parent on shutdown],
326 [ if test "$enableval" = "yes" ; then
327 echo "Kill parent on shutdown"
328 AC_DEFINE(KILL_PARENT_OPT)
333 [ --enable-snmp Enable SNMP monitoring],
334 [ if test "$enableval" = "yes" ; then
335 echo "SNMP monitoring enabled"
336 AC_DEFINE(SQUID_SNMP)
337 SNMPLIB='-L../snmplib -lsnmp'
338 SNMP_OBJS='$(SNMP_OBJS)'
339 SNMP_MAKEFILE=./snmplib/Makefile
345 AC_SUBST(makesnmplib)
347 AC_ARG_ENABLE(time_hack,
348 [ --enable-time-hack Update internal timestamp only once per second],
349 [ if test "$enableval" = "yes" ; then
350 echo "Update internal timestamp only once per second"
351 AC_DEFINE(ALARM_UPDATES_TIME)
355 AC_ARG_ENABLE(cachemgr_hostname,
356 [ --enable-cachemgr-hostname[=hostname]
357 Make cachemgr.cgi default to this host],
360 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()])
361 echo "Cachemgr default hostname == host where cachemgr runs"
367 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
368 echo "Cachemgr default hostname set to ${enableval}"
373 AC_ARG_ENABLE(arp_acl,
374 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
375 [ if test "$enableval" = "yes" ; then
376 echo "ARP ACL lists enabled (ether address)"
381 echo "WARNING: ARP ACL support is only currently supported on Linux"
382 echo " ethernet interfaces, probably won't work on $host."
386 AC_DEFINE(USE_ARP_ACL)
391 [ --enable-htcp Enable HTCP protocol],
392 [ if test "$enableval" = "yes" ; then
394 HTCP_OBJS='$(HTCP_OBJS)'
400 AC_ARG_ENABLE(forw-via-db,
401 [ --enable-forw-via-db Enable Forw/Via database],
402 [ if test "$enableval" = "yes" ; then
403 echo "FORW-VIA enabled"
404 AC_DEFINE(FORW_VIA_DB)
408 AC_ARG_ENABLE(cache-digests,
409 [ --enable-cache-digests Use Cache Digests
410 see http://squid.nlanr.net/Squid/FAQ/FAQ-16.html],
411 [ if test "$enableval" = "yes" ; then
412 echo "USE_CACHE_DIGESTS enabled"
413 AC_DEFINE(USE_CACHE_DIGESTS)
417 dnl Select Error language
418 AC_ARG_ENABLE(err-language,
419 [ --enable-err-language=lang
420 Select language for Error pages (see errors dir) ],
422 if test -d errors/$enableval; then
423 ERR_LANGUAGE=$enableval
425 echo "ERROR! Unknown language $enableval, see errors/"
428 ],[ERR_LANGUAGE="English"])
429 AC_SUBST(ERR_LANGUAGE)
433 [ --enable-poll Enable poll() instead of select(). Normally poll
434 is preferred over select, but configure knows poll
435 is broken on some platforms. If you think you are
436 smarter than the configure script, you may enable
437 poll with this option.
438 --disable-poll Disable the use of poll().],
442 echo "Forcing poll() to be enabled"
443 ac_cv_func_poll='yes'
446 echo "Forcing poll() to be disabled"
452 dnl Disable HTTP violations
453 AC_ARG_ENABLE(http-violations,
454 [ --disable-http-violations
455 This allows you to remove code which is known to
456 violate the HTTP protocol specification.],
457 [ if test "$enableval" = "no" ; then
458 echo "Disabling HTTP Violations"
459 AC_DEFINE(HTTP_VIOLATIONS, 0)
461 AC_DEFINE(HTTP_VIOLATIONS, 1)
465 dnl Enable IP-Filter Transparent Proxy
466 AC_ARG_ENABLE(ipf-transparent,
467 [ --enable-ipf-transparent
468 Enable Transparent Proxy support for systems
469 using IP-Filter network address redirection.],
470 [ if test "$enableval" = "yes" ; then
471 echo "IP-Filter Transparent Proxy enabled"
472 AC_DEFINE(IPF_TRANSPARENT)
473 IPF_TRANSPARENT="yes"
477 dnl Enable Leak Finding Functions
478 AC_ARG_ENABLE(leakfinder,
479 [ --enable-leakfinder
480 Enable Leak Finding code. Enabling this alone
481 does nothing; you also have to modify the source
482 code to use the leak finding functions. Probably
483 Useful for hackers only.],
484 [ if test "$enableval" = "yes" ; then
485 echo "Leak-Finding enabled"
486 AC_DEFINE(USE_LEAKFINDER)
487 LEAKFINDER_OBJS='$(LEAKFINDER_OBJS)'
491 AC_SUBST(LEAKFINDER_OBJS)
493 dnl Disable HTTP violations
494 AC_ARG_ENABLE(ident-lookups,
495 [ --disable-ident-lookups
496 This allows you to remove code that performs
497 Ident (RFC 931) lookups.],
498 [ if test "$enableval" = "no" ; then
499 echo "Disabling Ident Lookups"
500 AC_DEFINE(USE_IDENT, 0)
502 AC_DEFINE(USE_IDENT, 1)
506 AC_ARG_ENABLE(internal-dns,
507 [ --disable-internal-dns This prevents Squid from directly sending and
508 receiving DNS messages, and instead enables the
509 old external 'dnsserver' processes.],
510 [ if test "$enableval" = "no" ; then
511 echo "Disabling Internal DNS queries"
512 AC_DEFINE(USE_DNSSERVERS, 1)
514 AC_DEFINE(USE_DNSSERVERS, 0)
518 AC_ARG_ENABLE(truncate,
519 [ --enable-truncate This uses truncate() instead of unlink() when
520 removing cache files. Truncate gives a little
521 performance improvement, but may cause problems
522 when used with async I/O. Truncate uses more
523 filesystem inodes than unlink..],
524 [ if test "$enableval" = "yes" ; then
525 echo "Enabling truncate instead of unlink"
526 AC_DEFINE(USE_TRUNCATE)
530 dnl Enable underscore in hostnames
531 AC_ARG_ENABLE(underscores,
532 [ --enable-underscores Squid by default rejects any host names with _
533 in their name to conform with internet standars.
534 If you disagree with this you may allow _ in
535 hostnames by using this switch, provided that
536 the resolver library on the host where Squid runs
537 does not reject _ in hostnames...],
538 [ if test "$enableval" = "yes" ; then
539 echo "Enabling the use of underscores in host names"
540 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1)
544 dnl Enable HEAP_REPLACEMENT
545 AC_ARG_ENABLE(heap-replacement,
546 [ --enable-heap-replacement
547 This option allows you to use various cache
548 replacement algorithms, instead of the standard
551 [ if test "$enableval" = "yes" ; then
552 echo "Enabling HEAP_REPLACEMENT"
553 AC_DEFINE(HEAP_REPLACEMENT, 1)
557 dnl Enable "diskd" code
559 [ --enable-diskd Uses shared memory, message queues, and external
560 processes for disk I/O.],
561 [ if test "$enableval" = "yes" ; then
563 AC_DEFINE(USE_DISKD, 1)
564 OPT_DISKD_EXE='$(DISKD_EXE)'
565 AC_SUBST(OPT_DISKD_EXE)
571 # Force some compilers to use ANSI features
575 if test "$ac_cv_prog_CC" = "cc" ; then
576 echo "adding '-std1' to cc args for $host"
582 if test "$ac_cv_prog_CC" = "cc" ; then
583 echo "adding '-Ae' to cc args for $host"
590 dnl Check for programs
595 AC_PATH_PROG(SH, sh, /bin/sh)
596 AC_PATH_PROG(FALSE, false, /usr/bin/false)
597 AC_PATH_PROG(TRUE, true, /usr/bin/true)
598 AC_PATH_PROG(RM, rm, $FALSE)
599 AC_PATH_PROG(MV, mv, $FALSE)
600 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
601 AC_PATH_PROG(LN, ln, cp)
602 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
603 AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
604 AC_PATH_PROG(AR, ar, $FALSE)
608 echo "Disabling 'ranlib' for HP-UX..."
622 dnl Check for headers
652 netinet/ip_compat.h \
691 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
692 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
694 ac_cv_have_ansi_prototypes="yes",
695 ac_cv_have_ansi_prototypes="no")
697 if test $ac_cv_have_ansi_prototypes = "yes" ; then
698 AC_DEFINE(HAVE_ANSI_PROTOTYPES)
701 AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [
702 AC_TRY_COMPILE([#include <time.h>
703 #include <sys/time.h>],
706 ac_cv_have_tm_gmoff="yes",
707 ac_cv_have_tm_gmoff="no")
709 if test $ac_cv_have_tm_gmoff = "yes" ; then
710 AC_DEFINE(HAVE_TM_GMTOFF)
713 AC_CACHE_CHECK(for struct mallinfo,ac_cv_have_struct_mallinfo, [
714 AC_TRY_COMPILE([#include <sys/types.h>
718 [struct mallinfo foo;
727 ac_cv_have_struct_mallinfo="yes",
728 ac_cv_have_struct_mallinfo="no")
730 if test $ac_cv_have_struct_mallinfo = "yes" ; then
731 AC_DEFINE(HAVE_STRUCT_MALLINFO)
734 AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [
735 AC_TRY_COMPILE([#include <sys/types.h>
736 #include <malloc.h>],
737 [struct mallinfo foo;
739 ac_cv_have_ext_mallinfo="yes",
740 ac_cv_have_ext_mallinfo="no")
742 if test $ac_cv_have_ext_mallinfo = "yes" ; then
743 AC_DEFINE(HAVE_EXT_MALLINFO)
746 AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [
749 #include <sys/time.h>
751 #if HAVE_SYS_RESOURCE_H
752 #include <sys/resource.h>
755 ac_cv_have_struct_rusage="yes",
756 ac_cv_have_struct_rusage="no")
758 if test $ac_cv_have_struct_rusage = "yes" ; then
759 AC_DEFINE(HAVE_STRUCT_RUSAGE)
762 AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [
763 AC_TRY_COMPILE([#include <sys/types.h>
764 #include <netinet/in.h>
765 #include <netinet/in_systm.h>
766 #include <netinet/ip.h>
775 ac_cv_have_ip_hl="yes",
776 ac_cv_have_ip_hl="no")
778 if test $ac_cv_have_ip_hl = "yes" ; then
779 AC_DEFINE(HAVE_IP_HL)
782 dnl Check for typedefs
784 AC_CHECK_SIZEOF(long)
785 AC_CHECK_SIZEOF(void *)
787 dnl Check for special functions
790 AC_CHECK_TYPE(pid_t, int)
791 AC_CHECK_TYPE(size_t, unsigned int)
792 AC_CHECK_TYPE(ssize_t, int)
793 AC_CHECK_TYPE(off_t, int)
794 AC_CHECK_TYPE(mode_t, u_short)
795 AC_CHECK_TYPE(fd_mask, int)
796 AC_CHECK_TYPE(mtyp_t, long)
798 dnl Check for type in sys/socket.h
799 AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
800 AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
801 #include <sys/socket.h>
806 ac_cv_type_socklen_t=yes,
807 ac_cv_type_socklen_t=no)
809 if test $ac_cv_type_socklen_t = no; then
810 AC_DEFINE(socklen_t, int)
813 dnl Check for needed libraries
814 AC_CHECK_LIB(nsl, main)
815 AC_CHECK_LIB(socket, main)
817 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
818 echo "skipping libmalloc check (--enable-dlmalloc specified)"
820 AC_CHECK_LIB(gnumalloc, main)
821 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
822 echo "Disabling extended malloc functions when using gnumalloc"
823 ac_cv_func_mallinfo=no
824 ac_cv_func_mallocblksize=no
825 ac_cv_func_mallopt=no
829 echo "skipping libmalloc check for $host"
832 echo "skipping libmalloc check for $host"
836 AC_CHECK_LIB(malloc, main)
842 AC_CHECK_LIB(bsd, main)
843 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
844 AC_CHECK_LIB(bind, gethostbyname)
845 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
848 echo "skipping libresolv checks for $host"
851 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
852 AC_CHECK_LIB(resolv, main)
856 AC_CHECK_LIB(m, main)
858 dnl Check for libcrypt
859 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
860 AC_CHECK_LIB(crypt, crypt)
861 if test $ac_cv_lib_crypt_crypt = "yes"; then
866 dnl Check for pthreads
867 dnl We use pthreads when doing ASYNC I/O
868 AC_CHECK_LIB(pthread, main)
869 if test $ac_cv_lib_pthread_main = "yes"; then
870 PTHREADLIB="-lpthread"
874 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
875 dnl Robert Side <rside@aiinc.bc.ca>
876 dnl Mon, 18 Jan 1999 17:48:00 GMT
879 AC_CHECK_LIB(intl, strftime)
883 dnl System-specific library modifications
887 if test "$GCC" = "yes"; then
888 echo "Removing -O for gcc on $host"
889 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
893 echo "Removing -lsocket for IRIX..."
894 LIBS=`echo $LIBS | sed -e s/-lsocket//`
895 echo "Removing -lnsl for IRIX..."
896 LIBS=`echo $LIBS | sed -e s/-lnsl//`
897 echo "Removing -lbsd for IRIX..."
898 LIBS=`echo $LIBS | sed -e s/-lbsd//`
900 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
901 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
902 dnl Please change your configure script. AIX doesn't need -lbsd.
904 echo "Removing -lbsd for AIX..."
905 LIBS=`echo $LIBS | sed -e s/-lbsd//`
906 dnl From: mlaster@metavillage.com (Mike Laster)
907 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
908 dnl So using the internal versions generates a load of warnings
910 echo "disabling snprintf/vsnprintf for $host"
911 ac_cv_func_snprintf=no
912 ac_cv_func_vsnprintf=no
915 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
916 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
918 [*-*-solaris2.[0-4]])
919 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
921 [*-sony-newsos[56]*])
922 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
926 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
929 if test `uname -v` = "2.03"; then
930 echo "disabling mallinfo for $host"
931 ac_cv_func_mallinfo=no
936 dnl This has to be before AC_CHECK_FUNCS
937 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
938 # when running configure.
939 if test -z "$ac_cv_func_poll"; then
942 # John Kay (jkay@nlanr.net) 19970818
943 echo "disabling poll for $host..."
948 echo "disabling poll for $host..."
952 # Henrik Nordstrom (hno@hem.passagen.se) 19980817
953 # poll is problematic on Linux. We disable it
954 # by default until Linux gets it right.
955 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
956 if test $rev -lt 002002; then
957 echo "disabling poll for $host < 2.2..."
961 [powerpc-ibm-aix4.1.*])
962 # Mike Laster (mlaster@metavillage.com) 19981021
963 echo "disabling poll for $host..."
967 # Robert Side <rside@aiinc.bc.ca>
968 # Mon, 18 Jan 1999 17:48:00 GMT
969 echo "disabling poll for $host..."
975 dnl Check for library functions
1016 if test "$async_io" = "yes" ; then
1018 pthread_attr_setscope \
1019 pthread_setschedparam \
1020 pthread_attr_setschedparam \
1024 dnl Yay! Another Linux brokenness. Its not good enough
1025 dnl to know that setresuid() exists, because RedHat 5.0 declares
1026 dnl setresuid() but doesn't implement it.
1028 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
1032 if(setresuid(-1,-1,-1)) {
1033 perror("setresuid:");
1038 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
1040 if test "$ac_cv_func_setresuid" = "yes" ; then
1041 AC_DEFINE(HAVE_SETRESUID)
1044 dnl IP-Filter support requires ipf header files. These aren't
1045 dnl installed by default, so we need to check for them
1046 if test "$IPF_TRANSPARENT" ; then
1047 AC_MSG_CHECKING(if IP-Filter header files are installed)
1048 if test "$ac_cv_header_ip_compat_h" = "yes" &&
1049 test "$ac_cv_header_ip_fil_h" = "yes" &&
1050 test "$ac_cv_header_ip_nat_h" = "yes" ; then
1051 IPF_TRANSPARENT="yes"
1052 AC_DEFINE(IPF_TRANSPARENT, 1)
1053 elif test "$ac_cv_header_netinet_ip_compat_h" = "yes" &&
1054 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
1055 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
1056 IPF_TRANSPARENT="yes"
1057 AC_DEFINE(IPF_TRANSPARENT, 1)
1059 IPF_TRANSPARENT="no"
1060 AC_DEFINE(IPF_TRANSPARENT, 0)
1062 AC_MSG_RESULT($IPF_TRANSPARENT)
1064 if test "$IPF_TRANSPARENT" = "no" ; then
1065 echo "WARNING: Cannot find necessary IP-Filter header files"
1066 echo " Transparent Proxy support WILL NOT be enabled"
1070 if test -z "$USE_GNUREGEX" ; then
1072 *-sun-solaris2.[[0-4]])
1080 AC_MSG_CHECKING(if GNUregex needs to be compiled)
1081 if test -z "$USE_GNUREGEX"; then
1082 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
1085 AC_TRY_COMPILE([#include <sys/types.h>
1086 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
1091 AC_MSG_RESULT($USE_GNUREGEX)
1092 if test "$USE_GNUREGEX" = "yes"; then
1094 LIBREGEX="libregex.a"
1095 AC_DEFINE(USE_GNUREGEX)
1106 dnl Not cached since people are likely to tune this
1107 AC_MSG_CHECKING(Default FD_SETSIZE value)
1116 #include <sys/time.h>
1118 #if HAVE_SYS_SELECT_H
1119 #include <sys/select.h>
1121 #if HAVE_SYS_TYPES_H
1122 #include <sys/types.h>
1125 FILE *fp = fopen("conftestval", "w");
1126 fprintf (fp, "%d\n", FD_SETSIZE);
1130 DEFAULT_FD_SETSIZE=`cat conftestval`,
1131 DEFAULT_FD_SETSIZE=256,
1132 DEFAULT_FD_SETSIZE=256)
1133 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
1134 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
1136 dnl Not cached since people are likely to tune this
1137 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
1138 dnl damn! FreeBSD's pthreads breaks dup2().
1141 i386-unknown-freebsd*)
1142 if echo "$LDFLAGS" | grep -q pthread; then
1143 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
1149 #include <sys/time.h> /* needed on FreeBSD */
1150 #include <sys/param.h>
1151 #include <sys/resource.h>
1156 /* getrlimit and sysconf returns bogous values on cygwin32.
1157 * Number of fds is virtually unlimited in cygwin (sys/param.h)
1160 #elif HAVE_SETRLIMIT
1162 #if defined(RLIMIT_NOFILE)
1163 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
1164 perror("getrlimit: RLIMIT_NOFILE");
1166 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1167 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
1168 perror("setrlimit: RLIMIT_NOFILE");
1171 #elif defined(RLIMIT_OFILE)
1172 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
1173 perror("getrlimit: RLIMIT_OFILE");
1175 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1176 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
1177 perror("setrlimit: RLIMIT_OFILE");
1180 #endif /* RLIMIT_NOFILE */
1181 #endif /* HAVE_SETRLIMIT */
1182 /* by starting at 2^14, we will never get higher
1183 than 2^15 for SQUID_MAXFD */
1187 if (dup2(0, i) < 0) {
1195 fp = fopen("conftestval", "w");
1196 fprintf (fp, "%d\n", i);
1200 SQUID_MAXFD=`cat conftestval`,
1203 AC_MSG_RESULT($SQUID_MAXFD)
1204 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD)
1205 if test "$SQUID_MAXFD" -lt 512 ; then
1206 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
1207 echo " cache will be very busy. Please see the FAQ page"
1208 echo " http://squid.nlanr.net/Squid/FAQ/FAQ-11.html#filedescriptors"
1209 echo " on how to increase your filedescriptor limit"
1214 dnl Not cached since people are likely to tune this
1215 AC_MSG_CHECKING(Default UDP send buffer size)
1219 #include <sys/types.h>
1220 #include <sys/socket.h>
1221 #include <netinet/in.h>
1225 int fd,val=0,len=sizeof(int);
1226 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
1227 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
1228 if (val<=0) exit(1);
1229 fp = fopen("conftestval", "w");
1230 fprintf (fp, "%d\n", val);
1234 SQUID_UDP_SO_SNDBUF=`cat conftestval`,
1235 SQUID_UDP_SO_SNDBUF=16384,
1236 SQUID_UDP_SO_SNDBUF=16384)
1237 AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF)
1238 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF)
1240 dnl Not cached since people are likely to tune this
1241 AC_MSG_CHECKING(Default UDP receive buffer size)
1245 #include <sys/types.h>
1246 #include <sys/socket.h>
1247 #include <netinet/in.h>
1251 int fd,val=0,len=sizeof(int);
1252 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
1253 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1254 if (val <= 0) exit(1);
1255 fp = fopen("conftestval", "w");
1256 fprintf (fp, "%d\n", val);
1260 SQUID_UDP_SO_RCVBUF=`cat conftestval`,
1261 SQUID_UDP_SO_RCVBUF=16384,
1262 SQUID_UDP_SO_RCVBUF=16384)
1263 AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF)
1264 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF)
1266 dnl Not cached since people are likely to tune this
1267 AC_MSG_CHECKING(Default TCP send buffer size)
1271 #include <sys/types.h>
1272 #include <sys/socket.h>
1273 #include <netinet/in.h>
1277 int fd,val=0,len=sizeof(int);
1278 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1279 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
1280 if (val <= 0) exit(1);
1281 fp = fopen("conftestval", "w");
1282 fprintf (fp, "%d\n", val);
1286 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1287 SQUID_TCP_SO_SNDBUF=16384,
1288 SQUID_TCP_SO_SNDBUF=16384)
1289 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
1290 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF)
1292 dnl Not cached since people are likely to tune this
1293 AC_MSG_CHECKING(Default TCP receive buffer size)
1297 #include <sys/types.h>
1298 #include <sys/socket.h>
1299 #include <netinet/in.h>
1303 int fd,val=0,len=sizeof(int);
1304 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1305 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1306 if (val <= 0) exit(1);
1307 fp = fopen("conftestval", "w");
1308 fprintf (fp, "%d\n", val);
1312 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1313 SQUID_TCP_SO_RCVBUF=16384,
1314 SQUID_TCP_SO_RCVBUF=16384)
1315 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
1316 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF)
1318 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
1319 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
1320 ac_cv_needs_sys_errlist="no",
1321 ac_cv_needs_sys_errlist="yes")
1323 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
1324 AC_DEFINE(NEED_SYS_ERRLIST)
1327 dnl Not cached since people are likely to change this
1328 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
1329 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
1331 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)],
1334 AC_MSG_CHECKING(if inet_ntoa() actually works)
1338 #include <sys/types.h>
1339 #include <netinet/in.h>
1340 #include <arpa/inet.h>
1345 in.s_addr = inet_addr("1.2.3.4");
1346 fp = fopen("conftestval", "w");
1347 fprintf (fp, "%s\n", inet_ntoa(in));
1351 INET_NTOA_RESULT=`cat conftestval`,
1352 INET_NTOA_RESULT="broken",
1353 INET_NTOA_RESULT="broken")
1354 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
1355 AC_MSG_RESULT("yes")
1358 echo "Will use our own inet_ntoa()."
1359 LIBOBJS="$LIBOBJS inet_ntoa.o"
1360 # echo "WARNING: This looks bad, and probably prevents Squid from working."
1361 # echo " If you're on IRIX and using GCC 2.8, you probably need"
1362 # echo " to use the IRIX C compiler instead."
1366 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
1367 AC_MSG_CHECKING(for working statvfs() interface)
1371 #include <sys/types.h>
1372 #include <sys/statvfs.h>
1376 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
1377 sfs.f_files = sfs.f_ffree = 0;
1378 statvfs("/tmp", &sfs);
1380 ac_cv_func_statvfs=yes,
1381 ac_cv_func_statvfs=no)
1382 AC_MSG_RESULT($ac_cv_func_statvfs)
1383 if test "$ac_cv_func_statvfs" = "yes" ; then
1384 AC_DEFINE(HAVE_STATVFS)
1388 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
1390 #if HAVE_SYS_TYPES_H
1391 #include <sys/types.h>
1393 #if HAVE_NETINET_IN_H
1394 #include <netinet/in.h>
1396 #if HAVE_ARPA_INET_H
1397 #include <arpa/inet.h>
1399 #if HAVE_ARPA_NAMESER_H
1400 #include <arpa/nameser.h>
1406 [_res.nsaddr_list[[0]];],
1407 ac_cv_have_res_nsaddr_list="yes",
1408 ac_cv_have_res_nsaddr_list="no"))
1409 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
1410 AC_DEFINE(HAVE_RES_NSADDR_LIST)
1413 if test $ac_cv_have_res_nsaddr_list = "no" ; then
1414 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
1416 #if HAVE_SYS_TYPES_H
1417 #include <sys/types.h>
1419 #if HAVE_NETINET_IN_H
1420 #include <netinet/in.h>
1422 #if HAVE_ARPA_INET_H
1423 #include <arpa/inet.h>
1425 #if HAVE_ARPA_NAMESER_H
1426 #include <arpa/nameser.h>
1432 [_res.ns_list[[0]].addr;],
1433 ac_cv_have_res_ns_list="yes",
1434 ac_cv_have_res_ns_list="no"))
1435 if test $ac_cv_have_res_ns_list = "yes" ; then
1436 AC_DEFINE(HAVE_RES_NS_LIST)
1440 dnl Need the debugging version of malloc if available
1442 if test "$ac_cv_lib_malloc_main" = "yes" ; then
1443 if test -r /usr/lib/debug/malloc.o ; then
1444 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
1446 if test -r /usr/lib/debug/mallocmap.o ; then
1447 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
1453 if test -z "$XTRA_LIBS"; then
1455 dnl -lcrypt is set in CRYPTLIB
1456 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lcrypt//"`
1457 dnl -lpthread is set in PTHREADLIB
1458 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lpthread//"`
1460 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
1465 dnl Clean up after OSF/1 core dump bug
1471 ./include/config.h \
1472 ./scripts/Makefile \
1473 ./scripts/RunCache \
1474 ./scripts/RunAccel \
1476 ./contrib/Makefile \
1480 ./auth_modules/dummy \
1481 ./auth_modules/NCSA/Makefile \
1482 ./auth_modules/PAM/Makefile \
1483 ./auth_modules/SMB/Makefile
1484 ./auth_modules/getpwnam/Makefile \
1485 ./auth_modules/LDAP/Makefile \