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