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