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