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