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