1 dnl Configuration input file for Squid
7 AC_INIT([Squid Web Proxy],[3.HEAD-BZR],[http://www.squid-cache.org/bugs/],[squid])
9 AC_CONFIG_HEADERS([include/autoconf.h])
10 AC_CONFIG_AUX_DIR(cfgaux)
11 AC_CONFIG_SRCDIR([src/main.cc])
12 AM_INIT_AUTOMAKE([tar-ustar nostdinc])
13 AC_REVISION($Revision$)dnl
14 AC_PREFIX_DEFAULT(/usr/local/squid)
17 PRESET_CFLAGS="$CFLAGS"
18 PRESET_LDFLAGS="$LDFLAGS"
20 dnl Set default LDFLAGS
21 if test -z "$LDFLAGS"; then
32 dnl Make the squid top srcdir available to sub-packages as --with-squid=PATH
33 new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir"
34 ac_configure_args="$new_configure_args"
37 use_loadable_modules=1
38 AC_MSG_CHECKING(whether to use loadable modules)
39 AC_ARG_ENABLE(loadable-modules,
40 AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) ,
42 case "${enableval}" in
43 yes) use_loadable_modules=yes ;;
44 no) use_loadable_modules=no ;;
45 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
47 AC_MSG_RESULT([$use_loadable_modules, explicitly])
50 use_loadable_modules=yes;
51 AC_MSG_RESULT([$use_loadable_modules, implicitly])
55 AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
57 if test $use_loadable_modules = yes;
59 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
66 if test $use_loadable_modules = yes;
68 AC_LIBLTDL_CONVENIENCE(lib/libLtdl)
73 # Do we need these unconditionally for "make distcheck" to work?
77 if test $use_loadable_modules = yes;
79 # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
80 LIBADD_DL=${lt_cv_dlopen_libs}
89 # LIBREGEX='' # libregex.a
91 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
95 if test -z "$EXEEXT"; then
98 # automake automatically adds .exe when installing binaries
103 dnl this should be expanded to a list of platform sensible support requirements.
104 dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
106 mingw|mingw32|cygwin|cygwin32)
107 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
110 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
116 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
117 CFLAGS="$CFLAGS -mthreads"
118 CXXFLAGS="$CXXFLAGS -mthreads"
119 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
120 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
121 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
123 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
126 MINGW_LIBS="-lmingwex"
127 AM_CONDITIONAL(USE_IPC_WIN32, true)
131 AM_CONDITIONAL(USE_IPC_WIN32, false)
135 if test -z "$CACHE_HTTP_PORT"; then
136 CACHE_HTTP_PORT="3128"
138 if test -z "$CACHE_ICP_PORT"; then
139 CACHE_ICP_PORT="3130"
143 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
144 [What default TCP port to use for HTTP listening?])
145 AC_SUBST(CACHE_HTTP_PORT)
146 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
147 [What default UDP port to use for ICP listening?])
148 AC_SUBST(CACHE_ICP_PORT)
150 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
152 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
154 CACHE_EFFECTIVE_USER="nobody"
155 AC_ARG_WITH(default-user,
156 AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
157 [ CACHE_EFFECTIVE_USER="$withval" ]
159 AC_SUBST(CACHE_EFFECTIVE_USER)
161 DEFAULT_LOG_DIR="$localstatedir/logs"
163 AS_HELP_STRING([--with-logdir=PATH],[Default location for squid logs. default: $DEFAULT_LOG_DIR]),
166 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
169 DEFAULT_LOG_DIR="$withval"
174 AC_SUBST(DEFAULT_LOG_DIR)
176 DEFAULT_PIDFILE="$localstatedir/squid.pid"
178 AS_HELP_STRING([--with-pidfile=PATH],[Default location for squid PID file. default: $DEFAULT_PIDFILE]),
181 AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
184 DEFAULT_PIDFILE="$withval"
189 AC_SUBST(DEFAULT_PIDFILE)
191 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
194 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
198 if test "$GCC" = "yes"; then
199 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
200 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
203 if test $GCCVER2 -lt 300 ; then
204 AC_MSG_FAILURE([GCC $GCCVER causes a coredump on $host. Try a more recent GCC version])
213 dnl Set Default CFLAGS
214 if test -z "$PRESET_CFLAGS"; then
215 if test "$GCC" = "yes"; then
218 # sunos has too many warnings for this to be useful
222 # Motorola cc/ld does not like -02 but is ok on -O
223 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
226 CFLAGS="-Wall $CFLAGS"
232 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
233 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
234 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
235 -Wl,-woff,85,-woff,84,-woff,134 \
236 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
237 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
238 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
239 -Wl,-woff,85,-woff,84,-woff,134 \
240 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
243 # Mogul says DEC compilers take both -g and -O2
244 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
253 dnl set squid required flags
254 if test "$GCC" = "yes"; then
255 dnl Guido Serassio (serassio@squid-cache.org) 20070811
256 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
257 dnl -Werror -Wmissing-prototypes -Wmissing-declarations
258 dnl TODO: check if the problem will be present in any other newer MinGW release.
261 SQUID_CFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wcomments"
264 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
267 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
272 AC_SUBST(SQUID_CFLAGS)
273 AC_SUBST(SQUID_CXXFLAGS)
275 AC_TEST_CHECKFORHUGEOBJECTS
276 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
279 if test -z "$PRESET_LDFLAGS"; then
280 if test "$GCC" = "yes"; then
283 # Silence Linker warnings 84, 85 and 134
284 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
301 AC_ARG_ENABLE(optimizations,
302 AS_HELP_STRING([--disable-optimizations],[Don't compile Squid with compiler optimizations enabled.
303 Optimization is good for production builds, but not
304 good for debugging. During development, use
305 --disable-optimizations to reduce compilation times
306 and allow easier debugging. This option implicitly
307 also enabled --disable-inline]),
308 [ if test "$enableval" = "no" ; then
309 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
310 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
311 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
316 AC_ARG_ENABLE(inline,
317 AS_HELP_STRING([--disable-inline],[Don't compile trivial methods as inline. Squid
318 is coded with much of the code able to be inlined.
319 Inlining is good for production builds, but not
320 good for development. During development, use
321 --disable-inline to reduce compilation times and
322 allow incremental builds to be quick. For
323 production builds, or load tests, use
324 --enable-inline to have squid make all trivial
325 methods inlinable by the compiler.]),
326 [ if test "$enableval" = "no" ; then
331 if test "$SquidInline" = "yes" ; then
332 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
333 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
335 AC_MSG_NOTICE([Inlining optimization disabled])
336 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
339 AC_ARG_ENABLE(debug-cbdata,
340 AS_HELP_STRING([--enable-debug-cbdata],[Provide some debug information in cbdata]),
341 [ if test "$enableval" = "yes" ; then
342 AC_MSG_NOTICE([cbdata debugging enabled])
343 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
347 dnl Nasty hack to get autoconf 2.64 on Linux to run.
348 dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
349 AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[])
351 dnl This is a developer only option.. developers know how to set defines
353 dnl AC_ARG_ENABLE(xmalloc-debug,
354 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
355 dnl [ if test "$enableval" = "yes" ; then
356 dnl AC_MSG_NOTICE([malloc debugging enabled])
357 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
361 dnl This is a developer only option.. developers know how to set defines
363 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
364 dnl [ --enable-xmalloc-debug-trace
365 dnl Detailed trace of memory allocations],
366 dnl [ if test "$enableval" = "yes" ; then
367 dnl AC_MSG_NOTICE([malloc debug trace enabled])
368 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
369 dnl AC_DEFINE(XMALLOC_DEBUG,1)
373 AC_ARG_ENABLE(xmalloc-statistics,
374 AS_HELP_STRING([--enable-xmalloc-statistics],[Show malloc statistics in status page]),
375 [ if test "$enableval" = "yes" ; then
376 AC_MSG_NOTICE([malloc statistics enabled])
377 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
381 AC_ARG_ENABLE(async-io,
382 AS_HELP_STRING([--enable-async-io[=N_THREADS]],[Shorthand for "--with-aufs-threads=N_THREADS --with-pthreads
383 --enable-storeio=ufs,aufs"]),
387 STORE_MODULES="ufs aufs"
392 aufs_io_threads=$enableval
394 STORE_MODULES="ufs aufs"
399 AC_ARG_WITH(aufs-threads,
400 AS_HELP_STRING([--with-aufs-threads=N_THREADS],[Tune the number of worker threads for the aufs object store.]),
403 aufs_io_threads=$withval
406 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
410 if test "$aufs_io_threads"; then
411 AC_MSG_NOTICE([With $aufs_io_threads aufs threads])
412 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
413 [Defines how many threads aufs uses for I/O])
417 AS_HELP_STRING([--with-dl],[Use dynamic linking]))
418 if test "$with_dl" = "yes"; then
419 AC_MSG_NOTICE([With dl])
422 AC_ARG_ENABLE(disk-io,
423 AS_HELP_STRING([--enable-disk-io="list of modules"],[Build support for the list of disk I/O modules.
424 Set without a value or omitted, all available modules will be built.
425 See src/DiskIO for a list of available modules, or
426 Programmers Guide section on DiskIO
427 for details on how to build your custom disk module]),
430 for dir in $srcdir/src/DiskIO/*; do
431 module="`basename $dir`"
432 if test -d "$dir" && test "$module" != CVS; then
433 AC_MSG_NOTICE([Autodetected $module DiskIO module])
434 MAYBE_DISK_MODULES="$MAYBE_DISK_MODULES $module"
437 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
440 AC_DEFINE(USE_DISKIO,0,[DiskIO modules are expected to be available.])
443 MAYBE_DISK_MODULES=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
444 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
448 [ if test -z "$MAYBE_DISK_MODULES"; then
449 AC_MSG_NOTICE([Enabling all available DiskIO modules (default)...])
450 for dir in $srcdir/src/DiskIO/*; do
451 module="`basename $dir`"
452 if test -d "$dir" && test "$module" != CVS; then
453 AC_MSG_NOTICE([Autodetected $module DiskIO module])
454 MAYBE_DISK_MODULES="$MAYBE_DISK_MODULES $module"
457 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
460 dnl Some autoconf.h defines we might enable later...
461 AC_DEFINE(USE_DISKIO_AIO, 0, [Whether POSIX AIO support is needed. Automatic])
462 AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic])
467 dnl Setup the module paths etc.
469 FOUND_DISKIO_BLOCKING=
470 FOUND_DISKIO_DISKDAEMON=
471 FOUND_DISKIO_DISKTHREADS=
475 for module in $MAYBE_DISK_MODULES none; do
476 if test "$module" = "none"; then
479 if ! test -d $srcdir/src/DiskIO/$module; then
480 AC_MSG_ERROR(disk-io $module does not exist)
484 if test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
485 AC_MSG_ERROR([DiskIO DiskDaemon module listed twice.])
487 FOUND_DISKIO_DISKDAEMON="yes"
488 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
489 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
490 DISK_MODULES="$DISK_MODULES DiskDaemon"
491 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
492 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
495 if test "$FOUND_DISKIO_DISKTHREADS" = "yes" ; then
496 AC_MSG_ERROR([DiskIO DiskThreads module listed twice.])
498 FOUND_DISKIO_DISKTHREADS="yes"
499 use_diskthreads="yes"
501 SAVE_SQUID_CFLAGS="$SQUID_CFLAGS"
502 SAVE_SQUID_CXXFLAGS="$SQUID_CXXFLAGS"
503 AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
504 if test "$with_pthreads" != "no"; then
505 dnl TODO: this needs to be extended to handle more systems and better
506 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
507 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
511 AC_MSG_NOTICE([Windows threads support automatically enabled])
513 i386-unknown-freebsd*)
514 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
515 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
516 if test "$GCC" = "yes" ; then
517 if test -z "$PRESET_LDFLAGS"; then
518 LDFLAGS="$LDFLAGS -pthread"
523 if test "$GCC" = "yes" ; then
524 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
525 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
526 AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
527 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
531 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
532 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
533 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
534 AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
535 [ SQUID_CFLAGS="$SAVE_SQUID_CFLAGS -D_REENTRANT -lpthread -mt"
536 SQUID_CXXFLAGS="$SAVE_SQUID_CXXFLAGS -D_REENTRANT -lpthread -mt"
537 AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
538 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
545 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
546 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
547 AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
548 [ AC_MSG_NOTICE(pthread library required but cannot be found.)
554 AC_MSG_NOTICE([Native pthreads support manually disabled.])
557 if test "$use_diskthreads" = "yes" ; then
558 AC_DEFINE(USE_DISKIO_DISKTHREADS, 1, [Whether pthreads support is needed. Automatic])
559 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
560 DISK_LIBS="$DISK_LIBS $LIBPTHREADS libDiskThreads.a"
561 DISK_MODULES="$DISK_MODULES DiskThreads"
562 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
564 AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic])
565 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
566 SQUID_CFLAGS="$SAVE_SQUID_CFLAGS"
567 SQUID_CXXFLAGS="$SAVE_SQUID_CXXFLAGS"
572 if test "$FOUND_DISKIO_AIO" = "yes" ; then
573 AC_MSG_ERROR([DiskIO AIO module listed twice.])
575 FOUND_DISKIO_AIO="yes"
576 dnl Check for POSIX AIO availability
579 AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
580 if test "$with_aio" != "no"; then
582 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
583 dnl On some systems POSIX AIO functions are in librt
584 dnl On some systems POSIX AIO functions are in libaio
585 AC_CHECK_LIB(rt,aio_read,[LIBAIO="-lrt"],AC_CHECK_LIB(aio,aio_read,[LIBAIO="-laio"],[]))
586 dnl Enable AIO if the library and headers are found
587 if test "$LIBAIO" != "" && test "$have_aio_header" = "yes"; then
588 AC_MSG_NOTICE([Native POSIX AIO support detected.])
591 dnl Windows does things differently. We provide wrappers.
592 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
596 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
599 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
605 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
608 dnl Use the POSIX AIO pieces if we actually need them.
609 if test "$use_aio" = "yes" ; then
610 AC_DEFINE(USE_DISKIO_AIO, 1, [Whether POSIX AIO support is needed. Automatic])
611 DISK_MODULES="$DISK_MODULES AIO"
612 DISK_LIBS="$DISK_LIBS $LIBAIO libAIO.a"
613 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
617 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
620 AC_MSG_NOTICE([Enabling AIO DiskIO module])
624 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
629 if test "$FOUND_DISKIO_BLOCKING" = "yes" ; then
630 AC_MSG_ERROR([DiskIO Blocking module listed twice.])
632 FOUND_DISKIO_BLOCKING="yes"
633 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
634 DISK_LIBS="$DISK_LIBS libBlocking.a"
635 DISK_MODULES="$DISK_MODULES Blocking"
636 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
640 AC_MSG_NOTICE([Enabling $module DiskIO module])
641 DISK_LIBS="$DISK_LIBS lib${module}.a"
642 DISK_MODULES="$DISK_MODULES ${module}"
643 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
647 AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
648 AC_SUBST(DISK_MODULES)
650 AC_SUBST(DISK_PROGRAMS)
651 AC_SUBST(DISK_LINKOBJS)
652 AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
653 AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
656 dnl Check what Storage formats are wanted.
657 dnl This version will error out with a message saying why if a required DiskIO is missing.
658 AC_ARG_ENABLE(storeio,
659 AS_HELP_STRING([--enable-storeio="list of modules"],[Build support for the list of store I/O modules.
660 The default is only to build the "ufs" module.
661 See src/fs for a list of available modules, or
662 Programmers Guide section <not yet written>
663 for details on how to build your custom store module]),
666 for dir in $srcdir/src/fs/*; do
667 module="`basename $dir`"
668 if test -d "$dir" && test "$module" != CVS && test "$module" != coss; then
669 STORE_MODULES="$STORE_MODULES $module"
676 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
680 [ if test -z "$STORE_MODULES"; then
684 if test -n "$STORE_MODULES"; then
685 dnl ensure that all modules a) exist and b) only include once.
686 STORE_MODULES_FULL=$STORE_MODULES
688 for module in $STORE_MODULES_FULL; do
689 have_mod=`echo "$STORE_MODULES" | grep "$module"`
690 if test "$have_mod" != ""; then
691 AC_MSG_NOTICE([Removing duplicate $module from storeio])
692 elif test -d $srcdir/src/fs/$module; then
693 STORE_MODULES="$STORE_MODULES $module"
695 AC_MSG_ERROR(storeio $module does not exist)
698 for module in $STORE_MODULES_FULL; do
701 echo "WARNING: COSS Support is not stable yet in Squid-3. Please do not use."
706 AC_MSG_NOTICE([Store modules built: $STORE_MODULES])
708 for fs in $STORE_MODULES none; do
711 if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
712 AC_MSG_ERROR([Storage diskd module requires DiskIO modules: Blocking or DiskDaemon])
717 if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKTHREADS" = "yes" ; then
718 AC_MSG_ERROR([Storage diskd module requires DiskIO modules: Blocking or DiskThreads])
723 if ! test "$FOUND_DISKIO_AIO" = "yes"; then
724 AC_MSG_ERROR([COSS requires POSIX AIO which is not available.])
727 dnl Automake om MinGW needs explicit exe extension
728 dnl for STORE_TESTS substition
730 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
734 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
738 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
739 AC_MSG_NOTICE([Adding UFS, as it contains core logic for diskd and aufs])
740 STORE_MODULES="$STORE_MODULES ufs"
742 dnl Automake om MinGW needs explicit exe extension
743 dnl for STORE_TESTS substition
745 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
748 AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
749 AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
750 AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
751 AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build")
754 dnl got final STORE_MODULES, build library lists
755 dnl This list will not be needed when each fs library has its own Makefile
757 dnl File system libraries to link executables with.
758 dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
760 for fs in $STORE_MODULES; do
761 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
762 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
763 HAVE_FS_TYPE=HAVE_FS_`echo $fs | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
764 AC_DEFINE_UNQUOTED($HAVE_FS_TYPE, 1)
767 AC_SUBST(STORE_LIBS_TO_BUILD)
768 AC_SUBST(STORE_LIBS_TO_ADD)
769 AC_SUBST(STORE_TESTS)
772 dnl At lest one removal policy is always needed.
773 dnl 'lru' removal policy is currently hard-coded by name for tests
774 dnl so we must set it as default.
776 AC_ARG_ENABLE(removal-policies,
777 AS_HELP_STRING([--enable-removal-policies="list of policies"],[Build support for the list of removal policies.
778 The default is only to build the "lru" module.
779 See src/repl for a list of available modules, or
780 Programmers Guide section 9.9 for details on how
781 to build your custom policy]),
784 for dir in $srcdir/src/repl/*; do
785 module="`basename $dir`"
786 if test -d "$dir" && test "$module" != CVS && test "$module" != "lru"; then
787 REPL_POLICIES="$REPL_POLICIES $module"
794 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
798 if test -n "$REPL_POLICIES"; then
799 for module in $REPL_POLICIES; do
800 if test -d $srcdir/src/repl/$module; then
803 AC_MSG_ERROR(Removal policy $module does not exist)
806 AC_MSG_NOTICE([Removal policies built: $REPL_POLICIES])
807 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
808 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
810 AC_SUBST(REPL_POLICIES)
814 AM_CONDITIONAL(ENABLE_PINGER, false)
816 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
817 [ if test "$enableval" = "yes" ; then
818 AC_MSG_NOTICE([ICMP enabled])
819 AC_DEFINE(USE_ICMP,1,[Define to use Squid's ICMP and Network Measurement features (highly recommended!)])
820 AM_CONDITIONAL(ENABLE_PINGER, true)
824 AM_CONDITIONAL(USE_DELAY_POOLS, false)
825 AC_ARG_ENABLE(delay-pools,
826 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
827 [ if test "$enableval" = "yes" ; then
828 AC_MSG_NOTICE([Delay pools enabled])
829 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
830 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
834 dnl disable generic/common adaptation support by default
837 AM_CONDITIONAL(USE_ESI, false)
839 AS_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat.
840 Enabling ESI will cause squid to follow the
841 Edge Acceleration Specification (www.esi.org).
842 This causes squid to IGNORE client Cache-Control headers.
843 DO NOT use this in a squid configured as a web proxy,
844 ONLY use it in a squid configured for webserver acceleration.]),
845 use_esi=$enableval, use_esi=no)
846 if test "$use_esi" = "yes" ; then
847 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
848 AM_CONDITIONAL(USE_ESI, true)
850 dnl Perform configuration consistency checks for ESI
851 dnl ESI support requires libexpat
852 AC_CHECK_LIB([expat], [main],
853 [ESI_LIBS="-lexpat"],
854 [AC_MSG_FAILURE([ESI support requires libexpat library, but no usable library was found])]
856 AC_CHECK_LIB([xml2], [main],
858 [AC_MSG_FAILURE([ESI support requires libxml2 library, but no usable library was found])]
860 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
863 AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
866 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
867 AC_ARG_ENABLE(icap-client,
868 AS_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
869 use_icap_client=$enableval, use_icap_client=no)
870 if test "$use_icap_client" = "yes" ; then
871 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
872 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
873 ICAP_LIBS="icap/libicap.la"
876 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
882 AC_MSG_CHECKING(whether to support eCAP)
884 AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]),
886 case "${enableval}" in
889 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
891 AC_MSG_RESULT([$use_ecap, explicitly])
895 AC_MSG_RESULT([$use_ecap, implicitly])
899 dnl Perform configuration consistency checks for eCAP
901 if test $use_ecap = yes;
903 dnl eCAP support requires loadable modules, which are enabled by default
904 if test "$use_loadable_modules" != "yes"
906 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
909 dnl eCAP support requires libecap
910 AC_CHECK_LIB([ecap], [main],
912 [AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])]
916 AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
917 if test $use_ecap = yes;
919 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
920 ECAP_LIBS="ecap/libecap.la $ECAP_LIBS"
923 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
926 dnl convenience library
932 dnl enable adaptation if requested by specific adaptation mechanisms
933 AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
934 if test $use_adaptation = yes
936 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
937 ADAPTATION_LIBS="adaptation/libadaptation.la"
939 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
942 AC_SUBST(ADAPTATION_LIBS)
945 dnl This is a developer only option. Developers know how to set defines
947 dnl AC_ARG_ENABLE(mem-gen-trace,
948 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
949 dnl [ if test "$enableval" = "yes" ; then
950 dnl AC_MSG_NOTICE([Memory trace (to file) enabled])
951 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
955 AC_ARG_ENABLE(useragent-log,
956 AS_HELP_STRING([--enable-useragent-log],[Enable logging of User-Agent header]),
957 [ if test "$enableval" = "yes" ; then
958 AC_MSG_NOTICE([User-Agent logging enabled])
959 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
960 By default, they are written to useragent.log in the Squid log
965 AC_ARG_ENABLE(referer-log,
966 AS_HELP_STRING([--enable-referer-log],[Enable logging of Referer header]),
967 [ if test "$enableval" = "yes" ; then
968 AC_MSG_NOTICE([Referer logging enabled])
969 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
970 By default, they are written to referer.log in the Squid log
977 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]),
978 [ if test "$enableval" = "no" ; then
979 AC_MSG_NOTICE([Web Cache Coordination Protocol disabled])
983 if test $USE_WCCP = 1; then
984 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
988 AC_ARG_ENABLE(wccpv2,
989 AS_HELP_STRING([--disable-wccpv2],[Disable Web Cache Coordination V2 Protocol]),
990 [ if test "$enableval" = "no" ; then
991 AC_MSG_NOTICE(["Web Cache Coordination V2 Protocol disabled])
995 if test $USE_WCCPv2 = 1; then
996 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
999 AC_ARG_ENABLE(kill-parent-hack,
1000 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]),
1001 [ if test "$enableval" = "yes" ; then
1002 AC_MSG_NOTICE([Kill parent on shutdown])
1003 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
1004 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
1011 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]),
1012 [ if test "$enableval" = "no" ; then
1013 AC_MSG_NOTICE([SNMP monitoring disabled])
1017 if test x"$USE_SNMP" = xtrue; then
1018 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
1019 SNMPLIB='../snmplib/libsnmp.a'
1022 AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
1024 AC_SUBST(makesnmplib)
1026 AC_ARG_ENABLE(cachemgr-hostname,
1027 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],[Make cachemgr.cgi default to this host.
1028 If unspecified, uses the name of the build-host]),
1029 [ case $enableval in
1031 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1032 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1033 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1039 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1040 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1045 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
1046 AC_ARG_ENABLE(arp-acl,
1047 AS_HELP_STRING([--enable-arp-acl],[Enable use of ARP ACL lists (ether address)]),
1048 [ if test "$enableval" = "yes" ; then
1049 AC_MSG_NOTICE([ARP ACL lists enabled (ether address)])
1062 LIBS="$LIBS -liphlpapi"
1065 LIBS="$LIBS -liphlpapi"
1068 AC_MSG_WARN([ARP ACL support probably won't work on $host.])
1072 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, ?).])
1073 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
1078 AM_CONDITIONAL(ENABLE_HTCP, false)
1080 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]),
1081 [ if test "$enableval" = "no" ; then
1082 AC_MSG_NOTICE([HTCP support disabled])
1085 if test x$USE_HTCP = xtrue; then
1086 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1088 AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
1090 dnl SSL is not enabled by default.
1091 AM_CONDITIONAL(ENABLE_SSL, false)
1093 dnl Default is to use OpenSSL when available
1095 AS_HELP_STRING([--enable-ssl],[Enable ssl gatewaying support using OpenSSL]),
1096 [ if test "$enableval" != "no"; then
1097 AC_MSG_NOTICE([SSL gatewaying using OpenSSL enabled])
1098 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
1099 AM_CONDITIONAL(ENABLE_SSL, true)
1102 dnl Native Windows port of OpenSSL needs -lgdi32
1103 SSLLIB='-lssleay32 -leay32 -lgdi32'
1106 SSLLIB='-lssl -lcrypto'
1113 dnl User may specify OpenSSL is needed from a non-standard location
1114 AC_ARG_WITH(openssl,
1115 AS_HELP_STRING([--with-openssl{=PATH}],[Compile with the OpenSSL libraries. The path to
1116 the OpenSSL development libraries and headers
1117 installation can be specified if outside of the
1118 system standard directories]),
1120 case "$with_openssl" in
1128 SSLLIBDIR="$with_openssl/lib"
1129 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1133 if test -n "$USE_OPENSSL"; then
1134 AC_MSG_NOTICE([Using OpenSSL MD5 implementation])
1135 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)])
1136 if test -z "$SSLLIB"; then
1137 SSLLIB="-lcrypto" # for MD5 routines
1139 dnl This is a workaround for RedHat 9 brain damage..
1140 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
1141 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1142 SSLLIBDIR="/usr/kerberos/lib"
1143 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1146 if test -n "$SSLLIBDIR"; then
1147 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1152 AC_ARG_ENABLE(forw-via-db,
1153 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]),
1154 [ if test "$enableval" = "yes" ; then
1155 AC_MSG_NOTICE([FORW-VIA enabled])
1156 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
1160 AC_ARG_ENABLE(cache-digests,
1161 AS_HELP_STRING([--enable-cache-digests],[Use Cache Digests.
1162 See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
1163 [ if test "$enableval" = "yes" ; then
1164 AC_MSG_NOTICE([Cache Disgests enabled])
1165 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
1169 dnl Size of COSS memory buffer
1170 AC_ARG_WITH(coss-membuf-size,
1171 AS_HELP_STRING([--with-coss-membuf-size=size],[COSS membuf size (default 1048576 bytes)]),
1172 [ if test -n "$withval" -a "x$withval" != "xno" ; then
1173 AC_MSG_NOTICE([Setting COSS membuf size to $with_coss_membuf_size bytes])
1174 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
1178 dnl check for netio plugin stuff
1183 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
1185 case "$enableval" in
1187 AC_MSG_WARN([Forcing poll() to be enabled])
1191 AC_MSG_WARN([Forcing poll() to be disabled])
1199 AC_ARG_ENABLE(select,
1200 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
1202 case "$enableval" in
1204 AC_MSG_WARN([Forcing select() to be enabled])
1205 SELECT_TYPE="select"
1208 AC_MSG_WARN([Forcing select() to be disabled])
1215 dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1217 AC_ARG_ENABLE(kqueue,
1218 AS_HELP_STRING([--enable-kqueue],[Enable kqueue(2) support (experimental).]),
1220 case "$enableval" in
1222 AC_MSG_WARN([Forcing kqueue() to be enabled])
1223 SELECT_TYPE="kqueue"
1224 AC_CHECK_HEADERS([sys/event.h],[],
1225 [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ])
1228 AC_MSG_WARN([Forcing kqueue() to be disabled])
1232 AC_CHECK_HEADERS([sys/event.h])
1240 AC_ARG_ENABLE(epoll,
1241 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
1243 case "$enableval" in
1245 AC_MSG_WARN([Forcing epoll() to be enabled])
1250 AC_MSG_WARN([Forcing epoll() to be disabled])
1255 dnl auto-detect and verify epoll header and library present and working
1256 if test -z "$disable_epoll"; then
1258 # Check for libepoll
1260 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
1261 AC_SUBST(EPOLL_LIBS)
1263 dnl on some systems it is provided by libc
1264 dnl not to worry, the working test below will catch them
1265 dnl and we don't want to force additional libraries
1268 # Check for epoll_ctl, may need -lepoll
1270 LIBS="$LIBS $EPOLL_LIBS"
1271 AC_CHECK_FUNCS(epoll_ctl)
1274 dnl epoll requires sys/epoll.h
1275 AC_CHECK_HEADERS([sys/epoll.h])
1277 dnl Verify that epoll really works
1278 if test $ac_cv_func_epoll_ctl = yes; then
1279 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
1280 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1281 #include <sys/epoll.h>
1284 int main(int argc, char **argv)
1286 int fd = epoll_create(256);
1288 perror("epoll_create:");
1293 ]])],[ac_cv_epoll_works=yes],[ac_cv_epoll_works=no],[]))
1296 if test "$force_epoll" = "yes" && test "$ac_cv_epoll_works" = "no" ; then
1297 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
1301 dnl Disable HTTP violations
1303 AC_ARG_ENABLE(http-violations,
1304 AS_HELP_STRING([--disable-http-violations],[This allows you to remove code which is known to
1305 violate the HTTP protocol specification.]),
1306 [ if test "$enableval" = "no" ; then
1307 AC_MSG_NOTICE([Disabling HTTP Violations])
1311 if test $http_violations = 1; then
1312 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.])
1314 AC_DEFINE(HTTP_VIOLATIONS, 0)
1317 dnl Enable IPFW Transparent Proxy
1318 AC_ARG_ENABLE(ipfw-transparent,
1319 AS_HELP_STRING([--enable-ipfw-transparent],[Enable Transparent Proxy support for systems
1320 using FreeBSD IPFW style redirection.]),
1321 [ if test "$enableval" = "yes" ; then
1322 AC_MSG_NOTICE([IPFW Transparent Proxy enabled])
1323 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1324 IPFW_TRANSPARENT="yes"
1326 AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1330 dnl Enable IP-Filter Transparent Proxy
1331 AC_ARG_ENABLE(ipf-transparent,
1332 AS_HELP_STRING([--enable-ipf-transparent],[Enable Transparent Proxy support for systems
1333 using IP-Filter network address redirection.]),
1334 [ if test "$enableval" = "yes" ; then
1335 AC_MSG_NOTICE([IP-Filter Transparent Proxy enabled])
1336 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.])
1337 IPF_TRANSPARENT="yes"
1339 AC_DEFINE(IPF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.])
1343 dnl Enable PF Transparent Proxy
1344 AC_ARG_ENABLE(pf-transparent,
1345 AS_HELP_STRING([--enable-pf-transparent],[Enable Transparent Proxy support for systems
1346 using PF network address redirection.]),
1347 [ if test "$enableval" = "yes" ; then
1348 AC_MSG_NOTICE([PF Transparent Proxy enabled])
1349 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1350 PF_TRANSPARENT="yes"
1352 AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1356 dnl Enable Linux Netfilter Transparent Proxy
1357 AC_ARG_ENABLE(linux-netfilter,
1358 AS_HELP_STRING([--enable-linux-netfilter],[Enable Transparent Proxy support for Linux (Netfilter)]),
1359 [ if test "$enableval" = "yes" ; then
1360 AC_MSG_NOTICE([Linux (Netfilter) Transparent Proxy enabled])
1361 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1362 LINUX_NETFILTER="yes"
1364 AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1368 dnl Enable Large file support
1372 AC_ARG_WITH(large-files,
1373 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]),
1374 [ if test "x$withval" = "xyes"; then
1379 dnl UNIX Build environment
1380 dnl AS_HELP_STRING is not suited here because it doesn't allow to specify newlines
1381 AC_ARG_WITH(build-environment,
1382 [ --with-build-environment=model
1383 The build environment to use. Normally one of
1384 POSIX_V6_ILP32_OFF32 32 bits
1385 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1386 POSIX_V6_LP64_OFF64 64 bits
1387 POSIX_V6_LPBIG_OFFBIG large pointers and files
1388 XBS5_ILP32_OFF32 32 bits (legacy)
1389 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1390 XBS5_LP64_OFF64 64 bits (legacy)
1391 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1392 default The default for your OS],
1393 [ case "$withval" in
1395 AC_MSG_FAILURE(["--with-build-environment expects a build environment string as used by getconf])
1398 buildmodel="$withval"
1403 if test $needlargefiles && test -z "$buildmodel"; then
1404 for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do
1405 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1410 if test -z "$buildmodel"; then
1411 AC_MSG_WARN(["No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
1415 case "$buildmodel" in
1417 if test "$needlargefiles"; then
1418 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
1419 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1420 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1424 AC_MSG_NOTICE([Using $buildmodel build environment])
1425 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1428 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
1430 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1431 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1432 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1433 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1436 dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1437 dnl for LDFLAGS -xarch=generic64, but:
1438 dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1439 dnl For gcc "-xarch=generic64" must be replaced with "-m64"
1440 dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1442 if test "$GCC" = "yes"; then
1443 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
1444 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1445 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1446 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
1447 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1448 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1449 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1451 AC_MSG_NOTICE([Removing -Usun on $host])
1452 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1453 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1456 dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1457 dnl so we must adjust something to avoid gcc errors.
1458 dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1459 dnl remove "-n32" from LDFLAGS
1460 dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1461 dnl "-64" from LDFLAGS
1463 if test "$GCC" = "yes"; then
1464 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1465 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1466 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1467 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1468 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1469 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1478 dnl Enable Linux transparent proxy support for obsolete TPROXY
1479 AC_ARG_ENABLE(linux-tproxy,
1480 AS_HELP_STRING([--enable-linux-tproxy],[Enable real Transparent Proxy support for Netfilter TPROXY
1482 [ if test "$enableval" = "yes" ; then
1483 AC_MSG_NOTICE(["Linux Netfilter/TPROXY v2 enabled])
1484 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1486 if test -z "$LINUX_NETFILTER"; then
1487 AC_MSG_NOTICE([Linux-Netfilter Transparent Proxy automatically enabled])
1488 LINUX_NETFILTER="yes"
1491 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1495 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1496 dnl Enable Leak Finding Functions
1497 AC_ARG_ENABLE(leakfinder,
1498 AS_HELP_STRING([--enable-leakfinder],[Enable Leak Finding code. Enabling this alone
1499 does nothing; you also have to modify the source
1500 code to use the leak finding functions. Probably
1501 Useful for hackers only.]),
1502 [ if test "$enableval" = "yes" ; then
1503 AC_MSG_NOTICE([Leak-Finding enabled])
1504 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1505 USE_LEAKFINDER="yes"
1506 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1511 AC_ARG_ENABLE(follow-x-forwarded-for,
1512 AS_HELP_STRING([--enable-follow-x-forwarded-for],[Enable support for following the X-Forwarded-For
1513 HTTP header to try to find the IP address of the
1514 original or indirect client when a request has
1515 been forwarded through other proxies.]),
1516 [ if test "$enableval" = "yes" ; then
1517 AC_MSG_NOTICE([follow X-Forwarded-For enabled])
1521 if test $follow_xff = 1; then
1522 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1524 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1528 AC_ARG_ENABLE(ident-lookups,
1529 AS_HELP_STRING([--disable-ident-lookups],[This allows you to remove code that performs Ident (RFC 931) lookups.]),
1530 [ if test "$enableval" = "no" ; then
1531 AC_MSG_NOTICE([Disabling Ident Lookups])
1535 if test $use_ident = 1; then
1536 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1538 AC_DEFINE(USE_IDENT, 0)
1541 AM_CONDITIONAL(USE_DNSSERVER, false)
1543 AC_ARG_ENABLE(internal-dns,
1544 AS_HELP_STRING([--disable-internal-dns],[Prevents Squid from directly sending and receiving DNS messages,
1545 and instead enables the old external 'dnsserver' processes.]),
1546 [ if test "$enableval" = "no" ; then
1547 AC_MSG_WARN([Disabling Internal DNS queries])
1551 if test "$use_dnsserver" = "yes"; then
1552 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1553 AM_CONDITIONAL(USE_DNSSERVER, true)
1556 dnl Select Default hosts file location
1557 AC_ARG_ENABLE(default-hostsfile,
1558 AS_HELP_STRING([--enable-default-hostsfile=path],[Select default location for hosts file.
1559 See hosts_file directive in squid.conf for details]),
1561 if test "$enableval" != "none" ; then
1562 if test -f $enableval; then
1563 OPT_DEFAULT_HOSTS=$enableval
1565 AC_MSG_WARN([Unable to find $enableval])
1569 OPT_DEFAULT_HOSTS="none"
1571 AC_MSG_NOTICE([Default hosts file set to: $enableval])
1572 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1573 AC_SUBST(OPT_DEFAULT_HOSTS)
1575 dnl Select auth schemes modules to build
1577 AS_HELP_STRING([--enable-auth="list of auth scheme modules"],[Build support for the list of authentication schemes.
1578 The default is to build support for the Basic scheme.
1579 See src/auth for a list of available modules, or
1580 Programmers Guide section authentication schemes
1581 for details on how to build your custom auth scheme
1583 [ case $enableval in
1585 for dir in $srcdir/src/auth/*; do
1586 module="`basename $dir`"
1587 if test -d "$dir" && test "$module" != CVS; then
1588 AUTH_MODULES="$AUTH_MODULES $module"
1595 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1599 [ if test -z "$AUTH_MODULES"; then
1600 AUTH_MODULES="ntlm basic digest negotiate"
1603 if test -n "$AUTH_MODULES"; then
1604 for module in $AUTH_MODULES; do
1605 if test -d $srcdir/src/auth/$module; then
1608 AC_MSG_ERROR(Auth scheme $module does not exist)
1610 eval AUTH_MODULE_${module}=yes
1612 AC_MSG_NOTICE([Auth scheme modules built: $AUTH_MODULES])
1614 AC_MSG_WARN([Auth scheme modules built: None])
1616 dnl Authentication libraries to build
1617 dnl This list will not be needed when each auth library has its own Makefile
1619 for module in $AUTH_MODULES; do
1620 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD lib${module}.la"
1622 AC_SUBST(AUTH_MODULES)
1623 AC_SUBST(AUTH_LIBS_TO_BUILD)
1625 dnl bundled auth modules, in order to have handy defines for the cppunit testsuite
1626 test -n "$AUTH_MODULE_basic" && AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built])
1627 test -n "$AUTH_MODULE_digest" && AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built])
1628 test -n "$AUTH_MODULE_ntlm" && AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
1629 test -n "$AUTH_MODULE_negotiate" && AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built])
1631 dnl Select basic auth scheme helpers to build
1632 if test -n "$AUTH_MODULE_basic"; then
1633 BASIC_AUTH_HELPERS="all"
1635 AC_ARG_ENABLE(basic-auth-helpers,
1636 AS_HELP_STRING([--enable-basic-auth-helpers="list of helpers"],[This option selects which basic scheme proxy_auth
1637 helpers to build and install as part of the normal
1638 build process. For a list of available
1639 helpers see the helpers/basic_auth directory.]),
1640 [ case "$enableval" in
1642 BASIC_AUTH_HELPERS="all"
1645 BASIC_AUTH_HELPERS=""
1648 if test -z "$AUTH_MODULE_basic"; then
1649 AC_MSG_WARN([Basic auth helpers selected without the basic scheme enabled])
1652 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1656 if test "$BASIC_AUTH_HELPERS" = "all" ; then
1657 BASIC_AUTH_HELPERS=""
1658 for dir in $srcdir/helpers/basic_auth/*; do
1659 helper="`basename $dir`"
1660 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1661 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1665 if test -n "$BASIC_AUTH_HELPERS"; then
1666 for helper in $BASIC_AUTH_HELPERS; do
1667 if test -d $srcdir/helpers/basic_auth/$helper; then
1674 AC_MSG_ERROR(Basic auth helper $helper does not exist)
1677 AC_MSG_NOTICE([Basic auth helpers built: $BASIC_AUTH_HELPERS])
1679 AC_SUBST(BASIC_AUTH_HELPERS)
1681 dnl Select ntlm auth helpers to build
1682 if test -n "$AUTH_MODULE_ntlm"; then
1683 NTLM_AUTH_HELPERS="all"
1685 AC_ARG_ENABLE(ntlm-auth-helpers,
1686 AS_HELP_STRING([--enable-ntlm-auth-helpers="list of helpers"],[This option selects which proxy_auth ntlm helpers
1687 to build and install as part of the normal build
1688 process. For a list of available helpers see
1689 the helpers/ntlm_auth directory.]),
1690 [ case "$enableval" in
1692 NTLM_AUTH_HELPERS="all"
1695 NTLM_AUTH_HELPERS=""
1698 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1702 if test "$NTLM_AUTH_HELPERS" = "all" ; then
1703 NTLM_AUTH_HELPERS=""
1704 for dir in $srcdir/helpers/ntlm_auth/*; do
1705 helper="`basename $dir`"
1706 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1707 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1711 if test -n "$NTLM_AUTH_HELPERS"; then
1712 for helper in $NTLM_AUTH_HELPERS; do
1713 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1716 AC_MSG_ERROR(NTLM Auth helper $helper does not exist)
1719 AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS])
1721 AC_SUBST(NTLM_AUTH_HELPERS)
1723 dnl Select negotiate auth helpers to build
1724 if test -n "$AUTH_MODULE_negotiate"; then
1725 NEGOTIATE_AUTH_HELPERS="all"
1727 AC_ARG_ENABLE(negotiate-auth-helpers,
1728 AS_HELP_STRING([--enable-negotiate-auth-helpers="list of helpers"],[This option selects which proxy_auth negotiate helpers
1729 to build and install as part of the normal build
1730 process. For a list of available helpers see
1731 the helpers/negotiate_auth directory.]),
1732 [ case "$enableval" in
1734 NEGOTIATE_AUTH_HELPERS="all"
1737 NEGOTIATE_AUTH_HELPERS=""
1740 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1744 if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1745 NEGOTIATE_AUTH_HELPERS=""
1746 for dir in $srcdir/helpers/negotiate_auth/*; do
1747 helper="`basename $dir`"
1748 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1749 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1753 if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1754 for helper in $NEGOTIATE_AUTH_HELPERS; do
1755 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1758 AC_MSG_ERROR(Negotiate Auth helper $helper does not exist)
1761 AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS])
1763 AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1764 AC_CONFIG_SUBDIRS(helpers/negotiate_auth/squid_kerb_auth)
1766 dnl Select digest auth scheme helpers to build
1767 if test -n "$AUTH_MODULE_digest"; then
1768 DIGEST_AUTH_HELPERS=all
1770 AC_ARG_ENABLE(digest-auth-helpers,
1771 AS_HELP_STRING([--enable-digest-auth-helpers="list of helpers"],[This option selects which digest scheme authentication
1772 helpers to build and install as part of the normal build
1773 process. For a list of available helpers see the
1774 helpers/digest_auth directory.]),
1775 [ case "$enableval" in
1777 DIGEST_AUTH_HELPERS="all"
1780 DIGEST_AUTH_HELPERS=""
1783 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1787 if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1788 DIGEST_AUTH_HELPERS=""
1789 for dir in $srcdir/helpers/digest_auth/*; do
1790 helper="`basename $dir`"
1791 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1792 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1796 if test -n "$DIGEST_AUTH_HELPERS"; then
1797 for helper in $DIGEST_AUTH_HELPERS; do
1798 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1801 AC_MSG_ERROR(digest auth helper $helper does not exist)
1804 AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
1806 AC_SUBST(DIGEST_AUTH_HELPERS)
1809 SAVED_CPPFLAGS=$CPPFLAGS
1811 AC_ARG_WITH(krb5-config,
1812 [ --with-krb5-config=PATH specify path to krb5-config @<:@default=detect@:>@],
1813 [ if test "$withval" = "yes"; then
1815 elif test "$withval" != "no"; then
1816 krb5confpath=$withval
1821 if test x"$krb5confpath" != xno; then
1822 if test x"$krb5confpath" != x; then
1823 if ! test -x "$krb5confpath"; then
1824 AC_MSG_WARN([krb5-config '$krb5confpath' not executable, ignoring])
1825 AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no)
1826 krb5confpath=krb5-config
1828 krb5_config_path=`dirname $krb5confpath`
1829 AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no, $krb5_config_path)
1831 AC_CHECK_PROG(ac_krb5_config,krb5-config,yes,no)
1832 krb5confpath=krb5-config
1835 if test "$ac_krb5_config" = "yes" ; then
1836 ac_heimdal="`$krb5confpath --version 2>/dev/null | grep -i heimdal`"
1837 ac_solaris="`$krb5confpath --version 2>/dev/null | grep -i solaris`"
1838 if test "x$ac_heimdal" != "x" ; then
1839 AC_DEFINE(HAVE_HEIMDAL_KERBEROS,1,[Define to 1 if you have Heimdal Kerberos])
1841 AC_DEFINE(HAVE_MIT_KERBEROS,1,[Define to 1 if you have MIT Kerberos])
1843 if test "$ac_solaris" != "" ; then
1844 KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`"
1845 KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`"
1846 KRB5INCS="-I/usr/include/gssapi $KRB5INCS"
1847 KRB5LIBS="-L/usr/lib -R/usr/lib -lgss -lresolv -lsocket -lnsl $KRB5LIBS"
1849 KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`"
1850 KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`"
1851 KRB5INCS="`$krb5confpath --cflags gssapi 2>/dev/null` $KRB5INCS"
1852 KRB5LIBS="`$krb5confpath --libs gssapi 2>/dev/null` $KRB5LIBS"
1854 CPPFLAGS="$CPPFLAGS $KRB5INCS"
1855 LIBS="$LIBS $KRB5LIBS"
1856 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1857 if test "x$ac_heimdal" == "x" ; then
1858 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
1860 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1861 AC_MSG_CHECKING([for max_skew in struct krb5_context])
1865 [ krb5_context kc; kc->max_skew = 1; ],
1866 [ AC_DEFINE(HAVE_MAX_SKEW_IN_KRB5_CONTEXT, 1, [Define to 1 if max_skew in struct krb5_context])
1867 AC_MSG_RESULT(yes) ],
1868 [ AC_MSG_RESULT(no) ]
1871 if test "x$ac_heimdal" == "x" ; then
1872 AC_CHECK_HEADERS(profile.h)
1874 AC_CHECK_LIB(com_err,error_message,
1875 AC_DEFINE(HAVE_ERROR_MESSAGE,1,[Define to 1 if you have error_message]),)
1876 AC_CHECK_LIB(krb5,krb5_get_err_text,
1877 AC_DEFINE(HAVE_KRB5_GET_ERR_TEXT,1,[Define to 1 if you have krb5_get_err_text]),)
1878 AC_CHECK_LIB(krb5,krb5_get_error_message,
1879 AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE,1,[Define to 1 if you have krb5_get_error_message]),)
1880 AC_CHECK_LIB(krb5,krb5_kt_free_entry,
1881 AC_DEFINE(HAVE_KRB5_KT_FREE_ENTRY,1,[Define to 1 if you have krb5_kt_free_entry]),)
1882 AC_CHECK_LIB(krb5,krb5_get_init_creds_keytab,
1883 AC_DEFINE(HAVE_GET_INIT_CREDS_KEYTAB,1,[Define to 1 if you have krb5_get_init_creds_keytab]),)
1884 AC_CHECK_LIB(krb5,krb5_get_max_time_skew,
1885 AC_DEFINE(HAVE_KRB5_GET_MAX_TIME_SKEW,1,[Define to 1 if you have krb5_get_max_time_skew]),)
1886 AC_CHECK_LIB(krb5,krb5_get_profile,
1887 AC_DEFINE(HAVE_KRB5_GET_PROFILE,1,[Define to 1 if you have krb5_get_profile]),)
1888 AC_CHECK_LIB(krb5,profile_get_integer,
1889 AC_DEFINE(HAVE_PROFILE_GET_INTEGER,1,[Define to 1 if you have profile_get_integer]),)
1890 AC_CHECK_LIB(krb5,profile_release,
1891 AC_DEFINE(HAVE_PROFILE_RELEASE,1,[Define to 1 if you have profile_release]),)
1892 AC_MSG_CHECKING([for memory cache])
1897 krb5_context context;
1900 krb5_init_context(&context);
1901 return krb5_cc_resolve(context, "MEMORY:test_cache", &cc);
1903 [AC_DEFINE(HAVE_KRB5_MEMORY_CACHE,1, [Define to 1 if you have MEMORY: cache support])
1904 AC_MSG_RESULT(yes)],
1907 AC_MSG_CHECKING([for working gssapi])
1909 #ifdef HAVE_GSSAPI_GSSAPI_H
1910 #include <gssapi/gssapi.h>
1915 #ifdef HAVE_GSSAPI_GSSAPI_EXT_H
1916 #include <gssapi/gssapi_ext.h>
1919 #ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
1920 #include <gssapi/gssapi_krb5.h>
1923 #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
1924 #include <gssapi/gssapi_generic.h>
1932 gss_create_empty_oid_set(&val, &set);
1936 ], [AC_DEFINE(HAVE_GSSAPI, 1, [GSSAPI support])
1937 AC_MSG_RESULT(yes)],
1939 AC_MSG_CHECKING([for spnego support])
1941 #ifdef HAVE_HEIMDAL_KERBEROS
1942 #ifdef HAVE_GSSAPI_GSSAPI_H
1943 #include <gssapi/gssapi.h>
1944 #elif defined(HAVE_GSSAPI_H)
1948 #ifdef HAVE_GSSAPI_GSSAPI_H
1949 #include <gssapi/gssapi.h>
1950 #elif defined(HAVE_GSSAPI_H)
1953 #ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
1954 #include <gssapi/gssapi_krb5.h>
1956 #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
1957 #include <gssapi/gssapi_generic.h>
1961 int main(int argc, char *argv[]) {
1962 OM_uint32 major_status,minor_status;
1963 gss_OID_set gss_mech_set;
1966 static gss_OID_desc _gss_mech_spnego = {6, (void *)"\x2b\x06\x01\x05\x05\x02"};
1967 gss_OID gss_mech_spnego = &_gss_mech_spnego;
1969 major_status = gss_indicate_mechs( &minor_status, &gss_mech_set);
1971 for (i=0;i<gss_mech_set->count;i++) {
1972 if (!memcmp(gss_mech_set->elements[i].elements,gss_mech_spnego->elements,gss_mech_set->elements[i].length)) {
1979 [ac_cv_have_spnego=yes
1980 AC_DEFINE(HAVE_SPNEGO,1, [Define to 1 if you have SPNEGO support])
1981 AC_MSG_RESULT(yes)],
1982 [ac_cv_have_spnego=no
1984 AC_MSG_CHECKING([for working krb5])
1993 krb5_context context;
1995 krb5_init_context(&context);
1999 ], [AC_DEFINE(HAVE_KRB5, 1, [KRB5 support])
2000 AC_MSG_RESULT(yes)],
2003 CPPFLAGS=$SAVED_CPPFLAGS
2007 AM_CONDITIONAL(HAVE_SPNEGO, test x"$ac_cv_have_spnego" = x"yes" )
2009 dnl Enable "NTLM fail open"
2010 AC_ARG_ENABLE(ntlm-fail-open,
2011 AS_HELP_STRING([--enable-ntlm-fail-open],[Enable NTLM fail open, where a helper that fails one of the
2012 Authentication steps can allow squid to still authenticate
2014 [ if test "$enableval" = "yes" ; then
2015 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.])
2019 dnl Select external_acl helpers to build
2020 EXTERNAL_ACL_HELPERS=all
2021 AC_ARG_ENABLE(external-acl-helpers,
2022 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],[This option selects which external_acl helpers to
2023 build and install as part of the normal build
2024 process. For a list of available helpers see the
2025 helpers/external_acl directory.]),
2026 [ case "$enableval" in
2028 EXTERNAL_ACL_HELPERS=all
2031 EXTERNAL_ACL_HELPERS=""
2034 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
2038 if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
2039 EXTERNAL_ACL_HELPERS=""
2040 for dir in $srcdir/helpers/external_acl/*; do
2041 helper="`basename $dir`"
2042 if test -f $dir/config.test && sh $dir/config.test "$@"; then
2043 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
2047 if test -n "$EXTERNAL_ACL_HELPERS"; then
2048 for helper in $EXTERNAL_ACL_HELPERS; do
2049 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
2052 AC_MSG_ERROR(external acl helper $helper does not exist)
2055 AC_MSG_NOTICE([External acl helpers built: $EXTERNAL_ACL_HELPERS])
2057 AC_SUBST(EXTERNAL_ACL_HELPERS)
2059 dnl Select url_rewrite helpers to build
2060 URL_REWRITE_HELPERS=all
2061 AC_ARG_ENABLE(url-rewrite-helpers,
2062 AC_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
2063 [This option selects which url_rewrite helpers to
2064 build and install as part of the normal build
2065 process. For a list of available helpers see the
2066 helpers/url_rewrite directory.]),
2067 [ case "$enableval" in
2069 URL_REWRITE_HELPERS=all
2072 URL_REWRITE_HELPERS=""
2075 URL_REWRITE_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
2079 if test "$URL_REWRITE_HELPERS" = "all" ; then
2080 URL_REWRITE_HELPERS=""
2081 for dir in $srcdir/helpers/url_rewrite/*; do
2082 helper="`basename $dir`"
2083 if test -f $dir/config.test && sh $dir/config.test "$@"; then
2084 URL_REWRITE_HELPERS="$URL_REWRITE_HELPERS $helper"
2088 if test -n "$URL_REWRITE_HELPERS"; then
2089 for helper in $URL_REWRITE_HELPERS; do
2090 if test -f $srcdir/helpers/url_rewrite/$helper/Makefile.in; then
2093 AC_MSG_ERROR(url_rewrite helper $helper does not exist)
2096 AC_MSG_NOTICE([url_rewrite helpers built: $URL_REWRITE_HELPERS])
2098 AC_SUBST(URL_REWRITE_HELPERS)
2101 AC_ARG_WITH(valgrind-debug,
2102 AS_HELP_STRING([--with-valgrind-debug],[Include debug instrumentation for use with valgrind]),
2111 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
2115 if test $valgrind; then
2116 AC_CHECK_HEADERS(valgrind/memcheck.h,
2117 [ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
2118 AC_MSG_NOTICE([Valgrind debug support enabled]) ],
2119 [ AC_MSG_WARN([Valgrind header not found. Valgrind support disabled.]) ]
2124 dnl Disable "memPools" code
2125 AC_ARG_ENABLE(mempools,
2126 AS_HELP_STRING([--disable-mempools],[Disable memPools. Note that this option now simply sets the
2127 default behaviour. Specific classes can override this at runtime, and
2128 only lib/MemPool.c needs to be altered to change the squid-wide
2129 default for all classes.]),
2130 [ if test "$enableval" = "no" ; then
2131 AC_MSG_NOTICE([memPools disabled])
2132 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
2134 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
2137 [ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
2140 dnl Enable WIN32 Service compile mode
2141 AC_ARG_ENABLE(win32-service,
2142 AS_HELP_STRING([--enable-win32-service],[Compile Squid as a WIN32 Service.
2143 Works only on MS-Windows platforms (NT and up).]),
2144 [ if test "$enableval" = "yes" ; then
2145 AC_MSG_NOTICE([Enabling WIN32 run service mode])
2146 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
2151 dnl Check for Cyrus SASL
2152 if test "$require_sasl" = "yes"; then
2153 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
2154 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
2155 AC_MSG_NOTICE([using SASL2])
2158 if test "$ac_cv_header_sasl_h" = "yes"; then
2159 AC_MSG_NOTICE([using SASL])
2162 AC_MSG_ERROR(Neither SASL nor SASL2 found)
2168 dnl Disable "unlinkd" code
2169 AC_ARG_ENABLE(unlinkd,
2170 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]),
2171 [ if test "$enableval" = "no" ; then
2177 # Here we should probably use some magic depending on the selected
2181 if test "$use_unlinkd" = "yes"; then
2182 AC_MSG_NOTICE([unlinkd enabled])
2183 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
2184 AM_CONDITIONAL(ENABLE_UNLINKD, true)
2186 AC_MSG_NOTICE([unlinkd disabled])
2187 AM_CONDITIONAL(ENABLE_UNLINKD, false)
2190 dnl Enable backtraces on fatal errors
2191 AC_ARG_ENABLE(stacktraces,
2192 AS_HELP_STRING([--enable-stacktraces],[Enable automatic call backtrace on fatal errors]),
2193 [ if test "$enableval" = "yes" ; then
2194 AC_MSG_NOTICE([Enabling automatic stack backtraces on fatal errors])
2195 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
2199 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
2200 dnl Enable USE_XPROF_STATS
2201 AC_ARG_ENABLE(cpu-profiling,
2202 AS_HELP_STRING([--enable-cpu-profiling],[Enable instrumentation to try and understand how CPU power
2203 is spent by squid, by enabling specific probes in selected
2204 functions. New probes can only be added by modifying the source code.
2205 It is meant to help developers in optimizing performance
2206 of Squid internal functions.
2207 If you are not developer you shouldn't enable this,
2208 as it slows squid down somewhat. See lib/Profiler.c for more details.]),
2209 [ if test "$enableval" = "yes" ; then
2210 AC_MSG_NOTICE([Enabling cpu-profiling])
2211 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
2212 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
2216 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
2217 AC_ARG_ENABLE(x-accelerator-vary,
2218 AS_HELP_STRING([--enable-x-accelerator-vary],[Enable support for the X-Accelerator-Vary
2219 HTTP header. Can be used to indicate
2220 variance within an accelerator setup.
2221 Typically used together with other code
2222 that adds custom HTTP headers to the requests.]),
2223 [ if test "$enableval" = "yes" ; then
2224 AC_MSG_NOTICE([Enabling support for X-Accelerator-Vary])
2225 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
2229 AC_ARG_ENABLE(zph-qos,
2230 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]),
2231 [ if test "$enableval" = "yes" ; then
2232 AC_MSG_NOTICE([ZPH QOS enabled])
2233 AC_DEFINE(USE_ZPH_QOS,1,
2234 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
2235 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
2239 dnl --with-maxfd present for compatibility with Squid-2.
2240 dnl undocumented in ./configure --help to encourage using the Squid-3 directive.
2245 squid_filedescriptors_num=$withval
2248 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
2252 AC_ARG_WITH(filedescriptors,
2253 AS_HELP_STRING([--with-filedescriptors=NUMBER],[Force squid to support NUMBER filedescriptors]),
2257 squid_filedescriptors_num=$withval
2260 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
2265 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
2266 if $CPPUNITCONFIG --help >/dev/null; then
2267 AC_MSG_NOTICE([using system installed cppunit])
2268 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2270 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2272 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
2274 SQUID_CPPUNIT_LIBS=''
2275 SQUID_CPPUNIT_INC=''
2278 AC_ARG_WITH(cppunit-basedir,
2279 AS_HELP_STRING([--with-cppunit-basedir=PATH],[Path where the cppunit headers are libraries are found
2280 for unit testing.]),
2281 [ if test -f $withval/include/cppunit/TestCase.h; then
2282 AC_MSG_NOTICE([Using cppunit includes from $withval])
2283 SQUID_CPPUNIT_INC="-I${withval}/include"
2285 AC_MSG_ERROR(Cannot find cppunit at $withval)
2287 if test -f $withval/lib/libcppunit.la; then
2288 AC_MSG_NOTICE([Using cppunit lib from $withval])
2289 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2290 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2292 AC_MSG_ERROR(Cannot find cppunit at $withval)
2295 AC_SUBST(SQUID_CPPUNIT_LIBS)
2296 AC_SUBST(SQUID_CPPUNIT_LA)
2297 AC_SUBST(SQUID_CPPUNIT_INC)
2299 # Force some compilers to use ANSI features
2303 if test "$ac_cv_prog_CC" = "cc" ; then
2304 AC_MSG_NOTICE([adding '-std1' to cc args for $host])
2310 if test "$ac_cv_prog_CC" = "cc" ; then
2311 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
2318 dnl Check for programs
2322 AC_PATH_PROG(SH, sh, /bin/sh)
2323 AC_PATH_PROG(FALSE, false, /usr/bin/false)
2324 AC_PATH_PROG(TRUE, true, /usr/bin/true)
2325 AC_PATH_PROG(MV, mv, $FALSE)
2326 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
2327 AC_PATH_PROG(LN, ln, cp)
2329 AC_PATH_PROG(RM, rm, $FALSE)
2330 dnl Libtool 2.2.6 requires: rm -f
2333 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2336 AC_PATH_PROG(PERL, perl, none)
2337 if test "$ac_cv_path_PERL" = "none"; then
2338 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
2343 AC_MSG_NOTICE([Disabling 'ranlib' for HP-UX...])
2349 AC_PATH_PROG(AR, ar, $FALSE)
2358 dnl Check for headers
2390 machine/byte_swap.h \
2397 netinet/in_systm.h \
2398 netinet/ip_fil_compat.h \
2457 linux/netfilter_ipv4.h \
2458 linux/netfilter_ipv4/ip_tproxy.h \
2460 SQUID_DEFAULT_INCLUDES
2464 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2465 #if HAVE_NETINET_IN_H
2466 #include <netinet/in.h>
2470 dnl *BSD dont include the depenencies for all their net/ and netinet/ files
2471 dnl We must include a few basic type headers for them to work.
2479 netinet/ip_compat.h\
2480 netinet/ip_fil_compat.h\
2490 SQUID_BSDNET_INCLUDES)
2492 AC_CHECK_HEADERS([libxml/parser.h], [], [
2493 SAVED_CPPFLAGS="$CPPFLAGS"
2494 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2495 unset ac_cv_header_libxml_parser_h
2496 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include=yes], [])
2497 CPPFLAGS="$SAVED_CPPFLAGS"
2499 if test "x$ac_cv_libxml2_include" = "xyes"; then
2500 SQUID_CXXFLAGS="-I/usr/include/libxml2 $SQUID_CXXFLAGS"
2507 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2510 #include <sys/time.h>
2517 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2518 #if HAVE_SYS_TYPES_H
2519 #include <sys/types.h>
2525 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2526 #if HAVE_SYS_TYPES_H
2527 #include <sys/types.h>
2533 dnl Override rusage() detect on MinGW because is emulated in source code
2536 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2537 ac_cv_func_getrusage='yes'
2538 AC_MSG_NOTICE([Using own rusage on Windows.])
2541 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2543 #include <sys/time.h>
2545 #if HAVE_SYS_RESOURCE_H
2546 #include <sys/resource.h>
2551 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2552 #if HAVE_SYS_TYPES_H
2553 #include <sys/types.h>
2555 #include <netinet/in.h>
2556 #include <netinet/in_systm.h>
2557 #include <netinet/ip.h>
2558 #if defined (__linux__) || defined (__CYGWIN__)
2567 dnl Check for typedefs
2568 AC_CHECK_SIZEOF(void *)
2570 dnl 8 bit integers - int8_t
2571 dnl if this is defined we trust it to be 8 bits
2572 AC_CHECK_TYPE(int8_t,[
2573 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2574 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2575 ],,SQUID_DEFAULT_INCLUDES)
2578 AC_CHECK_TYPE(char,[
2579 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2580 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2581 ],,SQUID_DEFAULT_INCLUDES)
2583 dnl unsigned 8 bit ints - u_int8_t
2584 dnl if this is defined we trust it to be 8 bits
2585 AC_CHECK_TYPE(u_int8_t,[
2586 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2587 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2588 ],,SQUID_DEFAULT_INCLUDES)
2591 dnl if this is defined we trust it to be 8 bits
2592 AC_CHECK_TYPE(uint8_t,[
2593 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2594 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2595 ],,SQUID_DEFAULT_INCLUDES)
2597 dnl 16 bit integers - int16_t
2598 dnl if this is defined we trust it to be 16 bits
2599 AC_CHECK_TYPE(int16_t,[
2600 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2601 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2602 ],,SQUID_DEFAULT_INCLUDES)
2605 AC_CHECK_TYPE(short,[
2606 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2607 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2608 ],,SQUID_DEFAULT_INCLUDES)
2612 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2613 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2614 ],,SQUID_DEFAULT_INCLUDES)
2616 dnl unsigned 16 bit ints - u_int16_t
2617 dnl if this is defined we trust it to be 16 bits
2618 AC_CHECK_TYPE(u_int16_t,[
2619 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2620 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2621 ],,SQUID_DEFAULT_INCLUDES)
2624 dnl if this is defined we trust it to be 16 bits
2625 AC_CHECK_TYPE(uint16_t,[
2626 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2627 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2628 ],,SQUID_DEFAULT_INCLUDES)
2630 dnl 32 bit signed int - int32_t
2631 dnl if this is defined we trust it to be 32 bits
2632 AC_CHECK_TYPE(int32_t,[
2633 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2634 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2635 ],,SQUID_DEFAULT_INCLUDES)
2638 AC_CHECK_TYPE(long,[
2639 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2640 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2641 ],,SQUID_DEFAULT_INCLUDES)
2643 dnl 32 bit unsigned int - u_int32_t
2644 dnl if this is defined we trust it to be 32 bits
2645 AC_CHECK_TYPE(u_int32_t,[
2646 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2647 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2648 ],,SQUID_DEFAULT_INCLUDES)
2651 dnl if this is defined we trust it to be 32 bits
2652 AC_CHECK_TYPE(uint32_t,[
2653 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2654 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2655 ],,SQUID_DEFAULT_INCLUDES)
2657 dnl 64 bit signed - int64_t
2658 dnl if this is defind we trust it to be 64 bits
2659 AC_CHECK_TYPE(int64_t,[
2660 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2661 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2662 ],,SQUID_DEFAULT_INCLUDES)
2665 dnl if this is defind we trust it to be 64 bits
2666 AC_CHECK_TYPE(__int64,[
2667 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2668 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2669 ],,SQUID_DEFAULT_INCLUDES)
2672 AC_CHECK_TYPE(long long,[
2673 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2674 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2675 ],,SQUID_DEFAULT_INCLUDES)
2677 dnl 64 bit unsigned - u_int64_t
2678 dnl if this is defind we trust it to be 64 bits
2679 AC_CHECK_TYPE(u_int64_t,[
2680 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2681 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2682 ],,SQUID_DEFAULT_INCLUDES)
2685 dnl if this is defind we trust it to be 64 bits
2686 AC_CHECK_TYPE(uint64_t,[
2687 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2688 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2689 ],,SQUID_DEFAULT_INCLUDES)
2691 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2692 dnl that is incompatible with the updated Solaris header files.
2693 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2694 AC_CHECK_TYPE(pad128_t,
2695 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2696 ,SQUID_DEFAULT_INCLUDES)
2698 AC_CHECK_TYPE(upad128_t,
2699 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2700 ,SQUID_DEFAULT_INCLUDES)
2702 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2703 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2704 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2705 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2706 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2707 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2708 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2709 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2711 dnl Check for special functions
2714 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2715 #include <sys/types.h>
2716 #include <sys/socket.h>
2722 dnl Check for libcap header (assume its not broken unless
2724 AC_ARG_ENABLE(caps, AS_HELP_STRING([--disable-caps],[disable usage of Linux capabilities library to control privileges]),
2725 [ if test "x$enableval" = "xyes" ; then
2726 AC_MSG_RESULT(forced yes)
2731 ],[AC_MSG_RESULT(yes)])
2732 if test "x$use_caps" = "xyes"; then
2733 dnl Check for libcap1 breakage or libcap2 fixed (assume broken unless found working)
2735 AC_CHECK_HEADERS(sys/capability.h)
2736 AC_CACHE_CHECK([for operational libcap2], $libcap_broken,
2737 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/capability.h>]], [[
2740 ]])],[libcap_broken=0],[])
2742 AC_DEFINE_UNQUOTED([LIBCAP_BROKEN],$libcap_broken,[if libcap2 is available and not clashing with libc])
2745 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2746 #include <sys/ipc.h>
2747 #include <sys/msg.h>])
2749 dnl Check for needed libraries
2750 AC_CHECK_LIB(nsl, main)
2751 AC_CHECK_LIB(socket, main)
2752 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2755 AC_MSG_CHECKING(for winsock)
2757 for curlib in ws2_32 wsock32; do
2758 LIBS="$LIBS -l$curlib"
2759 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>]], [[
2761 select(0,NULL,NULL,NULL,NULL);
2763 gethostname(NULL,0);
2764 ]])],[have_winsock=yes],[have_winsock=no])
2766 if test $have_winsock = yes; then
2767 ac_cv_func_select='yes'
2768 if test $curlib = ws2_32; then
2769 have_winsock=winsock2
2775 AC_MSG_RESULT($have_winsock)
2776 if test $have_winsock = winsock2; then
2777 AC_CHECK_HEADERS(winsock2.h)
2779 AC_CHECK_HEADERS(winsock.h)
2784 dnl Ripped from the Samba sources
2785 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2786 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2787 #include <sys/types.h>
2790 #include <sys/socket.h>
2791 #include <sys/un.h>]], [[
2792 struct sockaddr_un sunaddr;
2793 sunaddr.sun_family = AF_UNIX;
2794 ]])],[squid_cv_unixsocket=yes],[squid_cv_unixsocket=no])])
2795 if test x"$squid_cv_unixsocket" = x"yes"; then
2796 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2800 AC_CHECK_LIB(gnumalloc, main)
2801 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2802 AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc])
2803 ac_cv_func_mallinfo=no
2804 ac_cv_func_mallocblksize=no
2805 ac_cv_func_mallopt=no
2809 AC_MSG_NOTICE([skipping libmalloc check for $host])
2812 AC_MSG_NOTICE([skipping libmalloc check for $host])
2816 AC_CHECK_LIB(malloc, main)
2821 AC_CHECK_LIB(bsd, main)
2822 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2823 AC_CHECK_LIB(bind, gethostbyname)
2824 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2827 AC_MSG_NOTICE([skipping libresolv checks for $host])
2830 AC_CHECK_LIB(resolv, main)
2836 AC_MSG_NOTICE([Use MSVCRT for math functions.])
2839 AC_CHECK_LIB(m, main)
2843 dnl Enable IPv6 support
2844 AC_MSG_CHECKING([whether to enable IPv6])
2847 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
2848 [ if test "x$enableval" = "xyes" ; then
2854 ],[AC_MSG_RESULT(yes)])
2856 if test "$use_ipng" = "yes"; then
2858 dnl Solaris 10/11 requires -lsocket
2861 LIBS="$LIBS -lsocket"
2866 AC_CACHE_CHECK([if PF_INET6 is available], $use_ipng,
2867 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* PF_INET6 available check */
2868 # include <sys/types.h>
2869 # include <sys/socket.h>
2870 int main(int argc, char **argv) {
2871 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
2876 ]])],[ AC_MSG_RESULT(yes)
2878 SAVED_LIBS="$LIBS" ],[ AC_MSG_RESULT(no)
2884 if test "$use_ipng" = "yes"; then
2885 AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
2888 dnl Check for forced split-stack mode
2889 AC_MSG_CHECKING([for IPv6 split-stack requirement])
2890 AC_ARG_WITH(ipv6-split-stack,
2891 AS_HELP_STRING([--with-ipv6-split-stack],[Force-Enable experimental split-stack support for Windows XP and *BSD. Requires IPv6.]),
2893 AC_MSG_RESULT(yes)],
2894 [ AC_MSG_RESULT(no) ])
2896 dnl Check for IPv6 v4-mapping availability
2897 dnl Useful for other OS with hybrid-stack defaults turned OFF
2898 dnl But only usable if it actually works...
2899 if test "$use_v4mapped" = "yes" ; then
2900 AC_MSG_CHECKING([for IPv6 v4-mapping ability])
2901 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* IPPROTO_V4MAPPED is usable check */
2902 # include <sys/types.h>
2903 # include <sys/socket.h>
2904 # include <netinet/in.h>
2905 #if HAVE_NETINET_IN6_H
2906 # include <netinet/in6.h>
2908 int main(int argc, char **argv) {
2909 int s = socket(PF_INET6, SOCK_STREAM, 0);
2911 if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &tos, sizeof(int)) < 0)
2916 ]])],[ AC_MSG_RESULT(yes)
2918 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
2919 ],[ AC_MSG_RESULT(no)
2920 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets])
2925 dnl if we can't defer v4-mapping to the OS we are forced to split-stack the FD table.
2926 AC_MSG_CHECKING([for IPv6 stack type/mode])
2927 if test "$use_v4mapped" = "yes"; then
2928 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2929 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations])
2930 AC_MSG_RESULT(mapping hybrid)
2932 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2933 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
2934 AC_MSG_RESULT(split-stack or BSD non-mapping dual-stack)
2937 dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2938 AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2939 ac_cv_have_sin6_len_in_struct_sai, [
2940 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2941 #include <sys/types.h>
2942 #include <sys/socket.h>
2943 #include <netinet/in.h>
2944 ]], [[ struct sockaddr_in6 s; s.sin6_len = 1; ]])],[ ac_cv_have_sin6_len_in_struct_sai="yes" ],[ ac_cv_have_sin6_len_in_struct_sai="no"
2947 if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2948 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2950 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2954 # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
2955 AC_MSG_WARN([IPv6 is not available on this system.])
2956 AC_DEFINE(USE_IPV6,0,[Enable support for IPv6])
2957 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
2958 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
2961 dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2962 AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2963 ac_cv_have_ss_len_in_struct_ss, [
2964 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2965 #include <sys/types.h>
2966 #include <sys/socket.h>
2967 #include <netinet/in.h>
2968 ]], [[ struct sockaddr_storage s; s.ss_len = 1; ]])],[ ac_cv_have_ss_len_in_struct_ss="yes" ],[ ac_cv_have_ss_len_in_struct_ss="no"
2971 if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2972 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2974 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2977 dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2978 AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2979 ac_cv_have_sin_len_in_struct_sai, [
2980 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2981 #include <sys/types.h>
2982 #include <sys/socket.h>
2983 #include <netinet/in.h>
2984 ]], [[ struct sockaddr_in s; s.sin_len = 1; ]])],[ ac_cv_have_sin_len_in_struct_sai="yes" ],[ ac_cv_have_sin_len_in_struct_sai="no"
2987 if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
2988 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2990 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2993 dnl Check for libcrypt
2994 dnl Some of our helpers use crypt(3) which may be in libc, or in
2995 dnl libcrypt (eg FreeBSD)
2996 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2997 dnl Solaris10 provides MD5 natively through libmd5
2998 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
3001 dnl Check for libdl, used by auth_modules/PAM
3002 if test "$with_dl" = "yes"; then
3003 AC_CHECK_LIB(dl, dlopen)
3006 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
3007 dnl Robert Side <rside@aiinc.bc.ca>
3008 dnl Mon, 18 Jan 1999 17:48:00 GMT
3011 AC_CHECK_LIB(intl, strftime)
3015 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
3016 dnl only with Windows LDAP libraries using -lwldap32
3019 LIB_LDAP="-lwldap32"
3024 dnl LDAP helpers need to know if -llber is needed or not
3025 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
3034 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
3035 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
3036 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3037 #if HAVE_SYS_TYPES_H
3038 #include <sys/types.h>
3047 #endif]], [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],[ac_cv_dbopen_libdb="yes"],[ac_cv_dbopen_libdb="no"])
3050 if test $ac_cv_dbopen_libdb = yes; then
3055 dnl System-specific library modifications
3059 if test "$GCC" = "yes"; then
3060 AC_MSG_NOTICE([Removing -O for gcc on $host])
3061 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
3065 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
3066 LIBS=`echo $LIBS | sed -e s/-lsocket//`
3067 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
3068 LIBS=`echo $LIBS | sed -e s/-lnsl//`
3069 ac_cv_lib_nsl_main=no
3070 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
3071 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3073 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
3074 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
3075 dnl Please change your configure script. AIX doesn't need -lbsd.
3077 AC_MSG_NOTICE([Removing -lbsd for AIX...])
3078 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3081 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
3082 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
3083 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
3085 [*-*-solaris2.[0-4]])
3086 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3088 [*-sony-newsos[56]*])
3089 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3093 # Remove optimization for GCC 2.95.[123]
3094 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
3095 if test "$GCC" = "yes"; then
3096 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
3099 AC_MSG_NOTICE([Removing -O for gcc on $host with GCC $GCCVER])
3100 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
3105 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
3108 if test `uname -v` = "2.03"; then
3109 AC_MSG_NOTICE([disabling mallinfo for $host])
3110 ac_cv_func_mallinfo=no
3115 dnl This has to be before AC_CHECK_FUNCS
3116 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
3117 # when running configure.
3118 if test -z "$ac_cv_func_poll"; then
3121 # John Kay (jkay@nlanr.net) 19970818
3122 AC_MSG_NOTICE([disabling poll for $host...])
3123 ac_cv_func_poll='no'
3127 AC_MSG_NOTICE([disabling poll for $host...])
3128 ac_cv_func_poll='no'
3131 # Henrik Nordstrom (hno@squid-cache.org) 19980817
3132 # poll is problematic on Linux. We disable it
3133 # by default until Linux gets it right.
3134 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
3135 if test $rev -lt 002002; then
3136 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
3137 ac_cv_func_poll='no'
3140 [powerpc-ibm-aix4.1.*])
3141 # Mike Laster (mlaster@metavillage.com) 19981021
3142 AC_MSG_NOTICE([disabling poll for $host...])
3143 ac_cv_func_poll='no'
3146 # Robert Side <rside@aiinc.bc.ca>
3147 # Mon, 18 Jan 1999 17:48:00 GMT
3148 AC_MSG_NOTICE([disabling poll for $host...])
3149 ac_cv_func_poll='no'
3154 dnl Override statfs() detect on MinGW becasue is emulated in source code
3157 ac_cv_func_statfs='yes'
3161 dnl Check for library functions
3163 backtrace_symbols_fd \
3193 pthread_attr_setschedparam \
3194 pthread_attr_setscope \
3195 pthread_setschedparam \
3223 dnl ... and some we provide local replacements for
3237 # check for crypt, may require -lcrypt
3239 LIBS="$LIBS $CRYPTLIB"
3240 AC_CHECK_FUNCS(crypt)
3243 dnl Magic which checks whether we are forcing a type of comm loop we
3244 dnl are actually going to (ab)use
3246 dnl Actually do the define magic now
3247 dnl mostly ripped from squid-commloops, thanks to adrian and benno
3249 if test -n "$SELECT_TYPE"; then
3250 : # Already decided above. Nothing to do here
3251 elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
3253 elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
3254 SELECT_TYPE="kqueue"
3255 elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
3257 elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
3260 SELECT_TYPE="select_win32"
3263 SELECT_TYPE="select"
3267 AC_MSG_WARN([Eep! Can't find poll, kqueue, epoll, or select!])
3268 AC_MSG_WARN([I'll try select and hope for the best.])
3269 SELECT_TYPE="select"
3270 AC_DEFINE(USE_SELECT,1)
3273 AC_MSG_NOTICE([Using ${SELECT_TYPE} for the IO loop.])
3275 AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
3276 AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
3277 AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
3278 AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
3279 AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
3280 AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
3281 AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
3283 case $SELECT_TYPE in
3285 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
3288 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
3291 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
3294 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
3297 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
3303 dnl Yay! Another Linux brokenness. Its not good enough
3304 dnl to know that setresuid() exists, because RedHat 5.0 declares
3305 dnl setresuid() but doesn't implement it.
3307 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
3308 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3310 int main(int argc, char **argv) {
3311 if(setresuid(-1,-1,-1)) {
3312 perror("setresuid:");
3317 ]])],[ac_cv_func_setresuid="yes"],[ac_cv_func_setresuid="no"],[])
3319 if test "$ac_cv_func_setresuid" = "yes" ; then
3320 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.])
3323 dnl Yay! This one is a MacOSX brokenness. Its not good enough
3324 dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
3325 dnl copy that crashes with a buffer over-run!
3327 AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
3328 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3332 // we expect this to succeed, or crash on over-run.
3333 // if it passes otherwise we may need a better check.
3334 int main(int argc, char **argv)
3337 char *str = malloc(size);
3338 memset(str, 'x', size);
3339 strnstr(str, "fubar", size);
3342 ]])],[ac_cv_func_strnstr="yes"],[ac_cv_func_strnstr="no"],[])
3344 if test "$ac_cv_func_strnstr" = "yes" ; then
3345 AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
3347 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.])
3351 dnl Test for va_copy
3353 AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
3354 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3357 int f (int i, ...) {
3358 va_list args1, args2;
3359 va_start (args1, i);
3360 va_copy (args2, args1);
3361 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3363 va_end (args1); va_end (args2);
3366 int main(int argc, char **argv) { return f (0, 42); }
3367 ]])],[ac_cv_func_va_copy="yes"],[ac_cv_func_va_copy="no"],[])
3369 if test "$ac_cv_func_va_copy" = "yes" ; then
3370 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
3374 dnl Some systems support __va_copy
3376 AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
3377 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3380 int f (int i, ...) {
3381 va_list args1, args2;
3382 va_start (args1, i);
3383 __va_copy (args2, args1);
3384 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3386 va_end (args1); va_end (args2);
3389 int main(int argc, char **argv) { return f (0, 42); }
3390 ]])],[ac_cv_func___va_copy="yes"],[ac_cv_func___va_copy="no"],[])
3392 if test "$ac_cv_func___va_copy" = "yes" ; then
3393 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
3396 dnl IP-Filter support requires ipf header files. These aren't
3397 dnl installed by default, so we need to check for them
3398 if test "$IPF_TRANSPARENT" ; then
3399 AC_MSG_CHECKING(if IP-Filter header files are installed)
3400 # hold on to your hats...
3401 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3402 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
3403 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3404 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
3405 have_ipfilter_compat_header="yes"
3407 if test "x$have_ipfilter_compat_header" = "xyes" &&
3408 test "$ac_cv_header_ip_fil_h" = "yes" &&
3409 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3410 IPF_TRANSPARENT="yes"
3411 AC_DEFINE(IPF_TRANSPARENT, 1)
3412 elif test "$have_ipfilter_compat_header" = "yes" &&
3413 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3414 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3415 IPF_TRANSPARENT="yes"
3416 AC_DEFINE(IPF_TRANSPARENT, 1)
3418 IPF_TRANSPARENT="no"
3419 AC_DEFINE(IPF_TRANSPARENT, 0)
3421 AC_MSG_RESULT($IPF_TRANSPARENT)
3423 if test "$IPF_TRANSPARENT" = "no" ; then
3424 AC_MSG_WARN([Cannot find necessary IP-Filter header files])
3425 AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
3427 elif test "$IPF_TRANSPARENT" = "yes" ; then
3428 dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3429 dnl Solaris minor version (8, 9, 10, ...)
3432 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3433 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3434 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3441 dnl PF support requires a header file.
3442 if test "$PF_TRANSPARENT" ; then
3443 AC_MSG_CHECKING(if PF header file is installed)
3444 # hold on to your hats...
3445 if test "$ac_cv_header_net_pfvar_h" = "yes" || test "$ac_cv_header_net_pf_pfvar_h" = "yes"; then
3446 PF_TRANSPARENT="yes"
3447 AC_DEFINE(PF_TRANSPARENT, 1)
3450 AC_DEFINE(PF_TRANSPARENT, 0)
3452 AC_MSG_RESULT($PF_TRANSPARENT)
3454 if test "$PF_TRANSPARENT" = "no" ; then
3455 AC_MSG_WARN([Cannot find necessary PF header file])
3456 AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
3460 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3461 dnl Shamelessly copied from above
3462 if test "$LINUX_NETFILTER" ; then
3463 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
3464 # hold on to your hats...
3465 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3466 LINUX_NETFILTER="yes"
3467 AC_DEFINE(LINUX_NETFILTER, 1)
3469 LINUX_NETFILTER="no"
3470 AC_DEFINE(LINUX_NETFILTER, 0)
3472 AC_MSG_RESULT($LINUX_NETFILTER)
3474 if test "$LINUX_NETFILTER" = "no" ; then
3475 AC_MSG_WARN([Cannot find necessary Linux kernel (Netfilter) header files])
3476 AC_MSG_WARN([Linux Transparent and Intercepting Proxy support WILL NOT be enabled])
3479 dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3480 if test "$LINUX_NETFILTER" = "yes" && test "$use_caps" != "yes" ; then
3481 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3482 AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3483 AC_MSG_WARN([Reduced support to Interception Proxy])
3487 dnl Linux Netfilter/TPROXYv2 support requires some specific header files
3488 dnl Shamelessly copied from above
3489 if test "$LINUX_TPROXY2"; then
3490 if test "$use_caps" = "yes"; then
3491 AC_MSG_CHECKING(if TPROXYv2 header files are installed)
3492 # hold on to your hats...
3493 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
3495 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3498 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3500 AC_MSG_RESULT($LINUX_TPROXY2)
3501 if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3502 AC_MSG_WARN([Cannot find TPROXY v2 headers, you need to patch the kernel with ])
3503 AC_MSG_WARN([tproxy package from:])
3504 AC_MSG_WARN([ - lynx http://www.balabit.com/downloads/files/tproxy/])
3505 AC_MSG_WARN([Or select the '--enable-linux-netfilter' option instead for Netfilter support.])
3509 AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY v2])
3510 AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3515 AC_ARG_ENABLE(gnuregex,
3516 AS_HELP_STRING([--enable-gnuregex],[Compile GNUregex. Unless you have reason to use
3517 this option, you should not enable it.
3518 This library file is usually only required on Windows and
3519 very old Unix boxes which do not have their own regex
3520 library built in.]),
3521 [USE_GNUREGEX=$enableval])
3522 if test -z "$USE_GNUREGEX" ; then
3524 *-sun-solaris2.[[0-4]])
3532 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3533 if test -z "$USE_GNUREGEX"; then
3534 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
3537 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
3538 #include <regex.h>]], [[regex_t t; regcomp(&t,"",0);]])],[USE_GNUREGEX="no"],[USE_GNUREGEX="yes"])
3541 AC_MSG_RESULT($USE_GNUREGEX)
3542 if test "$USE_GNUREGEX" = "yes"; then
3543 # override system regex with ours. Not good. But what was asked for.
3545 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
3550 dnl Not cached since people are likely to tune this
3551 AC_MSG_CHECKING(Default FD_SETSIZE value)
3552 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3563 #include <sys/time.h>
3565 #if HAVE_SYS_SELECT_H
3566 #include <sys/select.h>
3568 #if HAVE_SYS_TYPES_H
3569 #include <sys/types.h>
3572 #include <winsock.h>
3575 #include <winsock2.h>
3577 int main(int argc, char **argv) {
3578 FILE *fp = fopen("conftestval", "w");
3579 fprintf (fp, "%d\n", FD_SETSIZE);
3582 ]])],[DEFAULT_FD_SETSIZE=`cat conftestval`],[DEFAULT_FD_SETSIZE=256],[DEFAULT_FD_SETSIZE=256])
3583 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
3584 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
3587 dnl Not cached since people are likely to tune this
3588 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
3589 dnl damn! FreeBSD's pthreads breaks dup2().
3591 if test -n "$squid_filedescriptors_num" ; then
3592 SQUID_MAXFD=$squid_filedescriptors_num
3593 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3596 i386-unknown-freebsd*)
3597 if echo "$LDFLAGS" | grep -q pthread; then
3598 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3601 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3605 #include <sys/time.h> /* needed on FreeBSD */
3606 #include <sys/param.h>
3607 #include <sys/resource.h>
3608 int main(int argc, char **argv) {
3611 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
3612 /* getrlimit and sysconf returns bogous values on cygwin32.
3613 * Number of fds is virtually unlimited in cygwin (sys/param.h)
3614 * __CYGWIN32__ is deprecated.
3620 #if defined(RLIMIT_NOFILE)
3621 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3622 perror("getrlimit: RLIMIT_NOFILE");
3624 #if defined(__APPLE__)
3625 /* asking for more than OPEN_MAX fails on Leopard */
3626 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3628 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3630 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3631 perror("setrlimit: RLIMIT_NOFILE");
3634 #elif defined(RLIMIT_OFILE)
3635 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3636 perror("getrlimit: RLIMIT_OFILE");
3638 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3639 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3640 perror("setrlimit: RLIMIT_OFILE");
3643 #endif /* RLIMIT_NOFILE */
3644 #endif /* HAVE_SETRLIMIT */
3645 /* by starting at 2^14, we will never get higher
3646 than 2^15 for SQUID_MAXFD */
3650 if (dup2(0, i) < 0) {
3658 #endif /* IF !DEF CYGWIN */
3659 fp = fopen("conftestval", "w");
3660 fprintf (fp, "%d\n", i & ~0x3F);
3663 ]])],[SQUID_MAXFD=`cat conftestval`],[SQUID_MAXFD=256],[SQUID_MAXFD=256])
3664 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3670 AC_MSG_RESULT($SQUID_MAXFD)
3672 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3673 if test "$SQUID_MAXFD" -lt 512 ; then
3674 AC_MSG_WARN([$SQUID_MAXFD may not be enough filedescriptors if your])
3675 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3676 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3677 AC_MSG_WARN([on how to increase your filedescriptor limit])
3682 if test `expr $SQUID_MAXFD % 64` != 0; then
3683 AC_MSG_WARN([$SQUID_MAXFD is not an multiple of 64. This may cause issues on certain platforms.])
3687 dnl Not cached since people are likely to tune this
3688 AC_MSG_CHECKING(Default UDP send buffer size)
3689 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3692 #include <sys/types.h>
3693 #if HAVE_SYS_SOCKET_H
3694 #include <sys/socket.h>
3696 #if HAVE_NETINET_IN_H
3697 #include <netinet/in.h>
3700 #include <winsock.h>
3703 #include <winsock2.h>
3705 int main(int argc, char **argv)
3709 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3710 int len=sizeof(int);
3712 WSAStartup(2, &wsaData);
3714 socklen_t len=sizeof(socklen_t);
3716 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3717 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3718 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3721 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3723 if (val<=0) return 1;
3724 fp = fopen("conftestval", "w");
3725 fprintf (fp, "%d\n", val);
3728 ]])],[SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_SNDBUF=16384],[SQUID_DETECT_UDP_SO_SNDBUF=16384])
3729 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3730 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3732 dnl Not cached since people are likely to tune this
3733 AC_MSG_CHECKING(Default UDP receive buffer size)
3734 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3737 #include <sys/types.h>
3738 #if HAVE_SYS_SOCKET_H
3739 #include <sys/socket.h>
3741 #if HAVE_NETINET_IN_H
3742 #include <netinet/in.h>
3745 #include <winsock.h>
3748 #include <winsock2.h>
3750 int main(int argc, char **argv)
3754 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3755 int len=sizeof(int);
3757 WSAStartup(2, &wsaData);
3759 socklen_t len=sizeof(socklen_t);
3761 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3762 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3763 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3766 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3768 if (val <= 0) return 1;
3769 fp = fopen("conftestval", "w");
3770 fprintf (fp, "%d\n", val);
3773 ]])],[SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_RCVBUF=16384],[SQUID_DETECT_UDP_SO_RCVBUF=16384])
3774 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3775 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3777 dnl Not cached since people are likely to tune this
3778 AC_MSG_CHECKING(Default TCP send buffer size)
3779 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3782 #include <sys/types.h>
3783 #if HAVE_SYS_SOCKET_H
3784 #include <sys/socket.h>
3786 #if HAVE_NETINET_IN_H
3787 #include <netinet/in.h>
3790 #include <winsock.h>
3793 #include <winsock2.h>
3795 int main(int argc, char **argv)
3799 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3800 int len=sizeof(int);
3802 WSAStartup(2, &wsaData);
3804 socklen_t len=sizeof(socklen_t);
3806 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3807 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3808 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3811 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3813 if (val <= 0) return 1;
3814 fp = fopen("conftestval", "w");
3815 fprintf (fp, "%d\n", val);
3818 ]])],[SQUID_TCP_SO_SNDBUF=`cat conftestval`],[SQUID_TCP_SO_SNDBUF=16384],[SQUID_TCP_SO_SNDBUF=16384])
3819 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3820 if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3821 AC_MSG_NOTICE([Limiting send buffer size to 32K])
3822 SQUID_TCP_SO_SNDBUF=32768
3824 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3826 dnl Not cached since people are likely to tune this
3827 AC_MSG_CHECKING(Default TCP receive buffer size)
3828 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3831 #include <sys/types.h>
3832 #if HAVE_SYS_SOCKET_H
3833 #include <sys/socket.h>
3835 #if HAVE_NETINET_IN_H
3836 #include <netinet/in.h>
3839 #include <winsock.h>
3842 #include <winsock2.h>
3844 int main(int argc, char **argv)
3848 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3849 int len=sizeof(int);
3851 WSAStartup(2, &wsaData);
3853 socklen_t len=sizeof(socklen_t);
3855 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3856 #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3857 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3860 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3862 if (val <= 0) return 1;
3863 fp = fopen("conftestval", "w");
3864 fprintf (fp, "%d\n", val);
3867 ]])],[SQUID_TCP_SO_RCVBUF=`cat conftestval`],[SQUID_TCP_SO_RCVBUF=16384],[SQUID_TCP_SO_RCVBUF=16384])
3868 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3869 if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3870 AC_MSG_NOTICE([Limiting receive buffer size to 64K])
3871 SQUID_TCP_SO_RCVBUF=65535
3873 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3874 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3875 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[char *s = sys_errlist;]])],[ac_cv_needs_sys_errlist="no"],[ac_cv_needs_sys_errlist="yes"])
3877 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3878 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3881 dnl Not cached since people are likely to change this
3882 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3883 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
3884 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],[AC_MSG_RESULT(no)])
3886 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3887 AC_MSG_CHECKING(for working statvfs() interface)
3888 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3891 #include <sys/types.h>
3892 #include <sys/statvfs.h>
3895 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3896 sfs.f_files = sfs.f_ffree = 0;
3897 statvfs("/tmp", &sfs);
3898 ]])],[ac_cv_func_statvfs=yes],[ac_cv_func_statvfs=no])
3899 AC_MSG_RESULT($ac_cv_func_statvfs)
3900 if test "$ac_cv_func_statvfs" = "yes" ; then
3901 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3905 dnl Detect what resolver fields we have available to use...
3906 AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3907 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3908 #if HAVE_SYS_TYPES_H
3909 #include <sys/types.h>
3911 #if HAVE_NETINET_IN_H
3912 #include <netinet/in.h>
3914 #if HAVE_ARPA_INET_H
3915 #include <arpa/inet.h>
3917 #if HAVE_ARPA_NAMESER_H
3918 #include <arpa/nameser.h>
3923 ]], [[_res_ext.nsaddr_list[[0]].s_addr;]])],[ac_cv_have_res_ext_nsaddr_list="yes"],[ac_cv_have_res_ext_nsaddr_list="no"]))
3924 if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3925 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3926 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3929 if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
3930 AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3931 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3932 #if HAVE_SYS_TYPES_H
3933 #include <sys/types.h>
3935 #if HAVE_NETINET_IN_H
3936 #include <netinet/in.h>
3938 #if HAVE_ARPA_INET_H
3939 #include <arpa/inet.h>
3941 #if HAVE_ARPA_NAMESER_H
3942 #include <arpa/nameser.h>
3947 ]], [[_res._u._ext.nsaddrs[[0]]->sin6_addr;]])],[ac_cv_have_res_ext_nsaddrs="yes"],[ac_cv_have_res_ext_nsaddrs="no"]))
3948 if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3949 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3950 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3954 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3955 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3956 #if HAVE_SYS_TYPES_H
3957 #include <sys/types.h>
3959 #if HAVE_NETINET_IN_H
3960 #include <netinet/in.h>
3962 #if HAVE_ARPA_INET_H
3963 #include <arpa/inet.h>
3965 #if HAVE_ARPA_NAMESER_H
3966 #include <arpa/nameser.h>
3971 ]], [[_res.nsaddr_list[[0]];]])],[ac_cv_have_res_nsaddr_list="yes"],[ac_cv_have_res_nsaddr_list="no"]))
3972 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3973 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3974 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3977 if test "$_SQUID_RES_NSADDR_LIST" = ""; then
3978 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3979 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3980 #if HAVE_SYS_TYPES_H
3981 #include <sys/types.h>
3983 #if HAVE_NETINET_IN_H
3984 #include <netinet/in.h>
3986 #if HAVE_ARPA_INET_H
3987 #include <arpa/inet.h>
3989 #if HAVE_ARPA_NAMESER_H
3990 #include <arpa/nameser.h>
3995 ]], [[_res.ns_list[[0]].addr;]])],[ac_cv_have_res_ns_list="yes"],[ac_cv_have_res_ns_list="no"]))
3996 if test $ac_cv_have_res_ns_list = "yes" ; then
3997 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3998 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
4002 dnl Squid will usually attempt to translate when packaging or building from VCS
4003 use_translation="yes"
4004 AC_ARG_ENABLE(translation,
4005 AS_HELP_STRING([--disable-translation],[Prevent Squid generating localized error page templates and manuals.
4006 Which is usually tried, but may not be needed.]),
4007 [ if test "$enableval" = "no" ; then
4011 dnl Squid now has .po translation capability, given the right toolkit
4012 if test "$use_translation" = "yes" ; then
4013 AX_WITH_PROG([PO2HTML],[po2html])
4019 dnl Squid now has limited locale handling ...
4022 AC_ARG_ENABLE(auto-locale,
4023 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
4024 clients request headers.
4025 When disabled Squid requires explicit language configuration.]),
4026 [ if test "$enableval" = "no" ; then
4030 if test "$use_errlocale" = "yes" ; then
4031 AC_MSG_NOTICE([Enabling Multi-Language Support])
4032 AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
4034 AC_MSG_WARN([Disabling Multi-Language Support])
4035 AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
4038 dnl Need the debugging version of malloc if available
4040 if test "$ac_cv_lib_malloc_main" = "yes" ; then
4041 if test -r /usr/lib/debug/malloc.o ; then
4042 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
4044 if test -r /usr/lib/debug/mallocmap.o ; then
4045 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
4050 if test -z "$XTRA_LIBS"; then
4053 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
4058 dnl Clean up after OSF/1 core dump bug
4074 src/adaptation/Makefile \
4075 src/adaptation/icap/Makefile \
4076 src/adaptation/ecap/Makefile \
4079 src/ident/Makefile \
4085 test-suite/Makefile \
4087 doc/manuals/Makefile \
4089 helpers/basic_auth/Makefile \
4090 helpers/basic_auth/LDAP/Makefile \
4091 helpers/basic_auth/MSNT/Makefile \
4092 helpers/basic_auth/NCSA/Makefile \
4093 helpers/basic_auth/PAM/Makefile \
4094 helpers/basic_auth/SMB/Makefile \
4095 helpers/basic_auth/mswin_sspi/Makefile \
4096 helpers/basic_auth/YP/Makefile \
4097 helpers/basic_auth/getpwnam/Makefile \
4098 helpers/basic_auth/multi-domain-NTLM/Makefile \
4099 helpers/basic_auth/SASL/Makefile \
4100 helpers/basic_auth/POP3/Makefile \
4101 helpers/basic_auth/DB/Makefile \
4102 helpers/basic_auth/squid_radius_auth/Makefile \
4103 helpers/digest_auth/Makefile \
4104 helpers/digest_auth/password/Makefile \
4105 helpers/digest_auth/ldap/Makefile \
4106 helpers/digest_auth/eDirectory/Makefile \
4107 helpers/ntlm_auth/Makefile \
4108 helpers/ntlm_auth/fakeauth/Makefile \
4109 helpers/ntlm_auth/no_check/Makefile \
4110 helpers/ntlm_auth/smb_lm/Makefile \
4111 helpers/ntlm_auth/smb_lm/smbval/Makefile \
4112 helpers/ntlm_auth/mswin_sspi/Makefile \
4113 helpers/negotiate_auth/Makefile \
4114 helpers/negotiate_auth/mswin_sspi/Makefile \
4115 helpers/external_acl/Makefile \
4116 helpers/external_acl/ip_user/Makefile \
4117 helpers/external_acl/ldap_group/Makefile \
4118 helpers/external_acl/session/Makefile \
4119 helpers/external_acl/unix_group/Makefile \
4120 helpers/external_acl/wbinfo_group/Makefile \
4121 helpers/external_acl/mswin_ad_group/Makefile \
4122 helpers/external_acl/mswin_lm_group/Makefile \
4123 helpers/url_rewrite/Makefile \
4124 helpers/url_rewrite/fake/Makefile \
4128 AC_CONFIG_SUBDIRS(lib/libTrie)
4130 # must configure libltdl subdir unconditionally for "make distcheck" to work
4131 AC_CONFIG_SUBDIRS(lib/libLtdl)