]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
Bootstrapped
[thirdparty/squid.git] / configure.in
CommitLineData
1b3db6d9 1
2877b8a9 2dnl Configuration input file for Squid
090089c4 3dnl
983061ed 4dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
090089c4 5dnl
d1da2d1f 6dnl $Id: configure.in,v 1.286 2002/09/29 12:55:52 hno Exp $
090089c4 7dnl
8dnl
090089c4 9dnl
a26bdc75 10AC_INIT(src/main.c)
71b12d7c 11AC_CONFIG_AUX_DIR(cfgaux)
3b0691a6 12AM_INIT_AUTOMAKE(squid, 2.6-DEVEL)
a2794549 13AM_CONFIG_HEADER(include/autoconf.h)
d1da2d1f 14AC_REVISION($Revision: 1.286 $)dnl
a2794549 15AC_PREFIX_DEFAULT(/usr/local/squid)
246d7ffc 16AM_MAINTAINER_MODE
a2794549 17
18dnl Set default LDFLAGS
19if test -z "$LDFLAGS"; then
20 LDFLAGS="-g"
21fi
22
23PRESET_CFLAGS="$CFLAGS"
090089c4 24
a2794549 25dnl Check for GNU cc
26AC_PROG_CC
c4b0db82 27AC_LANG_C
29b8d8d6 28AC_PROG_CXX
a2794549 29AM_PROG_CC_C_O
88d50a22 30AC_CANONICAL_HOST
31
a2794549 32
26675bf4 33CRYPTLIB=''
00fa2c12 34REGEXLIB='' # -lregex
35LIBREGEX='' # libregex.a
090089c4 36
a2794549 37dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
38AC_EXEEXT
39AC_OBJEXT
40
41if test -z "$EXEEXT"; then
42 CGIEXT=".cgi"
43else
7aeb8001 44 # automake automatically adds .exe when installing binaries
45 CGIEXT=""
a2794549 46fi
7aeb8001 47AC_SUBST(CGIEXT)
a2794549 48
0e6d05ef 49dnl this should be expanded to a list of platform sensible support requirements.
50dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
df087e68 51case "$host_os" in
a2794549 52cygwin|cygwin32)
53 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
df087e68 54 ;;
55*)
a2794549 56 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
df087e68 57 ;;
58esac
df087e68 59
a26bdc75 60if test -z "$CACHE_HTTP_PORT"; then
61 CACHE_HTTP_PORT="3128"
62fi
63if test -z "$CACHE_ICP_PORT"; then
64 CACHE_ICP_PORT="3130"
65fi
a26bdc75 66
090089c4 67dnl Subsitutions
4d683a65 68AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT)
69AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT)
090089c4 70
30a4f2a8 71AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host")
72
781ba3fb 73AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args")
090089c4 74
d96ceb8e 75dnl Check for GNU cc
76AC_PROG_CC
77
6ad85e8a 78dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
79case "$host" in
80 mab-next-nextstep3)
81 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
82 ;;
83esac
84
30a4f2a8 85dnl Set Default CFLAGS
86if test -z "$PRESET_CFLAGS"; then
87 if test "$GCC" = "yes"; then
88 case "$host" in
97b12a5b 89 *-sun-sunos*)
30a4f2a8 90 # sunos has too many warnings for this to be useful
91 # motorola too
92 ;;
97b12a5b 93 *m88k*)
94 # Motorola cc/ld does not like -02 but is ok on -O
95 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
96 ;;
30a4f2a8 97 *)
98 CFLAGS="$CFLAGS -Wall"
99 ;;
100 esac
81a820c6 101 else
102 case "$host" in
c415c128 103 *mips-sgi-irix6.*)
81a820c6 104 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
c415c128 105 CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \
58dc050d 106 -woff 1009,1014,1110,1116,1185,1188,1204,1230,1233 \
81a820c6 107 -Wl,-woff,85,-woff,84,-woff,134 \
108 -nostdinc -I/usr/include -D_BSD_SIGNALS"
109 ;;
e8f5fb18 110 alpha-dec-osf4.*)
553c24ae 111 # Mogul says DEC compilers take both -g and -O2
b6a2f15e 112 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
553c24ae 113 CFLAGS="$CFLAGS -O2"
114 ;;
81a820c6 115 *)
116 ;;
117 esac
30a4f2a8 118 fi
30a4f2a8 119fi
120
121dnl Set LDFLAGS
122if test -z "$PRESET_LDFLAGS"; then
123 if test "$GCC" = "yes"; then
124 case "$host" in
125 *)
126 # nothing
127 ;;
128 esac
81a820c6 129 else
130 case "$host" in
c415c128 131 *mips-sgi-irix6.*)
81a820c6 132 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
c415c128 133 LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32"
81a820c6 134 ;;
135 esac
30a4f2a8 136 fi
137fi
2060fa9a 138
e5f4e1b0 139dnl Enable optional modules
140AC_ARG_ENABLE(dlmalloc,
94d48591 141[ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
e5f4e1b0 142[
94d48591 143 case "$enableval" in
144 'yes')
029ce4ae 145 use_dlmalloc="yes"
94d48591 146 LIBDLMALLOC="libdlmalloc.a"
147 LIB_MALLOC="-L../lib -ldlmalloc"
029ce4ae 148 echo "dlmalloc enabled"
94d48591 149 ;;
150 'no')
029ce4ae 151 use_dlmalloc="no"
152 echo "dlmalloc disabled"
94d48591 153 ;;
029ce4ae 154 *) use_dlmalloc="yes"
155 LIB_MALLOC="$enableval"
156 echo "dlmalloc enabled with $LIB_MALLOC"
157 esac
158])
159if test "${use_dlmalloc-unset}" = unset; then
160 case "$host" in
161 i386-*-solaris2.*)
162 echo "Enabling dlmalloc for $host"
163 use_dlmalloc="yes"
d20b1cd0 164 LIBDLMALLOC="libdlmalloc.a"
165 LIB_MALLOC="-L../lib -ldlmalloc"
029ce4ae 166 ;;
e8dbaa90 167 *-sgi-irix*)
168 echo "Enabling dlmalloc for $host"
169 use_dlmalloc="yes"
170 LIBDLMALLOC="libdlmalloc.a"
171 LIB_MALLOC="-L../lib -ldlmalloc"
172 ;;
029ce4ae 173 esac
174fi
175if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
176 # Ok. dlmalloc was enabled before, but state may be changed.
177 # we have to test these again
178 unset ac_cv_func_mallinfo
179 unset ac_cv_func_mallocblksize
180 unset ac_cv_func_free
181 unset ac_cv_func_realloc
182 unset ac_cv_func_memalign
183 unset ac_cv_func_valloc
184 unset ac_cv_func_pvalloc
185 unset ac_cv_func_calloc
186 unset ac_cv_func_cfree
187 unset ac_cv_func_malloc_trim
188 unset ac_cv_func_malloc_usable_size
189 unset ac_cv_func_malloc_stats
190 unset ac_cv_func_mallinfo
191 unset ac_cv_func_mallopt
192 unset ac_cv_lib_gnumalloc
193 unset ac_cv_header_gnumalloc_h
194 unset ac_cv_lib_malloc
195 unset ac_cv_enabled_dlmalloc
196fi
197if test "$use_dlmalloc" = yes; then
94d48591 198 ac_cv_func_mallinfo="yes"
199 ac_cv_func_mallocblksize="no"
200 ac_cv_func_free="yes"
201 ac_cv_func_realloc="yes"
202 ac_cv_func_memalign="yes"
203 ac_cv_func_valloc="yes"
204 ac_cv_func_pvalloc="yes"
205 ac_cv_func_calloc="yes"
206 ac_cv_func_cfree="yes"
207 ac_cv_func_malloc_trim="yes"
208 ac_cv_func_malloc_usable_size="yes"
209 ac_cv_func_malloc_stats="yes"
94d48591 210 ac_cv_func_mallopt="yes"
211 ac_cv_lib_gnumalloc="no"
85efe3ec 212 ac_cv_header_gnumalloc_h="no"
94d48591 213 ac_cv_lib_malloc="no"
214 ac_cv_enabled_dlmalloc="yes"
d96ceb8e 215 AC_DEFINE(USE_DLMALLOC, 1)
029ce4ae 216fi
217
e5f4e1b0 218AC_SUBST(LIBDLMALLOC)
219AC_SUBST(LIB_MALLOC)
220
221AC_ARG_ENABLE(gnuregex,
222[ --enable-gnuregex Compile GNUregex],
223[USE_GNUREGEX=$enableval])
224
fa80a8ef 225AC_ARG_ENABLE(debug-cbdata,
226[ --enable-debug-cbdata Provide some debug information in cbdata],
227[ if test "$enableval" = "yes" ; then
228 echo "cbdata debugging enabled"
229 AC_DEFINE(CBDATA_DEBUG)
230 fi
231])
232
0961c811 233dnl This is a developer only option.. developers know how to set defines
234dnl
235dnl AC_ARG_ENABLE(xmalloc-debug,
236dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
237dnl [ if test "$enableval" = "yes" ; then
238dnl echo "Malloc debugging enabled"
239dnl AC_DEFINE(XMALLOC_DEBUG)
240dnl fi
241dnl ])
242
243dnl This is a developer only option.. developers know how to set defines
244dnl
245dnl AC_ARG_ENABLE(xmalloc-debug-trace,
246dnl [ --enable-xmalloc-debug-trace
247dnl Detailed trace of memory allocations],
248dnl [ if test "$enableval" = "yes" ; then
249dnl echo "Malloc debug trace enabled"
250dnl AC_DEFINE(XMALLOC_TRACE)
251dnl AC_DEFINE(XMALLOC_DEBUG)
252dnl fi
253dnl ])
e5f4e1b0 254
d9180414 255AC_ARG_ENABLE(xmalloc-statistics,
e5f4e1b0 256[ --enable-xmalloc-statistics
257 Show malloc statistics in status page],
258[ if test "$enableval" = "yes" ; then
259 echo "Malloc statistics enabled"
260 AC_DEFINE(XMALLOC_STATISTICS)
261 fi
262])
263
323fe0d4 264AC_ARG_ENABLE(carp,
f7c8dc02 265[ --disable-carp Disable CARP support],
266[ if test "$enableval" = "no" ; then
267 echo "CARP disabled"
268 AC_DEFINE(USE_CARP, 0)
269 else
270 AC_DEFINE(USE_CARP, 1)
323fe0d4 271 fi
f7c8dc02 272])
323fe0d4 273
cd748f27 274AC_ARG_ENABLE(async-io,
9bc73deb 275[ --enable-async-io[=N_THREADS]
cd748f27 276 Shorthand for
f85c88f3 277 --with-aufs-threads=N_THREADS
cd748f27 278 --with-pthreads
279 --enable-storeio=ufs,aufs],
280[ case $enableval in
9bc73deb 281 yes)
cd748f27 282 STORE_MODULES="ufs aufs"
9bc73deb 283 ;;
284 no)
9bc73deb 285 ;;
286 *)
f85c88f3 287 aufs_io_threads=$enableval
cd748f27 288 STORE_MODULES="ufs aufs"
9bc73deb 289 ;;
290 esac
291])
292
f85c88f3 293AC_ARG_WITH(aufs-threads,
294[ --with-aufs-threads=N_THREADS
cd748f27 295 Tune the number of worker threads for the aufs object
296 store.],
f85c88f3 297[ aufs_io_threads=$withval ])
298if test "$aufs_io_threads"; then
299 echo "With $aufs_io_threads aufs threads"
f85c88f3 300 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads)
cd748f27 301fi
302
303AC_ARG_WITH(pthreads,
8154dd82 304[ --with-pthreads Use POSIX Threads])
305if test "$with_pthreads" = "yes"; then
cd748f27 306 echo "With pthreads"
9fc0b4b8 307 CFLAGS="$CFLAGS -D_REENTRANT"
c68e9c6b 308 case "$host" in
309 i386-unknown-freebsd*)
cd748f27 310 if test "$GCC" = "yes" ; then
311 if test -z "$PRESET_LDFLAGS"; then
312 LDFLAGS="$LDFLAGS -pthread"
313 fi
314 fi
315 ;;
b71119d9 316 *-solaris2.*)
317 if test "$GCC" = "yes" ; then
318 CFLAGS="$CFLAGS -pthreads"
319 else
320 CFLAGS="$CFLAGS -mt"
321 fi
322 ;;
c68e9c6b 323 esac
9bc73deb 324fi
e5f4e1b0 325
f85c88f3 326AC_ARG_WITH(aio,
8154dd82 327[ --with-aio Use POSIX AIO])
328if test "$with_aio" = "yes"; then
f85c88f3 329 echo "With aio"
f85c88f3 330fi
8154dd82 331
332AC_ARG_WITH(dl,
333[ --with-dl Use dynamic linking])
334if test "$with_dl" = "yes"; then
335 echo "With dl"
336fi
f85c88f3 337
cd748f27 338AC_ARG_ENABLE(storeio,
339[ --enable-storeio=\"list of modules\"
340 Build support for the list of store I/O modules.
341 The default is only to build the "ufs" module.
342 See src/fs for a list of available modules, or
343 Programmers Guide section <not yet written>
344 for details on how to build your custom store module],
345[ case $enableval in
346 yes)
347 for module in $srcdir/src/fs/*; do
348 if test -f $module/Makefile.in; then
349 STORE_MODULES="$STORE_MODULES `basename $module`"
8154dd82 350 fi
cd748f27 351 done
352 ;;
353 no)
354 ;;
355 *) STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
356 ;;
357 esac
358],
359[ if test -z "$STORE_MODULES"; then
360 STORE_MODULES="ufs"
361 fi
362])
d1aad03d 363echo "Store modules built: $STORE_MODULES"
a2794549 364STORE_OBJS="fs/lib`echo $STORE_MODULES|sed -e 's% %.a fs/lib%g'`.a"
cd748f27 365AC_SUBST(STORE_OBJS)
6652c622 366STORE_LIBS="`echo $STORE_OBJS|sed -e 's%fs/%%g'`"
f71946fc 367AC_SUBST(STORE_LIBS)
a2794549 368dnl remove all but diskd - its the only module that needs to recurse
369dnl into the sub directory
370STORE_MODULE_SUBDIRS=
371for fs in $STORE_MODULES none; do
8154dd82 372 case "$fs" in
373 diskd)
a2794549 374 STORE_MODULE_SUBDIRS="$STORE_MODULE_SUBDIRS $fs"
8154dd82 375 ;;
376 aufs)
377 if test -z "$with_pthreads"; then
378 echo "aufs store used, pthreads support automatically enabled"
379 with_pthreads=yes
380 fi
381 ;;
382 coss)
383 if test -z "$with_aio"; then
384 echo "coss store used, aio support automatically enabled"
385 with_aio=yes
386 fi
387 ;;
388 esac
a2794549 389done
390AC_SUBST(STORE_MODULES)
391AC_SUBST(STORE_MODULE_SUBDIRS)
392
cd748f27 393
6a566b9c 394dnl --enable-heap-replacement compability option
395AC_ARG_ENABLE(heap-replacement,
396[ --enable-heap-replacement
397 Backwards compability option. Please use the
398 new --enable-removal-policies directive instead.],
399[ if test "$enableval" = "yes" ; then
400 echo "--enable-heap-replacement is obsolete. please use the new"
401 echo "--enable-removal-policies directive instead"
402 sleep 5
403 REPL_POLICIES="heap"
404 fi
405])
406
d9180414 407AC_ARG_ENABLE(removal-policies,
6a566b9c 408[ --enable-removal-policies=\"list of policies\"
409 Build support for the list of removal policies.
410 The default is only to build the "lru" module.
411 See src/repl for a list of available modules, or
412 Programmers Guide section 9.9 for details on how
413 to build your custom policy],
414[ case $enableval in
415 yes)
416 for module in $srcdir/src/repl/*; do
417 if test -f $module/Makefile.in; then
418 REPL_POLICIES="$REPL_POLICIES `basename $module`"
419 fi
420 done
421 ;;
422 no)
423 ;;
424 *) REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
425 ;;
426 esac
427],
428[ if test -z "$REPL_POLICIES"; then
429 REPL_POLICIES="lru"
430 fi
431])
65033bdd 432echo "Removal policies built: $REPL_POLICIES"
6a566b9c 433AC_SUBST(REPL_POLICIES)
a2794549 434REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
6a566b9c 435AC_SUBST(REPL_OBJS)
6652c622 436REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
f71946fc 437AC_SUBST(REPL_LIBS)
6a566b9c 438
d1da2d1f 439AM_CONDITIONAL(ENABLE_PINGER, false)
e5f4e1b0 440AC_ARG_ENABLE(icmp,
441[ --enable-icmp Enable ICMP pinging],
442[ if test "$enableval" = "yes" ; then
443 echo "ICMP enabled"
444 AC_DEFINE(USE_ICMP)
d1da2d1f 445 AM_CONDITIONAL(ENABLE_PINGER, true)
e5f4e1b0 446 fi
447])
448
a2794549 449AM_CONDITIONAL(USE_DELAY_POOLS, false)
d9180414 450AC_ARG_ENABLE(delay-pools,
76d83c52 451[ --enable-delay-pools Enable delay pools to limit bandwidth usage],
e5f4e1b0 452[ if test "$enableval" = "yes" ; then
95e36d02 453 echo "Delay pools enabled"
95e36d02 454 AC_DEFINE(DELAY_POOLS)
a2794549 455 AM_CONDITIONAL(USE_DELAY_POOLS, true)
e5f4e1b0 456 fi
457])
458
0961c811 459dnl This is a developer only option. Developers know how to set defines
460dnl
461dnl AC_ARG_ENABLE(mem-gen-trace,
462dnl [ --enable-mem-gen-trace Do trace of memory stuff],
463dnl [ if test "$enableval" = "yes" ; then
464dnl echo "Memory trace (to file) enabled"
465dnl AC_DEFINE(MEM_GEN_TRACE)
466dnl fi
467dnl ])
36a97e19 468
d9180414 469AC_ARG_ENABLE(useragent-log,
e5f4e1b0 470[ --enable-useragent-log Enable logging of User-Agent header],
471[ if test "$enableval" = "yes" ; then
472 echo "User-Agent logging enabled"
473 AC_DEFINE(USE_USERAGENT_LOG)
474 fi
475])
476
dfca7e1a 477AC_ARG_ENABLE(referer-log,
0961c811 478[ --enable-referer-log Enable logging of Referer header],
dfca7e1a 479[ if test "$enableval" = "yes" ; then
480 echo "Referer logging enabled"
481 AC_DEFINE(USE_REFERER_LOG)
482 fi
483])
484
320e9f36 485AC_ARG_ENABLE(wccp,
0961c811 486[ --disable-wccp Disable Web Cache Coordination Protocol],
eb824054 487[ if test "$enableval" = "no" ; then
488 echo "Web Cache Coordination Protocol disabled"
489 AC_DEFINE(USE_WCCP, 0)
490 else
491 AC_DEFINE(USE_WCCP, 1)
320e9f36 492 fi
493])
320e9f36 494
d9180414 495AC_ARG_ENABLE(kill-parent-hack,
9fc0b4b8 496[ --enable-kill-parent-hack
497 Kill parent on shutdown],
e5f4e1b0 498[ if test "$enableval" = "yes" ; then
499 echo "Kill parent on shutdown"
500 AC_DEFINE(KILL_PARENT_OPT)
501 fi
502])
503
a2794549 504AM_CONDITIONAL(USE_SNMP, false)
e5f4e1b0 505AC_ARG_ENABLE(snmp,
506[ --enable-snmp Enable SNMP monitoring],
507[ if test "$enableval" = "yes" ; then
508 echo "SNMP monitoring enabled"
509 AC_DEFINE(SQUID_SNMP)
510 SNMPLIB='-L../snmplib -lsnmp'
a2794549 511 AM_CONDITIONAL(USE_SNMP, true)
8a7f0105 512 SNMP_MAKEFILE=./snmplib/Makefile
e5f4e1b0 513 makesnmplib=snmplib
514 fi
515])
516AC_SUBST(SNMPLIB)
e5f4e1b0 517AC_SUBST(makesnmplib)
518
d9180414 519AC_ARG_ENABLE(cachemgr-hostname,
e5f4e1b0 520[ --enable-cachemgr-hostname[=hostname]
521 Make cachemgr.cgi default to this host],
522[ case $enableval in
523 yes)
524 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()])
525 echo "Cachemgr default hostname == host where cachemgr runs"
526 ;;
527 no)
528 : # Nothing to do..
529 ;;
530 *)
531 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
532 echo "Cachemgr default hostname set to ${enableval}"
533 ;;
534 esac
535])
536
d9180414 537AC_ARG_ENABLE(arp-acl,
e5f4e1b0 538[ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
539[ if test "$enableval" = "yes" ; then
540 echo "ARP ACL lists enabled (ether address)"
933cc58d 541 case "$host" in
ef614b1c 542 *-linux-*)
543 ;;
544 *-solaris-*)
a931a29b 545 ;;
933cc58d 546 *)
ef614b1c 547 echo "WARNING: ARP ACL support probably won't work on $host."
933cc58d 548 sleep 10
549 ;;
550 esac
e5f4e1b0 551 AC_DEFINE(USE_ARP_ACL)
552 fi
553])
554
a2794549 555AM_CONDITIONAL(ENABLE_HTCP, false)
74075210 556AC_ARG_ENABLE(htcp,
88b7de25 557[ --enable-htcp Enable HTCP protocol],
b4b8b6da 558[ if test "$enableval" = "yes" ; then
559 echo "HTCP enabled"
b4b8b6da 560 AC_DEFINE(USE_HTCP)
a2794549 561 AM_CONDITIONAL(ENABLE_HTCP, true)
b4b8b6da 562 fi
74075210 563])
a2794549 564
565AM_CONDITIONAL(ENABLE_SSL, false)
74075210 566
1f7c9178 567AC_ARG_ENABLE(ssl,
568[ --enable-ssl Enable ssl gatewaying support using OpenSSL],
569[ if test "$enableval" != "no"; then
3dff197f 570 echo "SSL gatewaying using OpenSSL enabled"
1f7c9178 571 AC_DEFINE(USE_SSL)
a2794549 572 AM_CONDITIONAL(ENABLE_SSL, true)
1f7c9178 573 SSLLIB='-lssl -lcrypto'
574 USE_OPENSSL=1
575 fi
576])
577
3dff197f 578AM_CONDITIONAL(NEED_OWN_MD5, true)
579
1f7c9178 580AC_ARG_WITH(openssl,
581[ --with-openssl[=prefix]
582 Compile with the OpenSSL libraries. The path to
583 the OpenSSL development libraries and headers
584 installation can be specified if outside of the
585 system standard directories],
586[
46ce628c 587 case "$with_openssl" in
1f7c9178 588 yes)
589 USE_OPENSSL=1
590 ;;
591 no)
592 USE_OPENSSL=
593 ;;
594 *)
46ce628c 595 SSLLIBDIR="$with_openssl/lib"
bcce53ce 596 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1f7c9178 597 USE_OPENSSL=1
598 esac
599])
600
601if test -n "$USE_OPENSSL"; then
3dff197f 602 echo "Using OpenSSL MD5 implementation"
1f7c9178 603 AC_DEFINE(USE_OPENSSL)
3dff197f 604 AM_CONDITIONAL(NEED_OWN_MD5, false)
1f7c9178 605 if test -z "$SSLLIB"; then
606 SSLLIB="-lcrypto" # for MD5 routines
607 fi
608fi
609if test -n "$SSLLIBDIR"; then
610 SSLLIB="-L$SSLLIBDIR $SSLLIB"
611fi
1f7c9178 612AC_SUBST(SSLLIB)
613
02749868 614AC_ARG_ENABLE(forw-via-db,
615[ --enable-forw-via-db Enable Forw/Via database],
616[ if test "$enableval" = "yes" ; then
617 echo "FORW-VIA enabled"
618 AC_DEFINE(FORW_VIA_DB)
619 fi
620])
621
6cfa8966 622AC_ARG_ENABLE(cache-digests,
22df58ea 623[ --enable-cache-digests Use Cache Digests
2b6662ba 624 see http://www.squid-cache.org/FAQ/FAQ-16.html],
484f2ebc 625[ if test "$enableval" = "yes" ; then
6cfa8966 626 echo "USE_CACHE_DIGESTS enabled"
627 AC_DEFINE(USE_CACHE_DIGESTS)
484f2ebc 628 fi
629])
630
8c3926c5 631dnl Select Default Error language
632AC_ARG_ENABLE(default-err-language,
633[ --enable-default-err-language=lang
0961c811 634 Select default language for Error pages (see
635 errors directory) ],
933cc58d 636[
cf9d704a 637 if test -d $srcdir/errors/$enableval; then
8c3926c5 638 ERR_DEFAULT_LANGUAGE=$enableval
933cc58d 639 else
0961c811 640 echo "ERROR! Unknown language $enableval, see errors/ directory"
933cc58d 641 exit 1
642 fi
8c3926c5 643],[ERR_DEFAULT_LANGUAGE="English"])
644AC_SUBST(ERR_DEFAULT_LANGUAGE)
645
646dnl Select languages to be installed
647AC_ARG_ENABLE(err-languages,
648[ --enable-err-languages=\"lang1 lang2..\"
0961c811 649 Select languages to be installed. (All will be
650 installed by default) ],
8c3926c5 651[
652 for l in $enableval; do
653 if test -d $srcdir/errors/$l; then :; else
654 echo "ERROR! Unknown language $$l, see errors/"
655 exit 1
656 fi
657 done
658 ERR_LANGUAGES=$enableval
659],[
660 ERR_LANGUAGES=
661 for l in $srcdir/errors/*; do
cbbe101f 662 if test -f $l/ERR_ACCESS_DENIED; then
8c3926c5 663 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
664 fi
665 done
666])
667AC_SUBST(ERR_LANGUAGES)
933cc58d 668
cd748f27 669dnl Size of COSS memory buffer
670AC_ARG_WITH(coss-membuf-size,
671[ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
672[ if test "$with_coss_membuf_size"; then
673 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
674 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size)
675 fi
676])
677
1b3db6d9 678dnl check for netio plugin stuff
9bb83c8b 679dnl Enable poll()
680AC_ARG_ENABLE(poll,
0961c811 681[ --enable-poll Enable poll() support.
682 --disable-poll Disable poll() support. ],
1b3db6d9 683
684[
c68e9c6b 685 case "$enableval" in
686 yes)
9bb83c8b 687 echo "Forcing poll() to be enabled"
688 ac_cv_func_poll='yes'
c68e9c6b 689 ;;
690 no)
691 echo "Forcing poll() to be disabled"
692 ac_cv_func_poll='no'
693 ;;
694 esac
9bb83c8b 695])
696
1b3db6d9 697dnl Enable select()
698AC_ARG_ENABLE(select,
0961c811 699[ --enable-select Enable select() support.
700 --disable-select Disable select() support. ],
1b3db6d9 701
702[
703 case "$enableval" in
704 yes)
705 echo "Forcing select() to be enabled"
706 ac_cv_func_select='yes'
707 ;;
708 no)
709 echo "Forcing select() to be disabled"
710 ac_cv_func_select='no'
711 ;;
712 esac
713])
714
715dnl Enable kqueue()
716AC_ARG_ENABLE(kqueue,
0961c811 717[ --enable-kqueue Enable kqueue() support.
718 --disable-kqueue Disable kqueue() support. ],
1b3db6d9 719
720[
721 case "$enableval" in
722 yes)
723 echo "Forcing kqueue() to be enabled"
724 ac_cv_func_kqueue='yes'
725 ;;
726 no)
727 echo "Forcing kqueue() to be disabled"
728 ac_cv_func_kqueue='no'
729 ;;
730esac
731])
732
72fd085a 733dnl Disable HTTP violations
734AC_ARG_ENABLE(http-violations,
735[ --disable-http-violations
736 This allows you to remove code which is known to
c68e9c6b 737 violate the HTTP protocol specification.],
72fd085a 738[ if test "$enableval" = "no" ; then
739 echo "Disabling HTTP Violations"
6eec93b2 740 AC_DEFINE(HTTP_VIOLATIONS, 0)
72fd085a 741 else
6eec93b2 742 AC_DEFINE(HTTP_VIOLATIONS, 1)
72fd085a 743 fi
744])
745
5cafc1d6 746dnl Enable IP-Filter Transparent Proxy
747AC_ARG_ENABLE(ipf-transparent,
748[ --enable-ipf-transparent
749 Enable Transparent Proxy support for systems
c68e9c6b 750 using IP-Filter network address redirection.],
5cafc1d6 751[ if test "$enableval" = "yes" ; then
752 echo "IP-Filter Transparent Proxy enabled"
753 AC_DEFINE(IPF_TRANSPARENT)
754 IPF_TRANSPARENT="yes"
755 fi
756])
757
2b0dd4ac 758dnl Enable PF Transparent Proxy
759AC_ARG_ENABLE(pf-transparent,
760[ --enable-pf-transparent
761 Enable Transparent Proxy support for systems
762 using PF network address redirection.],
763[ if test "$enableval" = "yes" ; then
764 echo "PF Transparent Proxy enabled"
765 AC_DEFINE(PF_TRANSPARENT)
766 PF_TRANSPARENT="yes"
767 fi
768])
769
d852fbad 770dnl Enable Linux Netfilter (2.4) Transparent Proxy
771AC_ARG_ENABLE(linux-netfilter,
772[ --enable-linux-netfilter
773 Enable Transparent Proxy support for Linux 2.4.],
774[ if test "$enableval" = "yes" ; then
775 echo "Linux-Netfilter Transparent Proxy enabled"
776 AC_DEFINE(LINUX_NETFILTER)
777 LINUX_NETFILTER="yes"
778 fi
779])
780
bb7b5fd0 781dnl Enable Large file support
782AC_ARG_ENABLE(large-files,
783[ --enable-large-files Enable support for large files (>2GB). Still
784 experimental.],
785[ if test "$enableval" = "yes" ; then
786 echo "Large file support enabled"
787 CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
788 fi
789])
790
a2794549 791AM_CONDITIONAL(MAKE_LEAKFINDER, false)
5d620373 792dnl Enable Leak Finding Functions
793AC_ARG_ENABLE(leakfinder,
794[ --enable-leakfinder
795 Enable Leak Finding code. Enabling this alone
796 does nothing; you also have to modify the source
797 code to use the leak finding functions. Probably
798 Useful for hackers only.],
799[ if test "$enableval" = "yes" ; then
800 echo "Leak-Finding enabled"
801 AC_DEFINE(USE_LEAKFINDER)
5d620373 802 USE_LEAKFINDER="yes"
a2794549 803 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
5d620373 804 fi
805])
5d620373 806
3898f57f 807AC_ARG_ENABLE(ident-lookups,
808[ --disable-ident-lookups
809 This allows you to remove code that performs
810 Ident (RFC 931) lookups.],
811[ if test "$enableval" = "no" ; then
812 echo "Disabling Ident Lookups"
813 AC_DEFINE(USE_IDENT, 0)
814 else
815 AC_DEFINE(USE_IDENT, 1)
816 fi
817])
818
a2794549 819AM_CONDITIONAL(USE_DNSSERVER, false)
3c573763 820use_dnsserver=
eb824054 821AC_ARG_ENABLE(internal-dns,
7e3ce7b9 822[ --disable-internal-dns This prevents Squid from directly sending and
eb824054 823 receiving DNS messages, and instead enables the
824 old external 'dnsserver' processes.],
825[ if test "$enableval" = "no" ; then
826 echo "Disabling Internal DNS queries"
3c573763 827 use_dnsserver="yes"
eb824054 828 fi
829])
3c573763 830if test "$use_dnsserver" = "yes"; then
7b800d9f 831 AC_DEFINE(USE_DNSSERVERS)
a2794549 832 AM_CONDITIONAL(USE_DNSSERVER, true)
3c573763 833fi
eb824054 834
835AC_ARG_ENABLE(truncate,
7e3ce7b9 836[ --enable-truncate This uses truncate() instead of unlink() when
eb824054 837 removing cache files. Truncate gives a little
838 performance improvement, but may cause problems
839 when used with async I/O. Truncate uses more
840 filesystem inodes than unlink..],
841[ if test "$enableval" = "yes" ; then
842 echo "Enabling truncate instead of unlink"
843 AC_DEFINE(USE_TRUNCATE)
844 fi
845])
846
9bc73deb 847dnl Enable underscore in hostnames
848AC_ARG_ENABLE(underscores,
849[ --enable-underscores Squid by default rejects any host names with _
76d83c52 850 in their name to conform with internet standards.
9bc73deb 851 If you disagree with this you may allow _ in
852 hostnames by using this switch, provided that
853 the resolver library on the host where Squid runs
854 does not reject _ in hostnames...],
855[ if test "$enableval" = "yes" ; then
856 echo "Enabling the use of underscores in host names"
857 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1)
858 fi
859])
860
9d798391 861dnl Select Default hosts file location
862AC_ARG_ENABLE(default-hostsfile,
863[ --enable-default-hostsfile=path
864 Select default location for hosts file.
865 See hosts_file directive in squid.conf for details],
866[
867 if test "$enableval" != "none" ; then
868 if test -f $enableval; then
869 OPT_DEFAULT_HOSTS=$enableval
870 else
871 echo "Warning Unable to find $enableval"
872 sleep 5
873 fi
874 else
875 OPT_DEFAULT_HOSTS="none"
876 fi
877 echo "Default hosts file set to: $enableval"
878],[OPT_DEFAULT_HOSTS="/etc/hosts"])
879AC_SUBST(OPT_DEFAULT_HOSTS)
880
94439e4e 881
882dnl Select auth schemes modules to build
883AC_ARG_ENABLE(auth,
884[ --enable-auth=\"list of auth scheme modules\"
885 Build support for the list of authentication schemes.
886 The default is to build support for the Basic scheme.
887 See src/auth for a list of available modules, or
888 Programmers Guide section authentication schemes
889 for details on how to build your custom auth scheme
890 module],
891[ case $enableval in
892 yes)
893 for module in $srcdir/src/auth/*; do
894 if test -f $module/Makefile.in; then
895 AUTH_MODULES="$AUTH_MODULES `basename $module`"
896 fi
897 done
898 ;;
899 no)
900 ;;
901 *) AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
902 ;;
903 esac
904],
905[ if test -z "$AUTH_MODULES"; then
906 AUTH_MODULES="basic"
907 fi
908])
909echo "Auth scheme modules built: $AUTH_MODULES"
910AC_SUBST(AUTH_MODULES)
a2794549 911AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
94439e4e 912AC_SUBST(AUTH_OBJS)
6652c622 913AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
94439e4e 914AC_SUBST(AUTH_LIBS)
915
916dnl Select basic auth scheme helpers to build
917BASIC_AUTH_HELPERS=""
380f0a87 918AC_ARG_ENABLE(auth-modules,
94439e4e 919[ --enable-auth-modules=\"list of helpers\"
920 Backwards compability alias for
921 --enable-basic-auth-helpers],
922[ echo "--enable-auth-modules is obsolete. Please use the new"
923 echo "option --enable-basic-auth-helpers"
924 sleep 5
925 case "$enableval" in
926 yes)
0c510f3c 927 for helper in $srcdir/helpers/basic_auth/*; do
94439e4e 928 if test -f $helper/Makefile.in; then
fc83a946 929 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`"
94439e4e 930 fi
931 done
932 ;;
933 no)
934 ;;
935 *)
fc83a946 936 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
94439e4e 937 esac
938])
939AC_ARG_ENABLE(basic-auth-helpers,
940[ --enable-basic-auth-helpers=\"list of helpers\"
941 This option selects which basic scheme proxy_auth
942 helpers to build and install as part of the normal
943 build process. For a list of available
0c510f3c 944 helpers see the helpers/basic_auth directory.],
94439e4e 945[ case "$enableval" in
946 yes)
947 BASIC_AUTH_HELPERS=""
0c510f3c 948 for helper in $srcdir/helpers/basic_auth/*; do
94439e4e 949 if test -f $helper/Makefile.in; then
fc83a946 950 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`"
94439e4e 951 fi
952 done
953 ;;
954 no)
955 ;;
956 *)
fc83a946 957 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
94439e4e 958 esac
959])
fc83a946 960if test -n "$BASIC_AUTH_HELPERS"; then
20d8bfe4 961 for helper in $BASIC_AUTH_HELPERS; do
962 if test -f $srcdir/helpers/basic_auth/$helper/Makefile.in; then
963 :
964 else
965 echo "ERROR: Basic auth helper $helper does not exists"
966 exit 1
967 fi
968 done
fc83a946 969 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
94439e4e 970fi
fc83a946 971AC_SUBST(BASIC_AUTH_HELPERS)
94439e4e 972
973dnl Select ntlm auth helpers to build
974NTLM_AUTH_HELPERS=
975AC_ARG_ENABLE(ntlm-auth-helpers,
976[ --enable-ntlm-auth-helpers=\"list of helpers\"
977 This option selects which proxy_auth ntlm helpers
978 to build and install as part of the normal build
0c510f3c 979 process. For a list of available helpers see
980 the helpers/ntlm_auth directory.],
380f0a87 981[ case "$enableval" in
982 yes)
0c510f3c 983 for helper in $srcdir/helpers/ntlm_auth/*; do
94439e4e 984 if test -f $helper/Makefile.in; then
985 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS `basename $helper`"
380f0a87 986 fi
987 done
988 ;;
989 no)
990 ;;
991 *)
94439e4e 992 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
380f0a87 993 esac
994])
94439e4e 995if test -n "$NTLM_AUTH_HELPERS"; then
20d8bfe4 996 for helper in $NTLM_AUTH_HELPERS; do
997 if test -f $srcdir/helpers/ntlm_auth/$helper/Makefile.in; then
998 :
999 else
1000 echo "ERROR: NTLM auth helper $helper does not exists"
1001 exit 1
1002 fi
1003 done
94439e4e 1004 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
380f0a87 1005fi
94439e4e 1006AC_SUBST(NTLM_AUTH_HELPERS)
1007
2d70df72 1008dnl Select digest auth scheme helpers to build
1009DIGEST_AUTH_HELPERS=
1010AC_ARG_ENABLE(digest-auth-helpers,
1011[ --enable-digest-auth-helpers=\"list of helpers\"
1012 This option selects which digest scheme authentication
1013 helpers to build and install as part of the normal build
0c510f3c 1014 process. For a list of available helpers see the
1015 helpers/digest_auth directory.],
2d70df72 1016[ case "$enableval" in
1017 yes)
0c510f3c 1018 for helper in $srcdir/helpers/digest_auth/*; do
2d70df72 1019 if test -f $helper/Makefile.in; then
1020 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS `basename $helper`"
1021 fi
1022 done
1023 ;;
1024 no)
1025 ;;
1026 *)
1027 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1028 esac
1029])
1030if test -n "$DIGEST_AUTH_HELPERS"; then
1daefc1a 1031 for helper in $DIGEST_AUTH_HELPERS; do
1032 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1033 :
1034 else
1035 echo "ERROR: digest auth helper $helper does not exists"
1036 exit 1
1037 fi
1038 done
2d70df72 1039 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1040fi
1041AC_SUBST(DIGEST_AUTH_HELPERS)
380f0a87 1042
6437ac71 1043dnl Enable "NTLM fail open"
1044AC_ARG_ENABLE(ntlm-fail-open,
1045[ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
0961c811 1046 Authentication steps can allow squid to still authenticate
1047 the user.],
6437ac71 1048[ if test "$enableval" = "yes" ; then
1049 AC_DEFINE(NTLM_FAIL_OPEN)
1050 fi
1051])
1052
c6588c68 1053dnl Select external_acl helpers to build
1054EXTERNAL_ACL_HELPERS=
1055AC_ARG_ENABLE(external-acl-helpers,
1056[ --enable-external-acl-helpers=\"list of helpers\"
1057 This option selects which external_acl helpers to
1058 build and install as part of the normal build
1059 process. For a list of available helpers see the
1060 helpers/external_acl directory.],
1061[ case "$enableval" in
1062 yes)
1063 for helper in $srcdir/helpers/external_acl/*; do
1064 if test -f $helper/Makefile.in; then
1065 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS `basename $helper`"
1066 fi
1067 done
1068 ;;
1069 no)
1070 ;;
1071 *)
1072 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1073 esac
1074])
1075if test -n "$EXTERNAL_ACL_HELPERS"; then
20d8bfe4 1076 for helper in $EXTERNAL_ACL_HELPERS; do
1077 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1078 :
1079 else
1daefc1a 1080 echo "ERROR: external acl helper $helper does not exists"
20d8bfe4 1081 exit 1
1082 fi
1083 done
c6588c68 1084 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1085fi
1086AC_SUBST(EXTERNAL_ACL_HELPERS)
1087
d96ceb8e 1088dnl Disable "memPools" code
1089AC_ARG_ENABLE(mempools,
1090[ --disable-mempools Disable memPools],
1091[ if test "$enableval" = "no" ; then
1092 echo "memPools disabled"
1093 AC_DEFINE(DISABLE_POOLS, 1)
1094 else
1095 AC_DEFINE(DISABLE_POOLS, 0)
1096 fi
1097])
1098
3c573763 1099dnl Disable "unlinkd" code
fe0810ac 1100AC_ARG_ENABLE(unlinkd,
1101[ --disable-unlinkd Do not use unlinkd],
1102[ if test "$enableval" = "no" ; then
3c573763 1103 use_unlinkd=no
fe0810ac 1104 else
3c573763 1105 use_unlinkd=yes
fe0810ac 1106 fi
1107],[
1108 # Here we should probably use some magic depending on the selected
1109 # storage models
3c573763 1110 use_unlinkd=yes
fe0810ac 1111])
3c573763 1112if test "$use_unlinkd" = "yes"; then
fe0810ac 1113 echo "unlinkd enabled"
1114 AC_DEFINE(USE_UNLINKD)
a2794549 1115 AM_CONDITIONAL(ENABLE_UNLINKD, true)
fe0810ac 1116else
1117 echo "unlinkd disabled"
a2794549 1118 AM_CONDITIONAL(ENABLE_UNLINKD, false)
fe0810ac 1119fi
fe0810ac 1120
ce3d30fb 1121dnl Enable backtraces on fatal errors
1122AC_ARG_ENABLE(stacktraces,
1123[ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1124[ if test "$enableval" = "yes" ; then
1125 echo "Enabling automatic stack backtraces on fatal errors"
1126 AC_DEFINE(PRINT_STACK_TRACE, 1)
1127 fi
1128])
1129
f66a9ef4 1130dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1131AC_ARG_ENABLE(x_accelerator_vary,
0961c811 1132[ --enable-x-accelerator-vary
1133 Enable support for the X-Accelerator-Vary
1134 HTTP header. Can be used to indicate
1135 variance within an accelerator setup.
1136 Typically used together with other code
1137 that adds custom HTTP headers to the requests.],
f66a9ef4 1138[ if test "$enableval" = "yes" ; then
1139 echo "Enabling support for X-Accelerator-Vary"
1140 AC_DEFINE(X_ACCELERATOR_VARY, 1)
1141 fi
1142])
1143
f49be7d1 1144AC_ARG_WITH(filedescriptors,
1145[ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors],
1146[ squid_filedescriptors_num=$withval ])
1147
fd9aaa3e 1148# Force some compilers to use ANSI features
1149#
1150case "$host" in
1151 alpha-dec-osf*)
1152 if test "$ac_cv_prog_CC" = "cc" ; then
1153 echo "adding '-std1' to cc args for $host"
1154 CC="cc -std1";
1155 ac_cv_prog_CC="$CC"
1156 fi
1157 ;;
c68e9c6b 1158 *-hp-hpux*)
1159 if test "$ac_cv_prog_CC" = "cc" ; then
1160 echo "adding '-Ae' to cc args for $host"
1161 CC="cc -Ae";
1162 ac_cv_prog_CC="$CC"
1163 fi
1164 ;;
fd9aaa3e 1165esac
1166
090089c4 1167dnl Check for programs
1168AC_PROG_CPP
1169AC_PROG_INSTALL
1170AC_PROG_RANLIB
1171AC_PROG_LN_S
81280a96 1172AC_PATH_PROG(SH, sh, /bin/sh)
d9f67e6f 1173AC_PATH_PROG(FALSE, false, /usr/bin/false)
1174AC_PATH_PROG(TRUE, true, /usr/bin/true)
1175AC_PATH_PROG(RM, rm, $FALSE)
1176AC_PATH_PROG(MV, mv, $FALSE)
1177AC_PATH_PROG(MKDIR, mkdir, $FALSE)
090089c4 1178AC_PATH_PROG(LN, ln, cp)
4e9d8e26 1179AC_PATH_PROG(PERL, perl, none)
a2794549 1180dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
6ad85e8a 1181AC_PATH_PROG(AR, ar, $FALSE)
1182
4e9d8e26 1183if test "$ac_cv_path_PERL" = "none"; then
1184 echo "Perl is required to compile Squid"
1185 echo "Please install Perl and then re-run configure"
1186 exit 1
1187fi
1188
6ad85e8a 1189case "$host" in
1190 *-hp-hpux*)
1191 echo "Disabling 'ranlib' for HP-UX..."
1192 RANLIB=":"
1193 ;;
1194esac
1195
1196dnl set $(AR)
1197AR_R="$AR r"
1198case "$host" in
1199 *-next-nextstep3)
1200 AR="libtool -o"
1201 ;;
1202esac
1203AC_SUBST(AR_R)
090089c4 1204
1205dnl Check for headers
1206AC_HEADER_DIRENT
1207AC_HEADER_STDC
db40ae20 1208
1209AC_CHECK_HEADERS( \
db40ae20 1210 arpa/inet.h \
30a4f2a8 1211 arpa/nameser.h \
9441aa34 1212 assert.h \
db40ae20 1213 bstring.h \
db40ae20 1214 crypt.h \
30a4f2a8 1215 ctype.h \
1216 errno.h \
ce3d30fb 1217 execinfo.h \
db40ae20 1218 fcntl.h \
9c1d8929 1219 getopt.h \
88738790 1220 gnumalloc.h \
30a4f2a8 1221 grp.h \
5cafc1d6 1222 ip_compat.h \
42b51993 1223 ip_fil_compat.h \
5cafc1d6 1224 ip_fil.h \
1225 ip_nat.h \
30a4f2a8 1226 libc.h \
6ad85e8a 1227 limits.h \
d852fbad 1228 linux/netfilter_ipv4.h \
30a4f2a8 1229 malloc.h \
e0bddc45 1230 math.h \
db40ae20 1231 memory.h \
b075cbb1 1232 mount.h \
5cafc1d6 1233 net/if.h \
2b0dd4ac 1234 net/pfvar.h \
30a4f2a8 1235 netdb.h \
c415c128 1236 netinet/if_ether.h \
db40ae20 1237 netinet/in.h \
30a4f2a8 1238 netinet/tcp.h \
eb824054 1239 netinet/ip_compat.h \
42b51993 1240 netinet/ip_fil_compat.h \
eb824054 1241 netinet/ip_fil.h \
1242 netinet/ip_nat.h \
1f7c9178 1243 openssl/err.h \
1244 openssl/md5.h \
1245 openssl/ssl.h \
dcfe6390 1246 poll.h \
30a4f2a8 1247 pwd.h \
1248 regex.h \
1249 resolv.h \
c68e9c6b 1250 sched.h \
30a4f2a8 1251 signal.h \
1252 stdarg.h \
1253 stddef.h \
1254 stdio.h \
db40ae20 1255 stdlib.h \
1256 string.h \
1257 strings.h \
0a4e8536 1258 sys/bitypes.h \
db40ae20 1259 sys/file.h \
5cafc1d6 1260 sys/ioctl.h \
0343b99c 1261 sys/mount.h \
ebb3c3ba 1262 sys/msg.h \
30a4f2a8 1263 sys/param.h \
1264 sys/resource.h \
db40ae20 1265 sys/select.h\
30a4f2a8 1266 sys/socket.h \
1267 sys/stat.h \
b075cbb1 1268 sys/statvfs.h \
3c641669 1269 syscall.h \
30a4f2a8 1270 sys/syscall.h \
db40ae20 1271 sys/time.h \
1272 sys/types.h \
30a4f2a8 1273 sys/un.h \
b075cbb1 1274 sys/vfs.h \
30a4f2a8 1275 sys/wait.h \
db40ae20 1276 syslog.h \
30a4f2a8 1277 time.h \
1278 unistd.h \
3c641669 1279 utime.h \
30a4f2a8 1280 varargs.h \
77d6bd88 1281 byteswap.h \
1282 glib.h \
60d096f4 1283 stdint.h \
1284 inttypes.h \
3c641669 1285 grp.h \
1286 nss_common.h \
1287 nss.h
db40ae20 1288)
1289
aee0606f 1290AC_C_CONST
d57288d2 1291AC_C_BIGENDIAN
aee0606f 1292
5c51415d 1293AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1294 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1295 [foo("bar")],
1296 ac_cv_have_ansi_prototypes="yes",
1297 ac_cv_have_ansi_prototypes="no")
1298])
1299if test $ac_cv_have_ansi_prototypes = "yes" ; then
1300 AC_DEFINE(HAVE_ANSI_PROTOTYPES)
1301fi
20a50bb9 1302
5c51415d 1303AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [
1304 AC_TRY_COMPILE([#include <time.h>
46c883ed 1305#include <sys/time.h>],
5c51415d 1306 [struct tm foo;
1307 foo.tm_gmtoff = 0;],
1308 ac_cv_have_tm_gmoff="yes",
1309 ac_cv_have_tm_gmoff="no")
1310])
1311if test $ac_cv_have_tm_gmoff = "yes" ; then
1312 AC_DEFINE(HAVE_TM_GMTOFF)
1313fi
46c883ed 1314
eb824054 1315AC_CACHE_CHECK(for struct mallinfo,ac_cv_have_struct_mallinfo, [
1316 AC_TRY_COMPILE([#include <sys/types.h>
1317#if HAVE_MALLOC_H
1318#include <malloc.h>
1319#endif],
1320 [struct mallinfo foo;
1321 foo.arena = 0;
1322 foo.ordblks = 0;
1323 foo.smblks = 0;
1324 foo.hblks = 0;
1325 foo.hblkhd = 0;
1326 foo.uordblks = 0;
1327 foo.fordblks = 0;
1328 foo.keepcost = 0;],
1329 ac_cv_have_struct_mallinfo="yes",
1330 ac_cv_have_struct_mallinfo="no")
1331])
1332if test $ac_cv_have_struct_mallinfo = "yes" ; then
1333 AC_DEFINE(HAVE_STRUCT_MALLINFO)
1334fi
1335
5c51415d 1336AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [
1337 AC_TRY_COMPILE([#include <sys/types.h>
46c883ed 1338#include <malloc.h>],
5c51415d 1339 [struct mallinfo foo;
1340 foo.mxfast = 0;],
1341 ac_cv_have_ext_mallinfo="yes",
1342 ac_cv_have_ext_mallinfo="no")
1343])
1344if test $ac_cv_have_ext_mallinfo = "yes" ; then
1345 AC_DEFINE(HAVE_EXT_MALLINFO)
1346fi
090089c4 1347
b54a6789 1348AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [
1349 AC_TRY_COMPILE([
8ff51bba 1350#if HAVE_SYS_TIME_H
1351#include <sys/time.h>
1352#endif
b54a6789 1353#if HAVE_SYS_RESOURCE_H
1354#include <sys/resource.h>
1355#endif],
1356 [struct rusage R;],
1357 ac_cv_have_struct_rusage="yes",
1358 ac_cv_have_struct_rusage="no")
1359])
1360if test $ac_cv_have_struct_rusage = "yes" ; then
1361 AC_DEFINE(HAVE_STRUCT_RUSAGE)
1362fi
1363
5c51415d 1364AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [
1365 AC_TRY_COMPILE([#include <sys/types.h>
a025a745 1366#include <netinet/in.h>
1367#include <netinet/in_systm.h>
6ad85e8a 1368#include <netinet/ip.h>
b05490a8 1369#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 1370#define ip_hl ihl
1371#endif
1372#ifndef __linux__
b05490a8 1373#ifndef __CYGWIN__
6ad85e8a 1374#define iphdr ip
b05490a8 1375#endif
6ad85e8a 1376#endif],
5c51415d 1377 [struct iphdr ip;
1378 ip.ip_hl= 0;],
1379 ac_cv_have_ip_hl="yes",
1380 ac_cv_have_ip_hl="no")
1381])
1382if test $ac_cv_have_ip_hl = "yes" ; then
1383 AC_DEFINE(HAVE_IP_HL)
1384fi
a025a745 1385
090089c4 1386dnl Check for typedefs
77d6bd88 1387AC_CHECK_SIZEOF(void *)
1388AC_CHECK_SIZEOF(short)
090089c4 1389AC_CHECK_SIZEOF(int)
1390AC_CHECK_SIZEOF(long)
77d6bd88 1391AC_CHECK_SIZEOF(long long)
8154dd82 1392AC_CHECK_SIZEOF_SYSTYPE(__int64)
1393AC_CHECK_SIZEOF_SYSTYPE(int16_t)
1394AC_CHECK_SIZEOF_SYSTYPE(uint16_t)
1395AC_CHECK_SIZEOF_SYSTYPE(u_int16_t)
1396AC_CHECK_SIZEOF_SYSTYPE(int32_t)
1397AC_CHECK_SIZEOF_SYSTYPE(uint32_t)
1398AC_CHECK_SIZEOF_SYSTYPE(u_int32_t)
1399AC_CHECK_SIZEOF_SYSTYPE(int64_t)
1400AC_CHECK_SIZEOF_SYSTYPE(uint64_t)
1401AC_CHECK_SIZEOF_SYSTYPE(u_int64_t)
77d6bd88 1402
1403dnl int16_t
1404if test "x$ac_cv_sizeof_short" = "x2"; then
62b34480 1405 AC_CHECK_SYSTYPE(int16_t,short)
77d6bd88 1406elif test "x$ac_cv_sizeof_int" = "x2"; then
62b34480 1407 AC_CHECK_SYSTYPE(int16_t,int)
77d6bd88 1408fi
1409dnl u_int16t_t
1410if test "x$ac_cv_sizeof_uint16_t" = "x2"; then
62b34480 1411 AC_CHECK_SYSTYPE(u_int16_t,uint16_t)
77d6bd88 1412elif test "x$ac_cv_sizeof_short" = "x2"; then
62b34480 1413 AC_CHECK_SYSTYPE(u_int16_t,unsigned short)
77d6bd88 1414elif test "x$ac_cv_sizeof_int" = "x2"; then
62b34480 1415 AC_CHECK_SYSTYPE(u_int16_t,unsigned int)
77d6bd88 1416fi
1417dnl int32_t
1418if test "x$ac_cv_sizeof_int" = "x4"; then
62b34480 1419 AC_CHECK_SYSTYPE(int32_t,int)
77d6bd88 1420elif "x$ac_cv_sizeof_long" = "x4"; then
62b34480 1421 AC_CHECK_SYSTYPE(int32_t,long)
77d6bd88 1422fi
1423dnl u_int32_t
1424if test "x$ac_cv_sizeof_uint32_t" = "x4"; then
62b34480 1425 AC_CHECK_SYSTYPE(u_int32_t,uint32_t)
77d6bd88 1426elif test "x$ac_cv_sizeof_int" = "x4"; then
62b34480 1427 AC_CHECK_SYSTYPE(u_int32_t,unsigned int)
77d6bd88 1428elif test "x$ac_cv_sizeof_long" = "x4"; then
62b34480 1429 AC_CHECK_SYSTYPE(u_int32_t,unsigned long)
77d6bd88 1430fi
1431dnl int64_t
1432if test "x$ac_cv_sizeof_long" = "x8"; then
62b34480 1433 AC_CHECK_SYSTYPE(int64_t,long)
77d6bd88 1434elif test "x$ac_cv_sizeof_long_long" = "x8"; then
62b34480 1435 AC_CHECK_SYSTYPE(int64_t,long long)
77d6bd88 1436elif test "x$ac_cv_sizeof___int64" = "x8"; then
62b34480 1437 AC_CHECK_SYSTYPE(int64_t,__int64)
77d6bd88 1438fi
1439dnl u_int64_t
1440if test "x$ac_cv_sizeof_uint64_t" = "x8"; then
62b34480 1441 AC_CHECK_SYSTYPE(u_int64_t,uint64_t)
77d6bd88 1442elif test "x$ac_cv_sizeof_long" = "x8"; then
62b34480 1443 AC_CHECK_SYSTYPE(u_int64_t,unsigned long)
77d6bd88 1444elif test "x$ac_cv_sizeof_long_long" = "x8"; then
62b34480 1445 AC_CHECK_SYSTYPE(u_int64_t,unsigned long long)
77d6bd88 1446elif test "x$ac_cv_sizeof___int64" = "x8"; then
62b34480 1447 AC_CHECK_SYSTYPE(int64_t,unsigned __int64)
77d6bd88 1448fi
090089c4 1449
3f6fcd8a 1450AC_CHECK_TYPE(pid_t, int)
0897af2d 1451AC_CHECK_TYPE(size_t, unsigned int)
1452AC_CHECK_TYPE(ssize_t, int)
3f6fcd8a 1453AC_CHECK_TYPE(off_t, int)
95cf2361 1454AC_CHECK_TYPE(mode_t, u_short)
c716a1dd 1455AC_CHECK_TYPE(fd_mask, int)
3f6fcd8a 1456
adcceb47 1457AC_CHECK_SIZEOF_SYSTYPE(off_t, 4)
1458AC_CHECK_SIZEOF_SYSTYPE(size_t, 4)
1459
77d6bd88 1460dnl Check for special functions
1461AC_FUNC_ALLOCA
1462
1463
6637e3a5 1464dnl Check for type in sys/socket.h
1465AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
1466 AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
1467#include <sys/socket.h>
1468#if STDC_HEADERS
1469#include <stdlib.h>
1470#include <stddef.h>
1471#endif],
1472 ac_cv_type_socklen_t=yes,
1473 ac_cv_type_socklen_t=no)
1474])
1475if test $ac_cv_type_socklen_t = no; then
1476 AC_DEFINE(socklen_t, int)
1477fi
1478
aea1be68 1479dnl Check for mtyp_t in some headers
1480AC_CACHE_CHECK(for mtyp_t, ac_cv_type_mtyp_t, [
1481 AC_EGREP_CPP([mtyp_t[^a-zA-Z_0-9]], [#include <sys/types.h>
1482#include <sys/ipc.h>
1483#include <sys/msg.h>],
1484 ac_cv_type_mtyp_t=yes,
1485 ac_cv_type_mtyp_t=no)
1486])
1487if test $ac_cv_type_mtyp_t = no; then
1488 AC_DEFINE(mtyp_t, long)
1489 fi
1490
090089c4 1491dnl Check for needed libraries
30a4f2a8 1492AC_CHECK_LIB(nsl, main)
6716b242 1493AC_CHECK_LIB(socket, main)
94d48591 1494
3c641669 1495dnl Ripped from the Samba sources
1496AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
1497 AC_TRY_COMPILE([
1498#include <sys/types.h>
1499#include <stdlib.h>
1500#include <stddef.h>
1501#include <sys/socket.h>
1502#include <sys/un.h>],
1503[
1504 struct sockaddr_un sunaddr;
1505 sunaddr.sun_family = AF_UNIX;
1506],
1507 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
1508if test x"$squid_cv_unixsocket" = x"yes"; then
1509 AC_DEFINE(HAVE_UNIXSOCKET)
1510fi
1511dnl end rip
1512
94d48591 1513if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
1514 echo "skipping libmalloc check (--enable-dlmalloc specified)"
5c51415d 1515else
94d48591 1516 AC_CHECK_LIB(gnumalloc, main)
1517 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
1518 echo "Disabling extended malloc functions when using gnumalloc"
1519 ac_cv_func_mallinfo=no
1520 ac_cv_func_mallocblksize=no
1521 ac_cv_func_mallopt=no
1522 else
1523 case "$host" in
1524 *-sun-solaris*)
1525 echo "skipping libmalloc check for $host"
1526 ;;
1527 i386-*-freebsd*)
1528 echo "skipping libmalloc check for $host"
1529 ;;
1530 *)
1531
1532 AC_CHECK_LIB(malloc, main)
1533 ;;
1534 esac
1535 fi
8a15e65e 1536fi
94d48591 1537
6716b242 1538AC_CHECK_LIB(bsd, main)
be79ade0 1539AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
04a56fa3 1540AC_CHECK_LIB(bind, gethostbyname)
1541if test $ac_cv_lib_bind_gethostbyname = "no" ; then
1542 case "$host" in
78743365 1543 i386-*-freebsd*)
1544 echo "skipping libresolv checks for $host"
1545 ;;
1546 *)
1547 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
1548 AC_CHECK_LIB(resolv, main)
1549 ;;
04a56fa3 1550 esac
1551fi
e0bddc45 1552AC_CHECK_LIB(m, main)
090089c4 1553
1554dnl Check for libcrypt
8154dd82 1555dnl Some of our helpers use crypt(3) which may be in libc, or in
1556dnl libcrypt (eg FreeBSD)
042b1f8a 1557AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
be79ade0 1558AC_SUBST(CRYPTLIB)
77f675ad 1559
042b1f8a 1560dnl Check for libdl, used by auth_modules/PAM
8154dd82 1561if test "$with_dl" = "yes"; then
1562 AC_CHECK_LIB(dl, dlopen)
1563fi
042b1f8a 1564
e5f4e1b0 1565dnl Check for pthreads
1566dnl We use pthreads when doing ASYNC I/O
8154dd82 1567if test "$with_pthreads" = "yes"; then
1568 AC_CHECK_LIB(pthread, main)
1569fi
71f8abc8 1570
f85c88f3 1571dnl Check for librt
1572dnl We use AIO in the coss store
8154dd82 1573if test "$with_aio" = "yes"; then
1574 AC_CHECK_LIB(rt, aio_read)
1575fi
f85c88f3 1576
86ec11aa 1577dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
1578dnl Robert Side <rside@aiinc.bc.ca>
1579dnl Mon, 18 Jan 1999 17:48:00 GMT
1580case "$host" in
1581 *-pc-sco3.2*)
1582 AC_CHECK_LIB(intl, strftime)
1583 ;;
1584esac
1585
77f675ad 1586dnl System-specific library modifications
1587dnl
1588case "$host" in
88738790 1589 i386-*-solaris2.*)
7149a49f 1590 if test "$GCC" = "yes"; then
1591 echo "Removing -O for gcc on $host"
80e92d6d 1592 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 1593 fi
1594 ;;
77f675ad 1595 *-sgi-irix*)
1596 echo "Removing -lsocket for IRIX..."
6716b242 1597 LIBS=`echo $LIBS | sed -e s/-lsocket//`
77f675ad 1598 echo "Removing -lnsl for IRIX..."
6716b242 1599 LIBS=`echo $LIBS | sed -e s/-lnsl//`
c415c128 1600 ac_cv_lib_nsl_main=no
b44c0fb4 1601 echo "Removing -lbsd for IRIX..."
1602 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 1603 ;;
4ba0bd0e 1604dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
1605dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
1606dnl Please change your configure script. AIX doesn't need -lbsd.
1607 *-ibm-aix*)
1608 echo "Removing -lbsd for AIX..."
1609 LIBS=`echo $LIBS | sed -e s/-lbsd//`
c68e9c6b 1610dnl From: mlaster@metavillage.com (Mike Laster)
1611dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
1612dnl So using the internal versions generates a load of warnings
1613dnl during compile.
1614 echo "disabling snprintf/vsnprintf for $host"
1615 ac_cv_func_snprintf=no
1616 ac_cv_func_vsnprintf=no
4ba0bd0e 1617 ;;
30a4f2a8 1618 *m88k*)
1619 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
7149a49f 1620 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
1621 ;;
580ce039 1622 [*-*-solaris2.[0-4]])
7149a49f 1623 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
30a4f2a8 1624 ;;
711fa75e 1625 [*-sony-newsos[56]*])
f62c73dc 1626 AC_DEFINE(GETTIMEOFDAY_NO_TZP)
1627 ;;
77f675ad 1628esac
090089c4 1629
57faa85a 1630# Remove optimization for GCC 2.95.[123]
d20b1cd0 1631# gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
1632if test "$GCC" = "yes"; then
1633 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
1634 case "$GCCVER" in
57faa85a 1635 [2.95.[123]])
d20b1cd0 1636 echo "Removing -O for gcc on $host with GCC $GCCVER"
1637 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1638 ;;
1639 esac
1640fi
1641
176d10ee 1642# Recommended by Balint Nagy Endre <bne@CareNet.hu>
1643case "$host" in
1644 *-univel-sysv4.2MP)
1645 if test `uname -v` = "2.03"; then
1646 echo "disabling mallinfo for $host"
1647 ac_cv_func_mallinfo=no
1648 fi
1649 ;;
1650esac
1651
84cecfd2 1652dnl This has to be before AC_CHECK_FUNCS
1653# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
1654# when running configure.
1655if test -z "$ac_cv_func_poll"; then
1656 case "$host" in
1657 [alpha-dec-osf3.*])
1658 # John Kay (jkay@nlanr.net) 19970818
1659 echo "disabling poll for $host..."
1660 ac_cv_func_poll='no'
1661 ;;
1662 [*-hp-hpux*.*])
1663 # Duane Wessels
1664 echo "disabling poll for $host..."
1665 ac_cv_func_poll='no'
1666 ;;
1667 [*-linux-*])
f5cec332 1668 # Henrik Nordstrom (hno@squid-cache.org) 19980817
9bb83c8b 1669 # poll is problematic on Linux. We disable it
1670 # by default until Linux gets it right.
b6a2f15e 1671 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
1672 if test $rev -lt 002002; then
1673 echo "disabling poll for $host < 2.2..."
1674 ac_cv_func_poll='no'
1675 fi
84cecfd2 1676 ;;
c68e9c6b 1677 [powerpc-ibm-aix4.1.*])
1678 # Mike Laster (mlaster@metavillage.com) 19981021
1679 echo "disabling poll for $host..."
1680 ac_cv_func_poll='no'
1681 ;;
86ec11aa 1682 [*-pc-sco3.2*])
1683 # Robert Side <rside@aiinc.bc.ca>
1684 # Mon, 18 Jan 1999 17:48:00 GMT
1685 echo "disabling poll for $host..."
1686 ac_cv_func_poll='no'
1687 ;;
84cecfd2 1688 esac
1689fi
176d10ee 1690
6716b242 1691dnl Check for library functions
1692AC_CHECK_FUNCS(\
ce3d30fb 1693 backtrace_symbols_fd \
3a144521 1694 bcopy \
1695 bswap_16 \
1696 bswap_32 \
df087e68 1697 crypt \
4ac29a5b 1698 fchmod \
6716b242 1699 getdtablesize \
8505e57b 1700 getpagesize \
230c091c 1701 getpass \
3a144521 1702 getrlimit \
30a4f2a8 1703 getrusage \
9c1d8929 1704 getspnam \
30a4f2a8 1705 lrand48 \
6716b242 1706 mallinfo \
0f5efab0 1707 mallocblksize \
6716b242 1708 mallopt \
2ae6b9b0 1709 memcpy \
30a4f2a8 1710 memmove \
dac27377 1711 memset \
b99a6dec 1712 mkstemp \
1812b6c7 1713 mktime \
88738790 1714 mstats \
84cecfd2 1715 poll \
3a144521 1716 pthread_attr_setschedparam \
cd748f27 1717 pthread_attr_setscope \
1718 pthread_setschedparam \
42b51993 1719 pthread_sigmask \
c68e9c6b 1720 putenv \
b1e77ec1 1721 random \
6716b242 1722 regcomp \
1723 regexec \
1724 regfree \
30a4f2a8 1725 res_init \
4915be3b 1726 rint \
3a144521 1727 select \
234967c9 1728 seteuid \
c415c128 1729 setgroups \
30a4f2a8 1730 setpgrp \
6716b242 1731 setrlimit \
30a4f2a8 1732 setsid \
1733 sigaction \
11430c03 1734 snprintf \
1ccc0d40 1735 socketpair \
30a4f2a8 1736 srand48 \
b1e77ec1 1737 srandom \
0343b99c 1738 statfs \
6716b242 1739 sysconf \
1740 syslog \
234967c9 1741 timegm \
28da5e0d 1742 vsnprintf \
6716b242 1743)
1744
1b3db6d9 1745dnl Magic which checks whether we are forcing a type of comm loop we
1746dnl are actually going to (ab)use
1747
1748dnl Actually do the define magic now
1749dnl mostly ripped from squid-commloops, thanks to adrian and benno
1750
1751if test "$ac_cv_func_poll" = "yes" ; then
1752 SELECT_TYPE="poll"
1753 AC_DEFINE(USE_POLL)
1754elif test "$ac_cv_func_select" = "yes" ; then
1755 SELECT_TYPE="select"
1756 AC_DEFINE(USE_SELECT)
92b9f1fd 1757elif test "$ac_cv_func_kqueue" = "yes" ; then
1758 SELECT_TYPE="kqueue"
1759 AC_DEFINE(USE_KQUEUE)
1b3db6d9 1760else
92b9f1fd 1761 echo "Eep! Can't find poll, kqueue or select!"
1b3db6d9 1762 echo "I'll try select and hope for the best."
1763 SELECT_TYPE="select"
1764 AC_DEFINE(USE_SELECT)
1765fi
1766echo "Using ${SELECT_TYPE} for select loop."
1b3db6d9 1767
1768
60939927 1769dnl Yay! Another Linux brokenness. Its not good enough
1770dnl to know that setresuid() exists, because RedHat 5.0 declares
1771dnl setresuid() but doesn't implement it.
1772dnl
1773AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
5c51415d 1774 AC_TRY_RUN([
60939927 1775#include <stdlib.h>
5c51415d 1776 int main() {
1777 if(setresuid(-1,-1,-1)) {
1778 perror("setresuid:");
1779 exit(1);
60939927 1780 }
1781 exit(0);
5c51415d 1782 }
1783 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
60939927 1784)
5c51415d 1785if test "$ac_cv_func_setresuid" = "yes" ; then
1786 AC_DEFINE(HAVE_SETRESUID)
1787fi
60939927 1788
c3d0c8b5 1789AM_CONDITIONAL(NEED_OWN_SNPRINTF, false)
1790if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then
1791 AM_CONDITIONAL(NEED_OWN_SNPRINTF, true)
1792fi
1793
5cafc1d6 1794dnl IP-Filter support requires ipf header files. These aren't
1795dnl installed by default, so we need to check for them
1796if test "$IPF_TRANSPARENT" ; then
1797 AC_MSG_CHECKING(if IP-Filter header files are installed)
42b51993 1798 # hold on to your hats...
1799 if test "$ac_cv_header_ip_compat_h" = "yes" ||
1800 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
87d21d8b 1801 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
1802 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
42b51993 1803 have_ipfilter_compat_header="yes"
1804 fi
1805 if test "x$have_ipfilter_compat_header" = "xyes" &&
eb824054 1806 test "$ac_cv_header_ip_fil_h" = "yes" &&
1807 test "$ac_cv_header_ip_nat_h" = "yes" ; then
1808 IPF_TRANSPARENT="yes"
1809 AC_DEFINE(IPF_TRANSPARENT, 1)
42b51993 1810 elif test "$have_ipfilter_compat_header" = "yes" &&
eb824054 1811 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
1812 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
1813 IPF_TRANSPARENT="yes"
1814 AC_DEFINE(IPF_TRANSPARENT, 1)
1815 else
5cafc1d6 1816 IPF_TRANSPARENT="no"
1817 AC_DEFINE(IPF_TRANSPARENT, 0)
5cafc1d6 1818 fi
1819 AC_MSG_RESULT($IPF_TRANSPARENT)
1820fi
1821if test "$IPF_TRANSPARENT" = "no" ; then
1822 echo "WARNING: Cannot find necessary IP-Filter header files"
1823 echo " Transparent Proxy support WILL NOT be enabled"
1824 sleep 10
1825fi
1826
2b0dd4ac 1827dnl PF support requires a header file.
1828if test "$PF_TRANSPARENT" ; then
1829 AC_MSG_CHECKING(if PF header file is installed)
1830 # hold on to your hats...
1831 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
1832 PF_TRANSPARENT="yes"
1833 AC_DEFINE(PF_TRANSPARENT, 1)
1834 else
1835 PF_TRANSPARENT="no"
1836 AC_DEFINE(PF_TRANSPARENT, 0)
1837 fi
1838 AC_MSG_RESULT($PF_TRANSPARENT)
1839fi
1840if test "$PF_TRANSPARENT" = "no" ; then
1841 echo "WARNING: Cannot find necessary PF header file"
1842 echo " Transparent Proxy support WILL NOT be enabled"
1843 sleep 10
1844fi
1845
d852fbad 1846dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
1847dnl Shamelessly copied from above
1848if test "$LINUX_NETFILTER" ; then
1849 AC_MSG_CHECKING(if Linux 2.4 kernel header files are installed)
1850 # hold on to your hats...
1851 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
1852 LINUX_NETFILTER="yes"
1853 AC_DEFINE(LINUX_NETFILTER, 1)
1854 else
1855 LINUX_NETFILTER="no"
1856 AC_DEFINE(LINUX_NETFILTER, 0)
1857 fi
1858 AC_MSG_RESULT($LINUX_NETFILTER)
1859fi
1860if test "$LINUX_NETFILTER" = "no" ; then
1861 echo "WARNING: Cannot find necessary Linux 2.4 kernel header files"
1862 echo " Linux 2.4 Transparent Proxy support WILL NOT be enabled"
1863 sleep 10
1864fi
1865
91bc414e 1866if test -z "$USE_GNUREGEX" ; then
1867 case "$host" in
1868 *-sun-solaris2.[[0-4]])
1869 USE_GNUREGEX="yes"
1870 ;;
1871 *-next-nextstep*)
1872 USE_GNUREGEX="yes"
1873 ;;
1874 esac
1875fi
7a081912 1876AC_MSG_CHECKING(if GNUregex needs to be compiled)
91bc414e 1877if test -z "$USE_GNUREGEX"; then
55878dfd 1878if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
74946a0f 1879 USE_GNUREGEX="yes"
00fa2c12 1880else
0cccc031 1881 AC_TRY_COMPILE([#include <sys/types.h>
1882#include <regex.h>],[regex_t t; regcomp(&t,"",0);],
91bc414e 1883 USE_GNUREGEX="no",
1884 USE_GNUREGEX="yes")
1885fi
00fa2c12 1886fi
74946a0f 1887AC_MSG_RESULT($USE_GNUREGEX)
1888if test "$USE_GNUREGEX" = "yes"; then
26675bf4 1889 REGEXLIB="-lregex"
7a081912 1890 LIBREGEX="libregex.a"
74946a0f 1891 AC_DEFINE(USE_GNUREGEX)
7a081912 1892fi
26675bf4 1893AC_SUBST(REGEXLIB)
00fa2c12 1894AC_SUBST(LIBREGEX)
7a081912 1895
3f6fcd8a 1896AC_REPLACE_FUNCS(\
3d0cf10e 1897 drand48 \
3f6fcd8a 1898 tempnam \
4d38fc7e 1899 strerror \
3f6fcd8a 1900)
1901
5c51415d 1902dnl Not cached since people are likely to tune this
e924600d 1903AC_MSG_CHECKING(Default FD_SETSIZE value)
1904AC_TRY_RUN([
1905#if HAVE_STDIO_H
1906#include <stdio.h>
1907#endif
1908#if HAVE_UNISTD_H
1909#include <unistd.h>
1910#endif
1911#if HAVE_SYS_TIME_H
1912#include <sys/time.h>
1913#endif
1914#if HAVE_SYS_SELECT_H
1915#include <sys/select.h>
1916#endif
1917#if HAVE_SYS_TYPES_H
1918#include <sys/types.h>
1919#endif
1920main() {
635e6242 1921 FILE *fp = fopen("conftestval", "w");
1922 fprintf (fp, "%d\n", FD_SETSIZE);
e924600d 1923 exit(0);
1924}
1925],
1926DEFAULT_FD_SETSIZE=`cat conftestval`,
1927DEFAULT_FD_SETSIZE=256,
1928DEFAULT_FD_SETSIZE=256)
1929AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
1930AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
1931
f49be7d1 1932
5c51415d 1933dnl Not cached since people are likely to tune this
234967c9 1934AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
c76d8acc 1935dnl damn! FreeBSD's pthreads breaks dup2().
f49be7d1 1936if test -n "$squid_filedescriptors_num" ; then
1937 SQUID_MAXFD=$squid_filedescriptors_num
1938 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
1939else
1940 TLDFLAGS="$LDFLAGS"
1941 case $host in
1942 i386-unknown-freebsd*)
1943 if echo "$LDFLAGS" | grep -q pthread; then
1944 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
1945 fi
1946 esac
1947 AC_TRY_RUN([
8cca06da 1948#include <stdio.h>
234967c9 1949#include <unistd.h>
30a4f2a8 1950#include <sys/time.h> /* needed on FreeBSD */
234967c9 1951#include <sys/param.h>
1952#include <sys/resource.h>
1953main() {
635e6242 1954 FILE *fp;
234967c9 1955 int i,j;
42b51993 1956#if defined(__CYGWIN32__) || defined (__CYGWIN__)
b05490a8 1957 /* getrlimit and sysconf returns bogous values on cygwin32.
df087e68 1958 * Number of fds is virtually unlimited in cygwin (sys/param.h)
b05490a8 1959 * __CYGWIN32__ is deprecated.
df087e68 1960 */
1961 i = NOFILE;
b05490a8 1962#else
1963#if HAVE_SETRLIMIT
234967c9 1964 struct rlimit rl;
1965#if defined(RLIMIT_NOFILE)
1966 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
1967 perror("getrlimit: RLIMIT_NOFILE");
1968 } else {
1969 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1970 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
1971 perror("setrlimit: RLIMIT_NOFILE");
1972 }
1973 }
1974#elif defined(RLIMIT_OFILE)
1975 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
1976 perror("getrlimit: RLIMIT_OFILE");
1977 } else {
1978 rl.rlim_cur = rl.rlim_max; /* set it to the max */
1979 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
1980 perror("setrlimit: RLIMIT_OFILE");
1981 }
1982 }
1983#endif /* RLIMIT_NOFILE */
1984#endif /* HAVE_SETRLIMIT */
d9399075 1985 /* by starting at 2^14, we will never get higher
1986 than 2^15 for SQUID_MAXFD */
1987 i = j = 1<<14;
1988 while (j) {
1989 j >>= 1;
1990 if (dup2(0, i) < 0) {
1991 i -= j;
1992 } else {
1993 close(i);
1994 i += j;
1995 }
1996 }
1997 i++;
b05490a8 1998#endif /* IF !DEF CYGWIN */
635e6242 1999 fp = fopen("conftestval", "w");
2000 fprintf (fp, "%d\n", i);
234967c9 2001 exit(0);
2002}
f49be7d1 2003 ],
2004 SQUID_MAXFD=`cat conftestval`,
2005 SQUID_MAXFD=256,
2006 SQUID_MAXFD=256)
2007 AC_MSG_RESULT($SQUID_MAXFD)
2008fi
431d84c5 2009AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD)
b9cc811d 2010if test "$SQUID_MAXFD" -lt 512 ; then
80ab193b 2011 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
2012 echo " cache will be very busy. Please see the FAQ page"
2b6662ba 2013 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
e692ff35 2014 echo " on how to increase your filedescriptor limit"
933cc58d 2015 sleep 10
80ab193b 2016fi
c76d8acc 2017LDFLAGS="$TLDFLAGS"
234967c9 2018
5c51415d 2019dnl Not cached since people are likely to tune this
30a4f2a8 2020AC_MSG_CHECKING(Default UDP send buffer size)
2021AC_TRY_RUN([
8cca06da 2022#include <stdlib.h>
2023#include <stdio.h>
30a4f2a8 2024#include <sys/types.h>
2025#include <sys/socket.h>
2026#include <netinet/in.h>
2027main ()
2028{
635e6242 2029 FILE *fp;
30a4f2a8 2030 int fd,val=0,len=sizeof(int);
2031 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2032 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2033 if (val<=0) exit(1);
635e6242 2034 fp = fopen("conftestval", "w");
2035 fprintf (fp, "%d\n", val);
30a4f2a8 2036 exit(0);
2037}
2038],
2039SQUID_UDP_SO_SNDBUF=`cat conftestval`,
1c481e00 2040SQUID_UDP_SO_SNDBUF=16384,
2041SQUID_UDP_SO_SNDBUF=16384)
30a4f2a8 2042AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF)
2043AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF)
2044
5c51415d 2045dnl Not cached since people are likely to tune this
30a4f2a8 2046AC_MSG_CHECKING(Default UDP receive buffer size)
2047AC_TRY_RUN([
8cca06da 2048#include <stdlib.h>
2049#include <stdio.h>
30a4f2a8 2050#include <sys/types.h>
2051#include <sys/socket.h>
2052#include <netinet/in.h>
2053main ()
2054{
635e6242 2055 FILE *fp;
30a4f2a8 2056 int fd,val=0,len=sizeof(int);
2057 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2058 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2059 if (val <= 0) exit(1);
635e6242 2060 fp = fopen("conftestval", "w");
2061 fprintf (fp, "%d\n", val);
30a4f2a8 2062 exit(0);
2063}
2064],
2065SQUID_UDP_SO_RCVBUF=`cat conftestval`,
1c481e00 2066SQUID_UDP_SO_RCVBUF=16384,
2067SQUID_UDP_SO_RCVBUF=16384)
30a4f2a8 2068AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF)
2069AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF)
2070
5c51415d 2071dnl Not cached since people are likely to tune this
30a4f2a8 2072AC_MSG_CHECKING(Default TCP send buffer size)
2073AC_TRY_RUN([
8cca06da 2074#include <stdlib.h>
2075#include <stdio.h>
30a4f2a8 2076#include <sys/types.h>
2077#include <sys/socket.h>
2078#include <netinet/in.h>
2079main ()
2080{
635e6242 2081 FILE *fp;
30a4f2a8 2082 int fd,val=0,len=sizeof(int);
2083 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2084 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2085 if (val <= 0) exit(1);
635e6242 2086 fp = fopen("conftestval", "w");
2087 fprintf (fp, "%d\n", val);
30a4f2a8 2088 exit(0);
2089}
2090],
2091SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1c481e00 2092SQUID_TCP_SO_SNDBUF=16384,
2093SQUID_TCP_SO_SNDBUF=16384)
30a4f2a8 2094AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2095AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF)
2096
5c51415d 2097dnl Not cached since people are likely to tune this
30a4f2a8 2098AC_MSG_CHECKING(Default TCP receive buffer size)
2099AC_TRY_RUN([
8cca06da 2100#include <stdlib.h>
2101#include <stdio.h>
30a4f2a8 2102#include <sys/types.h>
2103#include <sys/socket.h>
2104#include <netinet/in.h>
2105main ()
2106{
635e6242 2107 FILE *fp;
30a4f2a8 2108 int fd,val=0,len=sizeof(int);
2109 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2110 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2111 if (val <= 0) exit(1);
635e6242 2112 fp = fopen("conftestval", "w");
2113 fprintf (fp, "%d\n", val);
30a4f2a8 2114 exit(0);
2115}
2116],
2117SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1c481e00 2118SQUID_TCP_SO_RCVBUF=16384,
2119SQUID_TCP_SO_RCVBUF=16384)
30a4f2a8 2120AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2121AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF)
2122
5c51415d 2123AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
9bc73deb 2124 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
5c51415d 2125 ac_cv_needs_sys_errlist="no",
2126 ac_cv_needs_sys_errlist="yes")
2127)
2128if test "$ac_cv_needs_sys_errlist" = "yes" ; then
2129 AC_DEFINE(NEED_SYS_ERRLIST)
2130fi
30a4f2a8 2131
5c51415d 2132dnl Not cached since people are likely to change this
6bf65235 2133AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
2134AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
2135[AC_MSG_RESULT(yes)
2136AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)],
2137AC_MSG_RESULT(no))
2138
a937d5e3 2139AC_MSG_CHECKING(if inet_ntoa() actually works)
2140AC_TRY_RUN([
2141#include <stdlib.h>
2142#include <stdio.h>
2143#include <sys/types.h>
2144#include <netinet/in.h>
2145#include <arpa/inet.h>
2146main ()
2147{
635e6242 2148 FILE *fp;
a937d5e3 2149 struct in_addr in;
2150 in.s_addr = inet_addr("1.2.3.4");
635e6242 2151 fp = fopen("conftestval", "w");
2152 fprintf (fp, "%s\n", inet_ntoa(in));
a937d5e3 2153 exit(0);
2154}
2155],
2156INET_NTOA_RESULT=`cat conftestval`,
2157INET_NTOA_RESULT="broken",
2158INET_NTOA_RESULT="broken")
2159if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
2160 AC_MSG_RESULT("yes")
2161else
2162 AC_MSG_RESULT("no")
b6a2f15e 2163 echo "Will use our own inet_ntoa()."
2164 LIBOBJS="$LIBOBJS inet_ntoa.o"
2165# echo "WARNING: This looks bad, and probably prevents Squid from working."
2166# echo " If you're on IRIX and using GCC 2.8, you probably need"
2167# echo " to use the IRIX C compiler instead."
2168# sleep 10
a937d5e3 2169fi
2170
b6a2f15e 2171if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
c68e9c6b 2172AC_MSG_CHECKING(for working statvfs() interface)
2173AC_TRY_COMPILE([
2174#include <stdlib.h>
2175#include <stdio.h>
2176#include <sys/types.h>
2177#include <sys/statvfs.h>
2178],
2179[
2180struct statvfs sfs;
2181sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
2182sfs.f_files = sfs.f_ffree = 0;
2183statvfs("/tmp", &sfs);
2184],
2185 ac_cv_func_statvfs=yes,
2186 ac_cv_func_statvfs=no)
2187AC_MSG_RESULT($ac_cv_func_statvfs)
6b8e7481 2188if test "$ac_cv_func_statvfs" = "yes" ; then
b6a2f15e 2189 AC_DEFINE(HAVE_STATVFS)
2190fi
6b8e7481 2191fi
c68e9c6b 2192
2193AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
2194AC_TRY_COMPILE([
2195#if HAVE_SYS_TYPES_H
2196#include <sys/types.h>
2197#endif
2198#if HAVE_NETINET_IN_H
2199#include <netinet/in.h>
2200#endif
2201#if HAVE_ARPA_INET_H
2202#include <arpa/inet.h>
2203#endif
2204#if HAVE_ARPA_NAMESER_H
2205#include <arpa/nameser.h>
2206#endif
2207#if HAVE_RESOLV_H
2208#include <resolv.h>
2209#endif
2210],
2211[_res.nsaddr_list[[0]];],
2212ac_cv_have_res_nsaddr_list="yes",
2213ac_cv_have_res_nsaddr_list="no"))
2214if test $ac_cv_have_res_nsaddr_list = "yes" ; then
2215 AC_DEFINE(HAVE_RES_NSADDR_LIST)
2216fi
2217
2218if test $ac_cv_have_res_nsaddr_list = "no" ; then
2219AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
2220AC_TRY_COMPILE([
2221#if HAVE_SYS_TYPES_H
2222#include <sys/types.h>
2223#endif
2224#if HAVE_NETINET_IN_H
2225#include <netinet/in.h>
2226#endif
2227#if HAVE_ARPA_INET_H
2228#include <arpa/inet.h>
2229#endif
2230#if HAVE_ARPA_NAMESER_H
2231#include <arpa/nameser.h>
2232#endif
2233#if HAVE_RESOLV_H
2234#include <resolv.h>
2235#endif
2236],
2237[_res.ns_list[[0]].addr;],
2238ac_cv_have_res_ns_list="yes",
2239ac_cv_have_res_ns_list="no"))
2240if test $ac_cv_have_res_ns_list = "yes" ; then
2241 AC_DEFINE(HAVE_RES_NS_LIST)
2242fi
2243fi
2244
090089c4 2245dnl Need the debugging version of malloc if available
2246XTRA_OBJS=''
6509a1a0 2247if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 2248 if test -r /usr/lib/debug/malloc.o ; then
2249 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
2250 fi
2251 if test -r /usr/lib/debug/mallocmap.o ; then
2252 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
2253 fi
2254fi
2bbd722b 2255
090089c4 2256AC_SUBST(XTRA_OBJS)
2257
38fea766 2258if test -z "$XTRA_LIBS"; then
2259 XTRA_LIBS="$LIBS"
0f5a16f8 2260 dnl minor cleanup
2261 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 2262 LIBS=''
2263fi
090089c4 2264AC_SUBST(XTRA_LIBS)
2265
090089c4 2266dnl Clean up after OSF/1 core dump bug
2267rm -f core
2268
a2794549 2269dnl FS_MAKEFILES=""
2270dnl for fs in $STORE_MODULES none; do
2271dnl if test $fs != none; then
2272dnl FS_MAKEFILES="$FS_MAKEFILES ./src/fs/$fs/Makefile"
2273dnl fi
2274dnl done
2275dnl REPL_MAKEFILES=""
2276dnl for repl in $REPL_POLICIES none; do
2277dnl if test $repl != none; then
2278dnl REPL_MAKEFILES="$REPL_MAKEFILES ./src/repl/$repl/Makefile"
2279dnl fi
2280dnl done
caa4f581 2281
63bf42ae 2282dnl This could actually be used to find all the Makefiles..
a2794549 2283dnl One of Automake's limitations is that it needs to know all the created makefiles.
2284dnl AUTH_MAKEFILES=""
2285dnl for auth in `find $srcdir/src/auth -type d -print`; do
2286dnl if test -f $auth/Makefile.in; then
2287dnl dir=`echo $auth | sed -e "s|^$srcdir/||"`
2288dnl AUTH_MAKEFILES="$AUTH_MAKEFILES ./$dir/Makefile"
2289dnl fi
2290dnl done
2291
2292
2293dnl src/fs/aufs/Makefile \
2294dnl src/fs/coss/Makefile \
2295dnl src/fs/diskd/Makefile \
2296dnl src/fs/null/Makefile \
2297dnl src/fs/ufs/Makefile \
2298dnl src/repl/heap/Makefile \
2299dnl src/repl/lru/Makefile \
2300AC_OUTPUT([\
2301 Makefile \
2302 lib/Makefile \
a2794549 2303 scripts/Makefile \
2304 scripts/RunCache \
2305 scripts/RunAccel \
2306 src/Makefile \
2307 src/fs/Makefile \
2308 src/repl/Makefile \
2309 src/auth/Makefile \
2310 src/auth/basic/Makefile \
a2794549 2311 src/auth/digest/Makefile \
a2794549 2312 src/auth/ntlm/Makefile \
a2794549 2313 contrib/Makefile \
2314 snmplib/Makefile \
2315 icons/Makefile \
2316 errors/Makefile \
c0f59984 2317 src/fs/aufs/Makefile \
2318 src/fs/coss/Makefile \
2319 src/fs/diskd/Makefile \
2320 src/fs/null/Makefile \
2321 src/fs/ufs/Makefile \
2322 src/repl/heap/Makefile \
2323 src/repl/lru/Makefile \
99db07b3 2324 doc/Makefile \
0c510f3c 2325 helpers/Makefile \
2326 helpers/basic_auth/Makefile \
2327 helpers/basic_auth/LDAP/Makefile \
2328 helpers/basic_auth/MSNT/Makefile \
2329 helpers/basic_auth/NCSA/Makefile \
2330 helpers/basic_auth/PAM/Makefile \
2331 helpers/basic_auth/SMB/Makefile \
2332 helpers/basic_auth/YP/Makefile \
2333 helpers/basic_auth/getpwnam/Makefile \
2334 helpers/basic_auth/multi-domain-NTLM/Makefile \
2335 helpers/basic_auth/SASL/Makefile \
2336 helpers/basic_auth/winbind/Makefile \
2337 helpers/digest_auth/Makefile \
2338 helpers/digest_auth/password/Makefile \
2339 helpers/ntlm_auth/Makefile \
2340 helpers/ntlm_auth/fakeauth/Makefile \
2341 helpers/ntlm_auth/no_check/Makefile \
2342 helpers/ntlm_auth/SMB/Makefile \
2343 helpers/ntlm_auth/SMB/smbval/Makefile \
2344 helpers/ntlm_auth/winbind/Makefile \
c6588c68 2345 helpers/external_acl/Makefile \
2346 helpers/external_acl/ip_user/Makefile \
2347 helpers/external_acl/ldap_group/Makefile \
2348 helpers/external_acl/unix_group/Makefile \
2349 helpers/external_acl/wbinfo_group/Makefile \
4402cd0f 2350 helpers/external_acl/winbind_group/Makefile \
53cbe3e4 2351])