]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
Merge from trunk
[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"
1199 fi
1200])
1201
5cafc1d6 1202dnl Enable IP-Filter Transparent Proxy
1203AC_ARG_ENABLE(ipf-transparent,
1204[ --enable-ipf-transparent
1205 Enable Transparent Proxy support for systems
c68e9c6b 1206 using IP-Filter network address redirection.],
5cafc1d6 1207[ if test "$enableval" = "yes" ; then
1208 echo "IP-Filter Transparent Proxy enabled"
6a9f6389 1209 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 1210 IPF_TRANSPARENT="yes"
1211 fi
1212])
1213
2b0dd4ac 1214dnl Enable PF Transparent Proxy
1215AC_ARG_ENABLE(pf-transparent,
1216[ --enable-pf-transparent
1217 Enable Transparent Proxy support for systems
1218 using PF network address redirection.],
1219[ if test "$enableval" = "yes" ; then
1220 echo "PF Transparent Proxy enabled"
6a9f6389 1221 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
2b0dd4ac 1222 PF_TRANSPARENT="yes"
1223 fi
1224])
1225
d6d62546 1226dnl Enable Linux Netfilter Transparent Proxy
d852fbad 1227AC_ARG_ENABLE(linux-netfilter,
1228[ --enable-linux-netfilter
d6d62546 1229 Enable Transparent Proxy support for Linux (Netfilter) systems.],
d852fbad 1230[ if test "$enableval" = "yes" ; then
d6d62546 1231 echo "Linux (Netfilter) Transparent Proxy enabled"
1232 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
d852fbad 1233 LINUX_NETFILTER="yes"
1234 fi
1235])
1236
bb7b5fd0 1237dnl Enable Large file support
2df6213e 1238buildmodel=""
1239needlargefiles=
1240
1241AC_ARG_WITH(large-files,
3a125142 1242[ --with-large-files Enable support for large files (logs etc).],
2df6213e 1243[ if test "$withval" = yes; then
1244 needlargefiles=1
bb7b5fd0 1245 fi
1246])
1247
2df6213e 1248dnl UNIX Build environment
1249AC_ARG_WITH(build-environment,
1250[ --with-build-environment=model
1251 The build environment to use. Normally one of
1252 POSIX_V6_ILP32_OFF32 32 bits
1253 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1254 POSIX_V6_LP64_OFF64 64 bits
1255 POSIX_V6_LPBIG_OFFBIG large pointers and files
1256 XBS5_ILP32_OFF32 32 bits (legacy)
1257 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1258 XBS5_LP64_OFF64 64 bits (legacy)
1259 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1260 default The default for your OS],
1261[ case "$withval" in
1262 yes|no)
1263 echo "--with-build-environment expects a build environment string as used by getconf"
1264 exit 1
1265 ;;
1266 *)
1267 buildmodel="$withval"
1268 ;;
1269 esac
1270])
1271
1272if test $needlargefiles && test -z "$buildmodel"; then
1273 for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG; do
1274 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1275 buildmodel=$model
1276 break
1277 fi
1278 done
1279 if test -z "$buildmodel"; then
1280 echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
1281 sleep 1
1282 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
cca81db1 1283 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2df6213e 1284 fi
1285fi
1286if test -n "$buildmodel" && test "$buildmodel" != "default"; then
1287 echo "Using $buildmodel build environment"
1288 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1289 : # All fine
1290 else
1291 echo "ERROR: Build environment $buildmodel not known to getconf."
1292 exit 1
1293 fi
1294 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
cca81db1 1295 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2df6213e 1296 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1297 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
63e02610 1298 case "$host" in
2df6213e 1299dnl
1300dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but:
1301dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc
1302dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun
2df6213e 1303 *-solaris*)
1304 if test "$GCC" = "yes"; then
1305 echo "Removing -Xa for gcc on $host"
1306 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
cca81db1 1307 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
2df6213e 1308 fi
2ddacc29 1309 echo "Removing -Usun on $host"
2df6213e 1310 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
cca81db1 1311 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
2df6213e 1312 ;;
63e02610 1313dnl
1314dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1315dnl so we must adjust something to avoid gcc errors.
1316dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1317dnl remove "-n32" from LDFLAGS
1318dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1319dnl "-64" from LDFLAGS
1320 *-sgi-irix6.*)
1321 if test "$GCC" = "yes"; then
1322 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
ff37fe61 1323 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
63e02610 1324 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1325 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
ff37fe61 1326 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
63e02610 1327 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1328 fi
1329 ;;
2df6213e 1330 *)
1331 ;;
1332 esac
1333fi
1334
7b0a0d1f 1335dnl Enable Linux transparent proxy support for obsolete TPROXY
e8cca4ac
AJ
1336AC_ARG_ENABLE(linux-tproxy,
1337[ --enable-linux-tproxy
f1e0717c 1338 Enable real Transparent Proxy support for Netfilter TPROXY (version 2).],
fc68f6b1 1339[ if test "$enableval" = "yes" ; then
f1e0717c
AJ
1340 echo "Linux Netfilter/TPROXY v2 enabled"
1341 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1342 LINUX_TPROXY2="yes"
1343 if test -z "$LINUX_NETFILTER"; then
1344 echo "Linux-Netfilter Transparent Proxy automatically enabled"
1345 LINUX_NETFILTER="yes"
1346 fi
1347 fi
1348])
fc68f6b1 1349
a2794549 1350AM_CONDITIONAL(MAKE_LEAKFINDER, false)
5d620373 1351dnl Enable Leak Finding Functions
1352AC_ARG_ENABLE(leakfinder,
1353[ --enable-leakfinder
1354 Enable Leak Finding code. Enabling this alone
1355 does nothing; you also have to modify the source
1356 code to use the leak finding functions. Probably
1357 Useful for hackers only.],
1358[ if test "$enableval" = "yes" ; then
1359 echo "Leak-Finding enabled"
6a9f6389 1360 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
5d620373 1361 USE_LEAKFINDER="yes"
a2794549 1362 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
5d620373 1363 fi
1364])
5d620373 1365
14b32873 1366use_ident=1
3898f57f 1367AC_ARG_ENABLE(ident-lookups,
1368[ --disable-ident-lookups
1369 This allows you to remove code that performs
1370 Ident (RFC 931) lookups.],
1371[ if test "$enableval" = "no" ; then
1372 echo "Disabling Ident Lookups"
14b32873 1373 use_ident=0
3898f57f 1374 fi
1375])
14b32873 1376if test $use_ident = 1; then
1377 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
8000a965 1378 AM_CONDITIONAL(ENABLE_IDENT, true)
14b32873 1379else
1380 AC_DEFINE(USE_IDENT, 0)
8000a965 1381 AM_CONDITIONAL(ENABLE_IDENT, false)
14b32873 1382fi
3898f57f 1383
a2794549 1384AM_CONDITIONAL(USE_DNSSERVER, false)
3c573763 1385use_dnsserver=
eb824054 1386AC_ARG_ENABLE(internal-dns,
7e3ce7b9 1387[ --disable-internal-dns This prevents Squid from directly sending and
eb824054 1388 receiving DNS messages, and instead enables the
1389 old external 'dnsserver' processes.],
1390[ if test "$enableval" = "no" ; then
1391 echo "Disabling Internal DNS queries"
3c573763 1392 use_dnsserver="yes"
eb824054 1393 fi
1394])
3c573763 1395if test "$use_dnsserver" = "yes"; then
6a9f6389 1396 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
a2794549 1397 AM_CONDITIONAL(USE_DNSSERVER, true)
3c573763 1398fi
eb824054 1399
9d798391 1400dnl Select Default hosts file location
1401AC_ARG_ENABLE(default-hostsfile,
1402[ --enable-default-hostsfile=path
1403 Select default location for hosts file.
1404 See hosts_file directive in squid.conf for details],
1405[
1406 if test "$enableval" != "none" ; then
1407 if test -f $enableval; then
1408 OPT_DEFAULT_HOSTS=$enableval
1409 else
1410 echo "Warning Unable to find $enableval"
1411 sleep 5
1412 fi
1413 else
1414 OPT_DEFAULT_HOSTS="none"
1415 fi
1416 echo "Default hosts file set to: $enableval"
1417],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1418AC_SUBST(OPT_DEFAULT_HOSTS)
1419
94439e4e 1420dnl Select auth schemes modules to build
1421AC_ARG_ENABLE(auth,
1422[ --enable-auth=\"list of auth scheme modules\"
1423 Build support for the list of authentication schemes.
1424 The default is to build support for the Basic scheme.
1425 See src/auth for a list of available modules, or
1426 Programmers Guide section authentication schemes
1427 for details on how to build your custom auth scheme
1428 module],
1429[ case $enableval in
1430 yes)
1c42c4a1 1431 for dir in $srcdir/src/auth/*; do
1432 module="`basename $dir`"
1c690e30 1433 if test -d "$dir" && test "$module" != CVS; then
1c42c4a1 1434 AUTH_MODULES="$AUTH_MODULES $module"
94439e4e 1435 fi
1436 done
1437 ;;
1438 no)
1439 ;;
1c690e30 1440 *)
1441 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1442 ;;
94439e4e 1443 esac
1444],
1445[ if test -z "$AUTH_MODULES"; then
6bf4f823 1446 AUTH_MODULES="ntlm basic digest negotiate"
94439e4e 1447 fi
1448])
1c690e30 1449if test -n "$AUTH_MODULES"; then
1450 for module in $AUTH_MODULES; do
1451 if test -d $srcdir/src/auth/$module; then
1452 :
1453 else
1454 echo "ERROR: Auth scheme $module does not exists"
1455 exit 1
1456 fi
7f18d2bd 1457 eval AUTH_MODULE_${module}=yes
1c690e30 1458 done
1459 echo "Auth scheme modules built: $AUTH_MODULES"
1460 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1461 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
d0571da6 1462else
1463 echo "Auth scheme modules built: None"
1c690e30 1464fi
f5691f9c 1465AUTH_LINKOBJS=
1466for module in $AUTH_MODULES; do
1467 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1468done
94439e4e 1469AC_SUBST(AUTH_MODULES)
94439e4e 1470AC_SUBST(AUTH_LIBS)
f5691f9c 1471AC_SUBST(AUTH_LINKOBJS)
1472AC_SUBST(AUTH_OBJS)
94439e4e 1473
1474dnl Select basic auth scheme helpers to build
7f18d2bd 1475if test -n "$AUTH_MODULE_basic"; then
1476 BASIC_AUTH_HELPERS="all"
1477fi
94439e4e 1478AC_ARG_ENABLE(basic-auth-helpers,
1479[ --enable-basic-auth-helpers=\"list of helpers\"
1480 This option selects which basic scheme proxy_auth
1481 helpers to build and install as part of the normal
1482 build process. For a list of available
0c510f3c 1483 helpers see the helpers/basic_auth directory.],
94439e4e 1484[ case "$enableval" in
7f18d2bd 1485 yes)
1486 BASIC_AUTH_HELPERS="all"
1c690e30 1487 ;;
94439e4e 1488 no)
7f18d2bd 1489 BASIC_AUTH_HELPERS=""
1c690e30 1490 ;;
94439e4e 1491 *)
7f18d2bd 1492 if test -z "$AUTH_MODULE_basic"; then
1493 echo "WARNING: Basic auth helpers selected without the basic scheme enabled"
1494 sleep 15
1495 fi
1c690e30 1496 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1497 ;;
94439e4e 1498 esac
1499])
7f18d2bd 1500if test "$BASIC_AUTH_HELPERS" = "all" ; then
1501 BASIC_AUTH_HELPERS=""
1502 for dir in $srcdir/helpers/basic_auth/*; do
1503 helper="`basename $dir`"
1504 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1505 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1506 fi
1507 done
1508fi
fc83a946 1509if test -n "$BASIC_AUTH_HELPERS"; then
20d8bfe4 1510 for helper in $BASIC_AUTH_HELPERS; do
1c690e30 1511 if test -d $srcdir/helpers/basic_auth/$helper; then
2adff954 1512 case $helper in
1513 SASL)
1514 require_sasl=yes
1515 ;;
1516 esac
20d8bfe4 1517 else
1c690e30 1518 echo "ERROR: Basic auth helper $helper does not exists"
1519 exit 1
20d8bfe4 1520 fi
1521 done
fc83a946 1522 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
94439e4e 1523fi
fc83a946 1524AC_SUBST(BASIC_AUTH_HELPERS)
94439e4e 1525
1526dnl Select ntlm auth helpers to build
7f18d2bd 1527if test -n "$AUTH_MODULE_ntlm"; then
1528 NTLM_AUTH_HELPERS="all"
1529fi
94439e4e 1530AC_ARG_ENABLE(ntlm-auth-helpers,
1531[ --enable-ntlm-auth-helpers=\"list of helpers\"
1532 This option selects which proxy_auth ntlm helpers
1533 to build and install as part of the normal build
0c510f3c 1534 process. For a list of available helpers see
1535 the helpers/ntlm_auth directory.],
380f0a87 1536[ case "$enableval" in
1537 yes)
7f18d2bd 1538 NTLM_AUTH_HELPERS="all"
1c690e30 1539 ;;
380f0a87 1540 no)
7f18d2bd 1541 NTLM_AUTH_HELPERS=""
1c690e30 1542 ;;
380f0a87 1543 *)
1c690e30 1544 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1545 ;;
380f0a87 1546 esac
1547])
7f18d2bd 1548if test "$NTLM_AUTH_HELPERS" = "all" ; then
1549 NTLM_AUTH_HELPERS=""
1550 for dir in $srcdir/helpers/ntlm_auth/*; do
1551 helper="`basename $dir`"
1552 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1553 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1554 fi
1555 done
1556fi
94439e4e 1557if test -n "$NTLM_AUTH_HELPERS"; then
20d8bfe4 1558 for helper in $NTLM_AUTH_HELPERS; do
1c690e30 1559 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1560 :
20d8bfe4 1561 else
1c690e30 1562 echo "ERROR: NTLM Auth helper $helper does not exists"
1563 exit 1
20d8bfe4 1564 fi
1565 done
94439e4e 1566 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
380f0a87 1567fi
94439e4e 1568AC_SUBST(NTLM_AUTH_HELPERS)
1569
6e785d85 1570dnl Select negotiate auth helpers to build
7f18d2bd 1571if test -n "$AUTH_MODULE_negotiate"; then
1572 NEGOTIATE_AUTH_HELPERS="all"
1573fi
6e785d85 1574AC_ARG_ENABLE(negotiate-auth-helpers,
1575[ --enable-negotiate-auth-helpers=\"list of helpers\"
1576 This option selects which proxy_auth negotiate helpers
1577 to build and install as part of the normal build
1578 process. For a list of available helpers see
1579 the helpers/negotiate_auth directory.],
1580[ case "$enableval" in
1581 yes)
7f18d2bd 1582 NEGOTIATE_AUTH_HELPERS="all"
6e785d85 1583 ;;
1584 no)
7f18d2bd 1585 NEGOTIATE_AUTH_HELPERS=""
6e785d85 1586 ;;
1587 *)
1588 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1589 ;;
1590 esac
1591])
7f18d2bd 1592if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1593 NEGOTIATE_AUTH_HELPERS=""
1594 for dir in $srcdir/helpers/negotiate_auth/*; do
1595 helper="`basename $dir`"
1596 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1597 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1598 fi
1599 done
1600fi
6e785d85 1601if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1602 for helper in $NEGOTIATE_AUTH_HELPERS; do
1603 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1604 :
1605 else
1606 echo "ERROR: Negotiate Auth helper $helper does not exists"
1607 exit 1
1608 fi
1609 done
1610 echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
1611fi
1612AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1613
2d70df72 1614dnl Select digest auth scheme helpers to build
7f18d2bd 1615if test -n "$AUTH_MODULE_digest"; then
1616 DIGEST_AUTH_HELPERS=all
1617fi
2d70df72 1618AC_ARG_ENABLE(digest-auth-helpers,
1619[ --enable-digest-auth-helpers=\"list of helpers\"
1620 This option selects which digest scheme authentication
1621 helpers to build and install as part of the normal build
0c510f3c 1622 process. For a list of available helpers see the
1623 helpers/digest_auth directory.],
2d70df72 1624[ case "$enableval" in
1625 yes)
7f18d2bd 1626 DIGEST_AUTH_HELPERS="all"
1c690e30 1627 ;;
2d70df72 1628 no)
7f18d2bd 1629 DIGEST_AUTH_HELPERS=""
1c690e30 1630 ;;
2d70df72 1631 *)
1c690e30 1632 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1633 ;;
2d70df72 1634 esac
1635])
7f18d2bd 1636if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1637 DIGEST_AUTH_HELPERS=""
1638 for dir in $srcdir/helpers/digest_auth/*; do
1639 helper="`basename $dir`"
1640 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1641 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1642 fi
1643 done
1644fi
2d70df72 1645if test -n "$DIGEST_AUTH_HELPERS"; then
1daefc1a 1646 for helper in $DIGEST_AUTH_HELPERS; do
1647 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1648 :
1649 else
1650 echo "ERROR: digest auth helper $helper does not exists"
1651 exit 1
1652 fi
1653 done
2d70df72 1654 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1655fi
1656AC_SUBST(DIGEST_AUTH_HELPERS)
380f0a87 1657
6437ac71 1658dnl Enable "NTLM fail open"
1659AC_ARG_ENABLE(ntlm-fail-open,
1660[ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
0961c811 1661 Authentication steps can allow squid to still authenticate
1662 the user.],
6437ac71 1663[ if test "$enableval" = "yes" ; then
6a9f6389 1664 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 1665 fi
1666])
1667
c6588c68 1668dnl Select external_acl helpers to build
7f18d2bd 1669EXTERNAL_ACL_HELPERS=all
c6588c68 1670AC_ARG_ENABLE(external-acl-helpers,
1671[ --enable-external-acl-helpers=\"list of helpers\"
1672 This option selects which external_acl helpers to
1673 build and install as part of the normal build
1674 process. For a list of available helpers see the
1675 helpers/external_acl directory.],
1676[ case "$enableval" in
1677 yes)
7f18d2bd 1678 EXTERNAL_ACL_HELPERS=all
1c690e30 1679 ;;
c6588c68 1680 no)
7f18d2bd 1681 EXTERNAL_ACL_HELPERS=""
1c690e30 1682 ;;
c6588c68 1683 *)
1c690e30 1684 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1685 ;;
c6588c68 1686 esac
1687])
7f18d2bd 1688if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
39ee7289 1689 EXTERNAL_ACL_HELPERS=""
7f18d2bd 1690 for dir in $srcdir/helpers/external_acl/*; do
1691 helper="`basename $dir`"
1692 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1693 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1694 fi
1695 done
1696fi
c6588c68 1697if test -n "$EXTERNAL_ACL_HELPERS"; then
20d8bfe4 1698 for helper in $EXTERNAL_ACL_HELPERS; do
1699 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1700 :
1701 else
1daefc1a 1702 echo "ERROR: external acl helper $helper does not exists"
20d8bfe4 1703 exit 1
1704 fi
1705 done
c6588c68 1706 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1707fi
1708AC_SUBST(EXTERNAL_ACL_HELPERS)
1709
3a125142 1710AC_ARG_WITH(valgrind-debug,
1711[ --with-valgrind-debug Include debug instrumentation for use with valgrind],
b4bab919 1712[ case $withval in
1713 yes)
1714 valgrind=1
1715 ;;
1716 no)
1717 valgrind=
1718 ;;
1719 *)
1720 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1721 valgrind=1
1722 ;;
1723 esac
1724 if test $valgrind; then
1725 AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
1726 echo "Valgrind debug support enabled"
1727 fi
1728])
1729
d96ceb8e 1730dnl Disable "memPools" code
1731AC_ARG_ENABLE(mempools,
b001e822 1732[ --disable-mempools Disable memPools. Note that this option now simply sets the
2df6213e 1733 default behaviour. Specific classes can override this at runtime, and
1734 only lib/MemPool.c needs to be altered to change the squid-wide
1735 default for all classes.],
d96ceb8e 1736[ if test "$enableval" = "no" ; then
1737 echo "memPools disabled"
6a9f6389 1738 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
3e0dc9a8 1739 else
1740 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 1741 fi
3e0dc9a8 1742],
1743[ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 1744])
1745
0e657244 1746dnl Enable WIN32 Service compile mode
1747AC_ARG_ENABLE(win32-service,
1748[ --enable-win32-service Compile Squid as a WIN32 Service
1749 Works only on Windows NT and Windows 2000 Platforms.],
1750[ if test "$enableval" = "yes" ; then
1751 echo "Enabling WIN32 run service mode"
1752 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1753 fi
1754])
1755
b1485ff8 1756
2adff954 1757dnl Check for Cyrus SASL
1758if test "$require_sasl" = "yes"; then
1759 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1760 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
1761 echo "using SASL2"
1762 LIBSASL="-lsasl2"
1763 else
1764 if test "$ac_cv_header_sasl_h" = "yes"; then
1765 echo "using SASL"
1766 LIBSASL="-lsasl"
1767 else
1768 echo "ERROR: Neither SASL nor SASL2 found"
1769 exit 1
1770 fi
1771 fi
1772 AC_SUBST(LIBSASL)
1773fi
1774
3c573763 1775dnl Disable "unlinkd" code
fe0810ac 1776AC_ARG_ENABLE(unlinkd,
1777[ --disable-unlinkd Do not use unlinkd],
1778[ if test "$enableval" = "no" ; then
3c573763 1779 use_unlinkd=no
fe0810ac 1780 else
3c573763 1781 use_unlinkd=yes
fe0810ac 1782 fi
1783],[
1784 # Here we should probably use some magic depending on the selected
1785 # storage models
3c573763 1786 use_unlinkd=yes
fe0810ac 1787])
3c573763 1788if test "$use_unlinkd" = "yes"; then
fe0810ac 1789 echo "unlinkd enabled"
6a9f6389 1790 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
a2794549 1791 AM_CONDITIONAL(ENABLE_UNLINKD, true)
fe0810ac 1792else
1793 echo "unlinkd disabled"
a2794549 1794 AM_CONDITIONAL(ENABLE_UNLINKD, false)
fe0810ac 1795fi
fe0810ac 1796
ce3d30fb 1797dnl Enable backtraces on fatal errors
1798AC_ARG_ENABLE(stacktraces,
1799[ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1800[ if test "$enableval" = "yes" ; then
1801 echo "Enabling automatic stack backtraces on fatal errors"
6a9f6389 1802 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
ce3d30fb 1803 fi
1804])
1805
88bfe092 1806AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1807dnl Enable USE_XPROF_STATS
1808AC_ARG_ENABLE(cpu-profiling,
1809[ --enable-cpu-profiling
1810 This option allows you to see which internal functions
1811 in Squid are consuming how much CPU. Compiles in probes
1812 that measure time spent in probed functions. Needs
1813 source modifications to add new probes. This is meant
1814 for developers to assist in performance optimisations
1815 of Squid internal functions.
1816 If you are not developer and not interested in the stats
1817 you shouldn't enable this, as overhead added, although
1818 small, is still overhead. See lib/Profiler.c for more.
1819 ],
1820[ if test "$enableval" = "yes" ; then
1821 echo "Enabling cpu-profiling"
6a9f6389 1822 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
88bfe092 1823 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1824 fi
1825])
1826
f66a9ef4 1827dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1828AC_ARG_ENABLE(x_accelerator_vary,
0961c811 1829[ --enable-x-accelerator-vary
1830 Enable support for the X-Accelerator-Vary
1831 HTTP header. Can be used to indicate
1832 variance within an accelerator setup.
1833 Typically used together with other code
1834 that adds custom HTTP headers to the requests.],
f66a9ef4 1835[ if test "$enableval" = "yes" ; then
1836 echo "Enabling support for X-Accelerator-Vary"
6a9f6389 1837 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
f66a9ef4 1838 fi
1839])
1840
cc192b50 1841dnl Enable IPv6 support
1842AC_MSG_CHECKING([whether to enable IPv6])
1843AC_ARG_ENABLE(ipv6,
1844[ --enable-ipv6 Enable ipv6 support],
1845[ AC_MSG_RESULT(yes)
1846 AC_CACHE_CHECK([if PF_INET6 is available], $enableval,
1847 AC_TRY_RUN(
1848 [ /* PF_INET6 available check */
1849# include <sys/types.h>
1850# include <sys/socket.h>
1851 void main() {
1852 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
1853 exit(1);
1854 else
1855 exit(0);
1856 }
1857 ],
1858 [ AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
1859 AC_MSG_RESULT(yes)
1860 ],
1861 [ AC_DEFINE(USE_IPV6,0,[0 == Disable support for IPv6])
1862 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[0 == Disable support for Split-Stack IPv6 Implementations])
1863 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[0 == Keep IPv4 and IPv6 Localhosts seperate.])
1864 AC_DEFINE(IPV6_SPECIAL_V4MAPPING,0,[0 == Leave all v4-mapping to OS Implementation])
1865 AC_MSG_RESULT(no)
1866 ])
1867 )
1868],
1869[ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6])
1870 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[ 0 == Disable support for Split-Stack IPv6 Implementations])
1871 AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[ 0 == Keep IPv4 and IPv6 Localhosts seperate.])
1872 AC_DEFINE(IPV6_SPECIAL_V4MAPPING,0,[ 0 == Leave v4-mapping to OS Implementation])
1873 AC_MSG_RESULT(no)
1874])
1875if test $ac_cv_enable_ipv6 ; then
1876dnl Check for Windows XP option
1877AC_MSG_CHECKING([for IPv6 split-stack requirement])
1878AC_ARG_WITH(ipv6-split-stack,
1879 [ --with-ipv6-split-stack Require IPv6 split-stack support (Requires IPv6 Support)],
1880 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [ 1 == Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(yes)],
1881 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [ 0 == Disable support for split-stack IPv6 implementations]) AC_MSG_RESULT(no)]
1882)
1883
1884dnl Check for IPv6 Windows Vista option
1885AC_MSG_CHECKING([for IPv6 v4-mapping requirement])
1886AC_ARG_WITH(ipv4-mapped,
1887 [ --with-ipv4-mapped Hybrid-Stack OS require Squid to do any v4-mapping (Requires IPv6 Support)],
1888 [AC_DEFINE(IPV6_SPECIAL_V4MAPPING, 1, [ 1 == Perform v4-mapping internally]) AC_MSG_RESULT(yes)],
1889 [AC_DEFINE(IPV6_SPECIAL_V4MAPPING, 0, [ 0 == Leave all v4-mapping to the OS]) AC_MSG_RESULT(no)]
1890)
1891
1892dnl Check for IPv6-pure option
1893AC_MSG_CHECKING([for IPv6-Localhost requirement])
1894AC_ARG_WITH(localhost-ipv6,
1895 [ --with-localhost-ipv6 Prefer IPv6 localhost address over IPv4 (Requires IPv6 Support).
1896 Treats 127.0.0.1 and ::1 as identical and converts all inputs of to ::1
1897 This depends on Dual-Stack support in the OS and all applications
1898 squid contacts via localhost being IPv6 enabled.
1899 Default: OFF. Treats these two IP as different, squid.conf must
1900 define both 127.0.0.1 and ::1 for the localhost ACL, etc. ],
1901 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [ 1 == Convert IPv4-localhost requests to IPv6.]) AC_MSG_RESULT(yes)],
1902 [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [ 0 == Keep IPv4 and IPv6 Localhosts seperate.]) AC_MSG_RESULT(no)]
1903)
1904# end IPv6-only options
1905fi
1906
bae9832d 1907dnl Optional CNAME-Recursion by Internal DNS engine
1908AC_MSG_CHECKING([whether DNS CNAME recursion wanted])
1909AC_ARG_WITH(dns-cname,
1910 [ --with-dns-cname Enable CNAME-Recursion in Internal DNS stub.],
1911 [AC_DEFINE(DNS_CNAME, 1, [ 1 == Enable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(yes)],
1912 [AC_DEFINE(DNS_CNAME, 0, [ 0 == Disable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(no)]
1913)
1914
8c37ea44
AJ
1915dnl Check whether this OS defines ss_len as a member of sockaddr_storage
1916AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
1917 ac_cv_have_ss_len_in_struct_ss, [
1918 AC_TRY_COMPILE([
1919#include <sys/types.h>
1920#include <sys/socket.h>
cda4116f 1921#include <netinet/in.h>
8c37ea44
AJ
1922 ],
1923 [ struct sockaddr_storage s; s.ss_len = 1; ],
1924 [ ac_cv_have_ss_len_in_struct_ss="yes" ],
1925 [ ac_cv_have_ss_len_in_struct_ss="no" ]
1926 )
1927])
1928if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
1929 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
1930else
1931 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
1932fi
1933
1934dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
1935AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
1936 ac_cv_have_sin_len_in_struct_sai, [
1937 AC_TRY_COMPILE([
1938#include <sys/types.h>
1939#include <sys/socket.h>
1940 ],
1941 [ struct sockaddr_in s; s.sin_len = 1; ],
1942 [ ac_cv_have_sin_len_in_struct_sai="yes" ],
1943 [ ac_cv_have_sin_len_in_struct_sai="no" ]
1944 )
1945])
1946if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
1947 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
1948else
1949 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
1950fi
1951
1952dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
1953AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
1954 ac_cv_have_sin6_len_in_struct_sai, [
1955 AC_TRY_COMPILE([
1956#include <sys/types.h>
1957#include <sys/socket.h>
1958 ],
1959 [ struct sockaddr_in6 s; s.sin6_len = 1; ],
1960 [ ac_cv_have_sin6_len_in_struct_sai="yes" ],
1961 [ ac_cv_have_sin6_len_in_struct_sai="no" ]
1962 )
1963])
1964if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
1965 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
1966else
1967 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
1968fi
1969
bae9832d 1970
f49be7d1 1971AC_ARG_WITH(filedescriptors,
f5e5c4cf 1972[ --with-filedescriptors=NUMBER
1973 Force squid to support NUMBER filedescriptors],
f49be7d1 1974[ squid_filedescriptors_num=$withval ])
1975
8b5e106b 1976AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
1977if $CPPUNITCONFIG --help >/dev/null; then
f5691f9c 1978 echo "using system installed cppunit"
8b5e106b 1979 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
1980 SQUID_CPPUNIT_LA=''
1981 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
1982else
f646b959 1983 echo "cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail."
63d03edb 1984 SQUID_CPPUNIT_LA=''
1985 SQUID_CPPUNIT_LIBS=''
1986 SQUID_CPPUNIT_INC=''
f5691f9c 1987fi
8b5e106b 1988
f5691f9c 1989AC_ARG_WITH(cppunit-basedir,
1990[ --with-cppunit-basedir=/path/to/cppunit-base
1991 Path where the cppunit headers are libraries are found
63d03edb 1992 for unit testing.
f5691f9c 1993 ],
1994[ if test -f $withval/include/cppunit/TestCase.h; then
1995 echo "Using cppunit includes from $withval"
1996 SQUID_CPPUNIT_INC="-I${withval}/include"
1997 else
1998 echo "ERROR: Cannot find cppunit at $withval"
1999 exit 1
2000 fi
2001 if test -f $withval/lib/libcppunit.la; then
2002 echo "Using cppunit lib from $withval"
549b1e60 2003 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
8b5e106b 2004 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
f5691f9c 2005 else
2006 echo "ERROR: Cannot find cppunit at $withval"
2007 exit 1
2008 fi
f5691f9c 2009])
8b5e106b 2010AC_SUBST(SQUID_CPPUNIT_LIBS)
f5691f9c 2011AC_SUBST(SQUID_CPPUNIT_LA)
2012AC_SUBST(SQUID_CPPUNIT_INC)
f5691f9c 2013
fd9aaa3e 2014# Force some compilers to use ANSI features
2015#
2016case "$host" in
2017 alpha-dec-osf*)
2018 if test "$ac_cv_prog_CC" = "cc" ; then
2019 echo "adding '-std1' to cc args for $host"
2020 CC="cc -std1";
2021 ac_cv_prog_CC="$CC"
2022 fi
2023 ;;
c68e9c6b 2024 *-hp-hpux*)
2025 if test "$ac_cv_prog_CC" = "cc" ; then
2026 echo "adding '-Ae' to cc args for $host"
2027 CC="cc -Ae";
2028 ac_cv_prog_CC="$CC"
2029 fi
2030 ;;
fd9aaa3e 2031esac
2032
090089c4 2033dnl Check for programs
2034AC_PROG_CPP
2035AC_PROG_INSTALL
090089c4 2036AC_PROG_LN_S
81280a96 2037AC_PATH_PROG(SH, sh, /bin/sh)
d9f67e6f 2038AC_PATH_PROG(FALSE, false, /usr/bin/false)
2039AC_PATH_PROG(TRUE, true, /usr/bin/true)
2040AC_PATH_PROG(RM, rm, $FALSE)
2041AC_PATH_PROG(MV, mv, $FALSE)
2042AC_PATH_PROG(MKDIR, mkdir, $FALSE)
090089c4 2043AC_PATH_PROG(LN, ln, cp)
4e9d8e26 2044AC_PATH_PROG(PERL, perl, none)
a2794549 2045dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
6ad85e8a 2046AC_PATH_PROG(AR, ar, $FALSE)
2047
4e9d8e26 2048if test "$ac_cv_path_PERL" = "none"; then
2049 echo "Perl is required to compile Squid"
2050 echo "Please install Perl and then re-run configure"
2051 exit 1
2052fi
2053
6ad85e8a 2054case "$host" in
2055 *-hp-hpux*)
2056 echo "Disabling 'ranlib' for HP-UX..."
2057 RANLIB=":"
2058 ;;
2059esac
2060
2061dnl set $(AR)
2062AR_R="$AR r"
2063case "$host" in
2064 *-next-nextstep3)
2065 AR="libtool -o"
2066 ;;
2067esac
2068AC_SUBST(AR_R)
090089c4 2069
2070dnl Check for headers
2071AC_HEADER_DIRENT
2072AC_HEADER_STDC
db40ae20 2073
2074AC_CHECK_HEADERS( \
db40ae20 2075 arpa/inet.h \
30a4f2a8 2076 arpa/nameser.h \
9441aa34 2077 assert.h \
db40ae20 2078 bstring.h \
db40ae20 2079 crypt.h \
30a4f2a8 2080 ctype.h \
2081 errno.h \
ce3d30fb 2082 execinfo.h \
db40ae20 2083 fcntl.h \
42ad37af 2084 fnmatch.h \
9c1d8929 2085 getopt.h \
52303a3d 2086 glob.h \
88738790 2087 gnumalloc.h \
30a4f2a8 2088 grp.h \
5cafc1d6 2089 ip_compat.h \
42b51993 2090 ip_fil_compat.h \
5cafc1d6 2091 ip_fil.h \
2092 ip_nat.h \
dbc5782a 2093 ipl.h \
30a4f2a8 2094 libc.h \
6ad85e8a 2095 limits.h \
30a4f2a8 2096 malloc.h \
e0bddc45 2097 math.h \
db40ae20 2098 memory.h \
b075cbb1 2099 mount.h \
e9e7c285 2100 net/if.h \
2b0dd4ac 2101 net/pfvar.h \
30a4f2a8 2102 netdb.h \
db40ae20 2103 netinet/in.h \
cc192b50 2104 netinet/icmp6.h \
2105 netinet/in_systm.h \
2106 netinet/ip.h \
2107 netinet/ip6.h \
2108 netinet/ip_icmp.h \
42b51993 2109 netinet/ip_fil_compat.h \
1f7c9178 2110 openssl/err.h \
2111 openssl/md5.h \
2112 openssl/ssl.h \
cc192b50 2113 netinet/tcp.h \
a7ad6e4e 2114 openssl/engine.h \
4da086c4 2115 paths.h \
dcfe6390 2116 poll.h \
30a4f2a8 2117 pwd.h \
b5e4d7d4 2118 shadow.h \
30a4f2a8 2119 regex.h \
c68e9c6b 2120 sched.h \
30a4f2a8 2121 signal.h \
2122 stdarg.h \
2123 stddef.h \
2124 stdio.h \
db40ae20 2125 stdlib.h \
2126 string.h \
2127 strings.h \
0a4e8536 2128 sys/bitypes.h \
f9576890 2129 sys/bswap.h \
2130 sys/endian.h \
db40ae20 2131 sys/file.h \
5cafc1d6 2132 sys/ioctl.h \
30a4f2a8 2133 sys/param.h \
62ae0622 2134 sys/prctl.h \
3d4022fa 2135 sys/md5.h \
77e4c0c9 2136 sys/msg.h \
30a4f2a8 2137 sys/resource.h \
db40ae20 2138 sys/select.h\
30a4f2a8 2139 sys/socket.h \
2140 sys/stat.h \
b075cbb1 2141 sys/statvfs.h \
3c641669 2142 syscall.h \
30a4f2a8 2143 sys/syscall.h \
db40ae20 2144 sys/time.h \
2145 sys/types.h \
30a4f2a8 2146 sys/un.h \
b075cbb1 2147 sys/vfs.h \
30a4f2a8 2148 sys/wait.h \
db40ae20 2149 syslog.h \
30a4f2a8 2150 time.h \
2151 unistd.h \
3c641669 2152 utime.h \
30a4f2a8 2153 varargs.h \
77d6bd88 2154 byteswap.h \
2155 glib.h \
60d096f4 2156 stdint.h \
2157 inttypes.h \
3c641669 2158 grp.h \
2159 nss_common.h \
94331f58 2160 nss.h \
2161 db.h \
329ce686 2162 db_185.h \
2163 sys/capability.h
db40ae20 2164)
2165
fc68f6b1 2166AC_CHECK_HEADERS(
2167 linux/netfilter_ipv4.h \
2168 linux/netfilter_ipv4/ip_tproxy.h \
2169,,,
dcd1dc78 2170SQUID_DEFAULT_INCLUDES
2171#if HAVE_LIMITS_H
2172#include <limits.h>
2173#endif
2174)
2175
5a3237b0 2176AC_CHECK_HEADERS(net/if.h \
2177 netinet/if_ether.h\
2178 netinet/ip_compat.h\
2179 netinet/ip_fil.h\
77e4c0c9 2180 netinet/ip_nat.h\
dbc5782a 2181 netinet/ipl.h \
77e4c0c9 2182 sys/mount.h\
2183 resolv.h,,,SQUID_BSDNET_INCLUDES)
5a3237b0 2184
a1559187 2185AC_CHECK_HEADERS([libxml/parser.h], [], [
2186 SAVED_CPPFLAGS="$CPPFLAGS"
2187 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2188 unset ac_cv_header_libxml_parser_h
2189 AC_CHECK_HEADERS([libxml/parser.h], [], [
2190 CPPFLAGS="$SAVED_CPPFLAGS"
2191 ])
2192 ])
2193
aee0606f 2194AC_C_CONST
d57288d2 2195AC_C_BIGENDIAN
aee0606f 2196
6a9f6389 2197AC_STRUCT_TM
2198AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2199#if TM_IN_SYS_TIME
2200#if HAVE_SYS_TIME_H
2201#include <sys/time.h>
2202#endif
2203#elif HAVE_TIME_H
2204#include <time.h>
2205#endif
5c51415d 2206])
46c883ed 2207
6a9f6389 2208AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2209#if HAVE_SYS_TYPES_H
2210#include <sys/types.h>
2211#endif
eb824054 2212#if HAVE_MALLOC_H
2213#include <malloc.h>
6a9f6389 2214#endif])
eb824054 2215
6a9f6389 2216AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2217#if HAVE_SYS_TYPES_H
2218#include <sys/types.h>
2219#endif
2220#if HAVE_MALLOC_H
2221#include <malloc.h>
2222#endif])
090089c4 2223
08caf8c6 2224dnl Override rusage() detect on MinGW because is emulated in source code
2225case "$host_os" in
2226 mingw|mingw32)
2227 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2228 ac_cv_func_getrusage='yes'
d750d7bf 2229 echo "Using own rusage on Windows."
08caf8c6 2230 ;;
2231 *)
2232 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
8ff51bba 2233#if HAVE_SYS_TIME_H
2234#include <sys/time.h>
2235#endif
b54a6789 2236#if HAVE_SYS_RESOURCE_H
2237#include <sys/resource.h>
6a9f6389 2238#endif])
08caf8c6 2239 ;;
2240esac
b54a6789 2241
6a9f6389 2242AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2243#if HAVE_SYS_TYPES_H
2244#include <sys/types.h>
2245#endif
a025a745 2246#include <netinet/in.h>
2247#include <netinet/in_systm.h>
6ad85e8a 2248#include <netinet/ip.h>
b05490a8 2249#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 2250#define ip_hl ihl
2251#endif
2252#ifndef __linux__
b05490a8 2253#ifndef __CYGWIN__
6ad85e8a 2254#define iphdr ip
b05490a8 2255#endif
6a9f6389 2256#endif])
a025a745 2257
090089c4 2258dnl Check for typedefs
77d6bd88 2259AC_CHECK_SIZEOF(void *)
090089c4 2260
0409a509 2261dnl 8 bit integers - int8_t
2262dnl if this is defined we trust it to be 8 bits
2263AC_CHECK_TYPE(int8_t,[
2264 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2265 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2266 ],,SQUID_DEFAULT_INCLUDES)
2267
2268dnl fallback #1
2269AC_CHECK_TYPE(char,[
2270 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2271 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2272 ],,SQUID_DEFAULT_INCLUDES)
2273
2274dnl unsigned 8 bit ints - u_int8_t
2275dnl if this is defined we trust it to be 8 bits
2276AC_CHECK_TYPE(u_int8_t,[
2277 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2278 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2279 ],,SQUID_DEFAULT_INCLUDES)
2280
2281dnl fallback #1
2282dnl if this is defined we trust it to be 8 bits
2283AC_CHECK_TYPE(uint8_t,[
2284 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2285 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2286 ],,SQUID_DEFAULT_INCLUDES)
2287
2288dnl 16 bit integers - int16_t
6a9f6389 2289dnl if this is defined we trust it to be 16 bits
62266438 2290AC_CHECK_TYPE(int16_t,[
2291 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2292 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2293 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2294
2295dnl fallback #1
2296AC_CHECK_TYPE(short,[
856e69c5 2297 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2298 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2299 ],,SQUID_DEFAULT_INCLUDES)
2300
2301dnl fallback #2
2302AC_CHECK_TYPE(int,[
856e69c5 2303 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2304 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2305 ],,SQUID_DEFAULT_INCLUDES)
2306
2307dnl unsigned 16 bit ints - u_int16_t
2308dnl if this is defined we trust it to be 16 bits
62266438 2309AC_CHECK_TYPE(u_int16_t,[
2310 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2311 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2312 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2313
2314dnl fallback #1
2315dnl if this is defined we trust it to be 16 bits
62266438 2316AC_CHECK_TYPE(uint16_t,[
2317 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2318 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2319 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2320
2321dnl 32 bit signed int - int32_t
2322dnl if this is defined we trust it to be 32 bits
62266438 2323AC_CHECK_TYPE(int32_t,[
2324 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2325 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2326 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2327
2328dnl fallback #1
2329AC_CHECK_TYPE(long,[
856e69c5 2330 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2331 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2332 ],,SQUID_DEFAULT_INCLUDES)
2333
2334dnl 32 bit unsigned int - u_int32_t
2335dnl if this is defined we trust it to be 32 bits
62266438 2336AC_CHECK_TYPE(u_int32_t,[
2337 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2338 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2339 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2340
2341dnl fallback #1
2342dnl if this is defined we trust it to be 32 bits
62266438 2343AC_CHECK_TYPE(uint32_t,[
2344 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2345 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2346 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2347
2348dnl 64 bit signed - int64_t
2349dnl if this is defind we trust it to be 64 bits
62266438 2350AC_CHECK_TYPE(int64_t,[
2351 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2352 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2353 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2354
2355dnl fallback #1
2356dnl if this is defind we trust it to be 64 bits
62266438 2357AC_CHECK_TYPE(__int64,[
2358 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2359 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2360 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2361
2362dnl fallback #2
2363AC_CHECK_TYPE(long long,[
856e69c5 2364 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2365 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2366 ],,SQUID_DEFAULT_INCLUDES)
2367
2368dnl 64 bit unsigned - u_int64_t
2369dnl if this is defind we trust it to be 64 bits
62266438 2370AC_CHECK_TYPE(u_int64_t,[
2371 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2372 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2373 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2374
2375dnl fallback #1
2376dnl if this is defind we trust it to be 64 bits
62266438 2377AC_CHECK_TYPE(uint64_t,[
2378 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2379 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2380 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2381
588e71df 2382dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2383dnl that is incompatible with the updated Solaris header files.
2384dnl For this reason, we must check if pad128_t and upad128_t are defined.
2385AC_CHECK_TYPE(pad128_t,
2386 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2387 ,SQUID_DEFAULT_INCLUDES)
2388
2389AC_CHECK_TYPE(upad128_t,
2390 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2391 ,SQUID_DEFAULT_INCLUDES)
2392
6a9f6389 2393AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2394AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2395 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2396AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2397AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2398 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2399AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2400AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
adcceb47 2401
77d6bd88 2402dnl Check for special functions
2403AC_FUNC_ALLOCA
2404
6a9f6389 2405AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2406#include <sys/types.h>
6637e3a5 2407#include <sys/socket.h>
2408#if STDC_HEADERS
2409#include <stdlib.h>
2410#include <stddef.h>
6a9f6389 2411#endif])
6637e3a5 2412
6a9f6389 2413AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
aea1be68 2414#include <sys/ipc.h>
6a9f6389 2415#include <sys/msg.h>])
aea1be68 2416
090089c4 2417dnl Check for needed libraries
30a4f2a8 2418AC_CHECK_LIB(nsl, main)
6716b242 2419AC_CHECK_LIB(socket, main)
4b26fae9 2420case "$host_os" in
2421 mingw|mingw32)
2422 AC_MSG_CHECKING(for winsock)
2423 save_LIBS="$LIBS"
2424 for curlib in ws2_32 wsock32; do
2425 LIBS="$LIBS -l$curlib"
2426 AC_TRY_LINK([
2427 char __attribute__((stdcall)) socket(int,int,int);
2428 char __attribute__((stdcall)) select(int,int,int,int,int);
2429 char __attribute__((stdcall)) closesocket(int);
2430 char __attribute__((stdcall)) gethostname(int,int);
2431 ],
2432 [
2433 socket(1,2,3);
2434 select(1,2,3,4,5);
2435 closesocket(1);
2436 gethostname(1,2);
2437 ],
2438 have_winsock=yes, have_winsock=no)
2439
2440 if test $have_winsock = yes; then
2441 ac_cv_func_select='yes'
2442 if test $curlib = ws2_32; then
2443 have_winsock=winsock2
2444 fi
2445 break
2446 fi
2447 LIBS="$save_LIBS"
2448 done
2449 AC_MSG_RESULT($have_winsock)
2450 ;;
2451esac
94d48591 2452
3c641669 2453dnl Ripped from the Samba sources
2454AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2455 AC_TRY_COMPILE([
2456#include <sys/types.h>
2457#include <stdlib.h>
2458#include <stddef.h>
2459#include <sys/socket.h>
2460#include <sys/un.h>],
2461[
2462 struct sockaddr_un sunaddr;
2463 sunaddr.sun_family = AF_UNIX;
2464],
2465 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2466if test x"$squid_cv_unixsocket" = x"yes"; then
6a9f6389 2467 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
3c641669 2468fi
2469dnl end rip
2470
94d48591 2471 AC_CHECK_LIB(gnumalloc, main)
2472 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2473 echo "Disabling extended malloc functions when using gnumalloc"
2474 ac_cv_func_mallinfo=no
2475 ac_cv_func_mallocblksize=no
2476 ac_cv_func_mallopt=no
2477 else
2478 case "$host" in
2479 *-sun-solaris*)
2480 echo "skipping libmalloc check for $host"
2481 ;;
2482 i386-*-freebsd*)
2483 echo "skipping libmalloc check for $host"
2484 ;;
2485 *)
2486
2487 AC_CHECK_LIB(malloc, main)
2488 ;;
2489 esac
2490 fi
94d48591 2491
6716b242 2492AC_CHECK_LIB(bsd, main)
be79ade0 2493AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
04a56fa3 2494AC_CHECK_LIB(bind, gethostbyname)
2495if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2496 case "$host" in
78743365 2497 i386-*-freebsd*)
2498 echo "skipping libresolv checks for $host"
2499 ;;
2500 *)
78743365 2501 AC_CHECK_LIB(resolv, main)
2502 ;;
04a56fa3 2503 esac
2504fi
08caf8c6 2505case "$host_os" in
2506mingw|mingw32)
2507 echo "Use MSVCRT for math functions."
2508 ;;
2509 *)
2510 AC_CHECK_LIB(m, main)
2511 ;;
2512esac
090089c4 2513
2514dnl Check for libcrypt
8154dd82 2515dnl Some of our helpers use crypt(3) which may be in libc, or in
2516dnl libcrypt (eg FreeBSD)
c1dc012a 2517AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
3d4022fa 2518
2519dnl Solaris10 provides MD5 natively through libmd5
c1dc012a 2520AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
3d4022fa 2521
be79ade0 2522AC_SUBST(CRYPTLIB)
77f675ad 2523
042b1f8a 2524dnl Check for libdl, used by auth_modules/PAM
8154dd82 2525if test "$with_dl" = "yes"; then
2526 AC_CHECK_LIB(dl, dlopen)
2527fi
042b1f8a 2528
e5f4e1b0 2529dnl Check for pthreads
2530dnl We use pthreads when doing ASYNC I/O
8154dd82 2531if test "$with_pthreads" = "yes"; then
fa035612 2532 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2533 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
e685e3c6 2534 case "$host" in
2535 i386-unknown-freebsd*)
2536 if test "$GCC" = "yes" ; then
2537 if test -z "$PRESET_LDFLAGS"; then
2538 LDFLAGS="$LDFLAGS -pthread"
2539 fi
2540 fi
2541 ;;
2542 *-solaris2.*)
2543 if test "$GCC" = "yes" ; then
fa035612 2544 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2545 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
e685e3c6 2546 else
fa035612 2547 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2548 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
e685e3c6 2549 fi
2550 ;;
2551 esac
8154dd82 2552 AC_CHECK_LIB(pthread, main)
2553fi
71f8abc8 2554
f85c88f3 2555dnl Check for librt
2556dnl We use AIO in the coss store
8154dd82 2557if test "$with_aio" = "yes"; then
580e2134 2558 dnl On some systems POSIX AIO functions are in libaio
2559 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
8154dd82 2560fi
f85c88f3 2561
86ec11aa 2562dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2563dnl Robert Side <rside@aiinc.bc.ca>
2564dnl Mon, 18 Jan 1999 17:48:00 GMT
2565case "$host" in
2566 *-pc-sco3.2*)
2567 AC_CHECK_LIB(intl, strftime)
2568 ;;
2569esac
2570
20e869bf 2571dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2572dnl only with Windows LDAP libraries using -lwldap32
2573case "$host_os" in
2574mingw|mingw32)
2575 LIB_LDAP="-lwldap32"
2576 LIB_LBER=""
2577 ;;
2578*)
2579 LIB_LDAP="-lldap"
2580 dnl LDAP helpers need to know if -llber is needed or not
2581 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2582 ;;
2583esac
2584AC_SUBST(LIB_LDAP)
2585AC_SUBST(LIB_LBER)
2586
b7a1c19e 2587dnl Check for libdb
2588DBLIB=
01b4931d 2589dnl 1.85
a258dfca 2590AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
32d0bbd7 2591SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2592 AC_TRY_LINK([
a258dfca 2593#if HAVE_SYS_TYPES_H
2594#include <sys/types.h>
2595#endif
2596#if HAVE_LIMITS_H
2597#include <limits.h>
2598#endif
2599#if HAVE_DB_185_H
2600#include <db_185.h>
2601#elif HAVE_DB_H
2602#include <db.h>
2603#endif],
2604 [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)],
a258dfca 2605 ac_cv_dbopen_libdb="yes",
2606 ac_cv_dbopen_libdb="no")
32d0bbd7 2607LIBS="$SAVED_LIBS"
a258dfca 2608])
2b2161bb 2609if test $ac_cv_dbopen_libdb = yes; then
32d0bbd7 2610 LIB_DB="-ldb"
2611fi
01b4931d 2612AC_SUBST(LIB_DB)
b7a1c19e 2613
77f675ad 2614dnl System-specific library modifications
2615dnl
2616case "$host" in
88738790 2617 i386-*-solaris2.*)
7149a49f 2618 if test "$GCC" = "yes"; then
2619 echo "Removing -O for gcc on $host"
80e92d6d 2620 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 2621 fi
2622 ;;
77f675ad 2623 *-sgi-irix*)
2624 echo "Removing -lsocket for IRIX..."
6716b242 2625 LIBS=`echo $LIBS | sed -e s/-lsocket//`
77f675ad 2626 echo "Removing -lnsl for IRIX..."
6716b242 2627 LIBS=`echo $LIBS | sed -e s/-lnsl//`
c415c128 2628 ac_cv_lib_nsl_main=no
b44c0fb4 2629 echo "Removing -lbsd for IRIX..."
2630 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 2631 ;;
4ba0bd0e 2632dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2633dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2634dnl Please change your configure script. AIX doesn't need -lbsd.
2635 *-ibm-aix*)
2636 echo "Removing -lbsd for AIX..."
2637 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2638 ;;
30a4f2a8 2639 *m88k*)
fa035612 2640 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2641 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
6a9f6389 2642 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
7149a49f 2643 ;;
580ce039 2644 [*-*-solaris2.[0-4]])
6a9f6389 2645 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
30a4f2a8 2646 ;;
711fa75e 2647 [*-sony-newsos[56]*])
6a9f6389 2648 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
f62c73dc 2649 ;;
77f675ad 2650esac
090089c4 2651
57faa85a 2652# Remove optimization for GCC 2.95.[123]
d20b1cd0 2653# gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2654if test "$GCC" = "yes"; then
2655 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2656 case "$GCCVER" in
57faa85a 2657 [2.95.[123]])
d20b1cd0 2658 echo "Removing -O for gcc on $host with GCC $GCCVER"
2659 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2660 ;;
2661 esac
2662fi
2663
176d10ee 2664# Recommended by Balint Nagy Endre <bne@CareNet.hu>
2665case "$host" in
2666 *-univel-sysv4.2MP)
2667 if test `uname -v` = "2.03"; then
2668 echo "disabling mallinfo for $host"
2669 ac_cv_func_mallinfo=no
2670 fi
2671 ;;
2672esac
2673
84cecfd2 2674dnl This has to be before AC_CHECK_FUNCS
2675# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2676# when running configure.
2677if test -z "$ac_cv_func_poll"; then
2678 case "$host" in
2679 [alpha-dec-osf3.*])
2680 # John Kay (jkay@nlanr.net) 19970818
2681 echo "disabling poll for $host..."
2682 ac_cv_func_poll='no'
2683 ;;
2684 [*-hp-hpux*.*])
2685 # Duane Wessels
2686 echo "disabling poll for $host..."
2687 ac_cv_func_poll='no'
2688 ;;
2689 [*-linux-*])
f5cec332 2690 # Henrik Nordstrom (hno@squid-cache.org) 19980817
9bb83c8b 2691 # poll is problematic on Linux. We disable it
2692 # by default until Linux gets it right.
b6a2f15e 2693 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2694 if test $rev -lt 002002; then
2695 echo "disabling poll for $host < 2.2..."
2696 ac_cv_func_poll='no'
2697 fi
84cecfd2 2698 ;;
c68e9c6b 2699 [powerpc-ibm-aix4.1.*])
2700 # Mike Laster (mlaster@metavillage.com) 19981021
2701 echo "disabling poll for $host..."
2702 ac_cv_func_poll='no'
2703 ;;
86ec11aa 2704 [*-pc-sco3.2*])
2705 # Robert Side <rside@aiinc.bc.ca>
2706 # Mon, 18 Jan 1999 17:48:00 GMT
2707 echo "disabling poll for $host..."
2708 ac_cv_func_poll='no'
2709 ;;
84cecfd2 2710 esac
2711fi
176d10ee 2712
08caf8c6 2713dnl Override statfs() detect on MinGW becasue is emulated in source code
2714case "$host_os" in
2715mingw|mingw32)
2716 ac_cv_func_statfs='yes'
2717 ;;
2718esac
2719
6716b242 2720dnl Check for library functions
2721AC_CHECK_FUNCS(\
ce3d30fb 2722 backtrace_symbols_fd \
3a144521 2723 bcopy \
2724 bswap_16 \
2725 bswap_32 \
f9576890 2726 bswap16 \
2727 bswap32 \
4ac29a5b 2728 fchmod \
6716b242 2729 getdtablesize \
8505e57b 2730 getpagesize \
230c091c 2731 getpass \
3a144521 2732 getrlimit \
30a4f2a8 2733 getrusage \
9c1d8929 2734 getspnam \
379d5751 2735 gettimeofday \
52303a3d 2736 glob \
f9576890 2737 htobe16 \
2738 htole16 \
d474c7a6 2739 kqueue\
30a4f2a8 2740 lrand48 \
6716b242 2741 mallinfo \
0f5efab0 2742 mallocblksize \
6716b242 2743 mallopt \
2ae6b9b0 2744 memcpy \
30a4f2a8 2745 memmove \
dac27377 2746 memset \
b99a6dec 2747 mkstemp \
1812b6c7 2748 mktime \
88738790 2749 mstats \
84cecfd2 2750 poll \
62ae0622 2751 prctl \
3a144521 2752 pthread_attr_setschedparam \
cd748f27 2753 pthread_attr_setscope \
2754 pthread_setschedparam \
42b51993 2755 pthread_sigmask \
c68e9c6b 2756 putenv \
b1e77ec1 2757 random \
6716b242 2758 regcomp \
2759 regexec \
2760 regfree \
30a4f2a8 2761 res_init \
af76ec93 2762 __res_init \
4915be3b 2763 rint \
a4ba1105 2764 sbrk \
3a144521 2765 select \
234967c9 2766 seteuid \
c415c128 2767 setgroups \
30a4f2a8 2768 setpgrp \
6716b242 2769 setrlimit \
30a4f2a8 2770 setsid \
2771 sigaction \
11430c03 2772 snprintf \
1ccc0d40 2773 socketpair \
30a4f2a8 2774 srand48 \
b1e77ec1 2775 srandom \
0343b99c 2776 statfs \
1cd53467 2777 strsep \
2733d426 2778 strtoll \
6716b242 2779 sysconf \
2780 syslog \
234967c9 2781 timegm \
28da5e0d 2782 vsnprintf \
6716b242 2783)
f5e5c4cf 2784dnl ... and some we provide local replacements for
2785AC_REPLACE_FUNCS(\
2786 drand48 \
cc192b50 2787 inet_ntop \
2788 inet_pton \
f5e5c4cf 2789 initgroups \
cc192b50 2790 getaddrinfo \
2791 getnameinfo \
f5e5c4cf 2792 strerror \
2793 tempnam \
2794)
6716b242 2795
d06d566f 2796# check for crypt, may require -lcrypt
2797SAVED_LIBS="$LIBS"
2798LIBS="$LIBS $CRYPTLIB"
2799AC_CHECK_FUNCS(crypt)
2800LIBS="$SAVED_LIBS"
2801
d474c7a6 2802# Check for libepoll
2803EPOLL_LIB=
2804AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
2805AC_SUBST(EPOLL_LIBS)
2806
2807# Check for epoll_ctl, may need -lepoll
2808SAVED_LIBS="$LIBS"
2809LIBS="$LIBS $LIB_EPOLL"
2810AC_CHECK_FUNCS(epoll_ctl)
2811LIBS="$SAVED_LIBS"
2812
2813dnl Verify that epoll really works
2814if test $ac_cv_func_epoll_ctl = yes; then
2815 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
2816 AC_TRY_RUN([
2817#include <sys/epoll.h>
2818#include <stdlib.h>
2819#include <stdio.h>
2820int main(int argc, char **argv)
2821{
2822 int fd = epoll_create(256);
2823 if (fd < 0) {
2824 perror("epoll_create:");
2825 exit(1);
2826 }
2827 exit(0);
2828}
2829 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
328c40de 2830fi
d474c7a6 2831
1b3db6d9 2832dnl Magic which checks whether we are forcing a type of comm loop we
2833dnl are actually going to (ab)use
2834
2835dnl Actually do the define magic now
2836dnl mostly ripped from squid-commloops, thanks to adrian and benno
2837
d474c7a6 2838if test -n "$SELECT_TYPE"; then
2839 : # Already decided above. Nothing to do here
6564c397 2840elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
a46d2c0e 2841 SELECT_TYPE="epoll"
6564c397 2842elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
2843 SELECT_TYPE="kqueue"
2844elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
6c9797b9 2845 SELECT_TYPE="poll"
6564c397 2846elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
663c0a38 2847 case "$host_os" in
2848 mingw|mingw32)
2849 SELECT_TYPE="select_win32"
663c0a38 2850 ;;
2851 *)
2852 SELECT_TYPE="select"
663c0a38 2853 ;;
2854 esac
1b3db6d9 2855else
a46d2c0e 2856 echo "Eep! Can't find poll, kqueue, epoll, or select!"
1b3db6d9 2857 echo "I'll try select and hope for the best."
2858 SELECT_TYPE="select"
6a9f6389 2859 AC_DEFINE(USE_SELECT,1)
1b3db6d9 2860fi
d474c7a6 2861
2862echo "Using ${SELECT_TYPE} for the IO loop."
2863
2864AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2865AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2866AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2867AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2868AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2869AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2870AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2871
2872case $SELECT_TYPE in
2873epoll)
2874 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2875 ;;
2876poll)
2877 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2878 ;;
2879kqueue)
2880 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2881 ;;
2882select_win32)
2883 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
2884 ;;
2885select)
2886 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2887 ;;
2888esac
1b3db6d9 2889
2890
d06d566f 2891
60939927 2892dnl Yay! Another Linux brokenness. Its not good enough
2893dnl to know that setresuid() exists, because RedHat 5.0 declares
2894dnl setresuid() but doesn't implement it.
2895dnl
2896AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
5c51415d 2897 AC_TRY_RUN([
60939927 2898#include <stdlib.h>
5c51415d 2899 int main() {
2900 if(setresuid(-1,-1,-1)) {
2901 perror("setresuid:");
2902 exit(1);
60939927 2903 }
2904 exit(0);
5c51415d 2905 }
2906 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
60939927 2907)
5c51415d 2908if test "$ac_cv_func_setresuid" = "yes" ; then
6a9f6389 2909 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 2910fi
60939927 2911
cee08cbc
AJ
2912dnl Yay! This one is a MacOSX brokenness. Its not good enough
2913dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
2914dnl copy that crashes with a buffer over-run!
2915dnl
2916AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
2917 AC_TRY_RUN([
2918#include <stdlib.h>
2919#include <stdio.h>
2920#include <string.h>
2921 // we expect this to succeed, or crash on over-run.
2922 // if it passes otherwise we may need a better check.
2923int main(int argc, char **argv)
2924{
2925 int size = 20;
2926 char *str = malloc(size);
2927 memset(str, 'x', size);
2928 strnstr(str, "fubar", size);
2929 return 0;
2930}
2931 ],ac_cv_func_strnstr="yes",ac_cv_func_strnstr="no")
2932)
2933if test "$ac_cv_func_strnstr" = "yes" ; then
2934 AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
2935else
2936 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.])
2937fi
2938
2939
1cd53467 2940AM_CONDITIONAL(NEED_OWN_STRSEP, false)
2941if test "$ac_cv_func_strsep" = "no" ; then
2942 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
2943fi
2944
2733d426 2945AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
2946if test "$ac_cv_func_strtoll" = "no" ; then
2947 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
2948fi
2949
eee79a2e 2950dnl
2951dnl Test for va_copy
2952dnl
2953AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
2954 AC_TRY_RUN([
2955 #include <stdarg.h>
2956 void f (int i, ...) {
2957 va_list args1, args2;
2958 va_start (args1, i);
2959 va_copy (args2, args1);
2960 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2961 exit (1);
2962 va_end (args1); va_end (args2);
2963 }
2964 int main() {
2965 f (0, 42);
2966 return 0;
2967 }
2968 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
2969)
2970if test "$ac_cv_func_va_copy" = "yes" ; then
a45f884d 2971 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
eee79a2e 2972fi
2973
2974dnl
2975dnl Some systems support __va_copy
2976dnl
2977AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
2978 AC_TRY_RUN([
2979 #include <stdarg.h>
2980 void f (int i, ...) {
2981 va_list args1, args2;
2982 va_start (args1, i);
2983 __va_copy (args2, args1);
2984 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2985 exit (1);
2986 va_end (args1); va_end (args2);
2987 }
2988 int main() {
2989 f (0, 42);
2990 return 0;
2991 }
2992 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
2993)
2994if test "$ac_cv_func___va_copy" = "yes" ; then
a45f884d 2995 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
eee79a2e 2996fi
c3d0c8b5 2997
5cafc1d6 2998dnl IP-Filter support requires ipf header files. These aren't
2999dnl installed by default, so we need to check for them
3000if test "$IPF_TRANSPARENT" ; then
3001 AC_MSG_CHECKING(if IP-Filter header files are installed)
42b51993 3002 # hold on to your hats...
3003 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3004 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
87d21d8b 3005 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3006 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
42b51993 3007 have_ipfilter_compat_header="yes"
3008 fi
3009 if test "x$have_ipfilter_compat_header" = "xyes" &&
eb824054 3010 test "$ac_cv_header_ip_fil_h" = "yes" &&
3011 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3012 IPF_TRANSPARENT="yes"
3013 AC_DEFINE(IPF_TRANSPARENT, 1)
42b51993 3014 elif test "$have_ipfilter_compat_header" = "yes" &&
eb824054 3015 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3016 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3017 IPF_TRANSPARENT="yes"
3018 AC_DEFINE(IPF_TRANSPARENT, 1)
3019 else
5cafc1d6 3020 IPF_TRANSPARENT="no"
3021 AC_DEFINE(IPF_TRANSPARENT, 0)
5cafc1d6 3022 fi
3023 AC_MSG_RESULT($IPF_TRANSPARENT)
3024fi
3025if test "$IPF_TRANSPARENT" = "no" ; then
3026 echo "WARNING: Cannot find necessary IP-Filter header files"
3027 echo " Transparent Proxy support WILL NOT be enabled"
3028 sleep 10
8f6ca20d 3029elif test "$IPF_TRANSPARENT" = "yes" ; then
3030dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3031dnl Solaris minor version (8, 9, 10, ...)
3032 case "$host" in
3033 *-solaris*)
3034 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3035 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
20b3ae10 3036 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
8f6ca20d 3037 ;;
3038 *)
3039 ;;
3040 esac
5cafc1d6 3041fi
3042
2b0dd4ac 3043dnl PF support requires a header file.
3044if test "$PF_TRANSPARENT" ; then
3045 AC_MSG_CHECKING(if PF header file is installed)
3046 # hold on to your hats...
3047 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
3048 PF_TRANSPARENT="yes"
3049 AC_DEFINE(PF_TRANSPARENT, 1)
3050 else
3051 PF_TRANSPARENT="no"
3052 AC_DEFINE(PF_TRANSPARENT, 0)
3053 fi
3054 AC_MSG_RESULT($PF_TRANSPARENT)
3055fi
3056if test "$PF_TRANSPARENT" = "no" ; then
3057 echo "WARNING: Cannot find necessary PF header file"
3058 echo " Transparent Proxy support WILL NOT be enabled"
3059 sleep 10
3060fi
3061
d852fbad 3062dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3063dnl Shamelessly copied from above
3064if test "$LINUX_NETFILTER" ; then
d6d62546 3065 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
d852fbad 3066 # hold on to your hats...
3067 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3068 LINUX_NETFILTER="yes"
3069 AC_DEFINE(LINUX_NETFILTER, 1)
3070 else
3071 LINUX_NETFILTER="no"
3072 AC_DEFINE(LINUX_NETFILTER, 0)
3073 fi
3074 AC_MSG_RESULT($LINUX_NETFILTER)
3075fi
3076if test "$LINUX_NETFILTER" = "no" ; then
d6d62546 3077 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
7b0a0d1f 3078 echo " Linux Transparent and Intercepting Proxy support WILL NOT be enabled"
d852fbad 3079 sleep 10
3080fi
3081
f1e0717c 3082dnl Linux Netfilter/TPROXYv2 support requires some specific header files
fc68f6b1 3083dnl Shamelessly copied from shamelessly copied from above
f1e0717c
AJ
3084if test "$LINUX_TPROXY2" ; then
3085 AC_MSG_CHECKING(if TPROXYv2 header files are installed)
fc68f6b1 3086 # hold on to your hats...
3087 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
f1e0717c
AJ
3088 LINUX_TPROXY2="yes"
3089 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
fc68f6b1 3090 else
f1e0717c
AJ
3091 LINUX_TPROXY2="no"
3092 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3093 fi
3094 AC_MSG_RESULT($LINUX_TPROXY2)
3095 if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3096 echo "WARNING: Cannot find TPROXY v2 headers, you need to install the"
3097 echo "tproxy package from:"
3098 echo " - lynx http://www.balabit.com/downloads/tproxy/"
7b0a0d1f 3099 echo "Or select the '--enable-linux-netfilter' option instead for Netfilter support."
f1e0717c 3100 sleep 10
fc68f6b1 3101 fi
fc68f6b1 3102fi
3103
91bc414e 3104if test -z "$USE_GNUREGEX" ; then
3105 case "$host" in
3106 *-sun-solaris2.[[0-4]])
3107 USE_GNUREGEX="yes"
3108 ;;
3109 *-next-nextstep*)
3110 USE_GNUREGEX="yes"
3111 ;;
3112 esac
3113fi
7a081912 3114AC_MSG_CHECKING(if GNUregex needs to be compiled)
91bc414e 3115if test -z "$USE_GNUREGEX"; then
55878dfd 3116if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
74946a0f 3117 USE_GNUREGEX="yes"
00fa2c12 3118else
0cccc031 3119 AC_TRY_COMPILE([#include <sys/types.h>
3120#include <regex.h>],[regex_t t; regcomp(&t,"",0);],
91bc414e 3121 USE_GNUREGEX="no",
3122 USE_GNUREGEX="yes")
3123fi
00fa2c12 3124fi
74946a0f 3125AC_MSG_RESULT($USE_GNUREGEX)
3126if test "$USE_GNUREGEX" = "yes"; then
26675bf4 3127 REGEXLIB="-lregex"
7a081912 3128 LIBREGEX="libregex.a"
6a9f6389 3129 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
7a081912 3130fi
26675bf4 3131AC_SUBST(REGEXLIB)
00fa2c12 3132AC_SUBST(LIBREGEX)
7a081912 3133
5c51415d 3134dnl Not cached since people are likely to tune this
e924600d 3135AC_MSG_CHECKING(Default FD_SETSIZE value)
3136AC_TRY_RUN([
3137#if HAVE_STDIO_H
3138#include <stdio.h>
3139#endif
3140#if HAVE_UNISTD_H
3141#include <unistd.h>
3142#endif
3143#if HAVE_SYS_TIME_H
3144#include <sys/time.h>
3145#endif
3146#if HAVE_SYS_SELECT_H
3147#include <sys/select.h>
3148#endif
3149#if HAVE_SYS_TYPES_H
3150#include <sys/types.h>
3151#endif
3152main() {
635e6242 3153 FILE *fp = fopen("conftestval", "w");
3154 fprintf (fp, "%d\n", FD_SETSIZE);
e924600d 3155 exit(0);
3156}
3157],
3158DEFAULT_FD_SETSIZE=`cat conftestval`,
3159DEFAULT_FD_SETSIZE=256,
3160DEFAULT_FD_SETSIZE=256)
3161AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
6a9f6389 3162AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
e924600d 3163
f49be7d1 3164
5c51415d 3165dnl Not cached since people are likely to tune this
234967c9 3166AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
c76d8acc 3167dnl damn! FreeBSD's pthreads breaks dup2().
5132a9eb 3168TLDFLAGS="$LDFLAGS"
f49be7d1 3169if test -n "$squid_filedescriptors_num" ; then
3170 SQUID_MAXFD=$squid_filedescriptors_num
3171 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3172else
f49be7d1 3173 case $host in
3174 i386-unknown-freebsd*)
3175 if echo "$LDFLAGS" | grep -q pthread; then
3176 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3177 fi
3178 esac
3179 AC_TRY_RUN([
8cca06da 3180#include <stdio.h>
234967c9 3181#include <unistd.h>
30a4f2a8 3182#include <sys/time.h> /* needed on FreeBSD */
234967c9 3183#include <sys/param.h>
3184#include <sys/resource.h>
3185main() {
635e6242 3186 FILE *fp;
234967c9 3187 int i,j;
42b51993 3188#if defined(__CYGWIN32__) || defined (__CYGWIN__)
b05490a8 3189 /* getrlimit and sysconf returns bogous values on cygwin32.
df087e68 3190 * Number of fds is virtually unlimited in cygwin (sys/param.h)
b05490a8 3191 * __CYGWIN32__ is deprecated.
df087e68 3192 */
3193 i = NOFILE;
b05490a8 3194#else
3195#if HAVE_SETRLIMIT
234967c9 3196 struct rlimit rl;
3197#if defined(RLIMIT_NOFILE)
3198 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3199 perror("getrlimit: RLIMIT_NOFILE");
3200 } else {
3201 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3202 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3203 perror("setrlimit: RLIMIT_NOFILE");
3204 }
3205 }
3206#elif defined(RLIMIT_OFILE)
3207 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3208 perror("getrlimit: RLIMIT_OFILE");
3209 } else {
3210 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3211 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3212 perror("setrlimit: RLIMIT_OFILE");
3213 }
3214 }
3215#endif /* RLIMIT_NOFILE */
3216#endif /* HAVE_SETRLIMIT */
d9399075 3217 /* by starting at 2^14, we will never get higher
3218 than 2^15 for SQUID_MAXFD */
3219 i = j = 1<<14;
3220 while (j) {
3221 j >>= 1;
3222 if (dup2(0, i) < 0) {
3223 i -= j;
3224 } else {
3225 close(i);
3226 i += j;
3227 }
3228 }
3229 i++;
b05490a8 3230#endif /* IF !DEF CYGWIN */
635e6242 3231 fp = fopen("conftestval", "w");
a4d7e961 3232 fprintf (fp, "%d\n", i & ~0x3F);
234967c9 3233 exit(0);
3234}
f49be7d1 3235 ],
3236 SQUID_MAXFD=`cat conftestval`,
3237 SQUID_MAXFD=256,
3238 SQUID_MAXFD=256)
4b26fae9 3239 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3240 case "$host_os" in
3241 mingw|mingw32)
3242 SQUID_MAXFD="2048"
3243 ;;
3244 esac
f49be7d1 3245 AC_MSG_RESULT($SQUID_MAXFD)
3246fi
6a9f6389 3247AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
b9cc811d 3248if test "$SQUID_MAXFD" -lt 512 ; then
80ab193b 3249 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
3250 echo " cache will be very busy. Please see the FAQ page"
2b6662ba 3251 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
e692ff35 3252 echo " on how to increase your filedescriptor limit"
933cc58d 3253 sleep 10
80ab193b 3254fi
c76d8acc 3255LDFLAGS="$TLDFLAGS"
234967c9 3256
d0f9207a 3257if test `expr $SQUID_MAXFD % 64` != 0; then
a4d7e961 3258 echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues"
3259 echo " on certain platforms."
3260 sleep 10
3261fi
3262
5c51415d 3263dnl Not cached since people are likely to tune this
30a4f2a8 3264AC_MSG_CHECKING(Default UDP send buffer size)
3265AC_TRY_RUN([
8cca06da 3266#include <stdlib.h>
3267#include <stdio.h>
30a4f2a8 3268#include <sys/types.h>
3269#include <sys/socket.h>
3270#include <netinet/in.h>
3271main ()
3272{
635e6242 3273 FILE *fp;
30a4f2a8 3274 int fd,val=0,len=sizeof(int);
3275 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3276 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3277 if (val<=0) exit(1);
635e6242 3278 fp = fopen("conftestval", "w");
3279 fprintf (fp, "%d\n", val);
30a4f2a8 3280 exit(0);
3281}
3282],
6a9f6389 3283SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3284SQUID_DETECT_UDP_SO_SNDBUF=16384,
3285SQUID_DETECT_UDP_SO_SNDBUF=16384)
3286AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3287AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
30a4f2a8 3288
5c51415d 3289dnl Not cached since people are likely to tune this
30a4f2a8 3290AC_MSG_CHECKING(Default UDP receive buffer size)
3291AC_TRY_RUN([
8cca06da 3292#include <stdlib.h>
3293#include <stdio.h>
30a4f2a8 3294#include <sys/types.h>
3295#include <sys/socket.h>
3296#include <netinet/in.h>
3297main ()
3298{
635e6242 3299 FILE *fp;
30a4f2a8 3300 int fd,val=0,len=sizeof(int);
3301 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3302 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3303 if (val <= 0) exit(1);
635e6242 3304 fp = fopen("conftestval", "w");
3305 fprintf (fp, "%d\n", val);
30a4f2a8 3306 exit(0);
3307}
3308],
6a9f6389 3309SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3310SQUID_DETECT_UDP_SO_RCVBUF=16384,
3311SQUID_DETECT_UDP_SO_RCVBUF=16384)
3312AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3313AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
30a4f2a8 3314
5c51415d 3315dnl Not cached since people are likely to tune this
30a4f2a8 3316AC_MSG_CHECKING(Default TCP send buffer size)
3317AC_TRY_RUN([
8cca06da 3318#include <stdlib.h>
3319#include <stdio.h>
30a4f2a8 3320#include <sys/types.h>
3321#include <sys/socket.h>
3322#include <netinet/in.h>
3323main ()
3324{
635e6242 3325 FILE *fp;
30a4f2a8 3326 int fd,val=0,len=sizeof(int);
3327 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3328 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3329 if (val <= 0) exit(1);
635e6242 3330 fp = fopen("conftestval", "w");
3331 fprintf (fp, "%d\n", val);
30a4f2a8 3332 exit(0);
3333}
3334],
3335SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1c481e00 3336SQUID_TCP_SO_SNDBUF=16384,
3337SQUID_TCP_SO_SNDBUF=16384)
30a4f2a8 3338AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2aa6ca58 3339if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3340 echo "Limiting send buffer size to 32K"
3341 SQUID_TCP_SO_SNDBUF=32768
3342fi
6a9f6389 3343AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
30a4f2a8 3344
5c51415d 3345dnl Not cached since people are likely to tune this
30a4f2a8 3346AC_MSG_CHECKING(Default TCP receive buffer size)
3347AC_TRY_RUN([
8cca06da 3348#include <stdlib.h>
3349#include <stdio.h>
30a4f2a8 3350#include <sys/types.h>
3351#include <sys/socket.h>
3352#include <netinet/in.h>
3353main ()
3354{
635e6242 3355 FILE *fp;
30a4f2a8 3356 int fd,val=0,len=sizeof(int);
3357 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3358 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3359 if (val <= 0) exit(1);
635e6242 3360 fp = fopen("conftestval", "w");
3361 fprintf (fp, "%d\n", val);
30a4f2a8 3362 exit(0);
3363}
3364],
3365SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1c481e00 3366SQUID_TCP_SO_RCVBUF=16384,
3367SQUID_TCP_SO_RCVBUF=16384)
30a4f2a8 3368AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2aa6ca58 3369if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3370 echo "Limiting receive buffer size to 64K"
3371 SQUID_TCP_SO_RCVBUF=65535
3372fi
6a9f6389 3373AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
5c51415d 3374AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
9bc73deb 3375 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
5c51415d 3376 ac_cv_needs_sys_errlist="no",
3377 ac_cv_needs_sys_errlist="yes")
3378)
3379if test "$ac_cv_needs_sys_errlist" = "yes" ; then
6a9f6389 3380 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
5c51415d 3381fi
30a4f2a8 3382
5c51415d 3383dnl Not cached since people are likely to change this
6bf65235 3384AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3385AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3386[AC_MSG_RESULT(yes)
6a9f6389 3387AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
6bf65235 3388AC_MSG_RESULT(no))
3389
a937d5e3 3390AC_MSG_CHECKING(if inet_ntoa() actually works)
3391AC_TRY_RUN([
3392#include <stdlib.h>
3393#include <stdio.h>
3394#include <sys/types.h>
3395#include <netinet/in.h>
3396#include <arpa/inet.h>
3397main ()
3398{
635e6242 3399 FILE *fp;
a937d5e3 3400 struct in_addr in;
3401 in.s_addr = inet_addr("1.2.3.4");
635e6242 3402 fp = fopen("conftestval", "w");
3403 fprintf (fp, "%s\n", inet_ntoa(in));
a937d5e3 3404 exit(0);
3405}
3406],
3407INET_NTOA_RESULT=`cat conftestval`,
3408INET_NTOA_RESULT="broken",
3409INET_NTOA_RESULT="broken")
3410if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3411 AC_MSG_RESULT("yes")
3412else
3413 AC_MSG_RESULT("no")
4b26fae9 3414 case "$host_os" in
3415 mingw|mingw32)
3416 echo "Using Win32 resolver instead."
3417 ;;
f5e5c4cf 3418 *)
4b26fae9 3419 echo "Will use our own inet_ntoa()."
3420 AC_LIBOBJ(inet_ntoa)
3421# echo "WARNING: This looks bad, and probably prevents Squid from working."
3422# echo " If you're on IRIX and using GCC 2.8, you probably need"
3423# echo " to use the IRIX C compiler instead."
3424# sleep 10
3425 ;;
3426 esac
a937d5e3 3427fi
3428
b6a2f15e 3429if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
c68e9c6b 3430AC_MSG_CHECKING(for working statvfs() interface)
3431AC_TRY_COMPILE([
3432#include <stdlib.h>
3433#include <stdio.h>
3434#include <sys/types.h>
3435#include <sys/statvfs.h>
3436],
3437[
3438struct statvfs sfs;
3439sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3440sfs.f_files = sfs.f_ffree = 0;
3441statvfs("/tmp", &sfs);
3442],
3443 ac_cv_func_statvfs=yes,
3444 ac_cv_func_statvfs=no)
3445AC_MSG_RESULT($ac_cv_func_statvfs)
6b8e7481 3446if test "$ac_cv_func_statvfs" = "yes" ; then
6a9f6389 3447 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
b6a2f15e 3448fi
6b8e7481 3449fi
c68e9c6b 3450
cc192b50 3451dnl Detect what resolver fields we have available to use...
3452AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3453AC_TRY_COMPILE([
3454#if HAVE_SYS_TYPES_H
3455#include <sys/types.h>
3456#endif
3457#if HAVE_NETINET_IN_H
3458#include <netinet/in.h>
3459#endif
3460#if HAVE_ARPA_INET_H
3461#include <arpa/inet.h>
3462#endif
3463#if HAVE_ARPA_NAMESER_H
3464#include <arpa/nameser.h>
3465#endif
3466#if HAVE_RESOLV_H
3467#include <resolv.h>
3468#endif
3469],
3470[_res_ext.nsaddr_list[[0]].s_addr;],
3471ac_cv_have_res_ext_nsaddr_list="yes",
3472ac_cv_have_res_ext_nsaddr_list="no"))
3473if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3474 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3475 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3476fi
3477
3478if test "$_SQUID_RES_NSADDR6_LIST" == ""; then
3479AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3480AC_TRY_COMPILE([
3481#if HAVE_SYS_TYPES_H
3482#include <sys/types.h>
3483#endif
3484#if HAVE_NETINET_IN_H
3485#include <netinet/in.h>
3486#endif
3487#if HAVE_ARPA_INET_H
3488#include <arpa/inet.h>
3489#endif
3490#if HAVE_ARPA_NAMESER_H
3491#include <arpa/nameser.h>
3492#endif
3493#if HAVE_RESOLV_H
3494#include <resolv.h>
3495#endif
3496],
3497[_res._u._ext.nsaddrs[[0]]->sin6_addr;],
3498ac_cv_have_res_ext_nsaddrs="yes",
3499ac_cv_have_res_ext_nsaddrs="no"))
3500if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3501 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3502 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3503fi
3504fi
3505
c68e9c6b 3506AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3507AC_TRY_COMPILE([
3508#if HAVE_SYS_TYPES_H
3509#include <sys/types.h>
3510#endif
3511#if HAVE_NETINET_IN_H
3512#include <netinet/in.h>
3513#endif
3514#if HAVE_ARPA_INET_H
3515#include <arpa/inet.h>
3516#endif
3517#if HAVE_ARPA_NAMESER_H
3518#include <arpa/nameser.h>
3519#endif
3520#if HAVE_RESOLV_H
3521#include <resolv.h>
3522#endif
3523],
3524[_res.nsaddr_list[[0]];],
3525ac_cv_have_res_nsaddr_list="yes",
3526ac_cv_have_res_nsaddr_list="no"))
3527if test $ac_cv_have_res_nsaddr_list = "yes" ; then
cc192b50 3528 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3529 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3530fi
3531
cc192b50 3532if test "$_SQUID_RES_NSADDR_LIST" == ""; then
c68e9c6b 3533AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3534AC_TRY_COMPILE([
3535#if HAVE_SYS_TYPES_H
3536#include <sys/types.h>
3537#endif
3538#if HAVE_NETINET_IN_H
3539#include <netinet/in.h>
3540#endif
3541#if HAVE_ARPA_INET_H
3542#include <arpa/inet.h>
3543#endif
3544#if HAVE_ARPA_NAMESER_H
3545#include <arpa/nameser.h>
3546#endif
3547#if HAVE_RESOLV_H
3548#include <resolv.h>
3549#endif
3550],
3551[_res.ns_list[[0]].addr;],
3552ac_cv_have_res_ns_list="yes",
3553ac_cv_have_res_ns_list="no"))
3554if test $ac_cv_have_res_ns_list = "yes" ; then
cc192b50 3555 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3556 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3557fi
3558fi
3559
090089c4 3560dnl Need the debugging version of malloc if available
3561XTRA_OBJS=''
6509a1a0 3562if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 3563 if test -r /usr/lib/debug/malloc.o ; then
3564 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3565 fi
3566 if test -r /usr/lib/debug/mallocmap.o ; then
3567 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3568 fi
3569fi
2bbd722b 3570
090089c4 3571AC_SUBST(XTRA_OBJS)
3572
38fea766 3573if test -z "$XTRA_LIBS"; then
3574 XTRA_LIBS="$LIBS"
0f5a16f8 3575 dnl minor cleanup
3576 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 3577 LIBS=''
3578fi
090089c4 3579AC_SUBST(XTRA_LIBS)
3580
090089c4 3581dnl Clean up after OSF/1 core dump bug
3582rm -f core
3583
6a9f6389 3584AC_CONFIG_FILES([\
a2794549 3585 Makefile \
3586 lib/Makefile \
a2794549 3587 scripts/Makefile \
3588 scripts/RunCache \
3589 scripts/RunAccel \
3590 src/Makefile \
3591 src/fs/Makefile \
3592 src/repl/Makefile \
3593 src/auth/Makefile \
5fa840c3
AR
3594 src/adaptation/Makefile \
3595 src/ICAP/Makefile \
3e7b6055 3596 src/eCAP/Makefile \
a2794549 3597 contrib/Makefile \
3598 snmplib/Makefile \
3599 icons/Makefile \
3600 errors/Makefile \
1077c1b8 3601 test-suite/Makefile \
99db07b3 3602 doc/Makefile \
0c510f3c 3603 helpers/Makefile \
3604 helpers/basic_auth/Makefile \
3605 helpers/basic_auth/LDAP/Makefile \
3606 helpers/basic_auth/MSNT/Makefile \
3607 helpers/basic_auth/NCSA/Makefile \
3608 helpers/basic_auth/PAM/Makefile \
3609 helpers/basic_auth/SMB/Makefile \
6e785d85 3610 helpers/basic_auth/mswin_sspi/Makefile \
0c510f3c 3611 helpers/basic_auth/YP/Makefile \
3612 helpers/basic_auth/getpwnam/Makefile \
3613 helpers/basic_auth/multi-domain-NTLM/Makefile \
3614 helpers/basic_auth/SASL/Makefile \
bcf74be7 3615 helpers/basic_auth/POP3/Makefile \
002d9b03 3616 helpers/basic_auth/DB/Makefile \
d80aac12 3617 helpers/basic_auth/squid_radius_auth/Makefile \
0c510f3c 3618 helpers/digest_auth/Makefile \
3619 helpers/digest_auth/password/Makefile \
55013f9c 3620 helpers/digest_auth/ldap/Makefile \
89f77e43 3621 helpers/digest_auth/eDirectory/Makefile \
0c510f3c 3622 helpers/ntlm_auth/Makefile \
3623 helpers/ntlm_auth/fakeauth/Makefile \
3624 helpers/ntlm_auth/no_check/Makefile \
3625 helpers/ntlm_auth/SMB/Makefile \
3626 helpers/ntlm_auth/SMB/smbval/Makefile \
6e785d85 3627 helpers/ntlm_auth/mswin_sspi/Makefile \
3628 helpers/negotiate_auth/Makefile \
3629 helpers/negotiate_auth/mswin_sspi/Makefile \
3e5d7cdf 3630 helpers/negotiate_auth/squid_kerb_auth/Makefile \
c6588c68 3631 helpers/external_acl/Makefile \
3632 helpers/external_acl/ip_user/Makefile \
3633 helpers/external_acl/ldap_group/Makefile \
74ab8d10 3634 helpers/external_acl/session/Makefile \
c6588c68 3635 helpers/external_acl/unix_group/Makefile \
736a9a4d 3636 helpers/external_acl/wbinfo_group/Makefile \
94ab55b0 3637 helpers/external_acl/mswin_lm_group/Makefile \
3638 tools/Makefile
53cbe3e4 3639])
43ae1d95 3640
377792e4 3641AC_CONFIG_SUBDIRS(lib/libTrie)
3642
3e7b6055
AR
3643# must configure libltdl subdir unconditionally for "make distcheck" to work
3644AC_CONFIG_SUBDIRS(lib/libLtdl)
3645
3646
6a9f6389 3647AC_OUTPUT