1 ## Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 ## Squid software is distributed under GPLv2+ license and includes
4 ## contributions from numerous individuals and organizations.
5 ## Please see the COPYING and CONTRIBUTORS files for details.
8 AC_INIT([Squid Web Proxy],[4.0.0-BZR],[http://bugs.squid-cache.org/],[squid])
10 AC_CONFIG_HEADERS([include/autoconf.h])
11 AC_CONFIG_AUX_DIR(cfgaux)
12 AC_CONFIG_SRCDIR([src/main.cc])
13 AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects])
14 AC_REVISION($Revision$)dnl
15 AC_PREFIX_DEFAULT(/usr/local/squid)
18 m4_include([acinclude/ax_with_prog.m4])
19 m4_include([acinclude/init.m4])
20 m4_include([acinclude/squid-util.m4])
21 m4_include([acinclude/compiler-flags.m4])
22 m4_include([acinclude/os-deps.m4])
23 m4_include([acinclude/krb5.m4])
24 m4_include([acinclude/pam.m4])
25 m4_include([acinclude/pkg.m4])
26 m4_include([acinclude/lib-checks.m4])
27 m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
28 m4_include([acinclude/ax_cxx_0x_types.m4])
30 PRESET_CFLAGS="$CFLAGS"
31 PRESET_CXXFLAGS="$CXXFLAGS"
32 PRESET_LDFLAGS="$LDFLAGS"
34 dnl Set default LDFLAGS
35 if test "x$LDFLAGS" = "x" ; then
46 # Clang 3.2 on some CPUs requires -march-native to detect correctly.
47 # GCC 4.3+ can also produce faster executables when its used.
48 # But building inside a virtual machine environment has been found to
49 # cause random Illegal Instruction errors due to mis-detection of CPU.
50 AC_ARG_ENABLE(arch-native,
51 AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific
52 optimizations with the -march=native parameter.
53 This flag disables the optimization. The default is to
54 auto-detect compiler support and use where available.]), [
55 SQUID_YESNO([$enableval],
56 [Unrecognized argument to --disable-arch-native: $enableval])
58 AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}])
59 if test "x${enable_arch_native}" != "xno"; then
60 SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native])
63 # might be cross-compiling.
64 # NP: BUILDCXXFLAGS defined at the end of configure after CXXFLAGS fully known.
65 AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen])
66 if test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"; then
67 AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Uses BUILDCXX instead.])
70 if test "x$BUILDCXX" = "x"; then
72 if test "x$squid_cv_check_marchnative" = "xyes"; then
73 CXXFLAGS="$CXXFLAGS -march=native"
78 AC_MSG_CHECKING([simplified host os])
79 simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'`
80 squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
81 if test -n "$squid_host_os_version"; then
82 squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`"
84 squid_host_os="$simple_host_os"
86 AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
87 # on windows squid_host_os is either mingw or cygwin, version is 32
89 # this needs to be before any test is run, to have more standard
90 # functions available on some Unix sysems (e.g. Solaris)
91 if test "x$squid_host_os" = "solaris" -a "x$GCC" != "x" ; then
92 AC_USE_SYSTEM_EXTENSIONS
95 # Check for C++11 compiler support
96 AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
105 AC_PATH_PROG(SH, sh, /bin/sh)
106 AC_PATH_PROG(FALSE, false, /usr/bin/false)
107 AC_PATH_PROG(TRUE, true, /usr/bin/true)
108 AC_PATH_PROG(MV, mv, $FALSE)
109 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
110 AC_PATH_PROG(LN, ln, cp)
111 AC_PATH_PROG(CHMOD, chmod, $FALSE)
112 AC_PATH_PROG(TR, tr, $FALSE)
113 AC_PATH_PROG(RM, rm, $FALSE)
114 AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
115 dnl Libtool 2.2.6 requires: rm -f
118 AC_PATH_PROG(PERL, perl, none)
119 if test "x$ac_cv_path_PERL" = "xnone"; then
120 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
122 AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
123 AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE")
125 dnl set $(AR) if not provided by the build environment
126 if test "x$AR" = "x"; then
127 AC_PATH_PROG(AR, ar, $FALSE)
132 AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE)
133 AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE")
135 # pre-define DEFAULT_PREFIX, some modules need it.
136 if test "${prefix}" = "NONE" ; then
137 squid_prefix=$ac_default_prefix
141 AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix])
143 AC_ARG_ENABLE(strict-error-checking,
144 AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
145 with all possible static compiler error-checks enabled.
146 This flag disables the behavior]), [
147 SQUID_YESNO([$enableval],
148 [Unrecognized argument to --disable-strict-error-checking: $enableval])
150 AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}])
152 AC_MSG_CHECKING(whether to use loadable modules)
153 AC_ARG_ENABLE(loadable-modules,
154 AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [
155 SQUID_YESNO([$enableval],
156 [Unrecognized argument to --disable-loadable-modules: $enableval])
158 AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_loadable_modules:=yes}" = "xyes")
159 AC_MSG_RESULT([$enable_loadable_modules])
161 if test "x$enable_loadable_modules" = "xyes";
163 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
169 # LT_INIT requires libtool v2, might as well state it loud
171 LT_INIT([dlopen],[disable-shared])
172 if ! test "${ac_top_build_prefix}" = "";
174 # LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
175 # But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
176 # This fixes Linux LTDLv3-v7, and BSD LTDL v2.2
177 top_build_prefix=${ac_top_build_prefix}
178 AC_SUBST(top_build_prefix)
182 dnl LibTool environment is now prepared for setup. Check that it is usable and initialize.
185 # Do we need these unconditionally for "make distcheck" to work?
189 if test "x$enable_loadable_modules" = "xyes";
191 # Why is this needed? Should not LT_INIT (or LT_LIB_DLLOAD) from libtool do that?
192 LIBADD_DL=${lt_cv_dlopen_libs}
193 AC_SUBST([LIBADD_DL])
196 SQUID_CC_GUESS_VARIANT
197 SQUID_CC_GUESS_OPTIONS
199 dnl find out the exe extension for this platform.
200 dnl If it is not empty, use it for CGI as well.
204 if test "x$EXEEXT" = "x" ; then
207 # automake automatically adds .exe when installing binaries
212 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"])
213 AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
215 case "$squid_host_os" in
217 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
218 CFLAGS="$CFLAGS -mthreads"
219 CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++"
220 if test "x$ac_cv_path_WIN32_PSAPI" = "xnone"; then
221 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
222 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
224 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
227 MINGW_LIBS="-lmingwex"
231 # FreeBSD places local libraries and packages in /usr/local
232 CFLAGS="$CFLAGS -I/usr/local/include"
233 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
234 LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib"
241 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
243 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args",
244 [configure command line used to configure Squid])
246 CACHE_EFFECTIVE_USER="nobody"
247 AC_ARG_WITH(default-user,
248 AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
249 [ CACHE_EFFECTIVE_USER="$withval" ]
251 AC_SUBST(CACHE_EFFECTIVE_USER)
253 DEFAULT_LOG_DIR="$localstatedir/logs"
255 AS_HELP_STRING([--with-logdir=PATH],
256 [Default location for squid logs. default: PREFIX/var/logs]), [
259 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
262 DEFAULT_LOG_DIR="$withval"
267 AC_SUBST(DEFAULT_LOG_DIR)
269 DEFAULT_PID_FILE="$localstatedir/run/@SERVICE_NAME@.pid"
271 AS_HELP_STRING([--with-pidfile=PATH],
272 [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]), [
275 AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
278 DEFAULT_PID_FILE="$withval"
282 AC_SUBST(DEFAULT_PID_FILE)
284 DEFAULT_SWAP_DIR="$localstatedir/cache/squid"
286 AS_HELP_STRING([--with-swapdir=PATH],
287 [Default location for squid cache directories. Default: PREFIX/var/cache/squid]), [
290 AC_MSG_ERROR( --with-swapdir requires a directory PATH. --with-swapdir=PATH )
293 DEFAULT_SWAP_DIR="$withval"
297 AC_SUBST(DEFAULT_SWAP_DIR)
299 dnl Set Default CFLAGS
300 if test "x$PRESET_CFLAGS" = "x"; then
301 if test "$squid_cv_compiler" = "gcc"; then
304 # sunos has too many warnings for this to be useful
308 # Motorola cc/ld does not like -02 but is ok on -O
309 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
312 CFLAGS="$squid_cv_cc_option_wall $CFLAGS"
318 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
319 CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
320 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
321 -Wl,-woff,85,-woff,84,-woff,134 \
322 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
323 CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
324 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
325 -Wl,-woff,85,-woff,84,-woff,134 \
326 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
334 dnl set squid required flags
335 if test "$squid_cv_compiler" = "gcc"; then
336 case "$squid_host_os" in
338 dnl Guido Serassio (serassio@squid-cache.org) 20070811
339 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
340 dnl -Werror -Wmissing-prototypes -Wmissing-declarations
341 dnl TODO: check if the problem will be present in any other newer MinGW release.
342 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow"
345 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow"
348 SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow"
354 dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features
355 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]])
357 if test "x$enable_strict_error_checking" != "xno"; then
358 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
359 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror"
362 if test "x$ac_cv_require_wno_deprecated_register" = "xyes"; then
363 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register"
366 # squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS
367 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
368 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
370 # possibly include some build info tag into squid -v
371 SQUID_EMBED_BUILD_INFO
373 AC_ARG_ENABLE(optimizations,
374 AS_HELP_STRING([--disable-optimizations],
375 [Do not compile Squid with compiler optimizations enabled.
376 Optimization is good for production builds, but not
377 good for debugging. During development, use
378 --disable-optimizations to reduce compilation times
379 and allow easier debugging. This option implies
380 --disable-inline]), [
381 if test "x$enableval" = "xno" ; then
382 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
383 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
384 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
389 AH_TEMPLATE(_USE_INLINE_,[Include inline methods into header file])
390 AC_ARG_ENABLE(inline,
391 AS_HELP_STRING([--disable-inline],
392 [Do not compile trivial methods as inline. Squid
393 is coded with much of the code able to be inlined.
394 Inlining is good for production builds, but not
395 good for development. During development, use
396 --disable-inline to reduce compilation times and
397 allow incremental builds to be quick. For
398 production builds, or load tests, use
399 --enable-inline to have squid make all trivial
400 methods inlinable by the compiler.]), [
401 SQUID_YESNO([$enableval],
402 [Unrecognized argument to --disable-inline: $enableval])
404 AC_MSG_NOTICE([inlining optimizations enabled: ${enable_inline:=yes}])
405 SQUID_DEFINE_BOOL(_USE_INLINE_,$enable_inline,
406 [Include inline methods into header file])
407 # to be used by sub-commands
410 AC_ARG_ENABLE(debug-cbdata,
411 AS_HELP_STRING([--enable-debug-cbdata],
412 [Provide some debug information in cbdata]), [
413 SQUID_YESNO([$enableval],
414 [unrecognized argument to --enable-debug-cbdata: $enableval])
416 SQUID_DEFINE_BOOL(USE_CBDATA_DEBUG,${enable_debug_cbdata:=no},
417 [Enable support for cbdata debug information])
418 AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata])
421 dnl Nasty hack to get autoconf 2.64 on Linux to run.
422 dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
423 AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:])
425 AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics])
426 AC_ARG_ENABLE(xmalloc-statistics,
427 AS_HELP_STRING([--enable-xmalloc-statistics],
428 [Show malloc statistics in status page]), [
429 SQUID_YESNO([$enableval],
430 [unrecognized argument to --enable-xmalloc-statistics: $enableval])
432 SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no},
433 [Show malloc statistics in status page])
434 AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics])
436 squid_opt_aufs_threads=""
437 AC_ARG_WITH(aufs-threads,
438 AS_HELP_STRING([--with-aufs-threads=N_THREADS],
439 [Tune the number of worker threads for the aufs object store.]), [
442 squid_opt_aufs_threads=$withval
445 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
449 if test "x$squid_opt_aufs_threads" != "x"; then
450 AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads])
451 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads,
452 [Defines how many threads aufs uses for I/O])
455 AC_ARG_WITH(dl, AS_HELP_STRING([--with-dl],[Use dynamic linking]))
456 if test "x$with_dl" = "xyes"; then
457 AC_MSG_NOTICE([With dl])
460 AC_SEARCH_LIBS([shm_open], [rt])
461 if test "x$ac_cv_search_shm_open" != "xno" ; then
462 AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
465 AC_MSG_CHECKING([for DiskIO modules to be enabled])
466 squid_disk_module_candidates=""
467 squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules)
468 AC_ARG_ENABLE(disk-io,
469 AS_HELP_STRING([--enable-disk-io="list of modules"],
470 [Build support for the list of disk I/O modules.
471 Set without a value or omitted, all available modules will be built.
472 See src/DiskIO for a list of available modules, or
473 Programmers Guide section on DiskIO
474 for details on how to build your custom disk module]), [
478 #do nothing, "auto" is ok
481 squid_opt_enable_diskio="no"
484 squid_opt_enable_diskio="yes"
485 squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
486 SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
491 # if requested to autodetect, find out what we have
492 if test "x$squid_opt_enable_diskio" = "xauto"; then
493 squid_opt_enable_diskio="yes"
494 SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
495 if test "x$ac_cv_search_shm_open" = "xno" ; then
497 squid_disk_module_candidates=`echo $squid_disk_module_candidates|sed 's/IpcIo//'`
501 AC_MSG_RESULT([${squid_disk_module_candidates:-none}])
502 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
503 SQUID_DEFINE_BOOL(USE_DISKIO,$squid_opt_enable_diskio,
504 [DiskIO modules are expected to be available.])
508 dnl Some autoconf.h defines we might enable later...
509 AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
510 AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
513 squid_opt_use_diskthreads=
516 dnl Setup the module paths etc.
520 AH_TEMPLATE(HAVE_DISKIO_MODULE_AIO, [Whether POSIX AIO Disk I/O module is built])
521 AH_TEMPLATE(HAVE_DISKIO_MODULE_BLOCKING, [Whether Blocking Disk I/O module is built])
522 AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKDAEMON, [Whether DiskDaemon Disk I/O module is built])
523 AH_TEMPLATE(HAVE_DISKIO_MODULE_IPCIO, [Whether IpcIo Disk I/O module is built])
524 AH_TEMPLATE(HAVE_DISKIO_MODULE_MMAPPED, [Whether Mmapped Disk I/O module is built])
525 for module in $squid_disk_module_candidates none; do
527 if test "x$module" = "xnone"; then
530 if ! test -d "$srcdir/src/DiskIO/$module"; then
531 AC_MSG_ERROR(disk-io $module does not exist)
536 dnl Check for POSIX AIO availability
537 squid_opt_use_aio="yes"
539 if test "x$with_aio" != "xno"; then
541 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
542 dnl On some systems POSIX AIO functions are in librt
543 dnl On some systems POSIX AIO functions are in libaio
544 AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
545 dnl Enable AIO if the library and headers are found
546 if test "x$AIOLIB" != "x" && test "x$have_aio_header" = "xyes"; then
547 AC_MSG_NOTICE([Native POSIX AIO support detected.])
548 squid_opt_use_aio="yes"
550 dnl Windows does things differently. We provide wrappers.
551 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
552 case "$squid_host_os" in
554 squid_opt_use_aio="yes"
555 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
558 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
559 squid_opt_use_aio="no"
564 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
565 squid_opt_use_aio="no"
567 dnl Use the POSIX AIO pieces if we actually need them.
568 if test "x$squid_opt_use_aio" = "xyes" ; then
569 DISK_MODULES="$DISK_MODULES AIO"
570 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
571 AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built])
572 case "$squid_host_os" in
575 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
578 AC_MSG_NOTICE([Enabling AIO DiskIO module])
582 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
583 squid_disk_module_candidates_AIO=no
588 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
589 DISK_MODULES="$DISK_MODULES Blocking"
590 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
591 AC_DEFINE([HAVE_DISKIO_MODULE_BLOCKING],1,[Blocking Disk I/O module is built])
595 case "$squid_host_os" in
597 AC_MSG_NOTICE(["DiskDaemon not supported on MinGW"])
598 squid_disk_module_candidates_DiskDaemon=no
601 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
602 DISK_MODULES="$DISK_MODULES DiskDaemon"
603 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
604 AC_DEFINE([HAVE_DISKIO_MODULE_DISKDAEMON],1,[DiskDaemon Disk I/O module is built])
610 squid_opt_use_diskthreads="yes"
612 SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
613 if test "x$with_pthreads" != "xno"; then
614 dnl TODO: this needs to be extended to handle more systems and better
615 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
616 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
617 case "$squid_host_os" in
620 AC_MSG_NOTICE([Windows threads support automatically enabled])
623 if test `echo "$squid_host_os_version" | tr -d .` -lt 70 ; then
624 AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later)
625 squid_opt_use_diskthreads="no"
627 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
628 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
629 if test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x" ; then
630 LDFLAGS="$LDFLAGS -pthread"
635 if test `echo "$squid_host_os_version" | tr -d .` -lt 52 ; then
636 AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later)
637 squid_opt_use_diskthreads="no"
639 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
640 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
641 LDFLAGS="$LDFLAGS -lpthread"
645 if test "x$GCC" = "xyes" ; then
646 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
647 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
648 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
649 AC_MSG_NOTICE(pthread library required but cannot be found.)
650 squid_opt_use_diskthreads="no"
653 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
654 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
655 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
656 AC_SEARCH_LIBS([pthread_create],[pthread thread],[
657 LIBPTHREADS="" #in LIBS
659 AC_MSG_NOTICE(pthread library required but cannot be found.)
660 squid_opt_use_diskthreads="no"
665 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
666 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
667 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
668 AC_MSG_NOTICE(pthread library required but cannot be found.)
669 squid_opt_use_diskthreads="no"
674 AC_MSG_NOTICE([Native pthreads support manually disabled.])
675 squid_opt_use_diskthreads="no"
677 if test "x$squid_opt_use_diskthreads" = "xyes" ; then
678 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
679 DISK_MODULES="$DISK_MODULES DiskThreads"
680 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
681 AC_DEFINE([HAVE_DISKIO_MODULE_DISKTHREADS],1,[DiskThreads Disk I/O module is built])
683 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
684 SQUID_STATE_ROLLBACK([diskthreads_state])
685 squid_disk_module_candidates_DiskThreads=no
690 AC_MSG_NOTICE([Enabling IpcIo DiskIO module])
691 if test "x$ac_cv_search_shm_open" = "xno" ; then
692 AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support])
693 squid_disk_module_candidates_IpcIo=no
695 DISK_MODULES="$DISK_MODULES IpcIo"
696 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/IpcIo/IpcIoDiskIOModule.o"
697 AC_DEFINE([HAVE_DISKIO_MODULE_IPCIO],1,[IpcIo Disk I/O module is built])
702 dnl TODO: use availability of sys/mman.h and/or mmap to define
703 dnl OR support windows mmap functions
704 if test "x$squid_host_os" = "xmingw" ; then
705 AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw])
706 squid_disk_module_candidates_Mmapped=no
708 AC_MSG_NOTICE([Enabling Mmapped DiskIO module])
709 DISK_MODULES="$DISK_MODULES Mmapped"
710 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Mmapped/MmappedDiskIOModule.o"
711 AC_DEFINE([HAVE_DISKIO_MODULE_MMAPPED],1,[Mmapped Disk I/O module is built])
716 AC_MSG_NOTICE([Enabling $module DiskIO module])
717 DISK_LIBS="$DISK_LIBS lib${module}.la"
718 DISK_MODULES="$DISK_MODULES ${module}"
719 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
723 AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
724 AC_SUBST(DISK_MODULES)
726 AC_SUBST(DISK_LINKOBJS)
727 AM_CONDITIONAL([ENABLE_DISKIO_AIO], [test "x$squid_disk_module_candidates_AIO" = "xyes"])
729 AM_CONDITIONAL([ENABLE_WIN32_AIO], [test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1"])
730 AM_CONDITIONAL([ENABLE_DISKIO_BLOCKING], [test "x$squid_disk_module_candidates_Blocking" = "xyes"])
731 AM_CONDITIONAL([ENABLE_DISKIO_DISKDAEMON], [test "x$squid_disk_module_candidates_DiskDaemon" = "xyes"])
732 AM_CONDITIONAL([ENABLE_DISKIO_DISKTHREADS], [test "x$squid_disk_module_candidates_DiskThreads" = "xyes"])
733 AC_SUBST(LIBPTHREADS)
734 AM_CONDITIONAL([ENABLE_WIN32_AIOPS], [test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1"])
735 AM_CONDITIONAL([ENABLE_DISKIO_IPCIO], [test "x$squid_disk_module_candidates_IpcIo" = "xyes"])
736 AM_CONDITIONAL([ENABLE_DISKIO_MMAPPED], [test "x$squid_disk_module_candidates_Mmapped" = "xyes"])
739 dnl Check what Storage formats are wanted.
740 dnl This version will error out with a message saying why if a required DiskIO is missing.
741 squid_opt_enable_storeio=auto
742 AC_ARG_ENABLE([storeio],
743 AS_HELP_STRING([--enable-storeio="list of modules"],
744 [Build support for the list of store I/O modules.
745 The default is only to build the "ufs" module.
746 See src/fs for a list of available modules, or
747 Programmers Guide section <not yet written>
748 for details on how to build your custom store module]), [
751 squid_opt_enable_storeio=auto
754 squid_opt_enable_storeio=no
757 squid_opt_enable_storeio=yes
758 squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
759 # ufs is really always needed as it has low-level routines
760 # if it is a dupe it will be cleaned-up later
761 squid_storeio_module_candidates="$squid_storeio_module_candidates ufs"
765 if test "x$squid_opt_enable_storeio" = "xauto"; then
766 squid_opt_enable_storeio=yes
767 AC_MSG_CHECKING([for available StoreIO modules])
768 SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
769 AC_MSG_RESULT([$squid_storeio_module_candidates])
772 SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates])
773 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
774 AC_MSG_NOTICE([Store modules built: $squid_storeio_module_candidates])
776 for fs in $squid_storeio_module_candidates none; do
779 if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
780 "$squid_disk_module_candidates_DiskDaemon" != "yes" ; then
781 AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon])
785 if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
786 "$squid_disk_module_candidates_DiskThreads" != "yes" ; then
787 AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads])
791 if test "x$squid_disk_module_candidates_IpcIo" != "xyes" -a \
792 "x$squid_disk_module_candidates_Blocking" != "xyes"; then
793 AC_MSG_ERROR([Storage module Rock requires IpcIo or Blocking DiskIO module])
795 squid_do_build_rock=true
798 squid_do_build_ufs=true
803 AM_CONDITIONAL(HAVE_FS_UFS,[test "x$squid_do_build_ufs" = "xtrue" ])
804 AM_CONDITIONAL(HAVE_FS_ROCK,[test "x$squid_do_build_rock" = "xtrue" ])
805 dnl hack: need to define those even if not used in the build system to
806 dnl make sure that global FS objects are linked to the squid binary.
807 AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
808 AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
809 AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
810 AH_TEMPLATE(HAVE_FS_ROCK, "Define to 1 if rock filesystem module is build")
813 dnl got final squid_storeio_module_candidates, build library lists
814 dnl This list will not be needed when each fs library has its own Makefile
816 dnl File system libraries to link executables with.
817 dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
819 for fs in $squid_storeio_module_candidates; do
820 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
821 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
822 SQUID_TOUPPER_VAR_CONTENTS([fs])
823 AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1)
826 AC_SUBST(STORE_LIBS_TO_BUILD)
827 AC_SUBST(STORE_LIBS_TO_ADD)
828 AC_SUBST(STORE_TESTS)
831 dnl At lest one removal policy is always needed.
832 dnl 'lru' removal policy is currently hard-coded by name for tests
833 dnl so we must set it as default.
835 AC_ARG_ENABLE(removal-policies,
836 AS_HELP_STRING([--enable-removal-policies="list of policies"],
837 [Build support for the list of removal policies.
838 The default is only to build the "lru" module.
839 See src/repl for a list of available modules, or
840 Programmers Guide section 9.9 for details on how
841 to build your custom policy]), [
844 SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES])
849 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
853 if test "x$REPL_POLICIES" != "x" ; then
854 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES])
855 AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES])
856 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
857 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
859 AC_SUBST(REPL_POLICIES)
863 AM_CONDITIONAL(ENABLE_PINGER, false)
865 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
866 [ if test "x$enableval" = "xyes" ; then
867 AC_MSG_NOTICE([ICMP enabled])
868 AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)])
869 AM_CONDITIONAL(ENABLE_PINGER, true)
873 AM_CONDITIONAL(ENABLE_DELAY_POOLS, false)
874 AC_ARG_ENABLE(delay-pools,
875 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
876 [ if test "x$enableval" = "xyes" ; then
877 AC_MSG_NOTICE([Delay pools enabled])
878 AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".])
879 AM_CONDITIONAL(ENABLE_DELAY_POOLS, true)
883 dnl disable generic/common adaptation support by default
884 squid_opt_use_adaptation=no
886 squid_opt_use_esi=yes
887 AH_TEMPLATE([USE_SQUID_ESI],
888 [Define to enable the ESI processor and Surrogate header support])
890 AS_HELP_STRING([--enable-esi],
891 [Enable ESI for accelerators. Benefits from expat or libxml2.
892 Enabling ESI will cause squid reverse proxies to be capable
893 of the Edge Acceleration Specification (www.esi.org).]),
894 [squid_opt_use_esi=$enableval], [squid_opt_use_esi=no])
899 if test "x$squid_opt_use_esi" = "xyes" ; then
900 AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.])
901 AC_DEFINE(USE_SQUID_ESI,1,
902 [Compile the ESI processor and Surrogate header support])
904 AC_MSG_NOTICE([Disabling ESI processor])
907 # ESI support libraries: expat
908 AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect]))
909 if test "x$squid_opt_use_esi" = "xyes" -a "x$with_expat" != "xno" ; then
910 AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
911 AC_CHECK_HEADERS([expat.h])
912 AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
913 if test "x$with_expat" = "xyes" -a "x$HAVE_LIBEXPAT" != "x1" ; then
914 AC_MSG_ERROR([Required library expat is not able to be found.])
918 AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
919 if test "x$squid_opt_use_esi" = "xyes" -a "x$with_libxml2" != "xno" ; then
920 AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1])
921 dnl Find the main header and include path...
922 AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [
923 AC_CHECK_HEADERS([libxml/parser.h], [], [
924 AC_MSG_NOTICE([Testing in /usr/include/libxml2])
925 SAVED_CPPFLAGS="$CPPFLAGS"
926 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
927 unset ac_cv_header_libxml_parser_h
928 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/include/libxml2"], [
929 AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
930 CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS"
931 unset ac_cv_header_libxml_parser_h
932 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/local/include/libxml2"], [
933 AC_MSG_NOTICE([Failed to find libxml2 header file libxml/parser.h])
936 CPPFLAGS="$SAVED_CPPFLAGS"
939 if test "x$ac_cv_libxml2_include" != "x"; then
940 SQUID_CXXFLAGS="$ac_cv_libxml2_include $SQUID_CXXFLAGS"
941 CPPFLAGS="$ac_cv_libxml2_include $CPPFLAGS"
943 dnl Now that we know where to look find the headers...
944 AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h)
945 AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
946 if test "x$with_libxml2" = "xyes" -a "$HAVE_LIBXML2" != "1" ; then
947 AC_MSG_ERROR([Required library libxml2 is not able to be found.])
951 AM_CONDITIONAL(USE_ESI, test "x$squid_opt_use_esi" = "xyes")
952 AM_CONDITIONAL(HAVE_LIBEXPAT, test "$HAVE_LIBEXPAT" = 1)
954 AM_CONDITIONAL(HAVE_LIBXML2, test "$HAVE_LIBXML2" = 1)
957 # icap argument handling
958 AC_ARG_ENABLE(icap-client,
959 AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[
960 SQUID_YESNO([$enableval],[Unrecognized argument to --disable-icap-client: $enableval])
962 SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid])
963 AM_CONDITIONAL(USE_ICAP_CLIENT, [test "x$enable_icap_client" != "xno" ])
964 if test "x$enable_icap_client" != "xno" ; then
965 ICAP_LIBS="icap/libicap.la"
966 squid_opt_use_adaptation=yes
973 AC_MSG_CHECKING(whether to support eCAP)
975 AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]), [
976 case "${enableval}" in
977 yes|no) squid_opt_use_ecap=$enableval ;;
978 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
980 AC_MSG_RESULT([$squid_opt_use_ecap, explicitly])
982 squid_opt_use_ecap=no;
983 AC_MSG_RESULT([$squid_opt_use_ecap, implicitly])
987 dnl Necessary if the first PKG_CHECK_MODULES call is conditional
990 dnl Perform configuration consistency checks for eCAP
991 if test "x$squid_opt_use_ecap" != "xno";
993 dnl eCAP support requires loadable modules, which are enabled by default
994 if test "x$enable_loadable_modules" != "xyes"
996 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.])
999 if test -n "$PKG_CONFIG"; then
1000 dnl eCAP support requires libecap.
1001 dnl This Squid supports libecap v1.0.x.
1002 dnl Use EXT_ prefix to distinguish external libecap (that we check for
1003 dnl here) from our own convenience ecap library in Makefiles.
1004 PKG_CHECK_MODULES([EXT_LIBECAP],[libecap >= 1.0 libecap < 1.1])
1006 AC_MSG_NOTICE([eCAP support requires pkg-config to verify the correct library version. Trouble may follow.])
1010 AM_CONDITIONAL(USE_ECAP, test "x$squid_opt_use_ecap" = "xyes")
1011 if test "x$squid_opt_use_ecap" = "xyes";
1013 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
1014 ECAP_LIBS="ecap/libsquid-ecap.la"
1015 squid_opt_use_adaptation=yes
1017 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
1020 dnl convenience library
1024 dnl enable adaptation if requested by specific adaptation mechanisms
1025 AM_CONDITIONAL(USE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes")
1026 if test "x$squid_opt_use_adaptation" = "xyes"
1028 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
1029 ADAPTATION_LIBS="adaptation/libadaptation.la"
1031 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
1034 AC_SUBST(ADAPTATION_LIBS)
1036 test "x$squid_host_os" = "xmingw" && enable_wccp=no
1038 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [
1039 SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccp: $enableval])
1041 SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP])
1042 AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp])
1044 test "x$squid_host_os" = "xmingw" && enable_wccpv2=no
1045 AC_ARG_ENABLE(wccpv2,
1046 AS_HELP_STRING([--disable-wccpv2],
1047 [Disable Web Cache Coordination V2 Protocol]), [
1048 SQUID_YESNO([$enableval],
1049 [unrecognized argument to --disable-wccpv2: $enableval])
1051 SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes},
1052 [Define to enable WCCP V2])
1053 AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2])
1055 AC_ARG_ENABLE(kill-parent-hack,
1056 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [
1057 SQUID_YESNO([$enableval],
1058 [unrecognized argument to --enable-kill-parent-hack: $enableval])
1060 SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no},
1061 [A dangerous feature which causes Squid to kill its parent
1062 process (presumably the RunCache script) upon receipt
1063 of SIGTERM or SIGINT. Deprecated, Use with caution.])
1064 AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack])
1067 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
1068 SQUID_YESNO([$enableval],
1069 [unrecognized argument to --disable-snmp: $enableval])
1071 SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes},
1072 [Define to enable SNMP monitoring of Squid])
1073 AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"])
1074 if test "x$enable_snmp" = "xyes"; then
1075 SNMPLIB='../lib/snmplib/libsnmplib.la'
1077 AC_MSG_NOTICE([SNMP support enabled: $enable_snmp])
1080 AC_ARG_ENABLE(cachemgr-hostname,
1081 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],
1082 [Make cachemgr.cgi default to this host.
1083 If unspecified, uses the name of the build-host]), [
1086 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1087 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1088 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1094 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1095 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1101 AS_HELP_STRING([--disable-eui],
1102 [Disable use of ARP / MAC/ EUI (ether address)]), [
1103 SQUID_YESNO([$enableval],[--disable-eui expects no arguments])
1105 if test "x${enable_eui:=yes}" = "xyes" ; then
1106 case "$squid_host_os" in
1107 linux|solaris|freebsd|openbsd|netbsd|cygwin)
1114 AC_MSG_WARN([EUI support probably will not work on host $host.])
1117 # iphlpapi.h check delayed after winsock2.h
1132 #include <sys/types.h>
1133 #include <sys/socket.h>
1136 # OpenBSD, FreeBSD and NetBSD requires sys/param.h to be included before sysctl.h and net/if_dl.h
1141 #if HAVE_SYS_PARAM_H
1142 #include <sys/param.h>
1147 AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui])
1148 SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui,
1149 [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.])
1150 AM_CONDITIONAL(USE_SQUID_EUI, [test "x$enable_eui" = "xyes" ])
1154 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [
1155 SQUID_YESNO([$enableval],
1156 [unrecognized argument to --disable-htcp: $enableval])
1158 SQUID_DEFINE_BOOL(USE_HTCP,${enable_htcp:=yes},
1159 [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1160 AM_CONDITIONAL(ENABLE_HTCP, [test "x$enable_htcp" = "xyes"])
1161 AC_MSG_NOTICE([HTCP support enabled: $enable_htcp])
1163 # Cryptograhic libraries
1165 AS_HELP_STRING([--without-nettle],[Compile without the Nettle crypto library.]),[
1166 case "$with_nettle" in
1168 : # Nothing special to do here
1171 if test ! -d "$withval" ; then
1172 AC_MSG_ERROR([--with-nettle path does not point to a directory])
1174 NETTLELIBDIR="-L$with_nettle/lib"
1175 CPPFLAGS="-I$with_nettle/include $CPPFLAGS"
1179 if test "x$with_nettle" != "xno" ; then
1180 AC_CHECK_LIB(nettle, nettle_md5_init,[
1181 NETTLELIB="$NETTLELIBDIR -lnettle"
1182 AC_CHECK_HEADERS(nettle/md5.h)
1184 if test "x$with_nettle" != "xno" ; then
1185 # Base64 uses the nettle 3.0 API
1186 # which matters on 64-bit systems
1187 AC_CHECK_HEADERS(nettle/base64.h)
1188 AC_MSG_CHECKING([for Nettle 3.0 API compatibility])
1189 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1192 # include <nettle/base64.h>
1194 uint8_t inData[10]; inData[0] = '\0';
1196 struct base64_decode_ctx ctx;
1197 base64_decode_init(&ctx);
1198 uint8_t outData[10];
1200 if (!base64_decode_update(&ctx, &dstLen, outData, srcLen, inData) ||
1201 !base64_decode_final(&ctx)) {
1204 ]])],[AC_MSG_RESULT(yes)
1205 AC_DEFINE(HAVE_NETTLE30_BASE64,1,[set to 1 if Nettle 3.0 API will link])
1206 ],[AC_MSG_RESULT(no)])
1209 AC_MSG_NOTICE([Using Nettle cryptographic library: ${with_nettle:=yes}])
1212 dnl Check for libcrypt
1214 dnl Some of our helpers use crypt(3) which may be in libc, or in
1215 dnl libcrypt (eg FreeBSD)
1216 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1217 dnl Solaris10 provides MD5 natively through libmd5
1218 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
1223 dnl User may want to disable GnuTLS
1225 AS_HELP_STRING([--without-gnutls],
1226 [Do not use GnuTLS for SSL. Default: auto-detect]), [
1227 case "$with_gnutls" in
1229 : # Nothing special to do here
1232 if test ! -d "$withval" ; then
1233 AC_MSG_ERROR([--with-gnutls path does not point to a directory])
1235 LIBGNUTLS_PATH="-L$with_gnutls/lib"
1236 CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
1239 AH_TEMPLATE(USE_GNUTLS,[GnuTLS support is available])
1240 if test "x$with_gnutls" != "xno"; then
1241 AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/x509.h)
1243 # User may have provided a custom location for GnuTLS. Otherwise...
1244 SQUID_STATE_SAVE(squid_gnutls_state)
1245 LIBS="$LIBS $LIBGNUTLS_PATH"
1247 # auto-detect using pkg-config
1248 PKG_CHECK_MODULES([LIBGNUTLS],[gnutls >= 3.1.5],,[
1249 ## find the package without pkg-config
1250 ## check that the library is actually new enough.
1251 ## by testing for a 3.1.5+ function which we use
1252 AC_CHECK_LIB(gnutls,gnutls_certificate_verify_peers3,[LIBGNUTLS_LIBS="-lgnutls"])
1255 SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS
1257 if test "x$with_gnutls" = "xyes" -a "x$LIBGNUTLS_LIBS" = "x"; then
1258 AC_MSG_ERROR([Required GnuTLS library not found])
1260 if test "x$LIBGNUTLS_LIBS" != "x" ; then
1261 CXXFLAGS="$LIBGNUTLS_CFLAGS $CXXFLAGS"
1262 SSLLIB="$LIBGNUTLS_PATH $LIBGNUTLS_LIBS $SSLLIB"
1263 AC_DEFINE(USE_GNUTLS,1,[GnuTLS support is available])
1268 AC_MSG_NOTICE([GnuTLS library support: ${with_gnutls:=auto} ${LIBGNUTLS_PATH} ${LIBGNUTLS_LIBS}])
1270 dnl User may specify OpenSSL is needed from a non-standard location
1271 AC_ARG_WITH(openssl,
1272 AS_HELP_STRING([--with-openssl=PATH],
1273 [Compile with the OpenSSL libraries. The path to
1274 the OpenSSL development libraries and headers
1275 installation can be specified if outside of the
1276 system standard directories]), [
1277 case "$with_openssl" in
1279 : # Nothing special to do here
1282 if test ! -d "$withval" ; then
1283 AC_MSG_ERROR([--with-openssl path does not point to a directory])
1285 LIBOPENSSL_PATH="-L$with_openssl/lib"
1286 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1290 AH_TEMPLATE(USE_OPENSSL,[OpenSSL support is available])
1291 ## OpenSSL is default disable due to licensing issues on some OS
1292 if test "x$with_openssl" = "xyes"; then
1297 openssl/opensslv.h \
1304 # User may have provided a custom location for OpenSSL. Otherwise...
1305 SQUID_STATE_SAVE(squid_openssl_state)
1306 LIBS="$LIBS $LIBOPENSSL_PATH"
1308 # auto-detect using pkg-config
1309 PKG_CHECK_MODULES([LIBOPENSSL],[openssl],,[
1310 ## For some OS pkg-config is broken or unavailable.
1311 ## Detect libraries the hard way.
1313 # Windows MinGW has some special libraries ...
1314 if test "x$squid_host_os" = "xmingw" ; then
1315 LIBOPENSSL_LIBS='-lssleay32 -leay32 -lgdi32 $LIBOPENSSL_LIBS'
1316 AC_MSG_NOTICE([Windows OpenSSL library support: yes -lssleay32 -leay32 -lgdi32])
1319 AC_CHECK_LIB(crypto,[CRYPTO_new_ex_data],[LIBOPENSSL_LIBS="-lcrypto $LIBOPENSSL_LIBS"],[
1320 AC_MSG_ERROR([library 'crypto' is required for OpenSSL])
1322 AC_CHECK_LIB(ssl,[SSL_library_init],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[
1323 AC_MSG_ERROR([library 'ssl' is required for OpenSSL])
1327 # This is a workaround for RedHat 9 brain damage..
1328 if test -d /usr/kerberos/include -a -f /usr/include/openssl/kssl.h; then
1329 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1330 LIBOPENSSL_LIBS="-L/usr/kerberos/lib $LIBOPENSSL_LIBS"
1331 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1333 SQUID_STATE_ROLLBACK(squid_openssl_state) #de-pollute LIBS
1335 if test "x$LIBOPENSSL_LIBS" != "x"; then
1336 CXXFLAGS="$LIBOPENSSL_CFLAGS $CXXFLAGS"
1337 SSLLIB="$LIBOPENSSL_PATH $LIBOPENSSL_LIBS $SSLLIB"
1338 AC_DEFINE(USE_OPENSSL,1,[OpenSSL support is available])
1340 # check for other specific broken implementations
1341 SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS
1342 SQUID_CHECK_OPENSSL_CONST_SSL_METHOD
1343 SQUID_CHECK_OPENSSL_TXTDB
1344 SQUID_CHECK_OPENSSL_HELLO_OVERWRITE_HACK
1346 if test "x$SSLLIB" = "x"; then
1347 AC_MSG_ERROR([Required OpenSSL library not found])
1350 AC_MSG_NOTICE([OpenSSL library support: ${with_openssl:=no} ${LIBOPENSSL_PATH} ${LIBOPENSSL_LIBS}])
1351 AM_CONDITIONAL(ENABLE_SSL,[ test "x$with_openssl" = "xyes" ])
1354 dnl User may specify MIT Kerberos is needed from a non-standard location
1355 AC_ARG_WITH(mit-krb5,
1356 AS_HELP_STRING([--without-mit-krb5],
1357 [Compile without MIT Kerberos support.]), [
1358 case "$with_mit_krb5" in
1360 : # Nothing special to do here
1363 if test ! -d "$withval" ; then
1364 AC_MSG_ERROR([--with-mit-krb5 path does not point to a directory])
1366 if test -d "$with_mit_krb5/lib64" ; then
1367 LIB_KRB5_PATH="-L$with_mit_krb5/lib64 -L$with_mit_krb5/lib"
1369 LIB_KRB5_PATH="-L$with_mit_krb5/lib"
1371 CXXFLAGS="-I$with_mit_krb5/include $CXXFLAGS"
1372 krb5confpath="$with_mit_krb5/bin"
1376 AH_TEMPLATE(USE_APPLE_KRB5,[Apple Kerberos support is available])
1377 AH_TEMPLATE(USE_MIT_KRB5,[MIT Kerberos support is available])
1378 AH_TEMPLATE(USE_SOLARIS_KRB5,[Solaris Kerberos support is available])
1380 dnl User may specify Heimdal Kerberos is needed from a non-standard location
1381 AC_ARG_WITH(heimdal-krb5,
1382 AS_HELP_STRING([--without-heimdal-krb5],
1383 [Compile without Heimdal Kerberos support.]), [
1384 case "$with_heimdal_krb5" in
1386 : # Nothing special to do here
1389 if test ! -d "$withval" ; then
1390 AC_MSG_ERROR([--with-heimdal-krb5 path does not point to a directory])
1392 if test -d "$with_heimdal_krb5/lib64" ; then
1393 LIB_KRB5_PATH="-L$with_heimdal_krb5/lib64 -L$with_heimdal_krb5/lib"
1395 LIB_KRB5_PATH="-L$with_heimdal_krb5/lib"
1397 CXXFLAGS="-I$with_heimdal_krb5/include $CXXFLAGS"
1398 krb5confpath="$with_heimdal_krb5/bin"
1399 with_heimdal_krb5=yes
1402 AH_TEMPLATE(USE_HEIMDAL_KRB5,[Heimdal Kerberos support is available])
1406 dnl User may specify GNU gss is needed from a non-standard location
1408 AS_HELP_STRING([--without-gnugss],
1409 [Compile without the GNU gss libraries.]), [
1410 case "$with_gnugss" in
1412 : # Nothing special to do here
1415 if test ! -d "$withval" ; then
1416 AC_MSG_ERROR([--with-gnugss path does not point to a directory])
1418 if test ! -d "$with_gnugss/lib64" ; then
1419 LIB_KRB5_PATH="-L$with_gnugss/lib64 -L$with_gnugss/lib"
1421 LIB_KRB5_PATH="-L$with_gnugss/lib"
1423 CXXFLAGS="-I$with_gnugss/include $CXXFLAGS"
1428 AH_TEMPLATE(USE_GNUGSS,[GNU gss support is available])
1430 # determine krb5 conflicts
1431 ac_with_krb5_count=0
1432 if test "x$with_mit_krb5" = "xyes"; then
1433 ac_with_krb5_count=`expr $ac_with_krb5_count + 1`
1435 if test "x$with_heimdal_krb5" = "xyes"; then
1436 ac_with_krb5_count=`expr $ac_with_krb5_count + 1`
1438 if test "x$with_gnugss" = "xyes"; then
1439 ac_with_krb5_count=`expr $ac_with_krb5_count + 1`
1442 if test $ac_with_krb5_count -gt 1 ; then
1443 AC_MSG_ERROR([Please choose only one Kerberos library.])
1444 elif test $ac_with_krb5_count -eq 0 ; then
1445 # find installed libs via pkg-config or krb5-config
1446 PKG_CHECK_EXISTS(gssapi-krb5 krb5, [with_mit_krb5=yes])
1447 PKG_CHECK_EXISTS(heimdal-gssapi, [with_heimdal_krb5=yes])
1448 PKG_CHECK_EXISTS(gss, [with_gnugss=yes])
1449 if test "x$with_mit_krb5" = "xyes"; then
1450 ac_with_krb5_count=`expr $ac_with_krb5_count + 1`
1452 if test "x$with_heimdal_krb5" = "xyes"; then
1453 ac_with_krb5_count=`expr $ac_with_krb5_count + 1`
1455 if test "x$with_gnugss" = "xyes"; then
1456 ac_with_krb5_count=`expr $ac_with_krb5_count + 1`
1458 if test $ac_with_krb5_count -gt 1 ; then
1459 AC_MSG_ERROR([pkg-config found multiple Kerberos library. Please select one with --with-<kerberos package>])
1460 elif test $ac_with_krb5_count -eq 0 -a "$cross_compiling" = "no"; then
1461 # Look for krb5-config (unless cross-compiling)
1462 AC_PATH_PROG(krb5_config,krb5-config,no)
1463 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1464 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1465 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1466 ac_solaris="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i solaris`"
1467 ac_apple="`$ac_cv_path_krb5_config --vendor 2>/dev/null | grep -c -i apple`"
1468 if test $ac_heimdal -gt 0 ; then
1469 with_heimdal_krb5=yes
1470 ac_with_krb5_count=1
1472 if test $ac_solaris -gt 0 ; then
1473 with_solaris_krb5=yes
1474 ac_with_krb5_count=1
1476 if test $ac_apple -gt 0 ; then
1478 ac_with_krb5_count=1
1480 if test $ac_heimdal -eq 0 && test $ac_solaris -eq 0 && test $ac_apple -eq 0; then
1482 ac_with_krb5_count=1
1485 AC_MSG_WARN([Could not find krb5-config in path])
1490 if test "x$with_mit_krb5" = "xyes" || test "x$with_apple_krb5" = "xyes" ; then
1491 SQUID_STATE_SAVE([squid_krb5_save])
1492 LIBS="$LIBS $LIB_KRB5_PATH"
1494 # auto-detect using pkg-config
1495 PKG_CHECK_MODULES([LIB_KRB5],[gssapi-krb5 krb5],,[
1496 # look for krb5-config (unless cross-compiling)
1497 if test "$cross_compiling" = "no"; then
1498 if test "x$krb5confpath" = "x" ; then
1499 AC_PATH_PROG(krb5_config,krb5-config,no)
1500 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1501 ac_krb5_config="$ac_cv_path_krb5_config"
1504 ac_krb5_config="$krb5confpath/krb5-config"
1507 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1509 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1510 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1511 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1512 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1513 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1515 ## For some OS pkg-config is broken or unavailable.
1516 ## Detect libraries the hard way.
1518 SQUID_STATE_SAVE([squid_mit_save])
1519 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1520 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
1521 AC_MSG_ERROR([library 'com_err' is required for MIT Kerberos])
1524 AC_CHECK_LIB(k5crypto, [main], [LIB_KRB5_LIBS="-lk5crypto $LIB_KRB5_LIBS"],[
1525 AC_MSG_ERROR([library 'k5crypto' is required for MIT Kerberos])
1528 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1529 AC_MSG_ERROR([library 'krb5' is required for MIT Kerberos])
1532 AC_CHECK_LIB(gssapi_krb5, [main], [LIB_KRB5_LIBS="-lgssapi_krb5 $LIB_KRB5_LIBS"],[
1533 AC_MSG_ERROR([library 'gssapi_krb5' is required for MIT Kerberos])
1535 SQUID_STATE_ROLLBACK([squid_mit_save])
1540 if test "x$LIB_KRB5_LIBS" != "x"; then
1541 if test "x$with_apple_krb5" = "xyes" ; then
1542 AC_DEFINE(USE_APPLE_KRB5,1,[Apple Kerberos support is available])
1543 KRB5_FLAVOUR="Apple"
1545 AC_DEFINE(USE_MIT_KRB5,1,[MIT Kerberos support is available])
1548 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1549 KRB5INCS="$LIB_KRB5_CFLAGS"
1551 # check for other specific broken implementations
1552 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1553 LIBS="$LIBS $KRB5LIBS"
1555 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1556 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1557 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
1558 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1559 AC_CHECK_HEADERS(profile.h)
1561 SQUID_CHECK_KRB5_FUNCS
1564 if test "x$KRB5LIBS" = "x"; then
1565 AC_MSG_ERROR([Required Kerberos library not found])
1566 ac_with_krb5_count=0
1569 SQUID_STATE_ROLLBACK([squid_krb5_save])
1572 if test "x$with_solaris_krb5" = "xyes"; then
1573 SQUID_STATE_SAVE([squid_krb5_save])
1574 LIBS="$LIBS $LIB_KRB5_PATH"
1576 # no pkg-config for solaris native Kerberos
1577 # look for krb5-config (unless cross-compiling)
1578 if test "$cross_compiling" = "no"; then
1579 if test "x$krb5confpath" = "x" ; then
1580 AC_PATH_PROG(krb5_config,krb5-config,no)
1581 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1582 ac_krb5_config="$ac_cv_path_krb5_config"
1585 ac_krb5_config="$krb5confpath/krb5-config"
1588 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1590 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1591 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1592 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1593 # Solaris 10 Update 11 patches the krb5-config tool to produce stderr messages on stdout.
1594 SOLARIS_BROKEN_KRB5CONFIG_GSSAPI="`$ac_krb5_config --libs gssapi 2>/dev/null | grep "krb5-config"`"
1595 if test "x$SOLARIS_BROKEN_KRB5CONFIG_GSSAPI" = "x"; then
1596 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1597 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1600 ## For some OS pkg-config is broken or unavailable.
1601 ## Detect libraries the hard way.
1603 CXXFLAGS="-I/usr/include/kerberosv5 $CXXFLAGS"
1605 SQUID_STATE_SAVE([squid_solaris_save])
1606 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1607 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1608 AC_MSG_ERROR([library 'krb5' is required for Solaris Kerberos])
1611 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
1612 AC_MSG_ERROR([library 'gss' is required for Solaris Kerberos])
1614 SQUID_STATE_ROLLBACK([squid_solaris_save])
1617 if test "x$LIB_KRB5_LIBS" != "x"; then
1618 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1619 KRB5INCS="$LIB_KRB5_CFLAGS"
1620 AC_DEFINE(USE_SOLARIS_KRB5,1,[Solaris Kerberos support is available])
1621 KRB5_FLAVOUR="Solaris"
1623 # check for other specific broken implementations
1624 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1625 LIBS="$LIBS $KRB5LIBS"
1627 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1628 AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_ext.h)
1629 AC_CHECK_HEADERS(krb5.h com_err.h)
1631 SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
1632 if test "x$squid_cv_broken_krb5_h" = "xyes"; then
1633 AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if Solaris krb5.h is broken for C++])
1634 AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.])
1635 AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512])
1636 AC_MSG_WARN([If you need Kerberos support you will have to patch])
1637 AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch])
1640 SQUID_CHECK_KRB5_FUNCS
1643 if test "x$KRB5LIBS" = "x"; then
1644 AC_MSG_ERROR([Required Kerberos library not found])
1645 ac_with_krb5_count=0
1648 SQUID_STATE_ROLLBACK([squid_krb5_save])
1651 if test "x$with_heimdal_krb5" = "xyes"; then
1652 SQUID_STATE_SAVE([squid_krb5_save])
1653 LIBS="$LIBS $LIB_KRB5_PATH"
1655 # auto-detect using pkg-config
1656 PKG_CHECK_MODULES([LIB_KRB5],[heimdal-gssapi],,[
1657 # look for krb5-config (unless cross-compiling)
1658 if test "$cross_compiling" = "no"; then
1659 if test "x$krb5confpath" = "x" ; then
1660 AC_PATH_PROG(krb5_config,krb5-config,no)
1661 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1662 ac_krb5_config="$ac_cv_path_krb5_config"
1665 ac_krb5_config="$krb5confpath/krb5-config"
1668 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1670 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1671 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1672 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1673 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1674 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1676 ## For some OS pkg-config is broken or unavailable.
1677 ## Detect libraries the hard way.
1678 SQUID_STATE_SAVE([squid_heimdal_save])
1680 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1681 AC_CHECK_LIB(resolv, [main], [LIB_KRB5_LIBS="-lresolv $LIB_KRB5_LIBS"],[
1682 AC_MSG_ERROR([library 'resolv' is required for Heimdal Kerberos])
1685 AC_CHECK_LIB(crypt, [main], [LIB_KRB5_LIBS="-lcrypt $LIB_KRB5_LIBS"],[
1686 AC_MSG_ERROR([library 'crypt' is required for Heimdal Kerberos])
1689 AC_CHECK_LIB(roken, [main], [LIB_KRB5_LIBS="-lroken $LIB_KRB5_LIBS"],[
1690 AC_MSG_ERROR([library 'roken' is required for Heimdal Kerberos])
1693 AC_CHECK_LIB(heimbase, [main], [LIB_KRB5_LIBS="-lheimbase $LIB_KRB5_LIBS"],[
1694 AC_MSG_WARN([library 'heimbase' may be required for Heimdal Kerberos])
1697 AC_CHECK_LIB(wind, [main], [LIB_KRB5_LIBS="-lwind $LIB_KRB5_LIBS"],[
1698 AC_MSG_WARN([library 'wind' may be required for Heimdal Kerberos])
1701 AC_CHECK_LIB(crypto, [main], [LIB_KRB5_LIBS="-lcrypto $LIB_KRB5_LIBS"],[
1702 AC_MSG_ERROR([library 'crypto' is required for Heimdal Kerberos])
1705 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
1706 AC_MSG_ERROR([library 'com_err' is required for Heimdal Kerberos])
1709 AC_CHECK_LIB(hx509, [main], [LIB_KRB5_LIBS="-lhx509 $LIB_KRB5_LIBS"],[
1710 AC_MSG_WARN([library 'hx509' may be required for Heimdal Kerberos])
1713 AC_CHECK_LIB(asn1, [main], [LIB_KRB5_LIBS="-lasn1 $LIB_KRB5_LIBS"],[
1714 AC_MSG_ERROR([library 'asn1' is required for Heimdal Kerberos])
1717 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1718 AC_MSG_ERROR([library 'krb5' is required for Heimdal Kerberos])
1721 AC_CHECK_LIB(heimntlm, [main], [LIB_KRB5_LIBS="-lheimntlm $LIB_KRB5_LIBS"],[
1722 AC_MSG_WARN([library 'heimntlm' may be required for Heimdal Kerberos])
1725 AC_CHECK_LIB(gssapi, [main], [LIB_KRB5_LIBS="-lgssapi $LIB_KRB5_LIBS"],[
1726 AC_MSG_ERROR([library 'gssapi' is required for Heimdal Kerberos])
1728 SQUID_STATE_ROLLBACK([squid_heimdal_save])
1732 if test "x$LIB_KRB5_LIBS" != "x"; then
1733 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1734 KRB5INCS="$LIB_KRB5_CFLAGS"
1735 AC_DEFINE(USE_HEIMDAL_KRB5,1,[Heimdal Kerberos support is available])
1736 KRB5_FLAVOUR="Heimdal"
1738 # check for other specific broken implementations
1739 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1740 LIBS="$LIBS $KRB5LIBS"
1742 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1743 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1744 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1746 SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
1747 if test "x$squid_cv_broken_heimdal_krb5_h" = "xyes"; then
1748 AC_DEFINE(HAVE_BROKEN_HEIMDAL_KRB5_H, 1, [Define to 1 if Heimdal krb5.h is broken for C++])
1751 SQUID_CHECK_KRB5_FUNCS
1754 if test "x$KRB5LIBS" = "x"; then
1755 AC_MSG_ERROR([Required Kerberos library not found])
1756 ac_with_krb5_count=0
1759 SQUID_STATE_ROLLBACK([squid_krb5_save])
1762 if test "x$with_gnugss" = "xyes"; then
1763 SQUID_STATE_SAVE([squid_krb5_save])
1764 LIBS="$LIBS $LIB_KRB5_PATH"
1766 # auto-detect using pkg-config
1767 PKG_CHECK_MODULES([LIB_KRB5],[gss],,[
1768 ## For some OS pkg-config is broken or unavailable.
1769 ## Detect libraries the hard way.
1771 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1772 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
1773 AC_MSG_ERROR([library 'com_err' is required for GNU Kerberos])
1778 if test "x$LIB_KRB5_LIBS" != "x"; then
1779 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1780 KRB5INCS="$LIB_KRB5_CFLAGS"
1781 AC_DEFINE(USE_GNUGSS,1,[GNU Kerberos support is available])
1782 KRB5_FLAVOUR="GNU GSS"
1784 # check for other specific broken implementations
1785 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1786 LIBS="$LIBS $KRB5LIBS"
1788 AC_MSG_NOTICE([Try to find Kerbeors headers in given path])
1789 AC_CHECK_HEADERS(gss.h)
1791 SQUID_CHECK_WORKING_GSSAPI
1792 SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support])
1794 SQUID_CHECK_SPNEGO_SUPPORT
1795 SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support])
1797 SQUID_CHECK_WORKING_KRB5
1798 SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support])
1801 if test "x$KRB5LIBS" = "x"; then
1802 AC_MSG_ERROR([Required Kerberos library not found])
1803 ac_with_krb5_count=0
1806 SQUID_STATE_ROLLBACK([squid_krb5_save])
1808 if test $ac_with_krb5_count -gt 0 ; then
1811 AC_MSG_NOTICE([$KRB5_FLAVOUR Kerberos library support: ${with_krb5:=no} ${LIB_KRB5_PATH} ${LIB_KRB5_LIBS}])
1814 AM_CONDITIONAL(HAVE_SPNEGO, test x"$squid_cv_have_spnego" = x"yes" )
1816 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
1817 dnl only with Windows LDAP libraries using -lwldap32
1818 case "$squid_host_os" in
1824 AC_CHECK_LIB(ldap, ldap_init, [LDAPLIB="-lldap"])
1825 dnl LDAP helpers need to know if -llber is needed or not
1826 AC_CHECK_LIB(lber, ber_init, [LBERLIB="-llber"])
1827 dnl if no ldap lib found check for mozilla version
1828 if test "x$ac_cv_lib_ldap_ldap_init" != x""yes; then
1831 AC_CHECK_LIB(ldap60, ldap_init, [LDAPLIB="-lldap60"])
1832 LIBS="$LDAPLIB $LIBPTHREADS"
1833 AC_CHECK_LIB(prldap60, prldap_init, [LDAPLIB="-lprldap60 $LDAPLIB"])
1834 LIBS="$LDAPLIB $LIBPTHREADS"
1835 AC_CHECK_LIB(ssldap60, ldapssl_init, [LDAPLIB="-lssldap60 $LDAPLIB"])
1839 AC_CHECK_HEADERS(ldap.h lber.h)
1840 AC_CHECK_HEADERS(mozldap/ldap.h)
1843 dnl Check for LDAP_OPT_DEBUG_LEVEL
1845 AC_MSG_CHECKING([for LDAP_OPT_DEBUG_LEVEL])
1846 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1849 int i=LDAP_OPT_DEBUG_LEVEL
1851 [ AC_MSG_RESULT(yes) ],
1852 [ AC_MSG_RESULT(no) ])
1855 dnl Check for working ldap
1858 LIBS="$LDAPLIB $LBERLIB $LIBPTHREADS"
1859 AC_MSG_CHECKING([for working ldap])
1860 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1861 # define LDAP_DEPRECATED 1
1864 # elif HAVE_MOZLDAP_LDAP_H
1865 # include <mozldap/ldap.h>
1873 ldap_init((const char *)&host, port);
1878 [ AC_DEFINE(HAVE_LDAP, 1, [LDAP support])
1879 AC_MSG_RESULT(yes) ],
1880 [ AC_MSG_RESULT(no) ],
1881 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1885 dnl Check for ldap vendor
1887 AC_MSG_CHECKING([for OpenLDAP])
1888 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1892 # include <string.h>
1896 return strcmp(LDAP_VENDOR_NAME,"OpenLDAP");
1899 [ AC_DEFINE(HAVE_OPENLDAP, 1, [OpenLDAP support])
1900 AC_MSG_RESULT(yes) ],
1901 [ AC_MSG_RESULT(no) ],
1902 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1904 AC_MSG_CHECKING([for Sun LDAP SDK])
1905 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1909 # include <string.h>
1913 return strcmp(LDAP_VENDOR_NAME,"Sun Microsystems Inc.");
1916 [ AC_DEFINE(HAVE_SUN_LDAP_SDK, 1, [Sun LDAP SDK support])
1917 AC_MSG_RESULT(yes) ],
1918 [ AC_MSG_RESULT(no) ],
1919 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1921 AC_MSG_CHECKING([for Mozilla LDAP SDK])
1922 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1925 # elif HAVE_MOZLDAP_LDAP_H
1926 # include <mozldap/ldap.h>
1928 # include <string.h>
1932 return strcmp(LDAP_VENDOR_NAME,"mozilla.org");
1935 [ AC_DEFINE(HAVE_MOZILLA_LDAP_SDK, 1, [Mozilla LDAP SDK support])
1936 AC_MSG_RESULT(yes) ],
1937 [ AC_MSG_RESULT(no)],
1938 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1941 dnl Check for LDAP_REBINDPROC_CALLBACK
1943 AC_MSG_CHECKING([for LDAP_REBINDPROC_CALLBACK])
1944 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1947 # elif HAVE_MOZLDAP_LDAP_H
1948 # include <mozldap/ldap.h>
1951 LDAP_REBINDPROC_CALLBACK ldap_rebind;
1953 [ AC_DEFINE(HAVE_LDAP_REBINDPROC_CALLBACK,1,[Define to 1 if you have LDAP_REBINDPROC_CALLBACK])
1954 AC_MSG_RESULT(yes) ],
1955 [ AC_MSG_RESULT(no) ])
1958 dnl Check for LDAP_REBIND_PROC
1960 AC_MSG_CHECKING([for LDAP_REBIND_PROC])
1961 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1964 # elif HAVE_MOZLDAP_LDAP_H
1965 # include <mozldap/ldap.h>
1968 LDAP_REBIND_PROC ldap_rebind;
1970 [ AC_DEFINE(HAVE_LDAP_REBIND_PROC,1,[Define to 1 if you have LDAP_REBIND_PROC])
1971 AC_MSG_RESULT(yes) ],
1972 [ AC_MSG_RESULT(no) ])
1975 dnl Check for LDAP_REBIND_FUNCTION
1977 AC_MSG_CHECKING([for LDAP_REBIND_FUNCTION])
1978 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1979 # define LDAP_REFERRALS
1982 # elif HAVE_MOZLDAP_LDAP_H
1983 # include <mozldap/ldap.h>
1986 LDAP_REBIND_FUNCTION ldap_rebind;
1988 [ AC_DEFINE(HAVE_LDAP_REBIND_FUNCTION,1,[Define to 1 if you have LDAP_REBIND_FUNCTION])
1989 AC_MSG_RESULT(yes) ],
1990 [ AC_MSG_RESULT(no) ])
1993 dnl Check for LDAP_SCOPE_DEFAULT
1995 AC_MSG_CHECKING([for LDAP_SCOPE_DEFAULT])
1996 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1999 # elif HAVE_MOZLDAP_LDAP_H
2000 # include <mozldap/ldap.h>
2003 int i=LDAP_SCOPE_DEFAULT;
2005 [ AC_DEFINE(HAVE_LDAP_SCOPE_DEFAULT,1,[Define to 1 if you have LDAP_SCOPE_DEFAULT])
2006 AC_MSG_RESULT(yes) ],
2007 [ AC_MSG_RESULT(no) ])
2010 dnl Check for ldap_url_desc.lud_scheme
2012 AC_CHECK_MEMBER(struct ldap_url_desc.lud_scheme,
2013 AC_DEFINE(HAVE_LDAP_URL_LUD_SCHEME,1,
2014 [Define to 1 if you have LDAPURLDesc.lud_scheme]),,[#include <ldap.h>])
2017 dnl Check for ldapssl_client_init
2019 AC_CHECK_LIB(ldap,ldapssl_client_init,
2020 AC_DEFINE(HAVE_LDAPSSL_CLIENT_INIT,1,[Define to 1 if you have ldapssl_client_init]),)
2023 dnl Check for ldap_url_desc2str
2025 AC_CHECK_LIB(ldap,ldap_url_desc2str,
2026 AC_DEFINE(HAVE_LDAP_URL_DESC2STR,1,[Define to 1 if you have ldap_url_desc2str]),)
2029 dnl Check for ldap_url_parse
2031 AC_CHECK_LIB(ldap,ldap_url_parse,
2032 AC_DEFINE(HAVE_LDAP_URL_PARSE,1,[Define to 1 if you have ldap_url_parse]),)
2035 dnl Check for ldap_start_tls_s
2037 AC_CHECK_LIB(ldap,ldap_start_tls_s,
2038 AC_DEFINE(HAVE_LDAP_START_TLS_S,1,[Define to 1 if you have ldap_start_tls_s]),)
2045 AC_ARG_ENABLE(forw-via-db,
2046 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [
2047 SQUID_YESNO([$enableval],[unrecognized argument to --enable-forw-via-db: $enableval])
2049 SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no},
2050 [Enable Forw/Via database])
2051 AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db])
2053 AC_ARG_ENABLE(cache-digests,
2054 AS_HELP_STRING([--enable-cache-digests],
2055 [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
2057 SQUID_YESNO($enableval,
2058 [unrecognized argument to --enable-cache-digests: $enableval])
2060 SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no},
2061 [Use Cache Digests for locating objects in neighbor caches.])
2062 AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests])
2065 ################################
2066 # check for netio plugin stuff #
2067 ################################
2068 dnl order of these options handling is relevant in case the user
2069 dnl supplies more than one --enable option. Options handled later
2070 dnl override those handled earlier for io loop method manual override
2071 AC_ARG_ENABLE(select,
2072 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
2074 SQUID_YESNO($enableval,[--disable-select takes no extra argument])
2075 if test "x$enableval" = "xyes"; then
2076 if test "x$squid_host_os" = "xmingw"; then
2077 squid_opt_io_loop_engine="select_win32"
2079 squid_opt_io_loop_engine="select"
2083 AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}])
2086 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
2088 SQUID_YESNO($enableval,[--disable-poll takes no extra argument])
2089 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="poll"
2091 AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}])
2093 AC_ARG_ENABLE(kqueue,
2094 AS_HELP_STRING([--disable-kqueue],
2095 [Disable kqueue(2) support.]), [
2096 SQUID_YESNO($enableval,[--enable-kqueue takes no extra argument])
2098 if test "x${enable_kqueue:=auto}" != "xno" ; then
2099 AC_CHECK_HEADERS([sys/event.h],[],[
2100 if test "x${enable_kqueue}" = "xyes" ; then
2101 AC_MSG_ERROR([kqueue support requires sys/event.h header file.])
2104 AC_CHECK_FUNCS(kqueue,[],[
2105 if test "x${enable_kqueue}" = "xyes" ; then
2106 AC_MSG_ERROR([kqueue support missing in libc library.])
2109 if test "x$ac_cv_func_kqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes" ; then
2110 squid_opt_io_loop_engine="kqueue"
2115 AC_MSG_NOTICE([enabling kqueue for net I/O: ${enable_kqueue:=auto}])
2118 AC_ARG_ENABLE(epoll,
2119 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
2121 SQUID_YESNO($enableval,[--disable-epoll takes no extra argument])
2122 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="epoll"
2124 AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}])
2126 # auto-detect and verify epoll header and library present and working
2127 # logic mapping and loop method selection are performed later
2128 if test "x$enable_epoll" != "xno" ; then
2130 # check if libs are needed to support epoll
2131 # note: this code block seems quite generic. Could it be extracted
2132 # into a squid specific configure function?
2133 SQUID_STATE_SAVE(squid_epoll_state)
2134 AC_SEARCH_LIBS(epoll_ctl,[epoll])
2135 if test "x$ac_cv_search_epoll_ctl" = "xno" ; then
2136 enable_epoll=no #disable. Needed code not found
2137 elif test "x$ac_cv_search_epoll_ctl" = "xnone required" ; then
2140 EPOLL_LIBS=$ac_cv_search_epoll_ctl
2142 AC_SUBST(EPOLL_LIBS)
2143 SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS
2145 # epoll requires sys/epoll.h
2146 AC_CHECK_HEADERS([sys/epoll.h])
2148 dnl Verify that epoll really works
2149 if test "x$ac_cv_search_epoll_ctl" != 'xno' ; then
2153 if test "x$enable_epoll" = "xyes" -a "x$squid_cv_epoll_works" = "xno" ; then
2154 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
2158 dnl Enable /dev/poll
2159 AC_ARG_ENABLE(devpoll,
2160 AS_HELP_STRING([--disable-devpoll],[Disable Solaris /dev/poll support.]),
2162 SQUID_YESNO($enableval,[--disable-devpoll takes no extra argument])
2163 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="devpoll"
2165 AC_MSG_NOTICE([enabling /dev/poll for net I/O: ${enable_devpoll:=auto}])
2167 ## auto-detect and verify devpoll header and library present and working
2168 if test "x$enable_devpoll" != "xno"; then
2170 # /dev/poll requires ioctl() and write()
2171 AC_CHECK_FUNCS(ioctl)
2172 AC_CHECK_FUNCS(write)
2174 # /dev/poll requires sys/devpoll.h
2175 AC_CHECK_HEADERS([sys/devpoll.h],,[
2176 if test "x$enable_devpoll" = "xyes"; then
2177 AC_MSG_ERROR([--enable-devpoll specified but /dev/poll headers not found])
2181 # Verify that /dev/poll really works
2182 if test "x$enable_devpoll" != 'xno' ; then
2186 if test "x$enable_devpoll" = "xyes" -a "x$squid_cv_devpoll_works" = "xno" ; then
2187 AC_MSG_ERROR([/dev/poll does not work. Force-enabling it is not going to help.])
2192 AC_ARG_ENABLE(http-violations,
2193 AS_HELP_STRING([--disable-http-violations],
2194 [This allows you to remove code which is known to
2195 violate the HTTP protocol specification.]), [
2196 SQUID_YESNO([$enableval],
2197 [unrecognized argument to --disable-http-violations: $enableval])
2199 SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes},
2200 [Define to enable code which volates the HTTP standard specification])
2201 AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations])
2203 # IPFW Transparent Proxy
2204 AC_ARG_ENABLE(ipfw-transparent,
2205 AS_HELP_STRING([--enable-ipfw-transparent],
2206 [Enable Transparent Proxy support for systems
2207 using FreeBSD IPFW-style firewalling.]), [
2208 SQUID_YESNO([$enableval],
2209 [unrecognized argument to --enable-ipfw-transparent: $enableval])
2211 SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no},
2212 [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.])
2213 AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent])
2215 # IP-Filter Transparent Proxy
2216 AC_ARG_ENABLE(ipf-transparent,
2217 AS_HELP_STRING([--enable-ipf-transparent],
2218 [Enable Transparent Proxy support using IPFilter-style firewalling]), [
2219 SQUID_YESNO([$enableval],
2220 [unrecognized argument to --enable-ipf-transparent: $enableval])
2222 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2223 #IPF currently broken. Default-disabled for now.
2224 AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}])
2226 dnl Enable PF Transparent Proxy
2227 AC_ARG_ENABLE(pf-transparent,
2228 AS_HELP_STRING([--enable-pf-transparent],
2229 [Enable Transparent Proxy support for systems using PF network address redirection.]), [
2230 SQUID_YESNO([$enableval],
2231 [unrecognized argument to --enable-pf-transparent: $enableval])
2233 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2234 AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=no}])
2236 dnl Enable /dev/pf support for older PF Transparent Proxy systems (OpenBSD 4.x and older)
2237 AC_ARG_WITH(nat-devpf,
2238 AS_HELP_STRING([--with-nat-devpf],
2239 [Enable /dev/pf support for NAT on older OpenBSD and FreeBSD kernels.]), [
2240 SQUID_YESNO([$enableval],
2241 [unrecognized argument to --with-nat-devpf: $enableval])
2243 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2244 AC_MSG_NOTICE([NAT lookups via /dev/pf: ${with_nat_devpf:=no}])
2246 # Linux Netfilter Transparent Proxy
2247 AC_ARG_ENABLE(linux-netfilter,
2248 AS_HELP_STRING([--enable-linux-netfilter],
2249 [Enable Transparent Proxy support for Linux (Netfilter)]), [
2250 SQUID_YESNO([$enableval],
2251 [unrecognized argument to --enable-linux-netfilter: $enableval])
2253 AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}])
2254 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2257 dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking)
2258 dnl squid_opt_netfilterconntrack is set only when option is explicity specified
2259 AC_ARG_WITH(netfilter-conntrack,
2260 AS_HELP_STRING([--without-netfilter-conntrack],
2261 [Do not use Netfilter conntrack libraries for packet marking.
2262 A path to alternative library location may be specified by
2263 using --with-netfilter-conntrack=PATH. Default: auto-detect.]), [
2264 case "$with_netfilter_conntrack" in
2266 squid_opt_netfilterconntrack=$with_netfilter_conntrack
2269 if test ! -d "$withval" ; then
2270 AC_MSG_ERROR([--without-netfilter-conntrack path does not point to a directory])
2272 squid_opt_netfilterconntrackpath=$withval
2273 LDFLAGS="-L$squid_opt_netfilterconntrackpath/lib $LDFLAGS"
2274 CPPFLAGS="-I$squid_opt_netfilterconntrackpath/include $CPPFLAGS"
2275 with_netfilter_conntrack=yes
2276 squid_opt_netfilterconntrack=yes
2279 AC_MSG_NOTICE([Linux Netfilter Conntrack support requested: ${with_netfilter_conntrack:=auto}])
2280 if test "x$with_netfilter_conntrack" != "xno"; then
2281 AC_SEARCH_LIBS([nfct_query], [netfilter_conntrack],,[
2282 if test x"$with_netfilter_conntrack" = "xyes"; then
2283 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack library not found])
2285 with_netfilter_conntrack=no])
2286 AC_CHECK_HEADERS([libnetfilter_conntrack/libnetfilter_conntrack.h \
2287 libnetfilter_conntrack/libnetfilter_conntrack_tcp.h],,[
2288 if test x"$with_netfilter_conntrack" = "xyes"; then
2289 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack headers not found])
2291 with_netfilter_conntrack=no])
2292 # If nothing is broken; enable the libraries usage.
2293 if test "x$with_netfilter_conntrack" != "xno"; then
2294 with_netfilter_conntrack=yes
2299 dnl Enable Large file support
2301 squid_opt_enable_large_files=no
2303 AC_ARG_WITH(large-files,
2304 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]), [
2305 if test "x$withval" = "xyes"; then
2306 squid_opt_enable_large_files=yes
2310 dnl UNIX Build environment
2311 dnl AS_HELP_STRING is not suited here because it cannot to specify newlines
2312 AC_ARG_WITH(build-environment,
2313 AS_HELP_STRING([--with-build-environment=model],
2314 [The build environment to use. Normally one of
2315 POSIX_V6_ILP32_OFF32 (32 bits),
2316 POSIX_V6_ILP32_OFFBIG (32 bits with large file support),
2317 POSIX_V6_LP64_OFF64 (64 bits),
2318 POSIX_V6_LPBIG_OFFBIG (large pointers and files),
2319 XBS5_ILP32_OFF32 i(legacy, 32 bits),
2320 XBS5_ILP32_OFFBIG (legacy, 32 bits with large file support),
2321 XBS5_LP64_OFF64 (legacy, 64 bits),
2322 XBS5_LPBIG_OFFBIG (legacy, large pointers and files)
2323 or default (The default for your OS)]), [
2326 AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf])
2329 buildmodel="$withval"
2334 #hack. Let's early-detect sizeof(long)
2335 AC_CHECK_SIZEOF(long)
2337 if test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"; then
2338 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
2339 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
2344 if test "x$buildmodel" = "x"; then
2345 AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
2348 if test "x$buildmodel" = "xdefault" -o "x$buildmodel" = "x"; then
2349 # define _FILE_OFFSET_BITS if requested and needed
2350 if test "x$squid_opt_enable_large_files" = "xyes" -a $ac_cv_sizeof_long -le 4 ; then
2351 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
2352 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
2353 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2356 AC_MSG_NOTICE([Using $buildmodel build environment])
2357 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
2360 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
2362 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
2363 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2364 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
2365 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
2366 if test "x$squid_host_os" = "xsolaris" ; then
2368 # On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
2369 # for LDFLAGS -xarch=generic64, but:
2370 # "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
2371 # For gcc "-xarch=generic64" must be replaced with "-m64"
2372 # The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
2373 if test "x$GCC" = "xyes"; then
2374 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
2375 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
2376 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
2377 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
2378 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2379 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2380 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
2382 AC_MSG_NOTICE([Removing -Usun on $host])
2383 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
2384 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
2388 dnl Enable Leak Finding Functions
2389 AC_ARG_ENABLE(leakfinder,
2390 AS_HELP_STRING([--enable-leakfinder],
2391 [Enable Leak Finding code. Enabling this alone does nothing;
2392 you also have to modify the source code to use the leak
2393 finding functions. Probably Useful for hackers only.]), [
2394 SQUID_YESNO([$enableval],
2395 [unrecognized argument to --enable-leakfinder: $enableval])
2397 AC_MSG_NOTICE([Leak Finder enabled: ${enable_leakfinder:=no}])
2398 SQUID_DEFINE_BOOL(USE_LEAKFINDER,$enable_leakfinder,
2399 [Enable code for assisting in finding memory leaks. Not for the faint of heart])
2400 AM_CONDITIONAL(MAKE_LEAKFINDER, [test "x$enable_leakfinder" = "xyes"])
2403 AC_ARG_ENABLE(follow-x-forwarded-for,
2404 AS_HELP_STRING([--enable-follow-x-forwarded-for],
2405 [Enable support for following the X-Forwarded-For
2406 HTTP header to try to find the IP address of the
2407 original or indirect client when a request has
2408 been forwarded through other proxies.]), [
2409 SQUID_YESNO([$enableval],
2410 [unrecognized argument to --enable-follow-x-forwarded-for: $enableval])
2412 AC_MSG_NOTICE([Support for X-Forwarded-For enabled: ${enable_follow_x_forwarded_for:=yes}])
2413 SQUID_DEFINE_BOOL(FOLLOW_X_FORWARDED_FOR,$enable_follow_x_forwarded_for,
2414 [Enable following X-Forwarded-For headers])
2416 AC_ARG_ENABLE(ident-lookups,
2417 AS_HELP_STRING([--disable-ident-lookups],
2418 [Remove code that supports performing Ident (RFC 931) lookups.]), [
2419 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ident-lookups: $enableval])
2421 AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}])
2422 SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups])
2424 AM_CONDITIONAL(USE_SSL_CRTD, false)
2425 AC_ARG_ENABLE(ssl-crtd,
2426 AC_HELP_STRING([--enable-ssl-crtd],
2427 [Prevent Squid from directly generation of SSL private key and
2428 certificate request and instead enables the ssl_crtd processes.]), [
2429 SQUID_YESNO([$enableval],
2430 [unrecogized argument to --enable-ssl-crtd: $enableval])
2433 if test "x$enable_ssl_crtd" = "xyes" -a "x$with_openssl" = "xno" ; then
2434 AC_MSG_ERROR([You need to enable ssl gatewaying support to use ssl_crtd feature. Try to use --with-openssl. ])
2436 SQUID_DEFINE_BOOL(USE_SSL_CRTD, ${enable_ssl_crtd:=no},[Use ssl_crtd daemon])
2437 AM_CONDITIONAL(USE_SSL_CRTD, [test "x$enable_ssl_crtd" = "xyes"])
2439 dnl Select Default hosts file location
2440 AC_ARG_ENABLE(default-hostsfile,
2441 AS_HELP_STRING([--enable-default-hostsfile=path],
2442 [Select default location for hosts file.
2443 See hosts_file directive in squid.conf for details]), [
2444 if test "x$enableval" != "xnone" -a "x$enableval" != "xno" ; then
2445 if test \! -f "$enableval"; then
2446 AC_MSG_WARN([Unable to find file $enableval. I hope you know what you are doing.])
2448 squid_opt_default_hosts=$enableval
2450 squid_opt_default_hosts="none"
2453 AC_MSG_NOTICE([Default hosts file set to: ${squid_opt_default_hosts:=/etc/hosts}])
2454 DEFAULT_HOSTS=$squid_opt_default_hosts
2455 AC_SUBST(DEFAULT_HOSTS)
2457 # Select auth schemes modules to build
2459 AS_HELP_STRING([--enable-auth],
2460 [Build global support for authentication. The list of schemes
2461 and helpers to be enabled is defined elsewhere]), [
2462 SQUID_YESNO([$enableval],
2463 [unrecognized argument to --enable-auth: $enableval])
2465 AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}])
2466 SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,[Enable support for authentication])
2467 AM_CONDITIONAL(ENABLE_AUTH, test "x$enable_auth" != "xno")
2470 AC_ARG_ENABLE(auth-basic,
2471 AS_HELP_STRING([--enable-auth-basic="list of helpers"],
2472 [Enable the basic authentication scheme, and build the specified helpers.
2473 Not providing an explicit list of helpers will attempt build of
2474 all possible helpers. Default is to do so.
2475 To disable the basic authentication scheme, use --disable-auth-basic.
2476 To enable but build no helpers, specify "none".
2477 To see available helpers, see the helpers/basic_auth directory. ]),[
2478 #nothing to do really
2480 m4_include([helpers/basic_auth/modules.m4])
2482 AC_ARG_ENABLE(auth-digest,
2483 AS_HELP_STRING([--enable-auth-digest="list of helpers"],
2484 [Enable the Digest authentication scheme, and build the specified helpers.
2485 Not providing an explicit list of helpers will attempt build of
2486 all possible helpers. Default is to do so.
2487 To disable the Digest authentication scheme, use --disable-auth-digest.
2488 To enable but build no helpers, specify "none".
2489 To see available helpers, see the helpers/digest_auth directory. ]),[
2490 #nothing to do, really
2492 m4_include([helpers/digest_auth/modules.m4])
2494 AC_ARG_ENABLE(auth-negotiate,
2495 AS_HELP_STRING([--enable-auth-negotiate="list of helpers"],
2496 [Enable the Negotiate authentication scheme, and build the specified
2498 Not providing an explicit list of helpers will attempt build of
2499 all possible helpers. Default is to do so.
2500 To disable the Negotiate authentication scheme,
2501 use --disable-auth-negotiate.
2502 To enable but build no helpers, specify "none".
2503 To see available helpers, see the helpers/negotiate_auth directory. ]),[
2504 #nothing to do, really
2506 m4_include([helpers/negotiate_auth/modules.m4])
2508 AC_ARG_ENABLE(auth-ntlm,
2509 AS_HELP_STRING([--enable-auth-ntlm="list of helpers"],
2510 [Enable the NTLM authentication scheme, and build the specified helpers.
2511 Not providing an explicit list of helpers will attempt build of
2512 all possible helpers. Default is to do so.
2513 To disable the NTLM authentication scheme, use --disable-auth-ntlm.
2514 To enable but build no helpers, specify "none".
2515 To see available helpers, see the helpers/ntlm_auth directory. ]),[
2517 m4_include([helpers/ntlm_auth/modules.m4])
2519 dnl Authentication libraries to build
2520 dnl This list will not be needed when each auth library has its own Makefile
2521 dnl this is to be placed AFTER each auth module's handler
2523 for module in $AUTH_MODULES; do
2524 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD ${module}/lib${module}.la"
2526 AC_SUBST(AUTH_MODULES)
2527 AC_SUBST(AUTH_LIBS_TO_BUILD)
2529 dnl Select logging daemon helpers to build
2530 AC_ARG_ENABLE(log-daemon-helpers,
2531 AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"],
2532 [This option selects which logging daemon helpers to
2533 build and install as part of the normal build process
2534 For a list of available helpers see the helpers/log_daemon
2536 #nothing to do, really
2538 m4_include([helpers/log_daemon/modules.m4])
2540 AC_ARG_ENABLE(external-acl-helpers,
2541 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
2542 [Enable external_acl helpers support and thelpers themselves.
2543 Default is to build all buildable helpers and enable support.
2544 To disable support, use --disable-external-acl-helpers.
2545 To build no helpers, specify "none".
2546 To see available helpers, see the helpers/external_acl
2548 #nothing to do, really
2550 m4_include([helpers/external_acl/modules.m4])
2552 dnl Select url_rewrite helpers to build
2553 AC_ARG_ENABLE(url-rewrite-helpers,
2554 AS_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
2555 [This option selects which url_rewrite helpers to
2556 build and install as part of the normal build
2557 process. The default is to attempt the build of all possible
2558 helpers. Use --disable-url-rewrite-helpers to build none.
2559 For a list of available helpers see the
2560 helpers/url_rewrite directory.]),[
2562 m4_include([helpers/url_rewrite/modules.m4])
2564 dnl Select storeid_rewrite helpers to build
2565 AC_ARG_ENABLE(storeid-rewrite-helpers,
2566 AS_HELP_STRING([--enable-storeid-rewrite-helpers="list of helpers"],
2567 [This option selects which Store-ID rewrite helpers to
2568 build and install as part of the normal build
2569 process. The default is to attempt the build of all possible
2570 helpers. Use --disable-storeid-rewrite-helpers to build none.
2571 For a list of available helpers see the
2572 helpers/storeid_rewrite directory.]),[
2574 m4_include([helpers/storeid_rewrite/modules.m4])
2576 AC_ARG_WITH(valgrind-debug,
2577 AS_HELP_STRING([--with-valgrind-debug],
2578 [Include debug instrumentation for use with valgrind]),
2580 SQUID_YESNO([$withval],
2581 [unrecognized argument to --with-valgrind-debug: $withval])
2582 if test "x$withval" != "xno" ; then
2583 AC_CHECK_HEADERS(valgrind/memcheck.h,[],[
2584 AC_MSG_ERROR([Valgrind support requested, needed headers not found.])
2588 SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no},
2589 [Valgrind memory debugger support])
2590 AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug])
2592 dnl Disable "memPools" code
2593 #AC_ARG_ENABLE(chunkedmempools,
2594 # AS_HELP_STRING([--enable-chunkedmempools],
2595 # [Enable experimental chunked memPools. Note that this option
2596 # simply sets the default behaviour. Specific classes can override this
2597 # at runtime, and only lib/MemPool.c needs to be altered
2598 # to change the squid-wide default for all classes.]), [
2599 #SQUID_YESNO([$enableval],
2600 # [--enable-chunkedmempools option takes no arguments])
2602 SQUID_DEFINE_BOOL(USE_CHUNKEDMEMPOOLS,${enable_chunkedmempools:=no},
2603 [Enable chunked Memory Pools support (experimental)])
2604 #AC_MSG_NOTICE([Chunked MemPools enabled: $enable_chunkedmempools])
2606 dnl Enable WIN32 Service compile mode
2607 AC_ARG_ENABLE(win32-service,
2608 AS_HELP_STRING([--enable-win32-service],
2609 [Compile Squid as a WIN32 Service.
2610 Works only on MS-Windows platforms]), [
2611 SQUID_YESNO([$enableval],
2612 [unrecognized argument to --enable-win32-service: $enableval])
2614 SQUID_DEFINE_BOOL(USE_WIN32_SERVICE,${enable_win32_service:=no},
2615 [Enable code supporting MS Windows service mode])
2616 AC_MSG_NOTICE([MS Windows service mode enabled: $enable_win32_service])
2619 # Disable "unlinkd" code
2620 AC_ARG_ENABLE(unlinkd,
2621 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [
2622 SQUID_YESNO([$enableval],
2623 [unrecognized argument to --disable-unlinkd: $enableval])
2625 SQUID_DEFINE_BOOL(USE_UNLINKD,${enable_unlinkd:=yes},
2626 [Enable useage of unlinkd])
2627 AM_CONDITIONAL(ENABLE_UNLINKD,test "x$enable_unlinkd" = "xyes")
2628 AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd])
2630 # Enable backtraces on fatal errors
2631 AC_ARG_ENABLE(stacktraces,
2632 AS_HELP_STRING([--enable-stacktraces],
2633 [Enable automatic call backtrace on fatal errors]), [
2634 SQUID_YESNO([$enableval],
2635 [unrecognized argument to --enable-stacktraces: $enableval])
2637 SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no},
2638 [Print stack traces on fatal errors])
2639 AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces])
2642 # CPU Profiling options handling
2643 AC_ARG_ENABLE(cpu-profiling,
2644 AS_HELP_STRING([--enable-cpu-profiling],
2645 [Enable instrumentation to try and understand how CPU power
2646 is spent by squid, by enabling specific probes in selected
2648 New probes can only be added by modifying the source code.
2649 It is meant to help developers in optimizing performance
2650 of Squid internal functions.
2651 If you are not developer you should not enable this,
2652 as it slows squid down somewhat.
2653 See lib/Profiler.c for more details.]), [
2654 SQUID_YESNO([$enableval],
2655 [unrecognized argument to --enable-cpu-profiling: $enableval])
2657 # Default OFF. This is a debug feature. Only check and enable if forced ON.
2658 if test "x$enable_cpu_profiling" = "xyes"; then
2659 SQUID_CHECK_FUNCTIONAL_CPU_PROFILER
2660 if test "x$squid_cv_cpu_profiler_works" = "xno"; then
2661 AC_MSG_ERROR([CPU profiling will not be functional in this build.])
2664 SQUID_DEFINE_BOOL(USE_XPROF_STATS,${enable_cpu_profiling:=no},
2665 [Define to enable CPU profiling within Squid])
2666 AM_CONDITIONAL(ENABLE_XPROF_STATS,
2667 test "x$enable_cpu_profiling" = "xyes")
2668 AC_MSG_NOTICE([CPU profiling enabled: $enable_cpu_profiling])
2670 # Enable X-Accelerator-Vary for Vary support within an accelerator setup
2671 AC_ARG_ENABLE(x-accelerator-vary,
2672 AS_HELP_STRING([--enable-x-accelerator-vary],
2673 [Enable support for the X-Accelerator-Vary
2674 HTTP header. Can be used to indicate
2675 variance within an accelerator setup.
2676 Typically used together with other code
2677 that adds custom HTTP headers to the requests.]), [
2678 SQUID_YESNO([$enableval],
2679 [unrecognized argument to --enable-x-accelerator-vary: $enableval])
2681 SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no},
2682 [Enable support for the X-Accelerator-Vary HTTP header])
2683 AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary])
2686 if $CPPUNITCONFIG --help >/dev/null; then
2687 squid_cv_cppunit_version="`$CPPUNITCONFIG --version`"
2688 AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version])
2689 unset squid_cv_cppunit_version
2690 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2692 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2694 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
2696 SQUID_CPPUNIT_LIBS=''
2697 SQUID_CPPUNIT_INC=''
2700 AC_ARG_WITH(cppunit-basedir,
2701 AS_HELP_STRING([--with-cppunit-basedir=PATH],
2702 [Path where the cppunit headers are libraries can be found ]), [
2703 if test -f "$withval/include/cppunit/TestCase.h"; then
2704 AC_MSG_NOTICE([Using cppunit includes from $withval])
2705 SQUID_CPPUNIT_INC="-I${withval}/include"
2707 AC_MSG_ERROR(Cannot find cppunit at $withval)
2709 if test -f "$withval/lib/libcppunit.la"; then
2710 AC_MSG_NOTICE([Using cppunit lib from $withval])
2711 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2712 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2714 AC_MSG_ERROR(Cannot find cppunit at $withval)
2717 SQUID_STATE_SAVE(squid_cppunit_state)
2718 CXXFLAGS="$CXXFLAGS $SQUID_CPPUNIT_INC"
2719 AC_CHECK_HEADERS(cppunit/extensions/HelperMacros.h)
2720 SQUID_STATE_ROLLBACK(squid_cppunit_state)
2721 AC_SUBST(SQUID_CPPUNIT_LIBS)
2722 AC_SUBST(SQUID_CPPUNIT_LA)
2723 AC_SUBST(SQUID_CPPUNIT_INC)
2725 # Force some compilers to use ANSI features
2729 if test "x$ac_cv_prog_CC" = "xcc" ; then
2730 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
2738 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2742 AC_MSG_NOTICE([Disabling ranlib for HP-UX...])
2747 dnl Check for headers
2772 linux/posix_types.h \
2780 netinet/in_systm.h \
2832 linux/netfilter_ipv4.h \
2833 linux/netfilter_ipv6/ip6_tables.h \
2835 SQUID_DEFAULT_INCLUDES
2839 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2840 #if HAVE_NETINET_IN_H
2841 #include <netinet/in.h>
2845 dnl *BSD dont include the dependencies for all their net/ and netinet/ files
2846 dnl We must include a few basic type headers for them to work.
2861 SQUID_BSDNET_INCLUDES)
2867 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2870 #include <sys/time.h>
2877 dnl Override rusage() detect on MinGW because is emulated in source code
2878 case "$squid_host_os" in
2880 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2881 ac_cv_func_getrusage='yes'
2882 AC_MSG_NOTICE([Using own rusage on Windows.])
2885 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2887 #include <sys/time.h>
2889 #if HAVE_SYS_RESOURCE_H
2890 #include <sys/resource.h>
2895 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2896 #if HAVE_SYS_TYPES_H
2897 #include <sys/types.h>
2899 #include <netinet/in.h>
2900 #include <netinet/in_systm.h>
2901 #include <netinet/ip.h>
2902 #if defined (__linux__) || defined (__CYGWIN__)
2911 dnl Check for typedefs
2912 AC_CHECK_SIZEOF(void *)
2914 # check for a bunch of types
2928 AC_CHECK_TYPE([bool])
2929 #need the defines for PRId64
2930 AC_CHECK_SIZEOF(int64_t)
2931 AC_CHECK_SIZEOF(long)
2932 #need the defines for PRIuSIZE
2933 AC_CHECK_SIZEOF(size_t)
2934 #need the define for overflow checks
2935 AC_CHECK_SIZEOF(off_t)
2936 AC_CHECK_SIZEOF(size_t)
2938 dnl Some C++11 types we try to use
2940 AX_CXX_TYPE_UNIQUE_PTR
2941 AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS
2942 SQUID_CXX_STD_UNDERLYING_TYPE
2944 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2945 dnl that is incompatible with the updated Solaris header files.
2946 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2947 AC_CHECK_TYPE(pad128_t,
2948 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2949 ,SQUID_DEFAULT_INCLUDES)
2951 AC_CHECK_TYPE(upad128_t,
2952 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2953 ,SQUID_DEFAULT_INCLUDES)
2955 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2956 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2958 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2959 #include <sys/types.h>
2960 #include <sys/socket.h>
2966 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
2967 [mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2968 #include <sys/ipc.h>
2969 #include <sys/msg.h>])
2971 # check for compiler support of %zu printf macro
2972 AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro])
2973 AC_MSG_CHECKING([for compiler %zu support])
2974 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2976 ]],[[size_t n=1;printf("%zu",n);]])],[
2977 AC_DEFINE(PRIuSIZE,"zu")
2979 ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
2982 dnl Check for special functions
2986 dnl Check for libcap header (assume its not broken unless
2987 AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],
2988 [disable usage of Linux capabilities library to control privileges]), [
2989 SQUID_YESNO([$withval],[unrecognized argument to --without-libcap: $withval])
2990 ],[with_libcap=auto])
2992 if test "x$with_libcap" != "xno"; then
2993 # cap_clear_flag is the most recent libcap function we require
2994 AC_CHECK_HEADERS(sys/capability.h)
2995 AC_CHECK_LIB(cap, cap_clear_flag)
2996 SQUID_CHECK_FUNCTIONAL_LIBCAP2
2998 # if it can't be supported..
2999 if test "x$ac_cv_header_sys_capability_h" = "xno" -o \
3000 "x$ac_cv_lib_cap_cap_clear_flag" = "xno"; then
3001 # and it was forced on: error
3002 if test "x$with_libcap" = "xyes" ; then
3003 AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
3005 # with_libcap is "auto"; it can't be supported. Disable.
3009 # header and lib are ok, we support
3015 SQUID_DEFINE_BOOL(USE_LIBCAP,$with_libcap,
3016 [use libcap to set capabilities required for TPROXY])
3017 AC_MSG_NOTICE([libcap support enabled: $with_libcap])
3018 SQUID_DEFINE_BOOL(LIBCAP_BROKEN,${squid_cv_sys_capability_works:=no},
3019 [libcap2 headers are broken and clashing with glibc])
3020 AC_MSG_NOTICE([libcap2 headers are ok: $squid_cv_sys_capability_works])
3023 dnl Check for needed libraries
3024 AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
3025 AC_SEARCH_LIBS([res_init],[resolv])
3026 AC_SEARCH_LIBS([__res_search],[resolv])
3027 AC_SEARCH_LIBS([bind],[socket])
3028 AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
3029 AC_SEARCH_LIBS([strlcpy], [bsd])
3030 AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
3031 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
3032 if test "x$squid_host_os" = "xmingw" ; then
3033 SQUID_CHECK_WINSOCK_LIB
3039 #include <winsock2.h>
3042 #include <windows.h>
3045 #include <ws2tcpip.h>
3050 # check that we have unix sockets
3051 SQUID_CHECK_UNIX_SOCKET
3052 SQUID_DEFINE_BOOL(HAVE_UNIXSOCKET,$squid_cv_unixsocket,[System supports unix sockets])
3054 AC_CHECK_LIB(gnumalloc, malloc)
3055 if test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"; then
3056 AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc])
3057 ac_cv_func_mallocblksize=no
3058 ac_cv_func_mallopt=no
3060 case "$squid_host_os" in
3062 AC_MSG_NOTICE([skipping libmalloc check for $host])
3065 AC_MSG_NOTICE([skipping libmalloc check for $host])
3069 AC_CHECK_LIB(malloc, main)
3074 case "$squid_host_os" in
3076 AC_MSG_NOTICE([Use MSVCRT for math functions.])
3079 dnl rint() and log() are only used in old C code for now.
3081 AC_SEARCH_LIBS([rint],[m])
3082 AC_SEARCH_LIBS([log],[m])
3087 dnl --with-maxfd present for compatibility with Squid-2.
3088 dnl undocumented in ./configure --help to encourage using the Squid-3 directive
3093 squid_filedescriptors_num=$withval
3094 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
3097 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
3102 AC_ARG_WITH(filedescriptors,
3103 AS_HELP_STRING([--with-filedescriptors=NUMBER],
3104 [Force squid to support NUMBER filedescriptors]),
3108 squid_filedescriptors_num=$withval
3109 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
3112 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
3117 SQUID_CHECK_DEFAULT_FD_SETSIZE
3119 if test "x$squid_filedescriptors_num" != "x"; then
3120 AC_MSG_NOTICE([Default number of fieldescriptors: $squid_filedescriptors_num])
3122 if test "$squid_filedescriptors_num" -lt 512 ; then
3123 AC_MSG_WARN([$squid_filedescriptors_num may not be enough filedescriptors if your])
3124 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3125 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3126 AC_MSG_WARN([on how to increase your filedescriptor limit])
3128 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $squid_filedescriptors_num,[Maximum number of open filedescriptors])
3131 dnl Enable IPv6 support
3132 AC_MSG_CHECKING([whether to enable IPv6])
3134 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support. The default is to probe system capabilities on startup.]), [
3135 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ipv6: $enableval])
3137 AC_MSG_RESULT(${enable_ipv6:=yes})
3138 SQUID_DEFINE_BOOL(USE_IPV6,$enable_ipv6,[Enable support for IPv6 ])
3140 if test "x$enable_ipv6" = "xyes" ; then
3141 SQUID_CHECK_SIN6_LEN_IN_SAI
3143 SQUID_CHECK_SS_LEN_IN_SOCKADDR_STORAGE
3144 SQUID_CHECK_SIN_LEN_IN_SOCKADDR_IN
3147 dnl Check for libdl, used by auth_modules/PAM
3148 if test "x$with_dl" = "xyes"; then
3149 AC_CHECK_LIB(dl, dlopen)
3152 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
3153 dnl Robert Side <rside@aiinc.bc.ca>
3154 dnl Mon, 18 Jan 1999 17:48:00 GMT
3157 AC_CHECK_LIB(intl, strftime)
3162 dnl this is not fully functional if db.h is for a differend db version
3165 dnl check that dbopen is actually defined in the header
3166 dnl FIXME: in case of failure undef db-related includes etc.
3167 AC_CHECK_DECL(dbopen,,,[
3168 #if HAVE_SYS_TYPES_H
3169 #include <sys/types.h>
3181 SQUID_CHECK_DBOPEN_NEEDS_LIBDB
3182 if test "x$ac_cv_dbopen_libdb" = "xyes"; then
3187 dnl System-specific library modifications
3191 if test "x$GCC" = "xyes"; then
3192 AC_MSG_NOTICE([Removing -O for gcc on $host])
3193 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
3198 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
3199 LIBS=`echo $LIBS | sed -e s/-lsocket//`
3200 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
3201 LIBS=`echo $LIBS | sed -e s/-lnsl//`
3202 ac_cv_lib_nsl_main=no
3203 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
3204 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3206 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
3207 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
3208 dnl Please change your configure script. AIX doesn't need -lbsd.
3210 AC_MSG_NOTICE([Removing -lbsd for AIX...])
3211 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3213 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_rtti],[-rtti],[[
3219 public:virtual ~Foo(){}
3221 class Bar:public Foo{
3222 public:Bar():Foo(){}
3225 Foo * myFoo=new Bar();
3226 Bar * myBar=dynamic_cast<Bar *>(myFoo);
3227 assert(myBar != NULL);
3229 if test "$ac_cv_require_rtti" = "yes"; then
3230 SQUID_CFLAGS="-rtti $SQUID_CFLAGS"
3231 SQUID_CXXFLAGS="-rtti $SQUID_CXXFLAGS"
3235 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_qcpluscmt],[-qcpluscmt],[[]],[[//c++ cmt]])
3237 if test "$ac_cv_require_qcpluscmt" = "yes"; then
3238 SQUID_CFLAGS="-qcpluscmt $SQUID_CFLAGS"
3243 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
3244 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
3245 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,
3246 [If gettimeofday is known to take only one argument])
3248 [*-*-solaris2.[0-4]])
3249 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3251 [*-sony-newsos[56]*])
3252 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3256 dnl This has to be before AC_CHECK_FUNCS
3257 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
3258 # when running configure.
3259 if test "x$ac_cv_func_poll" = "x" ; then
3263 AC_MSG_NOTICE([disabling poll for $host...])
3264 ac_cv_func_poll='no'
3267 # Henrik Nordstrom (hno@squid-cache.org) 19980817
3268 # poll is problematic on Linux. We disable it
3269 # by default until Linux gets it right.
3270 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
3271 if test $rev -lt 002002; then
3272 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
3273 ac_cv_func_poll='no'
3276 [powerpc-ibm-aix4.1.*])
3277 # Mike Laster (mlaster@metavillage.com) 19981021
3278 AC_MSG_NOTICE([disabling poll for $host...])
3279 ac_cv_func_poll='no'
3282 # Robert Side <rside@aiinc.bc.ca>
3283 # Mon, 18 Jan 1999 17:48:00 GMT
3284 AC_MSG_NOTICE([disabling poll for $host...])
3285 ac_cv_func_poll='no'
3290 dnl Check for library functions
3292 backtrace_symbols_fd \
3315 pthread_attr_setschedparam \
3316 pthread_attr_setscope \
3317 pthread_setschedparam \
3341 dnl ... and some we provide local replacements for
3350 AC_CHECK_DECLS([getaddrinfo,getnameinfo,inet_ntop,inet_pton,InetNtopA,InetPtonA],,,[
3352 * BSD requires sys/types.h, sys/socket.h, netinet/in.h, netdb.h, arpa/inet.h
3353 * Linux requires sys/types.h, sys/socket.h, arpa/inet.h
3354 * Windows requires sys/socket.h, winsock2.h, ws2tcpip.h
3356 #if HAVE_SYS_TYPES_H
3357 #include <sys/types.h>
3359 #if HAVE_NETINET_IN_H
3360 #include <netinet/in.h>
3362 #if HAVE_SYS_SOCKET_H
3363 #include <sys/socket.h>
3368 #if HAVE_ARPA_INET_H
3369 #include <arpa/inet.h>
3372 #include <winsock2.h>
3375 #include <ws2tcpip.h>
3379 # Magic which checks whether we are forcing a type of comm loop we
3380 # are actually going to (ab)use.
3381 # Mostly ripped from squid-commloops, thanks to adrian and benno
3383 if test "x$squid_opt_io_loop_engine" != "x"; then
3384 AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine])
3385 elif test "x$enable_epoll" != "xno" -a "x$squid_cv_epoll_works" = "xyes" ; then
3386 squid_opt_io_loop_engine="epoll"
3387 elif test "x$enable_kqueue" != "xno" ; then
3388 squid_opt_io_loop_engine="kqueue"
3389 elif test "x$enable_devpoll" != "xno" ; then
3390 squid_opt_io_loop_engine="devpoll"
3391 elif test "x$enable_poll" != "xno" -a "x$ac_cv_func_poll" = "xyes" ; then
3392 squid_opt_io_loop_engine="poll"
3393 elif test "x$enable_select" != "xno" -a "x$ac_cv_func_select" = "xyes"; then
3394 squid_opt_io_loop_engine="select"
3395 elif test "x$enable_select" != "xno" -a "x$squid_host_os" = "xmingw"; then
3396 squid_opt_io_loop_engine="select_win32"
3398 AC_MSG_WARN([Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!])
3399 AC_MSG_WARN([Will try select and hope for the best.])
3400 squid_opt_io_loop_engine="select"
3403 AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.])
3405 AM_CONDITIONAL([USE_POLL], [test $squid_opt_io_loop_engine = poll])
3406 AM_CONDITIONAL([USE_EPOLL], [test $squid_opt_io_loop_engine = epoll])
3407 AM_CONDITIONAL([USE_SELECT], [test $squid_opt_io_loop_engine = select])
3408 AM_CONDITIONAL([USE_SELECT_WIN32], [test $squid_opt_io_loop_engine = select_win32])
3409 AM_CONDITIONAL([USE_KQUEUE], [test $squid_opt_io_loop_engine = kqueue])
3410 AM_CONDITIONAL([USE_DEVPOLL], [test $squid_opt_io_loop_engine = devpoll])
3412 case $squid_opt_io_loop_engine in
3413 epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;;
3414 devpoll) AC_DEFINE(USE_DEVPOLL,1,[Use /dev/poll for the IO loop]) ;;
3415 poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;;
3416 kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;;
3417 select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;;
3418 select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;;
3421 if test "x$ac_cv_func_sched_getaffinity" = "xyes" -a "x$ac_cv_func_sched_setaffinity" = "xyes" ; then
3422 AC_DEFINE(HAVE_CPU_AFFINITY,1,[Support setting CPU affinity for workers])
3425 SQUID_CHECK_SETRESUID_WORKS
3426 if test "x$squid_cv_resuid_works" = "xyes" ; then
3427 AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Knowing that setresuid() exists is not enough, because RedHat 5.0 declares setresuid() but does not implement it.])
3430 AC_CHECK_HEADERS(mswsock.h)
3431 AC_MSG_CHECKING([for constant CMSG_SPACE])
3432 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3433 #if HAVE_SYS_SOCKET_H
3434 #include <sys/socket.h>
3437 #include <mswsock.h>
3440 int a[CMSG_SPACE(int)];
3443 AC_DEFINE(HAVE_CONSTANT_CMSG_SPACE, 1, [Define to 1 if CMSG_SPACE is constant])
3448 AC_CHECK_TYPE(struct cmsghdr,AC_DEFINE(HAVE_CMSGHDR,1,[The system provides struct cmsghdr]),,[
3449 #if HAVE_SYS_SOCKET_H
3450 #include <sys/socket.h>
3453 #include <mswsock.h>
3456 #include <winsock2.h>
3460 AC_CHECK_TYPE(struct iovec,AC_DEFINE(HAVE_IOVEC,1,[The system provides struct iovec]),,[
3461 #if HAVE_SYS_SOCKET_H
3462 #include <sys/socket.h>
3465 #include <winsock2.h>
3468 #include <sys/uio.h>
3472 AC_CHECK_TYPE(struct msghdr,AC_DEFINE(HAVE_MSGHDR,1,[The system provides struct msghdr]),,[
3473 #if HAVE_SYS_SOCKET_H
3474 #include <sys/socket.h>
3477 #include <mswsock.h>
3480 #include <winsock2.h>
3484 AC_CHECK_TYPE(struct sockaddr_un,AC_DEFINE(HAVE_SOCKADDR_UN,1,[The system provides sockaddr_un]),,[
3488 #if HAVE_SYS_SOCKET_H
3489 #include <sys/socket.h>
3492 #include <winsock2.h>
3496 SQUID_CHECK_FUNC_STRNSTR
3497 SQUID_CHECK_FUNC_VACOPY
3498 SQUID_CHECK_FUNC___VACOPY
3500 dnl IP-Filter support requires ipf header files. These aren't
3501 dnl installed by default, so we need to check for them
3502 if test "x$enable_ipf_transparent" != "xno" ; then
3503 SQUID_CHECK_BROKEN_SOLARIS_IPFILTER
3504 AC_MSG_CHECKING(for availability of IP-Filter header files)
3505 # hold on to your hats...
3506 if test "x$ac_cv_header_ip_compat_h" = "xyes" -o \
3507 "x$ac_cv_header_ip_fil_compat_h" = "xyes" -o \
3508 "x$ac_cv_header_netinet_ip_compat_h" = "xyes" -o \
3509 "x$ac_cv_header_netinet_ip_fil_compat_h" = "xyes" ; then
3510 have_ipfilter_compat_header="yes"
3512 if test "x$have_ipfilter_compat_header" = "xyes" -a \
3513 "x$ac_cv_header_ip_fil_h" = "xyes" -a \
3514 "x$ac_cv_header_ip_nat_h" = "xyes" ; then
3515 enable_ipf_transparent="yes"
3516 elif test "x$have_ipfilter_compat_header" = "xyes" -a \
3517 "x$ac_cv_header_netinet_ip_fil_h" = "xyes" -a \
3518 "x$ac_cv_header_netinet_ip_nat_h" = "xyes" ; then
3519 enable_ipf_transparent="yes"
3521 enable_ipf_transparent="no"
3523 AC_MSG_RESULT($IPF_TRANSPARENT)
3525 ## On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3526 ## Solaris minor version (8, 9, 10, ...)
3527 if test "x$enable_ipf_transparent" = "xyes" -a "x$squid_host_os" = "xsolaris" ; then
3528 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3529 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3530 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3534 AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent])
3535 SQUID_DEFINE_BOOL(IPF_TRANSPARENT,$enable_ipf_transparent,
3536 [Enable support for IPF-style transparent proxying])
3538 dnl PF /dev/pf support requires a header file.
3539 if test "x$with_nat_devpf" != "xno" ; then
3540 if test "x$ac_cv_header_net_pfvar_h" = "xyes" -o \
3541 "x$ac_cv_header_net_pf_pfvar_h" = "xyes"; then
3542 if test "x$with_nat_devpf" = "xauto" ; then
3546 if test "x$with_nat_devpf" = "xyes" ; then
3547 AC_MSG_ERROR([PF /dev/pf based NAT requested but needed header not found])
3552 SQUID_DEFINE_BOOL(PF_TRANSPARENT,${enable_pf_transparent:=no},
3553 [Enable support for PF-style transparent proxying])
3554 SQUID_DEFINE_BOOL(USE_NAT_DEVPF,${with_nat_devpf:=no},
3555 [Enable support for /dev/pf NAT lookups])
3557 if test "x$enable_linux_netfilter" != "xno" ; then
3558 if test "x$ac_cv_header_linux_netfilter_ipv4_h" = "xyes"; then
3559 if test "x$enable_linux_netfilter" = "xauto" ; then
3560 enable_linux_netfilter=yes
3563 if test "x$enable_linux_netfilter" = "xauto" ; then
3564 enable_linux_netfilter=no
3566 AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found])
3570 SQUID_DEFINE_BOOL(LINUX_NETFILTER,$enable_linux_netfilter,
3571 [Enable support for Transparent Proxy on Linux via Netfilter])
3573 dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3574 AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter])
3575 if test "x$enable_linux_netfilter" = "xyes" -a "x$with_libcap" != "xyes" ; then
3576 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for TPROXY])
3577 AC_MSG_WARN([Linux Transparent Proxy (version 4+) support WILL NOT be enabled])
3578 AC_MSG_WARN([Reduced support to NAT Interception Proxy])
3582 if test "x$squid_opt_netfilterconntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then
3583 AC_MSG_ERROR([Linux netfilter conntrack requires libcap support (libcap 2.09+)])
3585 if test "x$with_netfilter_conntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then
3586 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for netfilter mark support])
3587 AC_MSG_WARN([Linux netfilter marking support WILL NOT be enabled])
3588 with_netfilter_conntrack=no
3590 AC_MSG_NOTICE([Linux Netfilter Conntrack support enabled: ${with_netfilter_conntrack} ${squid_opt_netfilterconntrackpath}])
3593 AC_ARG_ENABLE(zph-qos,
3594 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]), [
3595 SQUID_YESNO([$enableval],
3596 [unrecognized argument to --enable-zph-qos: $enableval])
3598 SQUID_DEFINE_BOOL(USE_QOS_TOS,${enable_zph_qos:=yes},
3599 [Enable Zero Penalty Hit QOS. When set, Squid will alter the
3600 TOS field of HIT responses to help policing network traffic])
3601 AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos])
3602 if test x"$enable_zph_qos" = "xyes" ; then
3603 AC_MSG_NOTICE([QOS netfilter mark preservation enabled: $with_netfilter_conntrack])
3604 SQUID_DEFINE_BOOL(USE_LIBNETFILTERCONNTRACK,${with_netfilter_conntrack:=no},
3605 [Enable support for QOS netfilter mark preservation])
3609 AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB=''])
3610 AC_ARG_ENABLE(gnuregex,
3611 AS_HELP_STRING([--enable-gnuregex],
3612 [Compile GNUregex. Unless you have reason to use
3613 this option, you should not enable it.
3614 This library file is usually only required on Windows and
3615 very old Unix boxes which do not have their own regex
3616 library built in.]), [
3617 SQUID_YESNO([$enableval],[unrecognized argument to --enable-gnuregex: $enableval])
3619 # force-enable on old solaris and nextstep
3620 if test "x${enable_gnuregex:=auto}" = "xauto" ; then
3622 *-sun-solaris2.[[0-4]])
3623 enable_gnuregex="yes"
3626 enable_gnuregex="yes"
3631 # try detecting if it is needed
3632 if test "x$enable_gnuregex" = "xauto" ; then
3633 SQUID_CHECK_REGEX_WORKS
3634 if test "x$squid_cv_regex_works" = "xyes" ; then
3640 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3641 AC_MSG_RESULT($enable_gnuregex)
3642 if test "x$enable_gnuregex" = "xyes"; then
3643 # for some reason (force-enable, test..) gnuregex was found as needed. Override any system lib
3646 #if no reason was found to enable gnuregex, disable it
3647 if test "x$enable_gnuregex" = "xauto" ; then
3650 SQUID_DEFINE_BOOL(USE_GNUREGEX,$enable_gnuregex,[Define if we should use GNU regex])
3653 SQUID_DETECT_UDP_SND_BUFSIZE
3654 SQUID_DETECT_UDP_RECV_BUFSIZE
3655 SQUID_DETECT_TCP_SND_BUFSIZE
3656 SQUID_DETECT_TCP_RECV_BUFSIZE
3658 SQUID_CHECK_RECV_ARG_TYPE
3659 SQUID_CHECK_NEED_SYS_ERRLIST
3660 SQUID_CHECK_MAXPATHLEN
3662 SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK
3663 SQUID_CHECK_RESOLVER_FIELDS
3665 AC_CHECK_HEADERS(sys/statvfs.h)
3666 if test "x$ac_cv_header_sys_statvfs_h" = "xyes" ; then
3667 SQUID_CHECK_WORKING_STATVFS
3669 if test "x$ac_cv_func_statvfs" != "xyes" ; then
3670 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/vfs.h sys/statfs.h)
3671 AC_CHECK_FUNCS(statfs)
3672 SQUID_CHECK_F_FRSIZE_IN_STATFS
3675 dnl Squid will not usually attempt to translate templates when building
3676 AC_ARG_ENABLE(translation,
3677 AS_HELP_STRING([--enable-translation],[Generate the localized error page templates and manuals.
3678 Which can also be downloaded from http://www.squid-cache.org/Versions/langpack/.]), [
3679 SQUID_YESNO([$enableval],
3680 [unrecognized argument to --enable-translation: $enableval])
3682 if test "x${enable_translation:=no}" = "xyes" ; then
3683 AX_WITH_PROG([PO2HTML],[po2html])
3684 AX_WITH_PROG([PO2TEXT],[po2txt])
3692 dnl Squid now has limited locale handling ...
3694 AC_ARG_ENABLE(auto-locale,
3695 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
3696 clients request headers.
3697 When disabled Squid requires explicit language configuration.]), [
3698 SQUID_YESNO([$enableval],
3699 [unrecognized argument to --disable-auto-locale: $enableval])
3701 AC_MSG_NOTICE([Multi-Language support enabled: ${enable_auto_locale:=yes}])
3702 SQUID_DEFINE_BOOL(USE_ERR_LOCALES,$enable_auto_locale,
3703 [Use multi-language support on error pages])
3706 dnl Need the debugging version of malloc if available
3708 if test "x$ac_cv_lib_malloc_main" = "xyes" ; then
3709 if test -r /usr/lib/debug/malloc.o ; then
3710 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3712 if test -r /usr/lib/debug/mallocmap.o ; then
3713 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3718 if test "x$XTRA_LIBS" = "x"; then
3721 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3726 AC_SUBST(SQUID_CFLAGS)
3727 AC_SUBST(SQUID_CXXFLAGS)
3729 AC_ARG_VAR([BUILDCXXFLAGS],[C++ compiler flags for building compile-time tools. e.g. cf_gen])
3730 if test "x$BUILDCXXFLAGS" = "x"; then
3731 # if we are NOT cross-compiling, use the default build flags for cf_gen and friends
3732 # otherwise rely on the user-provided value
3733 if test "x$squid_cv_check_marchnative" = "xyes"; then
3734 # always valid for the Build compiler.
3735 BUILDCXXFLAGS="-march=native"
3737 BUILDCXXFLAGS="$BUILDCXXFLAGS $CXXFLAGS"
3739 AC_SUBST(BUILDCXXFLAGS)
3741 AC_MSG_NOTICE([BUILD LIBRARIES: $LIBS])
3742 AC_MSG_NOTICE([BUILD EXTRA LIBRARIES: $XTRA_LIBS])
3743 AC_MSG_NOTICE([BUILD OBJECTS: $OBJS])
3744 AC_MSG_NOTICE([BUILD EXTRA OBJECTS: $XTRA_OBJS])
3745 AC_MSG_NOTICE([BUILD C FLAGS: $CFLAGS])
3746 AC_MSG_NOTICE([BUILD EXTRA C FLAGS: $SQUID_CFLAGS])
3747 AC_MSG_NOTICE([BUILD C++ FLAGS: $CXXFLAGS])
3748 AC_MSG_NOTICE([BUILD EXTRA C++ FLAGS: $SQUID_CXXFLAGS])
3749 AC_MSG_NOTICE([BUILD Tools C++ FLAGS: $BUILDCXXFLAGS])
3751 dnl Clean up after OSF/1 core dump bug
3759 doc/manuals/Makefile
3760 doc/release-notes/Makefile
3763 helpers/basic_auth/Makefile
3764 helpers/basic_auth/DB/Makefile
3765 helpers/basic_auth/fake/Makefile
3766 helpers/basic_auth/getpwnam/Makefile
3767 helpers/basic_auth/LDAP/Makefile
3768 helpers/basic_auth/NCSA/Makefile
3769 helpers/basic_auth/NIS/Makefile
3770 helpers/basic_auth/PAM/Makefile
3771 helpers/basic_auth/POP3/Makefile
3772 helpers/basic_auth/RADIUS/Makefile
3773 helpers/basic_auth/SASL/Makefile
3774 helpers/basic_auth/SMB/Makefile
3775 helpers/basic_auth/SMB_LM/Makefile
3776 helpers/basic_auth/SSPI/Makefile
3777 helpers/digest_auth/Makefile
3778 helpers/digest_auth/eDirectory/Makefile
3779 helpers/digest_auth/file/Makefile
3780 helpers/digest_auth/LDAP/Makefile
3781 helpers/external_acl/Makefile
3782 helpers/external_acl/AD_group/Makefile
3783 helpers/external_acl/delayer/Makefile
3784 helpers/external_acl/eDirectory_userip/Makefile
3785 helpers/external_acl/file_userip/Makefile
3786 helpers/external_acl/kerberos_ldap_group/Makefile
3787 helpers/external_acl/LDAP_group/Makefile
3788 helpers/external_acl/LM_group/Makefile
3789 helpers/external_acl/session/Makefile
3790 helpers/external_acl/SQL_session/Makefile
3791 helpers/external_acl/unix_group/Makefile
3792 helpers/external_acl/wbinfo_group/Makefile
3793 helpers/external_acl/time_quota/Makefile
3794 helpers/log_daemon/Makefile
3795 helpers/log_daemon/DB/Makefile
3796 helpers/log_daemon/file/Makefile
3797 helpers/negotiate_auth/Makefile
3798 helpers/negotiate_auth/kerberos/Makefile
3799 helpers/negotiate_auth/SSPI/Makefile
3800 helpers/negotiate_auth/wrapper/Makefile
3801 helpers/ntlm_auth/Makefile
3802 helpers/ntlm_auth/fake/Makefile
3803 helpers/ntlm_auth/smb_lm/Makefile
3804 helpers/ntlm_auth/SSPI/Makefile
3805 helpers/ssl/Makefile
3806 helpers/storeid_rewrite/Makefile
3807 helpers/storeid_rewrite/file/Makefile
3808 helpers/url_rewrite/Makefile
3809 helpers/url_rewrite/fake/Makefile
3810 helpers/url_rewrite/LFS/Makefile
3813 lib/libTrie/Makefile
3814 lib/libTrie/test/Makefile
3815 lib/ntlmauth/Makefile
3816 lib/profiler/Makefile
3819 lib/snmplib/Makefile
3823 src/adaptation/Makefile
3824 src/adaptation/icap/Makefile
3825 src/adaptation/ecap/Makefile
3828 src/auth/basic/Makefile
3829 src/auth/digest/Makefile
3830 src/auth/negotiate/Makefile
3831 src/auth/ntlm/Makefile
3833 src/clients/Makefile
3837 src/DiskIO/AIO/Makefile
3838 src/DiskIO/Blocking/Makefile
3839 src/DiskIO/DiskDaemon/Makefile
3840 src/DiskIO/DiskThreads/Makefile
3841 src/DiskIO/IpcIo/Makefile
3842 src/DiskIO/Mmapped/Makefile
3850 src/http/one/Makefile
3860 src/security/Makefile
3861 src/servers/Makefile
3866 tools/helper-mux/Makefile
3867 tools/purge/Makefile
3868 tools/squidclient/Makefile
3869 tools/systemd/Makefile
3870 tools/sysvinit/Makefile
3873 # must configure libltdl subdir unconditionally for "make distcheck" to work
3874 #AC_CONFIG_SUBDIRS(libltdl)