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