]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
Bugzilla #446:
[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
41e4e47e 6dnl $Id: configure.in,v 1.306 2002/11/29 22:36:37 hno 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)
41e4e47e 16AC_REVISION($Revision: 1.306 $)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)
1c42c4a1 915 for dir in $srcdir/src/auth/*; do
916 module="`basename $dir`"
41e4e47e 917 if test -f $dir/auth_${module}.cc; then
1c42c4a1 918 AUTH_MODULES="$AUTH_MODULES $module"
94439e4e 919 fi
920 done
921 ;;
922 no)
923 ;;
924 *) AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
925 ;;
926 esac
927],
928[ if test -z "$AUTH_MODULES"; then
929 AUTH_MODULES="basic"
930 fi
931])
932echo "Auth scheme modules built: $AUTH_MODULES"
933AC_SUBST(AUTH_MODULES)
a2794549 934AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
94439e4e 935AC_SUBST(AUTH_OBJS)
6652c622 936AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
94439e4e 937AC_SUBST(AUTH_LIBS)
938
939dnl Select basic auth scheme helpers to build
940BASIC_AUTH_HELPERS=""
380f0a87 941AC_ARG_ENABLE(auth-modules,
94439e4e 942[ --enable-auth-modules=\"list of helpers\"
943 Backwards compability alias for
944 --enable-basic-auth-helpers],
945[ echo "--enable-auth-modules is obsolete. Please use the new"
946 echo "option --enable-basic-auth-helpers"
947 sleep 5
948 case "$enableval" in
949 yes)
0c510f3c 950 for helper in $srcdir/helpers/basic_auth/*; do
94439e4e 951 if test -f $helper/Makefile.in; then
fc83a946 952 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`"
94439e4e 953 fi
954 done
955 ;;
956 no)
957 ;;
958 *)
fc83a946 959 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
94439e4e 960 esac
961])
962AC_ARG_ENABLE(basic-auth-helpers,
963[ --enable-basic-auth-helpers=\"list of helpers\"
964 This option selects which basic scheme proxy_auth
965 helpers to build and install as part of the normal
966 build process. For a list of available
0c510f3c 967 helpers see the helpers/basic_auth directory.],
94439e4e 968[ case "$enableval" in
969 yes)
970 BASIC_AUTH_HELPERS=""
0c510f3c 971 for helper in $srcdir/helpers/basic_auth/*; do
94439e4e 972 if test -f $helper/Makefile.in; then
fc83a946 973 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`"
94439e4e 974 fi
975 done
976 ;;
977 no)
978 ;;
979 *)
fc83a946 980 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
94439e4e 981 esac
982])
fc83a946 983if test -n "$BASIC_AUTH_HELPERS"; then
20d8bfe4 984 for helper in $BASIC_AUTH_HELPERS; do
985 if test -f $srcdir/helpers/basic_auth/$helper/Makefile.in; then
986 :
987 else
988 echo "ERROR: Basic auth helper $helper does not exists"
989 exit 1
990 fi
991 done
fc83a946 992 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
94439e4e 993fi
fc83a946 994AC_SUBST(BASIC_AUTH_HELPERS)
94439e4e 995
996dnl Select ntlm auth helpers to build
997NTLM_AUTH_HELPERS=
998AC_ARG_ENABLE(ntlm-auth-helpers,
999[ --enable-ntlm-auth-helpers=\"list of helpers\"
1000 This option selects which proxy_auth ntlm helpers
1001 to build and install as part of the normal build
0c510f3c 1002 process. For a list of available helpers see
1003 the helpers/ntlm_auth directory.],
380f0a87 1004[ case "$enableval" in
1005 yes)
0c510f3c 1006 for helper in $srcdir/helpers/ntlm_auth/*; do
94439e4e 1007 if test -f $helper/Makefile.in; then
1008 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS `basename $helper`"
380f0a87 1009 fi
1010 done
1011 ;;
1012 no)
1013 ;;
1014 *)
94439e4e 1015 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
380f0a87 1016 esac
1017])
94439e4e 1018if test -n "$NTLM_AUTH_HELPERS"; then
20d8bfe4 1019 for helper in $NTLM_AUTH_HELPERS; do
1020 if test -f $srcdir/helpers/ntlm_auth/$helper/Makefile.in; then
1021 :
1022 else
1023 echo "ERROR: NTLM auth helper $helper does not exists"
1024 exit 1
1025 fi
1026 done
94439e4e 1027 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
380f0a87 1028fi
94439e4e 1029AC_SUBST(NTLM_AUTH_HELPERS)
1030
2d70df72 1031dnl Select digest auth scheme helpers to build
1032DIGEST_AUTH_HELPERS=
1033AC_ARG_ENABLE(digest-auth-helpers,
1034[ --enable-digest-auth-helpers=\"list of helpers\"
1035 This option selects which digest scheme authentication
1036 helpers to build and install as part of the normal build
0c510f3c 1037 process. For a list of available helpers see the
1038 helpers/digest_auth directory.],
2d70df72 1039[ case "$enableval" in
1040 yes)
0c510f3c 1041 for helper in $srcdir/helpers/digest_auth/*; do
2d70df72 1042 if test -f $helper/Makefile.in; then
1043 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS `basename $helper`"
1044 fi
1045 done
1046 ;;
1047 no)
1048 ;;
1049 *)
1050 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1051 esac
1052])
1053if test -n "$DIGEST_AUTH_HELPERS"; then
1daefc1a 1054 for helper in $DIGEST_AUTH_HELPERS; do
1055 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1056 :
1057 else
1058 echo "ERROR: digest auth helper $helper does not exists"
1059 exit 1
1060 fi
1061 done
2d70df72 1062 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1063fi
1064AC_SUBST(DIGEST_AUTH_HELPERS)
380f0a87 1065
6437ac71 1066dnl Enable "NTLM fail open"
1067AC_ARG_ENABLE(ntlm-fail-open,
1068[ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
0961c811 1069 Authentication steps can allow squid to still authenticate
1070 the user.],
6437ac71 1071[ if test "$enableval" = "yes" ; then
6a9f6389 1072 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 1073 fi
1074])
1075
c6588c68 1076dnl Select external_acl helpers to build
1077EXTERNAL_ACL_HELPERS=
1078AC_ARG_ENABLE(external-acl-helpers,
1079[ --enable-external-acl-helpers=\"list of helpers\"
1080 This option selects which external_acl helpers to
1081 build and install as part of the normal build
1082 process. For a list of available helpers see the
1083 helpers/external_acl directory.],
1084[ case "$enableval" in
1085 yes)
1086 for helper in $srcdir/helpers/external_acl/*; do
1087 if test -f $helper/Makefile.in; then
1088 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS `basename $helper`"
1089 fi
1090 done
1091 ;;
1092 no)
1093 ;;
1094 *)
1095 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1096 esac
1097])
1098if test -n "$EXTERNAL_ACL_HELPERS"; then
20d8bfe4 1099 for helper in $EXTERNAL_ACL_HELPERS; do
1100 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1101 :
1102 else
1daefc1a 1103 echo "ERROR: external acl helper $helper does not exists"
20d8bfe4 1104 exit 1
1105 fi
1106 done
c6588c68 1107 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1108fi
1109AC_SUBST(EXTERNAL_ACL_HELPERS)
1110
d96ceb8e 1111dnl Disable "memPools" code
1112AC_ARG_ENABLE(mempools,
1113[ --disable-mempools Disable memPools],
1114[ if test "$enableval" = "no" ; then
1115 echo "memPools disabled"
6a9f6389 1116 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
d96ceb8e 1117 fi
1118])
1119
3c573763 1120dnl Disable "unlinkd" code
fe0810ac 1121AC_ARG_ENABLE(unlinkd,
1122[ --disable-unlinkd Do not use unlinkd],
1123[ if test "$enableval" = "no" ; then
3c573763 1124 use_unlinkd=no
fe0810ac 1125 else
3c573763 1126 use_unlinkd=yes
fe0810ac 1127 fi
1128],[
1129 # Here we should probably use some magic depending on the selected
1130 # storage models
3c573763 1131 use_unlinkd=yes
fe0810ac 1132])
3c573763 1133if test "$use_unlinkd" = "yes"; then
fe0810ac 1134 echo "unlinkd enabled"
6a9f6389 1135 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
a2794549 1136 AM_CONDITIONAL(ENABLE_UNLINKD, true)
fe0810ac 1137else
1138 echo "unlinkd disabled"
a2794549 1139 AM_CONDITIONAL(ENABLE_UNLINKD, false)
fe0810ac 1140fi
fe0810ac 1141
ce3d30fb 1142dnl Enable backtraces on fatal errors
1143AC_ARG_ENABLE(stacktraces,
1144[ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1145[ if test "$enableval" = "yes" ; then
1146 echo "Enabling automatic stack backtraces on fatal errors"
6a9f6389 1147 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
ce3d30fb 1148 fi
1149])
1150
88bfe092 1151AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1152dnl Enable USE_XPROF_STATS
1153AC_ARG_ENABLE(cpu-profiling,
1154[ --enable-cpu-profiling
1155 This option allows you to see which internal functions
1156 in Squid are consuming how much CPU. Compiles in probes
1157 that measure time spent in probed functions. Needs
1158 source modifications to add new probes. This is meant
1159 for developers to assist in performance optimisations
1160 of Squid internal functions.
1161 If you are not developer and not interested in the stats
1162 you shouldn't enable this, as overhead added, although
1163 small, is still overhead. See lib/Profiler.c for more.
1164 ],
1165[ if test "$enableval" = "yes" ; then
1166 echo "Enabling cpu-profiling"
6a9f6389 1167 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
88bfe092 1168 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1169 fi
1170])
1171
f66a9ef4 1172dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1173AC_ARG_ENABLE(x_accelerator_vary,
0961c811 1174[ --enable-x-accelerator-vary
1175 Enable support for the X-Accelerator-Vary
1176 HTTP header. Can be used to indicate
1177 variance within an accelerator setup.
1178 Typically used together with other code
1179 that adds custom HTTP headers to the requests.],
f66a9ef4 1180[ if test "$enableval" = "yes" ; then
1181 echo "Enabling support for X-Accelerator-Vary"
6a9f6389 1182 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
f66a9ef4 1183 fi
1184])
1185
f49be7d1 1186AC_ARG_WITH(filedescriptors,
1187[ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors],
1188[ squid_filedescriptors_num=$withval ])
1189
fd9aaa3e 1190# Force some compilers to use ANSI features
1191#
1192case "$host" in
1193 alpha-dec-osf*)
1194 if test "$ac_cv_prog_CC" = "cc" ; then
1195 echo "adding '-std1' to cc args for $host"
1196 CC="cc -std1";
1197 ac_cv_prog_CC="$CC"
1198 fi
1199 ;;
c68e9c6b 1200 *-hp-hpux*)
1201 if test "$ac_cv_prog_CC" = "cc" ; then
1202 echo "adding '-Ae' to cc args for $host"
1203 CC="cc -Ae";
1204 ac_cv_prog_CC="$CC"
1205 fi
1206 ;;
fd9aaa3e 1207esac
1208
090089c4 1209dnl Check for programs
1210AC_PROG_CPP
1211AC_PROG_INSTALL
1212AC_PROG_RANLIB
1213AC_PROG_LN_S
81280a96 1214AC_PATH_PROG(SH, sh, /bin/sh)
d9f67e6f 1215AC_PATH_PROG(FALSE, false, /usr/bin/false)
1216AC_PATH_PROG(TRUE, true, /usr/bin/true)
1217AC_PATH_PROG(RM, rm, $FALSE)
1218AC_PATH_PROG(MV, mv, $FALSE)
1219AC_PATH_PROG(MKDIR, mkdir, $FALSE)
090089c4 1220AC_PATH_PROG(LN, ln, cp)
4e9d8e26 1221AC_PATH_PROG(PERL, perl, none)
a2794549 1222dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
6ad85e8a 1223AC_PATH_PROG(AR, ar, $FALSE)
1224
4e9d8e26 1225if test "$ac_cv_path_PERL" = "none"; then
1226 echo "Perl is required to compile Squid"
1227 echo "Please install Perl and then re-run configure"
1228 exit 1
1229fi
1230
6ad85e8a 1231case "$host" in
1232 *-hp-hpux*)
1233 echo "Disabling 'ranlib' for HP-UX..."
1234 RANLIB=":"
1235 ;;
1236esac
1237
1238dnl set $(AR)
1239AR_R="$AR r"
1240case "$host" in
1241 *-next-nextstep3)
1242 AR="libtool -o"
1243 ;;
1244esac
1245AC_SUBST(AR_R)
090089c4 1246
1247dnl Check for headers
1248AC_HEADER_DIRENT
1249AC_HEADER_STDC
db40ae20 1250
1251AC_CHECK_HEADERS( \
db40ae20 1252 arpa/inet.h \
30a4f2a8 1253 arpa/nameser.h \
9441aa34 1254 assert.h \
db40ae20 1255 bstring.h \
db40ae20 1256 crypt.h \
30a4f2a8 1257 ctype.h \
1258 errno.h \
ce3d30fb 1259 execinfo.h \
db40ae20 1260 fcntl.h \
9c1d8929 1261 getopt.h \
88738790 1262 gnumalloc.h \
30a4f2a8 1263 grp.h \
5cafc1d6 1264 ip_compat.h \
42b51993 1265 ip_fil_compat.h \
5cafc1d6 1266 ip_fil.h \
1267 ip_nat.h \
30a4f2a8 1268 libc.h \
6ad85e8a 1269 limits.h \
30a4f2a8 1270 malloc.h \
e0bddc45 1271 math.h \
db40ae20 1272 memory.h \
b075cbb1 1273 mount.h \
2b0dd4ac 1274 net/pfvar.h \
30a4f2a8 1275 netdb.h \
db40ae20 1276 netinet/in.h \
30a4f2a8 1277 netinet/tcp.h \
42b51993 1278 netinet/ip_fil_compat.h \
1f7c9178 1279 openssl/err.h \
1280 openssl/md5.h \
1281 openssl/ssl.h \
dcfe6390 1282 poll.h \
30a4f2a8 1283 pwd.h \
1284 regex.h \
1285 resolv.h \
c68e9c6b 1286 sched.h \
30a4f2a8 1287 signal.h \
1288 stdarg.h \
1289 stddef.h \
1290 stdio.h \
db40ae20 1291 stdlib.h \
1292 string.h \
1293 strings.h \
0a4e8536 1294 sys/bitypes.h \
db40ae20 1295 sys/file.h \
5cafc1d6 1296 sys/ioctl.h \
0343b99c 1297 sys/mount.h \
ebb3c3ba 1298 sys/msg.h \
30a4f2a8 1299 sys/param.h \
1300 sys/resource.h \
db40ae20 1301 sys/select.h\
30a4f2a8 1302 sys/socket.h \
1303 sys/stat.h \
b075cbb1 1304 sys/statvfs.h \
3c641669 1305 syscall.h \
30a4f2a8 1306 sys/syscall.h \
db40ae20 1307 sys/time.h \
1308 sys/types.h \
30a4f2a8 1309 sys/un.h \
b075cbb1 1310 sys/vfs.h \
30a4f2a8 1311 sys/wait.h \
db40ae20 1312 syslog.h \
30a4f2a8 1313 time.h \
1314 unistd.h \
3c641669 1315 utime.h \
30a4f2a8 1316 varargs.h \
77d6bd88 1317 byteswap.h \
1318 glib.h \
60d096f4 1319 stdint.h \
1320 inttypes.h \
3c641669 1321 grp.h \
1322 nss_common.h \
1323 nss.h
db40ae20 1324)
1325
5a3237b0 1326AC_CHECK_HEADERS(linux/netfilter_ipv4.h,,,
dcd1dc78 1327SQUID_DEFAULT_INCLUDES
1328#if HAVE_LIMITS_H
1329#include <limits.h>
1330#endif
1331)
1332
5a3237b0 1333AC_CHECK_HEADERS(net/if.h \
1334 netinet/if_ether.h\
1335 netinet/ip_compat.h\
1336 netinet/ip_fil.h\
1337 netinet/ip_nat.h,,,SQUID_BSDNET_INCLUDES)
1338
aee0606f 1339AC_C_CONST
d57288d2 1340AC_C_BIGENDIAN
aee0606f 1341
5c51415d 1342AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1343 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1344 [foo("bar")],
1345 ac_cv_have_ansi_prototypes="yes",
1346 ac_cv_have_ansi_prototypes="no")
1347])
1348if test $ac_cv_have_ansi_prototypes = "yes" ; then
6a9f6389 1349 AC_DEFINE(HAVE_ANSI_PROTOTYPES,1,[Define if your compiler supports prototyping])
5c51415d 1350fi
20a50bb9 1351
6a9f6389 1352AC_STRUCT_TM
1353AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
1354#if TM_IN_SYS_TIME
1355#if HAVE_SYS_TIME_H
1356#include <sys/time.h>
1357#endif
1358#elif HAVE_TIME_H
1359#include <time.h>
1360#endif
5c51415d 1361])
46c883ed 1362
6a9f6389 1363AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
1364#if HAVE_SYS_TYPES_H
1365#include <sys/types.h>
1366#endif
eb824054 1367#if HAVE_MALLOC_H
1368#include <malloc.h>
6a9f6389 1369#endif])
eb824054 1370
6a9f6389 1371AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
1372#if HAVE_SYS_TYPES_H
1373#include <sys/types.h>
1374#endif
1375#if HAVE_MALLOC_H
1376#include <malloc.h>
1377#endif])
090089c4 1378
6a9f6389 1379AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
8ff51bba 1380#if HAVE_SYS_TIME_H
1381#include <sys/time.h>
1382#endif
b54a6789 1383#if HAVE_SYS_RESOURCE_H
1384#include <sys/resource.h>
6a9f6389 1385#endif])
b54a6789 1386
6a9f6389 1387AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
1388#if HAVE_SYS_TYPES_H
1389#include <sys/types.h>
1390#endif
a025a745 1391#include <netinet/in.h>
1392#include <netinet/in_systm.h>
6ad85e8a 1393#include <netinet/ip.h>
b05490a8 1394#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 1395#define ip_hl ihl
1396#endif
1397#ifndef __linux__
b05490a8 1398#ifndef __CYGWIN__
6ad85e8a 1399#define iphdr ip
b05490a8 1400#endif
6a9f6389 1401#endif])
a025a745 1402
090089c4 1403dnl Check for typedefs
77d6bd88 1404AC_CHECK_SIZEOF(void *)
090089c4 1405
6a9f6389 1406dnl 16 bit integers - int16_t and u_int16_t
1407dnl if this is defined we trust it to be 16 bits
1408AC_CHECK_TYPE(int16_t,
1409 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers]),
1410 ,SQUID_DEFAULT_INCLUDES)
1411
1412dnl fallback #1
1413AC_CHECK_TYPE(short,[
856e69c5 1414 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 1415 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
1416 ],,SQUID_DEFAULT_INCLUDES)
1417
1418dnl fallback #2
1419AC_CHECK_TYPE(int,[
856e69c5 1420 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 1421 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
1422 ],,SQUID_DEFAULT_INCLUDES)
1423
1424dnl unsigned 16 bit ints - u_int16_t
1425dnl if this is defined we trust it to be 16 bits
1426AC_CHECK_TYPE(u_int16_t,
1427 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers]),
1428 ,SQUID_DEFAULT_INCLUDES)
1429
1430dnl fallback #1
1431dnl if this is defined we trust it to be 16 bits
1432AC_CHECK_TYPE(uint16_t,
1433 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers]),
1434 ,SQUID_DEFAULT_INCLUDES)
1435
1436dnl 32 bit signed int - int32_t
1437dnl if this is defined we trust it to be 32 bits
1438AC_CHECK_TYPE(int32_t,
1439 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers]),
1440 ,SQUID_DEFAULT_INCLUDES)
1441
1442dnl fallback #1
1443AC_CHECK_TYPE(long,[
856e69c5 1444 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 1445 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
1446 ],,SQUID_DEFAULT_INCLUDES)
1447
1448dnl 32 bit unsigned int - u_int32_t
1449dnl if this is defined we trust it to be 32 bits
1450AC_CHECK_TYPE(u_int32_t,
1451 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers]),
1452 ,SQUID_DEFAULT_INCLUDES)
1453
1454dnl fallback #1
1455dnl if this is defined we trust it to be 32 bits
1456AC_CHECK_TYPE(uint32_t,
1457 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers]),
1458 ,SQUID_DEFAULT_INCLUDES)
1459
1460dnl 64 bit signed - int64_t
1461dnl if this is defind we trust it to be 64 bits
1462AC_CHECK_TYPE(int64_t,
1463 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers]),
1464 ,SQUID_DEFAULT_INCLUDES)
1465
1466dnl fallback #1
1467dnl if this is defind we trust it to be 64 bits
1468AC_CHECK_TYPE(__int64,
1469 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers]),
1470 ,SQUID_DEFAULT_INCLUDES)
1471
1472dnl fallback #2
1473AC_CHECK_TYPE(long long,[
856e69c5 1474 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 1475 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
1476 ],,SQUID_DEFAULT_INCLUDES)
1477
1478dnl 64 bit unsigned - u_int64_t
1479dnl if this is defind we trust it to be 64 bits
1480AC_CHECK_TYPE(u_int64_t,
1481 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers]),
1482 ,SQUID_DEFAULT_INCLUDES)
1483
1484dnl fallback #1
1485dnl if this is defind we trust it to be 64 bits
1486AC_CHECK_TYPE(uint64_t,
1487 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers]),
1488 ,SQUID_DEFAULT_INCLUDES)
1489
1490AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 1491AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 1492 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1493AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 1494AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 1495 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1496AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1497AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
adcceb47 1498
77d6bd88 1499dnl Check for special functions
1500AC_FUNC_ALLOCA
1501
6a9f6389 1502AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
1503#include <sys/types.h>
6637e3a5 1504#include <sys/socket.h>
1505#if STDC_HEADERS
1506#include <stdlib.h>
1507#include <stddef.h>
6a9f6389 1508#endif])
6637e3a5 1509
6a9f6389 1510AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
aea1be68 1511#include <sys/ipc.h>
6a9f6389 1512#include <sys/msg.h>])
aea1be68 1513
090089c4 1514dnl Check for needed libraries
30a4f2a8 1515AC_CHECK_LIB(nsl, main)
6716b242 1516AC_CHECK_LIB(socket, main)
94d48591 1517
3c641669 1518dnl Ripped from the Samba sources
1519AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
1520 AC_TRY_COMPILE([
1521#include <sys/types.h>
1522#include <stdlib.h>
1523#include <stddef.h>
1524#include <sys/socket.h>
1525#include <sys/un.h>],
1526[
1527 struct sockaddr_un sunaddr;
1528 sunaddr.sun_family = AF_UNIX;
1529],
1530 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
1531if test x"$squid_cv_unixsocket" = x"yes"; then
6a9f6389 1532 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
3c641669 1533fi
1534dnl end rip
1535
94d48591 1536if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
1537 echo "skipping libmalloc check (--enable-dlmalloc specified)"
5c51415d 1538else
94d48591 1539 AC_CHECK_LIB(gnumalloc, main)
1540 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
1541 echo "Disabling extended malloc functions when using gnumalloc"
1542 ac_cv_func_mallinfo=no
1543 ac_cv_func_mallocblksize=no
1544 ac_cv_func_mallopt=no
1545 else
1546 case "$host" in
1547 *-sun-solaris*)
1548 echo "skipping libmalloc check for $host"
1549 ;;
1550 i386-*-freebsd*)
1551 echo "skipping libmalloc check for $host"
1552 ;;
1553 *)
1554
1555 AC_CHECK_LIB(malloc, main)
1556 ;;
1557 esac
1558 fi
8a15e65e 1559fi
94d48591 1560
6716b242 1561AC_CHECK_LIB(bsd, main)
be79ade0 1562AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
04a56fa3 1563AC_CHECK_LIB(bind, gethostbyname)
1564if test $ac_cv_lib_bind_gethostbyname = "no" ; then
1565 case "$host" in
78743365 1566 i386-*-freebsd*)
1567 echo "skipping libresolv checks for $host"
1568 ;;
1569 *)
1570 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
1571 AC_CHECK_LIB(resolv, main)
1572 ;;
04a56fa3 1573 esac
1574fi
e0bddc45 1575AC_CHECK_LIB(m, main)
090089c4 1576
1577dnl Check for libcrypt
8154dd82 1578dnl Some of our helpers use crypt(3) which may be in libc, or in
1579dnl libcrypt (eg FreeBSD)
042b1f8a 1580AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
be79ade0 1581AC_SUBST(CRYPTLIB)
77f675ad 1582
042b1f8a 1583dnl Check for libdl, used by auth_modules/PAM
8154dd82 1584if test "$with_dl" = "yes"; then
1585 AC_CHECK_LIB(dl, dlopen)
1586fi
042b1f8a 1587
e5f4e1b0 1588dnl Check for pthreads
1589dnl We use pthreads when doing ASYNC I/O
8154dd82 1590if test "$with_pthreads" = "yes"; then
e685e3c6 1591 CFLAGS="$CFLAGS -D_REENTRANT"
1592 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
1593 case "$host" in
1594 i386-unknown-freebsd*)
1595 if test "$GCC" = "yes" ; then
1596 if test -z "$PRESET_LDFLAGS"; then
1597 LDFLAGS="$LDFLAGS -pthread"
1598 fi
1599 fi
1600 ;;
1601 *-solaris2.*)
1602 if test "$GCC" = "yes" ; then
1603 CFLAGS="$CFLAGS -pthreads"
1604 CXXFLAGS="$CXXFLAGS -pthreads"
1605 else
1606 CFLAGS="$CFLAGS -mt"
1607 CXXFLAGS="$CXXFLAGS -mt"
1608 fi
1609 ;;
1610 esac
8154dd82 1611 AC_CHECK_LIB(pthread, main)
1612fi
71f8abc8 1613
f85c88f3 1614dnl Check for librt
1615dnl We use AIO in the coss store
8154dd82 1616if test "$with_aio" = "yes"; then
1617 AC_CHECK_LIB(rt, aio_read)
1618fi
f85c88f3 1619
86ec11aa 1620dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
1621dnl Robert Side <rside@aiinc.bc.ca>
1622dnl Mon, 18 Jan 1999 17:48:00 GMT
1623case "$host" in
1624 *-pc-sco3.2*)
1625 AC_CHECK_LIB(intl, strftime)
1626 ;;
1627esac
1628
77f675ad 1629dnl System-specific library modifications
1630dnl
1631case "$host" in
88738790 1632 i386-*-solaris2.*)
7149a49f 1633 if test "$GCC" = "yes"; then
1634 echo "Removing -O for gcc on $host"
80e92d6d 1635 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 1636 fi
1637 ;;
77f675ad 1638 *-sgi-irix*)
1639 echo "Removing -lsocket for IRIX..."
6716b242 1640 LIBS=`echo $LIBS | sed -e s/-lsocket//`
77f675ad 1641 echo "Removing -lnsl for IRIX..."
6716b242 1642 LIBS=`echo $LIBS | sed -e s/-lnsl//`
c415c128 1643 ac_cv_lib_nsl_main=no
b44c0fb4 1644 echo "Removing -lbsd for IRIX..."
1645 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 1646 ;;
4ba0bd0e 1647dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
1648dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
1649dnl Please change your configure script. AIX doesn't need -lbsd.
1650 *-ibm-aix*)
1651 echo "Removing -lbsd for AIX..."
1652 LIBS=`echo $LIBS | sed -e s/-lbsd//`
c68e9c6b 1653dnl From: mlaster@metavillage.com (Mike Laster)
1654dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
1655dnl So using the internal versions generates a load of warnings
1656dnl during compile.
1657 echo "disabling snprintf/vsnprintf for $host"
1658 ac_cv_func_snprintf=no
1659 ac_cv_func_vsnprintf=no
4ba0bd0e 1660 ;;
30a4f2a8 1661 *m88k*)
1662 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
680ae450 1663 CXXFLAGS="$CXXFLAGS -D_SQUID_MOTOROLA_"
6a9f6389 1664 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
7149a49f 1665 ;;
580ce039 1666 [*-*-solaris2.[0-4]])
6a9f6389 1667 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
30a4f2a8 1668 ;;
711fa75e 1669 [*-sony-newsos[56]*])
6a9f6389 1670 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
f62c73dc 1671 ;;
77f675ad 1672esac
090089c4 1673
57faa85a 1674# Remove optimization for GCC 2.95.[123]
d20b1cd0 1675# gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
1676if test "$GCC" = "yes"; then
1677 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
1678 case "$GCCVER" in
57faa85a 1679 [2.95.[123]])
d20b1cd0 1680 echo "Removing -O for gcc on $host with GCC $GCCVER"
1681 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1682 ;;
1683 esac
1684fi
1685
176d10ee 1686# Recommended by Balint Nagy Endre <bne@CareNet.hu>
1687case "$host" in
1688 *-univel-sysv4.2MP)
1689 if test `uname -v` = "2.03"; then
1690 echo "disabling mallinfo for $host"
1691 ac_cv_func_mallinfo=no
1692 fi
1693 ;;
1694esac
1695
84cecfd2 1696dnl This has to be before AC_CHECK_FUNCS
1697# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
1698# when running configure.
1699if test -z "$ac_cv_func_poll"; then
1700 case "$host" in
1701 [alpha-dec-osf3.*])
1702 # John Kay (jkay@nlanr.net) 19970818
1703 echo "disabling poll for $host..."
1704 ac_cv_func_poll='no'
1705 ;;
1706 [*-hp-hpux*.*])
1707 # Duane Wessels
1708 echo "disabling poll for $host..."
1709 ac_cv_func_poll='no'
1710 ;;
1711 [*-linux-*])
f5cec332 1712 # Henrik Nordstrom (hno@squid-cache.org) 19980817
9bb83c8b 1713 # poll is problematic on Linux. We disable it
1714 # by default until Linux gets it right.
b6a2f15e 1715 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
1716 if test $rev -lt 002002; then
1717 echo "disabling poll for $host < 2.2..."
1718 ac_cv_func_poll='no'
1719 fi
84cecfd2 1720 ;;
c68e9c6b 1721 [powerpc-ibm-aix4.1.*])
1722 # Mike Laster (mlaster@metavillage.com) 19981021
1723 echo "disabling poll for $host..."
1724 ac_cv_func_poll='no'
1725 ;;
86ec11aa 1726 [*-pc-sco3.2*])
1727 # Robert Side <rside@aiinc.bc.ca>
1728 # Mon, 18 Jan 1999 17:48:00 GMT
1729 echo "disabling poll for $host..."
1730 ac_cv_func_poll='no'
1731 ;;
84cecfd2 1732 esac
1733fi
176d10ee 1734
6716b242 1735dnl Check for library functions
1736AC_CHECK_FUNCS(\
ce3d30fb 1737 backtrace_symbols_fd \
3a144521 1738 bcopy \
1739 bswap_16 \
1740 bswap_32 \
df087e68 1741 crypt \
4ac29a5b 1742 fchmod \
6716b242 1743 getdtablesize \
8505e57b 1744 getpagesize \
230c091c 1745 getpass \
3a144521 1746 getrlimit \
30a4f2a8 1747 getrusage \
9c1d8929 1748 getspnam \
30a4f2a8 1749 lrand48 \
6716b242 1750 mallinfo \
0f5efab0 1751 mallocblksize \
6716b242 1752 mallopt \
2ae6b9b0 1753 memcpy \
30a4f2a8 1754 memmove \
dac27377 1755 memset \
b99a6dec 1756 mkstemp \
1812b6c7 1757 mktime \
88738790 1758 mstats \
84cecfd2 1759 poll \
3a144521 1760 pthread_attr_setschedparam \
cd748f27 1761 pthread_attr_setscope \
1762 pthread_setschedparam \
42b51993 1763 pthread_sigmask \
c68e9c6b 1764 putenv \
b1e77ec1 1765 random \
6716b242 1766 regcomp \
1767 regexec \
1768 regfree \
30a4f2a8 1769 res_init \
4915be3b 1770 rint \
3a144521 1771 select \
234967c9 1772 seteuid \
c415c128 1773 setgroups \
30a4f2a8 1774 setpgrp \
6716b242 1775 setrlimit \
30a4f2a8 1776 setsid \
1777 sigaction \
11430c03 1778 snprintf \
1ccc0d40 1779 socketpair \
30a4f2a8 1780 srand48 \
b1e77ec1 1781 srandom \
0343b99c 1782 statfs \
6716b242 1783 sysconf \
1784 syslog \
234967c9 1785 timegm \
28da5e0d 1786 vsnprintf \
6716b242 1787)
1788
1b3db6d9 1789dnl Magic which checks whether we are forcing a type of comm loop we
1790dnl are actually going to (ab)use
1791
1792dnl Actually do the define magic now
1793dnl mostly ripped from squid-commloops, thanks to adrian and benno
1794
1795if test "$ac_cv_func_poll" = "yes" ; then
1796 SELECT_TYPE="poll"
6a9f6389 1797 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
1b3db6d9 1798elif test "$ac_cv_func_select" = "yes" ; then
1799 SELECT_TYPE="select"
6a9f6389 1800 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
92b9f1fd 1801elif test "$ac_cv_func_kqueue" = "yes" ; then
1802 SELECT_TYPE="kqueue"
6a9f6389 1803 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
1b3db6d9 1804else
92b9f1fd 1805 echo "Eep! Can't find poll, kqueue or select!"
1b3db6d9 1806 echo "I'll try select and hope for the best."
1807 SELECT_TYPE="select"
6a9f6389 1808 AC_DEFINE(USE_SELECT,1)
1b3db6d9 1809fi
1810echo "Using ${SELECT_TYPE} for select loop."
1b3db6d9 1811
1812
60939927 1813dnl Yay! Another Linux brokenness. Its not good enough
1814dnl to know that setresuid() exists, because RedHat 5.0 declares
1815dnl setresuid() but doesn't implement it.
1816dnl
1817AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
5c51415d 1818 AC_TRY_RUN([
60939927 1819#include <stdlib.h>
5c51415d 1820 int main() {
1821 if(setresuid(-1,-1,-1)) {
1822 perror("setresuid:");
1823 exit(1);
60939927 1824 }
1825 exit(0);
5c51415d 1826 }
1827 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
60939927 1828)
5c51415d 1829if test "$ac_cv_func_setresuid" = "yes" ; then
6a9f6389 1830 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 1831fi
60939927 1832
c3d0c8b5 1833AM_CONDITIONAL(NEED_OWN_SNPRINTF, false)
1834if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then
1835 AM_CONDITIONAL(NEED_OWN_SNPRINTF, true)
1836fi
1837
5cafc1d6 1838dnl IP-Filter support requires ipf header files. These aren't
1839dnl installed by default, so we need to check for them
1840if test "$IPF_TRANSPARENT" ; then
1841 AC_MSG_CHECKING(if IP-Filter header files are installed)
42b51993 1842 # hold on to your hats...
1843 if test "$ac_cv_header_ip_compat_h" = "yes" ||
1844 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
87d21d8b 1845 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
1846 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
42b51993 1847 have_ipfilter_compat_header="yes"
1848 fi
1849 if test "x$have_ipfilter_compat_header" = "xyes" &&
eb824054 1850 test "$ac_cv_header_ip_fil_h" = "yes" &&
1851 test "$ac_cv_header_ip_nat_h" = "yes" ; then
1852 IPF_TRANSPARENT="yes"
1853 AC_DEFINE(IPF_TRANSPARENT, 1)
42b51993 1854 elif test "$have_ipfilter_compat_header" = "yes" &&
eb824054 1855 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
1856 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
1857 IPF_TRANSPARENT="yes"
1858 AC_DEFINE(IPF_TRANSPARENT, 1)
1859 else
5cafc1d6 1860 IPF_TRANSPARENT="no"
1861 AC_DEFINE(IPF_TRANSPARENT, 0)
5cafc1d6 1862 fi
1863 AC_MSG_RESULT($IPF_TRANSPARENT)
1864fi
1865if test "$IPF_TRANSPARENT" = "no" ; then
1866 echo "WARNING: Cannot find necessary IP-Filter header files"
1867 echo " Transparent Proxy support WILL NOT be enabled"
1868 sleep 10
1869fi
1870
2b0dd4ac 1871dnl PF support requires a header file.
1872if test "$PF_TRANSPARENT" ; then
1873 AC_MSG_CHECKING(if PF header file is installed)
1874 # hold on to your hats...
1875 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
1876 PF_TRANSPARENT="yes"
1877 AC_DEFINE(PF_TRANSPARENT, 1)
1878 else
1879 PF_TRANSPARENT="no"
1880 AC_DEFINE(PF_TRANSPARENT, 0)
1881 fi
1882 AC_MSG_RESULT($PF_TRANSPARENT)
1883fi
1884if test "$PF_TRANSPARENT" = "no" ; then
1885 echo "WARNING: Cannot find necessary PF header file"
1886 echo " Transparent Proxy support WILL NOT be enabled"
1887 sleep 10
1888fi
1889
d852fbad 1890dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
1891dnl Shamelessly copied from above
1892if test "$LINUX_NETFILTER" ; then
1893 AC_MSG_CHECKING(if Linux 2.4 kernel header files are installed)
1894 # hold on to your hats...
1895 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
1896 LINUX_NETFILTER="yes"
1897 AC_DEFINE(LINUX_NETFILTER, 1)
1898 else
1899 LINUX_NETFILTER="no"
1900 AC_DEFINE(LINUX_NETFILTER, 0)
1901 fi
1902 AC_MSG_RESULT($LINUX_NETFILTER)
1903fi
1904if test "$LINUX_NETFILTER" = "no" ; then
1905 echo "WARNING: Cannot find necessary Linux 2.4 kernel header files"
1906 echo " Linux 2.4 Transparent Proxy support WILL NOT be enabled"
1907 sleep 10
1908fi
1909
91bc414e 1910if test -z "$USE_GNUREGEX" ; then
1911 case "$host" in
1912 *-sun-solaris2.[[0-4]])
1913 USE_GNUREGEX="yes"
1914 ;;
1915 *-next-nextstep*)
1916 USE_GNUREGEX="yes"
1917 ;;
1918 esac
1919fi
7a081912 1920AC_MSG_CHECKING(if GNUregex needs to be compiled)
91bc414e 1921if test -z "$USE_GNUREGEX"; then
55878dfd 1922if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
74946a0f 1923 USE_GNUREGEX="yes"
00fa2c12 1924else
0cccc031 1925 AC_TRY_COMPILE([#include <sys/types.h>
1926#include <regex.h>],[regex_t t; regcomp(&t,"",0);],
91bc414e 1927 USE_GNUREGEX="no",
1928 USE_GNUREGEX="yes")
1929fi
00fa2c12 1930fi
74946a0f 1931AC_MSG_RESULT($USE_GNUREGEX)
1932if test "$USE_GNUREGEX" = "yes"; then
26675bf4 1933 REGEXLIB="-lregex"
7a081912 1934 LIBREGEX="libregex.a"
6a9f6389 1935 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
7a081912 1936fi
26675bf4 1937AC_SUBST(REGEXLIB)
00fa2c12 1938AC_SUBST(LIBREGEX)
7a081912 1939
3f6fcd8a 1940AC_REPLACE_FUNCS(\
3d0cf10e 1941 drand48 \
3f6fcd8a 1942 tempnam \
4d38fc7e 1943 strerror \
3f6fcd8a 1944)
1945
5c51415d 1946dnl Not cached since people are likely to tune this
e924600d 1947AC_MSG_CHECKING(Default FD_SETSIZE value)
1948AC_TRY_RUN([
1949#if HAVE_STDIO_H
1950#include <stdio.h>
1951#endif
1952#if HAVE_UNISTD_H
1953#include <unistd.h>
1954#endif
1955#if HAVE_SYS_TIME_H
1956#include <sys/time.h>
1957#endif
1958#if HAVE_SYS_SELECT_H
1959#include <sys/select.h>
1960#endif
1961#if HAVE_SYS_TYPES_H
1962#include <sys/types.h>
1963#endif
1964main() {
635e6242 1965 FILE *fp = fopen("conftestval", "w");
1966 fprintf (fp, "%d\n", FD_SETSIZE);
e924600d 1967 exit(0);
1968}
1969],
1970DEFAULT_FD_SETSIZE=`cat conftestval`,
1971DEFAULT_FD_SETSIZE=256,
1972DEFAULT_FD_SETSIZE=256)
1973AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
6a9f6389 1974AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
e924600d 1975
f49be7d1 1976
5c51415d 1977dnl Not cached since people are likely to tune this
234967c9 1978AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
c76d8acc 1979dnl damn! FreeBSD's pthreads breaks dup2().
f49be7d1 1980if test -n "$squid_filedescriptors_num" ; then
1981 SQUID_MAXFD=$squid_filedescriptors_num
1982 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
1983else
1984 TLDFLAGS="$LDFLAGS"
1985 case $host in
1986 i386-unknown-freebsd*)
1987 if echo "$LDFLAGS" | grep -q pthread; then
1988 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
1989 fi
1990 esac
1991 AC_TRY_RUN([
8cca06da 1992#include <stdio.h>
234967c9 1993#include <unistd.h>
30a4f2a8 1994#include <sys/time.h> /* needed on FreeBSD */
234967c9 1995#include <sys/param.h>
1996#include <sys/resource.h>
1997main() {
635e6242 1998 FILE *fp;
234967c9 1999 int i,j;
42b51993 2000#if defined(__CYGWIN32__) || defined (__CYGWIN__)
b05490a8 2001 /* getrlimit and sysconf returns bogous values on cygwin32.
df087e68 2002 * Number of fds is virtually unlimited in cygwin (sys/param.h)
b05490a8 2003 * __CYGWIN32__ is deprecated.
df087e68 2004 */
2005 i = NOFILE;
b05490a8 2006#else
2007#if HAVE_SETRLIMIT
234967c9 2008 struct rlimit rl;
2009#if defined(RLIMIT_NOFILE)
2010 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
2011 perror("getrlimit: RLIMIT_NOFILE");
2012 } else {
2013 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2014 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
2015 perror("setrlimit: RLIMIT_NOFILE");
2016 }
2017 }
2018#elif defined(RLIMIT_OFILE)
2019 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
2020 perror("getrlimit: RLIMIT_OFILE");
2021 } else {
2022 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2023 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
2024 perror("setrlimit: RLIMIT_OFILE");
2025 }
2026 }
2027#endif /* RLIMIT_NOFILE */
2028#endif /* HAVE_SETRLIMIT */
d9399075 2029 /* by starting at 2^14, we will never get higher
2030 than 2^15 for SQUID_MAXFD */
2031 i = j = 1<<14;
2032 while (j) {
2033 j >>= 1;
2034 if (dup2(0, i) < 0) {
2035 i -= j;
2036 } else {
2037 close(i);
2038 i += j;
2039 }
2040 }
2041 i++;
b05490a8 2042#endif /* IF !DEF CYGWIN */
635e6242 2043 fp = fopen("conftestval", "w");
2044 fprintf (fp, "%d\n", i);
234967c9 2045 exit(0);
2046}
f49be7d1 2047 ],
2048 SQUID_MAXFD=`cat conftestval`,
2049 SQUID_MAXFD=256,
2050 SQUID_MAXFD=256)
2051 AC_MSG_RESULT($SQUID_MAXFD)
2052fi
6a9f6389 2053AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
b9cc811d 2054if test "$SQUID_MAXFD" -lt 512 ; then
80ab193b 2055 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
2056 echo " cache will be very busy. Please see the FAQ page"
2b6662ba 2057 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
e692ff35 2058 echo " on how to increase your filedescriptor limit"
933cc58d 2059 sleep 10
80ab193b 2060fi
c76d8acc 2061LDFLAGS="$TLDFLAGS"
234967c9 2062
5c51415d 2063dnl Not cached since people are likely to tune this
30a4f2a8 2064AC_MSG_CHECKING(Default UDP send buffer size)
2065AC_TRY_RUN([
8cca06da 2066#include <stdlib.h>
2067#include <stdio.h>
30a4f2a8 2068#include <sys/types.h>
2069#include <sys/socket.h>
2070#include <netinet/in.h>
2071main ()
2072{
635e6242 2073 FILE *fp;
30a4f2a8 2074 int fd,val=0,len=sizeof(int);
2075 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2076 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2077 if (val<=0) exit(1);
635e6242 2078 fp = fopen("conftestval", "w");
2079 fprintf (fp, "%d\n", val);
30a4f2a8 2080 exit(0);
2081}
2082],
6a9f6389 2083SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
2084SQUID_DETECT_UDP_SO_SNDBUF=16384,
2085SQUID_DETECT_UDP_SO_SNDBUF=16384)
2086AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
2087AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
30a4f2a8 2088
5c51415d 2089dnl Not cached since people are likely to tune this
30a4f2a8 2090AC_MSG_CHECKING(Default UDP receive buffer size)
2091AC_TRY_RUN([
8cca06da 2092#include <stdlib.h>
2093#include <stdio.h>
30a4f2a8 2094#include <sys/types.h>
2095#include <sys/socket.h>
2096#include <netinet/in.h>
2097main ()
2098{
635e6242 2099 FILE *fp;
30a4f2a8 2100 int fd,val=0,len=sizeof(int);
2101 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2102 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2103 if (val <= 0) exit(1);
635e6242 2104 fp = fopen("conftestval", "w");
2105 fprintf (fp, "%d\n", val);
30a4f2a8 2106 exit(0);
2107}
2108],
6a9f6389 2109SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
2110SQUID_DETECT_UDP_SO_RCVBUF=16384,
2111SQUID_DETECT_UDP_SO_RCVBUF=16384)
2112AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
2113AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
30a4f2a8 2114
5c51415d 2115dnl Not cached since people are likely to tune this
30a4f2a8 2116AC_MSG_CHECKING(Default TCP send buffer size)
2117AC_TRY_RUN([
8cca06da 2118#include <stdlib.h>
2119#include <stdio.h>
30a4f2a8 2120#include <sys/types.h>
2121#include <sys/socket.h>
2122#include <netinet/in.h>
2123main ()
2124{
635e6242 2125 FILE *fp;
30a4f2a8 2126 int fd,val=0,len=sizeof(int);
2127 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2128 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2129 if (val <= 0) exit(1);
635e6242 2130 fp = fopen("conftestval", "w");
2131 fprintf (fp, "%d\n", val);
30a4f2a8 2132 exit(0);
2133}
2134],
2135SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1c481e00 2136SQUID_TCP_SO_SNDBUF=16384,
2137SQUID_TCP_SO_SNDBUF=16384)
30a4f2a8 2138AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
6a9f6389 2139AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
30a4f2a8 2140
5c51415d 2141dnl Not cached since people are likely to tune this
30a4f2a8 2142AC_MSG_CHECKING(Default TCP receive buffer size)
2143AC_TRY_RUN([
8cca06da 2144#include <stdlib.h>
2145#include <stdio.h>
30a4f2a8 2146#include <sys/types.h>
2147#include <sys/socket.h>
2148#include <netinet/in.h>
2149main ()
2150{
635e6242 2151 FILE *fp;
30a4f2a8 2152 int fd,val=0,len=sizeof(int);
2153 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2154 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2155 if (val <= 0) exit(1);
635e6242 2156 fp = fopen("conftestval", "w");
2157 fprintf (fp, "%d\n", val);
30a4f2a8 2158 exit(0);
2159}
2160],
2161SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1c481e00 2162SQUID_TCP_SO_RCVBUF=16384,
2163SQUID_TCP_SO_RCVBUF=16384)
30a4f2a8 2164AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
6a9f6389 2165AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
30a4f2a8 2166
5c51415d 2167AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
9bc73deb 2168 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
5c51415d 2169 ac_cv_needs_sys_errlist="no",
2170 ac_cv_needs_sys_errlist="yes")
2171)
2172if test "$ac_cv_needs_sys_errlist" = "yes" ; then
6a9f6389 2173 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
5c51415d 2174fi
30a4f2a8 2175
5c51415d 2176dnl Not cached since people are likely to change this
6bf65235 2177AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
2178AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
2179[AC_MSG_RESULT(yes)
6a9f6389 2180AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
6bf65235 2181AC_MSG_RESULT(no))
2182
a937d5e3 2183AC_MSG_CHECKING(if inet_ntoa() actually works)
2184AC_TRY_RUN([
2185#include <stdlib.h>
2186#include <stdio.h>
2187#include <sys/types.h>
2188#include <netinet/in.h>
2189#include <arpa/inet.h>
2190main ()
2191{
635e6242 2192 FILE *fp;
a937d5e3 2193 struct in_addr in;
2194 in.s_addr = inet_addr("1.2.3.4");
635e6242 2195 fp = fopen("conftestval", "w");
2196 fprintf (fp, "%s\n", inet_ntoa(in));
a937d5e3 2197 exit(0);
2198}
2199],
2200INET_NTOA_RESULT=`cat conftestval`,
2201INET_NTOA_RESULT="broken",
2202INET_NTOA_RESULT="broken")
2203if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
2204 AC_MSG_RESULT("yes")
2205else
2206 AC_MSG_RESULT("no")
b6a2f15e 2207 echo "Will use our own inet_ntoa()."
33f5f8b9 2208 AC_LIBOBJ(inet_ntoa)
b6a2f15e 2209# echo "WARNING: This looks bad, and probably prevents Squid from working."
2210# echo " If you're on IRIX and using GCC 2.8, you probably need"
2211# echo " to use the IRIX C compiler instead."
2212# sleep 10
a937d5e3 2213fi
2214
b6a2f15e 2215if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
c68e9c6b 2216AC_MSG_CHECKING(for working statvfs() interface)
2217AC_TRY_COMPILE([
2218#include <stdlib.h>
2219#include <stdio.h>
2220#include <sys/types.h>
2221#include <sys/statvfs.h>
2222],
2223[
2224struct statvfs sfs;
2225sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
2226sfs.f_files = sfs.f_ffree = 0;
2227statvfs("/tmp", &sfs);
2228],
2229 ac_cv_func_statvfs=yes,
2230 ac_cv_func_statvfs=no)
2231AC_MSG_RESULT($ac_cv_func_statvfs)
6b8e7481 2232if test "$ac_cv_func_statvfs" = "yes" ; then
6a9f6389 2233 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
b6a2f15e 2234fi
6b8e7481 2235fi
c68e9c6b 2236
2237AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
2238AC_TRY_COMPILE([
2239#if HAVE_SYS_TYPES_H
2240#include <sys/types.h>
2241#endif
2242#if HAVE_NETINET_IN_H
2243#include <netinet/in.h>
2244#endif
2245#if HAVE_ARPA_INET_H
2246#include <arpa/inet.h>
2247#endif
2248#if HAVE_ARPA_NAMESER_H
2249#include <arpa/nameser.h>
2250#endif
2251#if HAVE_RESOLV_H
2252#include <resolv.h>
2253#endif
2254],
2255[_res.nsaddr_list[[0]];],
2256ac_cv_have_res_nsaddr_list="yes",
2257ac_cv_have_res_nsaddr_list="no"))
2258if test $ac_cv_have_res_nsaddr_list = "yes" ; then
6a9f6389 2259 AC_DEFINE(HAVE_RES_NSADDR_LIST,1,[If _res structure has nsaddr_list member])
c68e9c6b 2260fi
2261
2262if test $ac_cv_have_res_nsaddr_list = "no" ; then
2263AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
2264AC_TRY_COMPILE([
2265#if HAVE_SYS_TYPES_H
2266#include <sys/types.h>
2267#endif
2268#if HAVE_NETINET_IN_H
2269#include <netinet/in.h>
2270#endif
2271#if HAVE_ARPA_INET_H
2272#include <arpa/inet.h>
2273#endif
2274#if HAVE_ARPA_NAMESER_H
2275#include <arpa/nameser.h>
2276#endif
2277#if HAVE_RESOLV_H
2278#include <resolv.h>
2279#endif
2280],
2281[_res.ns_list[[0]].addr;],
2282ac_cv_have_res_ns_list="yes",
2283ac_cv_have_res_ns_list="no"))
2284if test $ac_cv_have_res_ns_list = "yes" ; then
6a9f6389 2285 AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
c68e9c6b 2286fi
2287fi
2288
090089c4 2289dnl Need the debugging version of malloc if available
2290XTRA_OBJS=''
6509a1a0 2291if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 2292 if test -r /usr/lib/debug/malloc.o ; then
2293 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
2294 fi
2295 if test -r /usr/lib/debug/mallocmap.o ; then
2296 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
2297 fi
2298fi
2bbd722b 2299
090089c4 2300AC_SUBST(XTRA_OBJS)
2301
38fea766 2302if test -z "$XTRA_LIBS"; then
2303 XTRA_LIBS="$LIBS"
0f5a16f8 2304 dnl minor cleanup
2305 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 2306 LIBS=''
2307fi
090089c4 2308AC_SUBST(XTRA_LIBS)
2309
090089c4 2310dnl Clean up after OSF/1 core dump bug
2311rm -f core
2312
6a9f6389 2313AC_CONFIG_FILES([\
a2794549 2314 Makefile \
2315 lib/Makefile \
a2794549 2316 scripts/Makefile \
2317 scripts/RunCache \
2318 scripts/RunAccel \
2319 src/Makefile \
2320 src/fs/Makefile \
2321 src/repl/Makefile \
2322 src/auth/Makefile \
a2794549 2323 contrib/Makefile \
2324 snmplib/Makefile \
2325 icons/Makefile \
2326 errors/Makefile \
c0f59984 2327 src/fs/aufs/Makefile \
2328 src/fs/coss/Makefile \
2329 src/fs/diskd/Makefile \
2330 src/fs/null/Makefile \
2331 src/fs/ufs/Makefile \
1077c1b8 2332 test-suite/Makefile \
99db07b3 2333 doc/Makefile \
0c510f3c 2334 helpers/Makefile \
2335 helpers/basic_auth/Makefile \
2336 helpers/basic_auth/LDAP/Makefile \
2337 helpers/basic_auth/MSNT/Makefile \
2338 helpers/basic_auth/NCSA/Makefile \
2339 helpers/basic_auth/PAM/Makefile \
2340 helpers/basic_auth/SMB/Makefile \
2341 helpers/basic_auth/YP/Makefile \
2342 helpers/basic_auth/getpwnam/Makefile \
2343 helpers/basic_auth/multi-domain-NTLM/Makefile \
2344 helpers/basic_auth/SASL/Makefile \
2345 helpers/basic_auth/winbind/Makefile \
2346 helpers/digest_auth/Makefile \
2347 helpers/digest_auth/password/Makefile \
2348 helpers/ntlm_auth/Makefile \
2349 helpers/ntlm_auth/fakeauth/Makefile \
2350 helpers/ntlm_auth/no_check/Makefile \
2351 helpers/ntlm_auth/SMB/Makefile \
2352 helpers/ntlm_auth/SMB/smbval/Makefile \
2353 helpers/ntlm_auth/winbind/Makefile \
c6588c68 2354 helpers/external_acl/Makefile \
2355 helpers/external_acl/ip_user/Makefile \
2356 helpers/external_acl/ldap_group/Makefile \
2357 helpers/external_acl/unix_group/Makefile \
2358 helpers/external_acl/wbinfo_group/Makefile \
4402cd0f 2359 helpers/external_acl/winbind_group/Makefile \
53cbe3e4 2360])
6a9f6389 2361AC_OUTPUT