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