1 ## Copyright (C) 1996-2022 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],[6.0.0-VCS],[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 dist-xz])
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/tdb.m4])
27 m4_include([acinclude/lib-checks.m4])
28 m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
29 m4_include([acinclude/ax_cxx_0x_types.m4])
31 PRESET_CFLAGS="$CFLAGS"
32 PRESET_CXXFLAGS="$CXXFLAGS"
33 PRESET_LDFLAGS="$LDFLAGS"
35 dnl Set default LDFLAGS
36 if test "x$LDFLAGS" = "x" ; then
47 # Clang 3.2 on some CPUs requires -march-native to detect correctly.
48 # GCC 4.3+ can also produce faster executables when its used.
49 # But building inside a virtual machine environment has been found to
50 # cause random Illegal Instruction errors due to mis-detection of CPU.
51 AC_ARG_ENABLE(arch-native,
52 AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific
53 optimizations with the -march=native parameter.
54 This flag disables the optimization. The default is to
55 auto-detect compiler support and use where available.]), [
56 SQUID_YESNO([$enableval],
57 [Unrecognized argument to --disable-arch-native: $enableval])
59 AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}])
60 if test "x${enable_arch_native}" != "xno"; then
61 SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native])
64 # might be cross-compiling.
65 # NP: BUILDCXXFLAGS defined at the end of configure after CXXFLAGS fully known.
66 AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen])
67 if test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"; then
68 AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Uses BUILDCXX instead.])
71 if test "x$BUILDCXX" = "x"; then
73 if test "x$squid_cv_check_marchnative" = "xyes"; then
74 CXXFLAGS="$CXXFLAGS -march=native"
79 AC_MSG_CHECKING([simplified host os])
80 simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'`
81 squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
82 if test -n "$squid_host_os_version"; then
83 squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`"
85 squid_host_os="$simple_host_os"
87 AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
88 # on windows squid_host_os is either mingw or cygwin, version is 32
90 # this needs to be before any test is run, to have more standard
91 # functions available on some Unix sysems (e.g. Solaris)
92 if test "x$squid_host_os" = "solaris" -a "x$GCC" != "x" ; then
93 AC_USE_SYSTEM_EXTENSIONS
96 AC_MSG_CHECKING([compiler name-version])
97 squid_cv_cc_name=`$CC --version | head -1 | cut -f1 -d" "`
98 AS_CASE([$squid_cv_cc_name],
99 [gcc|clang],[squid_cv_cc_majversion=`$CC -dumpversion | cut -f1 -d.`],
100 [squid_cv_cc_majversion="unknown"]
102 squid_cv_cc_simplified="$squid_cv_cc_name-$squid_cv_cc_majversion"
103 AC_MSG_RESULT($squid_cv_cc_simplified)
106 AS_IF([test "$squid_cv_cc_simplified" = "gcc-4"],[
107 AC_MSG_NOTICE([skipping -Wextra on $squid_cv_cc_simplified])
109 # -Werror must be first
110 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Werror])
111 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wextra])
112 # -Wunused-private-field causes a huge number of false positives
113 # in unit tests. Disable that
114 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wno-unused-private-field])
115 # ...=2: This flexibility level allows GCC to "understand" our fallthrough
116 # comments. TODO: Switch to [[fallthrough]] attributes with C++17.
117 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wimplicit-fallthrough=2])
118 AS_IF([test "x$squid_cv_cc_implicit_fallthrough2" = "xno"], [
119 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wno-implicit-fallthrough])
122 # If the user did not specify a C++ version.
123 user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "\-std="`
124 if test "x$user_cxx" = "x"; then
125 # Check for C++11 compiler support
126 AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
136 AC_PATH_PROG(SH, sh, /bin/sh)
137 AC_PATH_PROG(FALSE, false, /usr/bin/false)
138 AC_PATH_PROG(TRUE, true, /usr/bin/true)
139 AC_PATH_PROG(MV, mv, $FALSE)
140 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
141 AC_PATH_PROG(LN, ln, cp)
142 AC_PATH_PROG(CHMOD, chmod, $FALSE)
143 AC_PATH_PROG(TR, tr, $FALSE)
144 AC_PATH_PROG(RM, rm, $FALSE)
145 dnl Libtool 2.2.6 requires: rm -f
150 AC_PATH_PROG(PERL, perl, none)
151 if test "x$ac_cv_path_PERL" = "xnone"; then
152 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
154 AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
155 AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE")
157 dnl set $(AR) if not provided by the build environment
158 if test "x$AR" = "x"; then
159 AC_PATH_PROG(AR, ar, $FALSE)
164 AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE)
165 AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE")
167 # pre-define DEFAULT_PREFIX, some modules need it.
168 if test "${prefix}" = "NONE" ; then
169 squid_prefix=$ac_default_prefix
173 AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix])
175 AC_ARG_ENABLE(strict-error-checking,
176 AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
177 with all possible static compiler error-checks enabled.
178 This flag disables the behavior]), [
179 SQUID_YESNO([$enableval],
180 [Unrecognized argument to --disable-strict-error-checking: $enableval])
182 AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}])
184 # LT_INIT requires libtool v2, might as well state it loud
187 if ! test "${ac_top_build_prefix}" = "";
189 # LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
190 # But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
191 # This fixes Linux LTDLv3-v7, and BSD LTDL v2.2
192 top_build_prefix=${ac_top_build_prefix}
193 AC_SUBST(top_build_prefix)
197 dnl LibTool environment is now prepared for setup. Check that it is usable and initialize.
200 # Do we need these unconditionally for "make distcheck" to work?
204 AC_MSG_CHECKING(whether to use loadable modules)
205 AS_IF([test "x${enable_shared:=yes}" = "xyes"],[AC_DEFINE(USE_LOADABLE_MODULES,1,[Support Loadable Modules])])
206 AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_shared:=yes}" = "xyes")
207 AC_MSG_RESULT([$enable_shared])
209 SQUID_CC_GUESS_VARIANT
210 SQUID_CC_GUESS_OPTIONS
212 dnl find out the exe extension for this platform.
213 dnl If it is not empty, use it for CGI as well.
217 if test "x$EXEEXT" = "x" ; then
220 # automake automatically adds .exe when installing binaries
225 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"])
226 AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
228 case "$squid_host_os" in
230 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
231 CFLAGS="$CFLAGS -mthreads"
232 CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++"
233 if test "x$ac_cv_path_WIN32_PSAPI" = "xnone"; then
234 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
235 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
237 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
240 MINGW_LIBS="-lmingwex"
244 # FreeBSD places local libraries and packages in /usr/local
245 CFLAGS="$CFLAGS -I/usr/local/include"
246 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
247 LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib"
254 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
256 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args",
257 [configure command line used to configure Squid])
259 CACHE_EFFECTIVE_USER="nobody"
260 AC_ARG_WITH(default-user,
261 AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
262 [ CACHE_EFFECTIVE_USER="$withval" ]
264 AC_SUBST(CACHE_EFFECTIVE_USER)
266 DEFAULT_LOG_DIR="$localstatedir/logs"
268 AS_HELP_STRING([--with-logdir=PATH],
269 [Default location for squid logs. default: PREFIX/var/logs]), [
272 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
275 DEFAULT_LOG_DIR="$withval"
280 AC_SUBST(DEFAULT_LOG_DIR)
282 DEFAULT_PID_FILE="$localstatedir/run/@SERVICE_NAME@.pid"
284 AS_HELP_STRING([--with-pidfile=PATH],
285 [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]), [
288 AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
291 DEFAULT_PID_FILE="$withval"
295 AC_SUBST(DEFAULT_PID_FILE)
297 DEFAULT_SWAP_DIR="$localstatedir/cache/squid"
299 AS_HELP_STRING([--with-swapdir=PATH],
300 [Default location for squid cache directories. Default: PREFIX/var/cache/squid]), [
303 AC_MSG_ERROR( --with-swapdir requires a directory PATH. --with-swapdir=PATH )
306 DEFAULT_SWAP_DIR="$withval"
310 AC_SUBST(DEFAULT_SWAP_DIR)
312 dnl Set Default CFLAGS
313 if test "x$PRESET_CFLAGS" = "x"; then
314 if test "$squid_cv_compiler" = "gcc"; then
317 # sunos has too many warnings for this to be useful
320 CFLAGS="$squid_cv_cc_option_wall $CFLAGS"
326 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
327 CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
328 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
329 -Wl,-woff,85,-woff,84,-woff,134 \
330 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
331 CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
332 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
333 -Wl,-woff,85,-woff,84,-woff,134 \
334 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
342 # useful warnings that may not be included in -Wall -Wextra
343 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wpointer-arith])
344 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wwrite-strings])
345 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wcomments])
346 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wshadow])
347 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wmissing-declarations])
348 SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Woverloaded-virtual])
350 dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features
351 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]])
353 if test "x$enable_strict_error_checking" != "xno"; then
354 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
355 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror"
358 if test "x$ac_cv_require_wno_deprecated_register" = "xyes"; then
359 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register"
362 # squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS
363 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
364 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
366 # possibly include some build info tag into squid -v
367 SQUID_EMBED_BUILD_INFO
369 AC_ARG_ENABLE(optimizations,
370 AS_HELP_STRING([--disable-optimizations],
371 [Do not compile Squid with compiler optimizations enabled.
372 Optimization is good for production builds, but not
373 good for debugging. During development, use
374 --disable-optimizations to reduce compilation times
375 and allow easier debugging.]), [
376 if test "x$enableval" = "xno" ; then
377 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
378 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`"
379 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9g]]*//'`"
383 AC_ARG_ENABLE(debug-cbdata,
384 AS_HELP_STRING([--enable-debug-cbdata],
385 [Provide some debug information in cbdata]), [
386 SQUID_YESNO([$enableval],
387 [unrecognized argument to --enable-debug-cbdata: $enableval])
389 SQUID_DEFINE_BOOL(USE_CBDATA_DEBUG,${enable_debug_cbdata:=no},
390 [Enable support for cbdata debug information])
391 AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata])
394 dnl Nasty hack to get autoconf 2.64 on Linux to run.
395 dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
396 AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:])
398 AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics])
399 AC_ARG_ENABLE(xmalloc-statistics,
400 AS_HELP_STRING([--enable-xmalloc-statistics],
401 [Show malloc statistics in status page]), [
402 SQUID_YESNO([$enableval],
403 [unrecognized argument to --enable-xmalloc-statistics: $enableval])
405 SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no},
406 [Show malloc statistics in status page])
407 AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics])
409 squid_opt_aufs_threads=""
410 AC_ARG_WITH(aufs-threads,
411 AS_HELP_STRING([--with-aufs-threads=N_THREADS],
412 [Tune the number of worker threads for the aufs object store.]), [
415 squid_opt_aufs_threads=$withval
418 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
422 if test "x$squid_opt_aufs_threads" != "x"; then
423 AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads])
424 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads,
425 [Defines how many threads aufs uses for I/O])
428 ## TODO check if this is necessary, LT_INIT does these checks
429 SQUID_AUTO_LIB(dl,[dynamic linking],[LIBDL])
430 if test "x$with_dl" != "xno"; then
431 CXXFLAGS="$LIBDL_CFLAGS $CXXFLAGS"
432 LDFLAGS="$LIBDL_PATH $LDFLAGS"
433 AC_CHECK_LIB(dl, dlopen)
436 AC_DEFUN([LIBATOMIC_CHECKER],[
437 AC_MSG_CHECKING(whether linking $1 -latomic works)
443 main(int argc, char **) {
445 std::atomic<uint8_t>(uint8_t(argc)).exchange(0) &&
446 std::atomic<uint64_t>{}.is_lock_free()
451 libatomic_checker_result="yes"],[
453 libatomic_checker_result="no"
456 ## check for atomics library before anything that might need it
457 SQUID_STATE_SAVE(LIBATOMIC)
458 LIBATOMIC_CHECKER(without)
459 AS_IF([test "x$libatomic_checker_result" = "xno"],[
460 LIBS="$LIBS -latomic"
461 LIBATOMIC_CHECKER(with)
462 AS_IF([test "x$libatomic_checker_result" = "xyes"],[
463 ATOMICLIB="-latomic"],[
464 AC_MSG_ERROR([Required library libatomic not found.])
466 SQUID_STATE_ROLLBACK(LIBATOMIC)
469 AC_SEARCH_LIBS([shm_open], [rt])
470 if test "x$ac_cv_search_shm_open" != "xno" ; then
471 AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
474 AC_MSG_CHECKING([for DiskIO modules to be enabled])
475 squid_disk_module_candidates=""
476 squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules)
477 AC_ARG_ENABLE(disk-io,
478 AS_HELP_STRING([--enable-disk-io="list of modules"],
479 [Build support for the list of disk I/O modules.
480 Set without a value or omitted, all available modules will be built.
481 See src/DiskIO for a list of available modules, or
482 Programmers Guide section on DiskIO
483 for details on how to build your custom disk module]), [
487 #do nothing, "auto" is ok
490 squid_opt_enable_diskio="no"
493 squid_opt_enable_diskio="yes"
494 squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
495 SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
500 # if requested to autodetect, find out what we have
501 if test "x$squid_opt_enable_diskio" = "xauto"; then
502 squid_opt_enable_diskio="yes"
503 SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
504 if test "x$ac_cv_search_shm_open" = "xno" ; then
506 squid_disk_module_candidates=`echo $squid_disk_module_candidates|sed 's/IpcIo//'`
510 AC_MSG_RESULT([${squid_disk_module_candidates:-none}])
511 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
512 SQUID_DEFINE_BOOL(USE_DISKIO,$squid_opt_enable_diskio,
513 [DiskIO modules are expected to be available.])
517 dnl Some autoconf.h defines we might enable later...
518 AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
519 AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
522 squid_opt_use_diskthreads=
525 dnl Setup the module paths etc.
528 AH_TEMPLATE(HAVE_DISKIO_MODULE_AIO, [Whether POSIX AIO Disk I/O module is built])
529 AH_TEMPLATE(HAVE_DISKIO_MODULE_BLOCKING, [Whether Blocking Disk I/O module is built])
530 AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKDAEMON, [Whether DiskDaemon Disk I/O module is built])
531 AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKTHREADS, [Whether DiskThreads Disk I/O module is built])
532 AH_TEMPLATE(HAVE_DISKIO_MODULE_IPCIO, [Whether IpcIo Disk I/O module is built])
533 AH_TEMPLATE(HAVE_DISKIO_MODULE_MMAPPED, [Whether Mmapped Disk I/O module is built])
534 for module in $squid_disk_module_candidates none; do
536 if test "x$module" = "xnone"; then
539 if ! test -d "$srcdir/src/DiskIO/$module"; then
540 AC_MSG_ERROR(disk-io $module does not exist)
545 dnl Check for POSIX AIO availability
546 squid_opt_use_aio="yes"
548 if test "x$with_aio" != "xno"; then
550 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
551 dnl On some systems POSIX AIO functions are in librt
552 dnl On some systems POSIX AIO functions are in libaio
553 AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
554 dnl Enable AIO if the library and headers are found
555 if test "x$AIOLIB" != "x" && test "x$have_aio_header" = "xyes"; then
556 AC_MSG_NOTICE([Native POSIX AIO support detected.])
557 squid_opt_use_aio="yes"
559 dnl Windows does things differently. We provide wrappers.
560 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
561 case "$squid_host_os" in
563 squid_opt_use_aio="yes"
564 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
567 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
568 squid_opt_use_aio="no"
573 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
574 squid_opt_use_aio="no"
576 dnl Use the POSIX AIO pieces if we actually need them.
577 if test "x$squid_opt_use_aio" = "xyes" ; then
578 DISK_MODULES="$DISK_MODULES AIO"
579 AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built])
580 case "$squid_host_os" in
583 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
586 AC_MSG_NOTICE([Enabling AIO DiskIO module])
590 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
591 squid_disk_module_candidates_AIO=no
596 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
597 DISK_MODULES="$DISK_MODULES Blocking"
598 AC_DEFINE([HAVE_DISKIO_MODULE_BLOCKING],1,[Blocking Disk I/O module is built])
602 case "$squid_host_os" in
604 AC_MSG_NOTICE(["DiskDaemon not supported on MinGW"])
605 squid_disk_module_candidates_DiskDaemon=no
608 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
609 DISK_MODULES="$DISK_MODULES DiskDaemon"
610 AC_DEFINE([HAVE_DISKIO_MODULE_DISKDAEMON],1,[DiskDaemon Disk I/O module is built])
616 squid_opt_use_diskthreads="yes"
618 SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
619 if test "x$with_pthreads" != "xno"; then
620 dnl TODO: this needs to be extended to handle more systems and better
621 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
622 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
623 case "$squid_host_os" in
626 AC_MSG_NOTICE([Windows threads support automatically enabled])
629 if test `echo "$squid_host_os_version" | tr -d .` -lt 70 ; then
630 AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later)
631 squid_opt_use_diskthreads="no"
633 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
634 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
635 if test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x" ; then
636 LDFLAGS="$LDFLAGS -pthread"
641 if test `echo "$squid_host_os_version" | tr -d .` -lt 52 ; then
642 AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later)
643 squid_opt_use_diskthreads="no"
645 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
646 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
647 LDFLAGS="$LDFLAGS -lpthread"
651 if test "x$GCC" = "xyes" ; then
652 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
653 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
654 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
655 AC_MSG_NOTICE(pthread library required but cannot be found.)
656 squid_opt_use_diskthreads="no"
659 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
660 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
661 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
662 AC_SEARCH_LIBS([pthread_create],[pthread thread],[
663 LIBPTHREADS="" #in LIBS
665 AC_MSG_NOTICE(pthread library required but cannot be found.)
666 squid_opt_use_diskthreads="no"
671 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
672 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
673 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
674 AC_MSG_NOTICE(pthread library required but cannot be found.)
675 squid_opt_use_diskthreads="no"
680 AC_MSG_NOTICE([Native pthreads support manually disabled.])
681 squid_opt_use_diskthreads="no"
683 if test "x$squid_opt_use_diskthreads" = "xyes" ; then
684 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
685 DISK_MODULES="$DISK_MODULES DiskThreads"
686 AC_DEFINE([HAVE_DISKIO_MODULE_DISKTHREADS],1,[DiskThreads Disk I/O module is built])
688 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
689 SQUID_STATE_ROLLBACK([diskthreads_state])
690 squid_disk_module_candidates_DiskThreads=no
695 if test "x$ac_cv_search_shm_open" = "xno" ; then
696 AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support])
697 squid_disk_module_candidates_IpcIo=no
699 AC_MSG_NOTICE([Enabling IpcIo DiskIO module])
700 DISK_MODULES="$DISK_MODULES IpcIo"
701 AC_DEFINE([HAVE_DISKIO_MODULE_IPCIO],1,[IpcIo Disk I/O module is built])
706 dnl TODO: use availability of sys/mman.h and/or mmap to define
707 dnl OR support windows mmap functions
708 if test "x$squid_host_os" = "xmingw" ; then
709 AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw])
710 squid_disk_module_candidates_Mmapped=no
712 AC_MSG_NOTICE([Enabling Mmapped DiskIO module])
713 DISK_MODULES="$DISK_MODULES Mmapped"
714 AC_DEFINE([HAVE_DISKIO_MODULE_MMAPPED],1,[Mmapped Disk I/O module is built])
719 AC_MSG_NOTICE([Enabling $module DiskIO module])
720 DISK_LIBS="$DISK_LIBS lib${module}.la"
721 DISK_MODULES="$DISK_MODULES ${module}"
725 AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
726 AC_SUBST(DISK_MODULES)
728 AM_CONDITIONAL(ENABLE_DISKIO_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes")
730 AM_CONDITIONAL(ENABLE_WIN32_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1")
731 AM_CONDITIONAL(ENABLE_DISKIO_BLOCKING, test "x$squid_disk_module_candidates_Blocking" = "xyes")
732 AM_CONDITIONAL(ENABLE_DISKIO_DISKDAEMON, test "x$squid_disk_module_candidates_DiskDaemon" = "xyes")
733 AM_CONDITIONAL(ENABLE_DISKIO_DISKTHREADS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes")
734 AC_SUBST(LIBPTHREADS)
735 AM_CONDITIONAL(ENABLE_WIN32_AIOPS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1")
736 AM_CONDITIONAL(ENABLE_DISKIO_IPCIO, test "x$squid_disk_module_candidates_IpcIo" = "xyes")
737 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 DiskIO module: Blocking or IpcIo])
795 squid_do_build_rock=true
798 if test "x$squid_disk_module_candidates_Blocking" != "xyes"; then
799 AC_MSG_ERROR([Storage module ufs requires DiskIO module: Blocking])
801 squid_do_build_ufs=true
806 AM_CONDITIONAL(ENABLE_FS_UFS, test "x$squid_do_build_ufs" = "xtrue")
807 AM_CONDITIONAL(ENABLE_FS_ROCK, test "x$squid_do_build_rock" = "xtrue")
808 dnl hack: need to define those even if not used in the build system to
809 dnl make sure that global FS objects are linked to the squid binary.
810 AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
811 AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
812 AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
813 AH_TEMPLATE(HAVE_FS_ROCK, "Define to 1 if rock filesystem module is build")
816 dnl got final squid_storeio_module_candidates, build library lists
817 dnl This list will not be needed when each fs library has its own Makefile
819 dnl File system libraries to link executables with.
820 dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
822 for fs in $squid_storeio_module_candidates; do
823 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
824 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
825 SQUID_TOUPPER_VAR_CONTENTS([fs])
826 AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1)
829 AC_SUBST(STORE_LIBS_TO_BUILD)
830 AC_SUBST(STORE_LIBS_TO_ADD)
831 AC_SUBST(STORE_TESTS)
834 dnl At lest one removal policy is always needed.
835 dnl 'lru' removal policy is currently hard-coded by name for tests
836 dnl so we must set it as default.
838 AC_ARG_ENABLE(removal-policies,
839 AS_HELP_STRING([--enable-removal-policies="list of policies"],
840 [Build support for the list of removal policies.
841 The default is only to build the "lru" module.
842 See src/repl for a list of available modules, or
843 Programmers Guide section 9.9 for details on how
844 to build your custom policy]), [
847 SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES])
852 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
856 if test "x$REPL_POLICIES" != "x" ; then
857 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES])
858 AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES])
859 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
860 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
862 AC_SUBST(REPL_POLICIES)
866 AM_CONDITIONAL(ENABLE_PINGER, false)
868 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
869 [ if test "x$enableval" = "xyes" ; then
870 AC_MSG_NOTICE([ICMP enabled])
871 AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)])
872 AM_CONDITIONAL(ENABLE_PINGER, true)
876 AM_CONDITIONAL(ENABLE_DELAY_POOLS, false)
877 AC_ARG_ENABLE(delay-pools,
878 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
879 [ if test "x$enableval" = "xyes" ; then
880 AC_MSG_NOTICE([Delay pools enabled])
881 AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".])
882 AM_CONDITIONAL(ENABLE_DELAY_POOLS, true)
886 dnl disable generic/common adaptation support by default
887 squid_opt_use_adaptation=no
889 squid_opt_use_esi=auto
890 AH_TEMPLATE([USE_SQUID_ESI],[Define to enable the ESI processor])
892 AS_HELP_STRING([--disable-esi],
893 [Disable ESI for accelerators. ESI requires expat or libxml2.
894 Enabling ESI will cause squid reverse proxies to be capable
895 of the Edge Acceleration Specification (www.esi.org).]),
896 [squid_opt_use_esi=$enableval],[])
902 # ESI support libraries: expat
903 SQUID_AUTO_LIB(expat,[ESI expat],[LIBEXPAT])
904 if test "x$squid_opt_use_esi" != "xno" -a "x$with_expat" != "xno" ; then
905 AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
906 AC_CHECK_HEADERS([expat.h])
907 AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
908 AS_IF(test "x$HAVE_LIBEXPAT" = "x1",[
909 squid_opt_use_esi=yes
911 AS_IF(test "x$with_expat" = "xyes",[
912 AC_MSG_ERROR([Required library expat not found.])
914 AC_MSG_NOTICE([Library expat not found.])
919 # TODO: remove this 'lib' prefix to match coding standard
920 SQUID_AUTO_LIB(libxml2,[ESI libxml2],[LIBXML2])
921 if test "x$squid_opt_use_esi" != "xno" -a "x$with_libxml2" != "xno" ; then
922 SQUID_STATE_SAVE([squid_libxml2_save])
923 PKG_CHECK_MODULES([LIBXML2],[libxml-2.0],[],[
924 AC_CHECK_LIB([xml2], [main], [LIBXML2_LIBS="$LIBXML2_LIBS -lxml2"])
925 dnl Find the main header and include path...
926 AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [
927 AC_CHECK_HEADERS([libxml/parser.h], [], [
928 AC_MSG_NOTICE([Testing in /usr/include/libxml2])
929 SAVED_CPPFLAGS="$CPPFLAGS"
930 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
931 unset ac_cv_header_libxml_parser_h
932 AC_CHECK_HEADERS([libxml/parser.h], [LIBXML2_CFLAGS="$LIBXML2_CFLAGS -I/usr/include/libxml2"], [
933 AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
934 CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS"
935 unset ac_cv_header_libxml_parser_h
936 AC_CHECK_HEADERS([libxml/parser.h], [LIBXML2_CFLAGS="$LIBXML2_CFLAGS -I/usr/local/include/libxml2"], [
937 AC_MSG_NOTICE([Failed to find libxml2 header file libxml/parser.h])
940 CPPFLAGS="$SAVED_CPPFLAGS"
944 CPPFLAGS="$CPPFLAGS $LIBXML2_CFLAGS"
945 dnl Now that we know where to look find the headers...
946 AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h)
947 SQUID_STATE_ROLLBACK([squid_libxml2_save])
949 if test "x$LIBXML2_LIBS" != "x"; then
951 squid_opt_use_esi=yes
952 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $LIBXML2_CFLAGS"
953 CPPFLAGS="$CPPFLAGS $LIBXML2_CFLAGS"
954 XMLLIB="$LIBXML2_LIBS"
955 AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
956 elif test "x$with_libxml2" = "xyes"; then
957 AC_MSG_ERROR([Required library libxml2 not found])
959 AC_MSG_NOTICE([Library libxml2 not found.])
963 AS_IF([test "x$squid_opt_use_esi" = "xyes"],[
964 AS_IF(test "x$HAVE_LIBXML2" = "x0" -a "x$HAVE_LIBEXPAT" = "x0",[
965 AC_MSG_ERROR([ESI processor requires libxml2 or libexpat])
967 AC_MSG_NOTICE([Enabling ESI processor: $EXPATLIB $XMLLIB])
968 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor])
970 AS_IF(test "x$squid_opt_use_esi" = "xno",[
971 AC_MSG_NOTICE([Disabling ESI processor.])
973 AC_MSG_NOTICE([Disabling ESI processor. libxml2 and libexpat not found.])
976 AM_CONDITIONAL(ENABLE_ESI, test "x$squid_opt_use_esi" = "xyes")
977 AM_CONDITIONAL(ENABLE_LIBEXPAT, test "x$HAVE_LIBEXPAT" = "x1")
979 AM_CONDITIONAL(ENABLE_LIBXML2, test "x$HAVE_LIBXML2" = "x1")
982 # icap argument handling
983 AC_ARG_ENABLE(icap-client,
984 AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[
985 SQUID_YESNO([$enableval],[Unrecognized argument to --disable-icap-client: $enableval])
987 SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid])
988 AS_IF(test "x$enable_icap_client" != "xno", squid_opt_use_adaptation="yes")
989 AM_CONDITIONAL(ENABLE_ICAP_CLIENT, test "x$enable_icap_client" != "xno")
992 AC_MSG_CHECKING(whether to support eCAP)
994 AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]), [
995 case "${enableval}" in
996 yes|no) squid_opt_use_ecap=$enableval ;;
997 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
999 AC_MSG_RESULT([$squid_opt_use_ecap, explicitly])
1001 squid_opt_use_ecap=no;
1002 AC_MSG_RESULT([$squid_opt_use_ecap, implicitly])
1006 dnl Perform configuration consistency checks for eCAP
1007 if test "x$squid_opt_use_ecap" != "xno";
1009 dnl eCAP support requires loadable modules, which are enabled by default
1010 if test "x$enable_shared" != "xyes"
1012 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-shared with --enable-ecap.])
1015 if test -n "$PKG_CONFIG"; then
1016 dnl eCAP support requires libecap.
1017 dnl This Squid supports libecap v1.0.x.
1018 dnl Use EXT_ prefix to distinguish external libecap (that we check for
1019 dnl here) from our own convenience ecap library in Makefiles.
1020 PKG_CHECK_MODULES([EXT_LIBECAP],[libecap >= 1.0 libecap < 1.1])
1022 AC_MSG_NOTICE([eCAP support requires pkg-config to verify the correct library version. Trouble may follow.])
1025 SQUID_STATE_SAVE(squid_ecap_state)
1026 AC_MSG_CHECKING([whether -lecap will link])
1027 CXXFLAGS="$CXXFLAGS $EXT_LIBECAP_CFLAGS"
1028 LIBS="$LIBS $EXT_LIBECAP_LIBS"
1029 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libecap/common/names.h>]],[[
1030 const libecap::Name test("test", libecap::Name::NextId());
1033 squid_opt_use_adaptation=yes
1037 test "x$squid_opt_use_ecap" = "xyes", AC_MSG_ERROR([eCAP library will not link.
1038 You may need to rebuild libecap using the same version of GCC as Squid.
1039 There have been breaking ABI changes in the libstdc++ STL with GCC 5.]),
1041 [AC_MSG_NOTICE([eCAP library will not link.
1042 You may need to rebuild libecap using the same version of GCC as Squid.
1043 There have been breaking ABI changes in the libstdc++ STL with GCC 5.])
1044 squid_opt_use_ecap="no"
1047 SQUID_STATE_ROLLBACK(squid_ecap_state)
1049 SQUID_DEFINE_BOOL(USE_ECAP,${squid_opt_use_ecap:=no},[Whether to use eCAP support])
1050 AM_CONDITIONAL(ENABLE_ECAP, test "x$squid_opt_use_ecap" = "xyes")
1052 dnl enable adaptation if requested by specific adaptation mechanisms
1054 if test "x$squid_opt_use_adaptation" = "xyes"; then
1055 ADAPTATION_LIBS="adaptation/libadaptation.la"
1057 SQUID_DEFINE_BOOL(USE_ADAPTATION,${squid_opt_use_adaptation:=no}, [common adaptation support])
1058 AM_CONDITIONAL(ENABLE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes")
1059 AC_SUBST(ADAPTATION_LIBS)
1061 test "x$squid_host_os" = "xmingw" && enable_wccp=no
1063 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [
1064 SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccp: $enableval])
1066 SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP])
1067 AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp])
1069 test "x$squid_host_os" = "xmingw" && enable_wccpv2=no
1070 AC_ARG_ENABLE(wccpv2,
1071 AS_HELP_STRING([--disable-wccpv2],
1072 [Disable Web Cache Coordination V2 Protocol]), [
1073 SQUID_YESNO([$enableval],
1074 [unrecognized argument to --disable-wccpv2: $enableval])
1076 SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes},
1077 [Define to enable WCCP V2])
1078 AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2])
1080 AC_ARG_ENABLE(kill-parent-hack,
1081 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [
1082 SQUID_YESNO([$enableval],
1083 [unrecognized argument to --enable-kill-parent-hack: $enableval])
1085 SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no},
1086 [A dangerous feature which causes Squid to kill its parent
1087 process (presumably the RunCache script) upon receipt
1088 of SIGTERM or SIGINT. Deprecated, Use with caution.])
1089 AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack])
1092 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
1093 SQUID_YESNO([$enableval],
1094 [unrecognized argument to --disable-snmp: $enableval])
1096 SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes},
1097 [Define to enable SNMP monitoring of Squid])
1098 AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"])
1099 if test "x$enable_snmp" = "xyes"; then
1100 SNMPLIB='../lib/snmplib/libsnmplib.la'
1102 AC_MSG_NOTICE([SNMP support enabled: $enable_snmp])
1105 AC_ARG_ENABLE(cachemgr-hostname,
1106 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],
1107 [Make cachemgr.cgi default to this host.
1108 If unspecified, uses the name of the build-host]), [
1111 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1112 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1113 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1119 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1120 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1126 AS_HELP_STRING([--disable-eui],
1127 [Disable use of ARP / MAC/ EUI (ether address)]), [
1128 SQUID_YESNO([$enableval],[--disable-eui expects no arguments])
1130 if test "x${enable_eui:=yes}" = "xyes" ; then
1131 SQUID_STATE_SAVE(LIBEUI)
1132 # GLIBC 2.30 deprecates sysctl.h. Test with the same flags that (may) break includes later.
1133 CFLAGS=$SQUID_CFLAGS
1134 CXXFLAGS=$SQUID_CXXFLAGS
1135 case "$squid_host_os" in
1136 linux|solaris|freebsd|openbsd|netbsd|cygwin)
1143 AC_MSG_WARN([EUI support probably will not work on host $host.])
1146 # iphlpapi.h check delayed after winsock2.h
1161 #include <sys/types.h>
1162 #include <sys/socket.h>
1165 # OpenBSD, FreeBSD and NetBSD requires sys/param.h to be included before sysctl.h and net/if_dl.h
1170 #if HAVE_SYS_PARAM_H
1171 #include <sys/param.h>
1174 SQUID_STATE_ROLLBACK(LIBEUI)
1177 AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui])
1178 SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui,
1179 [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.])
1180 AM_CONDITIONAL(ENABLE_EUI, [test "x$enable_eui" = "xyes" ])
1184 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [
1185 SQUID_YESNO([$enableval],
1186 [unrecognized argument to --disable-htcp: $enableval])
1188 SQUID_DEFINE_BOOL(USE_HTCP,${enable_htcp:=yes},
1189 [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1190 AM_CONDITIONAL(ENABLE_HTCP, [test "x$enable_htcp" = "xyes"])
1191 AC_MSG_NOTICE([HTCP support enabled: $enable_htcp])
1193 # Cryptograhic libraries
1194 SQUID_AUTO_LIB(nettle,[Nettle crypto],[LIBNETTLE])
1195 if test "x$with_nettle" != "xno" ; then
1196 CPPFLAGS="$LIBNETTLE_CFLAGS $CPPFLAGS"
1197 AC_CHECK_LIB(nettle, nettle_md5_init,[
1198 NETTLELIB="$LIBNETTLE_PATH -lnettle"
1199 AC_CHECK_HEADERS(nettle/md5.h)
1201 if test "x$with_nettle" != "xno" ; then
1202 # Base64 uses the nettle 3.4 API
1203 # which matters on 64-bit systems
1204 AC_CHECK_HEADERS(nettle/base64.h)
1205 AC_MSG_CHECKING([for Nettle 3.4 API compatibility])
1206 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1209 # include <nettle/base64.h>
1211 char inData[10]; inData[0] = '\0';
1213 struct base64_decode_ctx ctx;
1214 base64_decode_init(&ctx);
1215 uint8_t outData[10];
1217 if (!base64_decode_update(&ctx, &dstLen, outData, srcLen, inData) ||
1218 !base64_decode_final(&ctx)) {
1221 ]])],[AC_MSG_RESULT(yes)
1222 AC_DEFINE(HAVE_NETTLE34_BASE64,1,[set to 1 if Nettle 3.4 API will link])
1223 ],[AC_MSG_RESULT(no)])
1226 AC_MSG_NOTICE([Using Nettle cryptographic library: ${with_nettle:=yes}])
1229 dnl Check for libcrypt
1231 dnl Some of our helpers use crypt(3) which may be in libc, or in
1232 dnl libcrypt (eg FreeBSD)
1233 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1234 dnl Solaris10 provides MD5 natively through libmd5
1235 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
1240 SQUID_AUTO_LIB(gnutls,[GnuTLS crypto],[LIBGNUTLS])
1241 AH_TEMPLATE(USE_GNUTLS,[GnuTLS support is available])
1242 if test "x$with_gnutls" != "xno"; then
1243 SQUID_STATE_SAVE(squid_gnutls_state)
1245 # User may have provided a custom location for GnuTLS. Otherwise...
1246 CPPFLAGS="$LIBGNUTLS_CFLAGS $CPPFLAGS"
1247 LIBS="$LIBS $LIBGNUTLS_PATH"
1249 # auto-detect using pkg-config
1250 PKG_CHECK_MODULES([LIBGNUTLS],[gnutls >= 3.4.0],[
1251 CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
1253 ## find the package without pkg-config
1254 ## check that the library is actually new enough.
1255 ## by testing for a 3.4.0+ function which we use
1256 AC_CHECK_LIB(gnutls,gnutls_pcert_export_x509,[LIBGNUTLS_LIBS="-lgnutls"])
1258 AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/x509.h gnutls/abstract.h)
1260 SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS
1262 if test "x$with_gnutls" = "xyes" -a "x$LIBGNUTLS_LIBS" = "x"; then
1263 AC_MSG_ERROR([Required GnuTLS library not found])
1265 if test "x$LIBGNUTLS_LIBS" != "x" ; then
1266 CXXFLAGS="$LIBGNUTLS_CFLAGS $CXXFLAGS"
1267 SSLLIB="$LIBGNUTLS_PATH $LIBGNUTLS_LIBS $SSLLIB"
1268 AC_DEFINE(USE_GNUTLS,1,[GnuTLS support is available])
1273 AC_MSG_NOTICE([GnuTLS library support: ${with_gnutls:=auto} ${LIBGNUTLS_PATH} ${LIBGNUTLS_LIBS}])
1275 dnl User may specify OpenSSL is needed from a non-standard location
1276 SQUID_OPTIONAL_LIB(openssl,[OpenSSL],[LIBOPENSSL])
1277 AH_TEMPLATE(USE_OPENSSL,[OpenSSL support is available])
1278 ## OpenSSL is default disable due to licensing issues on some OS
1279 if test "x$with_openssl" = "xyes"; then
1280 CPPFLAGS="$LIBOPENSSL_CFLAGS $CPPFLAGS"
1291 openssl/opensslv.h \
1300 # User may have provided a custom location for OpenSSL. Otherwise...
1301 SQUID_STATE_SAVE(squid_openssl_state)
1302 LIBS="$LIBS $LIBOPENSSL_PATH"
1304 # auto-detect using pkg-config
1305 PKG_CHECK_MODULES([LIBOPENSSL],[openssl],,[
1306 ## For some OS pkg-config is broken or unavailable.
1307 ## Detect libraries the hard way.
1309 # Windows MinGW has some special libraries ...
1310 if test "x$squid_host_os" = "xmingw" ; then
1311 LIBOPENSSL_LIBS='-lssleay32 -leay32 -lgdi32 $LIBOPENSSL_LIBS'
1312 AC_MSG_NOTICE([Windows OpenSSL library support: yes -lssleay32 -leay32 -lgdi32])
1315 AC_CHECK_LIB(crypto,[CRYPTO_new_ex_data],[LIBOPENSSL_LIBS="-lcrypto $LIBOPENSSL_LIBS"],[
1316 AC_MSG_ERROR([library 'crypto' is required for OpenSSL])
1318 AC_CHECK_LIB(ssl,[SSL_CTX_new],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[
1319 AC_MSG_ERROR([library 'ssl' is required for OpenSSL])
1323 # This is a workaround for RedHat 9 brain damage..
1324 if test -d /usr/kerberos/include -a -f /usr/include/openssl/kssl.h; then
1325 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1326 LIBOPENSSL_LIBS="-L/usr/kerberos/lib $LIBOPENSSL_LIBS"
1327 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1329 SQUID_STATE_ROLLBACK(squid_openssl_state) #de-pollute LIBS
1331 if test "x$LIBOPENSSL_LIBS" != "x"; then
1332 CXXFLAGS="$LIBOPENSSL_CFLAGS $CXXFLAGS"
1333 SSLLIB="$LIBOPENSSL_PATH $LIBOPENSSL_LIBS $SSLLIB"
1334 AC_DEFINE(USE_OPENSSL,1,[OpenSSL support is available])
1336 # check for API functions
1337 SQUID_CHECK_LIBCRYPTO_API
1338 SQUID_CHECK_LIBSSL_API
1339 SQUID_CHECK_OPENSSL_TLS_METHODS
1340 SQUID_STATE_SAVE(check_SSL_CTX_get0_certificate)
1341 LIBS="$LIBS $SSLLIB"
1342 AC_CHECK_LIB(ssl, SSL_CTX_get0_certificate, [
1343 AC_DEFINE(HAVE_SSL_CTX_GET0_CERTIFICATE, 1, [SSL_CTX_get0_certificate is available])
1345 missing_SSL_CTX_get0_certificate=yes
1347 SQUID_STATE_ROLLBACK(check_SSL_CTX_get0_certificate)
1349 # check for other specific broken implementations
1350 if test "x$missing_SSL_CTX_get0_certificate" = "xyes"; then
1351 SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS
1353 SQUID_CHECK_OPENSSL_CONST_SSL_METHOD
1354 SQUID_CHECK_OPENSSL_CONST_CRYPTO_EX_DATA
1355 SQUID_CHECK_OPENSSL_CONST_SSL_SESSION_CB_ARG
1356 SQUID_CHECK_OPENSSL_CONST_X509_GET0_SIGNATURE_ARGS
1357 SQUID_CHECK_OPENSSL_TXTDB
1359 if test "x$SSLLIB" = "x"; then
1360 AC_MSG_ERROR([Required OpenSSL library not found])
1363 AC_MSG_NOTICE([OpenSSL library support: ${with_openssl:=no} ${LIBOPENSSL_PATH} ${LIBOPENSSL_LIBS}])
1364 AM_CONDITIONAL(ENABLE_SSL,[ test "x$with_openssl" = "xyes" ])
1367 dnl User may specify MIT Kerberos is needed from a non-standard location
1368 SQUID_AUTO_LIB(mit-krb5,[MIT Kerberos],[LIB_KRB5])
1369 AH_TEMPLATE(USE_APPLE_KRB5,[Apple Kerberos support is available])
1370 AH_TEMPLATE(USE_MIT_KRB5,[MIT Kerberos support is available])
1371 AH_TEMPLATE(USE_SOLARIS_KRB5,[Solaris Kerberos support is available])
1373 ## find out if pkg-config or krb5-config will work
1374 if test "x$with_mit_krb5" != "xno"; then
1375 CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS"
1376 krb5confpath="$with_mit_krb5/bin"
1377 # find installed libs via pkg-config or krb5-config
1379 PKG_CHECK_EXISTS(mit-krb5-gssapi mit-krb5, [squid_pc_krb5_name="mit-krb5-gssapi mit-krb5"],[
1380 PKG_CHECK_EXISTS(gssapi-krb5 krb5, [squid_pc_krb5_name="gssapi-krb5 krb5"])
1382 if test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"; then
1383 # Look for krb5-config (unless cross-compiling)
1384 AC_PATH_PROG(krb5_config,krb5-config,no,$krb5confpath)
1385 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1386 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1387 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1388 ac_solaris="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i solaris`"
1389 ac_apple="`$ac_cv_path_krb5_config --vendor 2>/dev/null | grep -c -i apple`"
1390 if test $ac_solaris -gt 0 ; then
1391 with_solaris_krb5=yes
1392 elif test $ac_apple -gt 0 ; then
1394 elif test $ac_heimdal -gt 0; then
1396 if test "x$with_mit_krb5" = "xyes"; then
1397 AC_MSG_ERROR([Could not find pkg-config or krb5-config for MIT Kerberos])
1401 if test "x$with_mit_krb5" = "xyes"; then
1402 AC_MSG_ERROR([Could not find krb5-config in path])
1410 # detect MIT Kerberos dependencies (except on Solaris)
1411 if test "x$with_mit_krb5" != "xno" -a "x$with_solaris_krb5" != "xyes"; then
1412 SQUID_STATE_SAVE([squid_krb5_save])
1413 LIBS="$LIBS $LIB_KRB5_PATH"
1415 # auto-detect using pkg-config
1416 PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[
1417 # look for krb5-config (unless cross-compiling)
1418 if test "$cross_compiling" = "no"; then
1419 if test "x$krb5confpath" = "x" ; then
1420 AC_PATH_PROG(krb5_config,krb5-config,no)
1421 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1422 ac_krb5_config="$ac_cv_path_krb5_config"
1425 ac_krb5_config="$krb5confpath/krb5-config"
1428 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1430 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1431 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1432 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1433 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1434 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1436 ## For some OS pkg-config is broken or unavailable.
1437 ## Detect libraries the hard way.
1439 SQUID_STATE_SAVE([squid_mit_save])
1441 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1442 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
1443 AC_MSG_WARN([library 'com_err' is required for MIT Kerberos])
1444 missing_required=yes
1447 AC_CHECK_LIB(k5crypto, [main], [LIB_KRB5_LIBS="-lk5crypto $LIB_KRB5_LIBS"],[
1448 AC_MSG_WARN([library 'k5crypto' is required for MIT Kerberos])
1449 missing_required=yes
1452 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1453 AC_MSG_WARN([library 'krb5' is required for MIT Kerberos])
1454 missing_required=yes
1457 AC_CHECK_LIB(gssapi_krb5, [main], [LIB_KRB5_LIBS="-lgssapi_krb5 $LIB_KRB5_LIBS"],[
1458 AC_MSG_WARN([library 'gssapi_krb5' is required for MIT Kerberos])
1459 missing_required=yes
1461 SQUID_STATE_ROLLBACK([squid_mit_save])
1462 if test "x$missing_required" = "xyes"; then
1468 if test "x$LIB_KRB5_LIBS" != "x"; then
1469 if test "x$with_apple_krb5" = "xyes" ; then
1470 AC_DEFINE(USE_APPLE_KRB5,1,[Apple Kerberos support is available])
1471 KRB5_FLAVOUR="Apple"
1473 AC_DEFINE(USE_MIT_KRB5,1,[MIT Kerberos support is available])
1476 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1477 KRB5INCS="$LIB_KRB5_CFLAGS"
1479 # check for other specific broken implementations
1480 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1481 LIBS="$LIBS $KRB5LIBS"
1483 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1484 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1485 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
1486 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1487 AC_CHECK_HEADERS(profile.h)
1489 SQUID_CHECK_KRB5_FUNCS
1491 if test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1492 AC_MSG_ERROR([Required Kerberos library not found])
1493 elif test "x$KRB5LIBS" = "x"; then
1497 SQUID_STATE_ROLLBACK([squid_krb5_save])
1500 # detect Solaris Kerberos dependencies
1501 if test "x$with_solaris_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1502 SQUID_STATE_SAVE([squid_krb5_save])
1503 LIBS="$LIBS $LIB_KRB5_PATH"
1505 # no pkg-config for solaris native Kerberos
1506 # look for krb5-config (unless cross-compiling)
1507 if test "$cross_compiling" = "no"; then
1508 if test "x$krb5confpath" = "x" ; then
1509 AC_PATH_PROG(krb5_config,krb5-config,no)
1510 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1511 ac_krb5_config="$ac_cv_path_krb5_config"
1514 ac_krb5_config="$krb5confpath/krb5-config"
1517 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1519 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1520 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1521 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1522 # Solaris 10 Update 11 patches the krb5-config tool to produce stderr messages on stdout.
1523 SOLARIS_BROKEN_KRB5CONFIG_GSSAPI="`$ac_krb5_config --libs gssapi 2>/dev/null | grep "krb5-config"`"
1524 if test "x$SOLARIS_BROKEN_KRB5CONFIG_GSSAPI" = "x"; then
1525 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1526 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1529 ## For some OS pkg-config is broken or unavailable.
1530 ## Detect libraries the hard way.
1532 CXXFLAGS="-I/usr/include/kerberosv5 $CXXFLAGS"
1534 SQUID_STATE_SAVE([squid_solaris_save])
1536 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1537 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1538 AC_MSG_WARN([library 'krb5' is required for Solaris Kerberos])
1539 missing_required=yes
1542 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
1543 AC_MSG_WARN([library 'gss' is required for Solaris Kerberos])
1544 missing_required=yes
1546 SQUID_STATE_ROLLBACK([squid_solaris_save])
1547 if test "x$missing_required" = "xyes"; then
1552 if test "x$LIB_KRB5_LIBS" != "x"; then
1553 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1554 KRB5INCS="$LIB_KRB5_CFLAGS"
1555 AC_DEFINE(USE_SOLARIS_KRB5,1,[Solaris Kerberos support is available])
1556 KRB5_FLAVOUR="Solaris"
1558 # check for other specific broken implementations
1559 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1560 LIBS="$LIBS $KRB5LIBS"
1562 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1563 AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_ext.h)
1564 AC_CHECK_HEADERS(krb5.h com_err.h)
1566 SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
1567 if test "x$squid_cv_broken_krb5_h" = "xyes"; then
1568 AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if Solaris krb5.h is broken for C++])
1569 AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.])
1570 AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512])
1571 AC_MSG_WARN([If you need Kerberos support you will have to patch])
1572 AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch])
1574 SQUID_CHECK_KRB5_FUNCS
1576 if test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1577 # Error only if Solaris flavour was detected while looking for required MIT Kerberos
1578 AC_MSG_ERROR([Required Kerberos library not found])
1579 elif test "x$KRB5LIBS" = "x"; then
1580 with_solaris_krb5=no
1583 SQUID_STATE_ROLLBACK([squid_krb5_save])
1586 dnl User may specify Heimdal Kerberos is needed from a non-standard location
1587 SQUID_AUTO_LIB(heimdal-krb5,[Heimdal Kerberos],[LIB_KRB5])
1588 AH_TEMPLATE(USE_HEIMDAL_KRB5,[Heimdal Kerberos support is available])
1589 if test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"; then
1590 CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS"
1591 krb5confpath="$with_heimdal_krb5/bin"
1592 # find installed libs via pkg-config or krb5-config
1593 PKG_CHECK_EXISTS(heimdal-krb5, [squid_pc_krb5_name="heimdal-krb5"])
1594 if test "x$squid_pc_krb5_name" = "x"; then
1595 PKG_CHECK_EXISTS(heimdal-gssapi, [squid_pc_krb5_name="heimdal-gssapi"])
1597 if test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"; then
1598 # Look for krb5-config (unless cross-compiling)
1599 AC_PATH_PROG(krb5_config,krb5-config,no,$krb5confpath)
1600 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1601 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1602 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1603 if test "x$with_heimdal_krb5" = "xyes" -a $ac_heimdal = 0; then
1604 AC_MSG_ERROR([Could not find pkg-config or krb5-config for Heimdal Kerberos])
1607 if test "x$with_heimdal_krb5" = "xyes"; then
1608 AC_MSG_ERROR([Could not find krb5-config in path])
1610 AC_MSG_WARN([Could not find krb5-config in path])
1611 with_heimdal_krb5=no
1616 if test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"; then
1617 SQUID_STATE_SAVE([squid_krb5_save])
1618 LIBS="$LIBS $LIB_KRB5_PATH"
1620 # auto-detect using pkg-config
1621 PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[
1622 # look for krb5-config (unless cross-compiling)
1623 if test "$cross_compiling" = "no"; then
1624 if test "x$krb5confpath" = "x" ; then
1625 AC_PATH_PROG(krb5_config,krb5-config,no)
1626 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1627 ac_krb5_config="$ac_cv_path_krb5_config"
1630 ac_krb5_config="$krb5confpath/krb5-config"
1633 if test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"; then
1635 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1636 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1637 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1638 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1639 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1641 ## For some OS pkg-config is broken or unavailable.
1642 ## Detect libraries the hard way.
1643 SQUID_STATE_SAVE([squid_heimdal_save])
1645 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1646 AC_CHECK_LIB(resolv, [main], [LIB_KRB5_LIBS="-lresolv $LIB_KRB5_LIBS"],[
1647 AC_MSG_WARN([library 'resolv' is required for Heimdal Kerberos])
1648 missing_required=yes
1651 AC_CHECK_LIB(crypt, [main], [LIB_KRB5_LIBS="-lcrypt $LIB_KRB5_LIBS"],[
1652 AC_MSG_WARN([library 'crypt' is required for Heimdal Kerberos])
1653 missing_required=yes
1656 AC_CHECK_LIB(roken, [main], [LIB_KRB5_LIBS="-lroken $LIB_KRB5_LIBS"],[
1657 AC_MSG_WARN([library 'roken' is required for Heimdal Kerberos])
1658 missing_required=yes
1661 AC_CHECK_LIB(heimbase, [main], [LIB_KRB5_LIBS="-lheimbase $LIB_KRB5_LIBS"],[
1662 AC_MSG_WARN([library 'heimbase' may be required for Heimdal Kerberos])
1665 AC_CHECK_LIB(wind, [main], [LIB_KRB5_LIBS="-lwind $LIB_KRB5_LIBS"],[
1666 AC_MSG_WARN([library 'wind' may be required for Heimdal Kerberos])
1669 AC_CHECK_LIB(crypto, [main], [LIB_KRB5_LIBS="-lcrypto $LIB_KRB5_LIBS"],[
1670 AC_MSG_WARN([library 'crypto' is required for Heimdal Kerberos])
1671 missing_required=yes
1674 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
1675 AC_MSG_WARN([library 'com_err' is required for Heimdal Kerberos])
1676 missing_required=yes
1679 AC_CHECK_LIB(hx509, [main], [LIB_KRB5_LIBS="-lhx509 $LIB_KRB5_LIBS"],[
1680 AC_MSG_WARN([library 'hx509' may be required for Heimdal Kerberos])
1683 AC_CHECK_LIB(asn1, [main], [LIB_KRB5_LIBS="-lasn1 $LIB_KRB5_LIBS"],[
1684 AC_MSG_WARN([library 'asn1' is required for Heimdal Kerberos])
1685 missing_required=yes
1688 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1689 AC_MSG_WARN([library 'krb5' is required for Heimdal Kerberos])
1690 missing_required=yes
1693 AC_CHECK_LIB(heimntlm, [main], [LIB_KRB5_LIBS="-lheimntlm $LIB_KRB5_LIBS"],[
1694 AC_MSG_WARN([library 'heimntlm' may be required for Heimdal Kerberos])
1697 AC_CHECK_LIB(gssapi, [main], [LIB_KRB5_LIBS="-lgssapi $LIB_KRB5_LIBS"],[
1698 AC_MSG_WARN([library 'gssapi' is required for Heimdal Kerberos])
1699 missing_required=yes
1701 SQUID_STATE_ROLLBACK([squid_heimdal_save])
1702 if test "x$missing_required" = "xyes"; then
1707 if test "x$LIB_KRB5_LIBS" != "x"; then
1708 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1709 KRB5INCS="$LIB_KRB5_CFLAGS"
1710 AC_DEFINE(USE_HEIMDAL_KRB5,1,[Heimdal Kerberos support is available])
1711 KRB5_FLAVOUR="Heimdal"
1713 # check for other specific broken implementations
1714 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1715 LIBS="$LIBS $KRB5LIBS"
1717 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1718 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1719 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1721 SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
1722 if test "x$squid_cv_broken_heimdal_krb5_h" = "xyes"; then
1723 AC_DEFINE(HAVE_BROKEN_HEIMDAL_KRB5_H, 1, [Define to 1 if Heimdal krb5.h is broken for C++])
1725 SQUID_CHECK_KRB5_FUNCS
1727 if test "x$KRB5LIBS" = "x"; then
1728 if test "x$with_heimdal_krb5" = "xyes"; then
1729 AC_MSG_ERROR([Required Heimdal Kerberos library not found])
1731 AC_MSG_WARN([Heimdal Kerberos library not found])
1734 SQUID_STATE_ROLLBACK([squid_krb5_save])
1737 dnl User may specify GNU gss is needed from a non-standard location
1738 SQUID_AUTO_LIB(gnugss,[GNU gss],[LIB_KRB5])
1739 AH_TEMPLATE(USE_GNUGSS,[GNU gss support is available])
1740 if test "x$with_gnugss" != "xno" -a "x$KRB5LIBS" = "x"; then
1741 CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS"
1743 SQUID_STATE_SAVE([squid_krb5_save])
1744 LIBS="$LIBS $LIB_KRB5_PATH"
1746 # auto-detect using pkg-config
1747 PKG_CHECK_MODULES([LIB_KRB5],[gss],,[
1748 ## For some OS pkg-config is broken or unavailable.
1749 ## Detect libraries the hard way.
1751 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1752 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
1753 AC_MSG_WARN([library 'com_err' is required for GNU Kerberos])
1757 if test "x$LIB_KRB5_LIBS" != "x"; then
1758 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1759 KRB5INCS="$LIB_KRB5_CFLAGS"
1760 AC_DEFINE(USE_GNUGSS,1,[GNU Kerberos support is available])
1761 KRB5_FLAVOUR="GNU GSS"
1763 # check for other specific broken implementations
1764 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1765 LIBS="$LIBS $KRB5LIBS"
1767 AC_MSG_NOTICE([Try to find Kerbeors headers in given path])
1768 AC_CHECK_HEADERS(gss.h)
1770 SQUID_CHECK_WORKING_GSSAPI
1771 SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support])
1773 SQUID_CHECK_SPNEGO_SUPPORT
1774 SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support])
1776 SQUID_CHECK_WORKING_KRB5
1777 SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support])
1779 if test "x$KRB5LIBS" = "x"; then
1780 if test "x$with_gnugss" = "xyes"; then
1781 AC_MSG_ERROR([Required GNU GSS Kerberos library not found])
1783 AC_MSG_WARN([GNU GSS Kerberos library not found])
1786 SQUID_STATE_ROLLBACK([squid_krb5_save])
1789 if test "x$KRB5LIBS" != "x"; then
1792 AC_MSG_NOTICE([$KRB5_FLAVOUR Kerberos library support: ${with_krb5:=no} ${LIB_KRB5_PATH} ${LIB_KRB5_LIBS}])
1796 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
1797 dnl only with Windows LDAP libraries using -lwldap32
1798 case "$squid_host_os" in
1804 AC_CHECK_LIB(ldap, ldap_init, [LDAPLIB="-lldap"])
1805 dnl LDAP helpers need to know if -llber is needed or not
1806 AC_CHECK_LIB(lber, ber_init, [LBERLIB="-llber"])
1807 dnl if no ldap lib found check for mozilla version
1808 if test "x$ac_cv_lib_ldap_ldap_init" != x""yes; then
1811 AC_CHECK_LIB(ldap60, ldap_init, [LDAPLIB="-lldap60"])
1812 LIBS="$LDAPLIB $LIBPTHREADS"
1813 AC_CHECK_LIB(prldap60, prldap_init, [LDAPLIB="-lprldap60 $LDAPLIB"])
1814 LIBS="$LDAPLIB $LIBPTHREADS"
1815 AC_CHECK_LIB(ssldap60, ldapssl_init, [LDAPLIB="-lssldap60 $LDAPLIB"])
1819 AC_CHECK_HEADERS(ldap.h lber.h)
1820 AC_CHECK_HEADERS(mozldap/ldap.h)
1823 dnl Check for LDAP_OPT_DEBUG_LEVEL
1825 AC_MSG_CHECKING([for LDAP_OPT_DEBUG_LEVEL])
1826 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1829 int i=LDAP_OPT_DEBUG_LEVEL
1831 [ AC_MSG_RESULT(yes) ],
1832 [ AC_MSG_RESULT(no) ])
1835 dnl Check for working ldap
1838 LIBS="$LDAPLIB $LBERLIB $LIBPTHREADS"
1839 AC_MSG_CHECKING([for working ldap])
1840 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1841 # define LDAP_DEPRECATED 1
1844 # elif HAVE_MOZLDAP_LDAP_H
1845 # include <mozldap/ldap.h>
1853 ldap_init((const char *)&host, port);
1858 [ AC_DEFINE(HAVE_LDAP, 1, [LDAP support])
1859 AC_MSG_RESULT(yes) ],
1860 [ AC_MSG_RESULT(no) ],
1861 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1865 dnl Check for ldap vendor
1867 AC_MSG_CHECKING([for OpenLDAP])
1868 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1872 # include <string.h>
1876 return strcmp(LDAP_VENDOR_NAME,"OpenLDAP");
1879 [ AC_DEFINE(HAVE_OPENLDAP, 1, [OpenLDAP support])
1880 AC_MSG_RESULT(yes) ],
1881 [ AC_MSG_RESULT(no) ],
1882 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1884 AC_MSG_CHECKING([for Sun LDAP SDK])
1885 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1889 # include <string.h>
1893 return strcmp(LDAP_VENDOR_NAME,"Sun Microsystems Inc.");
1896 [ AC_DEFINE(HAVE_SUN_LDAP_SDK, 1, [Sun LDAP SDK support])
1897 AC_MSG_RESULT(yes) ],
1898 [ AC_MSG_RESULT(no) ],
1899 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1901 AC_MSG_CHECKING([for Mozilla LDAP SDK])
1902 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1905 # elif HAVE_MOZLDAP_LDAP_H
1906 # include <mozldap/ldap.h>
1908 # include <string.h>
1912 return strcmp(LDAP_VENDOR_NAME,"mozilla.org");
1915 [ AC_DEFINE(HAVE_MOZILLA_LDAP_SDK, 1, [Mozilla LDAP SDK support])
1916 AC_MSG_RESULT(yes) ],
1917 [ AC_MSG_RESULT(no)],
1918 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1921 dnl Check for LDAP_REBINDPROC_CALLBACK
1923 AC_MSG_CHECKING([for LDAP_REBINDPROC_CALLBACK])
1924 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1927 # elif HAVE_MOZLDAP_LDAP_H
1928 # include <mozldap/ldap.h>
1931 LDAP_REBINDPROC_CALLBACK ldap_rebind;
1933 [ AC_DEFINE(HAVE_LDAP_REBINDPROC_CALLBACK,1,[Define to 1 if you have LDAP_REBINDPROC_CALLBACK])
1934 AC_MSG_RESULT(yes) ],
1935 [ AC_MSG_RESULT(no) ])
1938 dnl Check for LDAP_REBIND_PROC
1940 AC_MSG_CHECKING([for LDAP_REBIND_PROC])
1941 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1944 # elif HAVE_MOZLDAP_LDAP_H
1945 # include <mozldap/ldap.h>
1948 LDAP_REBIND_PROC ldap_rebind;
1950 [ AC_DEFINE(HAVE_LDAP_REBIND_PROC,1,[Define to 1 if you have LDAP_REBIND_PROC])
1951 AC_MSG_RESULT(yes) ],
1952 [ AC_MSG_RESULT(no) ])
1955 dnl Check for LDAP_REBIND_FUNCTION
1957 AC_MSG_CHECKING([for LDAP_REBIND_FUNCTION])
1958 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1959 # define LDAP_REFERRALS
1962 # elif HAVE_MOZLDAP_LDAP_H
1963 # include <mozldap/ldap.h>
1966 LDAP_REBIND_FUNCTION ldap_rebind;
1968 [ AC_DEFINE(HAVE_LDAP_REBIND_FUNCTION,1,[Define to 1 if you have LDAP_REBIND_FUNCTION])
1969 AC_MSG_RESULT(yes) ],
1970 [ AC_MSG_RESULT(no) ])
1973 dnl Check for LDAP_SCOPE_DEFAULT
1975 AC_MSG_CHECKING([for LDAP_SCOPE_DEFAULT])
1976 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1979 # elif HAVE_MOZLDAP_LDAP_H
1980 # include <mozldap/ldap.h>
1983 int i=LDAP_SCOPE_DEFAULT;
1985 [ AC_DEFINE(HAVE_LDAP_SCOPE_DEFAULT,1,[Define to 1 if you have LDAP_SCOPE_DEFAULT])
1986 AC_MSG_RESULT(yes) ],
1987 [ AC_MSG_RESULT(no) ])
1990 dnl Check for ldap_url_desc.lud_scheme
1992 AC_CHECK_MEMBER(struct ldap_url_desc.lud_scheme,
1993 AC_DEFINE(HAVE_LDAP_URL_LUD_SCHEME,1,
1994 [Define to 1 if you have LDAPURLDesc.lud_scheme]),,[#include <ldap.h>])
1997 dnl Check for ldapssl_client_init
1999 AC_CHECK_LIB(ldap,ldapssl_client_init,
2000 AC_DEFINE(HAVE_LDAPSSL_CLIENT_INIT,1,[Define to 1 if you have ldapssl_client_init]),)
2003 dnl Check for ldap_url_desc2str
2005 AC_CHECK_LIB(ldap,ldap_url_desc2str,
2006 AC_DEFINE(HAVE_LDAP_URL_DESC2STR,1,[Define to 1 if you have ldap_url_desc2str]),)
2009 dnl Check for ldap_url_parse
2011 AC_CHECK_LIB(ldap,ldap_url_parse,
2012 AC_DEFINE(HAVE_LDAP_URL_PARSE,1,[Define to 1 if you have ldap_url_parse]),)
2015 dnl Check for ldap_start_tls_s
2017 AC_CHECK_LIB(ldap,ldap_start_tls_s,
2018 AC_DEFINE(HAVE_LDAP_START_TLS_S,1,[Define to 1 if you have ldap_start_tls_s]),)
2025 SQUID_AUTO_LIB(systemd,[systemd API for start-up notification],[SYSTEMD])
2026 AH_TEMPLATE(USE_SYSTEMD,[systemd support is available])
2027 if test "x$with_systemd" != "xno" -a "x$squid_host_os" = "xlinux"; then
2028 SQUID_STATE_SAVE(squid_systemd_state)
2030 # User may have provided a custom location for systemd. Otherwise...
2031 LIBS="$LIBS $SYSTEMD_PATH"
2033 # auto-detect using pkg-config
2034 PKG_CHECK_MODULES(SYSTEMD,[libsystemd],,[
2036 PKG_CHECK_MODULES(SYSTEMD,[libsystemd-daemon],,[:])
2039 AC_CHECK_HEADERS(systemd/sd-daemon.h)
2041 SQUID_STATE_ROLLBACK(squid_systemd_state) #de-pollute LIBS
2043 if test "x$with_systemd" = "xyes" -a "x$SYSTEMD_LIBS" = "x"; then
2044 AC_MSG_ERROR([Required systemd library not found])
2046 if test "x$SYSTEMD_LIBS" != "x" ; then
2047 CXXFLAGS="$SYSTEMD_CFLAGS $CXXFLAGS"
2048 LDFLAGS="$SYSTEMD_PATH $SYSTEMD_LIBS $LDFLAGS"
2049 AC_DEFINE(USE_SYSTEMD,1,[systemd support is available])
2054 AC_MSG_NOTICE([systemd library support: ${with_systemd:=auto} ${SYSTEMD_PATH} ${SYSTEMD_LIBS}])
2056 AC_ARG_ENABLE(forw-via-db,
2057 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [
2058 SQUID_YESNO([$enableval],[unrecognized argument to --enable-forw-via-db: $enableval])
2060 SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no},
2061 [Enable Forw/Via database])
2062 AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db])
2064 AC_ARG_ENABLE(cache-digests,
2065 AS_HELP_STRING([--enable-cache-digests],
2066 [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
2068 SQUID_YESNO($enableval,
2069 [unrecognized argument to --enable-cache-digests: $enableval])
2071 SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no},
2072 [Use Cache Digests for locating objects in neighbor caches.])
2073 AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests])
2076 ################################
2077 # check for netio plugin stuff #
2078 ################################
2079 dnl order of these options handling is relevant in case the user
2080 dnl supplies more than one --enable option. Options handled later
2081 dnl override those handled earlier for io loop method manual override
2082 AC_ARG_ENABLE(select,
2083 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
2085 SQUID_YESNO($enableval,[--disable-select takes no extra argument])
2086 if test "x$enableval" = "xyes"; then
2087 if test "x$squid_host_os" = "xmingw"; then
2088 squid_opt_io_loop_engine="select_win32"
2090 squid_opt_io_loop_engine="select"
2094 AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}])
2097 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
2099 SQUID_YESNO($enableval,[--disable-poll takes no extra argument])
2100 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="poll"
2102 AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}])
2104 AC_ARG_ENABLE(kqueue,
2105 AS_HELP_STRING([--disable-kqueue],
2106 [Disable kqueue(2) support.]), [
2107 SQUID_YESNO($enableval,[--enable-kqueue takes no extra argument])
2109 if test "x${enable_kqueue:=auto}" != "xno" ; then
2110 AC_CHECK_HEADERS([sys/event.h],[],[
2111 if test "x${enable_kqueue}" = "xyes" ; then
2112 AC_MSG_ERROR([kqueue support requires sys/event.h header file.])
2115 AC_CHECK_FUNCS(kqueue,[],[
2116 if test "x${enable_kqueue}" = "xyes" ; then
2117 AC_MSG_ERROR([kqueue support missing in libc library.])
2120 if test "x$ac_cv_func_kqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes" ; then
2121 squid_opt_io_loop_engine="kqueue"
2126 AC_MSG_NOTICE([enabling kqueue for net I/O: ${enable_kqueue:=auto}])
2129 AC_ARG_ENABLE(epoll,
2130 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
2132 SQUID_YESNO($enableval,[--disable-epoll takes no extra argument])
2133 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="epoll"
2135 AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}])
2137 # auto-detect and verify epoll header and library present and working
2138 # logic mapping and loop method selection are performed later
2139 if test "x$enable_epoll" != "xno" ; then
2141 # check if libs are needed to support epoll
2142 # note: this code block seems quite generic. Could it be extracted
2143 # into a squid specific configure function?
2144 SQUID_STATE_SAVE(squid_epoll_state)
2145 AC_SEARCH_LIBS(epoll_ctl,[epoll])
2146 if test "x$ac_cv_search_epoll_ctl" = "xno" ; then
2147 enable_epoll=no #disable. Needed code not found
2148 elif test "x$ac_cv_search_epoll_ctl" = "xnone required" ; then
2151 EPOLL_LIBS=$ac_cv_search_epoll_ctl
2153 AC_SUBST(EPOLL_LIBS)
2154 SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS
2156 # epoll requires sys/epoll.h
2157 AC_CHECK_HEADERS([sys/epoll.h])
2159 dnl Verify that epoll really works
2160 if test "x$ac_cv_search_epoll_ctl" != 'xno' ; then
2164 if test "x$enable_epoll" = "xyes" -a "x$squid_cv_epoll_works" = "xno" ; then
2165 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
2169 dnl Enable /dev/poll
2170 AC_ARG_ENABLE(devpoll,
2171 AS_HELP_STRING([--disable-devpoll],[Disable Solaris /dev/poll support.]),
2173 SQUID_YESNO($enableval,[--disable-devpoll takes no extra argument])
2174 test "x$enableval" = "xyes" && squid_opt_io_loop_engine="devpoll"
2176 AC_MSG_NOTICE([enabling /dev/poll for net I/O: ${enable_devpoll:=auto}])
2178 ## auto-detect and verify devpoll header and library present and working
2179 if test "x$enable_devpoll" != "xno"; then
2181 # /dev/poll requires ioctl() and write()
2182 AC_CHECK_FUNCS(ioctl)
2183 AC_CHECK_FUNCS(write)
2185 # /dev/poll requires sys/devpoll.h
2186 AC_CHECK_HEADERS([sys/devpoll.h],,[
2187 if test "x$enable_devpoll" = "xyes"; then
2188 AC_MSG_ERROR([--enable-devpoll specified but /dev/poll headers not found])
2192 # Verify that /dev/poll really works
2193 if test "x$enable_devpoll" != 'xno' ; then
2197 if test "x$enable_devpoll" = "xyes" -a "x$squid_cv_devpoll_works" = "xno" ; then
2198 AC_MSG_ERROR([/dev/poll does not work. Force-enabling it is not going to help.])
2203 AC_ARG_ENABLE(http-violations,
2204 AS_HELP_STRING([--disable-http-violations],
2205 [This allows you to remove code which is known to
2206 violate the HTTP protocol specification.]), [
2207 SQUID_YESNO([$enableval],
2208 [unrecognized argument to --disable-http-violations: $enableval])
2210 SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes},
2211 [Define to enable code which volates the HTTP standard specification])
2212 AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations])
2214 # IPFW Transparent Proxy
2215 AC_ARG_ENABLE(ipfw-transparent,
2216 AS_HELP_STRING([--enable-ipfw-transparent],
2217 [Enable Transparent Proxy support for systems
2218 using FreeBSD IPFW-style firewalling.]), [
2219 SQUID_YESNO([$enableval],
2220 [unrecognized argument to --enable-ipfw-transparent: $enableval])
2222 SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no},
2223 [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.])
2224 AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent])
2226 # IP-Filter Transparent Proxy
2227 AC_ARG_ENABLE(ipf-transparent,
2228 AS_HELP_STRING([--enable-ipf-transparent],
2229 [Enable Transparent Proxy support using IPFilter-style firewalling]), [
2230 SQUID_YESNO([$enableval],
2231 [unrecognized argument to --enable-ipf-transparent: $enableval])
2233 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2234 #IPF currently broken. Default-disabled for now.
2235 AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}])
2237 dnl Enable PF Transparent Proxy
2238 AC_ARG_ENABLE(pf-transparent,
2239 AS_HELP_STRING([--enable-pf-transparent],
2240 [Enable Transparent Proxy support for systems using PF network address redirection.]), [
2241 SQUID_YESNO([$enableval],
2242 [unrecognized argument to --enable-pf-transparent: $enableval])
2244 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2245 AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=no}])
2247 dnl Enable /dev/pf support for older PF Transparent Proxy systems (OpenBSD 4.x and older)
2248 AC_ARG_WITH(nat-devpf,
2249 AS_HELP_STRING([--with-nat-devpf],
2250 [Enable /dev/pf support for NAT on older OpenBSD and FreeBSD kernels.]), [
2251 SQUID_YESNO([$enableval],
2252 [unrecognized argument to --with-nat-devpf: $enableval])
2254 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2255 AC_MSG_NOTICE([NAT lookups via /dev/pf: ${with_nat_devpf:=no}])
2257 # Linux Netfilter Transparent Proxy
2258 AC_ARG_ENABLE(linux-netfilter,
2259 AS_HELP_STRING([--enable-linux-netfilter],
2260 [Enable Transparent Proxy support for Linux (Netfilter)]), [
2261 SQUID_YESNO([$enableval],
2262 [unrecognized argument to --enable-linux-netfilter: $enableval])
2264 AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}])
2265 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2268 dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking)
2269 SQUID_AUTO_LIB(netfilter-conntrack,[Netfilter conntrack],[LIBNETFILTER_CONNTRACK])
2270 AC_MSG_NOTICE([Linux Netfilter Conntrack support requested: ${with_netfilter_conntrack:=auto}])
2271 if test "x$with_netfilter_conntrack" != "xno"; then
2272 LDFLAGS="$LIBNETFILTER_CONNTRACK_PATH $LDFLAGS"
2273 CPPFLAGS="$LIBNETFILTER_CONNTRACK_CFLAGS $CPPFLAGS"
2274 AC_SEARCH_LIBS([nfct_query], [netfilter_conntrack],,[
2275 if test x"$with_netfilter_conntrack" = "xyes"; then
2276 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack library not found])
2278 with_netfilter_conntrack=no])
2279 AC_CHECK_HEADERS([libnetfilter_conntrack/libnetfilter_conntrack.h \
2280 libnetfilter_conntrack/libnetfilter_conntrack_tcp.h],,[
2281 if test x"$with_netfilter_conntrack" = "xyes"; then
2282 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack headers not found])
2284 with_netfilter_conntrack=no])
2285 # If nothing is broken; enable the libraries usage.
2286 if test "x$with_netfilter_conntrack" != "xno"; then
2287 with_netfilter_conntrack=yes
2292 dnl Enable Large file support
2294 squid_opt_enable_large_files=no
2296 AC_ARG_WITH(large-files,
2297 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]), [
2298 if test "x$withval" = "xyes"; then
2299 squid_opt_enable_large_files=yes
2303 dnl UNIX Build environment
2304 dnl AS_HELP_STRING is not suited here because it cannot to specify newlines
2305 AC_ARG_WITH(build-environment,
2306 AS_HELP_STRING([--with-build-environment=model],
2307 [The build environment to use. Normally one of
2308 POSIX_V6_ILP32_OFF32 (32 bits),
2309 POSIX_V6_ILP32_OFFBIG (32 bits with large file support),
2310 POSIX_V6_LP64_OFF64 (64 bits),
2311 POSIX_V6_LPBIG_OFFBIG (large pointers and files),
2312 XBS5_ILP32_OFF32 i(legacy, 32 bits),
2313 XBS5_ILP32_OFFBIG (legacy, 32 bits with large file support),
2314 XBS5_LP64_OFF64 (legacy, 64 bits),
2315 XBS5_LPBIG_OFFBIG (legacy, large pointers and files)
2316 or default (The default for your OS)]), [
2319 AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf])
2322 buildmodel="$withval"
2327 #hack. Let's early-detect sizeof(long)
2328 AC_CHECK_SIZEOF(long)
2330 if test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"; then
2331 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
2332 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
2337 if test "x$buildmodel" = "x"; then
2338 AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
2341 if test "x$buildmodel" = "xdefault" -o "x$buildmodel" = "x"; then
2342 # define _FILE_OFFSET_BITS if requested and needed
2343 if test "x$squid_opt_enable_large_files" = "xyes" -a $ac_cv_sizeof_long -le 4 ; then
2344 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
2345 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
2346 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2349 AC_MSG_NOTICE([Using $buildmodel build environment])
2350 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
2353 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
2355 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
2356 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2357 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
2358 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
2359 if test "x$squid_host_os" = "xsolaris" ; then
2361 # On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
2362 # for LDFLAGS -xarch=generic64, but:
2363 # "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
2364 # For gcc "-xarch=generic64" must be replaced with "-m64"
2365 # The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
2366 if test "x$GCC" = "xyes"; then
2367 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
2368 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
2369 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
2370 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
2371 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2372 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2373 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
2375 AC_MSG_NOTICE([Removing -Usun on $host])
2376 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
2377 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
2381 AC_ARG_ENABLE(follow-x-forwarded-for,
2382 AS_HELP_STRING([--enable-follow-x-forwarded-for],
2383 [Enable support for following the X-Forwarded-For
2384 HTTP header to try to find the IP address of the
2385 original or indirect client when a request has
2386 been forwarded through other proxies.]), [
2387 SQUID_YESNO([$enableval],
2388 [unrecognized argument to --enable-follow-x-forwarded-for: $enableval])
2390 AC_MSG_NOTICE([Support for X-Forwarded-For enabled: ${enable_follow_x_forwarded_for:=yes}])
2391 SQUID_DEFINE_BOOL(FOLLOW_X_FORWARDED_FOR,$enable_follow_x_forwarded_for,
2392 [Enable following X-Forwarded-For headers])
2394 AC_ARG_ENABLE(ident-lookups,
2395 AS_HELP_STRING([--disable-ident-lookups],
2396 [Remove code that supports performing Ident (RFC 931) lookups.]), [
2397 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ident-lookups: $enableval])
2399 AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}])
2400 SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups])
2402 dnl Select Default hosts file location
2403 AC_ARG_ENABLE(default-hostsfile,
2404 AS_HELP_STRING([--enable-default-hostsfile=path],
2405 [Select default location for hosts file.
2406 See hosts_file directive in squid.conf for details]), [
2407 if test "x$enableval" != "xnone" -a "x$enableval" != "xno" ; then
2408 if test \! -f "$enableval"; then
2409 AC_MSG_WARN([Unable to find file $enableval. I hope you know what you are doing.])
2411 squid_opt_default_hosts=$enableval
2413 squid_opt_default_hosts="none"
2416 AC_MSG_NOTICE([Default hosts file set to: ${squid_opt_default_hosts:=/etc/hosts}])
2417 DEFAULT_HOSTS=$squid_opt_default_hosts
2418 AC_SUBST(DEFAULT_HOSTS)
2420 # Select auth schemes modules to build
2422 AS_HELP_STRING([--enable-auth],
2423 [Build global support for authentication. The list of schemes
2424 and helpers to be enabled is defined elsewhere]), [
2425 SQUID_YESNO([$enableval],
2426 [unrecognized argument to --enable-auth: $enableval])
2428 AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}])
2429 SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,[Enable support for authentication])
2430 AM_CONDITIONAL(ENABLE_AUTH, test "x$enable_auth" != "xno")
2434 AC_ARG_ENABLE(auth-basic,
2435 AS_HELP_STRING([--enable-auth-basic="list of helpers"],
2436 [Enable the basic authentication scheme, and build the specified helpers.
2437 Not providing an explicit list of helpers will attempt build of
2438 all possible helpers. Default is to do so.
2439 To disable the basic authentication scheme, use --disable-auth-basic.
2440 To enable but build no helpers, specify "none".
2441 To see available helpers, see the src/auth/basic/ directory. ]),[
2442 #nothing to do really
2444 m4_include([src/auth/basic/helpers.m4])
2446 AC_ARG_ENABLE(auth-digest,
2447 AS_HELP_STRING([--enable-auth-digest="list of helpers"],
2448 [Enable the Digest authentication scheme, and build the specified helpers.
2449 Not providing an explicit list of helpers will attempt build of
2450 all possible helpers. Default is to do so.
2451 To disable the Digest authentication scheme, use --disable-auth-digest.
2452 To enable but build no helpers, specify "none".
2453 To see available helpers, see the src/auth/digest/ directory. ]),[
2454 #nothing to do, really
2456 m4_include([src/auth/digest/helpers.m4])
2458 AC_ARG_ENABLE(auth-negotiate,
2459 AS_HELP_STRING([--enable-auth-negotiate="list of helpers"],
2460 [Enable the Negotiate authentication scheme, and build the specified
2462 Not providing an explicit list of helpers will attempt build of
2463 all possible helpers. Default is to do so.
2464 To disable the Negotiate authentication scheme,
2465 use --disable-auth-negotiate.
2466 To enable but build no helpers, specify "none".
2467 To see available helpers, see the src/auth/negotiate/ directory. ]),[
2468 #nothing to do, really
2470 m4_include([src/auth/negotiate/helpers.m4])
2472 AC_ARG_ENABLE(auth-ntlm,
2473 AS_HELP_STRING([--enable-auth-ntlm="list of helpers"],
2474 [Enable the NTLM authentication scheme, and build the specified helpers.
2475 Not providing an explicit list of helpers will attempt build of
2476 all possible helpers. Default is to do so.
2477 To disable the NTLM authentication scheme, use --disable-auth-ntlm.
2478 To enable but build no helpers, specify "none".
2479 To see available helpers, see the src/auth/ntlm/ directory. ]),[
2481 m4_include([src/auth/ntlm/helpers.m4])
2483 dnl Authentication libraries to build
2484 dnl This list will not be needed when each auth library has its own Makefile
2485 dnl this is to be placed AFTER each auth module's handler
2487 for module in $AUTH_MODULES; do
2488 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD ${module}/lib${module}.la"
2490 AC_SUBST(AUTH_MODULES)
2491 AC_SUBST(AUTH_LIBS_TO_BUILD)
2492 AM_CONDITIONAL(ENABLE_SMBLIB, test "x$require_smblib" = "xyes")
2494 dnl Select logging daemon helpers to build
2495 AC_ARG_ENABLE(log-daemon-helpers,
2496 AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"],
2497 [This option selects which logging daemon helpers to
2498 build and install as part of the normal build process
2499 For a list of available helpers see the src/log/
2501 #nothing to do, really
2503 m4_include([src/log/helpers.m4])
2505 AC_ARG_ENABLE(external-acl-helpers,
2506 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
2507 [Enable external_acl helpers support and the helpers themselves.
2508 Default is to build all buildable helpers and enable support.
2509 To disable support, use --disable-external-acl-helpers.
2510 To build no helpers, specify "none".
2511 To see available helpers, see the src/acl/external/
2513 #nothing to do, really
2515 m4_include([src/acl/external/helpers.m4])
2517 dnl Select url_rewrite helpers to build
2518 AC_ARG_ENABLE(url-rewrite-helpers,
2519 AS_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
2520 [This option selects which url_rewrite helpers to
2521 build and install as part of the normal build
2522 process. The default is to attempt the build of all possible
2523 helpers. Use --disable-url-rewrite-helpers to build none.
2524 For a list of available helpers see the
2525 src/http/url_rewriters/ directory.]),[
2527 m4_include([src/http/url_rewriters/helpers.m4])
2529 dnl Select security helpers to build
2530 AC_ARG_ENABLE(security-cert-validators,
2531 AS_HELP_STRING([--enable-security-cert-validators="list of helpers"],
2532 [This option selects which security certificate validator
2533 helpers to build and install as part of the normal build
2534 process. The default is to attempt the build of all possible
2535 helpers. Use --disable-security-cert-validators to
2536 build none. For a list of available helpers see the
2537 src/security/cert_validators/ directory.]),[
2539 m4_include([src/security/cert_validators/helpers.m4])
2541 AC_ARG_ENABLE(security-cert-generators,
2542 AS_HELP_STRING([--enable-security-cert-generators="list of helpers"],
2543 [This option selects which security certificate validator
2544 helpers to build and install as part of the normal build
2545 process. The default is to attempt the build of all possible
2546 helpers. Use --disable-security-cert-genrators to
2547 build none. For a list of available helpers see the
2548 src/security/cert_generators/ directory.]),[
2550 m4_include([src/security/cert_generators/helpers.m4])
2552 dnl Select storeid_rewrite helpers to build
2553 AC_ARG_ENABLE(storeid-rewrite-helpers,
2554 AS_HELP_STRING([--enable-storeid-rewrite-helpers="list of helpers"],
2555 [This option selects which Store-ID 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-storeid-rewrite-helpers to build none.
2559 For a list of available helpers see the
2560 src/store/id_rewriters/ directory.]),[
2562 m4_include([src/store/id_rewriters/helpers.m4])
2564 AC_ARG_WITH(valgrind-debug,
2565 AS_HELP_STRING([--with-valgrind-debug],
2566 [Include debug instrumentation for use with valgrind]),
2568 SQUID_YESNO([$withval],
2569 [unrecognized argument to --with-valgrind-debug: $withval])
2570 if test "x$withval" != "xno" ; then
2571 AC_CHECK_HEADERS(valgrind/memcheck.h,[],[
2572 AC_MSG_ERROR([Valgrind support requested, needed headers not found.])
2576 SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no},
2577 [Valgrind memory debugger support])
2578 AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug])
2580 dnl Enable WIN32 Service compile mode
2581 AC_ARG_ENABLE(win32-service,
2582 AS_HELP_STRING([--enable-win32-service],
2583 [Compile Squid as a WIN32 Service.
2584 Works only on MS-Windows platforms]), [
2585 SQUID_YESNO([$enableval],
2586 [unrecognized argument to --enable-win32-service: $enableval])
2588 SQUID_DEFINE_BOOL(USE_WIN32_SERVICE,${enable_win32_service:=no},
2589 [Enable code supporting MS Windows service mode])
2590 AC_MSG_NOTICE([MS Windows service mode enabled: $enable_win32_service])
2593 # Disable "unlinkd" code
2594 AC_ARG_ENABLE(unlinkd,
2595 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [
2596 SQUID_YESNO([$enableval],
2597 [unrecognized argument to --disable-unlinkd: $enableval])
2599 SQUID_DEFINE_BOOL(USE_UNLINKD,${enable_unlinkd:=yes},
2600 [Enable useage of unlinkd])
2601 AM_CONDITIONAL(ENABLE_UNLINKD,test "x$enable_unlinkd" = "xyes")
2602 AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd])
2604 # Enable backtraces on fatal errors
2605 AC_ARG_ENABLE(stacktraces,
2606 AS_HELP_STRING([--enable-stacktraces],
2607 [Enable automatic call backtrace on fatal errors]), [
2608 SQUID_YESNO([$enableval],
2609 [unrecognized argument to --enable-stacktraces: $enableval])
2611 SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no},
2612 [Print stack traces on fatal errors])
2613 AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces])
2615 # Enable X-Accelerator-Vary for Vary support within an accelerator setup
2616 AC_ARG_ENABLE(x-accelerator-vary,
2617 AS_HELP_STRING([--enable-x-accelerator-vary],
2618 [Enable support for the X-Accelerator-Vary
2619 HTTP header. Can be used to indicate
2620 variance within an accelerator setup.
2621 Typically used together with other code
2622 that adds custom HTTP headers to the requests.]), [
2623 SQUID_YESNO([$enableval],
2624 [unrecognized argument to --enable-x-accelerator-vary: $enableval])
2626 SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no},
2627 [Enable support for the X-Accelerator-Vary HTTP header])
2628 AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary])
2630 SQUID_AUTO_LIB(cppunit,[cppunit test framework],[LIBCPPUNIT])
2631 AS_IF([test "x$with_cppunit" != "xno"],[
2632 LIBCPPUNIT_LIBS="$LIBCPPUNIT_PATH -lcppunit"
2633 PKG_CHECK_MODULES([LIBCPPUNIT],[cppunit],[
2634 squid_cv_cppunit_version="`pkg-config cppunit --version`"
2635 AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version])
2636 AS_UNSET(squid_cv_cppunit_version)
2638 SQUID_STATE_SAVE(squid_cppunit_state)
2639 CXXFLAGS="${CXXFLAGS} ${LIBCPPUNIT_CFLAGS}"
2640 LIBS="${LIBS} ${LIBCPPUNIT_LIBS}"
2641 AC_CHECK_HEADERS(cppunit/extensions/HelperMacros.h)
2642 SQUID_STATE_ROLLBACK(squid_cppunit_state)
2644 AC_MSG_WARN([cppunit does not appear to be installed. Squid does not require this, but code testing with 'make check' will fail.])
2648 dnl Check for headers
2673 linux/posix_types.h \
2681 netinet/in_systm.h \
2733 linux/netfilter_ipv4.h \
2734 linux/netfilter_ipv6/ip6_tables.h \
2736 SQUID_DEFAULT_INCLUDES
2740 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2741 #if HAVE_NETINET_IN_H
2742 #include <netinet/in.h>
2746 dnl *BSD do not include the dependencies for all their net/ and netinet/ files
2747 dnl We must include a few basic type headers for them to work.
2762 SQUID_BSDNET_INCLUDES)
2768 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2771 #include <sys/time.h>
2778 dnl Override rusage() detect on MinGW because is emulated in source code
2779 case "$squid_host_os" in
2781 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2782 ac_cv_func_getrusage='yes'
2783 AC_MSG_NOTICE([Using own rusage on Windows.])
2786 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2788 #include <sys/time.h>
2790 #if HAVE_SYS_RESOURCE_H
2791 #include <sys/resource.h>
2796 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2797 #if HAVE_SYS_TYPES_H
2798 #include <sys/types.h>
2800 #include <netinet/in.h>
2801 #include <netinet/in_systm.h>
2802 #include <netinet/ip.h>
2803 #if defined (__linux__) || defined (__CYGWIN__)
2812 dnl Check for typedefs
2813 AC_CHECK_SIZEOF(void *)
2815 # check for a bunch of types
2829 AC_CHECK_TYPE([bool])
2830 #need the defines for PRId64
2831 AC_CHECK_SIZEOF(int64_t)
2832 AC_CHECK_SIZEOF(long)
2833 #need the defines for PRIuSIZE
2834 AC_CHECK_SIZEOF(size_t)
2835 #need the define for overflow checks
2836 AC_CHECK_SIZEOF(off_t)
2837 AC_CHECK_SIZEOF(size_t)
2839 dnl Some C++11 types we try to use
2840 AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS
2841 SQUID_CXX_STD_UNDERLYING_TYPE
2842 SQUID_CXX_STD_IS_TRIVIALLY_COPYABLE
2844 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2845 dnl that is incompatible with the updated Solaris header files.
2846 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2847 AC_CHECK_TYPE(pad128_t,
2848 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2849 ,SQUID_DEFAULT_INCLUDES)
2851 AC_CHECK_TYPE(upad128_t,
2852 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2853 ,SQUID_DEFAULT_INCLUDES)
2855 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2856 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2858 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2859 #include <sys/types.h>
2860 #include <sys/socket.h>
2866 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
2867 [mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2868 #include <sys/ipc.h>
2869 #include <sys/msg.h>])
2871 AC_CHECK_TYPE(cpu_set_t,
2872 AC_DEFINE(HAVE_CPU_SET_T,1,[cpu_set_t is defined by the system headers]),,[
2878 # check for compiler support of %zu printf macro
2879 AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro])
2880 AC_MSG_CHECKING([for compiler %zu support])
2881 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2883 ]],[[size_t n=1;printf("%zu",n);]])],[
2884 AC_DEFINE(PRIuSIZE,"zu")
2886 ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
2889 dnl Check for special functions
2893 # TODO: remove this 'lib' prefix to match coding standard
2894 SQUID_AUTO_LIB(libcap,[Linux capabilities],[LIBCAP])
2895 if test "x$with_libcap" != "xno"; then
2896 CXXFLAGS="$LIBCAP_CFLAGS $CXXFLAGS"
2897 LDFLAGS="$LIBCAP_PATH $LDFLAGS"
2898 # cap_clear_flag is the most recent libcap function we require
2899 AC_CHECK_HEADERS(sys/capability.h)
2900 AC_CHECK_LIB(cap, cap_clear_flag)
2901 SQUID_CHECK_FUNCTIONAL_LIBCAP2
2903 # if it can't be supported..
2904 if test "x$ac_cv_header_sys_capability_h" = "xno" -o \
2905 "x$ac_cv_lib_cap_cap_clear_flag" = "xno"; then
2906 # and it was forced on: error
2907 if test "x$with_libcap" = "xyes" ; then
2908 AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
2910 # with_libcap is "auto"; it can't be supported. Disable.
2914 # header and lib are ok, we support
2920 SQUID_DEFINE_BOOL(USE_LIBCAP,$with_libcap,
2921 [use libcap to set capabilities required for TPROXY])
2922 AC_MSG_NOTICE([libcap support enabled: $with_libcap])
2923 SQUID_DEFINE_BOOL(LIBCAP_BROKEN,${squid_cv_sys_capability_works:=no},
2924 [libcap2 headers are broken and clashing with glibc])
2925 AC_MSG_NOTICE([libcap2 headers are ok: $squid_cv_sys_capability_works])
2928 dnl Check for needed libraries
2929 AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
2930 AC_SEARCH_LIBS([res_init],[resolv])
2931 AC_SEARCH_LIBS([__res_search],[resolv])
2932 AC_SEARCH_LIBS([bind],[socket])
2933 AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
2934 AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
2935 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2936 if test "x$squid_host_os" = "xmingw" ; then
2937 SQUID_CHECK_WINSOCK_LIB
2943 #include <winsock2.h>
2946 #include <windows.h>
2949 #include <ws2tcpip.h>
2954 # check that we have unix sockets
2955 SQUID_CHECK_UNIX_SOCKET
2956 SQUID_DEFINE_BOOL(HAVE_UNIXSOCKET,$squid_cv_unixsocket,[System supports unix sockets])
2958 AC_CHECK_LIB(gnumalloc, malloc)
2959 if test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"; then
2960 AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc])
2961 ac_cv_func_mallocblksize=no
2962 ac_cv_func_mallopt=no
2964 case "$squid_host_os" in
2966 AC_MSG_NOTICE([skipping libmalloc check for $host])
2969 AC_MSG_NOTICE([skipping libmalloc check for $host])
2973 AC_CHECK_LIB(malloc, main)
2978 case "$squid_host_os" in
2980 AC_MSG_NOTICE([Use MSVCRT for math functions.])
2983 dnl log() are only used in old C code for now.
2985 AC_SEARCH_LIBS([log],[m])
2990 dnl --with-maxfd present for compatibility with Squid-2.
2991 dnl undocumented in ./configure --help to encourage using the Squid-3 directive
2996 squid_filedescriptors_num=$withval
2997 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
3000 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
3005 AC_ARG_WITH(filedescriptors,
3006 AS_HELP_STRING([--with-filedescriptors=NUMBER],
3007 [Force squid to support NUMBER filedescriptors]),
3011 squid_filedescriptors_num=$withval
3012 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
3015 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
3020 SQUID_CHECK_DEFAULT_FD_SETSIZE
3024 dnl Enable IPv6 support
3025 AC_MSG_CHECKING([whether to enable IPv6])
3027 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support. The default is to probe system capabilities on startup.]), [
3028 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ipv6: $enableval])
3030 AC_MSG_RESULT(${enable_ipv6:=yes})
3031 SQUID_DEFINE_BOOL(USE_IPV6,$enable_ipv6,[Enable support for IPv6 ])
3033 if test "x$enable_ipv6" = "xyes" ; then
3034 SQUID_CHECK_SIN6_LEN_IN_SAI
3036 SQUID_CHECK_SS_LEN_IN_SOCKADDR_STORAGE
3037 SQUID_CHECK_SIN_LEN_IN_SOCKADDR_IN
3039 dnl System-specific library modifications
3041 AH_TEMPLATE(GETTIMEOFDAY_NO_TZP,[If gettimeofday is known to take only one argument])
3044 if test "x$GCC" = "xyes"; then
3045 AC_MSG_NOTICE([Removing -O for gcc on $host])
3046 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`"
3051 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
3052 LIBS=`echo $LIBS | sed -e s/-lsocket//`
3053 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
3054 LIBS=`echo $LIBS | sed -e s/-lnsl//`
3055 ac_cv_lib_nsl_main=no
3058 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_rtti],[-rtti],[[
3064 public:virtual ~Foo(){}
3066 class Bar:public Foo{
3067 public:Bar():Foo(){}
3070 Foo * myFoo=new Bar();
3071 Bar * myBar=dynamic_cast<Bar *>(myFoo);
3072 assert(myBar != NULL);
3074 if test "$ac_cv_require_rtti" = "yes"; then
3075 SQUID_CFLAGS="-rtti $SQUID_CFLAGS"
3076 SQUID_CXXFLAGS="-rtti $SQUID_CXXFLAGS"
3080 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_qcpluscmt],[-qcpluscmt],[[]],[[//c++ cmt]])
3082 if test "$ac_cv_require_qcpluscmt" = "yes"; then
3083 SQUID_CFLAGS="-qcpluscmt $SQUID_CFLAGS"
3087 [*-*-solaris2.[0-4]])
3088 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3090 [*-sony-newsos[56]*])
3091 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3095 dnl This has to be before AC_CHECK_FUNCS
3096 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
3097 # when running configure.
3098 if test "x$ac_cv_func_poll" = "x" ; then
3102 AC_MSG_NOTICE([disabling poll for $host...])
3103 ac_cv_func_poll='no'
3106 # Henrik Nordstrom (hno@squid-cache.org) 19980817
3107 # poll is problematic on Linux. We disable it
3108 # by default until Linux gets it right.
3109 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
3110 if test $rev -lt 002002; then
3111 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
3112 ac_cv_func_poll='no'
3115 [powerpc-ibm-aix4.1.*])
3116 # Mike Laster (mlaster@metavillage.com) 19981021
3117 AC_MSG_NOTICE([disabling poll for $host...])
3118 ac_cv_func_poll='no'
3123 dnl Check for library functions
3125 backtrace_symbols_fd \
3148 pthread_attr_setschedparam \
3149 pthread_attr_setscope \
3150 pthread_setschedparam \
3175 dnl ... and some we provide local replacements for
3184 AC_CHECK_DECLS([getaddrinfo,getnameinfo,inet_ntop,inet_pton,InetNtopA,InetPtonA],,,[
3186 * BSD requires sys/types.h, sys/socket.h, netinet/in.h, netdb.h, arpa/inet.h
3187 * Linux requires sys/types.h, sys/socket.h, arpa/inet.h
3188 * Windows requires sys/socket.h, winsock2.h, ws2tcpip.h
3190 #if HAVE_SYS_TYPES_H
3191 #include <sys/types.h>
3193 #if HAVE_NETINET_IN_H
3194 #include <netinet/in.h>
3196 #if HAVE_SYS_SOCKET_H
3197 #include <sys/socket.h>
3202 #if HAVE_ARPA_INET_H
3203 #include <arpa/inet.h>
3206 #include <winsock2.h>
3209 #include <ws2tcpip.h>
3213 # Magic which checks whether we are forcing a type of comm loop we
3214 # are actually going to (ab)use.
3215 # Mostly ripped from squid-commloops, thanks to adrian and benno
3217 if test "x$squid_opt_io_loop_engine" != "x"; then
3218 AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine])
3219 elif test "x$enable_epoll" != "xno" -a "x$squid_cv_epoll_works" = "xyes" ; then
3220 squid_opt_io_loop_engine="epoll"
3221 elif test "x$enable_kqueue" != "xno" ; then
3222 squid_opt_io_loop_engine="kqueue"
3223 elif test "x$enable_devpoll" != "xno" ; then
3224 squid_opt_io_loop_engine="devpoll"
3225 elif test "x$enable_poll" != "xno" -a "x$ac_cv_func_poll" = "xyes" ; then
3226 squid_opt_io_loop_engine="poll"
3227 elif test "x$enable_select" != "xno" -a "x$ac_cv_func_select" = "xyes"; then
3228 squid_opt_io_loop_engine="select"
3229 elif test "x$enable_select" != "xno" -a "x$squid_host_os" = "xmingw"; then
3230 squid_opt_io_loop_engine="select_win32"
3232 AC_MSG_WARN([Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!])
3233 AC_MSG_WARN([Will try select and hope for the best.])
3234 squid_opt_io_loop_engine="select"
3237 AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.])
3239 AM_CONDITIONAL(ENABLE_POLL, test "x$squid_opt_io_loop_engine" = "xpoll")
3240 AM_CONDITIONAL(ENABLE_EPOLL, test "x$squid_opt_io_loop_engine" = "xepoll")
3241 AM_CONDITIONAL(ENABLE_SELECT, test "x$squid_opt_io_loop_engine" = "xselect")
3242 AM_CONDITIONAL(ENABLE_SELECT_WIN32, test "x$squid_opt_io_loop_engine" = "xselect_win32")
3243 AM_CONDITIONAL(ENABLE_KQUEUE, test "x$squid_opt_io_loop_engine" = "xkqueue")
3244 AM_CONDITIONAL(ENABLE_DEVPOLL, test "x$squid_opt_io_loop_engine" = "xdevpoll")
3246 case $squid_opt_io_loop_engine in
3247 epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;;
3248 devpoll) AC_DEFINE(USE_DEVPOLL,1,[Use /dev/poll for the IO loop]) ;;
3249 poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;;
3250 kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;;
3251 select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;;
3252 select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;;
3255 if test "x$ac_cv_func_sched_getaffinity" = "xyes" -a "x$ac_cv_func_sched_setaffinity" = "xyes" ; then
3256 AC_DEFINE(HAVE_CPU_AFFINITY,1,[Support setting CPU affinity for workers])
3259 SQUID_CHECK_SETRESUID_WORKS
3260 if test "x$squid_cv_resuid_works" = "xyes" ; then
3261 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.])
3264 AC_CHECK_HEADERS(mswsock.h)
3265 AC_MSG_CHECKING([for constant CMSG_SPACE])
3266 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3267 #if HAVE_SYS_SOCKET_H
3268 #include <sys/socket.h>
3271 #include <mswsock.h>
3274 int a[CMSG_SPACE(int)];
3277 AC_DEFINE(HAVE_CONSTANT_CMSG_SPACE, 1, [Define to 1 if CMSG_SPACE is constant])
3282 AC_CHECK_TYPE(struct cmsghdr,AC_DEFINE(HAVE_CMSGHDR,1,[The system provides struct cmsghdr]),,[
3283 #if HAVE_SYS_SOCKET_H
3284 #include <sys/socket.h>
3287 #include <mswsock.h>
3290 #include <winsock2.h>
3294 AC_CHECK_TYPE(struct iovec,AC_DEFINE(HAVE_IOVEC,1,[The system provides struct iovec]),,[
3295 #if HAVE_SYS_SOCKET_H
3296 #include <sys/socket.h>
3299 #include <winsock2.h>
3302 #include <sys/uio.h>
3306 AC_CHECK_TYPE(struct msghdr,AC_DEFINE(HAVE_MSGHDR,1,[The system provides struct msghdr]),,[
3307 #if HAVE_SYS_SOCKET_H
3308 #include <sys/socket.h>
3311 #include <mswsock.h>
3314 #include <winsock2.h>
3318 AC_CHECK_TYPE(struct sockaddr_un,AC_DEFINE(HAVE_SOCKADDR_UN,1,[The system provides sockaddr_un]),,[
3322 #if HAVE_SYS_SOCKET_H
3323 #include <sys/socket.h>
3326 #include <winsock2.h>
3330 SQUID_CHECK_FUNC_STRNSTR
3332 dnl IP-Filter support requires ipf header files. These aren't
3333 dnl installed by default, so we need to check for them
3334 if test "x$enable_ipf_transparent" != "xno" ; then
3335 SQUID_CHECK_BROKEN_SOLARIS_IPFILTER
3336 AC_MSG_CHECKING(for availability of IP-Filter header files)
3337 # hold on to your hats...
3338 if test "x$ac_cv_header_ip_compat_h" = "xyes" -o \
3339 "x$ac_cv_header_ip_fil_compat_h" = "xyes" -o \
3340 "x$ac_cv_header_netinet_ip_compat_h" = "xyes" -o \
3341 "x$ac_cv_header_netinet_ip_fil_compat_h" = "xyes" ; then
3342 have_ipfilter_compat_header="yes"
3344 if test "x$have_ipfilter_compat_header" = "xyes" -a \
3345 "x$ac_cv_header_ip_fil_h" = "xyes" -a \
3346 "x$ac_cv_header_ip_nat_h" = "xyes" ; then
3347 enable_ipf_transparent="yes"
3348 elif test "x$have_ipfilter_compat_header" = "xyes" -a \
3349 "x$ac_cv_header_netinet_ip_fil_h" = "xyes" -a \
3350 "x$ac_cv_header_netinet_ip_nat_h" = "xyes" ; then
3351 enable_ipf_transparent="yes"
3353 enable_ipf_transparent="no"
3355 AC_MSG_RESULT($IPF_TRANSPARENT)
3357 ## On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3358 ## Solaris minor version (8, 9, 10, ...)
3359 if test "x$enable_ipf_transparent" = "xyes" -a "x$squid_host_os" = "xsolaris" ; then
3360 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3361 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3362 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3366 AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent])
3367 SQUID_DEFINE_BOOL(IPF_TRANSPARENT,$enable_ipf_transparent,
3368 [Enable support for IPF-style transparent proxying])
3370 dnl PF /dev/pf support requires a header file.
3371 if test "x$with_nat_devpf" != "xno" ; then
3372 if test "x$ac_cv_header_net_pfvar_h" = "xyes" -o \
3373 "x$ac_cv_header_net_pf_pfvar_h" = "xyes"; then
3374 if test "x$with_nat_devpf" = "xauto" ; then
3378 if test "x$with_nat_devpf" = "xyes" ; then
3379 AC_MSG_ERROR([PF /dev/pf based NAT requested but needed header not found])
3384 SQUID_DEFINE_BOOL(PF_TRANSPARENT,${enable_pf_transparent:=no},
3385 [Enable support for PF-style transparent proxying])
3386 SQUID_DEFINE_BOOL(USE_NAT_DEVPF,${with_nat_devpf:=no},
3387 [Enable support for /dev/pf NAT lookups])
3389 if test "x$enable_linux_netfilter" != "xno" ; then
3390 if test "x$ac_cv_header_linux_netfilter_ipv4_h" = "xyes"; then
3391 if test "x$enable_linux_netfilter" = "xauto" ; then
3392 enable_linux_netfilter=yes
3395 if test "x$enable_linux_netfilter" = "xauto" ; then
3396 enable_linux_netfilter=no
3398 AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found])
3402 SQUID_DEFINE_BOOL(LINUX_NETFILTER,$enable_linux_netfilter,
3403 [Enable support for Transparent Proxy on Linux via Netfilter])
3405 dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3406 AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter])
3407 if test "x$enable_linux_netfilter" = "xyes" -a "x$with_libcap" != "xyes" ; then
3408 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for TPROXY])
3409 AC_MSG_WARN([Linux Transparent Proxy (version 4+) support WILL NOT be enabled])
3410 AC_MSG_WARN([Reduced support to NAT Interception Proxy])
3413 if test "x$with_netfilter_conntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then
3414 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for netfilter mark support])
3415 AC_MSG_WARN([Linux netfilter marking support WILL NOT be enabled])
3416 with_netfilter_conntrack=no
3418 AC_MSG_NOTICE([Linux Netfilter Conntrack support enabled: ${with_netfilter_conntrack}])
3421 AC_ARG_ENABLE(zph-qos,
3422 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]), [
3423 SQUID_YESNO([$enableval],
3424 [unrecognized argument to --enable-zph-qos: $enableval])
3426 SQUID_DEFINE_BOOL(USE_QOS_TOS,${enable_zph_qos:=yes},
3427 [Enable Zero Penalty Hit QOS. When set, Squid will alter the
3428 TOS field of HIT responses to help policing network traffic])
3429 AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos])
3430 if test x"$enable_zph_qos" = "xyes" ; then
3431 AC_MSG_NOTICE([QOS netfilter mark preservation enabled: $with_netfilter_conntrack])
3432 SQUID_DEFINE_BOOL(USE_LIBNETFILTERCONNTRACK,${with_netfilter_conntrack:=no},
3433 [Enable support for QOS netfilter mark preservation])
3437 AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB=''])
3438 AC_ARG_ENABLE(gnuregex,
3439 AS_HELP_STRING([--enable-gnuregex],
3440 [Compile GNUregex. Unless you have reason to use
3441 this option, you should not enable it.
3442 This library file is usually only required on Windows and
3443 very old Unix boxes which do not have their own regex
3444 library built in.]), [
3445 SQUID_YESNO([$enableval],[unrecognized argument to --enable-gnuregex: $enableval])
3447 # force-enable on old solaris
3448 if test "x${enable_gnuregex:=auto}" = "xauto" ; then
3450 *-sun-solaris2.[[0-4]])
3451 enable_gnuregex="yes"
3456 # try detecting if it is needed
3457 if test "x$enable_gnuregex" = "xauto" ; then
3458 SQUID_CHECK_REGEX_WORKS
3459 if test "x$squid_cv_regex_works" = "xyes" ; then
3465 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3466 AC_MSG_RESULT($enable_gnuregex)
3467 if test "x$enable_gnuregex" = "xyes"; then
3468 # for some reason (force-enable, test..) gnuregex was found as needed. Override any system lib
3471 #if no reason was found to enable gnuregex, disable it
3472 if test "x$enable_gnuregex" = "xauto" ; then
3475 SQUID_DEFINE_BOOL(USE_GNUREGEX,$enable_gnuregex,[Define if we should use GNU regex])
3478 SQUID_DETECT_UDP_SND_BUFSIZE
3479 SQUID_DETECT_UDP_RECV_BUFSIZE
3480 SQUID_DETECT_TCP_SND_BUFSIZE
3481 SQUID_DETECT_TCP_RECV_BUFSIZE
3483 SQUID_CHECK_RECV_ARG_TYPE
3484 SQUID_CHECK_NEED_SYS_ERRLIST
3485 SQUID_CHECK_MAXPATHLEN
3487 SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK
3488 SQUID_CHECK_RESOLVER_FIELDS
3490 AC_CHECK_HEADERS(sys/statvfs.h)
3491 if test "x$ac_cv_header_sys_statvfs_h" = "xyes" ; then
3492 SQUID_CHECK_WORKING_STATVFS
3494 if test "x$ac_cv_func_statvfs" != "xyes" ; then
3495 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/vfs.h sys/statfs.h)
3496 AC_CHECK_FUNCS(statfs)
3497 SQUID_CHECK_F_FRSIZE_IN_STATFS
3500 dnl Squid will not usually attempt to translate templates when building
3501 AC_ARG_ENABLE(translation,
3502 AS_HELP_STRING([--enable-translation],[Generate the localized error page templates and manuals.
3503 Which can also be downloaded from http://www.squid-cache.org/Versions/langpack/.]), [
3504 SQUID_YESNO([$enableval],
3505 [unrecognized argument to --enable-translation: $enableval])
3507 if test "x${enable_translation:=no}" = "xyes" ; then
3508 AX_WITH_PROG([PO2HTML],[po2html])
3509 AX_WITH_PROG([PO2TEXT],[po2txt])
3517 dnl Squid now has limited locale handling ...
3519 AC_ARG_ENABLE(auto-locale,
3520 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
3521 clients request headers.
3522 When disabled Squid requires explicit language configuration.]), [
3523 SQUID_YESNO([$enableval],
3524 [unrecognized argument to --disable-auto-locale: $enableval])
3526 AC_MSG_NOTICE([Multi-Language support enabled: ${enable_auto_locale:=yes}])
3527 SQUID_DEFINE_BOOL(USE_ERR_LOCALES,$enable_auto_locale,
3528 [Use multi-language support on error pages])
3531 dnl Need the debugging version of malloc if available
3533 if test "x$ac_cv_lib_malloc_main" = "xyes" ; then
3534 if test -r /usr/lib/debug/malloc.o ; then
3535 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3537 if test -r /usr/lib/debug/mallocmap.o ; then
3538 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3543 if test "x$XTRA_LIBS" = "x"; then
3546 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3551 AC_SUBST(SQUID_CFLAGS)
3552 AC_SUBST(SQUID_CXXFLAGS)
3554 AC_ARG_VAR([BUILDCXXFLAGS],[C++ compiler flags for building compile-time tools. e.g. cf_gen])
3555 if test "x$BUILDCXXFLAGS" = "x"; then
3556 # if we are NOT cross-compiling, use the default build flags for cf_gen and friends
3557 # otherwise rely on the user-provided value
3558 if test "x$squid_cv_check_marchnative" = "xyes"; then
3559 # always valid for the Build compiler.
3560 BUILDCXXFLAGS="-march=native"
3562 BUILDCXXFLAGS="$BUILDCXXFLAGS $CXXFLAGS"
3564 AC_SUBST(BUILDCXXFLAGS)
3566 AC_MSG_NOTICE([BUILD LIBRARIES: $LIBS])
3567 AC_MSG_NOTICE([BUILD EXTRA LIBRARIES: $XTRA_LIBS])
3568 AC_MSG_NOTICE([BUILD OBJECTS: $OBJS])
3569 AC_MSG_NOTICE([BUILD EXTRA OBJECTS: $XTRA_OBJS])
3570 AC_MSG_NOTICE([BUILD C FLAGS: $CFLAGS])
3571 AC_MSG_NOTICE([BUILD EXTRA C FLAGS: $SQUID_CFLAGS])
3572 AC_MSG_NOTICE([BUILD C++ FLAGS: $CXXFLAGS])
3573 AC_MSG_NOTICE([BUILD EXTRA C++ FLAGS: $SQUID_CXXFLAGS])
3574 AC_MSG_NOTICE([BUILD Tools C++ FLAGS: $BUILDCXXFLAGS])
3576 dnl Clean up after OSF/1 core dump bug
3584 doc/manuals/Makefile
3585 doc/release-notes/Makefile
3589 lib/libTrie/Makefile
3590 lib/libTrie/test/Makefile
3591 lib/ntlmauth/Makefile
3594 lib/snmplib/Makefile
3598 src/acl/external/Makefile
3599 src/acl/external/AD_group/Makefile
3600 src/acl/external/delayer/Makefile
3601 src/acl/external/eDirectory_userip/Makefile
3602 src/acl/external/file_userip/Makefile
3603 src/acl/external/kerberos_ldap_group/Makefile
3604 src/acl/external/kerberos_sid_group/Makefile
3605 src/acl/external/LDAP_group/Makefile
3606 src/acl/external/LM_group/Makefile
3607 src/acl/external/session/Makefile
3608 src/acl/external/SQL_session/Makefile
3609 src/acl/external/unix_group/Makefile
3610 src/acl/external/wbinfo_group/Makefile
3611 src/acl/external/time_quota/Makefile
3612 src/adaptation/Makefile
3613 src/adaptation/icap/Makefile
3614 src/adaptation/ecap/Makefile
3617 src/auth/basic/Makefile
3618 src/auth/basic/DB/Makefile
3619 src/auth/basic/fake/Makefile
3620 src/auth/basic/getpwnam/Makefile
3621 src/auth/basic/LDAP/Makefile
3622 src/auth/basic/NCSA/Makefile
3623 src/auth/basic/NIS/Makefile
3624 src/auth/basic/PAM/Makefile
3625 src/auth/basic/POP3/Makefile
3626 src/auth/basic/RADIUS/Makefile
3627 src/auth/basic/SASL/Makefile
3628 src/auth/basic/SMB/Makefile
3629 src/auth/basic/SMB_LM/Makefile
3630 src/auth/basic/SSPI/Makefile
3631 src/auth/digest/Makefile
3632 src/auth/digest/eDirectory/Makefile
3633 src/auth/digest/file/Makefile
3634 src/auth/digest/LDAP/Makefile
3635 src/auth/negotiate/Makefile
3636 src/auth/negotiate/kerberos/Makefile
3637 src/auth/negotiate/SSPI/Makefile
3638 src/auth/negotiate/wrapper/Makefile
3639 src/auth/ntlm/Makefile
3640 src/auth/ntlm/fake/Makefile
3641 src/auth/ntlm/SMB_LM/Makefile
3642 src/auth/ntlm/SSPI/Makefile
3644 src/clients/Makefile
3649 src/DiskIO/AIO/Makefile
3650 src/DiskIO/Blocking/Makefile
3651 src/DiskIO/DiskDaemon/Makefile
3652 src/DiskIO/DiskThreads/Makefile
3653 src/DiskIO/IpcIo/Makefile
3654 src/DiskIO/Mmapped/Makefile
3663 src/http/one/Makefile
3664 src/http/url_rewriters/Makefile
3665 src/http/url_rewriters/fake/Makefile
3666 src/http/url_rewriters/LFS/Makefile
3673 src/log/file/Makefile
3680 src/security/Makefile
3681 src/security/cert_generators/Makefile
3682 src/security/cert_generators/file/Makefile
3683 src/security/cert_validators/Makefile
3684 src/security/cert_validators/fake/Makefile
3685 src/servers/Makefile
3689 src/store/id_rewriters/Makefile
3690 src/store/id_rewriters/file/Makefile
3694 tools/apparmor/Makefile
3695 tools/helper-mux/Makefile
3696 tools/purge/Makefile
3697 tools/squidclient/Makefile
3698 tools/systemd/Makefile
3699 tools/sysvinit/Makefile
3702 # must configure libltdl subdir unconditionally for "make distcheck" to work
3703 #AC_CONFIG_SUBDIRS(libltdl)