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