]> git.ipfire.org Git - thirdparty/squid.git/blob - configure.in
Removed unused variable "i".
[thirdparty/squid.git] / configure.in
1 dnl
2 dnl Configuration input file for Squid
3 dnl
4 dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
5 dnl
6 dnl $Id: configure.in,v 1.227 2001/08/03 15:12:58 adrian Exp $
7 dnl
8 dnl
9 dnl
10 AC_INIT(src/main.c)
11 AC_CONFIG_HEADER(include/autoconf.h)
12 AC_REVISION($Revision: 1.227 $)dnl
13 AC_PREFIX_DEFAULT(/usr/local/squid)
14 AC_CONFIG_AUX_DIR(cfgaux)
15
16 AC_CANONICAL_HOST
17
18 CRYPTLIB=''
19 REGEXLIB='' # -lregex
20 LIBREGEX='' # libregex.a
21
22 dnl use directory structure of cached as default (hack)
23 if test "$libexecdir" = '${exec_prefix}/libexec' &&
24 test "$localstatedir" = '${prefix}/var'; then
25 libexecdir='${prefix}/libexec/squid'
26 localstatedir='${prefix}'
27 fi
28
29 dnl use .exe suffix for executables on cygwin32 platform
30 dnl this should be expanded to a list of platform sensible support requirements.
31 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
32 case "$host_os" in
33 cygwin|cygwin32|os2)
34 exec_suffix=".exe"
35 cgi_suffix=".exe"
36 WIN32_OBJS="win32.o"
37 ;;
38 *)
39 exec_suffix=""
40 cgi_suffix=".cgi"
41 WIN32_OBJS=""
42 ;;
43 esac
44 AC_SUBST(exec_suffix)
45 AC_SUBST(cgi_suffix)
46 AC_SUBST(WIN32_OBJS)
47
48 if test -z "$CACHE_HTTP_PORT"; then
49 CACHE_HTTP_PORT="3128"
50 fi
51 if test -z "$CACHE_ICP_PORT"; then
52 CACHE_ICP_PORT="3130"
53 fi
54
55 dnl Subsitutions
56 AC_SUBST(CACHE_HTTP_PORT)
57 AC_SUBST(CACHE_ICP_PORT)
58
59 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host")
60
61 dnl Set default LDFLAGS
62 if test -z "$LDFLAGS"; then
63 LDFLAGS="-g"
64 fi
65
66 PRESET_CFLAGS="$CFLAGS"
67
68 dnl Check for GNU cc
69 AC_PROG_CC
70
71 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
72 case "$host" in
73 mab-next-nextstep3)
74 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
75 ;;
76 esac
77
78 dnl Set Default CFLAGS
79 if test -z "$PRESET_CFLAGS"; then
80 if test "$GCC" = "yes"; then
81 case "$host" in
82 *-sun-sunos*)
83 # sunos has too many warnings for this to be useful
84 # motorola too
85 ;;
86 *m88k*)
87 # Motorola cc/ld does not like -02 but is ok on -O
88 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
89 ;;
90 *)
91 CFLAGS="$CFLAGS -Wall"
92 ;;
93 esac
94 else
95 case "$host" in
96 *mips-sgi-irix6.*)
97 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
98 CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \
99 -woff 1009,1014,1048,1110,1116,1185,1188,1204,1230,1233 \
100 -Wl,-woff,85,-woff,84,-woff,134 \
101 -nostdinc -I/usr/include -D_BSD_SIGNALS"
102 ;;
103 alpha-dec-osf4.*)
104 # Mogul says DEC compilers take both -g and -O2
105 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
106 CFLAGS="$CFLAGS -O2"
107 ;;
108 *)
109 ;;
110 esac
111 fi
112 fi
113
114 dnl Set LDFLAGS
115 if test -z "$PRESET_LDFLAGS"; then
116 if test "$GCC" = "yes"; then
117 case "$host" in
118 *)
119 # nothing
120 ;;
121 esac
122 else
123 case "$host" in
124 *mips-sgi-irix6.*)
125 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
126 LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32"
127 ;;
128 esac
129 fi
130 fi
131
132 dnl Enable optional modules
133 AC_ARG_ENABLE(dlmalloc,
134 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
135 [
136 case "$enableval" in
137 'yes')
138 use_dlmalloc="yes"
139 LIBDLMALLOC="libdlmalloc.a"
140 LIB_MALLOC="-L../lib -ldlmalloc"
141 echo "dlmalloc enabled"
142 ;;
143 'no')
144 use_dlmalloc="no"
145 echo "dlmalloc disabled"
146 ;;
147 *) use_dlmalloc="yes"
148 LIB_MALLOC="$enableval"
149 echo "dlmalloc enabled with $LIB_MALLOC"
150 esac
151 ])
152 if test "${use_dlmalloc-unset}" = unset; then
153 case "$host" in
154 i386-*-solaris2.*)
155 echo "Enabling dlmalloc for $host"
156 use_dlmalloc="yes"
157 LIBDLMALLOC="libdlmalloc.a"
158 LIB_MALLOC="-L../lib -ldlmalloc"
159 ;;
160 esac
161 fi
162 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
163 # Ok. dlmalloc was enabled before, but state may be changed.
164 # we have to test these again
165 unset ac_cv_func_mallinfo
166 unset ac_cv_func_mallocblksize
167 unset ac_cv_func_free
168 unset ac_cv_func_realloc
169 unset ac_cv_func_memalign
170 unset ac_cv_func_valloc
171 unset ac_cv_func_pvalloc
172 unset ac_cv_func_calloc
173 unset ac_cv_func_cfree
174 unset ac_cv_func_malloc_trim
175 unset ac_cv_func_malloc_usable_size
176 unset ac_cv_func_malloc_stats
177 unset ac_cv_func_mallinfo
178 unset ac_cv_func_mallopt
179 unset ac_cv_lib_gnumalloc
180 unset ac_cv_header_gnumalloc_h
181 unset ac_cv_lib_malloc
182 unset ac_cv_enabled_dlmalloc
183 fi
184 if test "$use_dlmalloc" = yes; then
185 ac_cv_func_mallinfo="yes"
186 ac_cv_func_mallocblksize="no"
187 ac_cv_func_free="yes"
188 ac_cv_func_realloc="yes"
189 ac_cv_func_memalign="yes"
190 ac_cv_func_valloc="yes"
191 ac_cv_func_pvalloc="yes"
192 ac_cv_func_calloc="yes"
193 ac_cv_func_cfree="yes"
194 ac_cv_func_malloc_trim="yes"
195 ac_cv_func_malloc_usable_size="yes"
196 ac_cv_func_malloc_stats="yes"
197 ac_cv_func_mallopt="yes"
198 ac_cv_lib_gnumalloc="no"
199 ac_cv_header_gnumalloc_h="no"
200 ac_cv_lib_malloc="no"
201 ac_cv_enabled_dlmalloc="yes"
202 fi
203
204 AC_SUBST(LIBDLMALLOC)
205 AC_SUBST(LIB_MALLOC)
206
207 AC_ARG_ENABLE(gnuregex,
208 [ --enable-gnuregex Compile GNUregex],
209 [USE_GNUREGEX=$enableval])
210
211 AC_ARG_ENABLE(xmalloc-debug,
212 [ --enable-xmalloc-debug Do some simple malloc debugging],
213 [ if test "$enableval" = "yes" ; then
214 echo "Malloc debugging enabled"
215 AC_DEFINE(XMALLOC_DEBUG)
216 fi
217 ])
218
219 AC_ARG_ENABLE(xmalloc-debug-trace,
220 [ --enable-xmalloc-debug-trace
221 Detailed trace of memory allocations],
222 [ if test "$enableval" = "yes" ; then
223 echo "Malloc debug trace enabled"
224 AC_DEFINE(XMALLOC_TRACE)
225 AC_DEFINE(XMALLOC_DEBUG)
226 fi
227 ])
228
229 AC_ARG_ENABLE(xmalloc-statistics,
230 [ --enable-xmalloc-statistics
231 Show malloc statistics in status page],
232 [ if test "$enableval" = "yes" ; then
233 echo "Malloc statistics enabled"
234 AC_DEFINE(XMALLOC_STATISTICS)
235 fi
236 ])
237
238 AC_ARG_ENABLE(carp,
239 [ --enable-carp Enable CARP support],
240 [ if test "$enableval" = "yes" ; then
241 echo "CARP support enabled"
242 AC_DEFINE(USE_CARP)
243 fi
244 ])
245
246 AC_ARG_ENABLE(async-io,
247 [ --enable-async-io[=N_THREADS]
248 Shorthand for
249 --with-aio-threads=N_THREADS
250 --with-pthreads
251 --enable-storeio=ufs,aufs],
252 [ case $enableval in
253 yes)
254 with_pthreads=yes
255 STORE_MODULES="ufs aufs"
256 ;;
257 no)
258 ;;
259 *)
260 async_io_threads=$enableval
261 with_pthreads=yes
262 STORE_MODULES="ufs aufs"
263 ;;
264 esac
265 ])
266
267 AC_ARG_WITH(aio-threads,
268 [ --with-aio-threads=N_THREADS
269 Tune the number of worker threads for the aufs object
270 store.],
271 [ async_io_threads=$withval ])
272 if test "$async_io_threads"; then
273 echo "With $async_io_threads AIO threads"
274 with_pthreads=yes
275 AC_DEFINE_UNQUOTED(ASYNC_IO_THREADS,$async_io_threads)
276 fi
277
278 AC_ARG_WITH(pthreads,
279 [ --with-pthreads Use POSIX Threads],
280 [ if test "$enableval" = "yes"; then
281 with_pthreads=yes
282 fi
283 ])
284 if test "$with_pthreads"; then
285 echo "With pthreads"
286 SQUID_PTHREAD_LIB='$(PTHREADLIB)'
287 CFLAGS="$CFLAGS -D_REENTRANT"
288 case "$host" in
289 i386-unknown-freebsd*)
290 if test "$GCC" = "yes" ; then
291 if test -z "$PRESET_LDFLAGS"; then
292 LDFLAGS="$LDFLAGS -pthread"
293 fi
294 fi
295 ;;
296 esac
297 fi
298 AC_SUBST(SQUID_PTHREAD_LIB)
299
300 AC_ARG_ENABLE(storeio,
301 [ --enable-storeio=\"list of modules\"
302 Build support for the list of store I/O modules.
303 The default is only to build the "ufs" module.
304 See src/fs for a list of available modules, or
305 Programmers Guide section <not yet written>
306 for details on how to build your custom store module],
307 [ case $enableval in
308 yes)
309 for module in $srcdir/src/fs/*; do
310 if test -f $module/Makefile.in; then
311 STORE_MODULES="$STORE_MODULES `basename $module`"
312 fi
313 done
314 ;;
315 no)
316 ;;
317 *) STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
318 ;;
319 esac
320 ],
321 [ if test -z "$STORE_MODULES"; then
322 STORE_MODULES="ufs"
323 fi
324 ])
325 echo "Store modules built: $STORE_MODULES"
326 AC_SUBST(STORE_MODULES)
327 STORE_OBJS="fs/`echo $STORE_MODULES|sed -e 's% %.a fs/%g'`.a"
328 AC_SUBST(STORE_OBJS)
329 STORE_LIBS="`echo $STORE_OBJS|sed -e 's%fs/%%g'`"
330 AC_SUBST(STORE_LIBS)
331
332 dnl --enable-heap-replacement compability option
333 AC_ARG_ENABLE(heap-replacement,
334 [ --enable-heap-replacement
335 Backwards compability option. Please use the
336 new --enable-removal-policies directive instead.],
337 [ if test "$enableval" = "yes" ; then
338 echo "--enable-heap-replacement is obsolete. please use the new"
339 echo "--enable-removal-policies directive instead"
340 sleep 5
341 REPL_POLICIES="heap"
342 fi
343 ])
344
345 AC_ARG_ENABLE(removal-policies,
346 [ --enable-removal-policies=\"list of policies\"
347 Build support for the list of removal policies.
348 The default is only to build the "lru" module.
349 See src/repl for a list of available modules, or
350 Programmers Guide section 9.9 for details on how
351 to build your custom policy],
352 [ case $enableval in
353 yes)
354 for module in $srcdir/src/repl/*; do
355 if test -f $module/Makefile.in; then
356 REPL_POLICIES="$REPL_POLICIES `basename $module`"
357 fi
358 done
359 ;;
360 no)
361 ;;
362 *) REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
363 ;;
364 esac
365 ],
366 [ if test -z "$REPL_POLICIES"; then
367 REPL_POLICIES="lru"
368 fi
369 ])
370 echo "Removal policies built: $REPL_POLICIES"
371 AC_SUBST(REPL_POLICIES)
372 REPL_OBJS="repl/`echo $REPL_POLICIES|sed -e 's% %.a repl/%g'`.a"
373 AC_SUBST(REPL_OBJS)
374 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
375 AC_SUBST(REPL_LIBS)
376
377 OPT_PINGER_EXE=''
378 AC_ARG_ENABLE(icmp,
379 [ --enable-icmp Enable ICMP pinging],
380 [ if test "$enableval" = "yes" ; then
381 echo "ICMP enabled"
382 AC_DEFINE(USE_ICMP)
383 OPT_PINGER_EXE='$(OPT_PINGER_EXE)'
384 fi
385 ])
386 AC_SUBST(OPT_PINGER_EXE)
387
388 AC_ARG_ENABLE(delay-pools,
389 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
390 [ if test "$enableval" = "yes" ; then
391 echo "Delay pools enabled"
392 DELAY_OBJS='$(DELAY_OBJS)'
393 AC_DEFINE(DELAY_POOLS)
394 fi
395 ])
396 AC_SUBST(DELAY_OBJS)
397
398 AC_ARG_ENABLE(mem-gen-trace,
399 [ --enable-mem-gen-trace Do trace of memory stuff],
400 [ if test "$enableval" = "yes" ; then
401 echo "Memory trace (to file) enabled"
402 AC_DEFINE(MEM_GEN_TRACE)
403 fi
404 ])
405
406 AC_ARG_ENABLE(useragent-log,
407 [ --enable-useragent-log Enable logging of User-Agent header],
408 [ if test "$enableval" = "yes" ; then
409 echo "User-Agent logging enabled"
410 AC_DEFINE(USE_USERAGENT_LOG)
411 fi
412 ])
413
414 AC_ARG_ENABLE(referer-log,
415 [ --enable-referer-log Enable logging of Referer header],
416 [ if test "$enableval" = "yes" ; then
417 echo "Referer logging enabled"
418 AC_DEFINE(USE_REFERER_LOG)
419 fi
420 ])
421
422 AC_ARG_ENABLE(wccp,
423 [ --disable-wccp Disable Web Cache Coordination Protocol],
424 [ if test "$enableval" = "no" ; then
425 echo "Web Cache Coordination Protocol disabled"
426 AC_DEFINE(USE_WCCP, 0)
427 else
428 AC_DEFINE(USE_WCCP, 1)
429 fi
430 ])
431
432 AC_ARG_ENABLE(kill-parent-hack,
433 [ --enable-kill-parent-hack
434 Kill parent on shutdown],
435 [ if test "$enableval" = "yes" ; then
436 echo "Kill parent on shutdown"
437 AC_DEFINE(KILL_PARENT_OPT)
438 fi
439 ])
440
441 AC_ARG_ENABLE(snmp,
442 [ --enable-snmp Enable SNMP monitoring],
443 [ if test "$enableval" = "yes" ; then
444 echo "SNMP monitoring enabled"
445 AC_DEFINE(SQUID_SNMP)
446 SNMPLIB='-L../snmplib -lsnmp'
447 SNMP_OBJS='$(SNMP_OBJS)'
448 SNMP_MAKEFILE=./snmplib/Makefile
449 makesnmplib=snmplib
450 fi
451 ])
452 AC_SUBST(SNMPLIB)
453 AC_SUBST(SNMP_OBJS)
454 AC_SUBST(makesnmplib)
455
456 AC_ARG_ENABLE(time-hack,
457 [ --enable-time-hack Update internal timestamp only once per second],
458 [ if test "$enableval" = "yes" ; then
459 echo "Update internal timestamp only once per second"
460 AC_DEFINE(ALARM_UPDATES_TIME)
461 fi
462 ])
463
464 AC_ARG_ENABLE(cachemgr-hostname,
465 [ --enable-cachemgr-hostname[=hostname]
466 Make cachemgr.cgi default to this host],
467 [ case $enableval in
468 yes)
469 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()])
470 echo "Cachemgr default hostname == host where cachemgr runs"
471 ;;
472 no)
473 : # Nothing to do..
474 ;;
475 *)
476 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
477 echo "Cachemgr default hostname set to ${enableval}"
478 ;;
479 esac
480 ])
481
482 AC_ARG_ENABLE(arp-acl,
483 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
484 [ if test "$enableval" = "yes" ; then
485 echo "ARP ACL lists enabled (ether address)"
486 case "$host" in
487 *-pc-linux-*)
488 ;;
489 *)
490 echo "WARNING: ARP ACL support is only currently supported on Linux"
491 echo " ethernet interfaces, probably won't work on $host."
492 sleep 10
493 ;;
494 esac
495 AC_DEFINE(USE_ARP_ACL)
496 fi
497 ])
498
499 AC_ARG_ENABLE(htcp,
500 [ --enable-htcp Enable HTCP protocol],
501 [ if test "$enableval" = "yes" ; then
502 echo "HTCP enabled"
503 HTCP_OBJS='$(HTCP_OBJS)'
504 AC_DEFINE(USE_HTCP)
505 fi
506 ])
507 AC_SUBST(HTCP_OBJS)
508
509 AC_ARG_ENABLE(ssl,
510 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
511 [ if test "$enableval" != "no"; then
512 echo "SSL gatewaying enabled"
513 AC_DEFINE(USE_SSL)
514 SSL_OBJS='$(SSL_OBJS)'
515 SSLLIB='-lssl -lcrypto'
516 USE_OPENSSL=1
517 fi
518 ])
519
520 AC_ARG_WITH(openssl,
521 [ --with-openssl[=prefix]
522 Compile with the OpenSSL libraries. The path to
523 the OpenSSL development libraries and headers
524 installation can be specified if outside of the
525 system standard directories],
526 [
527 case "$with_ssl" in
528 yes)
529 USE_OPENSSL=1
530 ;;
531 no)
532 USE_OPENSSL=
533 ;;
534 *)
535 SSLLIBDIR="$with_ssl/lib"
536 SSLINC="-I$with_ssl/include"
537 USE_OPENSSL=1
538 esac
539 ])
540
541 if test -n "$USE_OPENSSL"; then
542 AC_DEFINE(USE_OPENSSL)
543 if test -z "$SSLLIB"; then
544 SSLLIB="-lcrypto" # for MD5 routines
545 fi
546 fi
547 if test -n "$SSLLIBDIR"; then
548 SSLLIB="-L$SSLLIBDIR $SSLLIB"
549 fi
550 if test -n "$SSLINC"; then
551 CFLAGS="$CFLAGS $SSLINC"
552 fi
553 AC_SUBST(SSL_OBJS)
554 AC_SUBST(SSLLIB)
555
556 AC_ARG_ENABLE(forw-via-db,
557 [ --enable-forw-via-db Enable Forw/Via database],
558 [ if test "$enableval" = "yes" ; then
559 echo "FORW-VIA enabled"
560 AC_DEFINE(FORW_VIA_DB)
561 fi
562 ])
563
564 AC_ARG_ENABLE(cache-digests,
565 [ --enable-cache-digests Use Cache Digests
566 see http://www.squid-cache.org/FAQ/FAQ-16.html],
567 [ if test "$enableval" = "yes" ; then
568 echo "USE_CACHE_DIGESTS enabled"
569 AC_DEFINE(USE_CACHE_DIGESTS)
570 fi
571 ])
572
573 dnl Select Error language
574 AC_ARG_ENABLE(err-language,
575 [ --enable-err-language=lang
576 Select language for Error pages (see errors dir) ],
577 [
578 if test -d $srcdir/errors/$enableval; then
579 ERR_LANGUAGE=$enableval
580 else
581 echo "ERROR! Unknown language $enableval, see errors/"
582 exit 1
583 fi
584 ],[ERR_LANGUAGE="English"])
585 AC_SUBST(ERR_LANGUAGE)
586
587 dnl Size of COSS memory buffer
588 AC_ARG_WITH(coss-membuf-size,
589 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
590 [ if test "$with_coss_membuf_size"; then
591 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
592 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size)
593 fi
594 ])
595
596 dnl Enable poll()
597 AC_ARG_ENABLE(poll,
598 [ --enable-poll Enable poll() instead of select(). Normally poll
599 is preferred over select, but configure knows poll
600 is broken on some platforms. If you think you are
601 smarter than the configure script, you may enable
602 poll with this option.
603 --disable-poll Disable the use of poll().],
604 [
605 case "$enableval" in
606 yes)
607 echo "Forcing poll() to be enabled"
608 ac_cv_func_poll='yes'
609 ;;
610 no)
611 echo "Forcing poll() to be disabled"
612 ac_cv_func_poll='no'
613 ;;
614 esac
615 ])
616
617 dnl Disable HTTP violations
618 AC_ARG_ENABLE(http-violations,
619 [ --disable-http-violations
620 This allows you to remove code which is known to
621 violate the HTTP protocol specification.],
622 [ if test "$enableval" = "no" ; then
623 echo "Disabling HTTP Violations"
624 AC_DEFINE(HTTP_VIOLATIONS, 0)
625 else
626 AC_DEFINE(HTTP_VIOLATIONS, 1)
627 fi
628 ])
629
630 dnl Enable IP-Filter Transparent Proxy
631 AC_ARG_ENABLE(ipf-transparent,
632 [ --enable-ipf-transparent
633 Enable Transparent Proxy support for systems
634 using IP-Filter network address redirection.],
635 [ if test "$enableval" = "yes" ; then
636 echo "IP-Filter Transparent Proxy enabled"
637 AC_DEFINE(IPF_TRANSPARENT)
638 IPF_TRANSPARENT="yes"
639 fi
640 ])
641
642 dnl Enable Linux Netfilter (2.4) Transparent Proxy
643 AC_ARG_ENABLE(linux-netfilter,
644 [ --enable-linux-netfilter
645 Enable Transparent Proxy support for Linux 2.4.],
646 [ if test "$enableval" = "yes" ; then
647 echo "Linux-Netfilter Transparent Proxy enabled"
648 AC_DEFINE(LINUX_NETFILTER)
649 LINUX_NETFILTER="yes"
650 fi
651 ])
652
653 dnl Enable Leak Finding Functions
654 AC_ARG_ENABLE(leakfinder,
655 [ --enable-leakfinder
656 Enable Leak Finding code. Enabling this alone
657 does nothing; you also have to modify the source
658 code to use the leak finding functions. Probably
659 Useful for hackers only.],
660 [ if test "$enableval" = "yes" ; then
661 echo "Leak-Finding enabled"
662 AC_DEFINE(USE_LEAKFINDER)
663 LEAKFINDER_OBJS='$(LEAKFINDER_OBJS)'
664 USE_LEAKFINDER="yes"
665 fi
666 ])
667 AC_SUBST(LEAKFINDER_OBJS)
668
669 AC_ARG_ENABLE(ident-lookups,
670 [ --disable-ident-lookups
671 This allows you to remove code that performs
672 Ident (RFC 931) lookups.],
673 [ if test "$enableval" = "no" ; then
674 echo "Disabling Ident Lookups"
675 AC_DEFINE(USE_IDENT, 0)
676 else
677 AC_DEFINE(USE_IDENT, 1)
678 fi
679 ])
680
681 use_dnsserver=
682 AC_ARG_ENABLE(internal-dns,
683 [ --disable-internal-dns This prevents Squid from directly sending and
684 receiving DNS messages, and instead enables the
685 old external 'dnsserver' processes.],
686 [ if test "$enableval" = "no" ; then
687 echo "Disabling Internal DNS queries"
688 use_dnsserver="yes"
689 fi
690 ])
691 if test "$use_dnsserver" = "yes"; then
692 AC_DEFINE(USE_DNSSERVERS)
693 OPT_DNSSERVER_EXE='$(OPT_DNSSERVER_EXE)'
694 DNS_OBJS='dns.o'
695 else
696 OPT_DNSSERVER_EXE=''
697 DNS_OBJS='dns_internal.o'
698 fi
699 AC_SUBST(OPT_DNSSERVER_EXE)
700 AC_SUBST(DNS_OBJS)
701
702
703 AC_ARG_ENABLE(truncate,
704 [ --enable-truncate This uses truncate() instead of unlink() when
705 removing cache files. Truncate gives a little
706 performance improvement, but may cause problems
707 when used with async I/O. Truncate uses more
708 filesystem inodes than unlink..],
709 [ if test "$enableval" = "yes" ; then
710 echo "Enabling truncate instead of unlink"
711 AC_DEFINE(USE_TRUNCATE)
712 fi
713 ])
714
715 dnl Enable underscore in hostnames
716 AC_ARG_ENABLE(underscores,
717 [ --enable-underscores Squid by default rejects any host names with _
718 in their name to conform with internet standards.
719 If you disagree with this you may allow _ in
720 hostnames by using this switch, provided that
721 the resolver library on the host where Squid runs
722 does not reject _ in hostnames...],
723 [ if test "$enableval" = "yes" ; then
724 echo "Enabling the use of underscores in host names"
725 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1)
726 fi
727 ])
728
729
730 dnl Select auth schemes modules to build
731 AC_ARG_ENABLE(auth,
732 [ --enable-auth=\"list of auth scheme modules\"
733 Build support for the list of authentication schemes.
734 The default is to build support for the Basic scheme.
735 See src/auth for a list of available modules, or
736 Programmers Guide section authentication schemes
737 for details on how to build your custom auth scheme
738 module],
739 [ case $enableval in
740 yes)
741 for module in $srcdir/src/auth/*; do
742 if test -f $module/Makefile.in; then
743 AUTH_MODULES="$AUTH_MODULES `basename $module`"
744 fi
745 done
746 ;;
747 no)
748 ;;
749 *) AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
750 ;;
751 esac
752 ],
753 [ if test -z "$AUTH_MODULES"; then
754 AUTH_MODULES="basic"
755 fi
756 ])
757 echo "Auth scheme modules built: $AUTH_MODULES"
758 AC_SUBST(AUTH_MODULES)
759 AUTH_OBJS="auth/`echo $AUTH_MODULES|sed -e 's% %.a auth/%g'`.a"
760 AC_SUBST(AUTH_OBJS)
761 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
762 AC_SUBST(AUTH_LIBS)
763
764 dnl Select basic auth scheme helpers to build
765 BASIC_AUTH_HELPERS=""
766 AC_ARG_ENABLE(auth-modules,
767 [ --enable-auth-modules=\"list of helpers\"
768 Backwards compability alias for
769 --enable-basic-auth-helpers],
770 [ echo "--enable-auth-modules is obsolete. Please use the new"
771 echo "option --enable-basic-auth-helpers"
772 sleep 5
773 case "$enableval" in
774 yes)
775 for helper in $srcdir/src/auth/basic/helpers/*; do
776 if test -f $helper/Makefile.in; then
777 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`"
778 fi
779 done
780 ;;
781 no)
782 ;;
783 *)
784 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
785 esac
786 ])
787 AC_ARG_ENABLE(basic-auth-helpers,
788 [ --enable-basic-auth-helpers=\"list of helpers\"
789 This option selects which basic scheme proxy_auth
790 helpers to build and install as part of the normal
791 build process. For a list of available
792 helpers see the src/auth/basic/helpers directory.],
793 [ case "$enableval" in
794 yes)
795 BASIC_AUTH_HELPERS=""
796 for helper in $srcdir/src/auth/basic/helpers/*; do
797 if test -f $helper/Makefile.in; then
798 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`"
799 fi
800 done
801 ;;
802 no)
803 ;;
804 *)
805 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
806 esac
807 ])
808 if test -n "$BASIC_AUTH_HELPERS"; then
809 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
810 fi
811 AC_SUBST(BASIC_AUTH_HELPERS)
812
813 dnl Select ntlm auth helpers to build
814 NTLM_AUTH_HELPERS=
815 AC_ARG_ENABLE(ntlm-auth-helpers,
816 [ --enable-ntlm-auth-helpers=\"list of helpers\"
817 This option selects which proxy_auth ntlm helpers
818 to build and install as part of the normal build
819 process. For a list of available modules see
820 the src/auth/ntlm/helpers directory.],
821 [ case "$enableval" in
822 yes)
823 for helper in $srcdir/src/auth/ntlm/helpers/*; do
824 if test -f $helper/Makefile.in; then
825 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS `basename $helper`"
826 fi
827 done
828 ;;
829 no)
830 ;;
831 *)
832 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
833 esac
834 ])
835 if test -n "$NTLM_AUTH_HELPERS"; then
836 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
837 fi
838 AC_SUBST(NTLM_AUTH_HELPERS)
839
840 dnl Select digest auth scheme helpers to build
841 DIGEST_AUTH_HELPERS=
842 AC_ARG_ENABLE(digest-auth-helpers,
843 [ --enable-digest-auth-helpers=\"list of helpers\"
844 This option selects which digest scheme authentication
845 helpers to build and install as part of the normal build
846 process. For a list of available modules see the
847 src/auth/digest/helpers directory.],
848 [ case "$enableval" in
849 yes)
850 for helper in $srcdir/src/auth/digest/helpers/*; do
851 if test -f $helper/Makefile.in; then
852 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS `basename $helper`"
853 fi
854 done
855 ;;
856 no)
857 ;;
858 *)
859 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
860 esac
861 ])
862 if test -n "$DIGEST_AUTH_HELPERS"; then
863 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
864 fi
865 AC_SUBST(DIGEST_AUTH_HELPERS)
866
867 dnl Enable "NTLM fail open"
868 AC_ARG_ENABLE(ntlm-fail-open,
869 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
870 Authentication steps can allow squid to still authenticate
871 the user.],
872 [ if test "$enableval" = "yes" ; then
873 AC_DEFINE(NTLM_FAIL_OPEN)
874 fi
875 ])
876
877 dnl Disable "unlinkd" code
878 AC_ARG_ENABLE(unlinkd,
879 [ --disable-unlinkd Do not use unlinkd],
880 [ if test "$enableval" = "no" ; then
881 use_unlinkd=no
882 else
883 use_unlinkd=yes
884 fi
885 ],[
886 # Here we should probably use some magic depending on the selected
887 # storage models
888 use_unlinkd=yes
889 ])
890 if test "$use_unlinkd" = "yes"; then
891 echo "unlinkd enabled"
892 AC_DEFINE(USE_UNLINKD)
893 OPT_UNLINKD_EXE='$(OPT_UNLINKD_EXE)'
894 UNLINKD_OBJS='unlinkd.o'
895 else
896 echo "unlinkd disabled"
897 OPT_UNLINKD_EXE=''
898 UNLINKD_OBJS=''
899 fi
900 AC_SUBST(OPT_UNLINKD_EXE)
901 AC_SUBST(UNLINKD_OBJS)
902
903 dnl Enable backtraces on fatal errors
904 AC_ARG_ENABLE(stacktraces,
905 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
906 [ if test "$enableval" = "yes" ; then
907 echo "Enabling automatic stack backtraces on fatal errors"
908 AC_DEFINE(PRINT_STACK_TRACE, 1)
909 fi
910 ])
911
912 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
913 AC_ARG_ENABLE(x_accelerator_vary,
914 [ --enable-x-accelerator-vary Enable support for the X-Accelerator-Vary
915 HTTP header. Can be used to indicate
916 variance within an accelerator setup.
917 Typically used together with other code
918 that adds custom HTTP headers to the requests.],
919 [ if test "$enableval" = "yes" ; then
920 echo "Enabling support for X-Accelerator-Vary"
921 AC_DEFINE(X_ACCELERATOR_VARY, 1)
922 fi
923 ])
924
925 # Force some compilers to use ANSI features
926 #
927 case "$host" in
928 alpha-dec-osf*)
929 if test "$ac_cv_prog_CC" = "cc" ; then
930 echo "adding '-std1' to cc args for $host"
931 CC="cc -std1";
932 ac_cv_prog_CC="$CC"
933 fi
934 ;;
935 *-hp-hpux*)
936 if test "$ac_cv_prog_CC" = "cc" ; then
937 echo "adding '-Ae' to cc args for $host"
938 CC="cc -Ae";
939 ac_cv_prog_CC="$CC"
940 fi
941 ;;
942 esac
943
944 dnl Check for programs
945 AC_PROG_CPP
946 AC_PROG_INSTALL
947 AC_PROG_RANLIB
948 AC_PROG_LN_S
949 AC_PATH_PROG(SH, sh, /bin/sh)
950 AC_PATH_PROG(FALSE, false, /usr/bin/false)
951 AC_PATH_PROG(TRUE, true, /usr/bin/true)
952 AC_PATH_PROG(RM, rm, $FALSE)
953 AC_PATH_PROG(MV, mv, $FALSE)
954 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
955 AC_PATH_PROG(LN, ln, cp)
956 AC_PATH_PROG(PERL, perl, none)
957 AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
958 AC_PATH_PROG(AR, ar, $FALSE)
959
960 if test "$ac_cv_path_PERL" = "none"; then
961 echo "Perl is required to compile Squid"
962 echo "Please install Perl and then re-run configure"
963 exit 1
964 fi
965
966 case "$host" in
967 *-hp-hpux*)
968 echo "Disabling 'ranlib' for HP-UX..."
969 RANLIB=":"
970 ;;
971 esac
972
973 dnl set $(AR)
974 AR_R="$AR r"
975 case "$host" in
976 *-next-nextstep3)
977 AR="libtool -o"
978 ;;
979 esac
980 AC_SUBST(AR_R)
981
982 dnl Check for headers
983 AC_HEADER_DIRENT
984 AC_HEADER_STDC
985
986 AC_CHECK_HEADERS( \
987 arpa/inet.h \
988 arpa/nameser.h \
989 assert.h \
990 bstring.h \
991 config.h \
992 crypt.h \
993 ctype.h \
994 errno.h \
995 execinfo.h \
996 fcntl.h \
997 getopt.h \
998 gnumalloc.h \
999 grp.h \
1000 ip_compat.h \
1001 ip_fil_compat.h \
1002 ip_fil.h \
1003 ip_nat.h \
1004 libc.h \
1005 limits.h \
1006 linux/netfilter_ipv4.h \
1007 malloc.h \
1008 math.h \
1009 memory.h \
1010 mount.h \
1011 net/if.h \
1012 netdb.h \
1013 netinet/if_ether.h \
1014 netinet/in.h \
1015 netinet/tcp.h \
1016 netinet/ip_compat.h \
1017 netinet/ip_fil_compat.h \
1018 netinet/ip_fil.h \
1019 netinet/ip_nat.h \
1020 openssl/err.h \
1021 openssl/md5.h \
1022 openssl/ssl.h \
1023 poll.h \
1024 pwd.h \
1025 regex.h \
1026 resolv.h \
1027 sched.h \
1028 signal.h \
1029 stdarg.h \
1030 stddef.h \
1031 stdio.h \
1032 stdlib.h \
1033 string.h \
1034 strings.h \
1035 sys/file.h \
1036 sys/ioctl.h \
1037 sys/mount.h \
1038 sys/msg.h \
1039 sys/param.h \
1040 sys/resource.h \
1041 sys/select.h\
1042 sys/socket.h \
1043 sys/stat.h \
1044 sys/statvfs.h \
1045 sys/syscall.h \
1046 sys/time.h \
1047 sys/types.h \
1048 sys/un.h \
1049 sys/vfs.h \
1050 sys/wait.h \
1051 syslog.h \
1052 time.h \
1053 unistd.h \
1054 varargs.h \
1055 byteswap.h \
1056 glib.h \
1057 stdint.h \
1058 inttypes.h \
1059 )
1060
1061 AC_C_CONST
1062 AC_C_BIGENDIAN
1063
1064 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1065 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1066 [foo("bar")],
1067 ac_cv_have_ansi_prototypes="yes",
1068 ac_cv_have_ansi_prototypes="no")
1069 ])
1070 if test $ac_cv_have_ansi_prototypes = "yes" ; then
1071 AC_DEFINE(HAVE_ANSI_PROTOTYPES)
1072 fi
1073
1074 AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [
1075 AC_TRY_COMPILE([#include <time.h>
1076 #include <sys/time.h>],
1077 [struct tm foo;
1078 foo.tm_gmtoff = 0;],
1079 ac_cv_have_tm_gmoff="yes",
1080 ac_cv_have_tm_gmoff="no")
1081 ])
1082 if test $ac_cv_have_tm_gmoff = "yes" ; then
1083 AC_DEFINE(HAVE_TM_GMTOFF)
1084 fi
1085
1086 AC_CACHE_CHECK(for struct mallinfo,ac_cv_have_struct_mallinfo, [
1087 AC_TRY_COMPILE([#include <sys/types.h>
1088 #if HAVE_MALLOC_H
1089 #include <malloc.h>
1090 #endif],
1091 [struct mallinfo foo;
1092 foo.arena = 0;
1093 foo.ordblks = 0;
1094 foo.smblks = 0;
1095 foo.hblks = 0;
1096 foo.hblkhd = 0;
1097 foo.uordblks = 0;
1098 foo.fordblks = 0;
1099 foo.keepcost = 0;],
1100 ac_cv_have_struct_mallinfo="yes",
1101 ac_cv_have_struct_mallinfo="no")
1102 ])
1103 if test $ac_cv_have_struct_mallinfo = "yes" ; then
1104 AC_DEFINE(HAVE_STRUCT_MALLINFO)
1105 fi
1106
1107 AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [
1108 AC_TRY_COMPILE([#include <sys/types.h>
1109 #include <malloc.h>],
1110 [struct mallinfo foo;
1111 foo.mxfast = 0;],
1112 ac_cv_have_ext_mallinfo="yes",
1113 ac_cv_have_ext_mallinfo="no")
1114 ])
1115 if test $ac_cv_have_ext_mallinfo = "yes" ; then
1116 AC_DEFINE(HAVE_EXT_MALLINFO)
1117 fi
1118
1119 AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [
1120 AC_TRY_COMPILE([
1121 #if HAVE_SYS_TIME_H
1122 #include <sys/time.h>
1123 #endif
1124 #if HAVE_SYS_RESOURCE_H
1125 #include <sys/resource.h>
1126 #endif],
1127 [struct rusage R;],
1128 ac_cv_have_struct_rusage="yes",
1129 ac_cv_have_struct_rusage="no")
1130 ])
1131 if test $ac_cv_have_struct_rusage = "yes" ; then
1132 AC_DEFINE(HAVE_STRUCT_RUSAGE)
1133 fi
1134
1135 AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [
1136 AC_TRY_COMPILE([#include <sys/types.h>
1137 #include <netinet/in.h>
1138 #include <netinet/in_systm.h>
1139 #include <netinet/ip.h>
1140 #if defined (__linux__) || defined (__CYGWIN__)
1141 #define ip_hl ihl
1142 #endif
1143 #ifndef __linux__
1144 #ifndef __CYGWIN__
1145 #define iphdr ip
1146 #endif
1147 #endif],
1148 [struct iphdr ip;
1149 ip.ip_hl= 0;],
1150 ac_cv_have_ip_hl="yes",
1151 ac_cv_have_ip_hl="no")
1152 ])
1153 if test $ac_cv_have_ip_hl = "yes" ; then
1154 AC_DEFINE(HAVE_IP_HL)
1155 fi
1156
1157 dnl Check for typedefs
1158 AC_CHECK_SIZEOF(void *)
1159 AC_CHECK_SIZEOF(short)
1160 AC_CHECK_SIZEOF(int)
1161 AC_CHECK_SIZEOF(long)
1162 AC_CHECK_SIZEOF(long long)
1163 AC_CHECK_SIZEOF(__int64)
1164 AC_CHECK_SIZEOF(int16_t)
1165 AC_CHECK_SIZEOF(uint16_t)
1166 AC_CHECK_SIZEOF(u_int16_t)
1167 AC_CHECK_SIZEOF(int32_t)
1168 AC_CHECK_SIZEOF(uint32_t)
1169 AC_CHECK_SIZEOF(u_int32_t)
1170 AC_CHECK_SIZEOF(int64_t)
1171 AC_CHECK_SIZEOF(uint64_t)
1172 AC_CHECK_SIZEOF(u_int64_t)
1173
1174 dnl int16_t
1175 if test "x$ac_cv_sizeof_short" = "x2"; then
1176 AC_CHECK_TYPE(int16_t,short)
1177 elif test "x$ac_cv_sizeof_int" = "x2"; then
1178 AC_CHECK_TYPE(int16_t,int)
1179 fi
1180 dnl u_int16t_t
1181 if test "x$ac_cv_sizeof_uint16_t" = "x2"; then
1182 AC_CHECK_TYPE(u_int16_t,uint16_t)
1183 elif test "x$ac_cv_sizeof_short" = "x2"; then
1184 AC_CHECK_TYPE(u_int16_t,unsigned short)
1185 elif test "x$ac_cv_sizeof_int" = "x2"; then
1186 AC_CHECK_TYPE(u_int16_t,unsigned int)
1187 fi
1188 dnl int32_t
1189 if test "x$ac_cv_sizeof_int" = "x4"; then
1190 AC_CHECK_TYPE(int32_t,int)
1191 elif "x$ac_cv_sizeof_long" = "x4"; then
1192 AC_CHECK_TYPE(int32_t,long)
1193 fi
1194 dnl u_int32_t
1195 if test "x$ac_cv_sizeof_uint32_t" = "x4"; then
1196 AC_CHECK_TYPE(u_int32_t,uint32_t)
1197 elif test "x$ac_cv_sizeof_int" = "x4"; then
1198 AC_CHECK_TYPE(u_int32_t,unsigned int)
1199 elif test "x$ac_cv_sizeof_long" = "x4"; then
1200 AC_CHECK_TYPE(u_int32_t,unsigned long)
1201 fi
1202 dnl int64_t
1203 if test "x$ac_cv_sizeof_long" = "x8"; then
1204 AC_CHECK_TYPE(int64_t,long)
1205 elif test "x$ac_cv_sizeof_long_long" = "x8"; then
1206 AC_CHECK_TYPE(int64_t,long long)
1207 elif test "x$ac_cv_sizeof___int64" = "x8"; then
1208 AC_CHECK_TYPE(int64_t,__int64)
1209 fi
1210 dnl u_int64_t
1211 if test "x$ac_cv_sizeof_uint64_t" = "x8"; then
1212 AC_CHECK_TYPE(u_int64_t,uint64_t)
1213 elif test "x$ac_cv_sizeof_long" = "x8"; then
1214 AC_CHECK_TYPE(u_int64_t,unsigned long)
1215 elif test "x$ac_cv_sizeof_long_long" = "x8"; then
1216 AC_CHECK_TYPE(u_int64_t,unsigned long long)
1217 elif test "x$ac_cv_sizeof___int64" = "x8"; then
1218 AC_CHECK_TYPE(int64_t,unsigned __int64)
1219 fi
1220
1221 AC_CHECK_TYPE(pid_t, int)
1222 AC_CHECK_TYPE(size_t, unsigned int)
1223 AC_CHECK_TYPE(ssize_t, int)
1224 AC_CHECK_TYPE(off_t, int)
1225 AC_CHECK_TYPE(mode_t, u_short)
1226 AC_CHECK_TYPE(fd_mask, int)
1227
1228 dnl Check for special functions
1229 AC_FUNC_ALLOCA
1230
1231
1232 dnl Check for type in sys/socket.h
1233 AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
1234 AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
1235 #include <sys/socket.h>
1236 #if STDC_HEADERS
1237 #include <stdlib.h>
1238 #include <stddef.h>
1239 #endif],
1240 ac_cv_type_socklen_t=yes,
1241 ac_cv_type_socklen_t=no)
1242 ])
1243 if test $ac_cv_type_socklen_t = no; then
1244 AC_DEFINE(socklen_t, int)
1245 fi
1246
1247 dnl Check for mtyp_t in some headers
1248 AC_CACHE_CHECK(for mtyp_t, ac_cv_type_mtyp_t, [
1249 AC_EGREP_CPP([mtyp_t[^a-zA-Z_0-9]], [#include <sys/types.h>
1250 #include <sys/ipc.h>
1251 #include <sys/msg.h>],
1252 ac_cv_type_mtyp_t=yes,
1253 ac_cv_type_mtyp_t=no)
1254 ])
1255 if test $ac_cv_type_mtyp_t = no; then
1256 AC_DEFINE(mtyp_t, long)
1257 fi
1258
1259 dnl Check for needed libraries
1260 AC_CHECK_LIB(nsl, main)
1261 AC_CHECK_LIB(socket, main)
1262
1263 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
1264 echo "skipping libmalloc check (--enable-dlmalloc specified)"
1265 else
1266 AC_CHECK_LIB(gnumalloc, main)
1267 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
1268 echo "Disabling extended malloc functions when using gnumalloc"
1269 ac_cv_func_mallinfo=no
1270 ac_cv_func_mallocblksize=no
1271 ac_cv_func_mallopt=no
1272 else
1273 case "$host" in
1274 *-sun-solaris*)
1275 echo "skipping libmalloc check for $host"
1276 ;;
1277 i386-*-freebsd*)
1278 echo "skipping libmalloc check for $host"
1279 ;;
1280 *)
1281
1282 AC_CHECK_LIB(malloc, main)
1283 ;;
1284 esac
1285 fi
1286 fi
1287
1288 AC_CHECK_LIB(bsd, main)
1289 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
1290 AC_CHECK_LIB(bind, gethostbyname)
1291 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
1292 case "$host" in
1293 i386-*-freebsd*)
1294 echo "skipping libresolv checks for $host"
1295 ;;
1296 *)
1297 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
1298 AC_CHECK_LIB(resolv, main)
1299 ;;
1300 esac
1301 fi
1302 AC_CHECK_LIB(m, main)
1303
1304 dnl Check for libcrypt
1305 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
1306 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1307 AC_SUBST(CRYPTLIB)
1308
1309 dnl Check for libdl, used by auth_modules/PAM
1310 AC_CHECK_LIB(dl, dlopen, [DLLIB="-ldl"])
1311 AC_SUBST(DLLIB)
1312
1313 dnl Check for pthreads
1314 dnl We use pthreads when doing ASYNC I/O
1315 AC_CHECK_LIB(pthread, main, [PTHREADLIB="-lpthread"])
1316 AC_SUBST(PTHREADLIB)
1317
1318 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
1319 dnl Robert Side <rside@aiinc.bc.ca>
1320 dnl Mon, 18 Jan 1999 17:48:00 GMT
1321 case "$host" in
1322 *-pc-sco3.2*)
1323 AC_CHECK_LIB(intl, strftime)
1324 ;;
1325 esac
1326
1327 dnl System-specific library modifications
1328 dnl
1329 case "$host" in
1330 i386-*-solaris2.*)
1331 if test "$GCC" = "yes"; then
1332 echo "Removing -O for gcc on $host"
1333 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1334 fi
1335 ;;
1336 *-sgi-irix*)
1337 echo "Removing -lsocket for IRIX..."
1338 LIBS=`echo $LIBS | sed -e s/-lsocket//`
1339 echo "Removing -lnsl for IRIX..."
1340 LIBS=`echo $LIBS | sed -e s/-lnsl//`
1341 ac_cv_lib_nsl_main=no
1342 echo "Removing -lbsd for IRIX..."
1343 LIBS=`echo $LIBS | sed -e s/-lbsd//`
1344 ;;
1345 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
1346 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
1347 dnl Please change your configure script. AIX doesn't need -lbsd.
1348 *-ibm-aix*)
1349 echo "Removing -lbsd for AIX..."
1350 LIBS=`echo $LIBS | sed -e s/-lbsd//`
1351 dnl From: mlaster@metavillage.com (Mike Laster)
1352 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
1353 dnl So using the internal versions generates a load of warnings
1354 dnl during compile.
1355 echo "disabling snprintf/vsnprintf for $host"
1356 ac_cv_func_snprintf=no
1357 ac_cv_func_vsnprintf=no
1358 ;;
1359 *m88k*)
1360 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
1361 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
1362 ;;
1363 [*-*-solaris2.[0-4]])
1364 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
1365 ;;
1366 [*-sony-newsos[56]*])
1367 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
1368 ;;
1369 esac
1370
1371 # Remove optimization for GCC 2.95.[123]
1372 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
1373 if test "$GCC" = "yes"; then
1374 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
1375 case "$GCCVER" in
1376 [2.95.[123]])
1377 echo "Removing -O for gcc on $host with GCC $GCCVER"
1378 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1379 ;;
1380 esac
1381 fi
1382
1383 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
1384 case "$host" in
1385 *-univel-sysv4.2MP)
1386 if test `uname -v` = "2.03"; then
1387 echo "disabling mallinfo for $host"
1388 ac_cv_func_mallinfo=no
1389 fi
1390 ;;
1391 esac
1392
1393 dnl This has to be before AC_CHECK_FUNCS
1394 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
1395 # when running configure.
1396 if test -z "$ac_cv_func_poll"; then
1397 case "$host" in
1398 [alpha-dec-osf3.*])
1399 # John Kay (jkay@nlanr.net) 19970818
1400 echo "disabling poll for $host..."
1401 ac_cv_func_poll='no'
1402 ;;
1403 [*-hp-hpux*.*])
1404 # Duane Wessels
1405 echo "disabling poll for $host..."
1406 ac_cv_func_poll='no'
1407 ;;
1408 [*-linux-*])
1409 # Henrik Nordstrom (hno@hem.passagen.se) 19980817
1410 # poll is problematic on Linux. We disable it
1411 # by default until Linux gets it right.
1412 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
1413 if test $rev -lt 002002; then
1414 echo "disabling poll for $host < 2.2..."
1415 ac_cv_func_poll='no'
1416 fi
1417 ;;
1418 [powerpc-ibm-aix4.1.*])
1419 # Mike Laster (mlaster@metavillage.com) 19981021
1420 echo "disabling poll for $host..."
1421 ac_cv_func_poll='no'
1422 ;;
1423 [*-pc-sco3.2*])
1424 # Robert Side <rside@aiinc.bc.ca>
1425 # Mon, 18 Jan 1999 17:48:00 GMT
1426 echo "disabling poll for $host..."
1427 ac_cv_func_poll='no'
1428 ;;
1429 esac
1430 fi
1431
1432 dnl Check for library functions
1433 AC_CHECK_FUNCS(\
1434 bcopy \
1435 backtrace_symbols_fd \
1436 crypt \
1437 fchmod \
1438 getdtablesize \
1439 getpagesize \
1440 getrusage \
1441 getspnam \
1442 lrand48 \
1443 mallinfo \
1444 mallocblksize \
1445 mallopt \
1446 memcpy \
1447 memmove \
1448 memset \
1449 mkstemp \
1450 mktime \
1451 mstats \
1452 poll \
1453 pthread_attr_setscope \
1454 pthread_setschedparam \
1455 pthread_attr_setschedparam \
1456 pthread_sigmask \
1457 putenv \
1458 random \
1459 regcomp \
1460 regexec \
1461 regfree \
1462 res_init \
1463 rint \
1464 seteuid \
1465 setgroups \
1466 setpgrp \
1467 setrlimit \
1468 getrlimit \
1469 setsid \
1470 sigaction \
1471 snprintf \
1472 srand48 \
1473 srandom \
1474 statfs \
1475 sysconf \
1476 syslog \
1477 timegm \
1478 vsnprintf \
1479 bswap_16 \
1480 bswap_32 \
1481 )
1482
1483 dnl Yay! Another Linux brokenness. Its not good enough
1484 dnl to know that setresuid() exists, because RedHat 5.0 declares
1485 dnl setresuid() but doesn't implement it.
1486 dnl
1487 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
1488 AC_TRY_RUN([
1489 #include <stdlib.h>
1490 int main() {
1491 if(setresuid(-1,-1,-1)) {
1492 perror("setresuid:");
1493 exit(1);
1494 }
1495 exit(0);
1496 }
1497 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
1498 )
1499 if test "$ac_cv_func_setresuid" = "yes" ; then
1500 AC_DEFINE(HAVE_SETRESUID)
1501 fi
1502
1503 dnl IP-Filter support requires ipf header files. These aren't
1504 dnl installed by default, so we need to check for them
1505 if test "$IPF_TRANSPARENT" ; then
1506 AC_MSG_CHECKING(if IP-Filter header files are installed)
1507 # hold on to your hats...
1508 if test "$ac_cv_header_ip_compat_h" = "yes" ||
1509 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
1510 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
1511 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
1512 have_ipfilter_compat_header="yes"
1513 fi
1514 if test "x$have_ipfilter_compat_header" = "xyes" &&
1515 test "$ac_cv_header_ip_fil_h" = "yes" &&
1516 test "$ac_cv_header_ip_nat_h" = "yes" ; then
1517 IPF_TRANSPARENT="yes"
1518 AC_DEFINE(IPF_TRANSPARENT, 1)
1519 elif test "$have_ipfilter_compat_header" = "yes" &&
1520 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
1521 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
1522 IPF_TRANSPARENT="yes"
1523 AC_DEFINE(IPF_TRANSPARENT, 1)
1524 else
1525 IPF_TRANSPARENT="no"
1526 AC_DEFINE(IPF_TRANSPARENT, 0)
1527 fi
1528 AC_MSG_RESULT($IPF_TRANSPARENT)
1529 fi
1530 if test "$IPF_TRANSPARENT" = "no" ; then
1531 echo "WARNING: Cannot find necessary IP-Filter header files"
1532 echo " Transparent Proxy support WILL NOT be enabled"
1533 sleep 10
1534 fi
1535
1536 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
1537 dnl Shamelessly copied from above
1538 if test "$LINUX_NETFILTER" ; then
1539 AC_MSG_CHECKING(if Linux 2.4 kernel header files are installed)
1540 # hold on to your hats...
1541 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
1542 LINUX_NETFILTER="yes"
1543 AC_DEFINE(LINUX_NETFILTER, 1)
1544 else
1545 LINUX_NETFILTER="no"
1546 AC_DEFINE(LINUX_NETFILTER, 0)
1547 fi
1548 AC_MSG_RESULT($LINUX_NETFILTER)
1549 fi
1550 if test "$LINUX_NETFILTER" = "no" ; then
1551 echo "WARNING: Cannot find necessary Linux 2.4 kernel header files"
1552 echo " Linux 2.4 Transparent Proxy support WILL NOT be enabled"
1553 sleep 10
1554 fi
1555
1556 if test -z "$USE_GNUREGEX" ; then
1557 case "$host" in
1558 *-sun-solaris2.[[0-4]])
1559 USE_GNUREGEX="yes"
1560 ;;
1561 *-next-nextstep*)
1562 USE_GNUREGEX="yes"
1563 ;;
1564 esac
1565 fi
1566 AC_MSG_CHECKING(if GNUregex needs to be compiled)
1567 if test -z "$USE_GNUREGEX"; then
1568 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
1569 USE_GNUREGEX="yes"
1570 else
1571 AC_TRY_COMPILE([#include <sys/types.h>
1572 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
1573 USE_GNUREGEX="no",
1574 USE_GNUREGEX="yes")
1575 fi
1576 fi
1577 AC_MSG_RESULT($USE_GNUREGEX)
1578 if test "$USE_GNUREGEX" = "yes"; then
1579 REGEXLIB="-lregex"
1580 LIBREGEX="libregex.a"
1581 AC_DEFINE(USE_GNUREGEX)
1582 fi
1583 AC_SUBST(REGEXLIB)
1584 AC_SUBST(LIBREGEX)
1585
1586 AC_REPLACE_FUNCS(\
1587 drand48 \
1588 tempnam \
1589 strerror \
1590 )
1591
1592 dnl Not cached since people are likely to tune this
1593 AC_MSG_CHECKING(Default FD_SETSIZE value)
1594 AC_TRY_RUN([
1595 #if HAVE_STDIO_H
1596 #include <stdio.h>
1597 #endif
1598 #if HAVE_UNISTD_H
1599 #include <unistd.h>
1600 #endif
1601 #if HAVE_SYS_TIME_H
1602 #include <sys/time.h>
1603 #endif
1604 #if HAVE_SYS_SELECT_H
1605 #include <sys/select.h>
1606 #endif
1607 #if HAVE_SYS_TYPES_H
1608 #include <sys/types.h>
1609 #endif
1610 main() {
1611 FILE *fp = fopen("conftestval", "w");
1612 fprintf (fp, "%d\n", FD_SETSIZE);
1613 exit(0);
1614 }
1615 ],
1616 DEFAULT_FD_SETSIZE=`cat conftestval`,
1617 DEFAULT_FD_SETSIZE=256,
1618 DEFAULT_FD_SETSIZE=256)
1619 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
1620 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
1621
1622 dnl Not cached since people are likely to tune this
1623 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
1624 dnl damn! FreeBSD's pthreads breaks dup2().
1625 TLDFLAGS="$LDFLAGS"
1626 case $host in
1627 i386-unknown-freebsd*)
1628 if echo "$LDFLAGS" | grep -q pthread; then
1629 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
1630 fi
1631 esac
1632 AC_TRY_RUN([
1633 #include <stdio.h>
1634 #include <unistd.h>
1635 #include <sys/time.h> /* needed on FreeBSD */
1636 #include <sys/param.h>
1637 #include <sys/resource.h>
1638 main() {
1639 FILE *fp;
1640 int i,j;
1641 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
1642 /* getrlimit and sysconf returns bogous values on cygwin32.
1643 * Number of fds is virtually unlimited in cygwin (sys/param.h)
1644 * __CYGWIN32__ is deprecated.
1645 */
1646 i = NOFILE;
1647 #else
1648 #if HAVE_SETRLIMIT
1649 struct rlimit rl;
1650 #if defined(RLIMIT_NOFILE)
1651 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
1652 perror("getrlimit: RLIMIT_NOFILE");
1653 } else {
1654 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1655 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
1656 perror("setrlimit: RLIMIT_NOFILE");
1657 }
1658 }
1659 #elif defined(RLIMIT_OFILE)
1660 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
1661 perror("getrlimit: RLIMIT_OFILE");
1662 } else {
1663 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1664 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
1665 perror("setrlimit: RLIMIT_OFILE");
1666 }
1667 }
1668 #endif /* RLIMIT_NOFILE */
1669 #endif /* HAVE_SETRLIMIT */
1670 /* by starting at 2^14, we will never get higher
1671 than 2^15 for SQUID_MAXFD */
1672 i = j = 1<<14;
1673 while (j) {
1674 j >>= 1;
1675 if (dup2(0, i) < 0) {
1676 i -= j;
1677 } else {
1678 close(i);
1679 i += j;
1680 }
1681 }
1682 i++;
1683 #endif /* IF !DEF CYGWIN */
1684 fp = fopen("conftestval", "w");
1685 fprintf (fp, "%d\n", i);
1686 exit(0);
1687 }
1688 ],
1689 SQUID_MAXFD=`cat conftestval`,
1690 SQUID_MAXFD=256,
1691 SQUID_MAXFD=256)
1692 AC_MSG_RESULT($SQUID_MAXFD)
1693 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD)
1694 if test "$SQUID_MAXFD" -lt 512 ; then
1695 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
1696 echo " cache will be very busy. Please see the FAQ page"
1697 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
1698 echo " on how to increase your filedescriptor limit"
1699 sleep 10
1700 fi
1701 LDFLAGS="$TLDFLAGS"
1702
1703 dnl Not cached since people are likely to tune this
1704 AC_MSG_CHECKING(Default UDP send buffer size)
1705 AC_TRY_RUN([
1706 #include <stdlib.h>
1707 #include <stdio.h>
1708 #include <sys/types.h>
1709 #include <sys/socket.h>
1710 #include <netinet/in.h>
1711 main ()
1712 {
1713 FILE *fp;
1714 int fd,val=0,len=sizeof(int);
1715 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
1716 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
1717 if (val<=0) exit(1);
1718 fp = fopen("conftestval", "w");
1719 fprintf (fp, "%d\n", val);
1720 exit(0);
1721 }
1722 ],
1723 SQUID_UDP_SO_SNDBUF=`cat conftestval`,
1724 SQUID_UDP_SO_SNDBUF=16384,
1725 SQUID_UDP_SO_SNDBUF=16384)
1726 AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF)
1727 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF)
1728
1729 dnl Not cached since people are likely to tune this
1730 AC_MSG_CHECKING(Default UDP receive buffer size)
1731 AC_TRY_RUN([
1732 #include <stdlib.h>
1733 #include <stdio.h>
1734 #include <sys/types.h>
1735 #include <sys/socket.h>
1736 #include <netinet/in.h>
1737 main ()
1738 {
1739 FILE *fp;
1740 int fd,val=0,len=sizeof(int);
1741 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
1742 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1743 if (val <= 0) exit(1);
1744 fp = fopen("conftestval", "w");
1745 fprintf (fp, "%d\n", val);
1746 exit(0);
1747 }
1748 ],
1749 SQUID_UDP_SO_RCVBUF=`cat conftestval`,
1750 SQUID_UDP_SO_RCVBUF=16384,
1751 SQUID_UDP_SO_RCVBUF=16384)
1752 AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF)
1753 AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF)
1754
1755 dnl Not cached since people are likely to tune this
1756 AC_MSG_CHECKING(Default TCP send buffer size)
1757 AC_TRY_RUN([
1758 #include <stdlib.h>
1759 #include <stdio.h>
1760 #include <sys/types.h>
1761 #include <sys/socket.h>
1762 #include <netinet/in.h>
1763 main ()
1764 {
1765 FILE *fp;
1766 int fd,val=0,len=sizeof(int);
1767 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1768 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
1769 if (val <= 0) exit(1);
1770 fp = fopen("conftestval", "w");
1771 fprintf (fp, "%d\n", val);
1772 exit(0);
1773 }
1774 ],
1775 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1776 SQUID_TCP_SO_SNDBUF=16384,
1777 SQUID_TCP_SO_SNDBUF=16384)
1778 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
1779 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF)
1780
1781 dnl Not cached since people are likely to tune this
1782 AC_MSG_CHECKING(Default TCP receive buffer size)
1783 AC_TRY_RUN([
1784 #include <stdlib.h>
1785 #include <stdio.h>
1786 #include <sys/types.h>
1787 #include <sys/socket.h>
1788 #include <netinet/in.h>
1789 main ()
1790 {
1791 FILE *fp;
1792 int fd,val=0,len=sizeof(int);
1793 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
1794 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
1795 if (val <= 0) exit(1);
1796 fp = fopen("conftestval", "w");
1797 fprintf (fp, "%d\n", val);
1798 exit(0);
1799 }
1800 ],
1801 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1802 SQUID_TCP_SO_RCVBUF=16384,
1803 SQUID_TCP_SO_RCVBUF=16384)
1804 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
1805 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF)
1806
1807 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
1808 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
1809 ac_cv_needs_sys_errlist="no",
1810 ac_cv_needs_sys_errlist="yes")
1811 )
1812 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
1813 AC_DEFINE(NEED_SYS_ERRLIST)
1814 fi
1815
1816 dnl Not cached since people are likely to change this
1817 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
1818 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
1819 [AC_MSG_RESULT(yes)
1820 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)],
1821 AC_MSG_RESULT(no))
1822
1823 AC_MSG_CHECKING(if inet_ntoa() actually works)
1824 AC_TRY_RUN([
1825 #include <stdlib.h>
1826 #include <stdio.h>
1827 #include <sys/types.h>
1828 #include <netinet/in.h>
1829 #include <arpa/inet.h>
1830 main ()
1831 {
1832 FILE *fp;
1833 struct in_addr in;
1834 in.s_addr = inet_addr("1.2.3.4");
1835 fp = fopen("conftestval", "w");
1836 fprintf (fp, "%s\n", inet_ntoa(in));
1837 exit(0);
1838 }
1839 ],
1840 INET_NTOA_RESULT=`cat conftestval`,
1841 INET_NTOA_RESULT="broken",
1842 INET_NTOA_RESULT="broken")
1843 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
1844 AC_MSG_RESULT("yes")
1845 else
1846 AC_MSG_RESULT("no")
1847 echo "Will use our own inet_ntoa()."
1848 LIBOBJS="$LIBOBJS inet_ntoa.o"
1849 # echo "WARNING: This looks bad, and probably prevents Squid from working."
1850 # echo " If you're on IRIX and using GCC 2.8, you probably need"
1851 # echo " to use the IRIX C compiler instead."
1852 # sleep 10
1853 fi
1854
1855 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
1856 AC_MSG_CHECKING(for working statvfs() interface)
1857 AC_TRY_COMPILE([
1858 #include <stdlib.h>
1859 #include <stdio.h>
1860 #include <sys/types.h>
1861 #include <sys/statvfs.h>
1862 ],
1863 [
1864 struct statvfs sfs;
1865 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
1866 sfs.f_files = sfs.f_ffree = 0;
1867 statvfs("/tmp", &sfs);
1868 ],
1869 ac_cv_func_statvfs=yes,
1870 ac_cv_func_statvfs=no)
1871 AC_MSG_RESULT($ac_cv_func_statvfs)
1872 if test "$ac_cv_func_statvfs" = "yes" ; then
1873 AC_DEFINE(HAVE_STATVFS)
1874 fi
1875 fi
1876
1877 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
1878 AC_TRY_COMPILE([
1879 #if HAVE_SYS_TYPES_H
1880 #include <sys/types.h>
1881 #endif
1882 #if HAVE_NETINET_IN_H
1883 #include <netinet/in.h>
1884 #endif
1885 #if HAVE_ARPA_INET_H
1886 #include <arpa/inet.h>
1887 #endif
1888 #if HAVE_ARPA_NAMESER_H
1889 #include <arpa/nameser.h>
1890 #endif
1891 #if HAVE_RESOLV_H
1892 #include <resolv.h>
1893 #endif
1894 ],
1895 [_res.nsaddr_list[[0]];],
1896 ac_cv_have_res_nsaddr_list="yes",
1897 ac_cv_have_res_nsaddr_list="no"))
1898 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
1899 AC_DEFINE(HAVE_RES_NSADDR_LIST)
1900 fi
1901
1902 if test $ac_cv_have_res_nsaddr_list = "no" ; then
1903 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
1904 AC_TRY_COMPILE([
1905 #if HAVE_SYS_TYPES_H
1906 #include <sys/types.h>
1907 #endif
1908 #if HAVE_NETINET_IN_H
1909 #include <netinet/in.h>
1910 #endif
1911 #if HAVE_ARPA_INET_H
1912 #include <arpa/inet.h>
1913 #endif
1914 #if HAVE_ARPA_NAMESER_H
1915 #include <arpa/nameser.h>
1916 #endif
1917 #if HAVE_RESOLV_H
1918 #include <resolv.h>
1919 #endif
1920 ],
1921 [_res.ns_list[[0]].addr;],
1922 ac_cv_have_res_ns_list="yes",
1923 ac_cv_have_res_ns_list="no"))
1924 if test $ac_cv_have_res_ns_list = "yes" ; then
1925 AC_DEFINE(HAVE_RES_NS_LIST)
1926 fi
1927 fi
1928
1929 dnl Need the debugging version of malloc if available
1930 XTRA_OBJS=''
1931 if test "$ac_cv_lib_malloc_main" = "yes" ; then
1932 if test -r /usr/lib/debug/malloc.o ; then
1933 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
1934 fi
1935 if test -r /usr/lib/debug/mallocmap.o ; then
1936 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
1937 fi
1938 fi
1939
1940 AC_SUBST(XTRA_OBJS)
1941
1942 if test -z "$XTRA_LIBS"; then
1943 XTRA_LIBS="$LIBS"
1944 dnl minor cleanup
1945 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
1946 LIBS=''
1947 fi
1948 AC_SUBST(XTRA_LIBS)
1949
1950 dnl Clean up after OSF/1 core dump bug
1951 rm -f core
1952
1953 FS_MAKEFILES=""
1954 for fs in $STORE_MODULES none; do
1955 if test $fs != none; then
1956 FS_MAKEFILES="$FS_MAKEFILES ./src/fs/$fs/Makefile"
1957 fi
1958 done
1959 REPL_MAKEFILES=""
1960 for repl in $REPL_POLICIES none; do
1961 if test $repl != none; then
1962 REPL_MAKEFILES="$REPL_MAKEFILES ./src/repl/$repl/Makefile"
1963 fi
1964 done
1965
1966 dnl This could actually be used to find all the Makefiles..
1967 AUTH_MAKEFILES=""
1968 for auth in `find $srcdir/src/auth -type d -print`; do
1969 if test -f $auth/Makefile.in; then
1970 dir=`echo $auth | sed -e "s|^$srcdir/||"`
1971 AUTH_MAKEFILES="$AUTH_MAKEFILES ./$dir/Makefile"
1972 fi
1973 done
1974
1975 AC_OUTPUT(\
1976 ./makefile \
1977 ./lib/Makefile \
1978 ./include/config.h \
1979 ./scripts/Makefile \
1980 ./scripts/RunCache \
1981 ./scripts/RunAccel \
1982 ./src/Makefile \
1983 ./src/fs/Makefile \
1984 $FS_MAKEFILES \
1985 ./src/repl/Makefile \
1986 $REPL_MAKEFILES \
1987 ./src/auth/Makefile \
1988 $AUTH_MAKEFILES \
1989 ./contrib/Makefile \
1990 $SNMP_MAKEFILE \
1991 ./icons/Makefile \
1992 ./errors/Makefile \
1993 )