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.141 1998/08/18 16:13:56 wessels Exp $
11 AC_CONFIG_HEADER(include/autoconf.h)
12 AC_REVISION($Revision: 1.141 $)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"
93 if test -z "$PRESET_LDFLAGS"; then
94 if test "$GCC" = "yes"; then
103 dnl Enable optional modules
104 AC_ARG_ENABLE(dlmalloc,
105 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
107 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
108 # Ok. dlmalloc was enabled before, but state may be changed.
109 # we have to test these again
110 unset ac_cv_func_mallinfo
111 unset ac_cv_func_mallocblksize
112 unset ac_cv_func_free
113 unset ac_cv_func_realloc
114 unset ac_cv_func_memalign
115 unset ac_cv_func_valloc
116 unset ac_cv_func_pvalloc
117 unset ac_cv_func_calloc
118 unset ac_cv_func_cfree
119 unset ac_cv_func_malloc_trim
120 unset ac_cv_func_malloc_usable_size
121 unset ac_cv_func_malloc_stats
122 unset ac_cv_func_mallinfo
123 unset ac_cv_func_mallopt
124 unset ac_cv_lib_gnumalloc
125 unset ac_cv_lib_malloc
126 unset ac_cv_enabled_dlmalloc
130 LIBDLMALLOC="libdlmalloc.a"
131 LIB_MALLOC="-L../lib -ldlmalloc"
132 ac_cv_func_mallinfo="yes"
133 ac_cv_func_mallocblksize="no"
134 ac_cv_func_free="yes"
135 ac_cv_func_realloc="yes"
136 ac_cv_func_memalign="yes"
137 ac_cv_func_valloc="yes"
138 ac_cv_func_pvalloc="yes"
139 ac_cv_func_calloc="yes"
140 ac_cv_func_cfree="yes"
141 ac_cv_func_malloc_trim="yes"
142 ac_cv_func_malloc_usable_size="yes"
143 ac_cv_func_malloc_stats="yes"
144 ac_cv_func_mallinfo="yes"
145 ac_cv_func_mallopt="yes"
146 ac_cv_lib_gnumalloc="no"
147 ac_cv_lib_malloc="no"
148 ac_cv_enabled_dlmalloc="yes"
149 echo "dlmalloc build enabled"
152 # Disabled explicitly.
153 echo "dlmalloc disabled."
156 # Use already installed dlmalloc library.
157 LIB_MALLOC="${enableval}"
158 ac_cv_func_mallinfo="yes"
159 ac_cv_func_mallocblksize="no"
160 ac_cv_func_free="yes"
161 ac_cv_func_realloc="yes"
162 ac_cv_func_memalign="yes"
163 ac_cv_func_valloc="yes"
164 ac_cv_func_pvalloc="yes"
165 ac_cv_func_calloc="yes"
166 ac_cv_func_cfree="yes"
167 ac_cv_func_malloc_trim="yes"
168 ac_cv_func_malloc_usable_size="yes"
169 ac_cv_func_malloc_stats="yes"
170 ac_cv_func_mallinfo="yes"
171 ac_cv_func_mallopt="yes"
172 ac_cv_lib_gnumalloc="no"
173 ac_cv_lib_malloc="no"
174 ac_cv_enabled_dlmalloc="yes"
175 echo "Use installed dlmalloc."
179 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
180 # Ok. dlmalloc was enabled before, but now disabled.
181 # we have to test these again
182 unset ac_cv_func_mallinfo
183 unset ac_cv_func_mallocblksize
184 unset ac_cv_func_free
185 unset ac_cv_func_realloc
186 unset ac_cv_func_memalign
187 unset ac_cv_func_valloc
188 unset ac_cv_func_pvalloc
189 unset ac_cv_func_calloc
190 unset ac_cv_func_cfree
191 unset ac_cv_func_malloc_trim
192 unset ac_cv_func_malloc_usable_size
193 unset ac_cv_func_malloc_stats
194 unset ac_cv_func_mallinfo
195 unset ac_cv_func_mallopt
196 unset ac_cv_lib_gnumalloc
197 unset ac_cv_lib_malloc
198 unset ac_cv_enabled_dlmalloc
201 AC_SUBST(LIBDLMALLOC)
204 AC_ARG_ENABLE(gnuregex,
205 [ --enable-gnuregex Compile GNUregex],
206 [USE_GNUREGEX=$enableval])
208 AC_ARG_ENABLE(splaytree,
209 [ --enable-splaytree Use SPLAY trees to store ACL lists],
210 [ if test "$enableval" = "yes" ; then
211 echo "ACL lists using SPLAY trees"
212 AC_DEFINE(USE_SPLAY_TREE)
216 AC_ARG_ENABLE(xmalloc_debug,
217 [ --enable-xmalloc-debug Do some simple malloc debugging],
218 [ if test "$enableval" = "yes" ; then
219 echo "Malloc debugging enabled"
220 AC_DEFINE(XMALLOC_DEBUG)
224 AC_ARG_ENABLE(xmalloc_debug_trace,
225 [ --enable-xmalloc-debug-trace
226 Detailed trace of memory allocations],
227 [ if test "$enableval" = "yes" ; then
228 echo "Malloc debug trace enabled"
229 AC_DEFINE(XMALLOC_TRACE)
230 AC_DEFINE(XMALLOC_DEBUG)
234 AC_ARG_ENABLE(xmalloc_statistics,
235 [ --enable-xmalloc-statistics
236 Show malloc statistics in status page],
237 [ if test "$enableval" = "yes" ; then
238 echo "Malloc statistics enabled"
239 AC_DEFINE(XMALLOC_STATISTICS)
244 [ --enable-carp Enable CARP support],
245 [ if test "$enableval" = "yes" ; then
246 echo "CARP support enabled"
251 AC_ARG_ENABLE(async_io,
252 [ --enable-async-io Do ASYNC disk I/O using threads],
253 [ if test "$enableval" = "yes" ; then
254 echo "Async I/O enabled"
255 AC_DEFINE(USE_ASYNC_IO)
256 ASYNC_OBJS='$(ASYNC_OBJS)'
257 SQUID_PTHREAD_LIB='$(PTHREADLIB)'
258 CFLAGS="$CFLAGS -D_REENTRANT"
262 AC_SUBST(SQUID_PTHREAD_LIB)
265 [ --enable-icmp Enable ICMP pinging],
266 [ if test "$enableval" = "yes" ; then
272 AC_ARG_ENABLE(delay_pools,
273 [ --enable-delay-pools Enable delay pools to limit bandwith usage],
274 [ if test "$enableval" = "yes" ; then
275 echo "Delay pools enabled"
276 DELAY_OBJS='$(DELAY_OBJS)'
277 AC_DEFINE(DELAY_POOLS)
282 AC_ARG_ENABLE(mem-gen-trace,
283 [ --enable-mem-gen-trace Do trace of memory stuff],
284 [ if test "$enableval" = "yes" ; then
285 echo "Memory trace (to file) enabled"
286 AC_DEFINE(MEM_GEN_TRACE)
290 AC_ARG_ENABLE(useragent_log,
291 [ --enable-useragent-log Enable logging of User-Agent header],
292 [ if test "$enableval" = "yes" ; then
293 echo "User-Agent logging enabled"
294 AC_DEFINE(USE_USERAGENT_LOG)
298 AC_ARG_ENABLE(kill_parent_hack,
299 [ --enable-kill-parent-hack
300 Kill parent on shutdown],
301 [ if test "$enableval" = "yes" ; then
302 echo "Kill parent on shutdown"
303 AC_DEFINE(KILL_PARENT_OPT)
308 [ --enable-snmp Enable SNMP monitoring],
309 [ if test "$enableval" = "yes" ; then
310 echo "SNMP monitoring enabled"
311 AC_DEFINE(SQUID_SNMP)
312 SNMPLIB='-L../snmplib -lsnmp'
313 SNMP_OBJS='$(SNMP_OBJS)'
314 SNMP_MAKEFILE=./snmplib/Makefile
320 AC_SUBST(makesnmplib)
322 AC_ARG_ENABLE(time_hack,
323 [ --enable-time-hack Update internal timestamp only once per second],
324 [ if test "$enableval" = "yes" ; then
325 echo "Update internal timestamp only once per second"
326 AC_DEFINE(ALARM_UPDATES_TIME)
330 AC_ARG_ENABLE(cachemgr_hostname,
331 [ --enable-cachemgr-hostname[=hostname]
332 Make cachemgr.cgi default to this host],
335 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()])
336 echo "Cachemgr default hostname == host where cachemgr runs"
342 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
343 echo "Cachemgr default hostname set to ${enableval}"
348 AC_ARG_ENABLE(arp_acl,
349 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
350 [ if test "$enableval" = "yes" ; then
351 echo "ARP ACL lists enabled (ether address)"
358 echo "WARNING: ARP ACL support is designed for FreeBSD and Linux;"
359 echo " it probably wont work on your $host system"
363 AC_DEFINE(USE_ARP_ACL)
368 [ --enable-htpc Enable HTCP protocol],
369 [ if test "$enableval" = "yes" ; then
371 HTCP_OBJS='$(HTCP_OBJS)'
377 AC_ARG_ENABLE(forw-via-db,
378 [ --enable-forw-via-db Enable Forw/Via database],
379 [ if test "$enableval" = "yes" ; then
380 echo "FORW-VIA enabled"
381 AC_DEFINE(FORW_VIA_DB)
385 AC_ARG_ENABLE(cache-digests,
386 [ --enable-cache-digests Use Cache Digests
387 see http://squid.nlanr.net/Squid/FAQ/FAQ-16.html],
388 [ if test "$enableval" = "yes" ; then
389 echo "USE_CACHE_DIGESTS enabled"
390 AC_DEFINE(USE_CACHE_DIGESTS)
394 dnl Select Error language
395 AC_ARG_ENABLE(err-language,
396 [ --enable-err-language=lang
397 Select language for Error pages (see errors dir) ],
399 if test -d errors/$enableval; then
400 ERR_LANGUAGE=$enableval
402 echo "ERROR! Unknown language $enableval, see errors/"
405 ],[ERR_LANGUAGE="English"])
406 AC_SUBST(ERR_LANGUAGE)
410 [ --enable-poll Enable poll() instead of select(). Normally poll
411 is preferred over select, but configure knows poll
412 is broken on some platforms. If you think you are
413 smarter than the configure script, you may enable
414 poll with this option.
416 [ if test "$enableval" = "yes" ; then
417 echo "Forcing poll() to be enabled"
418 ac_cv_func_poll='yes'
422 # Force some compilers to use ANSI features
426 if test "$ac_cv_prog_CC" = "cc" ; then
427 echo "adding '-std1' to cc args for $host"
434 dnl Check for programs
439 AC_PATH_PROG(SH, sh, /bin/sh)
440 AC_PATH_PROG(FALSE, false, /usr/bin/false)
441 AC_PATH_PROG(TRUE, true, /usr/bin/true)
442 AC_PATH_PROG(RM, rm, $FALSE)
443 AC_PATH_PROG(MV, mv, $FALSE)
444 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
445 AC_PATH_PROG(LN, ln, cp)
446 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
447 AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
448 AC_PATH_PROG(AR, ar, $FALSE)
452 echo "Disabling 'ranlib' for HP-UX..."
466 dnl Check for headers
523 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
524 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
526 ac_cv_have_ansi_prototypes="yes",
527 ac_cv_have_ansi_prototypes="no")
529 if test $ac_cv_have_ansi_prototypes = "yes" ; then
530 AC_DEFINE(HAVE_ANSI_PROTOTYPES)
533 AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [
534 AC_TRY_COMPILE([#include <time.h>
535 #include <sys/time.h>],
538 ac_cv_have_tm_gmoff="yes",
539 ac_cv_have_tm_gmoff="no")
541 if test $ac_cv_have_tm_gmoff = "yes" ; then
542 AC_DEFINE(HAVE_TM_GMTOFF)
545 AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [
546 AC_TRY_COMPILE([#include <sys/types.h>
547 #include <malloc.h>],
548 [struct mallinfo foo;
550 ac_cv_have_ext_mallinfo="yes",
551 ac_cv_have_ext_mallinfo="no")
553 if test $ac_cv_have_ext_mallinfo = "yes" ; then
554 AC_DEFINE(HAVE_EXT_MALLINFO)
557 AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [
560 #include <sys/time.h>
562 #if HAVE_SYS_RESOURCE_H
563 #include <sys/resource.h>
566 ac_cv_have_struct_rusage="yes",
567 ac_cv_have_struct_rusage="no")
569 if test $ac_cv_have_struct_rusage = "yes" ; then
570 AC_DEFINE(HAVE_STRUCT_RUSAGE)
573 AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [
574 AC_TRY_COMPILE([#include <sys/types.h>
575 #include <netinet/in.h>
576 #include <netinet/in_systm.h>
577 #include <netinet/ip.h>
586 ac_cv_have_ip_hl="yes",
587 ac_cv_have_ip_hl="no")
589 if test $ac_cv_have_ip_hl = "yes" ; then
590 AC_DEFINE(HAVE_IP_HL)
593 dnl Check for typedefs
595 AC_CHECK_SIZEOF(long)
597 dnl Check for special functions
600 AC_CHECK_TYPE(pid_t, int)
601 AC_CHECK_TYPE(size_t, unsigned int)
602 AC_CHECK_TYPE(ssize_t, int)
603 AC_CHECK_TYPE(off_t, int)
604 AC_CHECK_TYPE(mode_t, u_short)
606 dnl Check for needed libraries
607 AC_CHECK_LIB(nsl, main)
608 AC_CHECK_LIB(socket, main)
610 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
611 echo "skipping libmalloc check (--enable-dlmalloc specified)"
613 AC_CHECK_LIB(gnumalloc, main)
614 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
615 echo "Disabling extended malloc functions when using gnumalloc"
616 ac_cv_func_mallinfo=no
617 ac_cv_func_mallocblksize=no
618 ac_cv_func_mallopt=no
622 echo "skipping libmalloc check for $host"
625 echo "skipping libmalloc check for $host"
629 AC_CHECK_LIB(malloc, main)
635 AC_CHECK_LIB(bsd, main)
636 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
639 echo "skipping libresolv checks for $host"
642 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
643 AC_CHECK_LIB(resolv, main)
646 AC_CHECK_LIB(m, main)
648 dnl Check for libcrypt
649 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
650 AC_CHECK_LIB(crypt, crypt)
651 if test $ac_cv_lib_crypt_crypt = "yes"; then
656 dnl Check for pthreads
657 dnl We use pthreads when doing ASYNC I/O
658 AC_CHECK_LIB(pthread, main)
659 if test $ac_cv_lib_pthread_main = "yes"; then
660 PTHREADLIB="-lpthread"
664 dnl System-specific library modifications
668 if test "$GCC" = "yes"; then
669 echo "Removing -O for gcc on $host"
670 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
674 echo "Removing -lsocket for IRIX..."
675 LIBS=`echo $LIBS | sed -e s/-lsocket//`
676 echo "Removing -lnsl for IRIX..."
677 LIBS=`echo $LIBS | sed -e s/-lnsl//`
678 echo "Removing -lbsd for IRIX..."
679 LIBS=`echo $LIBS | sed -e s/-lbsd//`
681 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
682 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
683 dnl Please change your configure script. AIX doesn't need -lbsd.
685 echo "Removing -lbsd for AIX..."
686 LIBS=`echo $LIBS | sed -e s/-lbsd//`
689 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
690 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
692 [*-*-solaris2.[0-4]])
693 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
696 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
700 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
703 if test `uname -v` = "2.03"; then
704 echo "disabling mallinfo for $host"
705 ac_cv_func_mallinfo=no
710 dnl This has to be before AC_CHECK_FUNCS
711 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
712 # when running configure.
713 if test -z "$ac_cv_func_poll"; then
716 # John Kay (jkay@nlanr.net) 19970818
717 echo "disabling poll for $host..."
722 echo "disabling poll for $host..."
726 # Henrik Nordstrom (hno@hem.passagen.se) 19980817
727 # poll is problematic on Linux. We disable it
728 # by default until Linux gets it right.
729 echo "disabling poll for $host..."
735 dnl Check for library functions
775 dnl Yay! Another Linux brokenness. Its not good enough
776 dnl to know that setresuid() exists, because RedHat 5.0 declares
777 dnl setresuid() but doesn't implement it.
779 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
783 if(setresuid(-1,-1,-1)) {
784 perror("setresuid:");
789 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
791 if test "$ac_cv_func_setresuid" = "yes" ; then
792 AC_DEFINE(HAVE_SETRESUID)
795 if test -z "$USE_GNUREGEX" ; then
797 *-sun-solaris2.[[0-4]])
805 AC_MSG_CHECKING(if GNUregex needs to be compiled)
806 if test -z "$USE_GNUREGEX"; then
807 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
810 AC_TRY_COMPILE([#include <sys/types.h>
811 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
816 AC_MSG_RESULT($USE_GNUREGEX)
817 if test "$USE_GNUREGEX" = "yes"; then
819 LIBREGEX="libregex.a"
820 AC_DEFINE(USE_GNUREGEX)
830 dnl Not cached since people are likely to tune this
831 AC_MSG_CHECKING(Default FD_SETSIZE value)
840 #include <sys/time.h>
842 #if HAVE_SYS_SELECT_H
843 #include <sys/select.h>
846 #include <sys/types.h>
849 fprintf (fopen("conftestval", "w"), "%d\n", FD_SETSIZE);
853 DEFAULT_FD_SETSIZE=`cat conftestval`,
854 DEFAULT_FD_SETSIZE=256,
855 DEFAULT_FD_SETSIZE=256)
856 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
857 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
859 dnl Not cached since people are likely to tune this
860 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
864 #include <sys/time.h> /* needed on FreeBSD */
865 #include <sys/param.h>
866 #include <sys/resource.h>
870 /* getrlimit and sysconf returns bogous values on cygwin32.
871 * Number of fds is virtually unlimited in cygwin (sys/param.h)
877 #if defined(RLIMIT_NOFILE)
878 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
879 perror("getrlimit: RLIMIT_NOFILE");
881 rl.rlim_cur = rl.rlim_max; /* set it to the max */
882 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
883 perror("setrlimit: RLIMIT_NOFILE");
886 #elif defined(RLIMIT_OFILE)
887 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
888 perror("getrlimit: RLIMIT_OFILE");
890 rl.rlim_cur = rl.rlim_max; /* set it to the max */
891 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
892 perror("setrlimit: RLIMIT_OFILE");
895 #endif /* RLIMIT_NOFILE */
896 #endif /* HAVE_SETRLIMIT */
897 #if HAVE_SYSCONF && defined(_SC_OPEN_MAX)
898 i = sysconf(_SC_OPEN_MAX);
899 #elif HAVE_GETDTABLESIZE && !defined(__linux__)
901 #elif defined(OPEN_MAX)
903 #elif defined(NOFILE)
905 #elif defined(_NFILE)
908 while((j=open("/dev/null", 0)) > 0) i=j;
909 close(i); close(i-1);
912 #endif /* __CYGWIN32__ */
913 fprintf (fopen("conftestval", "w"), "%d\n", i);
917 SQUID_MAXFD=`cat conftestval`,
920 AC_MSG_RESULT($SQUID_MAXFD)
921 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD)
922 if test "$SQUID_MAXFD" -lt 512 ; then
923 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
924 echo " cache will be very busy. Please see the FAQ page"
925 echo " http://squid.nlanr.net/Squid/FAQ/FAQ-11.html#filedescriptors"
926 echo " on how to increase your filedescriptor limit"
930 dnl Not cached since people are likely to tune this
931 AC_MSG_CHECKING(Default UDP send buffer size)
935 #include <sys/types.h>
936 #include <sys/socket.h>
937 #include <netinet/in.h>
940 int fd,val=0,len=sizeof(int);
941 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
942 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
944 fprintf (fopen("conftestval", "w"), "%d\n", val);
948 SQUID_UDP_SO_SNDBUF=`cat conftestval`,
949 SQUID_UDP_SO_SNDBUF=16384,
950 SQUID_UDP_SO_SNDBUF=16384)
951 AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF)
952 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF)
954 dnl Not cached since people are likely to tune this
955 AC_MSG_CHECKING(Default UDP receive buffer size)
959 #include <sys/types.h>
960 #include <sys/socket.h>
961 #include <netinet/in.h>
964 int fd,val=0,len=sizeof(int);
965 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
966 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
967 if (val <= 0) exit(1);
968 fprintf (fopen("conftestval", "w"), "%d\n", val);
972 SQUID_UDP_SO_RCVBUF=`cat conftestval`,
973 SQUID_UDP_SO_RCVBUF=16384,
974 SQUID_UDP_SO_RCVBUF=16384)
975 AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF)
976 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF)
978 dnl Not cached since people are likely to tune this
979 AC_MSG_CHECKING(Default TCP send buffer size)
983 #include <sys/types.h>
984 #include <sys/socket.h>
985 #include <netinet/in.h>
988 int fd,val=0,len=sizeof(int);
989 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
990 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
991 if (val <= 0) exit(1);
992 fprintf (fopen("conftestval", "w"), "%d\n", val);
996 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
997 SQUID_TCP_SO_SNDBUF=16384,
998 SQUID_TCP_SO_SNDBUF=16384)
999 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
1000 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF)
1002 dnl Not cached since people are likely to tune this
1003 AC_MSG_CHECKING(Default TCP receive buffer size)
1007 #include <sys/types.h>
1008 #include <sys/socket.h>
1009 #include <netinet/in.h>
1012 int fd,val=0,len=sizeof(int);
1013 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1014 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1015 if (val <= 0) exit(1);
1016 fprintf (fopen("conftestval", "w"), "%d\n", val);
1020 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1021 SQUID_TCP_SO_RCVBUF=16384,
1022 SQUID_TCP_SO_RCVBUF=16384)
1023 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
1024 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF)
1026 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
1027 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist[0];],
1028 ac_cv_needs_sys_errlist="no",
1029 ac_cv_needs_sys_errlist="yes")
1031 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
1032 AC_DEFINE(NEED_SYS_ERRLIST)
1035 dnl Not cached since people are likely to change this
1036 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
1037 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
1039 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)],
1042 dnl Need the debugging version of malloc if available
1044 if test "$ac_cv_lib_malloc_main" = "yes" ; then
1045 if test -r /usr/lib/debug/malloc.o ; then
1046 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
1048 if test -r /usr/lib/debug/mallocmap.o ; then
1049 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
1055 if test -z "$XTRA_LIBS"; then
1057 dnl -lcrypt is set in CRYPTLIB
1058 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lcrypt//"`
1059 dnl -lpthread is set in PTHREADLIB
1060 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lpthread//"`
1062 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
1067 dnl Clean up after OSF/1 core dump bug
1073 ./include/config.h \
1074 ./scripts/Makefile \
1075 ./scripts/RunCache \
1076 ./scripts/RunAccel \
1078 ./contrib/Makefile \
1082 ./auth_modules/NCSA/Makefile \