]>
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 |
c716a1dd | 6 | dnl $Id: configure.in,v 1.154 1998/10/02 04:36:23 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) |
c716a1dd | 12 | AC_REVISION($Revision: 1.154 $)dnl |
2877b8a9 | 13 | AC_PREFIX_DEFAULT(/usr/local/squid) |
71b12d7c | 14 | AC_CONFIG_AUX_DIR(cfgaux) |
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 | ||
df087e68 | 29 | dnl use .exe suffix for executables on cygwin32 platform |
30 | case "$host_os" in | |
31 | cygwin32) | |
32 | exec_suffix=".exe" | |
33 | cgi_suffix=".exe" | |
34 | ;; | |
35 | *) | |
36 | exec_suffix="" | |
37 | cgi_suffix=".cgi" | |
38 | ;; | |
39 | esac | |
40 | AC_SUBST(exec_suffix) | |
41 | AC_SUBST(cgi_suffix) | |
42 | ||
a26bdc75 | 43 | if test -z "$CACHE_HTTP_PORT"; then |
44 | CACHE_HTTP_PORT="3128" | |
45 | fi | |
46 | if test -z "$CACHE_ICP_PORT"; then | |
47 | CACHE_ICP_PORT="3130" | |
48 | fi | |
a26bdc75 | 49 | |
090089c4 | 50 | dnl Subsitutions |
a26bdc75 | 51 | AC_SUBST(CACHE_HTTP_PORT) |
52 | AC_SUBST(CACHE_ICP_PORT) | |
090089c4 | 53 | |
30a4f2a8 | 54 | AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host") |
55 | ||
56 | dnl Set default LDFLAGS | |
57 | if test -z "$LDFLAGS"; then | |
58 | LDFLAGS="-g" | |
59 | fi | |
60 | ||
38fea766 | 61 | PRESET_CFLAGS="$CFLAGS" |
30a4f2a8 | 62 | |
090089c4 | 63 | dnl Check for GNU cc |
64 | AC_PROG_CC | |
65 | ||
6ad85e8a | 66 | dnl Gerben Wierda <Gerben_Wierda@RnA.nl> |
67 | case "$host" in | |
68 | mab-next-nextstep3) | |
69 | CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc" | |
70 | ;; | |
71 | esac | |
72 | ||
30a4f2a8 | 73 | dnl Set Default CFLAGS |
74 | if test -z "$PRESET_CFLAGS"; then | |
75 | if test "$GCC" = "yes"; then | |
76 | case "$host" in | |
97b12a5b | 77 | *-sun-sunos*) |
30a4f2a8 | 78 | # sunos has too many warnings for this to be useful |
79 | # motorola too | |
80 | ;; | |
97b12a5b | 81 | *m88k*) |
82 | # Motorola cc/ld does not like -02 but is ok on -O | |
83 | CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'` | |
84 | ;; | |
30a4f2a8 | 85 | *) |
86 | CFLAGS="$CFLAGS -Wall" | |
87 | ;; | |
88 | esac | |
81a820c6 | 89 | else |
90 | case "$host" in | |
91 | *mips-sgi-irix6.4*) | |
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" | |
97 | ;; | |
98 | *) | |
99 | ;; | |
100 | esac | |
30a4f2a8 | 101 | fi |
30a4f2a8 | 102 | fi |
103 | ||
104 | dnl Set LDFLAGS | |
105 | if test -z "$PRESET_LDFLAGS"; then | |
106 | if test "$GCC" = "yes"; then | |
107 | case "$host" in | |
108 | *) | |
109 | # nothing | |
110 | ;; | |
111 | esac | |
81a820c6 | 112 | else |
113 | case "$host" in | |
114 | *mips-sgi-irix6.4*) | |
115 | # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com> | |
116 | LDFLAGS="-n32 -mips4 -nostdlib -L/usr/lib32" | |
117 | ;; | |
118 | esac | |
30a4f2a8 | 119 | fi |
120 | fi | |
2060fa9a | 121 | |
e5f4e1b0 | 122 | dnl Enable optional modules |
123 | AC_ARG_ENABLE(dlmalloc, | |
94d48591 | 124 | [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea], |
e5f4e1b0 | 125 | [ |
94d48591 | 126 | if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then |
127 | # Ok. dlmalloc was enabled before, but state may be changed. | |
e5f4e1b0 | 128 | # we have to test these again |
129 | unset ac_cv_func_mallinfo | |
130 | unset ac_cv_func_mallocblksize | |
131 | unset ac_cv_func_free | |
132 | unset ac_cv_func_realloc | |
133 | unset ac_cv_func_memalign | |
134 | unset ac_cv_func_valloc | |
135 | unset ac_cv_func_pvalloc | |
136 | unset ac_cv_func_calloc | |
137 | unset ac_cv_func_cfree | |
138 | unset ac_cv_func_malloc_trim | |
139 | unset ac_cv_func_malloc_usable_size | |
140 | unset ac_cv_func_malloc_stats | |
141 | unset ac_cv_func_mallinfo | |
142 | unset ac_cv_func_mallopt | |
143 | unset ac_cv_lib_gnumalloc | |
144 | unset ac_cv_lib_malloc | |
145 | unset ac_cv_enabled_dlmalloc | |
146 | fi | |
94d48591 | 147 | case "$enableval" in |
148 | 'yes') | |
149 | LIBDLMALLOC="libdlmalloc.a" | |
150 | LIB_MALLOC="-L../lib -ldlmalloc" | |
151 | ac_cv_func_mallinfo="yes" | |
152 | ac_cv_func_mallocblksize="no" | |
153 | ac_cv_func_free="yes" | |
154 | ac_cv_func_realloc="yes" | |
155 | ac_cv_func_memalign="yes" | |
156 | ac_cv_func_valloc="yes" | |
157 | ac_cv_func_pvalloc="yes" | |
158 | ac_cv_func_calloc="yes" | |
159 | ac_cv_func_cfree="yes" | |
160 | ac_cv_func_malloc_trim="yes" | |
161 | ac_cv_func_malloc_usable_size="yes" | |
162 | ac_cv_func_malloc_stats="yes" | |
163 | ac_cv_func_mallinfo="yes" | |
164 | ac_cv_func_mallopt="yes" | |
165 | ac_cv_lib_gnumalloc="no" | |
166 | ac_cv_lib_malloc="no" | |
167 | ac_cv_enabled_dlmalloc="yes" | |
168 | echo "dlmalloc build enabled" | |
169 | ;; | |
170 | 'no') | |
171 | # Disabled explicitly. | |
172 | echo "dlmalloc disabled." | |
173 | ;; | |
174 | *) | |
175 | # Use already installed dlmalloc library. | |
176 | LIB_MALLOC="${enableval}" | |
177 | ac_cv_func_mallinfo="yes" | |
178 | ac_cv_func_mallocblksize="no" | |
179 | ac_cv_func_free="yes" | |
180 | ac_cv_func_realloc="yes" | |
181 | ac_cv_func_memalign="yes" | |
182 | ac_cv_func_valloc="yes" | |
183 | ac_cv_func_pvalloc="yes" | |
184 | ac_cv_func_calloc="yes" | |
185 | ac_cv_func_cfree="yes" | |
186 | ac_cv_func_malloc_trim="yes" | |
187 | ac_cv_func_malloc_usable_size="yes" | |
188 | ac_cv_func_malloc_stats="yes" | |
189 | ac_cv_func_mallinfo="yes" | |
190 | ac_cv_func_mallopt="yes" | |
191 | ac_cv_lib_gnumalloc="no" | |
192 | ac_cv_lib_malloc="no" | |
193 | ac_cv_enabled_dlmalloc="yes" | |
194 | echo "Use installed dlmalloc." | |
195 | ;; | |
196 | esac | |
e5f4e1b0 | 197 | ],[ |
198 | if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then | |
199 | # Ok. dlmalloc was enabled before, but now disabled. | |
200 | # we have to test these again | |
201 | unset ac_cv_func_mallinfo | |
202 | unset ac_cv_func_mallocblksize | |
203 | unset ac_cv_func_free | |
204 | unset ac_cv_func_realloc | |
205 | unset ac_cv_func_memalign | |
206 | unset ac_cv_func_valloc | |
207 | unset ac_cv_func_pvalloc | |
208 | unset ac_cv_func_calloc | |
209 | unset ac_cv_func_cfree | |
210 | unset ac_cv_func_malloc_trim | |
211 | unset ac_cv_func_malloc_usable_size | |
212 | unset ac_cv_func_malloc_stats | |
213 | unset ac_cv_func_mallinfo | |
214 | unset ac_cv_func_mallopt | |
215 | unset ac_cv_lib_gnumalloc | |
216 | unset ac_cv_lib_malloc | |
217 | unset ac_cv_enabled_dlmalloc | |
218 | fi | |
219 | ]) | |
220 | AC_SUBST(LIBDLMALLOC) | |
221 | AC_SUBST(LIB_MALLOC) | |
222 | ||
223 | AC_ARG_ENABLE(gnuregex, | |
224 | [ --enable-gnuregex Compile GNUregex], | |
225 | [USE_GNUREGEX=$enableval]) | |
226 | ||
e5f4e1b0 | 227 | AC_ARG_ENABLE(xmalloc_debug, |
228 | [ --enable-xmalloc-debug Do some simple malloc debugging], | |
229 | [ if test "$enableval" = "yes" ; then | |
230 | echo "Malloc debugging enabled" | |
231 | AC_DEFINE(XMALLOC_DEBUG) | |
232 | fi | |
233 | ]) | |
234 | ||
027acbaf | 235 | AC_ARG_ENABLE(xmalloc_debug_trace, |
236 | [ --enable-xmalloc-debug-trace | |
e5f4e1b0 | 237 | Detailed trace of memory allocations], |
238 | [ if test "$enableval" = "yes" ; then | |
027acbaf | 239 | echo "Malloc debug trace enabled" |
240 | AC_DEFINE(XMALLOC_TRACE) | |
241 | AC_DEFINE(XMALLOC_DEBUG) | |
e5f4e1b0 | 242 | fi |
243 | ]) | |
244 | ||
245 | AC_ARG_ENABLE(xmalloc_statistics, | |
246 | [ --enable-xmalloc-statistics | |
247 | Show malloc statistics in status page], | |
248 | [ if test "$enableval" = "yes" ; then | |
249 | echo "Malloc statistics enabled" | |
250 | AC_DEFINE(XMALLOC_STATISTICS) | |
251 | fi | |
252 | ]) | |
253 | ||
323fe0d4 | 254 | AC_ARG_ENABLE(carp, |
255 | [ --enable-carp Enable CARP support], | |
256 | [ if test "$enableval" = "yes" ; then | |
257 | echo "CARP support enabled" | |
258 | AC_DEFINE(USE_CARP) | |
259 | fi | |
260 | ]) | |
261 | ||
e5f4e1b0 | 262 | AC_ARG_ENABLE(async_io, |
263 | [ --enable-async-io Do ASYNC disk I/O using threads], | |
264 | [ if test "$enableval" = "yes" ; then | |
265 | echo "Async I/O enabled" | |
266 | AC_DEFINE(USE_ASYNC_IO) | |
267 | ASYNC_OBJS='$(ASYNC_OBJS)' | |
9fc0b4b8 | 268 | SQUID_PTHREAD_LIB='$(PTHREADLIB)' |
269 | CFLAGS="$CFLAGS -D_REENTRANT" | |
e5f4e1b0 | 270 | fi |
271 | ]) | |
272 | AC_SUBST(ASYNC_OBJS) | |
273 | AC_SUBST(SQUID_PTHREAD_LIB) | |
274 | ||
275 | AC_ARG_ENABLE(icmp, | |
276 | [ --enable-icmp Enable ICMP pinging], | |
277 | [ if test "$enableval" = "yes" ; then | |
278 | echo "ICMP enabled" | |
279 | AC_DEFINE(USE_ICMP) | |
280 | fi | |
281 | ]) | |
282 | ||
95e36d02 | 283 | AC_ARG_ENABLE(delay_pools, |
284 | [ --enable-delay-pools Enable delay pools to limit bandwith usage], | |
e5f4e1b0 | 285 | [ if test "$enableval" = "yes" ; then |
95e36d02 | 286 | echo "Delay pools enabled" |
287 | DELAY_OBJS='$(DELAY_OBJS)' | |
288 | AC_DEFINE(DELAY_POOLS) | |
e5f4e1b0 | 289 | fi |
290 | ]) | |
95e36d02 | 291 | AC_SUBST(DELAY_OBJS) |
e5f4e1b0 | 292 | |
36a97e19 | 293 | AC_ARG_ENABLE(mem-gen-trace, |
294 | [ --enable-mem-gen-trace Do trace of memory stuff], | |
295 | [ if test "$enableval" = "yes" ; then | |
296 | echo "Memory trace (to file) enabled" | |
297 | AC_DEFINE(MEM_GEN_TRACE) | |
298 | fi | |
299 | ]) | |
300 | ||
e5f4e1b0 | 301 | AC_ARG_ENABLE(useragent_log, |
302 | [ --enable-useragent-log Enable logging of User-Agent header], | |
303 | [ if test "$enableval" = "yes" ; then | |
304 | echo "User-Agent logging enabled" | |
305 | AC_DEFINE(USE_USERAGENT_LOG) | |
306 | fi | |
307 | ]) | |
308 | ||
9fc0b4b8 | 309 | AC_ARG_ENABLE(kill_parent_hack, |
310 | [ --enable-kill-parent-hack | |
311 | Kill parent on shutdown], | |
e5f4e1b0 | 312 | [ if test "$enableval" = "yes" ; then |
313 | echo "Kill parent on shutdown" | |
314 | AC_DEFINE(KILL_PARENT_OPT) | |
315 | fi | |
316 | ]) | |
317 | ||
318 | AC_ARG_ENABLE(snmp, | |
319 | [ --enable-snmp Enable SNMP monitoring], | |
320 | [ if test "$enableval" = "yes" ; then | |
321 | echo "SNMP monitoring enabled" | |
322 | AC_DEFINE(SQUID_SNMP) | |
323 | SNMPLIB='-L../snmplib -lsnmp' | |
324 | SNMP_OBJS='$(SNMP_OBJS)' | |
8a7f0105 | 325 | SNMP_MAKEFILE=./snmplib/Makefile |
e5f4e1b0 | 326 | makesnmplib=snmplib |
327 | fi | |
328 | ]) | |
329 | AC_SUBST(SNMPLIB) | |
330 | AC_SUBST(SNMP_OBJS) | |
331 | AC_SUBST(makesnmplib) | |
332 | ||
333 | AC_ARG_ENABLE(time_hack, | |
334 | [ --enable-time-hack Update internal timestamp only once per second], | |
335 | [ if test "$enableval" = "yes" ; then | |
336 | echo "Update internal timestamp only once per second" | |
337 | AC_DEFINE(ALARM_UPDATES_TIME) | |
338 | fi | |
339 | ]) | |
340 | ||
341 | AC_ARG_ENABLE(cachemgr_hostname, | |
342 | [ --enable-cachemgr-hostname[=hostname] | |
343 | Make cachemgr.cgi default to this host], | |
344 | [ case $enableval in | |
345 | yes) | |
346 | AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()]) | |
347 | echo "Cachemgr default hostname == host where cachemgr runs" | |
348 | ;; | |
349 | no) | |
350 | : # Nothing to do.. | |
351 | ;; | |
352 | *) | |
353 | AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}") | |
354 | echo "Cachemgr default hostname set to ${enableval}" | |
355 | ;; | |
356 | esac | |
357 | ]) | |
358 | ||
359 | AC_ARG_ENABLE(arp_acl, | |
360 | [ --enable-arp-acl Enable use of ARP ACL lists (ether address)], | |
361 | [ if test "$enableval" = "yes" ; then | |
362 | echo "ARP ACL lists enabled (ether address)" | |
933cc58d | 363 | case "$host" in |
a931a29b | 364 | *-pc-linux-*) |
365 | ;; | |
933cc58d | 366 | *) |
bd0c865a | 367 | echo "WARNING: ARP ACL support is only currently supported on Linux" |
368 | echo " ethernet interfaces, probably won't work on $host." | |
933cc58d | 369 | sleep 10 |
370 | ;; | |
371 | esac | |
e5f4e1b0 | 372 | AC_DEFINE(USE_ARP_ACL) |
373 | fi | |
374 | ]) | |
375 | ||
74075210 | 376 | AC_ARG_ENABLE(htcp, |
88b7de25 | 377 | [ --enable-htcp Enable HTCP protocol], |
b4b8b6da | 378 | [ if test "$enableval" = "yes" ; then |
379 | echo "HTCP enabled" | |
380 | HTCP_OBJS='$(HTCP_OBJS)' | |
381 | AC_DEFINE(USE_HTCP) | |
382 | fi | |
74075210 | 383 | ]) |
b4b8b6da | 384 | AC_SUBST(HTCP_OBJS) |
74075210 | 385 | |
02749868 | 386 | AC_ARG_ENABLE(forw-via-db, |
387 | [ --enable-forw-via-db Enable Forw/Via database], | |
388 | [ if test "$enableval" = "yes" ; then | |
389 | echo "FORW-VIA enabled" | |
390 | AC_DEFINE(FORW_VIA_DB) | |
391 | fi | |
392 | ]) | |
393 | ||
6cfa8966 | 394 | AC_ARG_ENABLE(cache-digests, |
22df58ea | 395 | [ --enable-cache-digests Use Cache Digests |
043e3d78 | 396 | see http://squid.nlanr.net/Squid/FAQ/FAQ-16.html], |
484f2ebc | 397 | [ if test "$enableval" = "yes" ; then |
6cfa8966 | 398 | echo "USE_CACHE_DIGESTS enabled" |
399 | AC_DEFINE(USE_CACHE_DIGESTS) | |
484f2ebc | 400 | fi |
401 | ]) | |
402 | ||
933cc58d | 403 | dnl Select Error language |
404 | AC_ARG_ENABLE(err-language, | |
405 | [ --enable-err-language=lang | |
406 | Select language for Error pages (see errors dir) ], | |
407 | [ | |
408 | if test -d errors/$enableval; then | |
409 | ERR_LANGUAGE=$enableval | |
410 | else | |
411 | echo "ERROR! Unknown language $enableval, see errors/" | |
412 | exit 1 | |
413 | fi | |
93a8bb45 | 414 | ],[ERR_LANGUAGE="English"]) |
933cc58d | 415 | AC_SUBST(ERR_LANGUAGE) |
416 | ||
9bb83c8b | 417 | dnl Enable poll() |
418 | AC_ARG_ENABLE(poll, | |
419 | [ --enable-poll Enable poll() instead of select(). Normally poll | |
420 | is preferred over select, but configure knows poll | |
421 | is broken on some platforms. If you think you are | |
422 | smarter than the configure script, you may enable | |
423 | poll with this option. | |
424 | ], | |
425 | [ if test "$enableval" = "yes" ; then | |
426 | echo "Forcing poll() to be enabled" | |
427 | ac_cv_func_poll='yes' | |
428 | fi | |
429 | ]) | |
430 | ||
72fd085a | 431 | dnl Disable HTTP violations |
432 | AC_ARG_ENABLE(http-violations, | |
433 | [ --disable-http-violations | |
434 | This allows you to remove code which is known to | |
435 | violate the HTTP protocol specification. | |
436 | ], | |
437 | [ if test "$enableval" = "no" ; then | |
438 | echo "Disabling HTTP Violations" | |
6eec93b2 | 439 | AC_DEFINE(HTTP_VIOLATIONS, 0) |
72fd085a | 440 | else |
6eec93b2 | 441 | AC_DEFINE(HTTP_VIOLATIONS, 1) |
72fd085a | 442 | fi |
443 | ]) | |
444 | ||
5cafc1d6 | 445 | dnl Enable IP-Filter Transparent Proxy |
446 | AC_ARG_ENABLE(ipf-transparent, | |
447 | [ --enable-ipf-transparent | |
448 | Enable Transparent Proxy support for systems | |
449 | using IP-Filter network address redirection. | |
450 | ], | |
451 | [ if test "$enableval" = "yes" ; then | |
452 | echo "IP-Filter Transparent Proxy enabled" | |
453 | AC_DEFINE(IPF_TRANSPARENT) | |
454 | IPF_TRANSPARENT="yes" | |
455 | fi | |
456 | ]) | |
457 | ||
fd9aaa3e | 458 | # Force some compilers to use ANSI features |
459 | # | |
460 | case "$host" in | |
461 | alpha-dec-osf*) | |
462 | if test "$ac_cv_prog_CC" = "cc" ; then | |
463 | echo "adding '-std1' to cc args for $host" | |
464 | CC="cc -std1"; | |
465 | ac_cv_prog_CC="$CC" | |
466 | fi | |
467 | ;; | |
468 | esac | |
469 | ||
090089c4 | 470 | dnl Check for programs |
471 | AC_PROG_CPP | |
472 | AC_PROG_INSTALL | |
473 | AC_PROG_RANLIB | |
474 | AC_PROG_LN_S | |
81280a96 | 475 | AC_PATH_PROG(SH, sh, /bin/sh) |
d9f67e6f | 476 | AC_PATH_PROG(FALSE, false, /usr/bin/false) |
477 | AC_PATH_PROG(TRUE, true, /usr/bin/true) | |
478 | AC_PATH_PROG(RM, rm, $FALSE) | |
479 | AC_PATH_PROG(MV, mv, $FALSE) | |
480 | AC_PATH_PROG(MKDIR, mkdir, $FALSE) | |
090089c4 | 481 | AC_PATH_PROG(LN, ln, cp) |
983061ed | 482 | AC_PATH_PROG(PERL, perl, /usr/local/bin/perl) |
d9f67e6f | 483 | AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE) |
6ad85e8a | 484 | AC_PATH_PROG(AR, ar, $FALSE) |
485 | ||
486 | case "$host" in | |
487 | *-hp-hpux*) | |
488 | echo "Disabling 'ranlib' for HP-UX..." | |
489 | RANLIB=":" | |
490 | ;; | |
491 | esac | |
492 | ||
493 | dnl set $(AR) | |
494 | AR_R="$AR r" | |
495 | case "$host" in | |
496 | *-next-nextstep3) | |
497 | AR="libtool -o" | |
498 | ;; | |
499 | esac | |
500 | AC_SUBST(AR_R) | |
090089c4 | 501 | |
502 | dnl Check for headers | |
503 | AC_HEADER_DIRENT | |
504 | AC_HEADER_STDC | |
db40ae20 | 505 | |
506 | AC_CHECK_HEADERS( \ | |
507 | alloca.h \ | |
508 | arpa/inet.h \ | |
30a4f2a8 | 509 | arpa/nameser.h \ |
9441aa34 | 510 | assert.h \ |
db40ae20 | 511 | bstring.h \ |
512 | config.h \ | |
513 | crypt.h \ | |
30a4f2a8 | 514 | ctype.h \ |
515 | errno.h \ | |
db40ae20 | 516 | fcntl.h \ |
9c1d8929 | 517 | getopt.h \ |
88738790 | 518 | gnumalloc.h \ |
30a4f2a8 | 519 | grp.h \ |
5cafc1d6 | 520 | ip_compat.h \ |
521 | ip_fil.h \ | |
522 | ip_nat.h \ | |
30a4f2a8 | 523 | libc.h \ |
6ad85e8a | 524 | limits.h \ |
30a4f2a8 | 525 | malloc.h \ |
e0bddc45 | 526 | math.h \ |
db40ae20 | 527 | memory.h \ |
b075cbb1 | 528 | mount.h \ |
5cafc1d6 | 529 | net/if.h \ |
30a4f2a8 | 530 | netdb.h \ |
db40ae20 | 531 | netinet/in.h \ |
30a4f2a8 | 532 | netinet/tcp.h \ |
dcfe6390 | 533 | poll.h \ |
30a4f2a8 | 534 | pwd.h \ |
535 | regex.h \ | |
536 | resolv.h \ | |
537 | signal.h \ | |
538 | stdarg.h \ | |
539 | stddef.h \ | |
540 | stdio.h \ | |
db40ae20 | 541 | stdlib.h \ |
542 | string.h \ | |
543 | strings.h \ | |
544 | sys/file.h \ | |
5cafc1d6 | 545 | sys/ioctl.h \ |
30a4f2a8 | 546 | sys/param.h \ |
547 | sys/resource.h \ | |
db40ae20 | 548 | sys/select.h\ |
30a4f2a8 | 549 | sys/socket.h \ |
550 | sys/stat.h \ | |
b075cbb1 | 551 | sys/statvfs.h \ |
30a4f2a8 | 552 | sys/syscall.h \ |
db40ae20 | 553 | sys/time.h \ |
554 | sys/types.h \ | |
30a4f2a8 | 555 | sys/un.h \ |
b075cbb1 | 556 | sys/vfs.h \ |
30a4f2a8 | 557 | sys/wait.h \ |
db40ae20 | 558 | syslog.h \ |
30a4f2a8 | 559 | time.h \ |
560 | unistd.h \ | |
561 | varargs.h \ | |
db40ae20 | 562 | ) |
563 | ||
aee0606f | 564 | AC_C_CONST |
d57288d2 | 565 | AC_C_BIGENDIAN |
aee0606f | 566 | |
5c51415d | 567 | AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [ |
568 | AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}], | |
569 | [foo("bar")], | |
570 | ac_cv_have_ansi_prototypes="yes", | |
571 | ac_cv_have_ansi_prototypes="no") | |
572 | ]) | |
573 | if test $ac_cv_have_ansi_prototypes = "yes" ; then | |
574 | AC_DEFINE(HAVE_ANSI_PROTOTYPES) | |
575 | fi | |
20a50bb9 | 576 | |
5c51415d | 577 | AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [ |
578 | AC_TRY_COMPILE([#include <time.h> | |
46c883ed | 579 | #include <sys/time.h>], |
5c51415d | 580 | [struct tm foo; |
581 | foo.tm_gmtoff = 0;], | |
582 | ac_cv_have_tm_gmoff="yes", | |
583 | ac_cv_have_tm_gmoff="no") | |
584 | ]) | |
585 | if test $ac_cv_have_tm_gmoff = "yes" ; then | |
586 | AC_DEFINE(HAVE_TM_GMTOFF) | |
587 | fi | |
46c883ed | 588 | |
5c51415d | 589 | AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [ |
590 | AC_TRY_COMPILE([#include <sys/types.h> | |
46c883ed | 591 | #include <malloc.h>], |
5c51415d | 592 | [struct mallinfo foo; |
593 | foo.mxfast = 0;], | |
594 | ac_cv_have_ext_mallinfo="yes", | |
595 | ac_cv_have_ext_mallinfo="no") | |
596 | ]) | |
597 | if test $ac_cv_have_ext_mallinfo = "yes" ; then | |
598 | AC_DEFINE(HAVE_EXT_MALLINFO) | |
599 | fi | |
090089c4 | 600 | |
b54a6789 | 601 | AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [ |
602 | AC_TRY_COMPILE([ | |
8ff51bba | 603 | #if HAVE_SYS_TIME_H |
604 | #include <sys/time.h> | |
605 | #endif | |
b54a6789 | 606 | #if HAVE_SYS_RESOURCE_H |
607 | #include <sys/resource.h> | |
608 | #endif], | |
609 | [struct rusage R;], | |
610 | ac_cv_have_struct_rusage="yes", | |
611 | ac_cv_have_struct_rusage="no") | |
612 | ]) | |
613 | if test $ac_cv_have_struct_rusage = "yes" ; then | |
614 | AC_DEFINE(HAVE_STRUCT_RUSAGE) | |
615 | fi | |
616 | ||
5c51415d | 617 | AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [ |
618 | AC_TRY_COMPILE([#include <sys/types.h> | |
a025a745 | 619 | #include <netinet/in.h> |
620 | #include <netinet/in_systm.h> | |
6ad85e8a | 621 | #include <netinet/ip.h> |
622 | #ifdef __linux__ | |
623 | #define ip_hl ihl | |
624 | #endif | |
625 | #ifndef __linux__ | |
626 | #define iphdr ip | |
627 | #endif], | |
5c51415d | 628 | [struct iphdr ip; |
629 | ip.ip_hl= 0;], | |
630 | ac_cv_have_ip_hl="yes", | |
631 | ac_cv_have_ip_hl="no") | |
632 | ]) | |
633 | if test $ac_cv_have_ip_hl = "yes" ; then | |
634 | AC_DEFINE(HAVE_IP_HL) | |
635 | fi | |
a025a745 | 636 | |
090089c4 | 637 | dnl Check for typedefs |
638 | AC_CHECK_SIZEOF(int) | |
639 | AC_CHECK_SIZEOF(long) | |
640 | ||
256cf05b | 641 | dnl Check for special functions |
642 | AC_FUNC_ALLOCA | |
090089c4 | 643 | |
3f6fcd8a | 644 | AC_CHECK_TYPE(pid_t, int) |
0897af2d | 645 | AC_CHECK_TYPE(size_t, unsigned int) |
646 | AC_CHECK_TYPE(ssize_t, int) | |
3f6fcd8a | 647 | AC_CHECK_TYPE(off_t, int) |
95cf2361 | 648 | AC_CHECK_TYPE(mode_t, u_short) |
c716a1dd | 649 | AC_CHECK_TYPE(fd_mask, int) |
3f6fcd8a | 650 | |
6637e3a5 | 651 | dnl Check for type in sys/socket.h |
652 | AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [ | |
653 | AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h> | |
654 | #include <sys/socket.h> | |
655 | #if STDC_HEADERS | |
656 | #include <stdlib.h> | |
657 | #include <stddef.h> | |
658 | #endif], | |
659 | ac_cv_type_socklen_t=yes, | |
660 | ac_cv_type_socklen_t=no) | |
661 | ]) | |
662 | if test $ac_cv_type_socklen_t = no; then | |
663 | AC_DEFINE(socklen_t, int) | |
664 | fi | |
665 | ||
090089c4 | 666 | dnl Check for needed libraries |
30a4f2a8 | 667 | AC_CHECK_LIB(nsl, main) |
6716b242 | 668 | AC_CHECK_LIB(socket, main) |
94d48591 | 669 | |
670 | if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then | |
671 | echo "skipping libmalloc check (--enable-dlmalloc specified)" | |
5c51415d | 672 | else |
94d48591 | 673 | AC_CHECK_LIB(gnumalloc, main) |
674 | if test "$ac_cv_lib_gnumalloc_main" = "yes"; then | |
675 | echo "Disabling extended malloc functions when using gnumalloc" | |
676 | ac_cv_func_mallinfo=no | |
677 | ac_cv_func_mallocblksize=no | |
678 | ac_cv_func_mallopt=no | |
679 | else | |
680 | case "$host" in | |
681 | *-sun-solaris*) | |
682 | echo "skipping libmalloc check for $host" | |
683 | ;; | |
684 | i386-*-freebsd*) | |
685 | echo "skipping libmalloc check for $host" | |
686 | ;; | |
687 | *) | |
688 | ||
689 | AC_CHECK_LIB(malloc, main) | |
690 | ;; | |
691 | esac | |
692 | fi | |
8a15e65e | 693 | fi |
94d48591 | 694 | |
6716b242 | 695 | AC_CHECK_LIB(bsd, main) |
be79ade0 | 696 | AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"]) |
04a56fa3 | 697 | AC_CHECK_LIB(bind, gethostbyname) |
698 | if test $ac_cv_lib_bind_gethostbyname = "no" ; then | |
699 | case "$host" in | |
78743365 | 700 | i386-*-freebsd*) |
701 | echo "skipping libresolv checks for $host" | |
702 | ;; | |
703 | *) | |
704 | AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton)) | |
705 | AC_CHECK_LIB(resolv, main) | |
706 | ;; | |
04a56fa3 | 707 | esac |
708 | fi | |
e0bddc45 | 709 | AC_CHECK_LIB(m, main) |
090089c4 | 710 | |
711 | dnl Check for libcrypt | |
b8de7ebe | 712 | dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) |
0f5a16f8 | 713 | AC_CHECK_LIB(crypt, crypt) |
714 | if test $ac_cv_lib_crypt_crypt = "yes"; then | |
715 | CRYPTLIB="-lcrypt" | |
716 | fi | |
be79ade0 | 717 | AC_SUBST(CRYPTLIB) |
77f675ad | 718 | |
e5f4e1b0 | 719 | dnl Check for pthreads |
720 | dnl We use pthreads when doing ASYNC I/O | |
0f5a16f8 | 721 | AC_CHECK_LIB(pthread, main) |
722 | if test $ac_cv_lib_pthread_main = "yes"; then | |
723 | PTHREADLIB="-lpthread" | |
724 | fi | |
71f8abc8 | 725 | AC_SUBST(PTHREADLIB) |
726 | ||
77f675ad | 727 | dnl System-specific library modifications |
728 | dnl | |
729 | case "$host" in | |
88738790 | 730 | i386-*-solaris2.*) |
7149a49f | 731 | if test "$GCC" = "yes"; then |
732 | echo "Removing -O for gcc on $host" | |
80e92d6d | 733 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" |
7149a49f | 734 | fi |
735 | ;; | |
77f675ad | 736 | *-sgi-irix*) |
737 | echo "Removing -lsocket for IRIX..." | |
6716b242 | 738 | LIBS=`echo $LIBS | sed -e s/-lsocket//` |
77f675ad | 739 | echo "Removing -lnsl for IRIX..." |
6716b242 | 740 | LIBS=`echo $LIBS | sed -e s/-lnsl//` |
b44c0fb4 | 741 | echo "Removing -lbsd for IRIX..." |
742 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
77f675ad | 743 | ;; |
4ba0bd0e | 744 | dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher) |
745 | dnl Date: Thu, 17 Oct 1996 04:09:30 +0200 | |
746 | dnl Please change your configure script. AIX doesn't need -lbsd. | |
747 | *-ibm-aix*) | |
748 | echo "Removing -lbsd for AIX..." | |
749 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
750 | ;; | |
30a4f2a8 | 751 | *m88k*) |
752 | CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_" | |
7149a49f | 753 | AC_DEFINE(GETTIMEOFDAY_NO_TZP) |
754 | ;; | |
580ce039 | 755 | [*-*-solaris2.[0-4]]) |
7149a49f | 756 | AC_DEFINE(GETTIMEOFDAY_NO_TZP) |
30a4f2a8 | 757 | ;; |
f62c73dc | 758 | *-sony-newsos[56]*) |
759 | AC_DEFINE(GETTIMEOFDAY_NO_TZP) | |
760 | ;; | |
77f675ad | 761 | esac |
090089c4 | 762 | |
176d10ee | 763 | # Recommended by Balint Nagy Endre <bne@CareNet.hu> |
764 | case "$host" in | |
765 | *-univel-sysv4.2MP) | |
766 | if test `uname -v` = "2.03"; then | |
767 | echo "disabling mallinfo for $host" | |
768 | ac_cv_func_mallinfo=no | |
769 | fi | |
770 | ;; | |
771 | esac | |
772 | ||
84cecfd2 | 773 | dnl This has to be before AC_CHECK_FUNCS |
774 | # Disable poll() on certain platforms. Override by setting ac_cv_func_poll | |
775 | # when running configure. | |
776 | if test -z "$ac_cv_func_poll"; then | |
777 | case "$host" in | |
778 | [alpha-dec-osf3.*]) | |
779 | # John Kay (jkay@nlanr.net) 19970818 | |
780 | echo "disabling poll for $host..." | |
781 | ac_cv_func_poll='no' | |
782 | ;; | |
783 | [*-hp-hpux*.*]) | |
784 | # Duane Wessels | |
785 | echo "disabling poll for $host..." | |
786 | ac_cv_func_poll='no' | |
787 | ;; | |
788 | [*-linux-*]) | |
9bb83c8b | 789 | # Henrik Nordstrom (hno@hem.passagen.se) 19980817 |
790 | # poll is problematic on Linux. We disable it | |
791 | # by default until Linux gets it right. | |
792 | echo "disabling poll for $host..." | |
793 | ac_cv_func_poll='no' | |
84cecfd2 | 794 | ;; |
795 | esac | |
796 | fi | |
176d10ee | 797 | |
6716b242 | 798 | dnl Check for library functions |
799 | AC_CHECK_FUNCS(\ | |
30a4f2a8 | 800 | bcopy \ |
df087e68 | 801 | crypt \ |
4ac29a5b | 802 | fchmod \ |
6716b242 | 803 | getdtablesize \ |
8505e57b | 804 | getpagesize \ |
30a4f2a8 | 805 | getrusage \ |
9c1d8929 | 806 | getspnam \ |
30a4f2a8 | 807 | lrand48 \ |
6716b242 | 808 | mallinfo \ |
0f5efab0 | 809 | mallocblksize \ |
6716b242 | 810 | mallopt \ |
2ae6b9b0 | 811 | memcpy \ |
30a4f2a8 | 812 | memmove \ |
dac27377 | 813 | memset \ |
1812b6c7 | 814 | mktime \ |
88738790 | 815 | mstats \ |
84cecfd2 | 816 | poll \ |
b1e77ec1 | 817 | random \ |
6716b242 | 818 | regcomp \ |
819 | regexec \ | |
820 | regfree \ | |
30a4f2a8 | 821 | res_init \ |
4915be3b | 822 | rint \ |
234967c9 | 823 | seteuid \ |
30a4f2a8 | 824 | setpgrp \ |
6716b242 | 825 | setrlimit \ |
30a4f2a8 | 826 | setsid \ |
827 | sigaction \ | |
11430c03 | 828 | snprintf \ |
30a4f2a8 | 829 | srand48 \ |
b1e77ec1 | 830 | srandom \ |
b075cbb1 | 831 | statvfs \ |
6716b242 | 832 | sysconf \ |
833 | syslog \ | |
0a3efad5 | 834 | tempnam \ |
234967c9 | 835 | timegm \ |
28da5e0d | 836 | vsnprintf \ |
6716b242 | 837 | ) |
838 | ||
60939927 | 839 | dnl Yay! Another Linux brokenness. Its not good enough |
840 | dnl to know that setresuid() exists, because RedHat 5.0 declares | |
841 | dnl setresuid() but doesn't implement it. | |
842 | dnl | |
843 | AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid, | |
5c51415d | 844 | AC_TRY_RUN([ |
60939927 | 845 | #include <stdlib.h> |
5c51415d | 846 | int main() { |
847 | if(setresuid(-1,-1,-1)) { | |
848 | perror("setresuid:"); | |
849 | exit(1); | |
60939927 | 850 | } |
851 | exit(0); | |
5c51415d | 852 | } |
853 | ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no") | |
60939927 | 854 | ) |
5c51415d | 855 | if test "$ac_cv_func_setresuid" = "yes" ; then |
856 | AC_DEFINE(HAVE_SETRESUID) | |
857 | fi | |
60939927 | 858 | |
5cafc1d6 | 859 | dnl IP-Filter support requires ipf header files. These aren't |
860 | dnl installed by default, so we need to check for them | |
861 | if test "$IPF_TRANSPARENT" ; then | |
862 | AC_MSG_CHECKING(if IP-Filter header files are installed) | |
863 | if test "$ac_cv_header_ip_compat_h" = "no" || | |
864 | test "$ac_cv_header_ip_fil_h" = "no" || | |
865 | test "$ac_cv_header_ip_nat_h" = "no" ; then | |
866 | IPF_TRANSPARENT="no" | |
867 | AC_DEFINE(IPF_TRANSPARENT, 0) | |
868 | else | |
869 | IPF_TRANSPARENT="yes" | |
870 | AC_DEFINE(IPF_TRANSPARENT) | |
871 | fi | |
872 | AC_MSG_RESULT($IPF_TRANSPARENT) | |
873 | fi | |
874 | if test "$IPF_TRANSPARENT" = "no" ; then | |
875 | echo "WARNING: Cannot find necessary IP-Filter header files" | |
876 | echo " Transparent Proxy support WILL NOT be enabled" | |
877 | sleep 10 | |
878 | fi | |
879 | ||
91bc414e | 880 | if test -z "$USE_GNUREGEX" ; then |
881 | case "$host" in | |
882 | *-sun-solaris2.[[0-4]]) | |
883 | USE_GNUREGEX="yes" | |
884 | ;; | |
885 | *-next-nextstep*) | |
886 | USE_GNUREGEX="yes" | |
887 | ;; | |
888 | esac | |
889 | fi | |
7a081912 | 890 | AC_MSG_CHECKING(if GNUregex needs to be compiled) |
91bc414e | 891 | if test -z "$USE_GNUREGEX"; then |
55878dfd | 892 | if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then |
74946a0f | 893 | USE_GNUREGEX="yes" |
00fa2c12 | 894 | else |
0cccc031 | 895 | AC_TRY_COMPILE([#include <sys/types.h> |
896 | #include <regex.h>],[regex_t t; regcomp(&t,"",0);], | |
91bc414e | 897 | USE_GNUREGEX="no", |
898 | USE_GNUREGEX="yes") | |
899 | fi | |
00fa2c12 | 900 | fi |
74946a0f | 901 | AC_MSG_RESULT($USE_GNUREGEX) |
902 | if test "$USE_GNUREGEX" = "yes"; then | |
26675bf4 | 903 | REGEXLIB="-lregex" |
7a081912 | 904 | LIBREGEX="libregex.a" |
74946a0f | 905 | AC_DEFINE(USE_GNUREGEX) |
7a081912 | 906 | fi |
26675bf4 | 907 | AC_SUBST(REGEXLIB) |
00fa2c12 | 908 | AC_SUBST(LIBREGEX) |
7a081912 | 909 | |
3f6fcd8a | 910 | AC_REPLACE_FUNCS(\ |
911 | tempnam \ | |
4d38fc7e | 912 | strerror \ |
3f6fcd8a | 913 | ) |
914 | ||
5c51415d | 915 | dnl Not cached since people are likely to tune this |
e924600d | 916 | AC_MSG_CHECKING(Default FD_SETSIZE value) |
917 | AC_TRY_RUN([ | |
918 | #if HAVE_STDIO_H | |
919 | #include <stdio.h> | |
920 | #endif | |
921 | #if HAVE_UNISTD_H | |
922 | #include <unistd.h> | |
923 | #endif | |
924 | #if HAVE_SYS_TIME_H | |
925 | #include <sys/time.h> | |
926 | #endif | |
927 | #if HAVE_SYS_SELECT_H | |
928 | #include <sys/select.h> | |
929 | #endif | |
930 | #if HAVE_SYS_TYPES_H | |
931 | #include <sys/types.h> | |
932 | #endif | |
933 | main() { | |
934 | fprintf (fopen("conftestval", "w"), "%d\n", FD_SETSIZE); | |
935 | exit(0); | |
936 | } | |
937 | ], | |
938 | DEFAULT_FD_SETSIZE=`cat conftestval`, | |
939 | DEFAULT_FD_SETSIZE=256, | |
940 | DEFAULT_FD_SETSIZE=256) | |
941 | AC_MSG_RESULT($DEFAULT_FD_SETSIZE) | |
942 | AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE) | |
943 | ||
5c51415d | 944 | dnl Not cached since people are likely to tune this |
234967c9 | 945 | AC_MSG_CHECKING(Maximum number of filedescriptors we can open) |
946 | AC_TRY_RUN([ | |
8cca06da | 947 | #include <stdio.h> |
234967c9 | 948 | #include <unistd.h> |
30a4f2a8 | 949 | #include <sys/time.h> /* needed on FreeBSD */ |
234967c9 | 950 | #include <sys/param.h> |
951 | #include <sys/resource.h> | |
952 | main() { | |
953 | int i,j; | |
df087e68 | 954 | #if __CYGWIN32__ |
955 | /* getrlimit and sysconf returns bogous values on cygwin32. | |
956 | * Number of fds is virtually unlimited in cygwin (sys/param.h) | |
957 | */ | |
958 | i = NOFILE; | |
959 | #else | |
234967c9 | 960 | #if HAVE_SETRLIMIT |
961 | struct rlimit rl; | |
962 | #if defined(RLIMIT_NOFILE) | |
963 | if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { | |
964 | perror("getrlimit: RLIMIT_NOFILE"); | |
965 | } else { | |
966 | rl.rlim_cur = rl.rlim_max; /* set it to the max */ | |
967 | if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { | |
968 | perror("setrlimit: RLIMIT_NOFILE"); | |
969 | } | |
970 | } | |
971 | #elif defined(RLIMIT_OFILE) | |
972 | if (getrlimit(RLIMIT_OFILE, &rl) < 0) { | |
973 | perror("getrlimit: RLIMIT_OFILE"); | |
974 | } else { | |
975 | rl.rlim_cur = rl.rlim_max; /* set it to the max */ | |
976 | if (setrlimit(RLIMIT_OFILE, &rl) < 0) { | |
977 | perror("setrlimit: RLIMIT_OFILE"); | |
978 | } | |
979 | } | |
980 | #endif /* RLIMIT_NOFILE */ | |
981 | #endif /* HAVE_SETRLIMIT */ | |
982 | #if HAVE_SYSCONF && defined(_SC_OPEN_MAX) | |
983 | i = sysconf(_SC_OPEN_MAX); | |
3f6fcd8a | 984 | #elif HAVE_GETDTABLESIZE && !defined(__linux__) |
234967c9 | 985 | i = getdtablesize(); |
986 | #elif defined(OPEN_MAX) | |
987 | i = OPEN_MAX; | |
988 | #elif defined(NOFILE) | |
989 | i = NOFILE; | |
990 | #elif defined(_NFILE) | |
991 | i = _NFILE; | |
992 | #else | |
993 | while((j=open("/dev/null", 0)) > 0) i=j; | |
0a5b9b32 | 994 | close(i); close(i-1); |
995 | i++; | |
234967c9 | 996 | #endif |
df087e68 | 997 | #endif /* __CYGWIN32__ */ |
234967c9 | 998 | fprintf (fopen("conftestval", "w"), "%d\n", i); |
999 | exit(0); | |
1000 | } | |
1001 | ], | |
431d84c5 | 1002 | SQUID_MAXFD=`cat conftestval`, |
1003 | SQUID_MAXFD=256, | |
1004 | SQUID_MAXFD=256) | |
1005 | AC_MSG_RESULT($SQUID_MAXFD) | |
1006 | AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD) | |
b9cc811d | 1007 | if test "$SQUID_MAXFD" -lt 512 ; then |
80ab193b | 1008 | echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your" |
1009 | echo " cache will be very busy. Please see the FAQ page" | |
043e3d78 | 1010 | echo " http://squid.nlanr.net/Squid/FAQ/FAQ-11.html#filedescriptors" |
e692ff35 | 1011 | echo " on how to increase your filedescriptor limit" |
933cc58d | 1012 | sleep 10 |
80ab193b | 1013 | fi |
234967c9 | 1014 | |
5c51415d | 1015 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 1016 | AC_MSG_CHECKING(Default UDP send buffer size) |
1017 | AC_TRY_RUN([ | |
8cca06da | 1018 | #include <stdlib.h> |
1019 | #include <stdio.h> | |
30a4f2a8 | 1020 | #include <sys/types.h> |
1021 | #include <sys/socket.h> | |
1022 | #include <netinet/in.h> | |
1023 | main () | |
1024 | { | |
1025 | int fd,val=0,len=sizeof(int); | |
1026 | if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); | |
1027 | if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); | |
1028 | if (val<=0) exit(1); | |
1029 | fprintf (fopen("conftestval", "w"), "%d\n", val); | |
1030 | exit(0); | |
1031 | } | |
1032 | ], | |
1033 | SQUID_UDP_SO_SNDBUF=`cat conftestval`, | |
1c481e00 | 1034 | SQUID_UDP_SO_SNDBUF=16384, |
1035 | SQUID_UDP_SO_SNDBUF=16384) | |
30a4f2a8 | 1036 | AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF) |
1037 | AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF) | |
1038 | ||
5c51415d | 1039 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 1040 | AC_MSG_CHECKING(Default UDP receive buffer size) |
1041 | AC_TRY_RUN([ | |
8cca06da | 1042 | #include <stdlib.h> |
1043 | #include <stdio.h> | |
30a4f2a8 | 1044 | #include <sys/types.h> |
1045 | #include <sys/socket.h> | |
1046 | #include <netinet/in.h> | |
1047 | main () | |
1048 | { | |
1049 | int fd,val=0,len=sizeof(int); | |
1050 | if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); | |
1051 | if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); | |
1052 | if (val <= 0) exit(1); | |
1053 | fprintf (fopen("conftestval", "w"), "%d\n", val); | |
1054 | exit(0); | |
1055 | } | |
1056 | ], | |
1057 | SQUID_UDP_SO_RCVBUF=`cat conftestval`, | |
1c481e00 | 1058 | SQUID_UDP_SO_RCVBUF=16384, |
1059 | SQUID_UDP_SO_RCVBUF=16384) | |
30a4f2a8 | 1060 | AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF) |
1061 | AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF) | |
1062 | ||
5c51415d | 1063 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 1064 | AC_MSG_CHECKING(Default TCP send buffer size) |
1065 | AC_TRY_RUN([ | |
8cca06da | 1066 | #include <stdlib.h> |
1067 | #include <stdio.h> | |
30a4f2a8 | 1068 | #include <sys/types.h> |
1069 | #include <sys/socket.h> | |
1070 | #include <netinet/in.h> | |
1071 | main () | |
1072 | { | |
1073 | int fd,val=0,len=sizeof(int); | |
1074 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); | |
1075 | if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); | |
1076 | if (val <= 0) exit(1); | |
1077 | fprintf (fopen("conftestval", "w"), "%d\n", val); | |
1078 | exit(0); | |
1079 | } | |
1080 | ], | |
1081 | SQUID_TCP_SO_SNDBUF=`cat conftestval`, | |
1c481e00 | 1082 | SQUID_TCP_SO_SNDBUF=16384, |
1083 | SQUID_TCP_SO_SNDBUF=16384) | |
30a4f2a8 | 1084 | AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF) |
1085 | AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF) | |
1086 | ||
5c51415d | 1087 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 1088 | AC_MSG_CHECKING(Default TCP receive buffer size) |
1089 | AC_TRY_RUN([ | |
8cca06da | 1090 | #include <stdlib.h> |
1091 | #include <stdio.h> | |
30a4f2a8 | 1092 | #include <sys/types.h> |
1093 | #include <sys/socket.h> | |
1094 | #include <netinet/in.h> | |
1095 | main () | |
1096 | { | |
1097 | int fd,val=0,len=sizeof(int); | |
1098 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); | |
1099 | if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); | |
1100 | if (val <= 0) exit(1); | |
1101 | fprintf (fopen("conftestval", "w"), "%d\n", val); | |
1102 | exit(0); | |
1103 | } | |
1104 | ], | |
1105 | SQUID_TCP_SO_RCVBUF=`cat conftestval`, | |
1c481e00 | 1106 | SQUID_TCP_SO_RCVBUF=16384, |
1107 | SQUID_TCP_SO_RCVBUF=16384) | |
30a4f2a8 | 1108 | AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF) |
1109 | AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF) | |
1110 | ||
5c51415d | 1111 | AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist, |
1112 | AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist[0];], | |
1113 | ac_cv_needs_sys_errlist="no", | |
1114 | ac_cv_needs_sys_errlist="yes") | |
1115 | ) | |
1116 | if test "$ac_cv_needs_sys_errlist" = "yes" ; then | |
1117 | AC_DEFINE(NEED_SYS_ERRLIST) | |
1118 | fi | |
30a4f2a8 | 1119 | |
5c51415d | 1120 | dnl Not cached since people are likely to change this |
6bf65235 | 1121 | AC_MSG_CHECKING(for libresolv _dns_ttl_ hack) |
1122 | AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;, | |
1123 | [AC_MSG_RESULT(yes) | |
1124 | AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)], | |
1125 | AC_MSG_RESULT(no)) | |
1126 | ||
090089c4 | 1127 | dnl Need the debugging version of malloc if available |
1128 | XTRA_OBJS='' | |
6509a1a0 | 1129 | if test "$ac_cv_lib_malloc_main" = "yes" ; then |
090089c4 | 1130 | if test -r /usr/lib/debug/malloc.o ; then |
1131 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o" | |
1132 | fi | |
1133 | if test -r /usr/lib/debug/mallocmap.o ; then | |
1134 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o" | |
1135 | fi | |
1136 | fi | |
2bbd722b | 1137 | |
090089c4 | 1138 | AC_SUBST(XTRA_OBJS) |
1139 | ||
38fea766 | 1140 | if test -z "$XTRA_LIBS"; then |
1141 | XTRA_LIBS="$LIBS" | |
0f5a16f8 | 1142 | dnl -lcrypt is set in CRYPTLIB |
1143 | XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lcrypt//"` | |
1144 | dnl -lpthread is set in PTHREADLIB | |
1145 | XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lpthread//"` | |
1146 | dnl minor cleanup | |
1147 | XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"` | |
38fea766 | 1148 | LIBS='' |
1149 | fi | |
090089c4 | 1150 | AC_SUBST(XTRA_LIBS) |
1151 | ||
090089c4 | 1152 | dnl Clean up after OSF/1 core dump bug |
1153 | rm -f core | |
1154 | ||
1155 | AC_OUTPUT(\ | |
0992a350 | 1156 | ./makefile \ |
090089c4 | 1157 | ./lib/Makefile \ |
a26bdc75 | 1158 | ./include/config.h \ |
090089c4 | 1159 | ./scripts/Makefile \ |
1160 | ./scripts/RunCache \ | |
1161 | ./scripts/RunAccel \ | |
a26bdc75 | 1162 | ./src/Makefile \ |
e550e8b6 | 1163 | ./contrib/Makefile \ |
8a7f0105 | 1164 | $SNMP_MAKEFILE \ |
81280a96 | 1165 | ./icons/Makefile \ |
d4fb069d | 1166 | ./errors/Makefile \ |
e7814e83 | 1167 | ./auth_modules/dummy \ |
dbfa0154 | 1168 | ./auth_modules/NCSA/Makefile \ |
090089c4 | 1169 | ) |