]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
update
[thirdparty/squid.git] / configure.in
CommitLineData
090089c4 1dnl
2877b8a9 2dnl Configuration input file for Squid
090089c4 3dnl
983061ed 4dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
090089c4 5dnl
b54a6789 6dnl $Id: configure.in,v 1.90 1998/01/02 18:04:21 wessels Exp $
090089c4 7dnl
8dnl
090089c4 9dnl
a26bdc75 10AC_INIT(src/main.c)
090089c4 11AC_CONFIG_HEADER(include/autoconf.h)
b54a6789 12AC_REVISION($Revision: 1.90 $)dnl
2877b8a9 13AC_PREFIX_DEFAULT(/usr/local/squid)
da22ac20 14AC_CONFIG_AUX_DIR(aux)
090089c4 15
88d50a22 16AC_CANONICAL_HOST
17
26675bf4 18CRYPTLIB=''
00fa2c12 19REGEXLIB='' # -lregex
20LIBREGEX='' # libregex.a
090089c4 21
983061ed 22dnl use directory structure of cached as default (hack)
23if test "$libexecdir" = '${exec_prefix}/libexec'; then
24 libexecdir='${bindir}'
25 localstatedir='${prefix}'
26
27fi
28
a26bdc75 29if test -z "$CACHE_HTTP_PORT"; then
30 CACHE_HTTP_PORT="3128"
31fi
32if test -z "$CACHE_ICP_PORT"; then
33 CACHE_ICP_PORT="3130"
34fi
a26bdc75 35
090089c4 36dnl Subsitutions
a26bdc75 37AC_SUBST(CACHE_HTTP_PORT)
38AC_SUBST(CACHE_ICP_PORT)
090089c4 39
30a4f2a8 40AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host")
41
42dnl Set default LDFLAGS
43if test -z "$LDFLAGS"; then
44 LDFLAGS="-g"
45fi
46
38fea766 47PRESET_CFLAGS="$CFLAGS"
30a4f2a8 48
090089c4 49dnl Check for GNU cc
50AC_PROG_CC
51
52dnl Warn if not using GNU cc
c601f22c 53dnl if test $ac_cv_prog_gcc = no; then
54dnl echo '**************************************************************';
55dnl echo '**************************************************************';
56dnl echo '**';
57dnl echo '** WARNING: Squid is only guaranteed to compile with GNU cc.';
58dnl echo "** Currently, you're using $CC";
59dnl echo '**';
60dnl echo '**************************************************************';
61dnl echo '**************************************************************';
62dnl sleep 5
63dnl fi
090089c4 64
6ad85e8a 65dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
66case "$host" in
67 mab-next-nextstep3)
68 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
69 ;;
70esac
71
30a4f2a8 72dnl Set Default CFLAGS
73if test -z "$PRESET_CFLAGS"; then
74 if test "$GCC" = "yes"; then
75 case "$host" in
76 *-sun-sunos*|*m88k*)
77 # sunos has too many warnings for this to be useful
78 # motorola too
79 ;;
80 *)
81 CFLAGS="$CFLAGS -Wall"
82 ;;
83 esac
84 fi
30a4f2a8 85fi
86
87dnl Set LDFLAGS
88if test -z "$PRESET_LDFLAGS"; then
89 if test "$GCC" = "yes"; then
90 case "$host" in
91 *)
92 # nothing
93 ;;
94 esac
95 fi
96fi
2060fa9a 97
090089c4 98dnl Check for programs
99AC_PROG_CPP
100AC_PROG_INSTALL
101AC_PROG_RANLIB
102AC_PROG_LN_S
81280a96 103AC_PATH_PROG(SH, sh, /bin/sh)
d9f67e6f 104AC_PATH_PROG(FALSE, false, /usr/bin/false)
105AC_PATH_PROG(TRUE, true, /usr/bin/true)
106AC_PATH_PROG(RM, rm, $FALSE)
107AC_PATH_PROG(MV, mv, $FALSE)
108AC_PATH_PROG(MKDIR, mkdir, $FALSE)
090089c4 109AC_PATH_PROG(LN, ln, cp)
983061ed 110AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
d9f67e6f 111AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
6ad85e8a 112AC_PATH_PROG(AR, ar, $FALSE)
113
114case "$host" in
115 *-hp-hpux*)
116 echo "Disabling 'ranlib' for HP-UX..."
117 RANLIB=":"
118 ;;
119esac
120
121dnl set $(AR)
122AR_R="$AR r"
123case "$host" in
124 *-next-nextstep3)
125 AR="libtool -o"
126 ;;
127esac
128AC_SUBST(AR_R)
090089c4 129
130dnl Check for headers
131AC_HEADER_DIRENT
132AC_HEADER_STDC
db40ae20 133
2060fa9a 134
db40ae20 135AC_CHECK_HEADERS( \
136 alloca.h \
137 arpa/inet.h \
30a4f2a8 138 arpa/nameser.h \
9441aa34 139 assert.h \
db40ae20 140 bstring.h \
141 config.h \
142 crypt.h \
30a4f2a8 143 ctype.h \
144 errno.h \
db40ae20 145 fcntl.h \
9c1d8929 146 getopt.h \
88738790 147 gnumalloc.h \
30a4f2a8 148 grp.h \
149 libc.h \
6ad85e8a 150 limits.h \
30a4f2a8 151 malloc.h \
e0bddc45 152 math.h \
db40ae20 153 memory.h \
30a4f2a8 154 netdb.h \
db40ae20 155 netinet/in.h \
30a4f2a8 156 netinet/tcp.h \
dcfe6390 157 poll.h \
30a4f2a8 158 pwd.h \
159 regex.h \
160 resolv.h \
161 signal.h \
162 stdarg.h \
163 stddef.h \
164 stdio.h \
db40ae20 165 stdlib.h \
166 string.h \
167 strings.h \
168 sys/file.h \
30a4f2a8 169 sys/param.h \
170 sys/resource.h \
db40ae20 171 sys/select.h\
30a4f2a8 172 sys/socket.h \
173 sys/stat.h \
174 sys/syscall.h \
db40ae20 175 sys/time.h \
176 sys/types.h \
30a4f2a8 177 sys/un.h \
178 sys/wait.h \
db40ae20 179 syslog.h \
30a4f2a8 180 time.h \
181 unistd.h \
182 varargs.h \
db40ae20 183)
184
aee0606f 185AC_C_CONST
d57288d2 186AC_C_BIGENDIAN
aee0606f 187
5c51415d 188AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
189 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
190 [foo("bar")],
191 ac_cv_have_ansi_prototypes="yes",
192 ac_cv_have_ansi_prototypes="no")
193])
194if test $ac_cv_have_ansi_prototypes = "yes" ; then
195 AC_DEFINE(HAVE_ANSI_PROTOTYPES)
196fi
20a50bb9 197
5c51415d 198AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [
199 AC_TRY_COMPILE([#include <time.h>
46c883ed 200#include <sys/time.h>],
5c51415d 201 [struct tm foo;
202 foo.tm_gmtoff = 0;],
203 ac_cv_have_tm_gmoff="yes",
204 ac_cv_have_tm_gmoff="no")
205])
206if test $ac_cv_have_tm_gmoff = "yes" ; then
207 AC_DEFINE(HAVE_TM_GMTOFF)
208fi
46c883ed 209
5c51415d 210AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [
211 AC_TRY_COMPILE([#include <sys/types.h>
46c883ed 212#include <malloc.h>],
5c51415d 213 [struct mallinfo foo;
214 foo.mxfast = 0;],
215 ac_cv_have_ext_mallinfo="yes",
216 ac_cv_have_ext_mallinfo="no")
217])
218if test $ac_cv_have_ext_mallinfo = "yes" ; then
219 AC_DEFINE(HAVE_EXT_MALLINFO)
220fi
090089c4 221
b54a6789 222AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [
223 AC_TRY_COMPILE([
224#if HAVE_SYS_RESOURCE_H
225#include <sys/resource.h>
226#endif],
227 [struct rusage R;],
228 ac_cv_have_struct_rusage="yes",
229 ac_cv_have_struct_rusage="no")
230])
231if test $ac_cv_have_struct_rusage = "yes" ; then
232 AC_DEFINE(HAVE_STRUCT_RUSAGE)
233fi
234
5c51415d 235AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [
236 AC_TRY_COMPILE([#include <sys/types.h>
a025a745 237#include <netinet/in.h>
238#include <netinet/in_systm.h>
6ad85e8a 239#include <netinet/ip.h>
240#ifdef __linux__
241#define ip_hl ihl
242#endif
243#ifndef __linux__
244#define iphdr ip
245#endif],
5c51415d 246 [struct iphdr ip;
247 ip.ip_hl= 0;],
248 ac_cv_have_ip_hl="yes",
249 ac_cv_have_ip_hl="no")
250])
251if test $ac_cv_have_ip_hl = "yes" ; then
252 AC_DEFINE(HAVE_IP_HL)
253fi
a025a745 254
090089c4 255dnl Check for typedefs
256AC_CHECK_SIZEOF(int)
257AC_CHECK_SIZEOF(long)
258
256cf05b 259dnl Check for special functions
260AC_FUNC_ALLOCA
090089c4 261
3f6fcd8a 262AC_CHECK_TYPE(pid_t, int)
0897af2d 263AC_CHECK_TYPE(size_t, unsigned int)
264AC_CHECK_TYPE(ssize_t, int)
3f6fcd8a 265AC_CHECK_TYPE(off_t, int)
95cf2361 266AC_CHECK_TYPE(mode_t, u_short)
3f6fcd8a 267
090089c4 268dnl Check for needed libraries
30a4f2a8 269AC_CHECK_LIB(nsl, main)
6716b242 270AC_CHECK_LIB(socket, main)
8a15e65e 271AC_CHECK_LIB(gnumalloc, main)
5c51415d 272if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
273 echo "Disabling extended malloc functions when using gnumalloc"
274 ac_cv_func_mallinfo=no
275 ac_cv_func_mallocblksize=no
276 ac_cv_func_mallopt=no
277else
8a15e65e 278 case "$host" in
279 *-sun-solaris*)
280 echo "skipping libmalloc check for $host"
281 ;;
282 i386-*-freebsd*)
283 echo "skipping libmalloc check for $host"
284 ;;
285 *)
286 AC_CHECK_LIB(malloc, main)
287 ;;
288 esac
289fi
6716b242 290AC_CHECK_LIB(bsd, main)
be79ade0 291AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
78743365 292case "$host" in
293 i386-*-freebsd*)
294 echo "skipping libresolv checks for $host"
295 ;;
296 *)
297 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
298 AC_CHECK_LIB(resolv, main)
299 ;;
300esac
e0bddc45 301AC_CHECK_LIB(m, main)
090089c4 302
303dnl Check for libcrypt
b8de7ebe 304dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
be79ade0 305AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
306AC_SUBST(CRYPTLIB)
77f675ad 307
71f8abc8 308dnl Check for libcrypt
309dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
310AC_CHECK_LIB(pthread, main, [PTHREADLIB="-lpthread"])
311AC_SUBST(PTHREADLIB)
312
77f675ad 313dnl System-specific library modifications
314dnl
315case "$host" in
88738790 316 i386-*-solaris2.*)
7149a49f 317 if test "$GCC" = "yes"; then
318 echo "Removing -O for gcc on $host"
80e92d6d 319 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 320 fi
321 ;;
77f675ad 322 *-sgi-irix*)
323 echo "Removing -lsocket for IRIX..."
6716b242 324 LIBS=`echo $LIBS | sed -e s/-lsocket//`
77f675ad 325 echo "Removing -lnsl for IRIX..."
6716b242 326 LIBS=`echo $LIBS | sed -e s/-lnsl//`
b44c0fb4 327 echo "Removing -lbsd for IRIX..."
328 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 329 ;;
4ba0bd0e 330dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
331dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
332dnl Please change your configure script. AIX doesn't need -lbsd.
333 *-ibm-aix*)
334 echo "Removing -lbsd for AIX..."
335 LIBS=`echo $LIBS | sed -e s/-lbsd//`
336 ;;
30a4f2a8 337 *m88k*)
338 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
7149a49f 339 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
340 ;;
580ce039 341 [*-*-solaris2.[0-4]])
7149a49f 342 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
30a4f2a8 343 ;;
77f675ad 344esac
090089c4 345
176d10ee 346# Recommended by Balint Nagy Endre <bne@CareNet.hu>
347case "$host" in
348 *-univel-sysv4.2MP)
349 if test `uname -v` = "2.03"; then
350 echo "disabling mallinfo for $host"
351 ac_cv_func_mallinfo=no
352 fi
353 ;;
354esac
355
356
6716b242 357dnl Check for library functions
358AC_CHECK_FUNCS(\
30a4f2a8 359 bcopy \
4ac29a5b 360 fchmod \
6716b242 361 getdtablesize \
30a4f2a8 362 getrusage \
9c1d8929 363 getspnam \
30a4f2a8 364 lrand48 \
6716b242 365 mallinfo \
0f5efab0 366 mallocblksize \
6716b242 367 mallopt \
2ae6b9b0 368 memcpy \
30a4f2a8 369 memmove \
1812b6c7 370 mktime \
88738790 371 mstats \
dcfe6390 372 poll \
b1e77ec1 373 random \
6716b242 374 regcomp \
375 regexec \
376 regfree \
30a4f2a8 377 res_init \
234967c9 378 seteuid \
30a4f2a8 379 setpgrp \
6716b242 380 setrlimit \
30a4f2a8 381 setsid \
382 sigaction \
11430c03 383 snprintf \
30a4f2a8 384 srand48 \
b1e77ec1 385 srandom \
6716b242 386 sysconf \
387 syslog \
0a3efad5 388 tempnam \
234967c9 389 timegm \
28da5e0d 390 vsnprintf \
6716b242 391)
392
a03233e7 393case "$host" in
394 [alpha-dec-osf3.*])
395 # John Kay (jkay@nlanr.net) 19970818
396 echo "Disabling poll() for $host..."
397 ac_cv_func_poll="no"
398 ;;
399esac
400
60939927 401dnl Yay! Another Linux brokenness. Its not good enough
402dnl to know that setresuid() exists, because RedHat 5.0 declares
403dnl setresuid() but doesn't implement it.
404dnl
405AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
5c51415d 406 AC_TRY_RUN([
60939927 407#include <stdlib.h>
5c51415d 408 int main() {
409 if(setresuid(-1,-1,-1)) {
410 perror("setresuid:");
411 exit(1);
60939927 412 }
413 exit(0);
5c51415d 414 }
415 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
60939927 416)
5c51415d 417if test "$ac_cv_func_setresuid" = "yes" ; then
418 AC_DEFINE(HAVE_SETRESUID)
419fi
60939927 420
5c51415d 421AC_ARG_ENABLE(gnuregex,
422[ --enable-gnuregex Compile GNUregex],
423[USE_GNUREGEX=$enableval])
424
425AC_ARG_ENABLE(hashkey,
426[ --enable-hashkey[=sha|md5]
427 Use hash function as store index, instead of URL],
428[ case "$enableval" in
429 yes|sha)
430 echo "Store key set to SHA"
431 AC_DEFINE(STORE_KEY_SHA)
432 ;;
433 md5)
434 echo "Store key set to MD5"
435 AC_DEFINE(STORE_KEY_MD5)
436 ;;
437 esac
438])
439
440AC_ARG_ENABLE(xmalloc_debug,
109ff6af 441[ --enable-xmalloc-debug Do some simple malloc debugging],
5c51415d 442[ if test "$enableval" = "yes" ; then
443 echo "Malloc debugging enabled"
444 AC_DEFINE(XMALLOC_DEBUG)
445 fi
446])
447
109ff6af 448AC_ARG_ENABLE(xmalloc_debug_count,
449[ --enable-xmalloc-debug-count
450 Detailed trace of memory allocations],
451[ if test "$enableval" = "yes" ; then
452 echo "Malloc tracing enabled"
453 AC_DEFINE(XMALLOC_COUNT)
454 fi
455])
456
5c51415d 457AC_ARG_ENABLE(xmalloc_statistics,
458[ --enable-xmalloc-statistics
459 Show malloc statistics in status page],
460[ if test "$enableval" = "yes" ; then
461 echo "Malloc statistics enabled"
462 AC_DEFINE(XMALLOC_STATISTICS)
463 fi
464])
109ff6af 465
466AC_ARG_ENABLE(async_io,
467[ --enable-async-io Use ASYNC disk I/O],
468[ if test "$enableval" = "yes" ; then
469 echo "Async I/O enabled"
470 AC_DEFINE(USE_ASYNC_IO)
471 fi
472])
473
7a081912 474AC_MSG_CHECKING(if GNUregex needs to be compiled)
00fa2c12 475if test "$ac_cv_func_regcomp" = "no" ; then
74946a0f 476 USE_GNUREGEX="yes"
00fa2c12 477else
74946a0f 478 USE_GNUREGEX="no"
00fa2c12 479fi
480case "$host" in
580ce039 481 [*-sun-solaris2.[0-4]])
74946a0f 482 USE_GNUREGEX="yes"
483 ;;
484 [*-next-nextstep*])
485 USE_GNUREGEX="yes"
486 ;;
00fa2c12 487esac
74946a0f 488AC_MSG_RESULT($USE_GNUREGEX)
489if test "$USE_GNUREGEX" = "yes"; then
26675bf4 490 REGEXLIB="-lregex"
7a081912 491 LIBREGEX="libregex.a"
74946a0f 492 AC_DEFINE(USE_GNUREGEX)
7a081912 493fi
26675bf4 494AC_SUBST(REGEXLIB)
00fa2c12 495AC_SUBST(LIBREGEX)
7a081912 496
3f6fcd8a 497AC_REPLACE_FUNCS(\
498 tempnam \
4d38fc7e 499 strerror \
3f6fcd8a 500)
501
5c51415d 502dnl Not cached since people are likely to tune this
e924600d 503AC_MSG_CHECKING(Default FD_SETSIZE value)
504AC_TRY_RUN([
505#if HAVE_STDIO_H
506#include <stdio.h>
507#endif
508#if HAVE_UNISTD_H
509#include <unistd.h>
510#endif
511#if HAVE_SYS_TIME_H
512#include <sys/time.h>
513#endif
514#if HAVE_SYS_SELECT_H
515#include <sys/select.h>
516#endif
517#if HAVE_SYS_TYPES_H
518#include <sys/types.h>
519#endif
520main() {
521 fprintf (fopen("conftestval", "w"), "%d\n", FD_SETSIZE);
522 exit(0);
523}
524],
525DEFAULT_FD_SETSIZE=`cat conftestval`,
526DEFAULT_FD_SETSIZE=256,
527DEFAULT_FD_SETSIZE=256)
528AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
529AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
530
5c51415d 531dnl Not cached since people are likely to tune this
234967c9 532AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
533AC_TRY_RUN([
8cca06da 534#include <stdio.h>
234967c9 535#include <unistd.h>
30a4f2a8 536#include <sys/time.h> /* needed on FreeBSD */
234967c9 537#include <sys/param.h>
538#include <sys/resource.h>
539main() {
540 int i,j;
541#if HAVE_SETRLIMIT
542 struct rlimit rl;
543#if defined(RLIMIT_NOFILE)
544 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
545 perror("getrlimit: RLIMIT_NOFILE");
546 } else {
547 rl.rlim_cur = rl.rlim_max; /* set it to the max */
548 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
549 perror("setrlimit: RLIMIT_NOFILE");
550 }
551 }
552#elif defined(RLIMIT_OFILE)
553 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
554 perror("getrlimit: RLIMIT_OFILE");
555 } else {
556 rl.rlim_cur = rl.rlim_max; /* set it to the max */
557 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
558 perror("setrlimit: RLIMIT_OFILE");
559 }
560 }
561#endif /* RLIMIT_NOFILE */
562#endif /* HAVE_SETRLIMIT */
563#if HAVE_SYSCONF && defined(_SC_OPEN_MAX)
564 i = sysconf(_SC_OPEN_MAX);
3f6fcd8a 565#elif HAVE_GETDTABLESIZE && !defined(__linux__)
234967c9 566 i = getdtablesize();
567#elif defined(OPEN_MAX)
568 i = OPEN_MAX;
569#elif defined(NOFILE)
570 i = NOFILE;
571#elif defined(_NFILE)
572 i = _NFILE;
573#else
574 while((j=open("/dev/null", 0)) > 0) i=j;
0a5b9b32 575 close(i); close(i-1);
576 i++;
234967c9 577#endif
578 fprintf (fopen("conftestval", "w"), "%d\n", i);
579 exit(0);
580}
581],
431d84c5 582SQUID_MAXFD=`cat conftestval`,
583SQUID_MAXFD=256,
584SQUID_MAXFD=256)
585AC_MSG_RESULT($SQUID_MAXFD)
586AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD)
234967c9 587
5c51415d 588dnl Not cached since people are likely to tune this
30a4f2a8 589AC_MSG_CHECKING(Default UDP send buffer size)
590AC_TRY_RUN([
8cca06da 591#include <stdlib.h>
592#include <stdio.h>
30a4f2a8 593#include <sys/types.h>
594#include <sys/socket.h>
595#include <netinet/in.h>
596main ()
597{
598 int fd,val=0,len=sizeof(int);
599 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
600 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
601 if (val<=0) exit(1);
602 fprintf (fopen("conftestval", "w"), "%d\n", val);
603 exit(0);
604}
605],
606SQUID_UDP_SO_SNDBUF=`cat conftestval`,
1c481e00 607SQUID_UDP_SO_SNDBUF=16384,
608SQUID_UDP_SO_SNDBUF=16384)
30a4f2a8 609AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF)
610AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF)
611
5c51415d 612dnl Not cached since people are likely to tune this
30a4f2a8 613AC_MSG_CHECKING(Default UDP receive buffer size)
614AC_TRY_RUN([
8cca06da 615#include <stdlib.h>
616#include <stdio.h>
30a4f2a8 617#include <sys/types.h>
618#include <sys/socket.h>
619#include <netinet/in.h>
620main ()
621{
622 int fd,val=0,len=sizeof(int);
623 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
624 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
625 if (val <= 0) exit(1);
626 fprintf (fopen("conftestval", "w"), "%d\n", val);
627 exit(0);
628}
629],
630SQUID_UDP_SO_RCVBUF=`cat conftestval`,
1c481e00 631SQUID_UDP_SO_RCVBUF=16384,
632SQUID_UDP_SO_RCVBUF=16384)
30a4f2a8 633AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF)
634AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF)
635
5c51415d 636dnl Not cached since people are likely to tune this
30a4f2a8 637AC_MSG_CHECKING(Default TCP send buffer size)
638AC_TRY_RUN([
8cca06da 639#include <stdlib.h>
640#include <stdio.h>
30a4f2a8 641#include <sys/types.h>
642#include <sys/socket.h>
643#include <netinet/in.h>
644main ()
645{
646 int fd,val=0,len=sizeof(int);
647 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
648 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
649 if (val <= 0) exit(1);
650 fprintf (fopen("conftestval", "w"), "%d\n", val);
651 exit(0);
652}
653],
654SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1c481e00 655SQUID_TCP_SO_SNDBUF=16384,
656SQUID_TCP_SO_SNDBUF=16384)
30a4f2a8 657AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
658AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF)
659
5c51415d 660dnl Not cached since people are likely to tune this
30a4f2a8 661AC_MSG_CHECKING(Default TCP receive buffer size)
662AC_TRY_RUN([
8cca06da 663#include <stdlib.h>
664#include <stdio.h>
30a4f2a8 665#include <sys/types.h>
666#include <sys/socket.h>
667#include <netinet/in.h>
668main ()
669{
670 int fd,val=0,len=sizeof(int);
671 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
672 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
673 if (val <= 0) exit(1);
674 fprintf (fopen("conftestval", "w"), "%d\n", val);
675 exit(0);
676}
677],
678SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1c481e00 679SQUID_TCP_SO_RCVBUF=16384,
680SQUID_TCP_SO_RCVBUF=16384)
30a4f2a8 681AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
682AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF)
683
5c51415d 684AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
685 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist[0];],
686 ac_cv_needs_sys_errlist="no",
687 ac_cv_needs_sys_errlist="yes")
688)
689if test "$ac_cv_needs_sys_errlist" = "yes" ; then
690 AC_DEFINE(NEED_SYS_ERRLIST)
691fi
30a4f2a8 692
5c51415d 693dnl Not cached since people are likely to change this
6bf65235 694AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
695AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
696[AC_MSG_RESULT(yes)
697AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)],
698AC_MSG_RESULT(no))
699
090089c4 700dnl Need the debugging version of malloc if available
701XTRA_OBJS=''
6509a1a0 702if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 703 if test -r /usr/lib/debug/malloc.o ; then
704 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
705 fi
706 if test -r /usr/lib/debug/mallocmap.o ; then
707 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
708 fi
709fi
2bbd722b 710SNMPLIB='libsnmp.a'
711AC_SUBST(SNMPLIB)
712
090089c4 713AC_SUBST(XTRA_OBJS)
714
38fea766 715if test -z "$XTRA_LIBS"; then
716 XTRA_LIBS="$LIBS"
717 LIBS=''
718fi
090089c4 719AC_SUBST(XTRA_LIBS)
720
090089c4 721dnl Clean up after OSF/1 core dump bug
722rm -f core
723
724AC_OUTPUT(\
0992a350 725 ./makefile \
090089c4 726 ./lib/Makefile \
a26bdc75 727 ./include/config.h \
090089c4 728 ./scripts/Makefile \
729 ./scripts/RunCache \
730 ./scripts/RunAccel \
a26bdc75 731 ./src/Makefile \
608cdf33 732 ./src/options.h \
e550e8b6 733 ./contrib/Makefile \
2bbd722b 734 ./snmplib/Makefile \
81280a96 735 ./icons/Makefile \
d4fb069d 736 ./errors/Makefile \
090089c4 737)