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