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