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