]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
Bug 2141: Netmasks need to die a clean death (part 1)
[thirdparty/squid.git] / configure.in
CommitLineData
1b3db6d9 1
2877b8a9 2dnl Configuration input file for Squid
090089c4 3dnl
52303a3d 4dnl $Id: configure.in,v 1.497 2008/02/17 09:24:49 serassio Exp $
090089c4 5dnl
090089c4 6dnl
7dnl
39e4ea99 8AC_INIT(Squid Web Proxy, 3.HEAD-BZR, http://www.squid-cache.org/bugs/, squid)
856e69c5 9AC_PREREQ(2.52)
8d9ce05e 10AM_CONFIG_HEADER(include/autoconf.h)
71b12d7c 11AC_CONFIG_AUX_DIR(cfgaux)
8d9ce05e 12AC_CONFIG_SRCDIR([src/main.cc])
25b6a907 13AM_INIT_AUTOMAKE([tar-ustar])
52303a3d 14AC_REVISION($Revision: 1.497 $)dnl
a2794549 15AC_PREFIX_DEFAULT(/usr/local/squid)
246d7ffc 16AM_MAINTAINER_MODE
a2794549 17
63e02610 18PRESET_CFLAGS="$CFLAGS"
19PRESET_LDFLAGS="$LDFLAGS"
20
a2794549 21dnl Set default LDFLAGS
22if test -z "$LDFLAGS"; then
23 LDFLAGS="-g"
24fi
25
a2794549 26dnl Check for GNU cc
27AC_PROG_CC
e6c4cdd6 28AM_PROG_CC_C_O
c4b0db82 29AC_LANG_C
29b8d8d6 30AC_PROG_CXX
88d50a22 31AC_CANONICAL_HOST
3e7b6055
AR
32
33
34use_loadable_modules=1
35AC_MSG_CHECKING(whether to use loadable modules)
36AC_ARG_ENABLE(loadable-modules,
37 [
38 AC_HELP_STRING(
39 [--disable-loadable-modules],
40 [do not support loadable modules])
41 ],
42 [
43 case "${enableval}" in
44 yes) use_loadable_modules=yes ;;
45 no) use_loadable_modules=no ;;
46 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
47 esac
48 AC_MSG_RESULT([$use_loadable_modules, explicitly])
49 ],
50 [
51 use_loadable_modules=yes;
52 AC_MSG_RESULT([$use_loadable_modules, implicitly])
53 ]
54)
55
56AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
57
58if test $use_loadable_modules = yes;
59then
60 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
61 AC_ENABLE_SHARED
62else
63 AC_DISABLE_SHARED
64fi
65
66AC_LIBTOOL_DLOPEN
67if test $use_loadable_modules = yes;
68then
69 AC_LIBLTDL_CONVENIENCE(lib/libLtdl)
70fi
645aa936 71AC_PROG_LIBTOOL
f5691f9c 72AC_LTDL_DLLIB
3e7b6055
AR
73
74# Do we need these unconditionally for "make distcheck" to work?
75AC_SUBST(INCLTDL)
76AC_SUBST(LIBLTDL)
77
78if test $use_loadable_modules = yes;
79then
80 # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
81 LIBADD_DL=${lt_cv_dlopen_libs}
82 AC_SUBST([LIBADD_DL])
83fi
84
645aa936 85AC_PROG_RANLIB
88d50a22 86
a2794549 87
26675bf4 88CRYPTLIB=''
00fa2c12 89REGEXLIB='' # -lregex
90LIBREGEX='' # libregex.a
090089c4 91
a2794549 92dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
93AC_EXEEXT
94AC_OBJEXT
95
96if test -z "$EXEEXT"; then
97 CGIEXT=".cgi"
98else
7aeb8001 99 # automake automatically adds .exe when installing binaries
100 CGIEXT=""
a2794549 101fi
7aeb8001 102AC_SUBST(CGIEXT)
a2794549 103
0e6d05ef 104dnl this should be expanded to a list of platform sensible support requirements.
105dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
df087e68 106case "$host_os" in
4b26fae9 107mingw|mingw32|cygwin|cygwin32)
a2794549 108 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
df087e68 109 ;;
110*)
a2794549 111 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
df087e68 112 ;;
113esac
df087e68 114
4b26fae9 115case "$host_os" in
116mingw|mingw32)
117 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
118 CFLAGS="$CFLAGS -mthreads"
119 CXXFLAGS="$CXXFLAGS -mthreads"
120 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
121 echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform"
122 echo "Please see PSAPI.DLL section on doc/win32-relnotes.html."
123 else
124 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
125 LIBS="$LIBS -lpsapi"
126 fi
790ebe36 127 MINGW_LIBS="-lmingwex"
b5d712b5 128 AM_CONDITIONAL(USE_IPC_WIN32, true)
790ebe36 129 AC_SUBST(MINGW_LIBS)
4b26fae9 130 ;;
b5d712b5 131*)
132 AM_CONDITIONAL(USE_IPC_WIN32, false)
133 ;;
4b26fae9 134esac
135
a26bdc75 136if test -z "$CACHE_HTTP_PORT"; then
137 CACHE_HTTP_PORT="3128"
138fi
139if test -z "$CACHE_ICP_PORT"; then
140 CACHE_ICP_PORT="3130"
141fi
a26bdc75 142
f4aaf39c 143dnl Substitutions
6a9f6389 144AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
145[What default TCP port to use for HTTP listening?])
58c1507a 146AC_SUBST(CACHE_HTTP_PORT)
6a9f6389 147AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
148[What default UDP port to use for ICP listening?])
f5e5c4cf 149AC_SUBST(CACHE_ICP_PORT)
090089c4 150
6a9f6389 151AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
30a4f2a8 152
6a9f6389 153AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
090089c4 154
5483d916 155CACHE_EFFECTIVE_USER="nobody"
156AC_ARG_WITH(default-user,
157 [ --with-default-user=USER System user account for squid permissions.
158 default: nobody],
159 [ CACHE_EFFECTIVE_USER="$withval" ]
160)
161AC_SUBST(CACHE_EFFECTIVE_USER)
162
6ad85e8a 163dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
164case "$host" in
165 mab-next-nextstep3)
166 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
167 ;;
168esac
169
4c43504f 170if test "$GCC" = "yes"; then
171 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
172 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
173 case "$host" in
174 i386-*-freebsd*)
175 if test $GCCVER2 -lt 300 ; then
176 echo "ERROR: GCC $GCCVER causes a coredump on $host"
177 echo "ERROR: Try a more recent GCC version"
dd81cb63 178 sleep 5
4c43504f 179 fi
180 ;;
181 esac
182 unset GCCVER
183 unset GCCVER2
184fi
185
30a4f2a8 186dnl Set Default CFLAGS
187if test -z "$PRESET_CFLAGS"; then
188 if test "$GCC" = "yes"; then
189 case "$host" in
97b12a5b 190 *-sun-sunos*)
30a4f2a8 191 # sunos has too many warnings for this to be useful
192 # motorola too
193 ;;
97b12a5b 194 *m88k*)
195 # Motorola cc/ld does not like -02 but is ok on -O
196 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
197 ;;
30a4f2a8 198 *)
63e02610 199 CFLAGS="-Wall $CFLAGS"
30a4f2a8 200 ;;
201 esac
81a820c6 202 else
203 case "$host" in
c415c128 204 *mips-sgi-irix6.*)
81a820c6 205 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
63e02610 206 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
776b0191 207 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
81a820c6 208 -Wl,-woff,85,-woff,84,-woff,134 \
63e02610 209 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
776b0191 210 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
211 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
212 -Wl,-woff,85,-woff,84,-woff,134 \
213 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
81a820c6 214 ;;
e8f5fb18 215 alpha-dec-osf4.*)
553c24ae 216 # Mogul says DEC compilers take both -g and -O2
b6a2f15e 217 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
63e02610 218 CFLAGS="-O2 $CFLAGS"
553c24ae 219 ;;
81a820c6 220 *)
221 ;;
222 esac
30a4f2a8 223 fi
30a4f2a8 224fi
225
d2e3605e 226dnl set squid required flags
227if test "$GCC" = "yes"; then
9f68fb10 228dnl Guido Serassio (serassio@squid-cache.org) 20070811
229dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
230dnl -Wmissing-prototypes -Wmissing-declarations
231dnl TODO: check if the problem will be present in any other newer MinGW release.
232 case "$host_os" in
233 mingw|mingw32)
234 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
235 ;;
236 *)
237 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
238 ;;
239 esac
240 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
d2e3605e 241else
9f68fb10 242 SQUID_CFLAGS=
243 SQUID_CXXFLAGS=
d2e3605e 244fi
245AC_SUBST(SQUID_CFLAGS)
246AC_SUBST(SQUID_CXXFLAGS)
247
d7c59e37 248AC_TEST_CHECKFORHUGEOBJECTS
249SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
250
30a4f2a8 251dnl Set LDFLAGS
252if test -z "$PRESET_LDFLAGS"; then
253 if test "$GCC" = "yes"; then
254 case "$host" in
63e02610 255 *mips-sgi-irix6.*)
256 # Silence Linker warnings 84, 85 and 134
257 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
258 ;;
30a4f2a8 259 *)
260 # nothing
261 ;;
262 esac
81a820c6 263 else
264 case "$host" in
63e02610 265 *)
266 # nothing
81a820c6 267 ;;
268 esac
30a4f2a8 269 fi
270fi
2060fa9a 271
e5f4e1b0 272AC_ARG_ENABLE(gnuregex,
2c5d82f9 273[ --enable-gnuregex Compile GNUregex. Unless you have reason to use this
2df6213e 274 option, you should not enable it. This library file
275 is usually only required on Windows and very old
276 Unix boxes which do not have their own regex library
277 built in.],
e5f4e1b0 278[USE_GNUREGEX=$enableval])
279
6c0c04db 280SquidInline="yes"
83079644 281
282AC_ARG_ENABLE(optimizations,
283[ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
2df6213e 284 Optimization is good for production builds, but not
285 good for debugging. During development, use
286 --disable-optimizations to reduce compilation times
287 and allow easier debugging. This option implicitly
288 also enabled --disable-inline],
83079644 289[ if test "$enableval" = "no" ; then
290 echo "Disabling compiler optimizations (-O flag)"
291 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
292 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
293 SquidInline="no"
294 fi
295])
296
6c0c04db 297AC_ARG_ENABLE(inline,
298[ --disable-inline Don't compile trivial methods as inline. Squid
2df6213e 299 is coded with much of the code able to be inlined.
300 Inlining is good for production builds, but not
301 good for development. During development, use
302 --disable-inline to reduce compilation times and
303 allow incremental builds to be quick. For
304 production builds, or load tests, use
305 --enable-inline to have squid make all trivial
306 methods inlinable by the compiler.],
6c0c04db 307[ if test "$enableval" = "no" ; then
308 SquidInline="no"
309 fi
310])
311
312if test "$SquidInline" = "yes" ; then
313 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
314 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
315else
83079644 316 echo "Inlining optimization disabled"
6c0c04db 317 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
318fi
319
fa80a8ef 320AC_ARG_ENABLE(debug-cbdata,
321[ --enable-debug-cbdata Provide some debug information in cbdata],
322[ if test "$enableval" = "yes" ; then
323 echo "cbdata debugging enabled"
6a9f6389 324 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
fa80a8ef 325 fi
326])
327
0961c811 328dnl This is a developer only option.. developers know how to set defines
329dnl
330dnl AC_ARG_ENABLE(xmalloc-debug,
331dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
332dnl [ if test "$enableval" = "yes" ; then
333dnl echo "Malloc debugging enabled"
6a9f6389 334dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
0961c811 335dnl fi
336dnl ])
337
338dnl This is a developer only option.. developers know how to set defines
339dnl
340dnl AC_ARG_ENABLE(xmalloc-debug-trace,
341dnl [ --enable-xmalloc-debug-trace
342dnl Detailed trace of memory allocations],
343dnl [ if test "$enableval" = "yes" ; then
344dnl echo "Malloc debug trace enabled"
6a9f6389 345dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
346dnl AC_DEFINE(XMALLOC_DEBUG,1)
0961c811 347dnl fi
348dnl ])
e5f4e1b0 349
d9180414 350AC_ARG_ENABLE(xmalloc-statistics,
e5f4e1b0 351[ --enable-xmalloc-statistics
352 Show malloc statistics in status page],
353[ if test "$enableval" = "yes" ; then
354 echo "Malloc statistics enabled"
6a9f6389 355 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
e5f4e1b0 356 fi
357])
358
14b32873 359use_carp=1
323fe0d4 360AC_ARG_ENABLE(carp,
f5e5c4cf 361[ --disable-carp Disable CARP support],
f7c8dc02 362[ if test "$enableval" = "no" ; then
363 echo "CARP disabled"
14b32873 364 use_carp=0
323fe0d4 365 fi
f7c8dc02 366])
14b32873 367if test $use_carp = 1; then
368 AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol])
14b32873 369fi
323fe0d4 370
cd748f27 371AC_ARG_ENABLE(async-io,
9bc73deb 372[ --enable-async-io[=N_THREADS]
cd748f27 373 Shorthand for
f85c88f3 374 --with-aufs-threads=N_THREADS
cd748f27 375 --with-pthreads
376 --enable-storeio=ufs,aufs],
377[ case $enableval in
9bc73deb 378 yes)
69144041 379 with_pthreads="yes"
cd748f27 380 STORE_MODULES="ufs aufs"
9bc73deb 381 ;;
382 no)
9bc73deb 383 ;;
384 *)
f85c88f3 385 aufs_io_threads=$enableval
69144041 386 with_pthreads="yes"
cd748f27 387 STORE_MODULES="ufs aufs"
9bc73deb 388 ;;
389 esac
390])
391
f85c88f3 392AC_ARG_WITH(aufs-threads,
393[ --with-aufs-threads=N_THREADS
cd748f27 394 Tune the number of worker threads for the aufs object
395 store.],
a3310b77 396[ case $withval in
397 [[0-9]]*)
398 aufs_io_threads=$withval
399 ;;
400 *)
401 echo "ERROR: Invalid --with-aufs-threads argument"
402 exit 1
403 ;;
404 esac
405])
f85c88f3 406if test "$aufs_io_threads"; then
407 echo "With $aufs_io_threads aufs threads"
6a9f6389 408 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
409 [Defines how many threads aufs uses for I/O])
cd748f27 410fi
411
412AC_ARG_WITH(pthreads,
8154dd82 413[ --with-pthreads Use POSIX Threads])
414if test "$with_pthreads" = "yes"; then
cd748f27 415 echo "With pthreads"
9bc73deb 416fi
e5f4e1b0 417
f85c88f3 418AC_ARG_WITH(aio,
8154dd82 419[ --with-aio Use POSIX AIO])
420if test "$with_aio" = "yes"; then
f85c88f3 421 echo "With aio"
f85c88f3 422fi
8154dd82 423
424AC_ARG_WITH(dl,
425[ --with-dl Use dynamic linking])
426if test "$with_dl" = "yes"; then
427 echo "With dl"
428fi
f85c88f3 429
cd748f27 430AC_ARG_ENABLE(storeio,
431[ --enable-storeio=\"list of modules\"
432 Build support for the list of store I/O modules.
433 The default is only to build the "ufs" module.
434 See src/fs for a list of available modules, or
435 Programmers Guide section <not yet written>
436 for details on how to build your custom store module],
437[ case $enableval in
438 yes)
1c690e30 439 for dir in $srcdir/src/fs/*; do
440 module="`basename $dir`"
441 if test -d "$dir" && test "$module" != CVS; then
442 STORE_MODULES="$STORE_MODULES $module"
8154dd82 443 fi
cd748f27 444 done
445 ;;
446 no)
447 ;;
1c690e30 448 *)
449 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
cd748f27 450 ;;
451 esac
452],
453[ if test -z "$STORE_MODULES"; then
454 STORE_MODULES="ufs"
455 fi
456])
1c690e30 457if test -n "$STORE_MODULES"; then
458 for module in $STORE_MODULES; do
459 if test -d $srcdir/src/fs/$module; then
460 :
461 else
462 echo "ERROR: storeio $module does not exists"
463 exit 1
464 fi
465 done
466 echo "Store modules built: $STORE_MODULES"
59b2d47f 467 STORE_LINKOBJS=
468 for module in $STORE_MODULES; do
469 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
470 done
1c690e30 471fi
a2794549 472dnl remove all but diskd - its the only module that needs to recurse
473dnl into the sub directory
d3b3ab85 474UFS_FOUND=
1c690e30 475NEED_UFS=
b9ae18aa 476NEED_BLOCKING=
477NEED_DISKDAEMON=
478NEED_DISKTHREADS=
479NEED_AIO=
082a5e7a 480STORE_TESTS=
a2794549 481for fs in $STORE_MODULES none; do
8154dd82 482 case "$fs" in
483 diskd)
1c690e30 484 NEED_UFS="true"
b9ae18aa 485 NEED_BLOCKING="true"
486 NEED_DISKDAEMON="true"
8154dd82 487 ;;
488 aufs)
1c690e30 489 NEED_UFS="true"
b9ae18aa 490 NEED_BLOCKING="true"
491 NEED_DISKTHREADS="true"
8154dd82 492 ;;
493 coss)
082a5e7a 494 NEED_AIO="true"
3256ae73 495 dnl
496 dnl Automake om MinGW needs explicit exe extension
497 dnl for STORE_TESTS substition
498 dnl
082a5e7a 499 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
500 ;;
d3b3ab85 501 ufs)
082a5e7a 502 UFS_FOUND="true"
503 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
8154dd82 504 esac
a2794549 505done
b9ae18aa 506STORE_OBJS=
507STORE_LIBS=
508dnl We have 'fake' modules - aufs and diskd - legacy.
509for fs in $STORE_MODULES; do
510 case "$fs" in
511 diskd);;
512 aufs);;
513 *)
514 STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
515 STORE_LIBS="$STORE_LIBS lib${fs}.a"
516 ;;
517 esac
518done
d3b3ab85 519
1c690e30 520if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
3256ae73 521 echo "adding UFS, as it contains core logic for diskd and aufs"
522 STORE_OBJS="$STORE_OBJS fs/libufs.a"
523 STORE_LIBS="$STORE_LIBS libufs.a"
524 STORE_MODULES="$STORE_MODULES ufs"
525 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
526 dnl
527 dnl Automake om MinGW needs explicit exe extension
528 dnl for STORE_TESTS substition
529 dnl
530 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
d3b3ab85 531fi
532
1c690e30 533AC_SUBST(STORE_OBJS)
534AC_SUBST(STORE_LIBS)
59b2d47f 535AC_SUBST(STORE_LINKOBJS)
082a5e7a 536AC_SUBST(STORE_TESTS)
a2794549 537
b9ae18aa 538AC_ARG_ENABLE(disk-io,
539[ --enable-disk-io=\"list of modules\"
540 Build support for the list of disk I/O modules.
541 The default is only to build the "Blocking" module.
542 See src/DiskIO for a list of available modules, or
543 Programmers Guide section <not yet written>
544 for details on how to build your custom disk module],
545[ case $enableval in
546 yes)
547 for dir in $srcdir/src/DiskIO/*; do
548 module="`basename $dir`"
549 if test -d "$dir" && test "$module" != CVS; then
550 DISK_MODULES="$DISK_MODULES $module"
551 fi
552 done
553 ;;
554 no)
555 ;;
556 *)
557 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
558 ;;
559 esac
560],
561[ if test -z "$DISK_MODULES"; then
562 DISK_MODULES="Blocking"
563 fi
564])
565if test -n "$DISK_MODULES"; then
566 for module in $DISK_MODULES; do
567 if test -d $srcdir/src/DiskIO/$module; then
568 :
569 else
570 echo "ERROR: disk-io $module does not exists"
571 exit 1
572 fi
573 done
574 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
575 DISK_LINKOBJS=
576 for module in $DISK_MODULES; do
577 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
578 done
579fi
580for fs in $DISK_MODULES none; do
581 case "$fs" in
582 DiskDaemon)
583 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
584 FOUND_DISKDAEMON="true"
585 ;;
586 DiskThreads)
587 FOUND_DISKTHREADS="true"
588 ;;
589 AIO)
590 FOUND_AIO="true"
591 ;;
592 Blocking)
593 FOUND_BLOCKING="true"
594 esac
595done
596
597if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
abb2a3d9 598 echo "adding Blocking, as it is used by an active, legacy Store Module"
599 DISK_LIBS="$DISK_LIBS libBlocking.a"
600 DISK_MODULES="$DISK_MODULES Blocking"
601 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
b9ae18aa 602fi
603
604if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
abb2a3d9 605 echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
606 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
607 DISK_MODULES="$DISK_MODULES DiskDaemon"
608 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
609 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
b9ae18aa 610fi
611
612if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
abb2a3d9 613 echo "adding DiskThreads, as it is used by an active, legacy Store Module"
614 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
615 DISK_MODULES="$DISK_MODULES DiskThreads"
616 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
b9ae18aa 617fi
595c7973 618
b9ae18aa 619if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
abb2a3d9 620 echo "adding AIO, as it is used by an active, legacy Store Module"
621 DISK_LIBS="$DISK_LIBS libAIO.a"
622 DISK_MODULES="$DISK_MODULES AIO"
623 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
b9ae18aa 624fi
625echo "IO Modules built: $DISK_MODULES"
00dae584 626USE_AIOPS_WIN32=0
627USE_AIO_WIN32=0
b9ae18aa 628dnl we know what is being built. now add dependencies.
629for fs in $DISK_MODULES none; do
630 case "$fs" in
631 DiskThreads)
632 if test -z "$with_pthreads"; then
595c7973 633 case "$host_os" in
61163411 634 mingw|mingw32)
00dae584 635 USE_AIOPS_WIN32=1
595c7973 636 echo "DiskThreads IO Module used, Windows threads support automatically enabled"
637 ;;
638 *)
595c7973 639 echo "DiskThreads IO Module used, pthreads support automatically enabled"
640 with_pthreads=yes
641 ;;
642 esac
b9ae18aa 643 fi
644 ;;
645 AIO)
646 if test -z "$with_aio"; then
abb2a3d9 647 case "$host_os" in
61163411 648 mingw|mingw32)
00dae584 649 USE_AIO_WIN32=1
abb2a3d9 650 echo "Aio IO Module used, Windows overlapped I/O support automatically enabled"
651 ;;
652 *)
abb2a3d9 653 echo "Aio IO Module used, aio support automatically enabled"
654 with_aio=yes
655 ;;
656 esac
b9ae18aa 657 fi
658 ;;
659 esac
660done
661
662AC_SUBST(DISK_LIBS)
663AC_SUBST(DISK_PROGRAMS)
664AC_SUBST(DISK_LINKOBJS)
00dae584 665AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
666AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
b9ae18aa 667
d9180414 668AC_ARG_ENABLE(removal-policies,
6a566b9c 669[ --enable-removal-policies=\"list of policies\"
670 Build support for the list of removal policies.
671 The default is only to build the "lru" module.
672 See src/repl for a list of available modules, or
673 Programmers Guide section 9.9 for details on how
674 to build your custom policy],
675[ case $enableval in
676 yes)
1c690e30 677 for dir in $srcdir/src/repl/*; do
678 module="`basename $dir`"
679 if test -d "$dir" && test "$module" != CVS; then
680 REPL_POLICIES="$REPL_POLICIES $module"
6a566b9c 681 fi
682 done
683 ;;
684 no)
685 ;;
1c690e30 686 *)
687 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
6a566b9c 688 ;;
689 esac
690],
691[ if test -z "$REPL_POLICIES"; then
692 REPL_POLICIES="lru"
693 fi
694])
1c690e30 695if test -n "$REPL_POLICIES"; then
696 for module in $REPL_POLICIES; do
697 if test -d $srcdir/src/repl/$module; then
698 :
699 else
700 echo "ERROR: Removal policy $module does not exists"
701 exit 1
702 fi
703 done
704 echo "Removal policies built: $REPL_POLICIES"
705 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
706 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
707fi
6a566b9c 708AC_SUBST(REPL_POLICIES)
6a566b9c 709AC_SUBST(REPL_OBJS)
f71946fc 710AC_SUBST(REPL_LIBS)
6a566b9c 711
d1da2d1f 712AM_CONDITIONAL(ENABLE_PINGER, false)
e5f4e1b0 713AC_ARG_ENABLE(icmp,
714[ --enable-icmp Enable ICMP pinging],
715[ if test "$enableval" = "yes" ; then
716 echo "ICMP enabled"
6a9f6389 717 AC_DEFINE(USE_ICMP,1,
cc192b50 718 [ Defined this to use Squid's ICMP features (highly recommended!)
719 When USE_ICMP is defined, Squid will send ICMP pings to origin server sites.])
d1da2d1f 720 AM_CONDITIONAL(ENABLE_PINGER, true)
e5f4e1b0 721 fi
722])
723
a2794549 724AM_CONDITIONAL(USE_DELAY_POOLS, false)
d9180414 725AC_ARG_ENABLE(delay-pools,
76d83c52 726[ --enable-delay-pools Enable delay pools to limit bandwidth usage],
e5f4e1b0 727[ if test "$enableval" = "yes" ; then
95e36d02 728 echo "Delay pools enabled"
6a9f6389 729 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
730 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
e5f4e1b0 731 fi
732])
733
5fa840c3
AR
734dnl disable generic/common adaptation support by default
735use_adaptation=no
736
43ae1d95 737AM_CONDITIONAL(USE_ESI, false)
738AC_ARG_ENABLE(esi,
739 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.]),
328c40de 740 use_esi=$enableval, use_esi=no)
741if test "$use_esi" = "yes" ; then
f41735ea 742 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
43ae1d95 743 AM_CONDITIONAL(USE_ESI, true)
964b44c3 744 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
a787b56a 745else
f41735ea 746 AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
43ae1d95 747fi
748
51952383 749AM_CONDITIONAL(USE_ICAP_CLIENT, false)
750AC_ARG_ENABLE(icap-client,
751 AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
328c40de 752 use_icap_client=$enableval, use_icap_client=no)
753if test "$use_icap_client" = "yes" ; then
51952383 754 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
755 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
5fa840c3
AR
756 ICAP_LIBS="ICAP/libicap.la"
757 use_adaptation=yes
51952383 758else
759 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
c21ad0f5 760 ICAP_LIBS=""
51952383 761fi
c21ad0f5 762AC_SUBST(ICAP_LIBS)
51952383 763
3e7b6055
AR
764use_ecap=1
765AC_MSG_CHECKING(whether to support eCAP)
766AC_ARG_ENABLE(ecap,
767 [
768 AC_HELP_STRING(
769 [--enable-ecap],
770 [support loadable content adaptation modules])
771 ],
772 [
773 case "${enableval}" in
774 yes) use_ecap=yes ;;
775 no) use_ecap=no ;;
776 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
777 esac
778 AC_MSG_RESULT([$use_ecap, explicitly])
779 ],
780 [
781 use_ecap=no;
782 AC_MSG_RESULT([$use_ecap, implicitly])
783 ]
784)
785
786dnl Perform configuration consistency checks for eCAP
3e7b6055
AR
787if test $use_ecap = yes;
788then
5fa840c3 789 dnl eCAP support requires loadable modules, which are enabled by default
3e7b6055
AR
790 if test "$use_loadable_modules" != "yes"
791 then
792 AC_MSG_ERROR([
793 eCAP support requires loadable modules. Please do not use
794 --disable-loadable-modules with --enable-ecap.]);
795 fi
3e7b6055
AR
796fi
797
798AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
799if test $use_ecap = yes;
800then
801 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
802 ECAP_LIBS="eCAP/libeCAP.la"
5fa840c3 803 use_adaptation=yes
3e7b6055 804else
5fa840c3 805 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
3e7b6055
AR
806 ECAP_LIBS=""
807fi
808AC_SUBST(ECAP_LIBS)
809
3e7b6055 810
5fa840c3
AR
811dnl enable adaptation if requested by specific adaptation mechanisms
812AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
813if test $use_adaptation = yes
814then
815 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
816 ADAPTATION_LIBS="adaptation/libadaptation.la"
51952383 817else
5fa840c3
AR
818 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
819 ADAPTATION_LIBS=""
51952383 820fi
5fa840c3 821AC_SUBST(ADAPTATION_LIBS)
3e7b6055
AR
822
823
0961c811 824dnl This is a developer only option. Developers know how to set defines
825dnl
826dnl AC_ARG_ENABLE(mem-gen-trace,
827dnl [ --enable-mem-gen-trace Do trace of memory stuff],
828dnl [ if test "$enableval" = "yes" ; then
829dnl echo "Memory trace (to file) enabled"
6a9f6389 830dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
0961c811 831dnl fi
832dnl ])
36a97e19 833
d9180414 834AC_ARG_ENABLE(useragent-log,
e5f4e1b0 835[ --enable-useragent-log Enable logging of User-Agent header],
836[ if test "$enableval" = "yes" ; then
837 echo "User-Agent logging enabled"
6a9f6389 838 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
839 By default, they are written to useragent.log in the Squid log
840 directory.])
e5f4e1b0 841 fi
842])
843
dfca7e1a 844AC_ARG_ENABLE(referer-log,
0961c811 845[ --enable-referer-log Enable logging of Referer header],
dfca7e1a 846[ if test "$enableval" = "yes" ; then
847 echo "Referer logging enabled"
6a9f6389 848 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
849 By default, they are written to referer.log in the Squid log
850 directory.])
dfca7e1a 851 fi
852])
853
0b0cfcf2 854USE_WCCP=1
320e9f36 855AC_ARG_ENABLE(wccp,
0961c811 856[ --disable-wccp Disable Web Cache Coordination Protocol],
eb824054 857[ if test "$enableval" = "no" ; then
858 echo "Web Cache Coordination Protocol disabled"
0b0cfcf2 859 USE_WCCP=0
320e9f36 860 fi
861])
0b0cfcf2 862if test $USE_WCCP = 1; then
863 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
864fi
865
866USE_WCCPv2=1
867AC_ARG_ENABLE(wccpv2,
868[ --disable-wccpv2 Disable Web Cache Coordination V2 Protocol],
869[ if test "$enableval" = "no" ; then
870 echo "Web Cache Coordination V2 Protocol disabled"
871 USE_WCCPv2=0
872 fi
873])
874if test $USE_WCCPv2 = 1; then
875 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
14b32873 876fi
320e9f36 877
d9180414 878AC_ARG_ENABLE(kill-parent-hack,
9fc0b4b8 879[ --enable-kill-parent-hack
880 Kill parent on shutdown],
e5f4e1b0 881[ if test "$enableval" = "yes" ; then
882 echo "Kill parent on shutdown"
6a9f6389 883 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
884 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
885 Use with caution.])
e5f4e1b0 886 fi
887])
888
87630341 889USE_SNMP=true
e5f4e1b0 890AC_ARG_ENABLE(snmp,
87630341 891[ --disable-snmp Disable SNMP monitoring support],
892[ if test "$enableval" = "no" ; then
893 echo "SNMP monitoring disabled"
894 USE_SNMP=
895 fi
896])
10faea39 897if test x"$USE_SNMP" = xtrue; then
6a9f6389 898 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
63705952 899 SNMPLIB='../snmplib/libsnmp.a'
e5f4e1b0 900 makesnmplib=snmplib
87630341 901fi
cb50b537 902AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
e5f4e1b0 903AC_SUBST(SNMPLIB)
e5f4e1b0 904AC_SUBST(makesnmplib)
905
d9180414 906AC_ARG_ENABLE(cachemgr-hostname,
e5f4e1b0 907[ --enable-cachemgr-hostname[=hostname]
908 Make cachemgr.cgi default to this host],
909[ case $enableval in
910 yes)
6a9f6389 911 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
912 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
e5f4e1b0 913 echo "Cachemgr default hostname == host where cachemgr runs"
914 ;;
915 no)
916 : # Nothing to do..
917 ;;
918 *)
919 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
920 echo "Cachemgr default hostname set to ${enableval}"
921 ;;
922 esac
923])
924
b0dd28ba 925AM_CONDITIONAL(ENABLE_ARP_ACL, false)
d9180414 926AC_ARG_ENABLE(arp-acl,
e5f4e1b0 927[ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
928[ if test "$enableval" = "yes" ; then
929 echo "ARP ACL lists enabled (ether address)"
933cc58d 930 case "$host" in
ef614b1c 931 *-linux-*)
932 ;;
9d8d033e 933 *-solaris*)
a931a29b 934 ;;
9a2f1170 935 *-freebsd*)
936 ;;
f71a524f 937 *-openbsd*)
938 ;;
074bf084 939 *-netbsd*)
940 ;;
5700029a 941 *-cygwin*)
942 LIBS="$LIBS -liphlpapi"
943 ;;
944 *-mingw*)
945 LIBS="$LIBS -liphlpapi"
946 ;;
933cc58d 947 *)
ef614b1c 948 echo "WARNING: ARP ACL support probably won't work on $host."
933cc58d 949 sleep 10
950 ;;
951 esac
6a9f6389 952 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 953 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
e5f4e1b0 954 fi
955])
956
87630341 957USE_HTCP=true
a2794549 958AM_CONDITIONAL(ENABLE_HTCP, false)
74075210 959AC_ARG_ENABLE(htcp,
87630341 960[ --disable-htcp Disable HTCP protocol support],
961[ if test "$enableval" = "no" ; then
962 echo "HTCP support disabled"
b4b8b6da 963 fi
74075210 964])
87630341 965if test x$USE_HTCP = xtrue; then
966 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
967fi
968AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
a2794549 969
3d4022fa 970dnl SSL is not enabled by default.
a2794549 971AM_CONDITIONAL(ENABLE_SSL, false)
74075210 972
3d4022fa 973dnl Default is to use OpenSSL when available
1f7c9178 974AC_ARG_ENABLE(ssl,
975[ --enable-ssl Enable ssl gatewaying support using OpenSSL],
976[ if test "$enableval" != "no"; then
3dff197f 977 echo "SSL gatewaying using OpenSSL enabled"
6a9f6389 978 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
a2794549 979 AM_CONDITIONAL(ENABLE_SSL, true)
4b26fae9 980 case "$host_os" in
981 mingw|mingw32)
982 dnl Native Windows port of OpenSSL needs -lgdi32
ee86c79b 983 SSLLIB='-lssleay32 -leay32 -lgdi32'
4b26fae9 984 ;;
985 *)
986 SSLLIB='-lssl -lcrypto'
987 ;;
988 esac
1f7c9178 989 USE_OPENSSL=1
990 fi
991])
992
3d4022fa 993dnl User may specify OpenSSL is needed from a non-standard location
1f7c9178 994AC_ARG_WITH(openssl,
995[ --with-openssl[=prefix]
996 Compile with the OpenSSL libraries. The path to
997 the OpenSSL development libraries and headers
998 installation can be specified if outside of the
999 system standard directories],
1000[
46ce628c 1001 case "$with_openssl" in
1f7c9178 1002 yes)
1003 USE_OPENSSL=1
1004 ;;
1005 no)
1006 USE_OPENSSL=
1007 ;;
1008 *)
46ce628c 1009 SSLLIBDIR="$with_openssl/lib"
bcce53ce 1010 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1f7c9178 1011 USE_OPENSSL=1
1012 esac
1013])
1f7c9178 1014if test -n "$USE_OPENSSL"; then
3dff197f 1015 echo "Using OpenSSL MD5 implementation"
6a9f6389 1016 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)])
1f7c9178 1017 if test -z "$SSLLIB"; then
1018 SSLLIB="-lcrypto" # for MD5 routines
1019 fi
f11555e0 1020 dnl This is a workaround for RedHat 9 brain damage..
1021 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
1022 echo "OpenSSL depends on Kerberos"
1023 SSLLIBDIR="/usr/kerberos/lib"
1024 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1025 fi
1f7c9178 1026fi
1027if test -n "$SSLLIBDIR"; then
1028 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1029fi
1f7c9178 1030AC_SUBST(SSLLIB)
1031
3d4022fa 1032
02749868 1033AC_ARG_ENABLE(forw-via-db,
1034[ --enable-forw-via-db Enable Forw/Via database],
1035[ if test "$enableval" = "yes" ; then
1036 echo "FORW-VIA enabled"
6a9f6389 1037 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
02749868 1038 fi
1039])
1040
6cfa8966 1041AC_ARG_ENABLE(cache-digests,
22df58ea 1042[ --enable-cache-digests Use Cache Digests
2b6662ba 1043 see http://www.squid-cache.org/FAQ/FAQ-16.html],
484f2ebc 1044[ if test "$enableval" = "yes" ; then
6cfa8966 1045 echo "USE_CACHE_DIGESTS enabled"
6a9f6389 1046 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
484f2ebc 1047 fi
1048])
1049
8c3926c5 1050dnl Select Default Error language
1051AC_ARG_ENABLE(default-err-language,
1052[ --enable-default-err-language=lang
0961c811 1053 Select default language for Error pages (see
1054 errors directory) ],
933cc58d 1055[
cf9d704a 1056 if test -d $srcdir/errors/$enableval; then
8c3926c5 1057 ERR_DEFAULT_LANGUAGE=$enableval
933cc58d 1058 else
0961c811 1059 echo "ERROR! Unknown language $enableval, see errors/ directory"
933cc58d 1060 exit 1
1061 fi
8c3926c5 1062],[ERR_DEFAULT_LANGUAGE="English"])
1063AC_SUBST(ERR_DEFAULT_LANGUAGE)
1064
1065dnl Select languages to be installed
1066AC_ARG_ENABLE(err-languages,
1067[ --enable-err-languages=\"lang1 lang2..\"
0961c811 1068 Select languages to be installed. (All will be
1069 installed by default) ],
8c3926c5 1070[
1071 for l in $enableval; do
1072 if test -d $srcdir/errors/$l; then :; else
1073 echo "ERROR! Unknown language $$l, see errors/"
1074 exit 1
1075 fi
1076 done
1077 ERR_LANGUAGES=$enableval
1078],[
1079 ERR_LANGUAGES=
1080 for l in $srcdir/errors/*; do
cbbe101f 1081 if test -f $l/ERR_ACCESS_DENIED; then
8c3926c5 1082 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
1083 fi
1084 done
1085])
1086AC_SUBST(ERR_LANGUAGES)
933cc58d 1087
cd748f27 1088dnl Size of COSS memory buffer
1089AC_ARG_WITH(coss-membuf-size,
1090[ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
1091[ if test "$with_coss_membuf_size"; then
1092 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
6a9f6389 1093 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
cd748f27 1094 fi
1095])
1096
1b3db6d9 1097dnl check for netio plugin stuff
6564c397 1098
9bb83c8b 1099dnl Enable poll()
6564c397 1100disable_poll=
9bb83c8b 1101AC_ARG_ENABLE(poll,
6564c397 1102[ --disable-poll Disable poll() support. ],
1b3db6d9 1103
1104[
c68e9c6b 1105 case "$enableval" in
1106 yes)
9bb83c8b 1107 echo "Forcing poll() to be enabled"
d474c7a6 1108 SELECT_TYPE="poll"
c68e9c6b 1109 ;;
1110 no)
1111 echo "Forcing poll() to be disabled"
6564c397 1112 disable_poll=true
c68e9c6b 1113 ;;
1114 esac
9bb83c8b 1115])
1116
1b3db6d9 1117dnl Enable select()
6564c397 1118disable_select=
1b3db6d9 1119AC_ARG_ENABLE(select,
6564c397 1120[ --disable-select Disable select() support. ],
1b3db6d9 1121
1122[
1123 case "$enableval" in
1124 yes)
1125 echo "Forcing select() to be enabled"
d474c7a6 1126 SELECT_TYPE="select"
1b3db6d9 1127 ;;
1128 no)
1129 echo "Forcing select() to be disabled"
6564c397 1130 disable_select=true
1b3db6d9 1131 ;;
1132 esac
1133])
1134
1135dnl Enable kqueue()
6564c397 1136dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1137disable_kqueue=true
1b3db6d9 1138AC_ARG_ENABLE(kqueue,
6564c397 1139[ --enable-kqueue Enable kqueue() support (experimental).],
1b3db6d9 1140
1141[
1142 case "$enableval" in
1143 yes)
1144 echo "Forcing kqueue() to be enabled"
d474c7a6 1145 SELECT_TYPE="kqueue"
1b3db6d9 1146 ;;
1147 no)
1148 echo "Forcing kqueue() to be disabled"
6564c397 1149 disable_kqueue=true
1b3db6d9 1150 ;;
1151esac
1152])
1153
a46d2c0e 1154dnl Enable epoll()
6564c397 1155disable_epoll=
a46d2c0e 1156AC_ARG_ENABLE(epoll,
328c40de 1157[ --disable-epoll Disable Linux epoll() support.],
a46d2c0e 1158
1159[
1160 case "$enableval" in
1161 yes)
1162 echo "Forcing epoll() to be enabled"
d474c7a6 1163 SELECT_TYPE="epoll"
a46d2c0e 1164 ;;
1165 no)
1166 echo "Forcing epoll() to be disabled"
6564c397 1167 disable_epoll=true
a46d2c0e 1168 ;;
1169esac
1170])
1171
1172
72fd085a 1173dnl Disable HTTP violations
14b32873 1174http_violations=1
72fd085a 1175AC_ARG_ENABLE(http-violations,
1176[ --disable-http-violations
1177 This allows you to remove code which is known to
c68e9c6b 1178 violate the HTTP protocol specification.],
72fd085a 1179[ if test "$enableval" = "no" ; then
1180 echo "Disabling HTTP Violations"
14b32873 1181 http_violations=0
72fd085a 1182 fi
1183])
14b32873 1184if test $http_violations = 1; then
1185 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.])
1186else
1187 AC_DEFINE(HTTP_VIOLATIONS, 0)
1188fi
72fd085a 1189
68075fad 1190dnl Enable IPFW Transparent Proxy
1191AC_ARG_ENABLE(ipfw-transparent,
1192[ --enable-ipfw-transparent
1193 Enable Transparent Proxy support for systems
1194 using FreeBSD IPFW style redirection.],
1195[ if test "$enableval" = "yes" ; then
1196 echo "IPFW Transparent Proxy enabled"
1197 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1198 IPFW_TRANSPARENT="yes"
a74968c2
AJ
1199 else
1200 AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
68075fad 1201 fi
1202])
1203
5cafc1d6 1204dnl Enable IP-Filter Transparent Proxy
1205AC_ARG_ENABLE(ipf-transparent,
1206[ --enable-ipf-transparent
1207 Enable Transparent Proxy support for systems
c68e9c6b 1208 using IP-Filter network address redirection.],
5cafc1d6 1209[ if test "$enableval" = "yes" ; then
1210 echo "IP-Filter Transparent Proxy enabled"
6a9f6389 1211 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 1212 IPF_TRANSPARENT="yes"
a74968c2
AJ
1213 else
1214 AC_DEFINE(IPF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.])
5cafc1d6 1215 fi
1216])
1217
2b0dd4ac 1218dnl Enable PF Transparent Proxy
1219AC_ARG_ENABLE(pf-transparent,
1220[ --enable-pf-transparent
1221 Enable Transparent Proxy support for systems
1222 using PF network address redirection.],
1223[ if test "$enableval" = "yes" ; then
1224 echo "PF Transparent Proxy enabled"
6a9f6389 1225 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
2b0dd4ac 1226 PF_TRANSPARENT="yes"
a74968c2
AJ
1227 else
1228 AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
2b0dd4ac 1229 fi
1230])
1231
d6d62546 1232dnl Enable Linux Netfilter Transparent Proxy
d852fbad 1233AC_ARG_ENABLE(linux-netfilter,
1234[ --enable-linux-netfilter
d6d62546 1235 Enable Transparent Proxy support for Linux (Netfilter) systems.],
d852fbad 1236[ if test "$enableval" = "yes" ; then
d6d62546 1237 echo "Linux (Netfilter) Transparent Proxy enabled"
1238 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
d852fbad 1239 LINUX_NETFILTER="yes"
a74968c2
AJ
1240 else
1241 AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
d852fbad 1242 fi
1243])
1244
bb7b5fd0 1245dnl Enable Large file support
2df6213e 1246buildmodel=""
1247needlargefiles=
1248
1249AC_ARG_WITH(large-files,
3a125142 1250[ --with-large-files Enable support for large files (logs etc).],
2df6213e 1251[ if test "$withval" = yes; then
1252 needlargefiles=1
bb7b5fd0 1253 fi
1254])
1255
2df6213e 1256dnl UNIX Build environment
1257AC_ARG_WITH(build-environment,
1258[ --with-build-environment=model
1259 The build environment to use. Normally one of
1260 POSIX_V6_ILP32_OFF32 32 bits
1261 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1262 POSIX_V6_LP64_OFF64 64 bits
1263 POSIX_V6_LPBIG_OFFBIG large pointers and files
1264 XBS5_ILP32_OFF32 32 bits (legacy)
1265 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1266 XBS5_LP64_OFF64 64 bits (legacy)
1267 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1268 default The default for your OS],
1269[ case "$withval" in
1270 yes|no)
1271 echo "--with-build-environment expects a build environment string as used by getconf"
1272 exit 1
1273 ;;
1274 *)
1275 buildmodel="$withval"
1276 ;;
1277 esac
1278])
1279
1280if test $needlargefiles && test -z "$buildmodel"; then
f6fd3d67 1281 for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do
2df6213e 1282 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1283 buildmodel=$model
1284 break
1285 fi
1286 done
1287 if test -z "$buildmodel"; then
1288 echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
1289 sleep 1
1290 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
cca81db1 1291 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2df6213e 1292 fi
1293fi
1294if test -n "$buildmodel" && test "$buildmodel" != "default"; then
1295 echo "Using $buildmodel build environment"
1296 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1297 : # All fine
1298 else
1299 echo "ERROR: Build environment $buildmodel not known to getconf."
1300 exit 1
1301 fi
1302 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
cca81db1 1303 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2df6213e 1304 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1305 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
63e02610 1306 case "$host" in
2df6213e 1307dnl
1308dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but:
1309dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc
1310dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun
2df6213e 1311 *-solaris*)
1312 if test "$GCC" = "yes"; then
1313 echo "Removing -Xa for gcc on $host"
1314 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
cca81db1 1315 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
2df6213e 1316 fi
2ddacc29 1317 echo "Removing -Usun on $host"
2df6213e 1318 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
cca81db1 1319 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
2df6213e 1320 ;;
63e02610 1321dnl
1322dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1323dnl so we must adjust something to avoid gcc errors.
1324dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1325dnl remove "-n32" from LDFLAGS
1326dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1327dnl "-64" from LDFLAGS
1328 *-sgi-irix6.*)
1329 if test "$GCC" = "yes"; then
1330 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
ff37fe61 1331 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
63e02610 1332 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1333 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
ff37fe61 1334 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
63e02610 1335 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1336 fi
1337 ;;
2df6213e 1338 *)
1339 ;;
1340 esac
1341fi
1342
7b0a0d1f 1343dnl Enable Linux transparent proxy support for obsolete TPROXY
e8cca4ac
AJ
1344AC_ARG_ENABLE(linux-tproxy,
1345[ --enable-linux-tproxy
f1e0717c 1346 Enable real Transparent Proxy support for Netfilter TPROXY (version 2).],
fc68f6b1 1347[ if test "$enableval" = "yes" ; then
f1e0717c
AJ
1348 echo "Linux Netfilter/TPROXY v2 enabled"
1349 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1350 LINUX_TPROXY2="yes"
1351 if test -z "$LINUX_NETFILTER"; then
1352 echo "Linux-Netfilter Transparent Proxy automatically enabled"
1353 LINUX_NETFILTER="yes"
1354 fi
a74968c2
AJ
1355 else
1356 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
f1e0717c
AJ
1357 fi
1358])
fc68f6b1 1359
a2794549 1360AM_CONDITIONAL(MAKE_LEAKFINDER, false)
5d620373 1361dnl Enable Leak Finding Functions
1362AC_ARG_ENABLE(leakfinder,
1363[ --enable-leakfinder
1364 Enable Leak Finding code. Enabling this alone
1365 does nothing; you also have to modify the source
1366 code to use the leak finding functions. Probably
1367 Useful for hackers only.],
1368[ if test "$enableval" = "yes" ; then
1369 echo "Leak-Finding enabled"
6a9f6389 1370 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
5d620373 1371 USE_LEAKFINDER="yes"
a2794549 1372 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
5d620373 1373 fi
1374])
5d620373 1375
3d674977
AJ
1376follow_xff=1
1377AC_ARG_ENABLE(follow-x-forwarded-for,
1378[ --enable-follow-x-forwarded-for
1379 Enable support for following the X-Forwarded-For
1380 HTTP header to try to find the IP address of the
1381 original or indirect client when a request has
1382 been forwarded through other proxies.],
1383[ if test "$enableval" = "yes" ; then
1384 echo "follow X-Forwarded-For enabled"
1385 follow_xff=1
1386 fi
1387])
1388if test $follow_xff = 1; then
1389 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1390else
1391 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1392fi
1393
14b32873 1394use_ident=1
3898f57f 1395AC_ARG_ENABLE(ident-lookups,
1396[ --disable-ident-lookups
1397 This allows you to remove code that performs
1398 Ident (RFC 931) lookups.],
1399[ if test "$enableval" = "no" ; then
1400 echo "Disabling Ident Lookups"
14b32873 1401 use_ident=0
3898f57f 1402 fi
1403])
14b32873 1404if test $use_ident = 1; then
1405 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
8000a965 1406 AM_CONDITIONAL(ENABLE_IDENT, true)
14b32873 1407else
1408 AC_DEFINE(USE_IDENT, 0)
8000a965 1409 AM_CONDITIONAL(ENABLE_IDENT, false)
14b32873 1410fi
3898f57f 1411
a2794549 1412AM_CONDITIONAL(USE_DNSSERVER, false)
3c573763 1413use_dnsserver=
eb824054 1414AC_ARG_ENABLE(internal-dns,
7e3ce7b9 1415[ --disable-internal-dns This prevents Squid from directly sending and
eb824054 1416 receiving DNS messages, and instead enables the
1417 old external 'dnsserver' processes.],
1418[ if test "$enableval" = "no" ; then
1419 echo "Disabling Internal DNS queries"
3c573763 1420 use_dnsserver="yes"
eb824054 1421 fi
1422])
3c573763 1423if test "$use_dnsserver" = "yes"; then
6a9f6389 1424 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
a2794549 1425 AM_CONDITIONAL(USE_DNSSERVER, true)
3c573763 1426fi
eb824054 1427
9d798391 1428dnl Select Default hosts file location
1429AC_ARG_ENABLE(default-hostsfile,
1430[ --enable-default-hostsfile=path
1431 Select default location for hosts file.
1432 See hosts_file directive in squid.conf for details],
1433[
1434 if test "$enableval" != "none" ; then
1435 if test -f $enableval; then
1436 OPT_DEFAULT_HOSTS=$enableval
1437 else
1438 echo "Warning Unable to find $enableval"
1439 sleep 5
1440 fi
1441 else
1442 OPT_DEFAULT_HOSTS="none"
1443 fi
1444 echo "Default hosts file set to: $enableval"
1445],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1446AC_SUBST(OPT_DEFAULT_HOSTS)
1447
94439e4e 1448dnl Select auth schemes modules to build
1449AC_ARG_ENABLE(auth,
1450[ --enable-auth=\"list of auth scheme modules\"
1451 Build support for the list of authentication schemes.
1452 The default is to build support for the Basic scheme.
1453 See src/auth for a list of available modules, or
1454 Programmers Guide section authentication schemes
1455 for details on how to build your custom auth scheme
1456 module],
1457[ case $enableval in
1458 yes)
1c42c4a1 1459 for dir in $srcdir/src/auth/*; do
1460 module="`basename $dir`"
1c690e30 1461 if test -d "$dir" && test "$module" != CVS; then
1c42c4a1 1462 AUTH_MODULES="$AUTH_MODULES $module"
94439e4e 1463 fi
1464 done
1465 ;;
1466 no)
1467 ;;
1c690e30 1468 *)
1469 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1470 ;;
94439e4e 1471 esac
1472],
1473[ if test -z "$AUTH_MODULES"; then
6bf4f823 1474 AUTH_MODULES="ntlm basic digest negotiate"
94439e4e 1475 fi
1476])
1c690e30 1477if test -n "$AUTH_MODULES"; then
1478 for module in $AUTH_MODULES; do
1479 if test -d $srcdir/src/auth/$module; then
1480 :
1481 else
1482 echo "ERROR: Auth scheme $module does not exists"
1483 exit 1
1484 fi
7f18d2bd 1485 eval AUTH_MODULE_${module}=yes
1c690e30 1486 done
1487 echo "Auth scheme modules built: $AUTH_MODULES"
1488 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1489 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
d0571da6 1490else
1491 echo "Auth scheme modules built: None"
1c690e30 1492fi
f5691f9c 1493AUTH_LINKOBJS=
1494for module in $AUTH_MODULES; do
1495 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1496done
94439e4e 1497AC_SUBST(AUTH_MODULES)
94439e4e 1498AC_SUBST(AUTH_LIBS)
f5691f9c 1499AC_SUBST(AUTH_LINKOBJS)
1500AC_SUBST(AUTH_OBJS)
94439e4e 1501
1502dnl Select basic auth scheme helpers to build
7f18d2bd 1503if test -n "$AUTH_MODULE_basic"; then
1504 BASIC_AUTH_HELPERS="all"
1505fi
94439e4e 1506AC_ARG_ENABLE(basic-auth-helpers,
1507[ --enable-basic-auth-helpers=\"list of helpers\"
1508 This option selects which basic scheme proxy_auth
1509 helpers to build and install as part of the normal
1510 build process. For a list of available
0c510f3c 1511 helpers see the helpers/basic_auth directory.],
94439e4e 1512[ case "$enableval" in
7f18d2bd 1513 yes)
1514 BASIC_AUTH_HELPERS="all"
1c690e30 1515 ;;
94439e4e 1516 no)
7f18d2bd 1517 BASIC_AUTH_HELPERS=""
1c690e30 1518 ;;
94439e4e 1519 *)
7f18d2bd 1520 if test -z "$AUTH_MODULE_basic"; then
1521 echo "WARNING: Basic auth helpers selected without the basic scheme enabled"
1522 sleep 15
1523 fi
1c690e30 1524 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1525 ;;
94439e4e 1526 esac
1527])
7f18d2bd 1528if test "$BASIC_AUTH_HELPERS" = "all" ; then
1529 BASIC_AUTH_HELPERS=""
1530 for dir in $srcdir/helpers/basic_auth/*; do
1531 helper="`basename $dir`"
1532 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1533 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1534 fi
1535 done
1536fi
fc83a946 1537if test -n "$BASIC_AUTH_HELPERS"; then
20d8bfe4 1538 for helper in $BASIC_AUTH_HELPERS; do
1c690e30 1539 if test -d $srcdir/helpers/basic_auth/$helper; then
2adff954 1540 case $helper in
1541 SASL)
1542 require_sasl=yes
1543 ;;
1544 esac
20d8bfe4 1545 else
1c690e30 1546 echo "ERROR: Basic auth helper $helper does not exists"
1547 exit 1
20d8bfe4 1548 fi
1549 done
fc83a946 1550 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
94439e4e 1551fi
fc83a946 1552AC_SUBST(BASIC_AUTH_HELPERS)
94439e4e 1553
1554dnl Select ntlm auth helpers to build
7f18d2bd 1555if test -n "$AUTH_MODULE_ntlm"; then
1556 NTLM_AUTH_HELPERS="all"
1557fi
94439e4e 1558AC_ARG_ENABLE(ntlm-auth-helpers,
1559[ --enable-ntlm-auth-helpers=\"list of helpers\"
1560 This option selects which proxy_auth ntlm helpers
1561 to build and install as part of the normal build
0c510f3c 1562 process. For a list of available helpers see
1563 the helpers/ntlm_auth directory.],
380f0a87 1564[ case "$enableval" in
1565 yes)
7f18d2bd 1566 NTLM_AUTH_HELPERS="all"
1c690e30 1567 ;;
380f0a87 1568 no)
7f18d2bd 1569 NTLM_AUTH_HELPERS=""
1c690e30 1570 ;;
380f0a87 1571 *)
1c690e30 1572 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1573 ;;
380f0a87 1574 esac
1575])
7f18d2bd 1576if test "$NTLM_AUTH_HELPERS" = "all" ; then
1577 NTLM_AUTH_HELPERS=""
1578 for dir in $srcdir/helpers/ntlm_auth/*; do
1579 helper="`basename $dir`"
1580 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1581 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1582 fi
1583 done
1584fi
94439e4e 1585if test -n "$NTLM_AUTH_HELPERS"; then
20d8bfe4 1586 for helper in $NTLM_AUTH_HELPERS; do
1c690e30 1587 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1588 :
20d8bfe4 1589 else
1c690e30 1590 echo "ERROR: NTLM Auth helper $helper does not exists"
1591 exit 1
20d8bfe4 1592 fi
1593 done
94439e4e 1594 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
380f0a87 1595fi
94439e4e 1596AC_SUBST(NTLM_AUTH_HELPERS)
1597
6e785d85 1598dnl Select negotiate auth helpers to build
7f18d2bd 1599if test -n "$AUTH_MODULE_negotiate"; then
1600 NEGOTIATE_AUTH_HELPERS="all"
1601fi
6e785d85 1602AC_ARG_ENABLE(negotiate-auth-helpers,
1603[ --enable-negotiate-auth-helpers=\"list of helpers\"
1604 This option selects which proxy_auth negotiate helpers
1605 to build and install as part of the normal build
1606 process. For a list of available helpers see
1607 the helpers/negotiate_auth directory.],
1608[ case "$enableval" in
1609 yes)
7f18d2bd 1610 NEGOTIATE_AUTH_HELPERS="all"
6e785d85 1611 ;;
1612 no)
7f18d2bd 1613 NEGOTIATE_AUTH_HELPERS=""
6e785d85 1614 ;;
1615 *)
1616 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1617 ;;
1618 esac
1619])
7f18d2bd 1620if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1621 NEGOTIATE_AUTH_HELPERS=""
1622 for dir in $srcdir/helpers/negotiate_auth/*; do
1623 helper="`basename $dir`"
1624 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1625 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1626 fi
1627 done
1628fi
6e785d85 1629if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1630 for helper in $NEGOTIATE_AUTH_HELPERS; do
1631 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1632 :
1633 else
1634 echo "ERROR: Negotiate Auth helper $helper does not exists"
1635 exit 1
1636 fi
1637 done
1638 echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
1639fi
1640AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1641
2d70df72 1642dnl Select digest auth scheme helpers to build
7f18d2bd 1643if test -n "$AUTH_MODULE_digest"; then
1644 DIGEST_AUTH_HELPERS=all
1645fi
2d70df72 1646AC_ARG_ENABLE(digest-auth-helpers,
1647[ --enable-digest-auth-helpers=\"list of helpers\"
1648 This option selects which digest scheme authentication
1649 helpers to build and install as part of the normal build
0c510f3c 1650 process. For a list of available helpers see the
1651 helpers/digest_auth directory.],
2d70df72 1652[ case "$enableval" in
1653 yes)
7f18d2bd 1654 DIGEST_AUTH_HELPERS="all"
1c690e30 1655 ;;
2d70df72 1656 no)
7f18d2bd 1657 DIGEST_AUTH_HELPERS=""
1c690e30 1658 ;;
2d70df72 1659 *)
1c690e30 1660 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1661 ;;
2d70df72 1662 esac
1663])
7f18d2bd 1664if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1665 DIGEST_AUTH_HELPERS=""
1666 for dir in $srcdir/helpers/digest_auth/*; do
1667 helper="`basename $dir`"
1668 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1669 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1670 fi
1671 done
1672fi
2d70df72 1673if test -n "$DIGEST_AUTH_HELPERS"; then
1daefc1a 1674 for helper in $DIGEST_AUTH_HELPERS; do
1675 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1676 :
1677 else
1678 echo "ERROR: digest auth helper $helper does not exists"
1679 exit 1
1680 fi
1681 done
2d70df72 1682 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1683fi
1684AC_SUBST(DIGEST_AUTH_HELPERS)
380f0a87 1685
6437ac71 1686dnl Enable "NTLM fail open"
1687AC_ARG_ENABLE(ntlm-fail-open,
1688[ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
0961c811 1689 Authentication steps can allow squid to still authenticate
1690 the user.],
6437ac71 1691[ if test "$enableval" = "yes" ; then
6a9f6389 1692 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 1693 fi
1694])
1695
c6588c68 1696dnl Select external_acl helpers to build
7f18d2bd 1697EXTERNAL_ACL_HELPERS=all
c6588c68 1698AC_ARG_ENABLE(external-acl-helpers,
1699[ --enable-external-acl-helpers=\"list of helpers\"
1700 This option selects which external_acl helpers to
1701 build and install as part of the normal build
1702 process. For a list of available helpers see the
1703 helpers/external_acl directory.],
1704[ case "$enableval" in
1705 yes)
7f18d2bd 1706 EXTERNAL_ACL_HELPERS=all
1c690e30 1707 ;;
c6588c68 1708 no)
7f18d2bd 1709 EXTERNAL_ACL_HELPERS=""
1c690e30 1710 ;;
c6588c68 1711 *)
1c690e30 1712 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1713 ;;
c6588c68 1714 esac
1715])
7f18d2bd 1716if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
39ee7289 1717 EXTERNAL_ACL_HELPERS=""
7f18d2bd 1718 for dir in $srcdir/helpers/external_acl/*; do
1719 helper="`basename $dir`"
1720 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1721 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1722 fi
1723 done
1724fi
c6588c68 1725if test -n "$EXTERNAL_ACL_HELPERS"; then
20d8bfe4 1726 for helper in $EXTERNAL_ACL_HELPERS; do
1727 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1728 :
1729 else
1daefc1a 1730 echo "ERROR: external acl helper $helper does not exists"
20d8bfe4 1731 exit 1
1732 fi
1733 done
c6588c68 1734 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1735fi
1736AC_SUBST(EXTERNAL_ACL_HELPERS)
1737
3a125142 1738AC_ARG_WITH(valgrind-debug,
1739[ --with-valgrind-debug Include debug instrumentation for use with valgrind],
b4bab919 1740[ case $withval in
1741 yes)
1742 valgrind=1
1743 ;;
1744 no)
1745 valgrind=
1746 ;;
1747 *)
1748 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1749 valgrind=1
1750 ;;
1751 esac
1752 if test $valgrind; then
1753 AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
1754 echo "Valgrind debug support enabled"
1755 fi
1756])
1757
d96ceb8e 1758dnl Disable "memPools" code
1759AC_ARG_ENABLE(mempools,
b001e822 1760[ --disable-mempools Disable memPools. Note that this option now simply sets the
2df6213e 1761 default behaviour. Specific classes can override this at runtime, and
1762 only lib/MemPool.c needs to be altered to change the squid-wide
1763 default for all classes.],
d96ceb8e 1764[ if test "$enableval" = "no" ; then
1765 echo "memPools disabled"
6a9f6389 1766 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
3e0dc9a8 1767 else
1768 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 1769 fi
3e0dc9a8 1770],
1771[ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 1772])
1773
0e657244 1774dnl Enable WIN32 Service compile mode
1775AC_ARG_ENABLE(win32-service,
1776[ --enable-win32-service Compile Squid as a WIN32 Service
1777 Works only on Windows NT and Windows 2000 Platforms.],
1778[ if test "$enableval" = "yes" ; then
1779 echo "Enabling WIN32 run service mode"
1780 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1781 fi
1782])
1783
b1485ff8 1784
2adff954 1785dnl Check for Cyrus SASL
1786if test "$require_sasl" = "yes"; then
1787 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1788 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1789 echo "using SASL2"
1790 LIBSASL="-lsasl2"
1791 else
1792 if test "$ac_cv_header_sasl_h" = "yes"; then
1793 echo "using SASL"
1794 LIBSASL="-lsasl"
1795 else
1796 echo "ERROR: Neither SASL nor SASL2 found"
1797 exit 1
1798 fi
1799 fi
1800 AC_SUBST(LIBSASL)
1801fi
1802
3c573763 1803dnl Disable "unlinkd" code
fe0810ac 1804AC_ARG_ENABLE(unlinkd,
1805[ --disable-unlinkd Do not use unlinkd],
1806[ if test "$enableval" = "no" ; then
3c573763 1807 use_unlinkd=no
fe0810ac 1808 else
3c573763 1809 use_unlinkd=yes
fe0810ac 1810 fi
1811],[
1812 # Here we should probably use some magic depending on the selected
1813 # storage models
3c573763 1814 use_unlinkd=yes
fe0810ac 1815])
3c573763 1816if test "$use_unlinkd" = "yes"; then
fe0810ac 1817 echo "unlinkd enabled"
6a9f6389 1818 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
a2794549 1819 AM_CONDITIONAL(ENABLE_UNLINKD, true)
fe0810ac 1820else
1821 echo "unlinkd disabled"
a2794549 1822 AM_CONDITIONAL(ENABLE_UNLINKD, false)
fe0810ac 1823fi
fe0810ac 1824
ce3d30fb 1825dnl Enable backtraces on fatal errors
1826AC_ARG_ENABLE(stacktraces,
1827[ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1828[ if test "$enableval" = "yes" ; then
1829 echo "Enabling automatic stack backtraces on fatal errors"
6a9f6389 1830 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
ce3d30fb 1831 fi
1832])
1833
88bfe092 1834AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1835dnl Enable USE_XPROF_STATS
1836AC_ARG_ENABLE(cpu-profiling,
1837[ --enable-cpu-profiling
1838 This option allows you to see which internal functions
1839 in Squid are consuming how much CPU. Compiles in probes
1840 that measure time spent in probed functions. Needs
1841 source modifications to add new probes. This is meant
1842 for developers to assist in performance optimisations
1843 of Squid internal functions.
1844 If you are not developer and not interested in the stats
1845 you shouldn't enable this, as overhead added, although
1846 small, is still overhead. See lib/Profiler.c for more.
1847 ],
1848[ if test "$enableval" = "yes" ; then
1849 echo "Enabling cpu-profiling"
6a9f6389 1850 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
88bfe092 1851 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1852 fi
1853])
1854
f66a9ef4 1855dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1856AC_ARG_ENABLE(x_accelerator_vary,
0961c811 1857[ --enable-x-accelerator-vary
1858 Enable support for the X-Accelerator-Vary
1859 HTTP header. Can be used to indicate
1860 variance within an accelerator setup.
1861 Typically used together with other code
1862 that adds custom HTTP headers to the requests.],
f66a9ef4 1863[ if test "$enableval" = "yes" ; then
1864 echo "Enabling support for X-Accelerator-Vary"
6a9f6389 1865 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
f66a9ef4 1866 fi
1867])
1868
cc192b50 1869dnl Enable IPv6 support
1870AC_MSG_CHECKING([whether to enable IPv6])
7f85cca1 1871use_ipng=no
cc192b50 1872AC_ARG_ENABLE(ipv6,
7172612f 1873[ --enable-ipv6 Enable ipv6 support],
cc192b50 1874[ AC_MSG_RESULT(yes)
1875 AC_CACHE_CHECK([if PF_INET6 is available], $enableval,
1876 AC_TRY_RUN(
1877 [ /* PF_INET6 available check */
1878# include <sys/types.h>
1879# include <sys/socket.h>
1880 void main() {
1881 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
1882 exit(1);
1883 else
1884 exit(0);
1885 }
1886 ],
1887 [ AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
1888 AC_MSG_RESULT(yes)
7f85cca1 1889 use_ipng=yes
cc192b50 1890 ],
1891 [ AC_DEFINE(USE_IPV6,0,[0 == Disable support for IPv6])
7f85cca1
AJ
1892 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
1893 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
1894 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
cc192b50 1895 AC_MSG_RESULT(no)
1896 ])
1897 )
1898],
1899[ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6])
7f85cca1
AJ
1900 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
1901 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
1902 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
cc192b50 1903 AC_MSG_RESULT(no)
1904])
7f85cca1
AJ
1905
1906if test "$use_ipng" = "yes"; then
1907
cc192b50 1908dnl Check for Windows XP option
1909AC_MSG_CHECKING([for IPv6 split-stack requirement])
1910AC_ARG_WITH(ipv6-split-stack,
7f85cca1
AJ
1911 [ --with-ipv6-split-stack Require IPv6 split-stack support. Requires IPv6 Support.],
1912 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(yes)],
1913 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(no)]
cc192b50 1914)
1915
1916dnl Check for IPv6 Windows Vista option
9b1f7ee8 1917dnl Also useful for other OS
cc192b50 1918AC_MSG_CHECKING([for IPv6 v4-mapping requirement])
1919AC_ARG_WITH(ipv4-mapped,
7f85cca1
AJ
1920 [ --with-ipv4-mapped Hybrid-Stack OS require Squid to do any v4-mapping. Requires IPv6 Support.],
1921 [AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets]) AC_MSG_RESULT(yes)],
1922 [AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets]) AC_MSG_RESULT(no)]
cc192b50 1923)
1924
1925dnl Check for IPv6-pure option
1926AC_MSG_CHECKING([for IPv6-Localhost requirement])
1927AC_ARG_WITH(localhost-ipv6,
7f85cca1 1928 [ --with-localhost-ipv6 Prefer IPv6 localhost address over IPv4. Requires IPv6 Support.
cc192b50 1929 Treats 127.0.0.1 and ::1 as identical and converts all inputs of to ::1
1930 This depends on Dual-Stack support in the OS and all applications
1931 squid contacts via localhost being IPv6 enabled.
1932 Default: OFF. Treats these two IP as different, squid.conf must
1933 define both 127.0.0.1 and ::1 for the localhost ACL, etc. ],
7f85cca1
AJ
1934 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [Convert IPv4-localhost requests to IPv6. Default: keep seperate.]) AC_MSG_RESULT(yes)],
1935 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [Convert IPv4-localhost requests to IPv6. Default: Keep seperate.]) AC_MSG_RESULT(no)]
cc192b50 1936)
7f85cca1 1937
cc192b50 1938# end IPv6-only options
1939fi
1940
7172612f
AJ
1941AC_ARG_ENABLE(zph-qos,
1942[ --enable-zph-qos Enable ZPH QOS support],
1943[ if test "$enableval" = "yes" ; then
1944 echo "ZPH QOS enabled"
1945 AC_DEFINE(USE_ZPH_QOS,1,
1946 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
1947 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
1948 fi
1949])
1950
bae9832d 1951dnl Optional CNAME-Recursion by Internal DNS engine
1952AC_MSG_CHECKING([whether DNS CNAME recursion wanted])
1953AC_ARG_WITH(dns-cname,
1954 [ --with-dns-cname Enable CNAME-Recursion in Internal DNS stub.],
1955 [AC_DEFINE(DNS_CNAME, 1, [ 1 == Enable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(yes)],
1956 [AC_DEFINE(DNS_CNAME, 0, [ 0 == Disable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(no)]
1957)
1958
8c37ea44
AJ
1959dnl Check whether this OS defines ss_len as a member of sockaddr_storage
1960AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
1961 ac_cv_have_ss_len_in_struct_ss, [
1962 AC_TRY_COMPILE([
1963#include <sys/types.h>
1964#include <sys/socket.h>
cda4116f 1965#include <netinet/in.h>
8c37ea44
AJ
1966 ],
1967 [ struct sockaddr_storage s; s.ss_len = 1; ],
1968 [ ac_cv_have_ss_len_in_struct_ss="yes" ],
1969 [ ac_cv_have_ss_len_in_struct_ss="no" ]
1970 )
1971])
1972if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
1973 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
1974else
1975 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
1976fi
1977
1978dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
1979AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
1980 ac_cv_have_sin_len_in_struct_sai, [
1981 AC_TRY_COMPILE([
1982#include <sys/types.h>
1983#include <sys/socket.h>
1984 ],
1985 [ struct sockaddr_in s; s.sin_len = 1; ],
1986 [ ac_cv_have_sin_len_in_struct_sai="yes" ],
1987 [ ac_cv_have_sin_len_in_struct_sai="no" ]
1988 )
1989])
1990if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
1991 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
1992else
1993 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
1994fi
1995
1996dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
1997AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
1998 ac_cv_have_sin6_len_in_struct_sai, [
1999 AC_TRY_COMPILE([
2000#include <sys/types.h>
2001#include <sys/socket.h>
2002 ],
2003 [ struct sockaddr_in6 s; s.sin6_len = 1; ],
2004 [ ac_cv_have_sin6_len_in_struct_sai="yes" ],
2005 [ ac_cv_have_sin6_len_in_struct_sai="no" ]
2006 )
2007])
2008if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2009 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2010else
2011 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2012fi
2013
bae9832d 2014
f49be7d1 2015AC_ARG_WITH(filedescriptors,
f5e5c4cf 2016[ --with-filedescriptors=NUMBER
2017 Force squid to support NUMBER filedescriptors],
f49be7d1 2018[ squid_filedescriptors_num=$withval ])
2019
8b5e106b 2020AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
2021if $CPPUNITCONFIG --help >/dev/null; then
f5691f9c 2022 echo "using system installed cppunit"
8b5e106b 2023 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2024 SQUID_CPPUNIT_LA=''
2025 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2026else
f646b959 2027 echo "cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail."
63d03edb 2028 SQUID_CPPUNIT_LA=''
2029 SQUID_CPPUNIT_LIBS=''
2030 SQUID_CPPUNIT_INC=''
f5691f9c 2031fi
8b5e106b 2032
f5691f9c 2033AC_ARG_WITH(cppunit-basedir,
2034[ --with-cppunit-basedir=/path/to/cppunit-base
2035 Path where the cppunit headers are libraries are found
63d03edb 2036 for unit testing.
f5691f9c 2037 ],
2038[ if test -f $withval/include/cppunit/TestCase.h; then
2039 echo "Using cppunit includes from $withval"
2040 SQUID_CPPUNIT_INC="-I${withval}/include"
2041 else
2042 echo "ERROR: Cannot find cppunit at $withval"
2043 exit 1
2044 fi
2045 if test -f $withval/lib/libcppunit.la; then
2046 echo "Using cppunit lib from $withval"
549b1e60 2047 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
8b5e106b 2048 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
f5691f9c 2049 else
2050 echo "ERROR: Cannot find cppunit at $withval"
2051 exit 1
2052 fi
f5691f9c 2053])
8b5e106b 2054AC_SUBST(SQUID_CPPUNIT_LIBS)
f5691f9c 2055AC_SUBST(SQUID_CPPUNIT_LA)
2056AC_SUBST(SQUID_CPPUNIT_INC)
f5691f9c 2057
fd9aaa3e 2058# Force some compilers to use ANSI features
2059#
2060case "$host" in
2061 alpha-dec-osf*)
2062 if test "$ac_cv_prog_CC" = "cc" ; then
2063 echo "adding '-std1' to cc args for $host"
2064 CC="cc -std1";
2065 ac_cv_prog_CC="$CC"
2066 fi
2067 ;;
c68e9c6b 2068 *-hp-hpux*)
2069 if test "$ac_cv_prog_CC" = "cc" ; then
2070 echo "adding '-Ae' to cc args for $host"
2071 CC="cc -Ae";
2072 ac_cv_prog_CC="$CC"
2073 fi
2074 ;;
fd9aaa3e 2075esac
2076
090089c4 2077dnl Check for programs
2078AC_PROG_CPP
2079AC_PROG_INSTALL
090089c4 2080AC_PROG_LN_S
81280a96 2081AC_PATH_PROG(SH, sh, /bin/sh)
d9f67e6f 2082AC_PATH_PROG(FALSE, false, /usr/bin/false)
2083AC_PATH_PROG(TRUE, true, /usr/bin/true)
2084AC_PATH_PROG(RM, rm, $FALSE)
2085AC_PATH_PROG(MV, mv, $FALSE)
2086AC_PATH_PROG(MKDIR, mkdir, $FALSE)
090089c4 2087AC_PATH_PROG(LN, ln, cp)
4e9d8e26 2088AC_PATH_PROG(PERL, perl, none)
a2794549 2089dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
6ad85e8a 2090AC_PATH_PROG(AR, ar, $FALSE)
2091
4e9d8e26 2092if test "$ac_cv_path_PERL" = "none"; then
2093 echo "Perl is required to compile Squid"
2094 echo "Please install Perl and then re-run configure"
2095 exit 1
2096fi
2097
6ad85e8a 2098case "$host" in
2099 *-hp-hpux*)
2100 echo "Disabling 'ranlib' for HP-UX..."
2101 RANLIB=":"
2102 ;;
2103esac
2104
2105dnl set $(AR)
2106AR_R="$AR r"
2107case "$host" in
2108 *-next-nextstep3)
2109 AR="libtool -o"
2110 ;;
2111esac
2112AC_SUBST(AR_R)
090089c4 2113
2114dnl Check for headers
2115AC_HEADER_DIRENT
2116AC_HEADER_STDC
db40ae20 2117
2118AC_CHECK_HEADERS( \
db40ae20 2119 arpa/inet.h \
30a4f2a8 2120 arpa/nameser.h \
9441aa34 2121 assert.h \
db40ae20 2122 bstring.h \
db40ae20 2123 crypt.h \
30a4f2a8 2124 ctype.h \
2125 errno.h \
ce3d30fb 2126 execinfo.h \
db40ae20 2127 fcntl.h \
42ad37af 2128 fnmatch.h \
9c1d8929 2129 getopt.h \
52303a3d 2130 glob.h \
88738790 2131 gnumalloc.h \
30a4f2a8 2132 grp.h \
5cafc1d6 2133 ip_compat.h \
42b51993 2134 ip_fil_compat.h \
5cafc1d6 2135 ip_fil.h \
2136 ip_nat.h \
dbc5782a 2137 ipl.h \
30a4f2a8 2138 libc.h \
6ad85e8a 2139 limits.h \
30a4f2a8 2140 malloc.h \
e0bddc45 2141 math.h \
db40ae20 2142 memory.h \
b075cbb1 2143 mount.h \
30a4f2a8 2144 netdb.h \
db40ae20 2145 netinet/in.h \
cc192b50 2146 netinet/in_systm.h \
42b51993 2147 netinet/ip_fil_compat.h \
1f7c9178 2148 openssl/err.h \
2149 openssl/md5.h \
2150 openssl/ssl.h \
cc192b50 2151 netinet/tcp.h \
a7ad6e4e 2152 openssl/engine.h \
4da086c4 2153 paths.h \
dcfe6390 2154 poll.h \
30a4f2a8 2155 pwd.h \
b5e4d7d4 2156 shadow.h \
30a4f2a8 2157 regex.h \
c68e9c6b 2158 sched.h \
30a4f2a8 2159 signal.h \
2160 stdarg.h \
2161 stddef.h \
2162 stdio.h \
db40ae20 2163 stdlib.h \
2164 string.h \
2165 strings.h \
0a4e8536 2166 sys/bitypes.h \
f9576890 2167 sys/bswap.h \
2168 sys/endian.h \
db40ae20 2169 sys/file.h \
5cafc1d6 2170 sys/ioctl.h \
30a4f2a8 2171 sys/param.h \
62ae0622 2172 sys/prctl.h \
3d4022fa 2173 sys/md5.h \
77e4c0c9 2174 sys/msg.h \
30a4f2a8 2175 sys/resource.h \
db40ae20 2176 sys/select.h\
30a4f2a8 2177 sys/socket.h \
2178 sys/stat.h \
b075cbb1 2179 sys/statvfs.h \
3c641669 2180 syscall.h \
30a4f2a8 2181 sys/syscall.h \
db40ae20 2182 sys/time.h \
2183 sys/types.h \
30a4f2a8 2184 sys/un.h \
b075cbb1 2185 sys/vfs.h \
30a4f2a8 2186 sys/wait.h \
db40ae20 2187 syslog.h \
30a4f2a8 2188 time.h \
2189 unistd.h \
3c641669 2190 utime.h \
30a4f2a8 2191 varargs.h \
77d6bd88 2192 byteswap.h \
2193 glib.h \
60d096f4 2194 stdint.h \
2195 inttypes.h \
3c641669 2196 grp.h \
2197 nss_common.h \
94331f58 2198 nss.h \
2199 db.h \
329ce686 2200 db_185.h \
2201 sys/capability.h
db40ae20 2202)
2203
fc68f6b1 2204AC_CHECK_HEADERS(
2205 linux/netfilter_ipv4.h \
2206 linux/netfilter_ipv4/ip_tproxy.h \
2207,,,
dcd1dc78 2208SQUID_DEFAULT_INCLUDES
2209#if HAVE_LIMITS_H
2210#include <limits.h>
2211#endif
a74968c2
AJ
2212/* Netfilter ip(6)tables v1.4.0 has broken headers */
2213#if HAVE_NETINET_IN_H
2214#include <netinet/in.h>
2215#endif
dcd1dc78 2216)
2217
d1e5191e 2218dnl *BSD dont include the depenencies for all their net/ and netinet/ files
c92b4732 2219dnl We must include a few basic type headers for them to work.
d1e5191e
AJ
2220AC_CHECK_HEADERS( \
2221 net/if.h \
5a3237b0 2222 netinet/if_ether.h\
d1e5191e
AJ
2223 netinet/icmp6.h \
2224 netinet/ip.h \
2225 netinet/ip6.h \
5a3237b0 2226 netinet/ip_compat.h\
2227 netinet/ip_fil.h\
d1e5191e 2228 netinet/ip_icmp.h \
77e4c0c9 2229 netinet/ip_nat.h\
dbc5782a 2230 netinet/ipl.h \
d1e5191e 2231 net/pfvar.h \
77e4c0c9 2232 sys/mount.h\
d1e5191e
AJ
2233 resolv.h \
2234,,,
2235SQUID_BSDNET_INCLUDES)
5a3237b0 2236
a1559187 2237AC_CHECK_HEADERS([libxml/parser.h], [], [
2238 SAVED_CPPFLAGS="$CPPFLAGS"
2239 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2240 unset ac_cv_header_libxml_parser_h
2241 AC_CHECK_HEADERS([libxml/parser.h], [], [
2242 CPPFLAGS="$SAVED_CPPFLAGS"
2243 ])
2244 ])
2245
aee0606f 2246AC_C_CONST
d57288d2 2247AC_C_BIGENDIAN
aee0606f 2248
6a9f6389 2249AC_STRUCT_TM
2250AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2251#if TM_IN_SYS_TIME
2252#if HAVE_SYS_TIME_H
2253#include <sys/time.h>
2254#endif
2255#elif HAVE_TIME_H
2256#include <time.h>
2257#endif
5c51415d 2258])
46c883ed 2259
6a9f6389 2260AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2261#if HAVE_SYS_TYPES_H
2262#include <sys/types.h>
2263#endif
eb824054 2264#if HAVE_MALLOC_H
2265#include <malloc.h>
6a9f6389 2266#endif])
eb824054 2267
6a9f6389 2268AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2269#if HAVE_SYS_TYPES_H
2270#include <sys/types.h>
2271#endif
2272#if HAVE_MALLOC_H
2273#include <malloc.h>
2274#endif])
090089c4 2275
08caf8c6 2276dnl Override rusage() detect on MinGW because is emulated in source code
2277case "$host_os" in
2278 mingw|mingw32)
2279 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2280 ac_cv_func_getrusage='yes'
d750d7bf 2281 echo "Using own rusage on Windows."
08caf8c6 2282 ;;
2283 *)
2284 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
8ff51bba 2285#if HAVE_SYS_TIME_H
2286#include <sys/time.h>
2287#endif
b54a6789 2288#if HAVE_SYS_RESOURCE_H
2289#include <sys/resource.h>
6a9f6389 2290#endif])
08caf8c6 2291 ;;
2292esac
b54a6789 2293
6a9f6389 2294AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2295#if HAVE_SYS_TYPES_H
2296#include <sys/types.h>
2297#endif
a025a745 2298#include <netinet/in.h>
2299#include <netinet/in_systm.h>
6ad85e8a 2300#include <netinet/ip.h>
b05490a8 2301#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 2302#define ip_hl ihl
2303#endif
2304#ifndef __linux__
b05490a8 2305#ifndef __CYGWIN__
6ad85e8a 2306#define iphdr ip
b05490a8 2307#endif
6a9f6389 2308#endif])
a025a745 2309
090089c4 2310dnl Check for typedefs
77d6bd88 2311AC_CHECK_SIZEOF(void *)
090089c4 2312
0409a509 2313dnl 8 bit integers - int8_t
2314dnl if this is defined we trust it to be 8 bits
2315AC_CHECK_TYPE(int8_t,[
2316 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2317 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2318 ],,SQUID_DEFAULT_INCLUDES)
2319
2320dnl fallback #1
2321AC_CHECK_TYPE(char,[
2322 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2323 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2324 ],,SQUID_DEFAULT_INCLUDES)
2325
2326dnl unsigned 8 bit ints - u_int8_t
2327dnl if this is defined we trust it to be 8 bits
2328AC_CHECK_TYPE(u_int8_t,[
2329 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2330 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2331 ],,SQUID_DEFAULT_INCLUDES)
2332
2333dnl fallback #1
2334dnl if this is defined we trust it to be 8 bits
2335AC_CHECK_TYPE(uint8_t,[
2336 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2337 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2338 ],,SQUID_DEFAULT_INCLUDES)
2339
2340dnl 16 bit integers - int16_t
6a9f6389 2341dnl if this is defined we trust it to be 16 bits
62266438 2342AC_CHECK_TYPE(int16_t,[
2343 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2344 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2345 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2346
2347dnl fallback #1
2348AC_CHECK_TYPE(short,[
856e69c5 2349 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2350 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2351 ],,SQUID_DEFAULT_INCLUDES)
2352
2353dnl fallback #2
2354AC_CHECK_TYPE(int,[
856e69c5 2355 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2356 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2357 ],,SQUID_DEFAULT_INCLUDES)
2358
2359dnl unsigned 16 bit ints - u_int16_t
2360dnl if this is defined we trust it to be 16 bits
62266438 2361AC_CHECK_TYPE(u_int16_t,[
2362 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2363 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2364 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2365
2366dnl fallback #1
2367dnl if this is defined we trust it to be 16 bits
62266438 2368AC_CHECK_TYPE(uint16_t,[
2369 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2370 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2371 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2372
2373dnl 32 bit signed int - int32_t
2374dnl if this is defined we trust it to be 32 bits
62266438 2375AC_CHECK_TYPE(int32_t,[
2376 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2377 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2378 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2379
2380dnl fallback #1
2381AC_CHECK_TYPE(long,[
856e69c5 2382 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2383 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2384 ],,SQUID_DEFAULT_INCLUDES)
2385
2386dnl 32 bit unsigned int - u_int32_t
2387dnl if this is defined we trust it to be 32 bits
62266438 2388AC_CHECK_TYPE(u_int32_t,[
2389 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2390 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2391 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2392
2393dnl fallback #1
2394dnl if this is defined we trust it to be 32 bits
62266438 2395AC_CHECK_TYPE(uint32_t,[
2396 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2397 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2398 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2399
2400dnl 64 bit signed - int64_t
2401dnl if this is defind we trust it to be 64 bits
62266438 2402AC_CHECK_TYPE(int64_t,[
2403 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2404 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2405 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2406
2407dnl fallback #1
2408dnl if this is defind we trust it to be 64 bits
62266438 2409AC_CHECK_TYPE(__int64,[
2410 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2411 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2412 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2413
2414dnl fallback #2
2415AC_CHECK_TYPE(long long,[
856e69c5 2416 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2417 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2418 ],,SQUID_DEFAULT_INCLUDES)
2419
2420dnl 64 bit unsigned - u_int64_t
2421dnl if this is defind we trust it to be 64 bits
62266438 2422AC_CHECK_TYPE(u_int64_t,[
2423 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2424 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2425 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2426
2427dnl fallback #1
2428dnl if this is defind we trust it to be 64 bits
62266438 2429AC_CHECK_TYPE(uint64_t,[
2430 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2431 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2432 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2433
588e71df 2434dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2435dnl that is incompatible with the updated Solaris header files.
2436dnl For this reason, we must check if pad128_t and upad128_t are defined.
2437AC_CHECK_TYPE(pad128_t,
2438 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2439 ,SQUID_DEFAULT_INCLUDES)
2440
2441AC_CHECK_TYPE(upad128_t,
2442 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2443 ,SQUID_DEFAULT_INCLUDES)
2444
6a9f6389 2445AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2446AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2447 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2448AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2449AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2450 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2451AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2452AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
adcceb47 2453
77d6bd88 2454dnl Check for special functions
2455AC_FUNC_ALLOCA
2456
6a9f6389 2457AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2458#include <sys/types.h>
6637e3a5 2459#include <sys/socket.h>
2460#if STDC_HEADERS
2461#include <stdlib.h>
2462#include <stddef.h>
6a9f6389 2463#endif])
6637e3a5 2464
6a9f6389 2465AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
aea1be68 2466#include <sys/ipc.h>
6a9f6389 2467#include <sys/msg.h>])
aea1be68 2468
090089c4 2469dnl Check for needed libraries
30a4f2a8 2470AC_CHECK_LIB(nsl, main)
6716b242 2471AC_CHECK_LIB(socket, main)
4b26fae9 2472case "$host_os" in
2473 mingw|mingw32)
2474 AC_MSG_CHECKING(for winsock)
2475 save_LIBS="$LIBS"
2476 for curlib in ws2_32 wsock32; do
2477 LIBS="$LIBS -l$curlib"
2478 AC_TRY_LINK([
2479 char __attribute__((stdcall)) socket(int,int,int);
2480 char __attribute__((stdcall)) select(int,int,int,int,int);
2481 char __attribute__((stdcall)) closesocket(int);
2482 char __attribute__((stdcall)) gethostname(int,int);
2483 ],
2484 [
2485 socket(1,2,3);
2486 select(1,2,3,4,5);
2487 closesocket(1);
2488 gethostname(1,2);
2489 ],
2490 have_winsock=yes, have_winsock=no)
2491
2492 if test $have_winsock = yes; then
2493 ac_cv_func_select='yes'
2494 if test $curlib = ws2_32; then
2495 have_winsock=winsock2
2496 fi
2497 break
2498 fi
2499 LIBS="$save_LIBS"
2500 done
2501 AC_MSG_RESULT($have_winsock)
2502 ;;
2503esac
94d48591 2504
3c641669 2505dnl Ripped from the Samba sources
2506AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2507 AC_TRY_COMPILE([
2508#include <sys/types.h>
2509#include <stdlib.h>
2510#include <stddef.h>
2511#include <sys/socket.h>
2512#include <sys/un.h>],
2513[
2514 struct sockaddr_un sunaddr;
2515 sunaddr.sun_family = AF_UNIX;
2516],
2517 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2518if test x"$squid_cv_unixsocket" = x"yes"; then
6a9f6389 2519 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
3c641669 2520fi
2521dnl end rip
2522
94d48591 2523 AC_CHECK_LIB(gnumalloc, main)
2524 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2525 echo "Disabling extended malloc functions when using gnumalloc"
2526 ac_cv_func_mallinfo=no
2527 ac_cv_func_mallocblksize=no
2528 ac_cv_func_mallopt=no
2529 else
2530 case "$host" in
2531 *-sun-solaris*)
2532 echo "skipping libmalloc check for $host"
2533 ;;
2534 i386-*-freebsd*)
2535 echo "skipping libmalloc check for $host"
2536 ;;
2537 *)
2538
2539 AC_CHECK_LIB(malloc, main)
2540 ;;
2541 esac
2542 fi
94d48591 2543
6716b242 2544AC_CHECK_LIB(bsd, main)
be79ade0 2545AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
04a56fa3 2546AC_CHECK_LIB(bind, gethostbyname)
2547if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2548 case "$host" in
78743365 2549 i386-*-freebsd*)
2550 echo "skipping libresolv checks for $host"
2551 ;;
2552 *)
78743365 2553 AC_CHECK_LIB(resolv, main)
2554 ;;
04a56fa3 2555 esac
2556fi
08caf8c6 2557case "$host_os" in
2558mingw|mingw32)
2559 echo "Use MSVCRT for math functions."
2560 ;;
2561 *)
2562 AC_CHECK_LIB(m, main)
2563 ;;
2564esac
090089c4 2565
2566dnl Check for libcrypt
8154dd82 2567dnl Some of our helpers use crypt(3) which may be in libc, or in
2568dnl libcrypt (eg FreeBSD)
c1dc012a 2569AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
3d4022fa 2570
2571dnl Solaris10 provides MD5 natively through libmd5
c1dc012a 2572AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
3d4022fa 2573
be79ade0 2574AC_SUBST(CRYPTLIB)
77f675ad 2575
042b1f8a 2576dnl Check for libdl, used by auth_modules/PAM
8154dd82 2577if test "$with_dl" = "yes"; then
2578 AC_CHECK_LIB(dl, dlopen)
2579fi
042b1f8a 2580
e5f4e1b0 2581dnl Check for pthreads
2582dnl We use pthreads when doing ASYNC I/O
8154dd82 2583if test "$with_pthreads" = "yes"; then
fa035612 2584 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2585 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
e685e3c6 2586 case "$host" in
2587 i386-unknown-freebsd*)
2588 if test "$GCC" = "yes" ; then
2589 if test -z "$PRESET_LDFLAGS"; then
2590 LDFLAGS="$LDFLAGS -pthread"
2591 fi
2592 fi
2593 ;;
2594 *-solaris2.*)
2595 if test "$GCC" = "yes" ; then
fa035612 2596 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2597 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
e685e3c6 2598 else
fa035612 2599 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2600 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
e685e3c6 2601 fi
2602 ;;
2603 esac
8154dd82 2604 AC_CHECK_LIB(pthread, main)
2605fi
71f8abc8 2606
f85c88f3 2607dnl Check for librt
2608dnl We use AIO in the coss store
8154dd82 2609if test "$with_aio" = "yes"; then
580e2134 2610 dnl On some systems POSIX AIO functions are in libaio
2611 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
8154dd82 2612fi
f85c88f3 2613
86ec11aa 2614dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2615dnl Robert Side <rside@aiinc.bc.ca>
2616dnl Mon, 18 Jan 1999 17:48:00 GMT
2617case "$host" in
2618 *-pc-sco3.2*)
2619 AC_CHECK_LIB(intl, strftime)
2620 ;;
2621esac
2622
20e869bf 2623dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2624dnl only with Windows LDAP libraries using -lwldap32
2625case "$host_os" in
2626mingw|mingw32)
2627 LIB_LDAP="-lwldap32"
2628 LIB_LBER=""
2629 ;;
2630*)
2631 LIB_LDAP="-lldap"
2632 dnl LDAP helpers need to know if -llber is needed or not
2633 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2634 ;;
2635esac
2636AC_SUBST(LIB_LDAP)
2637AC_SUBST(LIB_LBER)
2638
b7a1c19e 2639dnl Check for libdb
2640DBLIB=
01b4931d 2641dnl 1.85
a258dfca 2642AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
32d0bbd7 2643SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2644 AC_TRY_LINK([
a258dfca 2645#if HAVE_SYS_TYPES_H
2646#include <sys/types.h>
2647#endif
2648#if HAVE_LIMITS_H
2649#include <limits.h>
2650#endif
2651#if HAVE_DB_185_H
2652#include <db_185.h>
2653#elif HAVE_DB_H
2654#include <db.h>
2655#endif],
2656 [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)],
a258dfca 2657 ac_cv_dbopen_libdb="yes",
2658 ac_cv_dbopen_libdb="no")
32d0bbd7 2659LIBS="$SAVED_LIBS"
a258dfca 2660])
2b2161bb 2661if test $ac_cv_dbopen_libdb = yes; then
32d0bbd7 2662 LIB_DB="-ldb"
2663fi
01b4931d 2664AC_SUBST(LIB_DB)
b7a1c19e 2665
77f675ad 2666dnl System-specific library modifications
2667dnl
2668case "$host" in
88738790 2669 i386-*-solaris2.*)
7149a49f 2670 if test "$GCC" = "yes"; then
2671 echo "Removing -O for gcc on $host"
80e92d6d 2672 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 2673 fi
2674 ;;
77f675ad 2675 *-sgi-irix*)
2676 echo "Removing -lsocket for IRIX..."
6716b242 2677 LIBS=`echo $LIBS | sed -e s/-lsocket//`
77f675ad 2678 echo "Removing -lnsl for IRIX..."
6716b242 2679 LIBS=`echo $LIBS | sed -e s/-lnsl//`
c415c128 2680 ac_cv_lib_nsl_main=no
b44c0fb4 2681 echo "Removing -lbsd for IRIX..."
2682 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 2683 ;;
4ba0bd0e 2684dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2685dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2686dnl Please change your configure script. AIX doesn't need -lbsd.
2687 *-ibm-aix*)
2688 echo "Removing -lbsd for AIX..."
2689 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2690 ;;
30a4f2a8 2691 *m88k*)
fa035612 2692 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2693 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
6a9f6389 2694 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
7149a49f 2695 ;;
580ce039 2696 [*-*-solaris2.[0-4]])
6a9f6389 2697 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
30a4f2a8 2698 ;;
711fa75e 2699 [*-sony-newsos[56]*])
6a9f6389 2700 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
f62c73dc 2701 ;;
77f675ad 2702esac
090089c4 2703
57faa85a 2704# Remove optimization for GCC 2.95.[123]
d20b1cd0 2705# gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2706if test "$GCC" = "yes"; then
2707 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2708 case "$GCCVER" in
57faa85a 2709 [2.95.[123]])
d20b1cd0 2710 echo "Removing -O for gcc on $host with GCC $GCCVER"
2711 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2712 ;;
2713 esac
2714fi
2715
176d10ee 2716# Recommended by Balint Nagy Endre <bne@CareNet.hu>
2717case "$host" in
2718 *-univel-sysv4.2MP)
2719 if test `uname -v` = "2.03"; then
2720 echo "disabling mallinfo for $host"
2721 ac_cv_func_mallinfo=no
2722 fi
2723 ;;
2724esac
2725
84cecfd2 2726dnl This has to be before AC_CHECK_FUNCS
2727# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2728# when running configure.
2729if test -z "$ac_cv_func_poll"; then
2730 case "$host" in
2731 [alpha-dec-osf3.*])
2732 # John Kay (jkay@nlanr.net) 19970818
2733 echo "disabling poll for $host..."
2734 ac_cv_func_poll='no'
2735 ;;
2736 [*-hp-hpux*.*])
2737 # Duane Wessels
2738 echo "disabling poll for $host..."
2739 ac_cv_func_poll='no'
2740 ;;
2741 [*-linux-*])
f5cec332 2742 # Henrik Nordstrom (hno@squid-cache.org) 19980817
9bb83c8b 2743 # poll is problematic on Linux. We disable it
2744 # by default until Linux gets it right.
b6a2f15e 2745 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2746 if test $rev -lt 002002; then
2747 echo "disabling poll for $host < 2.2..."
2748 ac_cv_func_poll='no'
2749 fi
84cecfd2 2750 ;;
c68e9c6b 2751 [powerpc-ibm-aix4.1.*])
2752 # Mike Laster (mlaster@metavillage.com) 19981021
2753 echo "disabling poll for $host..."
2754 ac_cv_func_poll='no'
2755 ;;
86ec11aa 2756 [*-pc-sco3.2*])
2757 # Robert Side <rside@aiinc.bc.ca>
2758 # Mon, 18 Jan 1999 17:48:00 GMT
2759 echo "disabling poll for $host..."
2760 ac_cv_func_poll='no'
2761 ;;
84cecfd2 2762 esac
2763fi
176d10ee 2764
08caf8c6 2765dnl Override statfs() detect on MinGW becasue is emulated in source code
2766case "$host_os" in
2767mingw|mingw32)
2768 ac_cv_func_statfs='yes'
2769 ;;
2770esac
2771
6716b242 2772dnl Check for library functions
2773AC_CHECK_FUNCS(\
ce3d30fb 2774 backtrace_symbols_fd \
3a144521 2775 bcopy \
2776 bswap_16 \
2777 bswap_32 \
f9576890 2778 bswap16 \
2779 bswap32 \
4ac29a5b 2780 fchmod \
6716b242 2781 getdtablesize \
8505e57b 2782 getpagesize \
230c091c 2783 getpass \
3a144521 2784 getrlimit \
30a4f2a8 2785 getrusage \
9c1d8929 2786 getspnam \
379d5751 2787 gettimeofday \
52303a3d 2788 glob \
f9576890 2789 htobe16 \
2790 htole16 \
d474c7a6 2791 kqueue\
30a4f2a8 2792 lrand48 \
6716b242 2793 mallinfo \
0f5efab0 2794 mallocblksize \
6716b242 2795 mallopt \
2ae6b9b0 2796 memcpy \
30a4f2a8 2797 memmove \
dac27377 2798 memset \
b99a6dec 2799 mkstemp \
1812b6c7 2800 mktime \
88738790 2801 mstats \
84cecfd2 2802 poll \
62ae0622 2803 prctl \
3a144521 2804 pthread_attr_setschedparam \
cd748f27 2805 pthread_attr_setscope \
2806 pthread_setschedparam \
42b51993 2807 pthread_sigmask \
c68e9c6b 2808 putenv \
b1e77ec1 2809 random \
6716b242 2810 regcomp \
2811 regexec \
2812 regfree \
30a4f2a8 2813 res_init \
af76ec93 2814 __res_init \
4915be3b 2815 rint \
a4ba1105 2816 sbrk \
3a144521 2817 select \
234967c9 2818 seteuid \
c415c128 2819 setgroups \
30a4f2a8 2820 setpgrp \
6716b242 2821 setrlimit \
30a4f2a8 2822 setsid \
2823 sigaction \
11430c03 2824 snprintf \
1ccc0d40 2825 socketpair \
30a4f2a8 2826 srand48 \
b1e77ec1 2827 srandom \
0343b99c 2828 statfs \
1cd53467 2829 strsep \
2733d426 2830 strtoll \
6716b242 2831 sysconf \
2832 syslog \
234967c9 2833 timegm \
28da5e0d 2834 vsnprintf \
6716b242 2835)
f5e5c4cf 2836dnl ... and some we provide local replacements for
2837AC_REPLACE_FUNCS(\
2838 drand48 \
cc192b50 2839 inet_ntop \
2840 inet_pton \
f5e5c4cf 2841 initgroups \
cc192b50 2842 getaddrinfo \
2843 getnameinfo \
f5e5c4cf 2844 strerror \
2845 tempnam \
2846)
6716b242 2847
d06d566f 2848# check for crypt, may require -lcrypt
2849SAVED_LIBS="$LIBS"
2850LIBS="$LIBS $CRYPTLIB"
2851AC_CHECK_FUNCS(crypt)
2852LIBS="$SAVED_LIBS"
2853
d474c7a6 2854# Check for libepoll
2855EPOLL_LIB=
2856AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
2857AC_SUBST(EPOLL_LIBS)
2858
2859# Check for epoll_ctl, may need -lepoll
2860SAVED_LIBS="$LIBS"
2861LIBS="$LIBS $LIB_EPOLL"
2862AC_CHECK_FUNCS(epoll_ctl)
2863LIBS="$SAVED_LIBS"
2864
2865dnl Verify that epoll really works
2866if test $ac_cv_func_epoll_ctl = yes; then
2867 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
2868 AC_TRY_RUN([
2869#include <sys/epoll.h>
2870#include <stdlib.h>
2871#include <stdio.h>
2872int main(int argc, char **argv)
2873{
2874 int fd = epoll_create(256);
2875 if (fd < 0) {
2876 perror("epoll_create:");
2877 exit(1);
2878 }
2879 exit(0);
2880}
2881 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
328c40de 2882fi
d474c7a6 2883
1b3db6d9 2884dnl Magic which checks whether we are forcing a type of comm loop we
2885dnl are actually going to (ab)use
2886
2887dnl Actually do the define magic now
2888dnl mostly ripped from squid-commloops, thanks to adrian and benno
2889
d474c7a6 2890if test -n "$SELECT_TYPE"; then
2891 : # Already decided above. Nothing to do here
6564c397 2892elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
a46d2c0e 2893 SELECT_TYPE="epoll"
6564c397 2894elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
2895 SELECT_TYPE="kqueue"
2896elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
6c9797b9 2897 SELECT_TYPE="poll"
6564c397 2898elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
663c0a38 2899 case "$host_os" in
2900 mingw|mingw32)
2901 SELECT_TYPE="select_win32"
663c0a38 2902 ;;
2903 *)
2904 SELECT_TYPE="select"
663c0a38 2905 ;;
2906 esac
1b3db6d9 2907else
a46d2c0e 2908 echo "Eep! Can't find poll, kqueue, epoll, or select!"
1b3db6d9 2909 echo "I'll try select and hope for the best."
2910 SELECT_TYPE="select"
6a9f6389 2911 AC_DEFINE(USE_SELECT,1)
1b3db6d9 2912fi
d474c7a6 2913
2914echo "Using ${SELECT_TYPE} for the IO loop."
2915
2916AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2917AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2918AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2919AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2920AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2921AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2922AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2923
2924case $SELECT_TYPE in
2925epoll)
2926 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2927 ;;
2928poll)
2929 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2930 ;;
2931kqueue)
2932 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2933 ;;
2934select_win32)
2935 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
2936 ;;
2937select)
2938 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2939 ;;
2940esac
1b3db6d9 2941
2942
d06d566f 2943
60939927 2944dnl Yay! Another Linux brokenness. Its not good enough
2945dnl to know that setresuid() exists, because RedHat 5.0 declares
2946dnl setresuid() but doesn't implement it.
2947dnl
2948AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
5c51415d 2949 AC_TRY_RUN([
60939927 2950#include <stdlib.h>
5c51415d 2951 int main() {
2952 if(setresuid(-1,-1,-1)) {
2953 perror("setresuid:");
2954 exit(1);
60939927 2955 }
2956 exit(0);
5c51415d 2957 }
2958 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
60939927 2959)
5c51415d 2960if test "$ac_cv_func_setresuid" = "yes" ; then
6a9f6389 2961 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 2962fi
60939927 2963
cee08cbc
AJ
2964dnl Yay! This one is a MacOSX brokenness. Its not good enough
2965dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
2966dnl copy that crashes with a buffer over-run!
2967dnl
2968AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
2969 AC_TRY_RUN([
2970#include <stdlib.h>
2971#include <stdio.h>
2972#include <string.h>
2973 // we expect this to succeed, or crash on over-run.
2974 // if it passes otherwise we may need a better check.
2975int main(int argc, char **argv)
2976{
2977 int size = 20;
2978 char *str = malloc(size);
2979 memset(str, 'x', size);
2980 strnstr(str, "fubar", size);
2981 return 0;
2982}
2983 ],ac_cv_func_strnstr="yes",ac_cv_func_strnstr="no")
2984)
2985if test "$ac_cv_func_strnstr" = "yes" ; then
2986 AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
2987else
2988 AC_DEFINE(HAVE_STRNSTR,0,[Yay! A MacOS X brokenness. Its not good enough to know that strnstr() exists, because MacOSX 10.4 and earlier may have a buffer overrun.])
2989fi
2990
2991
1cd53467 2992AM_CONDITIONAL(NEED_OWN_STRSEP, false)
2993if test "$ac_cv_func_strsep" = "no" ; then
2994 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
2995fi
2996
2733d426 2997AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
2998if test "$ac_cv_func_strtoll" = "no" ; then
2999 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
3000fi
3001
eee79a2e 3002dnl
3003dnl Test for va_copy
3004dnl
3005AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
3006 AC_TRY_RUN([
3007 #include <stdarg.h>
3008 void f (int i, ...) {
3009 va_list args1, args2;
3010 va_start (args1, i);
3011 va_copy (args2, args1);
3012 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3013 exit (1);
3014 va_end (args1); va_end (args2);
3015 }
3016 int main() {
3017 f (0, 42);
3018 return 0;
3019 }
3020 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
3021)
3022if test "$ac_cv_func_va_copy" = "yes" ; then
a45f884d 3023 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
eee79a2e 3024fi
3025
3026dnl
3027dnl Some systems support __va_copy
3028dnl
3029AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
3030 AC_TRY_RUN([
3031 #include <stdarg.h>
3032 void f (int i, ...) {
3033 va_list args1, args2;
3034 va_start (args1, i);
3035 __va_copy (args2, args1);
3036 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3037 exit (1);
3038 va_end (args1); va_end (args2);
3039 }
3040 int main() {
3041 f (0, 42);
3042 return 0;
3043 }
3044 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
3045)
3046if test "$ac_cv_func___va_copy" = "yes" ; then
a45f884d 3047 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
eee79a2e 3048fi
c3d0c8b5 3049
5cafc1d6 3050dnl IP-Filter support requires ipf header files. These aren't
3051dnl installed by default, so we need to check for them
3052if test "$IPF_TRANSPARENT" ; then
3053 AC_MSG_CHECKING(if IP-Filter header files are installed)
42b51993 3054 # hold on to your hats...
3055 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3056 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
87d21d8b 3057 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3058 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
42b51993 3059 have_ipfilter_compat_header="yes"
3060 fi
3061 if test "x$have_ipfilter_compat_header" = "xyes" &&
eb824054 3062 test "$ac_cv_header_ip_fil_h" = "yes" &&
3063 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3064 IPF_TRANSPARENT="yes"
3065 AC_DEFINE(IPF_TRANSPARENT, 1)
42b51993 3066 elif test "$have_ipfilter_compat_header" = "yes" &&
eb824054 3067 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3068 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3069 IPF_TRANSPARENT="yes"
3070 AC_DEFINE(IPF_TRANSPARENT, 1)
3071 else
5cafc1d6 3072 IPF_TRANSPARENT="no"
3073 AC_DEFINE(IPF_TRANSPARENT, 0)
5cafc1d6 3074 fi
3075 AC_MSG_RESULT($IPF_TRANSPARENT)
3076fi
3077if test "$IPF_TRANSPARENT" = "no" ; then
3078 echo "WARNING: Cannot find necessary IP-Filter header files"
3079 echo " Transparent Proxy support WILL NOT be enabled"
3080 sleep 10
8f6ca20d 3081elif test "$IPF_TRANSPARENT" = "yes" ; then
3082dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3083dnl Solaris minor version (8, 9, 10, ...)
3084 case "$host" in
3085 *-solaris*)
3086 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3087 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
20b3ae10 3088 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
8f6ca20d 3089 ;;
3090 *)
3091 ;;
3092 esac
5cafc1d6 3093fi
3094
2b0dd4ac 3095dnl PF support requires a header file.
3096if test "$PF_TRANSPARENT" ; then
3097 AC_MSG_CHECKING(if PF header file is installed)
3098 # hold on to your hats...
3099 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
3100 PF_TRANSPARENT="yes"
3101 AC_DEFINE(PF_TRANSPARENT, 1)
3102 else
3103 PF_TRANSPARENT="no"
3104 AC_DEFINE(PF_TRANSPARENT, 0)
3105 fi
3106 AC_MSG_RESULT($PF_TRANSPARENT)
3107fi
3108if test "$PF_TRANSPARENT" = "no" ; then
3109 echo "WARNING: Cannot find necessary PF header file"
3110 echo " Transparent Proxy support WILL NOT be enabled"
3111 sleep 10
3112fi
3113
d852fbad 3114dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3115dnl Shamelessly copied from above
3116if test "$LINUX_NETFILTER" ; then
d6d62546 3117 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
d852fbad 3118 # hold on to your hats...
3119 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3120 LINUX_NETFILTER="yes"
3121 AC_DEFINE(LINUX_NETFILTER, 1)
3122 else
3123 LINUX_NETFILTER="no"
3124 AC_DEFINE(LINUX_NETFILTER, 0)
3125 fi
3126 AC_MSG_RESULT($LINUX_NETFILTER)
3127fi
3128if test "$LINUX_NETFILTER" = "no" ; then
d6d62546 3129 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
7b0a0d1f 3130 echo " Linux Transparent and Intercepting Proxy support WILL NOT be enabled"
d852fbad 3131 sleep 10
3132fi
3133
f1e0717c 3134dnl Linux Netfilter/TPROXYv2 support requires some specific header files
fc68f6b1 3135dnl Shamelessly copied from shamelessly copied from above
f1e0717c
AJ
3136if test "$LINUX_TPROXY2" ; then
3137 AC_MSG_CHECKING(if TPROXYv2 header files are installed)
fc68f6b1 3138 # hold on to your hats...
3139 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
f1e0717c
AJ
3140 LINUX_TPROXY2="yes"
3141 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
fc68f6b1 3142 else
f1e0717c
AJ
3143 LINUX_TPROXY2="no"
3144 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3145 fi
3146 AC_MSG_RESULT($LINUX_TPROXY2)
3147 if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3148 echo "WARNING: Cannot find TPROXY v2 headers, you need to install the"
3149 echo "tproxy package from:"
3150 echo " - lynx http://www.balabit.com/downloads/tproxy/"
7b0a0d1f 3151 echo "Or select the '--enable-linux-netfilter' option instead for Netfilter support."
f1e0717c 3152 sleep 10
fc68f6b1 3153 fi
fc68f6b1 3154fi
3155
91bc414e 3156if test -z "$USE_GNUREGEX" ; then
3157 case "$host" in
3158 *-sun-solaris2.[[0-4]])
3159 USE_GNUREGEX="yes"
3160 ;;
3161 *-next-nextstep*)
3162 USE_GNUREGEX="yes"
3163 ;;
3164 esac
3165fi
7a081912 3166AC_MSG_CHECKING(if GNUregex needs to be compiled)
91bc414e 3167if test -z "$USE_GNUREGEX"; then
55878dfd 3168if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
74946a0f 3169 USE_GNUREGEX="yes"
00fa2c12 3170else
0cccc031 3171 AC_TRY_COMPILE([#include <sys/types.h>
3172#include <regex.h>],[regex_t t; regcomp(&t,"",0);],
91bc414e 3173 USE_GNUREGEX="no",
3174 USE_GNUREGEX="yes")
3175fi
00fa2c12 3176fi
74946a0f 3177AC_MSG_RESULT($USE_GNUREGEX)
3178if test "$USE_GNUREGEX" = "yes"; then
26675bf4 3179 REGEXLIB="-lregex"
7a081912 3180 LIBREGEX="libregex.a"
6a9f6389 3181 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
7a081912 3182fi
26675bf4 3183AC_SUBST(REGEXLIB)
00fa2c12 3184AC_SUBST(LIBREGEX)
7a081912 3185
5c51415d 3186dnl Not cached since people are likely to tune this
e924600d 3187AC_MSG_CHECKING(Default FD_SETSIZE value)
3188AC_TRY_RUN([
3189#if HAVE_STDIO_H
3190#include <stdio.h>
3191#endif
3192#if HAVE_UNISTD_H
3193#include <unistd.h>
3194#endif
3195#if HAVE_SYS_TIME_H
3196#include <sys/time.h>
3197#endif
3198#if HAVE_SYS_SELECT_H
3199#include <sys/select.h>
3200#endif
3201#if HAVE_SYS_TYPES_H
3202#include <sys/types.h>
3203#endif
3204main() {
635e6242 3205 FILE *fp = fopen("conftestval", "w");
3206 fprintf (fp, "%d\n", FD_SETSIZE);
e924600d 3207 exit(0);
3208}
3209],
3210DEFAULT_FD_SETSIZE=`cat conftestval`,
3211DEFAULT_FD_SETSIZE=256,
3212DEFAULT_FD_SETSIZE=256)
3213AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
6a9f6389 3214AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
e924600d 3215
f49be7d1 3216
5c51415d 3217dnl Not cached since people are likely to tune this
234967c9 3218AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
c76d8acc 3219dnl damn! FreeBSD's pthreads breaks dup2().
5132a9eb 3220TLDFLAGS="$LDFLAGS"
f49be7d1 3221if test -n "$squid_filedescriptors_num" ; then
3222 SQUID_MAXFD=$squid_filedescriptors_num
3223 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3224else
f49be7d1 3225 case $host in
3226 i386-unknown-freebsd*)
3227 if echo "$LDFLAGS" | grep -q pthread; then
3228 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3229 fi
3230 esac
3231 AC_TRY_RUN([
8cca06da 3232#include <stdio.h>
234967c9 3233#include <unistd.h>
30a4f2a8 3234#include <sys/time.h> /* needed on FreeBSD */
234967c9 3235#include <sys/param.h>
3236#include <sys/resource.h>
3237main() {
635e6242 3238 FILE *fp;
234967c9 3239 int i,j;
42b51993 3240#if defined(__CYGWIN32__) || defined (__CYGWIN__)
b05490a8 3241 /* getrlimit and sysconf returns bogous values on cygwin32.
df087e68 3242 * Number of fds is virtually unlimited in cygwin (sys/param.h)
b05490a8 3243 * __CYGWIN32__ is deprecated.
df087e68 3244 */
3245 i = NOFILE;
b05490a8 3246#else
3247#if HAVE_SETRLIMIT
234967c9 3248 struct rlimit rl;
3249#if defined(RLIMIT_NOFILE)
3250 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3251 perror("getrlimit: RLIMIT_NOFILE");
3252 } else {
f168f0c5
AJ
3253#if defined(__APPLE__)
3254 /* asking for more than OPEN_MAX fails on Leopard */
3255 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3256#else
234967c9 3257 rl.rlim_cur = rl.rlim_max; /* set it to the max */
f168f0c5 3258#endif
234967c9 3259 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3260 perror("setrlimit: RLIMIT_NOFILE");
3261 }
3262 }
3263#elif defined(RLIMIT_OFILE)
3264 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3265 perror("getrlimit: RLIMIT_OFILE");
3266 } else {
3267 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3268 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3269 perror("setrlimit: RLIMIT_OFILE");
3270 }
3271 }
3272#endif /* RLIMIT_NOFILE */
3273#endif /* HAVE_SETRLIMIT */
d9399075 3274 /* by starting at 2^14, we will never get higher
3275 than 2^15 for SQUID_MAXFD */
3276 i = j = 1<<14;
3277 while (j) {
3278 j >>= 1;
3279 if (dup2(0, i) < 0) {
3280 i -= j;
3281 } else {
3282 close(i);
3283 i += j;
3284 }
3285 }
3286 i++;
b05490a8 3287#endif /* IF !DEF CYGWIN */
635e6242 3288 fp = fopen("conftestval", "w");
a4d7e961 3289 fprintf (fp, "%d\n", i & ~0x3F);
234967c9 3290 exit(0);
3291}
f49be7d1 3292 ],
3293 SQUID_MAXFD=`cat conftestval`,
3294 SQUID_MAXFD=256,
3295 SQUID_MAXFD=256)
4b26fae9 3296 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3297 case "$host_os" in
3298 mingw|mingw32)
3299 SQUID_MAXFD="2048"
3300 ;;
3301 esac
f49be7d1 3302 AC_MSG_RESULT($SQUID_MAXFD)
3303fi
6a9f6389 3304AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
b9cc811d 3305if test "$SQUID_MAXFD" -lt 512 ; then
80ab193b 3306 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
3307 echo " cache will be very busy. Please see the FAQ page"
2b6662ba 3308 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
e692ff35 3309 echo " on how to increase your filedescriptor limit"
933cc58d 3310 sleep 10
80ab193b 3311fi
c76d8acc 3312LDFLAGS="$TLDFLAGS"
234967c9 3313
d0f9207a 3314if test `expr $SQUID_MAXFD % 64` != 0; then
a4d7e961 3315 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
3316 echo " on certain platforms."
3317 sleep 10
3318fi
3319
5c51415d 3320dnl Not cached since people are likely to tune this
30a4f2a8 3321AC_MSG_CHECKING(Default UDP send buffer size)
3322AC_TRY_RUN([
8cca06da 3323#include <stdlib.h>
3324#include <stdio.h>
30a4f2a8 3325#include <sys/types.h>
3326#include <sys/socket.h>
3327#include <netinet/in.h>
3328main ()
3329{
635e6242 3330 FILE *fp;
30a4f2a8 3331 int fd,val=0,len=sizeof(int);
3332 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3333 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3334 if (val<=0) exit(1);
635e6242 3335 fp = fopen("conftestval", "w");
3336 fprintf (fp, "%d\n", val);
30a4f2a8 3337 exit(0);
3338}
3339],
6a9f6389 3340SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3341SQUID_DETECT_UDP_SO_SNDBUF=16384,
3342SQUID_DETECT_UDP_SO_SNDBUF=16384)
3343AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3344AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
30a4f2a8 3345
5c51415d 3346dnl Not cached since people are likely to tune this
30a4f2a8 3347AC_MSG_CHECKING(Default UDP receive buffer size)
3348AC_TRY_RUN([
8cca06da 3349#include <stdlib.h>
3350#include <stdio.h>
30a4f2a8 3351#include <sys/types.h>
3352#include <sys/socket.h>
3353#include <netinet/in.h>
3354main ()
3355{
635e6242 3356 FILE *fp;
30a4f2a8 3357 int fd,val=0,len=sizeof(int);
3358 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3359 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3360 if (val <= 0) exit(1);
635e6242 3361 fp = fopen("conftestval", "w");
3362 fprintf (fp, "%d\n", val);
30a4f2a8 3363 exit(0);
3364}
3365],
6a9f6389 3366SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3367SQUID_DETECT_UDP_SO_RCVBUF=16384,
3368SQUID_DETECT_UDP_SO_RCVBUF=16384)
3369AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3370AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
30a4f2a8 3371
5c51415d 3372dnl Not cached since people are likely to tune this
30a4f2a8 3373AC_MSG_CHECKING(Default TCP send buffer size)
3374AC_TRY_RUN([
8cca06da 3375#include <stdlib.h>
3376#include <stdio.h>
30a4f2a8 3377#include <sys/types.h>
3378#include <sys/socket.h>
3379#include <netinet/in.h>
3380main ()
3381{
635e6242 3382 FILE *fp;
30a4f2a8 3383 int fd,val=0,len=sizeof(int);
3384 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3385 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3386 if (val <= 0) exit(1);
635e6242 3387 fp = fopen("conftestval", "w");
3388 fprintf (fp, "%d\n", val);
30a4f2a8 3389 exit(0);
3390}
3391],
3392SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1c481e00 3393SQUID_TCP_SO_SNDBUF=16384,
3394SQUID_TCP_SO_SNDBUF=16384)
30a4f2a8 3395AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2aa6ca58 3396if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3397 echo "Limiting send buffer size to 32K"
3398 SQUID_TCP_SO_SNDBUF=32768
3399fi
6a9f6389 3400AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
30a4f2a8 3401
5c51415d 3402dnl Not cached since people are likely to tune this
30a4f2a8 3403AC_MSG_CHECKING(Default TCP receive buffer size)
3404AC_TRY_RUN([
8cca06da 3405#include <stdlib.h>
3406#include <stdio.h>
30a4f2a8 3407#include <sys/types.h>
3408#include <sys/socket.h>
3409#include <netinet/in.h>
3410main ()
3411{
635e6242 3412 FILE *fp;
30a4f2a8 3413 int fd,val=0,len=sizeof(int);
3414 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3415 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3416 if (val <= 0) exit(1);
635e6242 3417 fp = fopen("conftestval", "w");
3418 fprintf (fp, "%d\n", val);
30a4f2a8 3419 exit(0);
3420}
3421],
3422SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1c481e00 3423SQUID_TCP_SO_RCVBUF=16384,
3424SQUID_TCP_SO_RCVBUF=16384)
30a4f2a8 3425AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2aa6ca58 3426if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3427 echo "Limiting receive buffer size to 64K"
3428 SQUID_TCP_SO_RCVBUF=65535
3429fi
6a9f6389 3430AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
5c51415d 3431AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
9bc73deb 3432 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
5c51415d 3433 ac_cv_needs_sys_errlist="no",
3434 ac_cv_needs_sys_errlist="yes")
3435)
3436if test "$ac_cv_needs_sys_errlist" = "yes" ; then
6a9f6389 3437 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
5c51415d 3438fi
30a4f2a8 3439
5c51415d 3440dnl Not cached since people are likely to change this
6bf65235 3441AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3442AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3443[AC_MSG_RESULT(yes)
6a9f6389 3444AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
6bf65235 3445AC_MSG_RESULT(no))
3446
a937d5e3 3447AC_MSG_CHECKING(if inet_ntoa() actually works)
3448AC_TRY_RUN([
3449#include <stdlib.h>
3450#include <stdio.h>
3451#include <sys/types.h>
3452#include <netinet/in.h>
3453#include <arpa/inet.h>
3454main ()
3455{
635e6242 3456 FILE *fp;
a937d5e3 3457 struct in_addr in;
3458 in.s_addr = inet_addr("1.2.3.4");
635e6242 3459 fp = fopen("conftestval", "w");
3460 fprintf (fp, "%s\n", inet_ntoa(in));
a937d5e3 3461 exit(0);
3462}
3463],
3464INET_NTOA_RESULT=`cat conftestval`,
3465INET_NTOA_RESULT="broken",
3466INET_NTOA_RESULT="broken")
3467if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3468 AC_MSG_RESULT("yes")
3469else
3470 AC_MSG_RESULT("no")
4b26fae9 3471 case "$host_os" in
3472 mingw|mingw32)
3473 echo "Using Win32 resolver instead."
3474 ;;
f5e5c4cf 3475 *)
4b26fae9 3476 echo "Will use our own inet_ntoa()."
3477 AC_LIBOBJ(inet_ntoa)
3478# echo "WARNING: This looks bad, and probably prevents Squid from working."
3479# echo " If you're on IRIX and using GCC 2.8, you probably need"
3480# echo " to use the IRIX C compiler instead."
3481# sleep 10
3482 ;;
3483 esac
a937d5e3 3484fi
3485
b6a2f15e 3486if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
c68e9c6b 3487AC_MSG_CHECKING(for working statvfs() interface)
3488AC_TRY_COMPILE([
3489#include <stdlib.h>
3490#include <stdio.h>
3491#include <sys/types.h>
3492#include <sys/statvfs.h>
3493],
3494[
3495struct statvfs sfs;
3496sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3497sfs.f_files = sfs.f_ffree = 0;
3498statvfs("/tmp", &sfs);
3499],
3500 ac_cv_func_statvfs=yes,
3501 ac_cv_func_statvfs=no)
3502AC_MSG_RESULT($ac_cv_func_statvfs)
6b8e7481 3503if test "$ac_cv_func_statvfs" = "yes" ; then
6a9f6389 3504 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
b6a2f15e 3505fi
6b8e7481 3506fi
c68e9c6b 3507
cc192b50 3508dnl Detect what resolver fields we have available to use...
3509AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3510AC_TRY_COMPILE([
3511#if HAVE_SYS_TYPES_H
3512#include <sys/types.h>
3513#endif
3514#if HAVE_NETINET_IN_H
3515#include <netinet/in.h>
3516#endif
3517#if HAVE_ARPA_INET_H
3518#include <arpa/inet.h>
3519#endif
3520#if HAVE_ARPA_NAMESER_H
3521#include <arpa/nameser.h>
3522#endif
3523#if HAVE_RESOLV_H
3524#include <resolv.h>
3525#endif
3526],
3527[_res_ext.nsaddr_list[[0]].s_addr;],
3528ac_cv_have_res_ext_nsaddr_list="yes",
3529ac_cv_have_res_ext_nsaddr_list="no"))
3530if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3531 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3532 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3533fi
3534
3535if test "$_SQUID_RES_NSADDR6_LIST" == ""; then
3536AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3537AC_TRY_COMPILE([
3538#if HAVE_SYS_TYPES_H
3539#include <sys/types.h>
3540#endif
3541#if HAVE_NETINET_IN_H
3542#include <netinet/in.h>
3543#endif
3544#if HAVE_ARPA_INET_H
3545#include <arpa/inet.h>
3546#endif
3547#if HAVE_ARPA_NAMESER_H
3548#include <arpa/nameser.h>
3549#endif
3550#if HAVE_RESOLV_H
3551#include <resolv.h>
3552#endif
3553],
3554[_res._u._ext.nsaddrs[[0]]->sin6_addr;],
3555ac_cv_have_res_ext_nsaddrs="yes",
3556ac_cv_have_res_ext_nsaddrs="no"))
3557if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3558 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3559 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3560fi
3561fi
3562
c68e9c6b 3563AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3564AC_TRY_COMPILE([
3565#if HAVE_SYS_TYPES_H
3566#include <sys/types.h>
3567#endif
3568#if HAVE_NETINET_IN_H
3569#include <netinet/in.h>
3570#endif
3571#if HAVE_ARPA_INET_H
3572#include <arpa/inet.h>
3573#endif
3574#if HAVE_ARPA_NAMESER_H
3575#include <arpa/nameser.h>
3576#endif
3577#if HAVE_RESOLV_H
3578#include <resolv.h>
3579#endif
3580],
3581[_res.nsaddr_list[[0]];],
3582ac_cv_have_res_nsaddr_list="yes",
3583ac_cv_have_res_nsaddr_list="no"))
3584if test $ac_cv_have_res_nsaddr_list = "yes" ; then
cc192b50 3585 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3586 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3587fi
3588
cc192b50 3589if test "$_SQUID_RES_NSADDR_LIST" == ""; then
c68e9c6b 3590AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3591AC_TRY_COMPILE([
3592#if HAVE_SYS_TYPES_H
3593#include <sys/types.h>
3594#endif
3595#if HAVE_NETINET_IN_H
3596#include <netinet/in.h>
3597#endif
3598#if HAVE_ARPA_INET_H
3599#include <arpa/inet.h>
3600#endif
3601#if HAVE_ARPA_NAMESER_H
3602#include <arpa/nameser.h>
3603#endif
3604#if HAVE_RESOLV_H
3605#include <resolv.h>
3606#endif
3607],
3608[_res.ns_list[[0]].addr;],
3609ac_cv_have_res_ns_list="yes",
3610ac_cv_have_res_ns_list="no"))
3611if test $ac_cv_have_res_ns_list = "yes" ; then
cc192b50 3612 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3613 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3614fi
3615fi
3616
090089c4 3617dnl Need the debugging version of malloc if available
3618XTRA_OBJS=''
6509a1a0 3619if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 3620 if test -r /usr/lib/debug/malloc.o ; then
3621 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3622 fi
3623 if test -r /usr/lib/debug/mallocmap.o ; then
3624 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3625 fi
3626fi
2bbd722b 3627
090089c4 3628AC_SUBST(XTRA_OBJS)
3629
38fea766 3630if test -z "$XTRA_LIBS"; then
3631 XTRA_LIBS="$LIBS"
0f5a16f8 3632 dnl minor cleanup
3633 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 3634 LIBS=''
3635fi
090089c4 3636AC_SUBST(XTRA_LIBS)
3637
090089c4 3638dnl Clean up after OSF/1 core dump bug
3639rm -f core
3640
6a9f6389 3641AC_CONFIG_FILES([\
a2794549 3642 Makefile \
3643 lib/Makefile \
a2794549 3644 scripts/Makefile \
3645 scripts/RunCache \
3646 scripts/RunAccel \
3647 src/Makefile \
3648 src/fs/Makefile \
3649 src/repl/Makefile \
3650 src/auth/Makefile \
5fa840c3
AR
3651 src/adaptation/Makefile \
3652 src/ICAP/Makefile \
3e7b6055 3653 src/eCAP/Makefile \
a2794549 3654 contrib/Makefile \
3655 snmplib/Makefile \
3656 icons/Makefile \
3657 errors/Makefile \
1077c1b8 3658 test-suite/Makefile \
99db07b3 3659 doc/Makefile \
0c510f3c 3660 helpers/Makefile \
3661 helpers/basic_auth/Makefile \
3662 helpers/basic_auth/LDAP/Makefile \
3663 helpers/basic_auth/MSNT/Makefile \
3664 helpers/basic_auth/NCSA/Makefile \
3665 helpers/basic_auth/PAM/Makefile \
3666 helpers/basic_auth/SMB/Makefile \
6e785d85 3667 helpers/basic_auth/mswin_sspi/Makefile \
0c510f3c 3668 helpers/basic_auth/YP/Makefile \
3669 helpers/basic_auth/getpwnam/Makefile \
3670 helpers/basic_auth/multi-domain-NTLM/Makefile \
3671 helpers/basic_auth/SASL/Makefile \
bcf74be7 3672 helpers/basic_auth/POP3/Makefile \
002d9b03 3673 helpers/basic_auth/DB/Makefile \
d80aac12 3674 helpers/basic_auth/squid_radius_auth/Makefile \
0c510f3c 3675 helpers/digest_auth/Makefile \
3676 helpers/digest_auth/password/Makefile \
55013f9c 3677 helpers/digest_auth/ldap/Makefile \
89f77e43 3678 helpers/digest_auth/eDirectory/Makefile \
0c510f3c 3679 helpers/ntlm_auth/Makefile \
3680 helpers/ntlm_auth/fakeauth/Makefile \
3681 helpers/ntlm_auth/no_check/Makefile \
3682 helpers/ntlm_auth/SMB/Makefile \
3683 helpers/ntlm_auth/SMB/smbval/Makefile \
6e785d85 3684 helpers/ntlm_auth/mswin_sspi/Makefile \
3685 helpers/negotiate_auth/Makefile \
3686 helpers/negotiate_auth/mswin_sspi/Makefile \
3e5d7cdf 3687 helpers/negotiate_auth/squid_kerb_auth/Makefile \
c6588c68 3688 helpers/external_acl/Makefile \
3689 helpers/external_acl/ip_user/Makefile \
3690 helpers/external_acl/ldap_group/Makefile \
74ab8d10 3691 helpers/external_acl/session/Makefile \
c6588c68 3692 helpers/external_acl/unix_group/Makefile \
736a9a4d 3693 helpers/external_acl/wbinfo_group/Makefile \
9e6e0372 3694 helpers/external_acl/mswin_ad_group/Makefile \
94ab55b0 3695 helpers/external_acl/mswin_lm_group/Makefile \
3696 tools/Makefile
53cbe3e4 3697])
43ae1d95 3698
377792e4 3699AC_CONFIG_SUBDIRS(lib/libTrie)
3700
3e7b6055
AR
3701# must configure libltdl subdir unconditionally for "make distcheck" to work
3702AC_CONFIG_SUBDIRS(lib/libLtdl)
3703
3704
6a9f6389 3705AC_OUTPUT