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.186 2000/05/03 17:15:39 adrian Exp $
11 AC_CONFIG_HEADER(include/autoconf.h)
12 AC_REVISION($Revision: 1.186 $)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 -mips3 -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 -mips3 -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]
242 --with-aio-threads=N_THREADS
244 --enable-storeio=ufs,aufs],
248 STORE_MODULES="ufs aufs"
253 async_io_threads=$enableval
255 STORE_MODULES="ufs aufs"
260 AC_ARG_WITH(aio-threads,
261 [ --with-aio-threads=N_THREADS
262 Tune the number of worker threads for the aufs object
264 [ async_io_threads=$withval ])
265 if test "$async_io_threads"; then
266 echo "With $async_io_threads AIO threads"
268 AC_DEFINE_UNQUOTED(ASYNC_IO_THREADS,$async_io_threads)
271 AC_ARG_WITH(pthreads,
272 [ --with-pthreads Use POSIX Threads],
273 [ if test "$enableval" = "yes"; then
277 if test "$with_pthreads"; then
279 SQUID_PTHREAD_LIB='$(PTHREADLIB)'
280 CFLAGS="$CFLAGS -D_REENTRANT"
282 i386-unknown-freebsd*)
283 if test "$GCC" = "yes" ; then
284 if test -z "$PRESET_LDFLAGS"; then
285 LDFLAGS="$LDFLAGS -pthread"
291 AC_SUBST(SQUID_PTHREAD_LIB)
293 AC_ARG_ENABLE(storeio,
294 [ --enable-storeio=\"list of modules\"
295 Build support for the list of store I/O modules.
296 The default is only to build the "ufs" module.
297 See src/fs for a list of available modules, or
298 Programmers Guide section <not yet written>
299 for details on how to build your custom store module],
302 for module in $srcdir/src/fs/*; do
303 if test -f $module/Makefile.in; then
304 STORE_MODULES="$STORE_MODULES `basename $module`"
310 *) STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
314 [ if test -z "$STORE_MODULES"; then
318 echo "Store moules built: $STORE_MODULES"
319 AC_SUBST(STORE_MODULES)
320 STORE_OBJS="fs/`echo $STORE_MODULES|sed -e's% %.a fs/%g'`.a"
324 [ --enable-icmp Enable ICMP pinging],
325 [ if test "$enableval" = "yes" ; then
331 AC_ARG_ENABLE(delay_pools,
332 [ --enable-delay-pools Enable delay pools to limit bandwith usage],
333 [ if test "$enableval" = "yes" ; then
334 echo "Delay pools enabled"
335 DELAY_OBJS='$(DELAY_OBJS)'
336 AC_DEFINE(DELAY_POOLS)
341 AC_ARG_ENABLE(mem-gen-trace,
342 [ --enable-mem-gen-trace Do trace of memory stuff],
343 [ if test "$enableval" = "yes" ; then
344 echo "Memory trace (to file) enabled"
345 AC_DEFINE(MEM_GEN_TRACE)
349 AC_ARG_ENABLE(useragent_log,
350 [ --enable-useragent-log Enable logging of User-Agent header],
351 [ if test "$enableval" = "yes" ; then
352 echo "User-Agent logging enabled"
353 AC_DEFINE(USE_USERAGENT_LOG)
358 [ --disable-wccp Disable Web Cache Coordination Protocol],
359 [ if test "$enableval" = "no" ; then
360 echo "Web Cache Coordination Protocol disabled"
361 AC_DEFINE(USE_WCCP, 0)
363 AC_DEFINE(USE_WCCP, 1)
367 AC_ARG_ENABLE(kill_parent_hack,
368 [ --enable-kill-parent-hack
369 Kill parent on shutdown],
370 [ if test "$enableval" = "yes" ; then
371 echo "Kill parent on shutdown"
372 AC_DEFINE(KILL_PARENT_OPT)
377 [ --enable-snmp Enable SNMP monitoring],
378 [ if test "$enableval" = "yes" ; then
379 echo "SNMP monitoring enabled"
380 AC_DEFINE(SQUID_SNMP)
381 SNMPLIB='-L../snmplib -lsnmp'
382 SNMP_OBJS='$(SNMP_OBJS)'
383 SNMP_MAKEFILE=./snmplib/Makefile
389 AC_SUBST(makesnmplib)
391 AC_ARG_ENABLE(time_hack,
392 [ --enable-time-hack Update internal timestamp only once per second],
393 [ if test "$enableval" = "yes" ; then
394 echo "Update internal timestamp only once per second"
395 AC_DEFINE(ALARM_UPDATES_TIME)
399 AC_ARG_ENABLE(cachemgr_hostname,
400 [ --enable-cachemgr-hostname[=hostname]
401 Make cachemgr.cgi default to this host],
404 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()])
405 echo "Cachemgr default hostname == host where cachemgr runs"
411 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
412 echo "Cachemgr default hostname set to ${enableval}"
417 AC_ARG_ENABLE(arp_acl,
418 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
419 [ if test "$enableval" = "yes" ; then
420 echo "ARP ACL lists enabled (ether address)"
425 echo "WARNING: ARP ACL support is only currently supported on Linux"
426 echo " ethernet interfaces, probably won't work on $host."
430 AC_DEFINE(USE_ARP_ACL)
435 [ --enable-htcp Enable HTCP protocol],
436 [ if test "$enableval" = "yes" ; then
438 HTCP_OBJS='$(HTCP_OBJS)'
444 AC_ARG_ENABLE(forw-via-db,
445 [ --enable-forw-via-db Enable Forw/Via database],
446 [ if test "$enableval" = "yes" ; then
447 echo "FORW-VIA enabled"
448 AC_DEFINE(FORW_VIA_DB)
452 AC_ARG_ENABLE(cache-digests,
453 [ --enable-cache-digests Use Cache Digests
454 see http://squid.nlanr.net/Squid/FAQ/FAQ-16.html],
455 [ if test "$enableval" = "yes" ; then
456 echo "USE_CACHE_DIGESTS enabled"
457 AC_DEFINE(USE_CACHE_DIGESTS)
461 dnl Select Error language
462 AC_ARG_ENABLE(err-language,
463 [ --enable-err-language=lang
464 Select language for Error pages (see errors dir) ],
466 if test -d errors/$enableval; then
467 ERR_LANGUAGE=$enableval
469 echo "ERROR! Unknown language $enableval, see errors/"
472 ],[ERR_LANGUAGE="English"])
473 AC_SUBST(ERR_LANGUAGE)
475 dnl Size of COSS memory buffer
476 AC_ARG_WITH(coss-membuf-size,
477 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
478 [ if test "$with_coss_membuf_size"; then
479 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
480 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size)
486 [ --enable-poll Enable poll() instead of select(). Normally poll
487 is preferred over select, but configure knows poll
488 is broken on some platforms. If you think you are
489 smarter than the configure script, you may enable
490 poll with this option.
491 --disable-poll Disable the use of poll().],
495 echo "Forcing poll() to be enabled"
496 ac_cv_func_poll='yes'
499 echo "Forcing poll() to be disabled"
505 dnl Disable HTTP violations
506 AC_ARG_ENABLE(http-violations,
507 [ --disable-http-violations
508 This allows you to remove code which is known to
509 violate the HTTP protocol specification.],
510 [ if test "$enableval" = "no" ; then
511 echo "Disabling HTTP Violations"
512 AC_DEFINE(HTTP_VIOLATIONS, 0)
514 AC_DEFINE(HTTP_VIOLATIONS, 1)
518 dnl Enable IP-Filter Transparent Proxy
519 AC_ARG_ENABLE(ipf-transparent,
520 [ --enable-ipf-transparent
521 Enable Transparent Proxy support for systems
522 using IP-Filter network address redirection.],
523 [ if test "$enableval" = "yes" ; then
524 echo "IP-Filter Transparent Proxy enabled"
525 AC_DEFINE(IPF_TRANSPARENT)
526 IPF_TRANSPARENT="yes"
530 dnl Enable Leak Finding Functions
531 AC_ARG_ENABLE(leakfinder,
532 [ --enable-leakfinder
533 Enable Leak Finding code. Enabling this alone
534 does nothing; you also have to modify the source
535 code to use the leak finding functions. Probably
536 Useful for hackers only.],
537 [ if test "$enableval" = "yes" ; then
538 echo "Leak-Finding enabled"
539 AC_DEFINE(USE_LEAKFINDER)
540 LEAKFINDER_OBJS='$(LEAKFINDER_OBJS)'
544 AC_SUBST(LEAKFINDER_OBJS)
546 dnl Disable HTTP violations
547 AC_ARG_ENABLE(ident-lookups,
548 [ --disable-ident-lookups
549 This allows you to remove code that performs
550 Ident (RFC 931) lookups.],
551 [ if test "$enableval" = "no" ; then
552 echo "Disabling Ident Lookups"
553 AC_DEFINE(USE_IDENT, 0)
555 AC_DEFINE(USE_IDENT, 1)
559 AC_ARG_ENABLE(internal-dns,
560 [ --disable-internal-dns This prevents Squid from directly sending and
561 receiving DNS messages, and instead enables the
562 old external 'dnsserver' processes.],
563 [ if test "$enableval" = "no" ; then
564 echo "Disabling Internal DNS queries"
565 AC_DEFINE(USE_DNSSERVERS, 1)
567 AC_DEFINE(USE_DNSSERVERS, 0)
571 AC_ARG_ENABLE(truncate,
572 [ --enable-truncate This uses truncate() instead of unlink() when
573 removing cache files. Truncate gives a little
574 performance improvement, but may cause problems
575 when used with async I/O. Truncate uses more
576 filesystem inodes than unlink..],
577 [ if test "$enableval" = "yes" ; then
578 echo "Enabling truncate instead of unlink"
579 AC_DEFINE(USE_TRUNCATE)
583 dnl Enable underscore in hostnames
584 AC_ARG_ENABLE(underscores,
585 [ --enable-underscores Squid by default rejects any host names with _
586 in their name to conform with internet standars.
587 If you disagree with this you may allow _ in
588 hostnames by using this switch, provided that
589 the resolver library on the host where Squid runs
590 does not reject _ in hostnames...],
591 [ if test "$enableval" = "yes" ; then
592 echo "Enabling the use of underscores in host names"
593 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1)
597 dnl Enable HEAP_REPLACEMENT
598 AC_ARG_ENABLE(heap-replacement,
599 [ --enable-heap-replacement
600 This option allows you to use various cache
601 replacement algorithms, instead of the standard
603 [ if test "$enableval" = "yes" ; then
604 echo "Enabling HEAP_REPLACEMENT"
605 AC_DEFINE(HEAP_REPLACEMENT, 1)
609 dnl Select auth modules to build
611 AC_ARG_ENABLE(auth-modules,
612 [ --enable-auth-modules=\"list of modules\"
613 This option selects wich proxy_auth helper modules
614 to build and install as part of the normal build
615 process. For a list of available modules see
616 the auth_modules directory.],
617 [ case "$enableval" in
619 for module in $srcdir/auth_modules/*; do
620 if test -f $module/Makefile.in; then
621 AUTH_MODULES="$AUTH_MODULES `basename $module`"
628 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
631 if test -n "$AUTH_MODULES"; then
632 echo "Auth moules built: $AUTH_MODULES"
634 AC_SUBST(AUTH_MODULES)
636 # Force some compilers to use ANSI features
640 if test "$ac_cv_prog_CC" = "cc" ; then
641 echo "adding '-std1' to cc args for $host"
647 if test "$ac_cv_prog_CC" = "cc" ; then
648 echo "adding '-Ae' to cc args for $host"
655 dnl Check for programs
660 AC_PATH_PROG(SH, sh, /bin/sh)
661 AC_PATH_PROG(FALSE, false, /usr/bin/false)
662 AC_PATH_PROG(TRUE, true, /usr/bin/true)
663 AC_PATH_PROG(RM, rm, $FALSE)
664 AC_PATH_PROG(MV, mv, $FALSE)
665 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
666 AC_PATH_PROG(LN, ln, cp)
667 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
668 AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
669 AC_PATH_PROG(AR, ar, $FALSE)
673 echo "Disabling 'ranlib' for HP-UX..."
687 dnl Check for headers
718 netinet/ip_compat.h \
759 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
760 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
762 ac_cv_have_ansi_prototypes="yes",
763 ac_cv_have_ansi_prototypes="no")
765 if test $ac_cv_have_ansi_prototypes = "yes" ; then
766 AC_DEFINE(HAVE_ANSI_PROTOTYPES)
769 AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [
770 AC_TRY_COMPILE([#include <time.h>
771 #include <sys/time.h>],
774 ac_cv_have_tm_gmoff="yes",
775 ac_cv_have_tm_gmoff="no")
777 if test $ac_cv_have_tm_gmoff = "yes" ; then
778 AC_DEFINE(HAVE_TM_GMTOFF)
781 AC_CACHE_CHECK(for struct mallinfo,ac_cv_have_struct_mallinfo, [
782 AC_TRY_COMPILE([#include <sys/types.h>
786 [struct mallinfo foo;
795 ac_cv_have_struct_mallinfo="yes",
796 ac_cv_have_struct_mallinfo="no")
798 if test $ac_cv_have_struct_mallinfo = "yes" ; then
799 AC_DEFINE(HAVE_STRUCT_MALLINFO)
802 AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [
803 AC_TRY_COMPILE([#include <sys/types.h>
804 #include <malloc.h>],
805 [struct mallinfo foo;
807 ac_cv_have_ext_mallinfo="yes",
808 ac_cv_have_ext_mallinfo="no")
810 if test $ac_cv_have_ext_mallinfo = "yes" ; then
811 AC_DEFINE(HAVE_EXT_MALLINFO)
814 AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [
817 #include <sys/time.h>
819 #if HAVE_SYS_RESOURCE_H
820 #include <sys/resource.h>
823 ac_cv_have_struct_rusage="yes",
824 ac_cv_have_struct_rusage="no")
826 if test $ac_cv_have_struct_rusage = "yes" ; then
827 AC_DEFINE(HAVE_STRUCT_RUSAGE)
830 AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [
831 AC_TRY_COMPILE([#include <sys/types.h>
832 #include <netinet/in.h>
833 #include <netinet/in_systm.h>
834 #include <netinet/ip.h>
843 ac_cv_have_ip_hl="yes",
844 ac_cv_have_ip_hl="no")
846 if test $ac_cv_have_ip_hl = "yes" ; then
847 AC_DEFINE(HAVE_IP_HL)
850 dnl Check for typedefs
852 AC_CHECK_SIZEOF(long)
853 AC_CHECK_SIZEOF(void *)
855 dnl Check for special functions
858 AC_CHECK_TYPE(pid_t, int)
859 AC_CHECK_TYPE(size_t, unsigned int)
860 AC_CHECK_TYPE(ssize_t, int)
861 AC_CHECK_TYPE(off_t, int)
862 AC_CHECK_TYPE(mode_t, u_short)
863 AC_CHECK_TYPE(fd_mask, int)
864 AC_CHECK_TYPE(mtyp_t, long)
866 dnl Check for type in sys/socket.h
867 AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
868 AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
869 #include <sys/socket.h>
874 ac_cv_type_socklen_t=yes,
875 ac_cv_type_socklen_t=no)
877 if test $ac_cv_type_socklen_t = no; then
878 AC_DEFINE(socklen_t, int)
881 dnl Check for needed libraries
882 AC_CHECK_LIB(nsl, main)
883 AC_CHECK_LIB(socket, main)
885 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
886 echo "skipping libmalloc check (--enable-dlmalloc specified)"
888 AC_CHECK_LIB(gnumalloc, main)
889 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
890 echo "Disabling extended malloc functions when using gnumalloc"
891 ac_cv_func_mallinfo=no
892 ac_cv_func_mallocblksize=no
893 ac_cv_func_mallopt=no
897 echo "skipping libmalloc check for $host"
900 echo "skipping libmalloc check for $host"
904 AC_CHECK_LIB(malloc, main)
910 AC_CHECK_LIB(bsd, main)
911 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
912 AC_CHECK_LIB(bind, gethostbyname)
913 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
916 echo "skipping libresolv checks for $host"
919 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
920 AC_CHECK_LIB(resolv, main)
924 AC_CHECK_LIB(m, main)
926 dnl Check for libcrypt
927 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
928 AC_CHECK_LIB(crypt, crypt)
929 if test $ac_cv_lib_crypt_crypt = "yes"; then
934 dnl Check for pthreads
935 dnl We use pthreads when doing ASYNC I/O
936 AC_CHECK_LIB(pthread, main)
937 if test $ac_cv_lib_pthread_main = "yes"; then
938 PTHREADLIB="-lpthread"
942 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
943 dnl Robert Side <rside@aiinc.bc.ca>
944 dnl Mon, 18 Jan 1999 17:48:00 GMT
947 AC_CHECK_LIB(intl, strftime)
951 dnl System-specific library modifications
955 if test "$GCC" = "yes"; then
956 echo "Removing -O for gcc on $host"
957 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
961 echo "Removing -lsocket for IRIX..."
962 LIBS=`echo $LIBS | sed -e s/-lsocket//`
963 echo "Removing -lnsl for IRIX..."
964 LIBS=`echo $LIBS | sed -e s/-lnsl//`
965 ac_cv_lib_nsl_main=no
966 echo "Removing -lbsd for IRIX..."
967 LIBS=`echo $LIBS | sed -e s/-lbsd//`
969 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
970 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
971 dnl Please change your configure script. AIX doesn't need -lbsd.
973 echo "Removing -lbsd for AIX..."
974 LIBS=`echo $LIBS | sed -e s/-lbsd//`
975 dnl From: mlaster@metavillage.com (Mike Laster)
976 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
977 dnl So using the internal versions generates a load of warnings
979 echo "disabling snprintf/vsnprintf for $host"
980 ac_cv_func_snprintf=no
981 ac_cv_func_vsnprintf=no
984 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
985 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
987 [*-*-solaris2.[0-4]])
988 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
990 [*-sony-newsos[56]*])
991 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
995 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
998 if test `uname -v` = "2.03"; then
999 echo "disabling mallinfo for $host"
1000 ac_cv_func_mallinfo=no
1005 dnl This has to be before AC_CHECK_FUNCS
1006 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
1007 # when running configure.
1008 if test -z "$ac_cv_func_poll"; then
1011 # John Kay (jkay@nlanr.net) 19970818
1012 echo "disabling poll for $host..."
1013 ac_cv_func_poll='no'
1017 echo "disabling poll for $host..."
1018 ac_cv_func_poll='no'
1021 # Henrik Nordstrom (hno@hem.passagen.se) 19980817
1022 # poll is problematic on Linux. We disable it
1023 # by default until Linux gets it right.
1024 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
1025 if test $rev -lt 002002; then
1026 echo "disabling poll for $host < 2.2..."
1027 ac_cv_func_poll='no'
1030 [powerpc-ibm-aix4.1.*])
1031 # Mike Laster (mlaster@metavillage.com) 19981021
1032 echo "disabling poll for $host..."
1033 ac_cv_func_poll='no'
1036 # Robert Side <rside@aiinc.bc.ca>
1037 # Mon, 18 Jan 1999 17:48:00 GMT
1038 echo "disabling poll for $host..."
1039 ac_cv_func_poll='no'
1044 dnl Check for library functions
1063 pthread_attr_setscope \
1064 pthread_setschedparam \
1065 pthread_attr_setschedparam \
1090 dnl Yay! Another Linux brokenness. Its not good enough
1091 dnl to know that setresuid() exists, because RedHat 5.0 declares
1092 dnl setresuid() but doesn't implement it.
1094 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
1098 if(setresuid(-1,-1,-1)) {
1099 perror("setresuid:");
1104 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
1106 if test "$ac_cv_func_setresuid" = "yes" ; then
1107 AC_DEFINE(HAVE_SETRESUID)
1110 dnl IP-Filter support requires ipf header files. These aren't
1111 dnl installed by default, so we need to check for them
1112 if test "$IPF_TRANSPARENT" ; then
1113 AC_MSG_CHECKING(if IP-Filter header files are installed)
1114 if test "$ac_cv_header_ip_compat_h" = "yes" &&
1115 test "$ac_cv_header_ip_fil_h" = "yes" &&
1116 test "$ac_cv_header_ip_nat_h" = "yes" ; then
1117 IPF_TRANSPARENT="yes"
1118 AC_DEFINE(IPF_TRANSPARENT, 1)
1119 elif test "$ac_cv_header_netinet_ip_compat_h" = "yes" &&
1120 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
1121 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
1122 IPF_TRANSPARENT="yes"
1123 AC_DEFINE(IPF_TRANSPARENT, 1)
1125 IPF_TRANSPARENT="no"
1126 AC_DEFINE(IPF_TRANSPARENT, 0)
1128 AC_MSG_RESULT($IPF_TRANSPARENT)
1130 if test "$IPF_TRANSPARENT" = "no" ; then
1131 echo "WARNING: Cannot find necessary IP-Filter header files"
1132 echo " Transparent Proxy support WILL NOT be enabled"
1136 if test -z "$USE_GNUREGEX" ; then
1138 *-sun-solaris2.[[0-4]])
1146 AC_MSG_CHECKING(if GNUregex needs to be compiled)
1147 if test -z "$USE_GNUREGEX"; then
1148 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
1151 AC_TRY_COMPILE([#include <sys/types.h>
1152 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
1157 AC_MSG_RESULT($USE_GNUREGEX)
1158 if test "$USE_GNUREGEX" = "yes"; then
1160 LIBREGEX="libregex.a"
1161 AC_DEFINE(USE_GNUREGEX)
1172 dnl Not cached since people are likely to tune this
1173 AC_MSG_CHECKING(Default FD_SETSIZE value)
1182 #include <sys/time.h>
1184 #if HAVE_SYS_SELECT_H
1185 #include <sys/select.h>
1187 #if HAVE_SYS_TYPES_H
1188 #include <sys/types.h>
1191 FILE *fp = fopen("conftestval", "w");
1192 fprintf (fp, "%d\n", FD_SETSIZE);
1196 DEFAULT_FD_SETSIZE=`cat conftestval`,
1197 DEFAULT_FD_SETSIZE=256,
1198 DEFAULT_FD_SETSIZE=256)
1199 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
1200 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
1202 dnl Not cached since people are likely to tune this
1203 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
1204 dnl damn! FreeBSD's pthreads breaks dup2().
1207 i386-unknown-freebsd*)
1208 if echo "$LDFLAGS" | grep -q pthread; then
1209 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
1215 #include <sys/time.h> /* needed on FreeBSD */
1216 #include <sys/param.h>
1217 #include <sys/resource.h>
1222 /* getrlimit and sysconf returns bogous values on cygwin32.
1223 * Number of fds is virtually unlimited in cygwin (sys/param.h)
1226 #elif HAVE_SETRLIMIT
1228 #if defined(RLIMIT_NOFILE)
1229 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
1230 perror("getrlimit: RLIMIT_NOFILE");
1232 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1233 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
1234 perror("setrlimit: RLIMIT_NOFILE");
1237 #elif defined(RLIMIT_OFILE)
1238 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
1239 perror("getrlimit: RLIMIT_OFILE");
1241 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1242 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
1243 perror("setrlimit: RLIMIT_OFILE");
1246 #endif /* RLIMIT_NOFILE */
1247 #endif /* HAVE_SETRLIMIT */
1248 /* by starting at 2^14, we will never get higher
1249 than 2^15 for SQUID_MAXFD */
1253 if (dup2(0, i) < 0) {
1261 fp = fopen("conftestval", "w");
1262 fprintf (fp, "%d\n", i);
1266 SQUID_MAXFD=`cat conftestval`,
1269 AC_MSG_RESULT($SQUID_MAXFD)
1270 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD)
1271 if test "$SQUID_MAXFD" -lt 512 ; then
1272 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
1273 echo " cache will be very busy. Please see the FAQ page"
1274 echo " http://squid.nlanr.net/Squid/FAQ/FAQ-11.html#filedescriptors"
1275 echo " on how to increase your filedescriptor limit"
1280 dnl Not cached since people are likely to tune this
1281 AC_MSG_CHECKING(Default UDP send buffer size)
1285 #include <sys/types.h>
1286 #include <sys/socket.h>
1287 #include <netinet/in.h>
1291 int fd,val=0,len=sizeof(int);
1292 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
1293 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
1294 if (val<=0) exit(1);
1295 fp = fopen("conftestval", "w");
1296 fprintf (fp, "%d\n", val);
1300 SQUID_UDP_SO_SNDBUF=`cat conftestval`,
1301 SQUID_UDP_SO_SNDBUF=16384,
1302 SQUID_UDP_SO_SNDBUF=16384)
1303 AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF)
1304 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF)
1306 dnl Not cached since people are likely to tune this
1307 AC_MSG_CHECKING(Default UDP receive buffer size)
1311 #include <sys/types.h>
1312 #include <sys/socket.h>
1313 #include <netinet/in.h>
1317 int fd,val=0,len=sizeof(int);
1318 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
1319 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1320 if (val <= 0) exit(1);
1321 fp = fopen("conftestval", "w");
1322 fprintf (fp, "%d\n", val);
1326 SQUID_UDP_SO_RCVBUF=`cat conftestval`,
1327 SQUID_UDP_SO_RCVBUF=16384,
1328 SQUID_UDP_SO_RCVBUF=16384)
1329 AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF)
1330 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF)
1332 dnl Not cached since people are likely to tune this
1333 AC_MSG_CHECKING(Default TCP send buffer size)
1337 #include <sys/types.h>
1338 #include <sys/socket.h>
1339 #include <netinet/in.h>
1343 int fd,val=0,len=sizeof(int);
1344 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1345 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
1346 if (val <= 0) exit(1);
1347 fp = fopen("conftestval", "w");
1348 fprintf (fp, "%d\n", val);
1352 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1353 SQUID_TCP_SO_SNDBUF=16384,
1354 SQUID_TCP_SO_SNDBUF=16384)
1355 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
1356 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF)
1358 dnl Not cached since people are likely to tune this
1359 AC_MSG_CHECKING(Default TCP receive buffer size)
1363 #include <sys/types.h>
1364 #include <sys/socket.h>
1365 #include <netinet/in.h>
1369 int fd,val=0,len=sizeof(int);
1370 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1371 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1372 if (val <= 0) exit(1);
1373 fp = fopen("conftestval", "w");
1374 fprintf (fp, "%d\n", val);
1378 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1379 SQUID_TCP_SO_RCVBUF=16384,
1380 SQUID_TCP_SO_RCVBUF=16384)
1381 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
1382 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF)
1384 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
1385 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
1386 ac_cv_needs_sys_errlist="no",
1387 ac_cv_needs_sys_errlist="yes")
1389 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
1390 AC_DEFINE(NEED_SYS_ERRLIST)
1393 dnl Not cached since people are likely to change this
1394 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
1395 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
1397 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)],
1400 AC_MSG_CHECKING(if inet_ntoa() actually works)
1404 #include <sys/types.h>
1405 #include <netinet/in.h>
1406 #include <arpa/inet.h>
1411 in.s_addr = inet_addr("1.2.3.4");
1412 fp = fopen("conftestval", "w");
1413 fprintf (fp, "%s\n", inet_ntoa(in));
1417 INET_NTOA_RESULT=`cat conftestval`,
1418 INET_NTOA_RESULT="broken",
1419 INET_NTOA_RESULT="broken")
1420 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
1421 AC_MSG_RESULT("yes")
1424 echo "Will use our own inet_ntoa()."
1425 LIBOBJS="$LIBOBJS inet_ntoa.o"
1426 # echo "WARNING: This looks bad, and probably prevents Squid from working."
1427 # echo " If you're on IRIX and using GCC 2.8, you probably need"
1428 # echo " to use the IRIX C compiler instead."
1432 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
1433 AC_MSG_CHECKING(for working statvfs() interface)
1437 #include <sys/types.h>
1438 #include <sys/statvfs.h>
1442 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
1443 sfs.f_files = sfs.f_ffree = 0;
1444 statvfs("/tmp", &sfs);
1446 ac_cv_func_statvfs=yes,
1447 ac_cv_func_statvfs=no)
1448 AC_MSG_RESULT($ac_cv_func_statvfs)
1449 if test "$ac_cv_func_statvfs" = "yes" ; then
1450 AC_DEFINE(HAVE_STATVFS)
1454 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
1456 #if HAVE_SYS_TYPES_H
1457 #include <sys/types.h>
1459 #if HAVE_NETINET_IN_H
1460 #include <netinet/in.h>
1462 #if HAVE_ARPA_INET_H
1463 #include <arpa/inet.h>
1465 #if HAVE_ARPA_NAMESER_H
1466 #include <arpa/nameser.h>
1472 [_res.nsaddr_list[[0]];],
1473 ac_cv_have_res_nsaddr_list="yes",
1474 ac_cv_have_res_nsaddr_list="no"))
1475 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
1476 AC_DEFINE(HAVE_RES_NSADDR_LIST)
1479 if test $ac_cv_have_res_nsaddr_list = "no" ; then
1480 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
1482 #if HAVE_SYS_TYPES_H
1483 #include <sys/types.h>
1485 #if HAVE_NETINET_IN_H
1486 #include <netinet/in.h>
1488 #if HAVE_ARPA_INET_H
1489 #include <arpa/inet.h>
1491 #if HAVE_ARPA_NAMESER_H
1492 #include <arpa/nameser.h>
1498 [_res.ns_list[[0]].addr;],
1499 ac_cv_have_res_ns_list="yes",
1500 ac_cv_have_res_ns_list="no"))
1501 if test $ac_cv_have_res_ns_list = "yes" ; then
1502 AC_DEFINE(HAVE_RES_NS_LIST)
1506 dnl Need the debugging version of malloc if available
1508 if test "$ac_cv_lib_malloc_main" = "yes" ; then
1509 if test -r /usr/lib/debug/malloc.o ; then
1510 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
1512 if test -r /usr/lib/debug/mallocmap.o ; then
1513 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
1519 if test -z "$XTRA_LIBS"; then
1521 dnl -lcrypt is set in CRYPTLIB
1522 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lcrypt//"`
1523 dnl -lpthread is set in PTHREADLIB
1524 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lpthread//"`
1526 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
1531 dnl Clean up after OSF/1 core dump bug
1537 ./include/config.h \
1538 ./scripts/Makefile \
1539 ./scripts/RunCache \
1540 ./scripts/RunAccel \
1543 ./src/fs/ufs/Makefile \
1544 ./src/fs/aufs/Makefile \
1545 ./src/fs/coss/Makefile \
1546 ./src/fs/diskd/Makefile \
1547 ./contrib/Makefile \
1551 ./auth_modules/Makefile \
1552 ./auth_modules/NCSA/Makefile \
1553 ./auth_modules/PAM/Makefile \
1554 ./auth_modules/SMB/Makefile \
1555 ./auth_modules/MSNT/Makefile \
1556 ./auth_modules/getpwnam/Makefile \
1557 ./auth_modules/LDAP/Makefile \