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