]>
Commit | Line | Data |
---|---|---|
090089c4 | 1 | dnl |
2877b8a9 | 2 | dnl Configuration input file for Squid |
090089c4 | 3 | dnl |
983061ed | 4 | dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) |
090089c4 | 5 | dnl |
b1e77ec1 | 6 | dnl $Id: configure.in,v 1.66 1997/01/20 18:33:48 wessels Exp $ |
090089c4 | 7 | dnl |
8 | dnl | |
090089c4 | 9 | dnl |
a26bdc75 | 10 | AC_INIT(src/main.c) |
090089c4 | 11 | AC_CONFIG_HEADER(include/autoconf.h) |
b1e77ec1 | 12 | AC_REVISION($Revision: 1.66 $)dnl |
2877b8a9 | 13 | AC_PREFIX_DEFAULT(/usr/local/squid) |
da22ac20 | 14 | AC_CONFIG_AUX_DIR(aux) |
090089c4 | 15 | |
88d50a22 | 16 | AC_CANONICAL_HOST |
17 | ||
26675bf4 | 18 | CRYPTLIB='' |
00fa2c12 | 19 | REGEXLIB='' # -lregex |
20 | LIBREGEX='' # libregex.a | |
090089c4 | 21 | |
983061ed | 22 | dnl use directory structure of cached as default (hack) |
23 | if test "$libexecdir" = '${exec_prefix}/libexec'; then | |
24 | libexecdir='${bindir}' | |
25 | localstatedir='${prefix}' | |
26 | ||
27 | fi | |
28 | ||
a26bdc75 | 29 | if test -z "$CACHE_HTTP_PORT"; then |
30 | CACHE_HTTP_PORT="3128" | |
31 | fi | |
32 | if test -z "$CACHE_ICP_PORT"; then | |
33 | CACHE_ICP_PORT="3130" | |
34 | fi | |
a26bdc75 | 35 | |
090089c4 | 36 | dnl Subsitutions |
a26bdc75 | 37 | AC_SUBST(CACHE_HTTP_PORT) |
38 | AC_SUBST(CACHE_ICP_PORT) | |
090089c4 | 39 | |
30a4f2a8 | 40 | AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host") |
41 | ||
42 | dnl Set default LDFLAGS | |
43 | if test -z "$LDFLAGS"; then | |
44 | LDFLAGS="-g" | |
45 | fi | |
46 | ||
38fea766 | 47 | PRESET_CFLAGS="$CFLAGS" |
30a4f2a8 | 48 | |
090089c4 | 49 | dnl Check for GNU cc |
50 | AC_PROG_CC | |
51 | ||
52 | dnl Warn if not using GNU cc | |
ec1b5d74 | 53 | if test $ac_cv_prog_gcc = no; then |
090089c4 | 54 | echo '**************************************************************'; |
55 | echo '**************************************************************'; | |
56 | echo '**'; | |
2877b8a9 | 57 | echo '** WARNING: Squid is only guaranteed to compile with GNU cc.'; |
090089c4 | 58 | echo "** Currently, you're using $CC"; |
e973b94a | 59 | echo '**'; |
090089c4 | 60 | echo '**************************************************************'; |
61 | echo '**************************************************************'; | |
62 | sleep 5 | |
63 | fi | |
64 | ||
30a4f2a8 | 65 | dnl Set Default CFLAGS |
66 | if test -z "$PRESET_CFLAGS"; then | |
67 | if test "$GCC" = "yes"; then | |
68 | case "$host" in | |
69 | *-sun-sunos*|*m88k*) | |
70 | # sunos has too many warnings for this to be useful | |
71 | # motorola too | |
72 | ;; | |
73 | *) | |
74 | CFLAGS="$CFLAGS -Wall" | |
75 | ;; | |
76 | esac | |
77 | fi | |
78 | ||
30a4f2a8 | 79 | case "$host" in |
30a4f2a8 | 80 | *-hp-hpux*) |
81 | echo "Disabling 'ranlib' for HP-UX..." | |
82 | RANLIB=":" | |
83 | ;; | |
84 | esac | |
85 | fi | |
86 | ||
87 | dnl Set LDFLAGS | |
88 | if test -z "$PRESET_LDFLAGS"; then | |
89 | if test "$GCC" = "yes"; then | |
90 | case "$host" in | |
91 | *) | |
92 | # nothing | |
93 | ;; | |
94 | esac | |
95 | fi | |
96 | fi | |
2060fa9a | 97 | |
090089c4 | 98 | dnl Check for programs |
99 | AC_PROG_CPP | |
100 | AC_PROG_INSTALL | |
101 | AC_PROG_RANLIB | |
102 | AC_PROG_LN_S | |
d9f67e6f | 103 | AC_PATH_PROG(FALSE, false, /usr/bin/false) |
104 | AC_PATH_PROG(TRUE, true, /usr/bin/true) | |
105 | AC_PATH_PROG(RM, rm, $FALSE) | |
106 | AC_PATH_PROG(MV, mv, $FALSE) | |
107 | AC_PATH_PROG(MKDIR, mkdir, $FALSE) | |
090089c4 | 108 | AC_PATH_PROG(LN, ln, cp) |
983061ed | 109 | AC_PATH_PROG(PERL, perl, /usr/local/bin/perl) |
d9f67e6f | 110 | AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE) |
090089c4 | 111 | |
090089c4 | 112 | |
113 | dnl Check for headers | |
114 | AC_HEADER_DIRENT | |
115 | AC_HEADER_STDC | |
db40ae20 | 116 | |
2060fa9a | 117 | |
db40ae20 | 118 | AC_CHECK_HEADERS( \ |
119 | alloca.h \ | |
120 | arpa/inet.h \ | |
30a4f2a8 | 121 | arpa/nameser.h \ |
db40ae20 | 122 | bstring.h \ |
123 | config.h \ | |
124 | crypt.h \ | |
30a4f2a8 | 125 | ctype.h \ |
126 | errno.h \ | |
db40ae20 | 127 | fcntl.h \ |
9c1d8929 | 128 | getopt.h \ |
30a4f2a8 | 129 | grp.h \ |
130 | libc.h \ | |
131 | malloc.h \ | |
e0bddc45 | 132 | math.h \ |
db40ae20 | 133 | memory.h \ |
30a4f2a8 | 134 | netdb.h \ |
db40ae20 | 135 | netinet/in.h \ |
30a4f2a8 | 136 | netinet/tcp.h \ |
dcfe6390 | 137 | poll.h \ |
30a4f2a8 | 138 | pwd.h \ |
139 | regex.h \ | |
140 | resolv.h \ | |
46aea673 | 141 | shadow.h \ |
30a4f2a8 | 142 | signal.h \ |
143 | stdarg.h \ | |
144 | stddef.h \ | |
145 | stdio.h \ | |
db40ae20 | 146 | stdlib.h \ |
147 | string.h \ | |
148 | strings.h \ | |
149 | sys/file.h \ | |
30a4f2a8 | 150 | sys/param.h \ |
151 | sys/resource.h \ | |
db40ae20 | 152 | sys/select.h\ |
30a4f2a8 | 153 | sys/socket.h \ |
154 | sys/stat.h \ | |
155 | sys/syscall.h \ | |
db40ae20 | 156 | sys/time.h \ |
157 | sys/types.h \ | |
30a4f2a8 | 158 | sys/un.h \ |
159 | sys/wait.h \ | |
db40ae20 | 160 | syslog.h \ |
30a4f2a8 | 161 | time.h \ |
162 | unistd.h \ | |
163 | varargs.h \ | |
db40ae20 | 164 | ) |
165 | ||
aee0606f | 166 | AC_C_CONST |
167 | ||
20a50bb9 | 168 | AC_MSG_CHECKING(if ANSI prototypes work) |
8cca06da | 169 | AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}], |
170 | [foo("bar")], | |
20a50bb9 | 171 | [AC_DEFINE(HAVE_ANSI_PROTOTYPES) |
172 | AC_MSG_RESULT(yes)], | |
173 | AC_MSG_RESULT(no)) | |
174 | ||
46c883ed | 175 | AC_MSG_CHECKING(for tm->tm_gmtoff) |
176 | AC_TRY_COMPILE([#include <time.h> | |
177 | #include <sys/time.h>], | |
178 | [struct tm foo; | |
179 | foo.tm_gmtoff = 0;], | |
180 | [AC_DEFINE(HAVE_TM_GMTOFF) | |
181 | AC_MSG_RESULT(yes)], | |
182 | AC_MSG_RESULT(no)) | |
183 | ||
184 | AC_MSG_CHECKING(for extended mallinfo) | |
185 | AC_TRY_COMPILE([#include <sys/types.h> | |
186 | #include <malloc.h>], | |
187 | [struct mallinfo foo; | |
188 | foo.mxfast = 0;], | |
189 | [AC_DEFINE(HAVE_EXT_MALLINFO) | |
190 | AC_MSG_RESULT(yes)], | |
191 | AC_MSG_RESULT(no)) | |
090089c4 | 192 | |
a025a745 | 193 | AC_MSG_CHECKING(for ip->ip_hl) |
194 | AC_TRY_COMPILE([#include <sys/types.h> | |
195 | #include <netinet/in.h> | |
196 | #include <netinet/in_systm.h> | |
197 | #include <netinet/ip.h>], | |
198 | [struct ip ip; | |
199 | ip.ip_hl= 0;], | |
200 | [AC_DEFINE(HAVE_IP_HL) | |
201 | AC_MSG_RESULT(yes)], | |
202 | AC_MSG_RESULT(no)) | |
203 | ||
090089c4 | 204 | dnl Check for typedefs |
205 | AC_CHECK_SIZEOF(int) | |
206 | AC_CHECK_SIZEOF(long) | |
207 | ||
256cf05b | 208 | dnl Check for special functions |
209 | AC_FUNC_ALLOCA | |
090089c4 | 210 | |
3f6fcd8a | 211 | AC_CHECK_TYPE(pid_t, int) |
212 | AC_CHECK_TYPE(size_t, int) | |
213 | AC_CHECK_TYPE(off_t, int) | |
95cf2361 | 214 | AC_CHECK_TYPE(mode_t, u_short) |
3f6fcd8a | 215 | |
090089c4 | 216 | dnl Check for needed libraries |
30a4f2a8 | 217 | AC_CHECK_LIB(nsl, main) |
6716b242 | 218 | AC_CHECK_LIB(socket, main) |
8a15e65e | 219 | AC_CHECK_LIB(gnumalloc, main) |
6509a1a0 | 220 | if test "$ac_cv_lib_gnumalloc_main" = "no"; then |
8a15e65e | 221 | case "$host" in |
222 | *-sun-solaris*) | |
223 | echo "skipping libmalloc check for $host" | |
224 | ;; | |
225 | i386-*-freebsd*) | |
226 | echo "skipping libmalloc check for $host" | |
227 | ;; | |
228 | *) | |
229 | AC_CHECK_LIB(malloc, main) | |
230 | ;; | |
231 | esac | |
232 | fi | |
6716b242 | 233 | AC_CHECK_LIB(bsd, main) |
be79ade0 | 234 | AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"]) |
8a15e65e | 235 | AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton)) |
6509a1a0 | 236 | AC_CHECK_LIB(resolv, main) |
e0bddc45 | 237 | AC_CHECK_LIB(m, main) |
090089c4 | 238 | |
239 | dnl Check for libcrypt | |
b8de7ebe | 240 | dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) |
be79ade0 | 241 | AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) |
242 | AC_SUBST(CRYPTLIB) | |
77f675ad | 243 | |
46aea673 | 244 | dnl Check for libshadow which is needed by the shadow password suite |
245 | AC_CHECK_LIB(shadow, main) | |
246 | ||
77f675ad | 247 | dnl System-specific library modifications |
248 | dnl | |
249 | case "$host" in | |
7149a49f | 250 | i386-*-solaris2.?) |
251 | if test "$GCC" = "yes"; then | |
252 | echo "Removing -O for gcc on $host" | |
253 | CFLAGS="`echo $CFLAGS | sed -e s/-O//`" | |
254 | fi | |
255 | ;; | |
77f675ad | 256 | *-sgi-irix*) |
257 | echo "Removing -lsocket for IRIX..." | |
6716b242 | 258 | LIBS=`echo $LIBS | sed -e s/-lsocket//` |
77f675ad | 259 | echo "Removing -lnsl for IRIX..." |
6716b242 | 260 | LIBS=`echo $LIBS | sed -e s/-lnsl//` |
b44c0fb4 | 261 | echo "Removing -lbsd for IRIX..." |
262 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
77f675ad | 263 | ;; |
4ba0bd0e | 264 | dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher) |
265 | dnl Date: Thu, 17 Oct 1996 04:09:30 +0200 | |
266 | dnl Please change your configure script. AIX doesn't need -lbsd. | |
267 | *-ibm-aix*) | |
268 | echo "Removing -lbsd for AIX..." | |
269 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
270 | ;; | |
30a4f2a8 | 271 | *m88k*) |
272 | CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_" | |
7149a49f | 273 | AC_DEFINE(GETTIMEOFDAY_NO_TZP) |
274 | ;; | |
580ce039 | 275 | [*-*-solaris2.[0-4]]) |
7149a49f | 276 | AC_DEFINE(GETTIMEOFDAY_NO_TZP) |
30a4f2a8 | 277 | ;; |
77f675ad | 278 | esac |
090089c4 | 279 | |
176d10ee | 280 | # Recommended by Balint Nagy Endre <bne@CareNet.hu> |
281 | case "$host" in | |
282 | *-univel-sysv4.2MP) | |
283 | if test `uname -v` = "2.03"; then | |
284 | echo "disabling mallinfo for $host" | |
285 | ac_cv_func_mallinfo=no | |
286 | fi | |
287 | ;; | |
288 | esac | |
289 | ||
290 | ||
6716b242 | 291 | dnl Check for library functions |
292 | AC_CHECK_FUNCS(\ | |
30a4f2a8 | 293 | bcopy \ |
4ac29a5b | 294 | fchmod \ |
6716b242 | 295 | getdtablesize \ |
30a4f2a8 | 296 | getrusage \ |
9c1d8929 | 297 | getspnam \ |
30a4f2a8 | 298 | lrand48 \ |
6716b242 | 299 | mallinfo \ |
0f5efab0 | 300 | mallocblksize \ |
6716b242 | 301 | mallopt \ |
2ae6b9b0 | 302 | memcpy \ |
30a4f2a8 | 303 | memmove \ |
1812b6c7 | 304 | mktime \ |
dcfe6390 | 305 | poll \ |
b7c1b13c | 306 | pw_encrypt \ |
b1e77ec1 | 307 | random \ |
6716b242 | 308 | regcomp \ |
309 | regexec \ | |
310 | regfree \ | |
30a4f2a8 | 311 | res_init \ |
234967c9 | 312 | seteuid \ |
30a4f2a8 | 313 | setpgrp \ |
234967c9 | 314 | setresuid \ |
6716b242 | 315 | setrlimit \ |
30a4f2a8 | 316 | setsid \ |
317 | sigaction \ | |
30a4f2a8 | 318 | srand48 \ |
b1e77ec1 | 319 | srandom \ |
0f5efab0 | 320 | strerror \ |
6716b242 | 321 | sysconf \ |
322 | syslog \ | |
0a3efad5 | 323 | tempnam \ |
234967c9 | 324 | timegm \ |
6716b242 | 325 | ) |
326 | ||
7a081912 | 327 | AC_MSG_CHECKING(if GNUregex needs to be compiled) |
00fa2c12 | 328 | if test "$ac_cv_func_regcomp" = "no" ; then |
74946a0f | 329 | USE_GNUREGEX="yes" |
00fa2c12 | 330 | else |
74946a0f | 331 | USE_GNUREGEX="no" |
00fa2c12 | 332 | fi |
333 | case "$host" in | |
580ce039 | 334 | [*-sun-solaris2.[0-4]]) |
74946a0f | 335 | USE_GNUREGEX="yes" |
336 | ;; | |
337 | [*-next-nextstep*]) | |
338 | USE_GNUREGEX="yes" | |
339 | ;; | |
00fa2c12 | 340 | esac |
74946a0f | 341 | AC_MSG_RESULT($USE_GNUREGEX) |
342 | if test "$USE_GNUREGEX" = "yes"; then | |
26675bf4 | 343 | REGEXLIB="-lregex" |
7a081912 | 344 | LIBREGEX="libregex.a" |
74946a0f | 345 | AC_DEFINE(USE_GNUREGEX) |
7a081912 | 346 | fi |
26675bf4 | 347 | AC_SUBST(REGEXLIB) |
00fa2c12 | 348 | AC_SUBST(LIBREGEX) |
7a081912 | 349 | |
3f6fcd8a | 350 | AC_REPLACE_FUNCS(\ |
351 | tempnam \ | |
352 | ) | |
353 | ||
234967c9 | 354 | AC_MSG_CHECKING(Maximum number of filedescriptors we can open) |
355 | AC_TRY_RUN([ | |
8cca06da | 356 | #include <stdio.h> |
234967c9 | 357 | #include <unistd.h> |
30a4f2a8 | 358 | #include <sys/time.h> /* needed on FreeBSD */ |
234967c9 | 359 | #include <sys/param.h> |
360 | #include <sys/resource.h> | |
361 | main() { | |
362 | int i,j; | |
363 | #if HAVE_SETRLIMIT | |
364 | struct rlimit rl; | |
365 | #if defined(RLIMIT_NOFILE) | |
366 | if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { | |
367 | perror("getrlimit: RLIMIT_NOFILE"); | |
368 | } else { | |
369 | rl.rlim_cur = rl.rlim_max; /* set it to the max */ | |
370 | if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { | |
371 | perror("setrlimit: RLIMIT_NOFILE"); | |
372 | } | |
373 | } | |
374 | #elif defined(RLIMIT_OFILE) | |
375 | if (getrlimit(RLIMIT_OFILE, &rl) < 0) { | |
376 | perror("getrlimit: RLIMIT_OFILE"); | |
377 | } else { | |
378 | rl.rlim_cur = rl.rlim_max; /* set it to the max */ | |
379 | if (setrlimit(RLIMIT_OFILE, &rl) < 0) { | |
380 | perror("setrlimit: RLIMIT_OFILE"); | |
381 | } | |
382 | } | |
383 | #endif /* RLIMIT_NOFILE */ | |
384 | #endif /* HAVE_SETRLIMIT */ | |
385 | #if HAVE_SYSCONF && defined(_SC_OPEN_MAX) | |
386 | i = sysconf(_SC_OPEN_MAX); | |
3f6fcd8a | 387 | #elif HAVE_GETDTABLESIZE && !defined(__linux__) |
234967c9 | 388 | i = getdtablesize(); |
389 | #elif defined(OPEN_MAX) | |
390 | i = OPEN_MAX; | |
391 | #elif defined(NOFILE) | |
392 | i = NOFILE; | |
393 | #elif defined(_NFILE) | |
394 | i = _NFILE; | |
395 | #else | |
396 | while((j=open("/dev/null", 0)) > 0) i=j; | |
0a5b9b32 | 397 | close(i); close(i-1); |
398 | i++; | |
234967c9 | 399 | #endif |
400 | fprintf (fopen("conftestval", "w"), "%d\n", i); | |
401 | exit(0); | |
402 | } | |
403 | ], | |
431d84c5 | 404 | SQUID_MAXFD=`cat conftestval`, |
405 | SQUID_MAXFD=256, | |
406 | SQUID_MAXFD=256) | |
407 | AC_MSG_RESULT($SQUID_MAXFD) | |
408 | AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD) | |
234967c9 | 409 | |
30a4f2a8 | 410 | AC_MSG_CHECKING(Default UDP send buffer size) |
411 | AC_TRY_RUN([ | |
8cca06da | 412 | #include <stdlib.h> |
413 | #include <stdio.h> | |
30a4f2a8 | 414 | #include <sys/types.h> |
415 | #include <sys/socket.h> | |
416 | #include <netinet/in.h> | |
417 | main () | |
418 | { | |
419 | int fd,val=0,len=sizeof(int); | |
420 | if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); | |
421 | if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); | |
422 | if (val<=0) exit(1); | |
423 | fprintf (fopen("conftestval", "w"), "%d\n", val); | |
424 | exit(0); | |
425 | } | |
426 | ], | |
427 | SQUID_UDP_SO_SNDBUF=`cat conftestval`, | |
1c481e00 | 428 | SQUID_UDP_SO_SNDBUF=16384, |
429 | SQUID_UDP_SO_SNDBUF=16384) | |
30a4f2a8 | 430 | AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF) |
431 | AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF) | |
432 | ||
433 | AC_MSG_CHECKING(Default UDP receive buffer size) | |
434 | AC_TRY_RUN([ | |
8cca06da | 435 | #include <stdlib.h> |
436 | #include <stdio.h> | |
30a4f2a8 | 437 | #include <sys/types.h> |
438 | #include <sys/socket.h> | |
439 | #include <netinet/in.h> | |
440 | main () | |
441 | { | |
442 | int fd,val=0,len=sizeof(int); | |
443 | if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); | |
444 | if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); | |
445 | if (val <= 0) exit(1); | |
446 | fprintf (fopen("conftestval", "w"), "%d\n", val); | |
447 | exit(0); | |
448 | } | |
449 | ], | |
450 | SQUID_UDP_SO_RCVBUF=`cat conftestval`, | |
1c481e00 | 451 | SQUID_UDP_SO_RCVBUF=16384, |
452 | SQUID_UDP_SO_RCVBUF=16384) | |
30a4f2a8 | 453 | AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF) |
454 | AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF) | |
455 | ||
456 | AC_MSG_CHECKING(Default TCP send buffer size) | |
457 | AC_TRY_RUN([ | |
8cca06da | 458 | #include <stdlib.h> |
459 | #include <stdio.h> | |
30a4f2a8 | 460 | #include <sys/types.h> |
461 | #include <sys/socket.h> | |
462 | #include <netinet/in.h> | |
463 | main () | |
464 | { | |
465 | int fd,val=0,len=sizeof(int); | |
466 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); | |
467 | if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); | |
468 | if (val <= 0) exit(1); | |
469 | fprintf (fopen("conftestval", "w"), "%d\n", val); | |
470 | exit(0); | |
471 | } | |
472 | ], | |
473 | SQUID_TCP_SO_SNDBUF=`cat conftestval`, | |
1c481e00 | 474 | SQUID_TCP_SO_SNDBUF=16384, |
475 | SQUID_TCP_SO_SNDBUF=16384) | |
30a4f2a8 | 476 | AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF) |
477 | AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF) | |
478 | ||
479 | AC_MSG_CHECKING(Default TCP receive buffer size) | |
480 | AC_TRY_RUN([ | |
8cca06da | 481 | #include <stdlib.h> |
482 | #include <stdio.h> | |
30a4f2a8 | 483 | #include <sys/types.h> |
484 | #include <sys/socket.h> | |
485 | #include <netinet/in.h> | |
486 | main () | |
487 | { | |
488 | int fd,val=0,len=sizeof(int); | |
489 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); | |
490 | if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); | |
491 | if (val <= 0) exit(1); | |
492 | fprintf (fopen("conftestval", "w"), "%d\n", val); | |
493 | exit(0); | |
494 | } | |
495 | ], | |
496 | SQUID_TCP_SO_RCVBUF=`cat conftestval`, | |
1c481e00 | 497 | SQUID_TCP_SO_RCVBUF=16384, |
498 | SQUID_TCP_SO_RCVBUF=16384) | |
30a4f2a8 | 499 | AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF) |
500 | AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF) | |
501 | ||
502 | AC_MSG_CHECKING(if sys_errlist[] is already defined) | |
503 | AC_TRY_COMPILE([#include <stdio.h>], | |
504 | [char *s = sys_errlist[0];], | |
505 | AC_MSG_RESULT(yes), | |
506 | [AC_MSG_RESULT(no) | |
507 | AC_DEFINE(NEED_SYS_ERRLIST)]) | |
508 | ||
6bf65235 | 509 | AC_MSG_CHECKING(for libresolv _dns_ttl_ hack) |
510 | AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;, | |
511 | [AC_MSG_RESULT(yes) | |
512 | AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)], | |
513 | AC_MSG_RESULT(no)) | |
514 | ||
090089c4 | 515 | dnl Need the debugging version of malloc if available |
516 | XTRA_OBJS='' | |
6509a1a0 | 517 | if test "$ac_cv_lib_malloc_main" = "yes" ; then |
090089c4 | 518 | if test -r /usr/lib/debug/malloc.o ; then |
519 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o" | |
520 | fi | |
521 | if test -r /usr/lib/debug/mallocmap.o ; then | |
522 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o" | |
523 | fi | |
524 | fi | |
525 | AC_SUBST(XTRA_OBJS) | |
526 | ||
38fea766 | 527 | if test -z "$XTRA_LIBS"; then |
528 | XTRA_LIBS="$LIBS" | |
529 | LIBS='' | |
530 | fi | |
090089c4 | 531 | AC_SUBST(XTRA_LIBS) |
532 | ||
090089c4 | 533 | dnl Clean up after OSF/1 core dump bug |
534 | rm -f core | |
535 | ||
536 | AC_OUTPUT(\ | |
0992a350 | 537 | ./makefile \ |
090089c4 | 538 | ./lib/Makefile \ |
a26bdc75 | 539 | ./include/config.h \ |
090089c4 | 540 | ./scripts/Makefile \ |
541 | ./scripts/RunCache \ | |
542 | ./scripts/RunAccel \ | |
a26bdc75 | 543 | ./src/Makefile \ |
983061ed | 544 | ./src/squid.conf.pre \ |
e550e8b6 | 545 | ./contrib/Makefile \ |
090089c4 | 546 | ) |