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