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