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/nettle.m4])
25 m4_include([acinclude/pam.m4])
26 m4_include([acinclude/pkg.m4])
27 m4_include([acinclude/tdb.m4])
28 m4_include([acinclude/lib-checks.m4])
29 m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
30 m4_include([acinclude/ax_cxx_0x_types.m4])
32 PRESET_CFLAGS="$CFLAGS"
33 PRESET_CXXFLAGS="$CXXFLAGS"
34 PRESET_LDFLAGS="$LDFLAGS"
36 dnl Set default LDFLAGS
37 AS_IF([test "x$LDFLAGS" = "x"],[LDFLAGS="-g"])
39 # check for host OS detail
41 AC_MSG_CHECKING([simplified host os])
42 simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'`
43 squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
44 AS_IF([test -n "$squid_host_os_version"],[
45 squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`"
47 squid_host_os="$simple_host_os"
49 AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
50 # on windows squid_host_os is either mingw or cygwin, version is 32
56 # AC_USE_SYSTEM_EXTENSIONS should be called before any macros that run the C compiler.
57 AS_IF([test "x$squid_host_os" = "solaris" -a "x$GCC" = "xyes"],[
58 AC_USE_SYSTEM_EXTENSIONS
63 # Clang 3.2 on some CPUs requires -march-native to detect correctly.
64 # GCC 4.3+ can also produce faster executables when its used.
65 # But building inside a virtual machine environment has been found to
66 # cause random Illegal Instruction errors due to mis-detection of CPU.
67 AC_ARG_ENABLE(arch-native,
68 AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific
69 optimizations with the -march=native parameter.
70 This flag disables the optimization. The default is to
71 auto-detect compiler support and use where available.]), [
72 SQUID_YESNO([$enableval],[--enable-arch-native])
74 AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}])
75 AS_IF([test "x${enable_arch_native}" != "xno"],[
76 SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native])
79 # might be cross-compiling.
80 # NP: BUILDCXXFLAGS defined at the end of configure after CXXFLAGS fully known.
81 AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen])
82 AS_IF([test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"],[
83 AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Use BUILDCXX instead.])
86 AS_IF([test "x$BUILDCXX" = "x"],[
88 AS_IF([test "x$squid_cv_check_marchnative" = "xyes"],[
89 CXXFLAGS="$CXXFLAGS -march=native"
94 # If the user did not specify a C++ version.
95 user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "(-)std="`
96 AS_IF([test "x$user_cxx" = "x"],[
97 # Check for C++11 compiler support
98 AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
108 AC_PATH_PROG(SH, sh, /bin/sh)
109 AC_PATH_PROG(FALSE, false, /usr/bin/false)
110 AC_PATH_PROG(TRUE, true, /usr/bin/true)
111 AC_PATH_PROG(MV, mv, $FALSE)
112 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
113 AC_PATH_PROG(LN, ln, cp)
114 AC_PATH_PROG(CHMOD, chmod, $FALSE)
115 AC_PATH_PROG(TR, tr, $FALSE)
116 AC_PATH_PROG(RM, rm, $FALSE)
117 dnl Libtool 2.2.6 requires: rm -f
122 AC_PATH_PROG(PERL, perl, none)
123 AS_IF([test "x$ac_cv_path_PERL" = "xnone"],[
124 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
126 AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
127 AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE")
129 AC_PATH_PROG(AR, ar, $FALSE)
133 AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE)
134 AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE")
136 # pre-define DEFAULT_PREFIX, some modules need it.
137 AS_IF([test "${prefix}" = "NONE"],[squid_prefix=$ac_default_prefix],[squid_prefix=$prefix])
138 AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix])
140 AC_ARG_ENABLE(strict-error-checking,
141 AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
142 with all possible static compiler error-checks enabled.
143 This flag disables the behavior]), [
144 SQUID_YESNO([$enableval],[--enable-strict-error-checking])
146 AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}])
148 # LT_INIT requires libtool v2, might as well state it loud
151 AS_IF([test "x$ac_top_build_prefix" != "x"],[
152 # LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
153 # But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
154 # This fixes Linux LTDLv3-v7, and BSD LTDL v2.2
155 top_build_prefix=${ac_top_build_prefix}
156 AC_SUBST(top_build_prefix)
160 dnl LibTool environment is now prepared for setup. Check that it is usable and initialize.
163 # Do we need these unconditionally for "make distcheck" to work?
167 AC_MSG_CHECKING(whether to use loadable modules)
168 AS_IF([test "x${enable_shared:=yes}" = "xyes"],[AC_DEFINE(USE_LOADABLE_MODULES,1,[Support Loadable Modules])])
169 AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_shared:=yes}" = "xyes")
170 AC_MSG_RESULT([$enable_shared])
172 SQUID_CC_GUESS_VARIANT
173 SQUID_CC_GUESS_OPTIONS
175 dnl find out the exe extension for this platform.
176 dnl If it is not empty, use it for CGI as well.
179 AS_IF([test "x$EXEEXT" = "x"],[CGIEXT=".cgi"],[CGIEXT=""])
182 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"])
183 AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
185 AS_CASE(["$squid_host_os"],
187 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
188 CFLAGS="$CFLAGS -mthreads"
189 CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++"
190 AS_IF([test "x$ac_cv_path_WIN32_PSAPI" = "xnone"],[
191 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
192 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
194 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
197 MINGW_LIBS="-lmingwex"
202 # FreeBSD places local libraries and packages in /usr/local
203 CFLAGS="$CFLAGS -I/usr/local/include"
204 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
205 LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib"
210 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
212 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args",
213 [configure command line used to configure Squid])
215 CACHE_EFFECTIVE_USER="nobody"
216 AC_ARG_WITH(default-user,
217 AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
218 [ CACHE_EFFECTIVE_USER="$withval" ]
220 AC_SUBST(CACHE_EFFECTIVE_USER)
222 DEFAULT_LOG_DIR="$localstatedir/logs"
224 AS_HELP_STRING([--with-logdir=PATH],
225 [Default location for squid logs. default: PREFIX/var/logs]),[
227 [yes|no],[AC_MSG_ERROR([--with-logdir requires a directory PATH. --with-logdir=PATH])],
228 [DEFAULT_LOG_DIR="$withval"]
231 AC_SUBST(DEFAULT_LOG_DIR)
233 DEFAULT_PID_FILE="$localstatedir/run/@SERVICE_NAME@.pid"
235 AS_HELP_STRING([--with-pidfile=PATH],
236 [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]),[
238 [yes|no],[AC_MSG_ERROR([--with-pidfile requires a file PATH. --with-pidfile=PATH])],
239 [DEFAULT_PID_FILE="$withval"]
242 AC_SUBST(DEFAULT_PID_FILE)
244 DEFAULT_SWAP_DIR="$localstatedir/cache/squid"
246 AS_HELP_STRING([--with-swapdir=PATH],
247 [Default location for squid cache directories. Default: PREFIX/var/cache/squid]),[
249 [yes|no],[AC_MSG_ERROR([--with-swapdir requires a directory PATH. --with-swapdir=PATH])],
250 [DEFAULT_SWAP_DIR="$withval"]
253 AC_SUBST(DEFAULT_SWAP_DIR)
255 dnl Set Default CFLAGS
256 AS_IF([test "x$PRESET_CFLAGS" = "x"],[
257 AS_IF([test "$squid_cv_compiler" = "gcc"],[
258 # TODO check if these exceptions are still necessary
261 # sunos has too many warnings for -Wall to be useful
263 [CFLAGS="$squid_cv_cc_option_wall $CFLAGS"]
267 [*mips-sgi-irix6.*],[
268 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
269 CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
270 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
271 -Wl,-woff,85,-woff,84,-woff,134 \
272 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
273 CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
274 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
275 -Wl,-woff,85,-woff,84,-woff,134 \
276 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
281 AC_MSG_CHECKING([compiler name-version])
282 squid_cv_cc_name=`$CC --version | head -1 | cut -f1 -d" "`
283 AS_CASE([$squid_cv_cc_name],
284 [gcc|clang],[squid_cv_cc_majversion=`$CC -dumpversion | cut -f1 -d.`],
285 [squid_cv_cc_majversion="unknown"]
287 squid_cv_cc_simplified="$squid_cv_cc_name-$squid_cv_cc_majversion"
288 AC_MSG_RESULT($squid_cv_cc_simplified)
293 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([$squid_cv_cc_option_wall])
296 AS_IF([test "$squid_cv_cc_simplified" = "gcc-4"],[
297 AC_MSG_NOTICE([skipping -Wextra on $squid_cv_cc_simplified])
299 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wextra])
301 # Now disable or configure certain warnings enabled by -Wextra
303 # -Wunused-private-field causes a huge number of false positives
304 # in unit tests. Disable that
305 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wno-unused-private-field])
307 # ...=2: This flexibility level allows GCC to "understand" our fallthrough
308 # comments. TODO: Switch to [[fallthrough]] attributes with C++17.
309 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wimplicit-fallthrough=2])
310 AS_IF([test "x$squid_cv_cc_arg_wimplicit_fallthrough_2" != "xyes"], [
311 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wno-implicit-fallthrough])
315 # useful warnings that may not be included in -Wall -Wextra
316 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wpointer-arith])
317 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wwrite-strings])
318 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wcomments])
319 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wshadow])
320 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Wmissing-declarations])
321 SQUID_CC_ADD_CXXFLAG_WARNING_IF_SUPPORTED([-Woverloaded-virtual])
323 dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features
324 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]])
326 AS_IF([test "x$enable_strict_error_checking" != "xno"],[
327 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
328 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror"
331 AS_IF([test "x$ac_cv_require_wno_deprecated_register" = "xyes"],[
332 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register"
335 # squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS
336 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
337 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
339 # possibly include some build info tag into squid -v
340 SQUID_EMBED_BUILD_INFO
342 AC_ARG_ENABLE(optimizations,
343 AS_HELP_STRING([--disable-optimizations],
344 [Do not compile Squid with compiler optimizations enabled.
345 Optimization is good for production builds, but not
346 good for debugging. During development, use
347 --disable-optimizations to reduce compilation times
348 and allow easier debugging.]), [
349 AS_IF([test "x$enableval" = "xno"],[
350 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
351 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`"
352 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9g]]*//'`"
356 AC_ARG_ENABLE(debug-cbdata,
357 AS_HELP_STRING([--enable-debug-cbdata],
358 [Provide some debug information in cbdata]), [
359 SQUID_YESNO([$enableval],[--enable-debug-cbdata])
361 SQUID_DEFINE_BOOL(USE_CBDATA_DEBUG,${enable_debug_cbdata:=no},
362 [Enable support for cbdata debug information])
363 AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata])
366 dnl Nasty hack to get autoconf 2.64 on Linux to run.
367 dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
368 AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:])
370 AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics])
371 AC_ARG_ENABLE(xmalloc-statistics,
372 AS_HELP_STRING([--enable-xmalloc-statistics],
373 [Show malloc statistics in status page]), [
374 SQUID_YESNO([$enableval],[--enable-xmalloc-statistics])
376 SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no},
377 [Show malloc statistics in status page])
378 AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics])
380 squid_opt_aufs_threads=""
381 AC_ARG_WITH(aufs-threads,
382 AS_HELP_STRING([--with-aufs-threads=N_THREADS],
383 [Tune the number of worker threads for the aufs object store.]), [
385 [[[0-9]]*],[squid_opt_aufs_threads=$withval],
386 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
389 AS_IF([test "x$squid_opt_aufs_threads" != "x"],[
390 AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads])
391 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads,
392 [Defines how many threads aufs uses for I/O])
395 ## TODO check if this is necessary, LT_INIT does these checks
396 SQUID_AUTO_LIB(dl,[dynamic linking],[LIBDL])
397 AS_IF([test "x$with_dl" != "xno"],[
398 CXXFLAGS="$LIBDL_CFLAGS $CXXFLAGS"
399 LDFLAGS="$LIBDL_PATH $LDFLAGS"
400 AC_CHECK_LIB(dl, dlopen)
403 AC_DEFUN([LIBATOMIC_CHECKER],[
404 AC_MSG_CHECKING(whether linking $1 -latomic works)
410 main(int argc, char **) {
412 std::atomic<uint8_t>(uint8_t(argc)).exchange(0) &&
413 std::atomic<uint64_t>{}.is_lock_free()
418 libatomic_checker_result="yes"],[
420 libatomic_checker_result="no"
423 ## check for atomics library before anything that might need it
424 SQUID_STATE_SAVE(LIBATOMIC)
425 LIBATOMIC_CHECKER(without)
426 AS_IF([test "x$libatomic_checker_result" = "xno"],[
427 LIBS="$LIBS -latomic"
428 LIBATOMIC_CHECKER(with)
429 AS_IF([test "x$libatomic_checker_result" = "xyes"],[
430 ATOMICLIB="-latomic"],[
431 AC_MSG_ERROR([Required library libatomic not found.])
433 SQUID_STATE_ROLLBACK(LIBATOMIC)
436 AC_SEARCH_LIBS([shm_open], [rt])
437 AS_IF([test "x$ac_cv_search_shm_open" != "xno"],[
438 AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
441 squid_disk_module_candidates=
442 AC_ARG_ENABLE(disk-io,
443 AS_HELP_STRING([--enable-disk-io="list of modules"],
444 [Build support for the list of disk I/O modules.
445 Set without a value or omitted, all available modules will be built.
446 See src/DiskIO for a list of available modules, or
447 Programmers Guide section on DiskIO
448 for details on how to build your custom disk module]),
449 AS_CASE(["$enableval"],
451 [no|none],[enable_disk_io="no"],
454 squid_disk_module_candidates="$enableval"
457 AS_IF([test "x${enable_disk_io:=yes}" = "xyes"],[
458 SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
459 AS_IF([test "x$ac_cv_search_shm_open" = "xno"],[
460 squid_disk_module_candidates=`echo "$squid_disk_module_candidates" | sed 's/IpcIo//g'`
463 SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
464 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
465 AC_MSG_NOTICE([DiskIO modules built: ${squid_disk_module_candidates:-none}])
466 SQUID_DEFINE_BOOL(USE_DISKIO,$enable_disk_io,[DiskIO modules are expected to be available.])
468 dnl Some autoconf.h defines we might enable later...
469 AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
470 AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
473 squid_opt_use_diskthreads=
476 dnl Setup the module paths etc.
479 AH_TEMPLATE(HAVE_DISKIO_MODULE_AIO, [Whether POSIX AIO Disk I/O module is built])
480 AH_TEMPLATE(HAVE_DISKIO_MODULE_BLOCKING, [Whether Blocking Disk I/O module is built])
481 AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKDAEMON, [Whether DiskDaemon Disk I/O module is built])
482 AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKTHREADS, [Whether DiskThreads Disk I/O module is built])
483 AH_TEMPLATE(HAVE_DISKIO_MODULE_IPCIO, [Whether IpcIo Disk I/O module is built])
484 AH_TEMPLATE(HAVE_DISKIO_MODULE_MMAPPED, [Whether Mmapped Disk I/O module is built])
485 for module in $squid_disk_module_candidates none; do
487 AS_IF([test "x$module" = "xnone"],[continue])
488 AS_IF([! test -d "$srcdir/src/DiskIO/$module"],[AC_MSG_ERROR([disk-io $module does not exist])])
491 dnl Check for POSIX AIO availability
492 squid_opt_use_aio="yes"
494 AS_IF([test "x$with_aio" != "xno"],[
496 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
497 dnl On some systems POSIX AIO functions are in librt
498 dnl On some systems POSIX AIO functions are in libaio
499 AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
500 dnl Enable AIO if the library and headers are found
501 AS_IF([test "x$AIOLIB" != "x" -a "x$have_aio_header" = "xyes"],[
502 AC_MSG_NOTICE([Native POSIX AIO support detected.])
503 squid_opt_use_aio="yes"
505 dnl Windows does things differently. We provide wrappers.
506 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
507 AS_IF([test "$squid_host_os" = "mingw"],[
508 squid_opt_use_aio="yes"
509 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
511 squid_opt_use_aio="no"
512 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
516 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
517 squid_opt_use_aio="no"
519 dnl Use the POSIX AIO pieces if we actually need them.
520 AS_IF([test "x$squid_opt_use_aio" = "xyes"],[
521 DISK_MODULES="$DISK_MODULES AIO"
522 AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built])
523 AS_IF([test "$squid_host_os" = "mingw"],[
525 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
527 AC_MSG_NOTICE([Enabling AIO DiskIO module])
530 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
531 squid_disk_module_candidates_AIO=no
536 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
537 DISK_MODULES="$DISK_MODULES Blocking"
538 AC_DEFINE([HAVE_DISKIO_MODULE_BLOCKING],1,[Blocking Disk I/O module is built])
542 AS_IF([test "$squid_host_os" = "mingw"],[
543 AC_MSG_NOTICE([DiskDaemon not supported on MinGW])
544 squid_disk_module_candidates_DiskDaemon=no
546 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
547 DISK_MODULES="$DISK_MODULES DiskDaemon"
548 AC_DEFINE([HAVE_DISKIO_MODULE_DISKDAEMON],1,[DiskDaemon Disk I/O module is built])
553 squid_opt_use_diskthreads="yes"
555 SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
556 AS_IF([test "x$with_pthreads" != "xno"],[
557 dnl TODO: this needs to be extended to handle more systems and better
558 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
559 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
560 AS_CASE(["$squid_host_os"],
563 AC_MSG_NOTICE([Windows threads support automatically enabled])
567 AS_IF([test `echo "$squid_host_os_version" | tr -d .` -lt 70],[
568 AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later)
569 squid_opt_use_diskthreads="no"
571 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
572 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
573 AS_IF([test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x"],[LDFLAGS="$LDFLAGS -pthread"])
578 AS_IF([test `echo "$squid_host_os_version" | tr -d .` -lt 52],[
579 AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later)
580 squid_opt_use_diskthreads="no"
582 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
583 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
584 LDFLAGS="$LDFLAGS -lpthread"
589 AS_IF([test "x$GCC" = "xyes"],[
590 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
591 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
592 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
593 AC_MSG_NOTICE(pthread library required but cannot be found.)
594 squid_opt_use_diskthreads="no"
597 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
598 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
599 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
600 AC_SEARCH_LIBS([pthread_create],[pthread thread],[
601 LIBPTHREADS="" #in LIBS
603 AC_MSG_NOTICE(pthread library required but cannot be found.)
604 squid_opt_use_diskthreads="no"
610 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
611 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
612 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
613 AC_MSG_NOTICE(pthread library required but cannot be found.)
614 squid_opt_use_diskthreads="no"
619 AC_MSG_NOTICE([Native pthreads support manually disabled.])
620 squid_opt_use_diskthreads="no"
622 AS_IF([test "x$squid_opt_use_diskthreads" = "xyes"],[
623 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
624 DISK_MODULES="$DISK_MODULES DiskThreads"
625 AC_DEFINE([HAVE_DISKIO_MODULE_DISKTHREADS],1,[DiskThreads Disk I/O module is built])
627 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
628 SQUID_STATE_ROLLBACK([diskthreads_state])
629 squid_disk_module_candidates_DiskThreads=no
634 AS_IF([test "x$ac_cv_search_shm_open" = "xno"],[
635 AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support])
636 squid_disk_module_candidates_IpcIo=no
638 AC_MSG_NOTICE([Enabling IpcIo DiskIO module])
639 DISK_MODULES="$DISK_MODULES IpcIo"
640 AC_DEFINE([HAVE_DISKIO_MODULE_IPCIO],1,[IpcIo Disk I/O module is built])
645 dnl TODO: use availability of sys/mman.h and/or mmap to define
646 dnl OR support windows mmap functions
647 AS_IF([test "x$squid_host_os" = "xmingw"],[
648 AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw])
649 squid_disk_module_candidates_Mmapped=no
651 AC_MSG_NOTICE([Enabling Mmapped DiskIO module])
652 DISK_MODULES="$DISK_MODULES Mmapped"
653 AC_DEFINE([HAVE_DISKIO_MODULE_MMAPPED],1,[Mmapped Disk I/O module is built])
658 AC_MSG_NOTICE([Enabling $module DiskIO module])
659 DISK_LIBS="$DISK_LIBS lib${module}.la"
660 DISK_MODULES="$DISK_MODULES ${module}"
663 AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
664 AC_SUBST(DISK_MODULES)
666 AM_CONDITIONAL(ENABLE_DISKIO_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes")
668 AM_CONDITIONAL(ENABLE_WIN32_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1")
669 AM_CONDITIONAL(ENABLE_DISKIO_BLOCKING, test "x$squid_disk_module_candidates_Blocking" = "xyes")
670 AM_CONDITIONAL(ENABLE_DISKIO_DISKDAEMON, test "x$squid_disk_module_candidates_DiskDaemon" = "xyes")
671 AM_CONDITIONAL(ENABLE_DISKIO_DISKTHREADS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes")
672 AC_SUBST(LIBPTHREADS)
673 AM_CONDITIONAL(ENABLE_WIN32_AIOPS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1")
674 AM_CONDITIONAL(ENABLE_DISKIO_IPCIO, test "x$squid_disk_module_candidates_IpcIo" = "xyes")
675 AM_CONDITIONAL(ENABLE_DISKIO_MMAPPED, test "x$squid_disk_module_candidates_Mmapped" = "xyes")
677 dnl Check what Storage formats are wanted.
678 dnl This version will error out with a message saying why if a required DiskIO is missing.
679 AC_ARG_ENABLE([storeio],
680 AS_HELP_STRING([--enable-storeio="list of modules"],
681 [Build support for the list of store I/O modules.
682 The default is only to build the "ufs" module.
683 See src/fs for a list of available modules, or
684 Programmers Guide section <not yet written>
685 for details on how to build your custom store module]), [
686 AS_CASE(["$enableval"],
688 [no|none],[enable_storeio="no"],
691 # ufs is really always needed as it has low-level routines
692 # if it is a dupe it will be cleaned-up later
693 squid_storeio_module_candidates="$enableval ufs"
696 AS_IF([test "x${enable_storeio:=yes}" = "xyes"],[
697 SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
699 SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates])
700 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
701 AC_MSG_NOTICE([Store modules built: ${squid_storeio_module_candidates:-none}])
703 for fs in ${squid_storeio_module_candidates:-none}; do
706 AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
707 "x$squid_disk_module_candidates_DiskDaemon" != "xyes"],[
708 AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon])
712 AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
713 "x$squid_disk_module_candidates_DiskThreads" != "xyes"],[
714 AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads])
718 AS_IF([test "x$squid_disk_module_candidates_IpcIo" != "xyes" -a \
719 "x$squid_disk_module_candidates_Blocking" != "xyes"],[
720 AC_MSG_ERROR([Storage module Rock requires DiskIO module: Blocking or IpcIo])
722 squid_do_build_rock=true
725 AS_IF([test "x$squid_disk_module_candidates_Blocking" != "xyes"],[
726 AC_MSG_ERROR([Storage module ufs requires DiskIO module: Blocking])
728 squid_do_build_ufs=true
733 AM_CONDITIONAL(ENABLE_FS_UFS, test "x$squid_do_build_ufs" = "xtrue")
734 AM_CONDITIONAL(ENABLE_FS_ROCK, test "x$squid_do_build_rock" = "xtrue")
735 dnl hack: need to define those even if not used in the build system to
736 dnl make sure that global FS objects are linked to the squid binary.
737 AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
738 AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
739 AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
740 AH_TEMPLATE(HAVE_FS_ROCK, "Define to 1 if rock filesystem module is build")
743 dnl got final squid_storeio_module_candidates, build library lists
744 dnl This list will not be needed when each fs library has its own Makefile
746 dnl File system libraries to link executables with.
747 dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
749 for fs in $squid_storeio_module_candidates; do
750 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
751 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
752 SQUID_TOUPPER_VAR_CONTENTS([fs])
753 AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1)
756 AC_SUBST(STORE_LIBS_TO_BUILD)
757 AC_SUBST(STORE_LIBS_TO_ADD)
758 AC_SUBST(STORE_TESTS)
761 dnl At lest one removal policy is always needed.
762 dnl 'lru' removal policy is currently hard-coded by name for tests
763 dnl so we must set it as default.
765 AC_ARG_ENABLE(removal-policies,
766 AS_HELP_STRING([--enable-removal-policies="list of policies"],
767 [Build support for the list of removal policies.
768 The default is only to build the "lru" module.
769 See src/repl for a list of available modules, or
770 Programmers Guide section 9.9 for details on how
771 to build your custom policy]), [
772 AS_CASE(["$enableval"],
773 [yes],[ SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES]) ],
775 [ REPL_POLICIES="$enableval" ]
778 SQUID_CLEANUP_MODULES_LIST([REPL_POLICIES])
779 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES])
780 AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES])
781 REPL_OBJS="repl/lib`echo \"$REPL_POLICIES\" | sed -e 's% %.a repl/lib%g'`.a"
782 REPL_LIBS=`echo "$REPL_OBJS" | sed -e 's%repl/%%g'`
783 AC_SUBST(REPL_POLICIES)
787 AM_CONDITIONAL(ENABLE_PINGER, false)
789 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),[
790 AS_IF([test "x$enableval" = "xyes"],[
791 AC_MSG_NOTICE([ICMP enabled])
792 AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)])
793 AM_CONDITIONAL(ENABLE_PINGER, true)
797 AM_CONDITIONAL(ENABLE_DELAY_POOLS, false)
798 AC_ARG_ENABLE(delay-pools,
799 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),[
800 AS_IF([test "x$enableval" = "xyes"],[
801 AC_MSG_NOTICE([Delay pools enabled])
802 AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".])
803 AM_CONDITIONAL(ENABLE_DELAY_POOLS, true)
807 dnl disable generic/common adaptation support by default
808 squid_opt_use_adaptation=no
810 squid_opt_use_esi=auto
811 AH_TEMPLATE([USE_SQUID_ESI],[Define to enable the ESI processor])
813 AS_HELP_STRING([--disable-esi],
814 [Disable ESI for accelerators. ESI requires expat or xml2 library.
815 Enabling ESI will cause squid reverse proxies to be capable
816 of the Edge Acceleration Specification (www.esi.org).]),
817 [squid_opt_use_esi=$enableval],[])
819 # ESI support libraries: expat
820 AH_TEMPLATE(HAVE_LIBEXPAT,[Define to 1 if you have the expat library])
821 SQUID_AUTO_LIB(expat,[ESI expat library],[LIBEXPAT])
822 AS_IF([test "x$squid_opt_use_esi" != "xno" -a "x$with_expat" != "xno"],[
823 SQUID_STATE_SAVE(squid_expat_state)
824 PKG_CHECK_MODULES([LIBEXPAT],[expat],[],[
825 AC_CHECK_LIB([expat],[main],[LIBEXPAT_LIBS="-lexpat"])
827 CPPFLAGS="$LIBEXPAT_CFLAGS $CPPFLAGS"
828 AC_CHECK_HEADERS(expat.h)
829 SQUID_STATE_ROLLBACK(squid_expat_state)
830 AS_IF([test "x$LIBEXPAT_LIBS" != "x"],[
831 squid_opt_use_esi=yes
832 LIBEXPAT_LIBS="$LIBEXPAT_PATH $LIBEXPAT_LIBS"
833 AC_DEFINE(HAVE_LIBEXPAT,1,[Define to 1 if you have the expat library])
835 [test "x$with_expat" = "xyes"],[AC_MSG_ERROR([Required library expat not found.])],
836 [AC_MSG_NOTICE([Library expat not found.])]
839 AM_CONDITIONAL(ENABLE_LIBEXPAT,[test "x$LIBEXPAT_LIBS" != "x"])
840 AC_SUBST(LIBEXPAT_LIBS)
842 # ESI support libraries: xml2
843 AH_TEMPLATE(HAVE_LIBXML2,[Define to 1 if you have the xml2 library])
844 SQUID_AUTO_LIB(xml2,[ESI xml2 library],[LIBXML2])
845 AS_IF([test "x$squid_opt_use_esi" != "xno" -a "x$with_xml2" != "xno"],[
846 SQUID_STATE_SAVE([squid_libxml2_save])
847 PKG_CHECK_MODULES([LIBXML2],[libxml-2.0],[],[
848 AC_CHECK_LIB([xml2],[main],[LIBXML2_LIBS="$LIBXML2_PATH -lxml2"])
850 CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS"
851 AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h)
852 SQUID_STATE_ROLLBACK([squid_libxml2_save])
854 AS_IF([test "x$LIBXML2_LIBS" != "x"],[
855 squid_opt_use_esi=yes
856 CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS"
857 LIBXML2_LIBS="$LIBXML2_PATH $LIBXML2_LIBS"
858 AC_DEFINE(HAVE_LIBXML2,1,[Define to 1 if you have the xml2 library])
859 ],[test "x$with_xml2" = "xyes"],[
860 AC_MSG_ERROR([Required library xml2 not found])
862 AC_MSG_NOTICE([Library xml2 not found.])
865 AM_CONDITIONAL(ENABLE_LIBXML2,[test "x$LIBXML2_LIBS" != "x"])
866 AC_SUBST(LIBXML2_LIBS)
868 AS_IF([test "x$squid_opt_use_esi" = "xyes"],[
869 AS_IF([test "x$LIBXML2_LIBS" = "x" -a "x$LIBEXPAT_LIBS" = "x"],[
870 AC_MSG_ERROR([ESI processor requires libxml2 or libexpat])
872 AC_MSG_NOTICE([Enabling ESI processor: $LIBEXPAT_LIBS $LIBXML2_LIBS])
873 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor])
875 AS_IF(test "x$squid_opt_use_esi" = "xno",[
876 AC_MSG_NOTICE([Disabling ESI processor.])
878 AC_MSG_NOTICE([Disabling ESI processor. libxml2 and libexpat not found.])
881 AM_CONDITIONAL(ENABLE_ESI, test "x$squid_opt_use_esi" = "xyes")
883 AC_ARG_ENABLE(icap-client,
884 AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[
885 SQUID_YESNO([$enableval],[--enable-icap-client])
887 SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid])
888 AS_IF(test "x$enable_icap_client" != "xno", squid_opt_use_adaptation="yes")
889 AM_CONDITIONAL(ENABLE_ICAP_CLIENT, test "x$enable_icap_client" != "xno")
892 AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]),[
893 SQUID_YESNO([$enableval],[--enable-ecap])],[
896 dnl Perform configuration consistency checks for eCAP
897 AS_IF([test "x$enable_ecap" != "xno"],[
898 AS_IF([test "x$enable_shared" != "xyes"],[
899 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-shared with --enable-ecap.])
902 AS_IF([test -n "$PKG_CONFIG"],[
903 dnl eCAP support requires libecap.
904 dnl This Squid supports libecap v1.0.x.
905 dnl Use EXT_ prefix to distinguish external libecap (that we check for
906 dnl here) from our own convenience ecap library in Makefiles.
907 PKG_CHECK_MODULES([EXT_LIBECAP],[libecap >= 1.0 libecap < 1.1])
909 AC_MSG_NOTICE([eCAP support requires pkg-config to verify the correct library version. Trouble may follow.])
912 SQUID_STATE_SAVE(squid_ecap_state)
913 AC_MSG_CHECKING([whether -lecap will link])
914 CXXFLAGS="$CXXFLAGS $EXT_LIBECAP_CFLAGS"
915 LIBS="$LIBS $EXT_LIBECAP_LIBS"
916 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libecap/common/names.h>]],[[
917 const libecap::Name test("test", libecap::Name::NextId());
920 squid_opt_use_adaptation=yes
923 AS_IF([test "x$enable_ecap" = "xyes"],[
924 AC_MSG_ERROR([eCAP library will not link.
925 You may need to rebuild libecap using the same version of GCC as Squid.
926 There have been breaking ABI changes in the libstdc++ STL with GCC 5.])
928 AC_MSG_NOTICE([eCAP library will not link.
929 You may need to rebuild libecap using the same version of GCC as Squid.
930 There have been breaking ABI changes in the libstdc++ STL with GCC 5.])
934 SQUID_STATE_ROLLBACK(squid_ecap_state)
936 SQUID_DEFINE_BOOL(USE_ECAP,${enable_ecap:=no},[Whether to use eCAP support])
937 AM_CONDITIONAL(ENABLE_ECAP, test "x$enable_ecap" = "xyes")
939 dnl enable adaptation if requested by specific adaptation mechanisms
941 AS_IF([test "x$squid_opt_use_adaptation" = "xyes"],[ADAPTATION_LIBS="adaptation/libadaptation.la"])
942 SQUID_DEFINE_BOOL(USE_ADAPTATION,${squid_opt_use_adaptation:=no}, [common adaptation support])
943 AM_CONDITIONAL(ENABLE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes")
944 AC_SUBST(ADAPTATION_LIBS)
946 AS_IF([test "x$squid_host_os" = "xmingw"],[enable_wccp=no])
948 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]),[
949 SQUID_YESNO([$enableval],[--enable-wccp])
951 SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP])
952 AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp])
954 AS_IF([test "x$squid_host_os" = "xmingw"],[enable_wccpv2=no])
955 AC_ARG_ENABLE(wccpv2,
956 AS_HELP_STRING([--disable-wccpv2],
957 [Disable Web Cache Coordination V2 Protocol]), [
958 SQUID_YESNO([$enableval],[--enable-wccpv2])
960 SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes},
961 [Define to enable WCCP V2])
962 AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2])
964 AC_ARG_ENABLE(kill-parent-hack,
965 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [
966 SQUID_YESNO([$enableval],[--enable-kill-parent-hack])
968 SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no},
969 [A dangerous feature which causes Squid to kill its parent
970 process (presumably the RunCache script) upon receipt
971 of SIGTERM or SIGINT. Deprecated, Use with caution.])
972 AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack])
975 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
976 SQUID_YESNO([$enableval],[--enable-snmp])
978 SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes},
979 [Define to enable SNMP monitoring of Squid])
980 AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"])
981 AS_IF([test "x$enable_snmp" = "xyes"],[SNMPLIB="../lib/snmplib/libsnmplib.la"])
982 AC_MSG_NOTICE([SNMP support enabled: $enable_snmp])
985 AC_ARG_ENABLE(cachemgr-hostname,
986 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],
987 [Make cachemgr.cgi default to this host.
988 If unspecified, uses the name of the build-host]), [
989 AS_CASE([$enableval],
991 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
992 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
993 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
997 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
998 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1003 AS_HELP_STRING([--disable-eui],
1004 [Disable use of ARP / MAC/ EUI (ether address)]), [
1005 SQUID_YESNO([$enableval],[--enable-eui])
1007 AS_IF([test "x${enable_eui:=yes}" = "xyes"],[
1008 SQUID_STATE_SAVE(LIBEUI)
1009 # GLIBC 2.30 deprecates sysctl.h. Test with the same flags that (may) break includes later.
1010 CFLAGS=$SQUID_CFLAGS
1011 CXXFLAGS=$SQUID_CXXFLAGS
1012 AS_CASE(["$squid_host_os"],
1013 [linux|solaris|freebsd|openbsd|netbsd|cygwin],[:],
1014 [mingw],[EUILIB="-liphlpapi"],
1015 [AC_MSG_WARN([EUI support probably will not work on host $host.])]
1017 # iphlpapi.h check delayed after winsock2.h
1032 #include <sys/types.h>
1033 #include <sys/socket.h>
1036 # OpenBSD, FreeBSD and NetBSD requires sys/param.h to be included before sysctl.h and net/if_dl.h
1041 #if HAVE_SYS_PARAM_H
1042 #include <sys/param.h>
1045 SQUID_STATE_ROLLBACK(LIBEUI)
1048 AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui])
1049 SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui,
1050 [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.])
1051 AM_CONDITIONAL(ENABLE_EUI, [test "x$enable_eui" = "xyes" ])
1055 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [
1056 SQUID_YESNO([$enableval],[--enable-htcp])
1058 SQUID_DEFINE_BOOL(USE_HTCP,${enable_htcp:=yes},
1059 [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1060 AM_CONDITIONAL(ENABLE_HTCP, [test "x$enable_htcp" = "xyes"])
1061 AC_MSG_NOTICE([HTCP support enabled: $enable_htcp])
1063 # Cryptograhic libraries
1064 SQUID_AUTO_LIB(nettle,[Nettle crypto],[LIBNETTLE])
1065 AS_IF(test "x$with_nettle" != "xno"],[
1066 SQUID_STATE_SAVE(squid_nettle_state)
1067 PKG_CHECK_MODULES([LIBNETTLE],[nettle >= 3.4],[],[
1068 CPPFLAGS="$LIBNETTLE_CFLAGS $CPPFLAGS"
1069 AC_CHECK_LIB(nettle,[nettle_md5_init],[LIBNETTLE_LIBS="-lnettle"])
1071 AC_CHECK_HEADERS(nettle/base64.h nettle/md5.h)
1072 SQUID_CHECK_NETTLE_BASE64
1073 SQUID_STATE_ROLLBACK(squid_nettle_state)
1074 AS_IF([test "x$LIBNETTLE_LIBS" != "x"],[
1075 CXXFLAGS="$LIBNETTLE_CFLAGS $CXXFLAGS"
1076 LIBNETTLE_LIBS="$LIBNETTLE_PATH $LIBNETTLE_LIBS"
1077 ],[test "x$with_nettle" = "xyes"],[
1078 AC_MSG_ERROR([Required library nettle not found])
1080 AC_MSG_NOTICE([Library nettle not found.])
1083 AC_MSG_NOTICE([Using Nettle cryptographic library: ${with_nettle:=yes}])
1084 AC_SUBST(LIBNETTLE_LIBS)
1086 dnl Check for libcrypt
1088 dnl Some of our helpers use crypt(3) which may be in libc, or in
1089 dnl libcrypt (eg FreeBSD)
1090 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1091 dnl Solaris10 provides MD5 natively through libmd5
1092 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
1097 SQUID_AUTO_LIB(gnutls,[GnuTLS crypto],[LIBGNUTLS])
1098 AH_TEMPLATE(USE_GNUTLS,[GnuTLS support is available])
1099 AS_IF([test "x$with_gnutls" != "xno"],[
1100 SQUID_STATE_SAVE(squid_gnutls_state)
1102 # User may have provided a custom location for GnuTLS. Otherwise...
1103 CPPFLAGS="$LIBGNUTLS_CFLAGS $CPPFLAGS"
1104 LIBS="$LIBS $LIBGNUTLS_PATH"
1106 # auto-detect using pkg-config
1107 PKG_CHECK_MODULES([LIBGNUTLS],[gnutls >= 3.4.0],[
1108 CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
1110 ## find the package without pkg-config
1111 ## check that the library is actually new enough.
1112 ## by testing for a 3.4.0+ function which we use
1113 AC_CHECK_LIB(gnutls,gnutls_pcert_export_x509,[LIBGNUTLS_LIBS="-lgnutls"])
1115 AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/x509.h gnutls/abstract.h)
1117 SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS
1119 AS_IF([test "x$with_gnutls" = "xyes" -a "x$LIBGNUTLS_LIBS" = "x"],[
1120 AC_MSG_ERROR([Required GnuTLS library not found])
1122 AS_IF([test "x$LIBGNUTLS_LIBS" != "x"],[
1123 CXXFLAGS="$LIBGNUTLS_CFLAGS $CXXFLAGS"
1124 SSLLIB="$LIBGNUTLS_PATH $LIBGNUTLS_LIBS $SSLLIB"
1125 AC_DEFINE(USE_GNUTLS,1,[GnuTLS support is available])
1130 AC_MSG_NOTICE([GnuTLS library support: ${with_gnutls:=auto} ${LIBGNUTLS_PATH} ${LIBGNUTLS_LIBS}])
1132 dnl User may specify OpenSSL is needed from a non-standard location
1133 SQUID_OPTIONAL_LIB(openssl,[OpenSSL],[LIBOPENSSL])
1134 AH_TEMPLATE(USE_OPENSSL,[OpenSSL support is available])
1135 ## OpenSSL is default disable due to licensing issues on some OS
1136 AS_IF([test "x$with_openssl" = "xyes"],[
1137 CPPFLAGS="$LIBOPENSSL_CFLAGS $CPPFLAGS"
1149 openssl/opensslv.h \
1158 # User may have provided a custom location for OpenSSL. Otherwise...
1159 SQUID_STATE_SAVE(squid_openssl_state)
1160 LIBS="$LIBS $LIBOPENSSL_PATH"
1162 # auto-detect using pkg-config
1163 PKG_CHECK_MODULES([LIBOPENSSL],[openssl],,[
1164 ## For some OS pkg-config is broken or unavailable.
1165 ## Detect libraries the hard way.
1167 # Windows MinGW has some special libraries ...
1168 AS_IF([test "x$squid_host_os" = "xmingw"],[
1169 LIBOPENSSL_LIBS='-lssleay32 -leay32 -lgdi32 $LIBOPENSSL_LIBS'
1170 AC_MSG_NOTICE([Windows OpenSSL library support: yes -lssleay32 -leay32 -lgdi32])
1173 AC_CHECK_LIB(crypto,[CRYPTO_new_ex_data],[LIBOPENSSL_LIBS="-lcrypto $LIBOPENSSL_LIBS"],[
1174 AC_MSG_ERROR([library 'crypto' is required for OpenSSL])
1176 AC_CHECK_LIB(ssl,[SSL_CTX_new],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[
1177 AC_MSG_ERROR([library 'ssl' is required for OpenSSL])
1181 # This is a workaround for RedHat 9 brain damage..
1182 AS_IF([test -d /usr/kerberos/include -a -f /usr/include/openssl/kssl.h],[
1183 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1184 LIBOPENSSL_LIBS="-L/usr/kerberos/lib $LIBOPENSSL_LIBS"
1185 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1187 SQUID_STATE_ROLLBACK(squid_openssl_state) #de-pollute LIBS
1189 AS_IF([test "x$LIBOPENSSL_LIBS" != "x"],[
1190 CXXFLAGS="$LIBOPENSSL_CFLAGS $CXXFLAGS"
1191 SSLLIB="$LIBOPENSSL_PATH $LIBOPENSSL_LIBS $SSLLIB"
1192 AC_DEFINE(USE_OPENSSL,1,[OpenSSL support is available])
1194 # check for API functions
1195 SQUID_CHECK_LIBCRYPTO_API
1196 SQUID_CHECK_LIBSSL_API
1197 SQUID_CHECK_OPENSSL_TLS_METHODS
1198 SQUID_STATE_SAVE(check_SSL_CTX_get0_certificate)
1199 LIBS="$LIBS $SSLLIB"
1200 AC_CHECK_LIB(ssl, SSL_CTX_get0_certificate, [
1201 AC_DEFINE(HAVE_SSL_CTX_GET0_CERTIFICATE, 1, [SSL_CTX_get0_certificate is available])
1203 missing_SSL_CTX_get0_certificate=yes
1205 SQUID_STATE_ROLLBACK(check_SSL_CTX_get0_certificate)
1207 # check for other specific broken implementations
1208 AS_IF([test "x$missing_SSL_CTX_get0_certificate" = "xyes"],SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS)
1209 SQUID_CHECK_OPENSSL_CONST_SSL_METHOD
1210 SQUID_CHECK_OPENSSL_CONST_CRYPTO_EX_DATA
1211 SQUID_CHECK_OPENSSL_CONST_SSL_SESSION_CB_ARG
1212 SQUID_CHECK_OPENSSL_CONST_X509_GET0_SIGNATURE_ARGS
1213 SQUID_CHECK_OPENSSL_TXTDB
1215 AS_IF([test "x$SSLLIB" = "x"],[AC_MSG_ERROR([Required OpenSSL library not found])])
1217 AC_MSG_NOTICE([OpenSSL library support: ${with_openssl:=no} ${LIBOPENSSL_PATH} ${LIBOPENSSL_LIBS}])
1218 AM_CONDITIONAL(ENABLE_SSL,[ test "x$with_openssl" = "xyes" ])
1221 dnl User may specify MIT Kerberos is needed from a non-standard location
1222 SQUID_AUTO_LIB(mit-krb5,[MIT Kerberos],[LIB_KRB5])
1223 AH_TEMPLATE(USE_APPLE_KRB5,[Apple Kerberos support is available])
1224 AH_TEMPLATE(USE_MIT_KRB5,[MIT Kerberos support is available])
1225 AH_TEMPLATE(USE_SOLARIS_KRB5,[Solaris Kerberos support is available])
1227 ## find out if pkg-config or krb5-config will work
1228 AS_IF([test "x$with_mit_krb5" != "xno"],[
1229 CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS"
1230 krb5confpath="$with_mit_krb5/bin"
1231 # find installed libs via pkg-config or krb5-config
1233 PKG_CHECK_EXISTS(mit-krb5-gssapi mit-krb5, [squid_pc_krb5_name="mit-krb5-gssapi mit-krb5"],[
1234 PKG_CHECK_EXISTS(gssapi-krb5 krb5, [squid_pc_krb5_name="gssapi-krb5 krb5"])
1236 AS_IF([test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"],[
1237 # Look for krb5-config (unless cross-compiling)
1238 AC_PATH_PROG(krb5_config,krb5-config,no,$krb5confpath)
1239 AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[
1240 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1241 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1242 ac_solaris="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i solaris`"
1243 ac_apple="`$ac_cv_path_krb5_config --vendor 2>/dev/null | grep -c -i apple`"
1244 AS_IF([test $ac_solaris -gt 0],[with_solaris_krb5=yes],
1245 [test $ac_apple -gt 0],[with_apple_krb5=yes],
1246 [test $ac_heimdal -gt 0],[with_mit_krb5=no]
1249 AS_IF([test "x$with_mit_krb5" = "xyes"],[
1250 AC_MSG_ERROR([Could not find krb5-config in path])
1258 # detect MIT Kerberos dependencies (except on Solaris)
1259 AS_IF([test "x$with_mit_krb5" != "xno" -a "x$with_solaris_krb5" != "xyes"],[
1260 SQUID_STATE_SAVE([squid_krb5_save])
1261 LIBS="$LIBS $LIB_KRB5_PATH"
1263 # auto-detect using pkg-config
1264 PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[
1265 # look for krb5-config (unless cross-compiling)
1266 AS_IF([test "$cross_compiling" = "no"],[
1267 AS_IF([test "x$krb5confpath" = "x"],[
1268 AC_PATH_PROG(krb5_config,krb5-config,no)
1269 AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[ac_krb5_config="$ac_cv_path_krb5_config"])
1271 ac_krb5_config="$krb5confpath/krb5-config"
1274 AS_IF([test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"],[
1276 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1277 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1278 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1279 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1280 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1282 ## For some OS pkg-config is broken or unavailable.
1283 ## Detect libraries the hard way.
1285 SQUID_STATE_SAVE([squid_mit_save])
1287 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1288 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
1289 AC_MSG_WARN([library 'com_err' is required for MIT Kerberos])
1290 missing_required=yes
1293 AC_CHECK_LIB(k5crypto, [main], [LIB_KRB5_LIBS="-lk5crypto $LIB_KRB5_LIBS"],[
1294 AC_MSG_WARN([library 'k5crypto' is required for MIT Kerberos])
1295 missing_required=yes
1298 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1299 AC_MSG_WARN([library 'krb5' is required for MIT Kerberos])
1300 missing_required=yes
1303 AC_CHECK_LIB(gssapi_krb5, [main], [LIB_KRB5_LIBS="-lgssapi_krb5 $LIB_KRB5_LIBS"],[
1304 AC_MSG_WARN([library 'gssapi_krb5' is required for MIT Kerberos])
1305 missing_required=yes
1307 SQUID_STATE_ROLLBACK([squid_mit_save])
1308 AS_IF([test "x$missing_required" = "xyes"],[LIB_KRB5_LIBS=""])
1312 AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[
1313 AS_IF([test "x$with_apple_krb5" = "xyes"],[
1314 AC_DEFINE(USE_APPLE_KRB5,1,[Apple Kerberos support is available])
1315 KRB5_FLAVOUR="Apple"
1317 AC_DEFINE(USE_MIT_KRB5,1,[MIT Kerberos support is available])
1320 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1321 KRB5INCS="$LIB_KRB5_CFLAGS"
1323 # check for other specific broken implementations
1324 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1325 LIBS="$LIBS $KRB5LIBS"
1327 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1328 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1329 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
1330 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1331 AC_CHECK_HEADERS(profile.h)
1333 SQUID_CHECK_KRB5_FUNCS
1335 AS_IF([test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"],[
1336 AC_MSG_ERROR([Required Kerberos library not found])
1337 ],[test "x$KRB5LIBS" = "x"],[
1341 SQUID_STATE_ROLLBACK([squid_krb5_save])
1344 # detect Solaris Kerberos dependencies
1345 AS_IF([test "x$with_solaris_krb5" = "xyes" -a "x$KRB5LIBS" = "x"],[
1346 SQUID_STATE_SAVE([squid_krb5_save])
1347 LIBS="$LIBS $LIB_KRB5_PATH"
1349 # no pkg-config for solaris native Kerberos
1350 # look for krb5-config (unless cross-compiling)
1351 AS_IF([test "$cross_compiling" = "no"],[
1352 AS_IF([test "x$krb5confpath" = "x"],[
1353 AC_PATH_PROG(krb5_config,krb5-config,no)
1354 AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[ac_krb5_config="$ac_cv_path_krb5_config"])
1356 ac_krb5_config="$krb5confpath/krb5-config"
1359 AS_IF([test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"],[
1361 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1362 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1363 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1364 # Solaris 10 Update 11 patches the krb5-config tool to produce stderr messages on stdout.
1365 SOLARIS_BROKEN_KRB5CONFIG_GSSAPI="`$ac_krb5_config --libs gssapi 2>/dev/null | grep "krb5-config"`"
1366 AS_IF([test "x$SOLARIS_BROKEN_KRB5CONFIG_GSSAPI" = "x"],[
1367 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1368 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1371 ## For some OS pkg-config is broken or unavailable.
1372 ## Detect libraries the hard way.
1374 CXXFLAGS="-I/usr/include/kerberosv5 $CXXFLAGS"
1376 SQUID_STATE_SAVE([squid_solaris_save])
1378 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1379 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1380 AC_MSG_WARN([library 'krb5' is required for Solaris Kerberos])
1381 missing_required=yes
1384 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
1385 AC_MSG_WARN([library 'gss' is required for Solaris Kerberos])
1386 missing_required=yes
1388 SQUID_STATE_ROLLBACK([squid_solaris_save])
1389 AS_IF([test "x$missing_required" = "xyes"],[LIB_KRB5_LIBS=""])
1392 AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[
1393 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1394 KRB5INCS="$LIB_KRB5_CFLAGS"
1395 AC_DEFINE(USE_SOLARIS_KRB5,1,[Solaris Kerberos support is available])
1396 KRB5_FLAVOUR="Solaris"
1398 # check for other specific broken implementations
1399 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1400 LIBS="$LIBS $KRB5LIBS"
1402 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1403 AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_ext.h)
1404 AC_CHECK_HEADERS(krb5.h com_err.h)
1406 SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
1407 AS_IF([test "x$squid_cv_broken_krb5_h" = "xyes"],[
1408 AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if Solaris krb5.h is broken for C++])
1409 AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.])
1410 AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512])
1411 AC_MSG_WARN([If you need Kerberos support you will have to patch])
1412 AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch])
1414 SQUID_CHECK_KRB5_FUNCS
1416 AS_IF([test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"],[
1417 # Error only if Solaris flavour was detected while looking for required MIT Kerberos
1418 AC_MSG_ERROR([Required Kerberos library not found])
1419 ],[test "x$KRB5LIBS" = "x"],[
1420 with_solaris_krb5=no
1423 SQUID_STATE_ROLLBACK([squid_krb5_save])
1426 dnl User may specify Heimdal Kerberos is needed from a non-standard location
1427 SQUID_AUTO_LIB(heimdal-krb5,[Heimdal Kerberos],[LIB_KRB5])
1428 AH_TEMPLATE(USE_HEIMDAL_KRB5,[Heimdal Kerberos support is available])
1429 AS_IF([test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"],[
1430 CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS"
1431 krb5confpath="$with_heimdal_krb5/bin"
1432 # find installed libs via pkg-config or krb5-config
1433 PKG_CHECK_EXISTS(heimdal-krb5, [squid_pc_krb5_name="heimdal-krb5"])
1434 AS_IF([test "x$squid_pc_krb5_name" = "x"],[
1435 PKG_CHECK_EXISTS(heimdal-gssapi, [squid_pc_krb5_name="heimdal-gssapi"])
1437 AS_IF([test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"],[
1438 # Look for krb5-config (unless cross-compiling)
1439 AC_PATH_PROG(krb5_config,krb5-config,no,$krb5confpath)
1440 AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[
1441 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1442 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1443 AS_IF([test "x$with_heimdal_krb5" = "xyes" -a $ac_heimdal = 0],[
1444 AC_MSG_ERROR([Could not find pkg-config or krb5-config for Heimdal Kerberos])
1447 AS_IF([test "x$with_heimdal_krb5" = "xyes"],[
1448 AC_MSG_ERROR([Could not find krb5-config in path])
1450 AC_MSG_WARN([Could not find krb5-config in path])
1451 with_heimdal_krb5=no
1456 AS_IF([test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"],[
1457 SQUID_STATE_SAVE([squid_krb5_save])
1458 LIBS="$LIBS $LIB_KRB5_PATH"
1460 # auto-detect using pkg-config
1461 PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[
1462 # look for krb5-config (unless cross-compiling)
1463 AS_IF([test "$cross_compiling" = "no"],[
1464 AS_IF([test "x$krb5confpath" = "x"],[
1465 AC_PATH_PROG(krb5_config,krb5-config,no)
1466 AS_IF([test "x$ac_cv_path_krb5_config" != "xno"],[ac_krb5_config="$ac_cv_path_krb5_config"])
1468 ac_krb5_config="$krb5confpath/krb5-config"
1471 AS_IF([test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"],[
1473 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1474 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1475 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1476 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1477 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1479 ## For some OS pkg-config is broken or unavailable.
1480 ## Detect libraries the hard way.
1481 SQUID_STATE_SAVE([squid_heimdal_save])
1483 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1484 AC_CHECK_LIB(resolv, [main], [LIB_KRB5_LIBS="-lresolv $LIB_KRB5_LIBS"],[
1485 AC_MSG_WARN([library 'resolv' is required for Heimdal Kerberos])
1486 missing_required=yes
1489 AC_CHECK_LIB(crypt, [main], [LIB_KRB5_LIBS="-lcrypt $LIB_KRB5_LIBS"],[
1490 AC_MSG_WARN([library 'crypt' is required for Heimdal Kerberos])
1491 missing_required=yes
1494 AC_CHECK_LIB(roken, [main], [LIB_KRB5_LIBS="-lroken $LIB_KRB5_LIBS"],[
1495 AC_MSG_WARN([library 'roken' is required for Heimdal Kerberos])
1496 missing_required=yes
1499 AC_CHECK_LIB(heimbase, [main], [LIB_KRB5_LIBS="-lheimbase $LIB_KRB5_LIBS"],[
1500 AC_MSG_WARN([library 'heimbase' may be required for Heimdal Kerberos])
1503 AC_CHECK_LIB(wind, [main], [LIB_KRB5_LIBS="-lwind $LIB_KRB5_LIBS"],[
1504 AC_MSG_WARN([library 'wind' may be required for Heimdal Kerberos])
1507 AC_CHECK_LIB(crypto, [main], [LIB_KRB5_LIBS="-lcrypto $LIB_KRB5_LIBS"],[
1508 AC_MSG_WARN([library 'crypto' is required for Heimdal Kerberos])
1509 missing_required=yes
1512 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
1513 AC_MSG_WARN([library 'com_err' is required for Heimdal Kerberos])
1514 missing_required=yes
1517 AC_CHECK_LIB(hx509, [main], [LIB_KRB5_LIBS="-lhx509 $LIB_KRB5_LIBS"],[
1518 AC_MSG_WARN([library 'hx509' may be required for Heimdal Kerberos])
1521 AC_CHECK_LIB(asn1, [main], [LIB_KRB5_LIBS="-lasn1 $LIB_KRB5_LIBS"],[
1522 AC_MSG_WARN([library 'asn1' is required for Heimdal Kerberos])
1523 missing_required=yes
1526 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
1527 AC_MSG_WARN([library 'krb5' is required for Heimdal Kerberos])
1528 missing_required=yes
1531 AC_CHECK_LIB(heimntlm, [main], [LIB_KRB5_LIBS="-lheimntlm $LIB_KRB5_LIBS"],[
1532 AC_MSG_WARN([library 'heimntlm' may be required for Heimdal Kerberos])
1535 AC_CHECK_LIB(gssapi, [main], [LIB_KRB5_LIBS="-lgssapi $LIB_KRB5_LIBS"],[
1536 AC_MSG_WARN([library 'gssapi' is required for Heimdal Kerberos])
1537 missing_required=yes
1539 SQUID_STATE_ROLLBACK([squid_heimdal_save])
1540 AS_IF([test "x$missing_required" = "xyes"],[LIB_KRB5_LIBS=""])
1543 AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[
1544 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1545 KRB5INCS="$LIB_KRB5_CFLAGS"
1546 AC_DEFINE(USE_HEIMDAL_KRB5,1,[Heimdal Kerberos support is available])
1547 KRB5_FLAVOUR="Heimdal"
1549 # check for other specific broken implementations
1550 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1551 LIBS="$LIBS $KRB5LIBS"
1553 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1554 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1555 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1557 SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
1558 AS_IF([test "x$squid_cv_broken_heimdal_krb5_h" = "xyes"],[
1559 AC_DEFINE(HAVE_BROKEN_HEIMDAL_KRB5_H, 1, [Define to 1 if Heimdal krb5.h is broken for C++])
1561 SQUID_CHECK_KRB5_FUNCS
1563 AS_IF([test "x$KRB5LIBS" = "x"],[
1564 AS_IF([test "x$with_heimdal_krb5" = "xyes"],[
1565 AC_MSG_ERROR([Required Heimdal Kerberos library not found])
1567 AC_MSG_WARN([Heimdal Kerberos library not found])
1570 SQUID_STATE_ROLLBACK([squid_krb5_save])
1573 dnl User may specify GNU gss is needed from a non-standard location
1574 SQUID_AUTO_LIB(gnugss,[GNU gss],[LIB_KRB5])
1575 AH_TEMPLATE(USE_GNUGSS,[GNU gss support is available])
1576 AS_IF([test "x$with_gnugss" != "xno" -a "x$KRB5LIBS" = "x"],[
1577 CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS"
1579 SQUID_STATE_SAVE([squid_krb5_save])
1580 LIBS="$LIBS $LIB_KRB5_PATH"
1582 # auto-detect using pkg-config
1583 PKG_CHECK_MODULES([LIB_KRB5],[gss],,[
1584 ## For some OS pkg-config is broken or unavailable.
1585 ## Detect libraries the hard way.
1587 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1588 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
1589 AC_MSG_WARN([library 'com_err' is required for GNU Kerberos])
1593 AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[
1594 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1595 KRB5INCS="$LIB_KRB5_CFLAGS"
1596 AC_DEFINE(USE_GNUGSS,1,[GNU Kerberos support is available])
1597 KRB5_FLAVOUR="GNU GSS"
1599 # check for other specific broken implementations
1600 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1601 LIBS="$LIBS $KRB5LIBS"
1603 AC_MSG_NOTICE([Try to find Kerbeors headers in given path])
1604 AC_CHECK_HEADERS(gss.h)
1606 SQUID_CHECK_WORKING_GSSAPI
1607 SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support])
1609 SQUID_CHECK_SPNEGO_SUPPORT
1610 SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support])
1612 SQUID_CHECK_WORKING_KRB5
1613 SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support])
1615 AS_IF([test "x$KRB5LIBS" = "x"],[
1616 AS_IF([test "x$with_gnugss" = "xyes"],[
1617 AC_MSG_ERROR([Required GNU GSS Kerberos library not found])
1619 AC_MSG_WARN([GNU GSS Kerberos library not found])
1622 SQUID_STATE_ROLLBACK([squid_krb5_save])
1625 AS_IF([test "x$KRB5LIBS" != "x"],[with_krb5=yes])
1626 AC_MSG_NOTICE([$KRB5_FLAVOUR Kerberos library support: ${with_krb5:=no} ${LIB_KRB5_PATH} ${LIB_KRB5_LIBS}])
1630 dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
1631 dnl only with Windows LDAP libraries using -lwldap32
1632 AS_IF([test "$squid_host_os" = "mingw"],[
1636 AC_CHECK_LIB(ldap, ldap_init, [LDAPLIB="-lldap"])
1637 AC_CHECK_LIB(lber, ber_init, [LBERLIB="-llber"])
1638 dnl if no ldap lib found check for mozilla version
1639 AS_IF([test "x$ac_cv_lib_ldap_ldap_init" != "xyes"],[
1642 AC_CHECK_LIB(ldap60, ldap_init, [LDAPLIB="-lldap60"])
1643 LIBS="$LDAPLIB $LIBPTHREADS"
1644 AC_CHECK_LIB(prldap60, prldap_init, [LDAPLIB="-lprldap60 $LDAPLIB"])
1645 LIBS="$LDAPLIB $LIBPTHREADS"
1646 AC_CHECK_LIB(ssldap60, ldapssl_init, [LDAPLIB="-lssldap60 $LDAPLIB"])
1650 AC_CHECK_HEADERS(ldap.h lber.h)
1651 AC_CHECK_HEADERS(mozldap/ldap.h)
1653 AC_MSG_CHECKING([for LDAP_OPT_DEBUG_LEVEL])
1654 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1657 int i=LDAP_OPT_DEBUG_LEVEL
1664 AC_MSG_CHECKING([for working ldap])
1666 LIBS="$LDAPLIB $LBERLIB $LIBPTHREADS"
1667 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1668 # define LDAP_DEPRECATED 1
1671 # elif HAVE_MOZLDAP_LDAP_H
1672 # include <mozldap/ldap.h>
1679 ldap_init((const char *)&host, port);
1683 AC_DEFINE(HAVE_LDAP, 1, [LDAP support])
1688 AC_MSG_RESULT(cross-compiler cant tell)
1692 AC_MSG_CHECKING([for OpenLDAP])
1693 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1697 # include <string.h>
1701 return strcmp(LDAP_VENDOR_NAME,"OpenLDAP");
1704 AC_DEFINE(HAVE_OPENLDAP, 1, [OpenLDAP support])
1709 AC_MSG_RESULT(cross-compiler cant tell)
1712 AC_MSG_CHECKING([for Sun LDAP SDK])
1713 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1717 # include <string.h>
1721 return strcmp(LDAP_VENDOR_NAME,"Sun Microsystems Inc.");
1724 AC_DEFINE(HAVE_SUN_LDAP_SDK, 1, [Sun LDAP SDK support])
1729 AC_MSG_RESULT(cross-compiler cant tell)
1732 AC_MSG_CHECKING([for Mozilla LDAP SDK])
1733 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1736 # elif HAVE_MOZLDAP_LDAP_H
1737 # include <mozldap/ldap.h>
1739 # include <string.h>
1743 return strcmp(LDAP_VENDOR_NAME,"mozilla.org");
1746 AC_DEFINE(HAVE_MOZILLA_LDAP_SDK, 1, [Mozilla LDAP SDK support])
1751 AC_MSG_RESULT(cross-compiler cant tell)
1754 AC_MSG_CHECKING([for LDAP_REBINDPROC_CALLBACK])
1755 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1758 # elif HAVE_MOZLDAP_LDAP_H
1759 # include <mozldap/ldap.h>
1762 LDAP_REBINDPROC_CALLBACK ldap_rebind;
1764 AC_DEFINE(HAVE_LDAP_REBINDPROC_CALLBACK,1,[Define to 1 if you have LDAP_REBINDPROC_CALLBACK])
1770 AC_MSG_CHECKING([for LDAP_REBIND_PROC])
1771 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1774 # elif HAVE_MOZLDAP_LDAP_H
1775 # include <mozldap/ldap.h>
1778 LDAP_REBIND_PROC ldap_rebind;
1780 AC_DEFINE(HAVE_LDAP_REBIND_PROC,1,[Define to 1 if you have LDAP_REBIND_PROC])
1786 AC_MSG_CHECKING([for LDAP_REBIND_FUNCTION])
1787 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1788 # define LDAP_REFERRALS
1791 # elif HAVE_MOZLDAP_LDAP_H
1792 # include <mozldap/ldap.h>
1795 LDAP_REBIND_FUNCTION ldap_rebind;
1797 AC_DEFINE(HAVE_LDAP_REBIND_FUNCTION,1,[Define to 1 if you have LDAP_REBIND_FUNCTION])
1803 AC_MSG_CHECKING([for LDAP_SCOPE_DEFAULT])
1804 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1807 # elif HAVE_MOZLDAP_LDAP_H
1808 # include <mozldap/ldap.h>
1811 int i=LDAP_SCOPE_DEFAULT;
1813 AC_DEFINE(HAVE_LDAP_SCOPE_DEFAULT,1,[Define to 1 if you have LDAP_SCOPE_DEFAULT])
1819 AC_CHECK_MEMBER([struct ldap_url_desc.lud_scheme],[
1820 AC_DEFINE(HAVE_LDAP_URL_LUD_SCHEME,1,[Define to 1 if you have LDAPURLDesc.lud_scheme])
1825 AC_CHECK_LIB(ldap,ldapssl_client_init,[
1826 AC_DEFINE(HAVE_LDAPSSL_CLIENT_INIT,1,[Define to 1 if you have ldapssl_client_init])
1829 AC_CHECK_LIB(ldap,ldap_url_desc2str,[
1830 AC_DEFINE(HAVE_LDAP_URL_DESC2STR,1,[Define to 1 if you have ldap_url_desc2str])
1833 AC_CHECK_LIB(ldap,ldap_url_parse,[
1834 AC_DEFINE(HAVE_LDAP_URL_PARSE,1,[Define to 1 if you have ldap_url_parse])
1837 AC_CHECK_LIB(ldap,ldap_start_tls_s,[
1838 AC_DEFINE(HAVE_LDAP_START_TLS_S,1,[Define to 1 if you have ldap_start_tls_s])
1845 SQUID_AUTO_LIB(systemd,[systemd API for start-up notification],[LIBSYSTEMD])
1846 AH_TEMPLATE(USE_SYSTEMD,[systemd support is available])
1847 AS_IF([test "x$with_systemd" != "xno"],[
1848 SQUID_STATE_SAVE(squid_systemd_state)
1849 LIBS="$LIBS $LIBSYSTEMD_PATH"
1850 PKG_CHECK_MODULES(LIBSYSTEMD,[libsystemd],,[
1852 PKG_CHECK_MODULES(LIBSYSTEMD,[libsystemd-daemon],,[:])
1854 AC_CHECK_HEADERS(systemd/sd-daemon.h)
1855 SQUID_STATE_ROLLBACK(squid_systemd_state)
1857 AS_IF([test "x$LIBSYSTEMD_LIBS" != "x"],[
1858 CXXFLAGS="$LIBSYSTEMD_CFLAGS $CXXFLAGS"
1859 LIBSYSTEMD_LIBS="$LIBSYSTEMD_PATH $LIBSYSTEMD_LIBS"
1860 AC_DEFINE(USE_SYSTEMD,1,[systemd support is available])
1861 ],[test "x$with_systemd" = "xyes"],[
1862 AC_MSG_ERROR([Required systemd library not found])
1864 AC_MSG_NOTICE([Library for systemd support not found])
1867 AC_MSG_NOTICE([systemd library support: $with_systemd $LIBSYSTEMD_LIBS])
1869 AC_ARG_ENABLE(forw-via-db,
1870 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [
1871 SQUID_YESNO([$enableval],[--enable-forw-via-db])
1873 SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no},
1874 [Enable Forw/Via database])
1875 AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db])
1877 AC_ARG_ENABLE(cache-digests,
1878 AS_HELP_STRING([--enable-cache-digests],
1879 [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),[
1880 SQUID_YESNO([$enableval],[--enable-cache-digests])
1882 SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no},
1883 [Use Cache Digests for locating objects in neighbor caches.])
1884 AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests])
1887 ################################
1888 # check for netio plugin stuff #
1889 ################################
1890 dnl order of these options handling is relevant in case the user
1891 dnl supplies more than one --enable option. Options handled later
1892 dnl override those handled earlier for io loop method manual override
1893 AC_ARG_ENABLE(select,
1894 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),[
1895 SQUID_YESNO([$enableval],[--enable-select])
1896 AS_IF([test "x$enableval" = "xyes"],[
1897 squid_opt_io_loop_engine="select"
1898 AS_IF([test "x$squid_host_os" = "xmingw"],[squid_opt_io_loop_engine="select_win32"])
1901 AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}])
1904 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),[
1905 SQUID_YESNO([$enableval],[--enable-poll])
1906 AS_IF(["x$enableval" = "xyes"],[squid_opt_io_loop_engine="poll"])
1908 AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}])
1910 AC_ARG_ENABLE(kqueue,
1911 AS_HELP_STRING([--disable-kqueue],
1912 [Disable kqueue(2) support.]), [
1913 SQUID_YESNO([$enableval],[--enable-kqueue])
1915 AS_IF([test "x${enable_kqueue:=auto}" != "xno"],[
1916 AC_CHECK_HEADERS([sys/event.h],[],[
1917 AS_IF([test "x${enable_kqueue}" = "xyes"],[
1918 AC_MSG_ERROR([kqueue support requires sys/event.h header file.])
1921 AC_CHECK_FUNCS(kqueue,[],[
1922 AS_IF([test "x${enable_kqueue}" = "xyes"],[
1923 AC_MSG_ERROR([kqueue support missing in libc library.])
1926 AS_IF([test "x$ac_cv_func_kqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes"],[
1927 squid_opt_io_loop_engine="kqueue"
1932 AC_MSG_NOTICE([enabling kqueue for net I/O: ${enable_kqueue:=auto}])
1935 AC_ARG_ENABLE(epoll,
1936 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
1938 SQUID_YESNO([$enableval],[--enable-epoll])
1939 AS_IF([test "x$enableval" = "xyes"],[squid_opt_io_loop_engine="epoll"])
1941 AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}])
1943 # auto-detect and verify epoll header and library present and working
1944 # logic mapping and loop method selection are performed later
1945 AS_IF([test "x$enable_epoll" != "xno"],[
1946 # check if libs are needed to support epoll
1947 SQUID_STATE_SAVE(squid_epoll_state)
1948 AC_SEARCH_LIBS(epoll_ctl,[epoll])
1949 AS_IF([test "x$ac_cv_search_epoll_ctl" = "xno"],[enable_epoll=no],
1950 [test "x$ac_cv_search_epoll_ctl" = "xnone required"],[EPOLL_LIBS=""],
1951 [EPOLL_LIBS=$ac_cv_search_epoll_ctl]
1953 AC_SUBST(EPOLL_LIBS)
1954 SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS
1956 # epoll requires sys/epoll.h
1957 AC_CHECK_HEADERS([sys/epoll.h])
1959 dnl Verify that epoll really works
1960 AS_IF([test "x$ac_cv_search_epoll_ctl" != "xno"], SQUID_CHECK_EPOLL)
1962 AS_IF([test "x$enable_epoll" = "xyes" -a "x$squid_cv_epoll_works" = "xno"],[
1963 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
1967 dnl Enable /dev/poll
1968 AC_ARG_ENABLE(devpoll,
1969 AS_HELP_STRING([--disable-devpoll],[Disable Solaris /dev/poll support.]),[
1970 SQUID_YESNO([$enableval],[--enable-devpoll])
1971 AS_IF([test "x$enableval" = "xyes"],[squid_opt_io_loop_engine="devpoll"])
1973 AC_MSG_NOTICE([enabling /dev/poll for net I/O: ${enable_devpoll:=auto}])
1975 ## auto-detect and verify devpoll header and library present and working
1976 AS_IF([test "x$enable_devpoll" != "xno"],[
1977 # /dev/poll requires ioctl() and write()
1978 AC_CHECK_FUNCS(ioctl)
1979 AC_CHECK_FUNCS(write)
1981 # /dev/poll requires sys/devpoll.h
1982 AC_CHECK_HEADERS([sys/devpoll.h],,[
1983 AS_IF([test "x$enable_devpoll" = "xyes"],[
1984 AC_MSG_ERROR([--enable-devpoll specified but /dev/poll headers not found])
1989 # Verify that /dev/poll really works
1990 AS_IF([test "x$enable_devpoll" != "xno"], SQUID_CHECK_DEVPOLL)
1992 AS_IF([test "x$enable_devpoll" = "xyes" -a "x$squid_cv_devpoll_works" = "xno"],[
1993 AC_MSG_ERROR([/dev/poll does not work. Force-enabling it is not going to help.])
1997 AC_ARG_ENABLE(http-violations,
1998 AS_HELP_STRING([--disable-http-violations],
1999 [This allows you to remove code which is known to
2000 violate the HTTP protocol specification.]), [
2001 SQUID_YESNO([$enableval],[--enable-http-violations])
2003 SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes},
2004 [Define to enable code which volates the HTTP standard specification])
2005 AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations])
2007 # IPFW Transparent Proxy
2008 AC_ARG_ENABLE(ipfw-transparent,
2009 AS_HELP_STRING([--enable-ipfw-transparent],
2010 [Enable Transparent Proxy support for systems
2011 using FreeBSD IPFW-style firewalling.]), [
2012 SQUID_YESNO([$enableval],[--enable-ipfw-transparent])
2014 SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no},
2015 [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.])
2016 AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent])
2018 # IP-Filter Transparent Proxy
2019 AC_ARG_ENABLE(ipf-transparent,
2020 AS_HELP_STRING([--enable-ipf-transparent],
2021 [Enable Transparent Proxy support using IPFilter-style firewalling]), [
2022 SQUID_YESNO([$enableval],[--enable-ipf-transparent])
2024 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2025 #IPF currently broken. Default-disabled for now.
2026 AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}])
2028 dnl Enable PF Transparent Proxy
2029 AC_ARG_ENABLE(pf-transparent,
2030 AS_HELP_STRING([--enable-pf-transparent],
2031 [Enable Transparent Proxy support for systems using PF network address redirection.]), [
2032 SQUID_YESNO([$enableval],[--enable-pf-transparent])
2034 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2035 AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=no}])
2037 dnl Enable /dev/pf support for older PF Transparent Proxy systems (OpenBSD 4.x and older)
2038 AC_ARG_WITH(nat-devpf,
2039 AS_HELP_STRING([--with-nat-devpf],
2040 [Enable /dev/pf support for NAT on older OpenBSD and FreeBSD kernels.]), [
2041 SQUID_YESNO([$withval],[--with-nat-devpf])
2043 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2044 AC_MSG_NOTICE([NAT lookups via /dev/pf: ${with_nat_devpf:=no}])
2046 # Linux Netfilter Transparent Proxy
2047 AC_ARG_ENABLE(linux-netfilter,
2048 AS_HELP_STRING([--enable-linux-netfilter],
2049 [Enable Transparent Proxy support for Linux (Netfilter)]), [
2050 SQUID_YESNO([$enableval],[--enable-linux-netfilter])
2052 AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}])
2053 #will be AC_DEFINEd later, after checking for appropriate infrastructure
2056 dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking)
2057 SQUID_AUTO_LIB(netfilter-conntrack,[Netfilter conntrack],[LIBNETFILTER_CONNTRACK])
2058 AC_MSG_NOTICE([Linux Netfilter Conntrack support requested: ${with_netfilter_conntrack:=auto}])
2059 AS_IF([test "x$with_netfilter_conntrack" != "xno"],[
2060 LDFLAGS="$LIBNETFILTER_CONNTRACK_PATH $LDFLAGS"
2061 CPPFLAGS="$LIBNETFILTER_CONNTRACK_CFLAGS $CPPFLAGS"
2062 AC_SEARCH_LIBS([nfct_query], [netfilter_conntrack],,[
2063 AS_IF([test "x$with_netfilter_conntrack" = "xyes"],[
2064 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack library not found])
2066 with_netfilter_conntrack=no
2068 AC_CHECK_HEADERS([ \
2069 libnetfilter_conntrack/libnetfilter_conntrack.h \
2070 libnetfilter_conntrack/libnetfilter_conntrack_tcp.h
2072 AS_IF([test "x$with_netfilter_conntrack" = "xyes"],[
2073 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack headers not found])
2075 with_netfilter_conntrack=no
2077 AS_IF([test "x$with_netfilter_conntrack" != "xno"],[with_netfilter_conntrack=yes])
2080 dnl Enable Large file support
2083 AC_ARG_WITH(large-files,
2084 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]), [
2085 SQUID_YESNO([$withval],[--with-large-files])
2086 squid_opt_enable_large_files=$withval
2089 dnl UNIX Build environment
2090 dnl AS_HELP_STRING is not suited here because it cannot to specify newlines
2091 AC_ARG_WITH(build-environment,
2092 AS_HELP_STRING([--with-build-environment=model],
2093 [The build environment to use. Normally one of
2094 POSIX_V6_ILP32_OFF32 (32 bits),
2095 POSIX_V6_ILP32_OFFBIG (32 bits with large file support),
2096 POSIX_V6_LP64_OFF64 (64 bits),
2097 POSIX_V6_LPBIG_OFFBIG (large pointers and files),
2098 XBS5_ILP32_OFF32 i(legacy, 32 bits),
2099 XBS5_ILP32_OFFBIG (legacy, 32 bits with large file support),
2100 XBS5_LP64_OFF64 (legacy, 64 bits),
2101 XBS5_LPBIG_OFFBIG (legacy, large pointers and files)
2102 or default (The default for your OS)]), [
2103 AS_CASE(["$withval"],
2104 [yes|no],[AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf])],
2105 [buildmodel="$withval"]
2109 #hack. Let's early-detect sizeof(long)
2110 AC_CHECK_SIZEOF(long)
2112 AS_IF([test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"],[
2113 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
2114 AS_IF([test "`getconf _$model 2>/dev/null || true`" = 1 -o "`getconf $model 2>/dev/null || true`"],[
2119 AS_IF([test "x$buildmodel" = "x"],[
2120 AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
2123 AS_IF([test "x$buildmodel" = "xdefault" -o "x$buildmodel" = "x"],[
2124 # define _FILE_OFFSET_BITS if requested and needed
2125 AS_IF([test "x$squid_opt_enable_large_files" = "xyes" -a $ac_cv_sizeof_long -le 4],[
2126 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
2127 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
2128 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2131 AC_MSG_NOTICE([Using $buildmodel build environment])
2132 AS_IF([ ! test "`getconf _$buildmodel 2>/dev/null || true`" = 1 -o "`getconf $buildmodel 2>/dev/null || true`"],[
2133 AC_MSG_ERROR([Build environment $buildmodel not known to getconf.])
2135 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
2136 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2137 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
2138 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
2140 AS_IF([test "x$squid_host_os" = "xsolaris"],[
2141 # On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
2142 # for LDFLAGS -xarch=generic64, but:
2143 # "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
2144 # For gcc "-xarch=generic64" must be replaced with "-m64"
2145 # The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
2146 AS_IF([test "x$GCC" = "xyes"],[
2147 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
2148 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
2149 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
2150 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
2151 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2152 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2153 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
2155 AC_MSG_NOTICE([Removing -Usun on $host])
2156 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
2157 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
2161 AC_ARG_ENABLE(follow-x-forwarded-for,
2162 AS_HELP_STRING([--disable-follow-x-forwarded-for],
2163 [Do not follow the X-Forwarded-For
2164 HTTP header to try to find the IP address of the
2165 original or indirect client when a request has
2166 been forwarded through other proxies.]), [
2167 SQUID_YESNO([$enableval],[--enable-follow-x-forwarded-for])
2169 AC_MSG_NOTICE([Support for X-Forwarded-For enabled: ${enable_follow_x_forwarded_for:=yes}])
2170 SQUID_DEFINE_BOOL(FOLLOW_X_FORWARDED_FOR,$enable_follow_x_forwarded_for,
2171 [Enable following X-Forwarded-For headers])
2173 AC_ARG_ENABLE(ident-lookups,
2174 AS_HELP_STRING([--disable-ident-lookups],
2175 [Remove code that supports performing Ident (RFC 931) lookups.]), [
2176 SQUID_YESNO([$enableval],[--enable-ident-lookups])
2178 AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}])
2179 SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups])
2181 dnl Select Default hosts file location
2182 AC_ARG_ENABLE(default-hostsfile,
2183 AS_HELP_STRING([--enable-default-hostsfile=path],
2184 [Select default location for hosts file.
2185 See hosts_file directive in squid.conf for details]), [
2186 # TODO: handle the "yes" case cleanly
2187 AS_CASE(["$enableval"],
2188 [no|none],[squid_opt_default_hosts="none"],
2190 squid_opt_default_hosts=$enableval
2191 AS_IF([ ! test -f "$enableval"],[
2192 AC_MSG_WARN([Unable to find file $enableval. I hope you know what you are doing.])
2196 AC_MSG_NOTICE([Default hosts file set to: ${squid_opt_default_hosts:=/etc/hosts}])
2197 DEFAULT_HOSTS=$squid_opt_default_hosts
2198 AC_SUBST(DEFAULT_HOSTS)
2200 # Select auth schemes modules to build
2202 AS_HELP_STRING([--disable-auth],
2203 [Do not support authentication. When supported, the list of schemes
2204 and helpers to be enabled is defined elsewhere]), [
2205 SQUID_YESNO([$enableval],[--enable-auth])
2207 AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}])
2208 SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,[Enable support for authentication])
2209 AM_CONDITIONAL(ENABLE_AUTH, test "x$enable_auth" != "xno")
2213 AC_ARG_ENABLE(auth-basic,
2214 AS_HELP_STRING([--enable-auth-basic="list of helpers"],
2215 [Enable the basic authentication scheme, and build the specified helpers.
2216 Not providing an explicit list of helpers will attempt build of
2217 all possible helpers. Default is to do so.
2218 To disable the basic authentication scheme, use --disable-auth-basic.
2219 To enable but build no helpers, specify "none".
2220 To see available helpers, see the src/auth/basic/ directory. ]),[
2221 #nothing to do really
2223 m4_include([src/auth/basic/helpers.m4])
2225 AC_ARG_ENABLE(auth-digest,
2226 AS_HELP_STRING([--enable-auth-digest="list of helpers"],
2227 [Enable the Digest authentication scheme, and build the specified helpers.
2228 Not providing an explicit list of helpers will attempt build of
2229 all possible helpers. Default is to do so.
2230 To disable the Digest authentication scheme, use --disable-auth-digest.
2231 To enable but build no helpers, specify "none".
2232 To see available helpers, see the src/auth/digest/ directory. ]),[
2233 #nothing to do, really
2235 m4_include([src/auth/digest/helpers.m4])
2237 AC_ARG_ENABLE(auth-negotiate,
2238 AS_HELP_STRING([--enable-auth-negotiate="list of helpers"],
2239 [Enable the Negotiate authentication scheme, and build the specified
2241 Not providing an explicit list of helpers will attempt build of
2242 all possible helpers. Default is to do so.
2243 To disable the Negotiate authentication scheme,
2244 use --disable-auth-negotiate.
2245 To enable but build no helpers, specify "none".
2246 To see available helpers, see the src/auth/negotiate/ directory. ]),[
2247 #nothing to do, really
2249 m4_include([src/auth/negotiate/helpers.m4])
2251 AC_ARG_ENABLE(auth-ntlm,
2252 AS_HELP_STRING([--enable-auth-ntlm="list of helpers"],
2253 [Enable the NTLM authentication scheme, and build the specified helpers.
2254 Not providing an explicit list of helpers will attempt build of
2255 all possible helpers. Default is to do so.
2256 To disable the NTLM authentication scheme, use --disable-auth-ntlm.
2257 To enable but build no helpers, specify "none".
2258 To see available helpers, see the src/auth/ntlm/ directory. ]),[
2260 m4_include([src/auth/ntlm/helpers.m4])
2262 dnl Authentication libraries to build
2263 dnl This list will not be needed when each auth library has its own Makefile
2264 dnl this is to be placed AFTER each auth module's handler
2266 for module in $AUTH_MODULES; do
2267 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD ${module}/lib${module}.la"
2269 AC_SUBST(AUTH_MODULES)
2270 AC_SUBST(AUTH_LIBS_TO_BUILD)
2271 AM_CONDITIONAL(ENABLE_SMBLIB, test "x$require_smblib" = "xyes")
2273 dnl Select logging daemon helpers to build
2274 AC_ARG_ENABLE(log-daemon-helpers,
2275 AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"],
2276 [This option selects which logging daemon helpers to
2277 build and install as part of the normal build process
2278 For a list of available helpers see the src/log/
2280 #nothing to do, really
2282 m4_include([src/log/helpers.m4])
2284 AC_ARG_ENABLE(external-acl-helpers,
2285 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
2286 [Enable external_acl helpers support and the helpers themselves.
2287 Default is to build all buildable helpers and enable support.
2288 To disable support, use --disable-external-acl-helpers.
2289 To build no helpers, specify "none".
2290 To see available helpers, see the src/acl/external/
2292 #nothing to do, really
2294 m4_include([src/acl/external/helpers.m4])
2296 dnl Select url_rewrite helpers to build
2297 AC_ARG_ENABLE(url-rewrite-helpers,
2298 AS_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
2299 [This option selects which url_rewrite helpers to
2300 build and install as part of the normal build
2301 process. The default is to attempt the build of all possible
2302 helpers. Use --disable-url-rewrite-helpers to build none.
2303 For a list of available helpers see the
2304 src/http/url_rewriters/ directory.]),[
2306 m4_include([src/http/url_rewriters/helpers.m4])
2308 dnl Select security helpers to build
2309 AC_ARG_ENABLE(security-cert-validators,
2310 AS_HELP_STRING([--enable-security-cert-validators="list of helpers"],
2311 [This option selects which security certificate validator
2312 helpers to build and install as part of the normal build
2313 process. The default is to attempt the build of all possible
2314 helpers. Use --disable-security-cert-validators to
2315 build none. For a list of available helpers see the
2316 src/security/cert_validators/ directory.]),[
2318 m4_include([src/security/cert_validators/helpers.m4])
2320 AC_ARG_ENABLE(security-cert-generators,
2321 AS_HELP_STRING([--enable-security-cert-generators="list of helpers"],
2322 [This option selects which security certificate validator
2323 helpers to build and install as part of the normal build
2324 process. The default is to attempt the build of all possible
2325 helpers. Use --disable-security-cert-genrators to
2326 build none. For a list of available helpers see the
2327 src/security/cert_generators/ directory.]),[
2329 m4_include([src/security/cert_generators/helpers.m4])
2331 dnl Select storeid_rewrite helpers to build
2332 AC_ARG_ENABLE(storeid-rewrite-helpers,
2333 AS_HELP_STRING([--enable-storeid-rewrite-helpers="list of helpers"],
2334 [This option selects which Store-ID rewrite helpers to
2335 build and install as part of the normal build
2336 process. The default is to attempt the build of all possible
2337 helpers. Use --disable-storeid-rewrite-helpers to build none.
2338 For a list of available helpers see the
2339 src/store/id_rewriters/ directory.]),[
2341 m4_include([src/store/id_rewriters/helpers.m4])
2343 AC_ARG_WITH(valgrind-debug,
2344 AS_HELP_STRING([--with-valgrind-debug],
2345 [Include debug instrumentation for use with valgrind]),
2347 SQUID_YESNO([$withval],[--with-valgrind-debug])
2348 AS_IF([test "x$withval" != "xno"],[
2349 AC_CHECK_HEADERS(valgrind/memcheck.h,[],[
2350 AC_MSG_ERROR([Valgrind support requested, needed headers not found.])
2354 SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no},
2355 [Valgrind memory debugger support])
2356 AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug])
2358 dnl Enable WIN32 Service compile mode
2359 AC_ARG_ENABLE(win32-service,
2360 AS_HELP_STRING([--enable-win32-service],
2361 [Compile Squid as a WIN32 Service.
2362 Works only on MS-Windows platforms]), [
2363 SQUID_YESNO([$enableval],[--enable-win32-service])
2365 SQUID_DEFINE_BOOL(USE_WIN32_SERVICE,${enable_win32_service:=no},
2366 [Enable code supporting MS Windows service mode])
2367 AC_MSG_NOTICE([MS Windows service mode enabled: $enable_win32_service])
2370 # Disable "unlinkd" code
2371 AC_ARG_ENABLE(unlinkd,
2372 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [
2373 SQUID_YESNO([$enableval],[--enable-unlinkd])
2375 SQUID_DEFINE_BOOL(USE_UNLINKD,${enable_unlinkd:=yes},
2376 [Enable useage of unlinkd])
2377 AM_CONDITIONAL(ENABLE_UNLINKD,test "x$enable_unlinkd" = "xyes")
2378 AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd])
2380 # Enable backtraces on fatal errors
2381 AC_ARG_ENABLE(stacktraces,
2382 AS_HELP_STRING([--enable-stacktraces],
2383 [Enable automatic call backtrace on fatal errors]), [
2384 SQUID_YESNO([$enableval],[--enable-stacktraces])
2386 SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no},
2387 [Print stack traces on fatal errors])
2388 AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces])
2390 # Enable X-Accelerator-Vary for Vary support within an accelerator setup
2391 AC_ARG_ENABLE(x-accelerator-vary,
2392 AS_HELP_STRING([--enable-x-accelerator-vary],
2393 [Enable support for the X-Accelerator-Vary
2394 HTTP header. Can be used to indicate
2395 variance within an accelerator setup.
2396 Typically used together with other code
2397 that adds custom HTTP headers to the requests.]), [
2398 SQUID_YESNO([$enableval],[--enable-x-accelerator-vary])
2400 SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no},
2401 [Enable support for the X-Accelerator-Vary HTTP header])
2402 AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary])
2404 SQUID_AUTO_LIB(cppunit,[cppunit test framework],[LIBCPPUNIT])
2405 AS_IF([test "x$with_cppunit" != "xno"],[
2406 LIBCPPUNIT_LIBS="$LIBCPPUNIT_PATH -lcppunit"
2407 PKG_CHECK_MODULES([LIBCPPUNIT],[cppunit],[
2408 squid_cv_cppunit_version="`pkg-config --modversion cppunit`"
2409 AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version])
2410 AS_UNSET(squid_cv_cppunit_version)
2412 SQUID_STATE_SAVE(squid_cppunit_state)
2413 CXXFLAGS="${CXXFLAGS} ${LIBCPPUNIT_CFLAGS}"
2414 LIBS="${LIBS} ${LIBCPPUNIT_LIBS}"
2415 AC_CHECK_HEADERS(cppunit/extensions/HelperMacros.h)
2416 SQUID_STATE_ROLLBACK(squid_cppunit_state)
2418 AC_MSG_WARN([cppunit does not appear to be installed. Squid does not require this, but code testing with 'make check' will fail.])
2422 dnl Check for headers
2445 linux/posix_types.h \
2453 netinet/in_systm.h \
2505 linux/netfilter_ipv4.h \
2506 linux/netfilter_ipv6/ip6_tables.h \
2508 SQUID_DEFAULT_INCLUDES
2512 /* Netfilter ip(6)tables v1.4.0 has broken headers */
2513 #if HAVE_NETINET_IN_H
2514 #include <netinet/in.h>
2518 dnl *BSD do not include the dependencies for all their net/ and netinet/ files
2519 dnl We must include a few basic type headers for them to work.
2534 SQUID_BSDNET_INCLUDES)
2539 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2545 dnl Override rusage() detect on MinGW because is emulated in source code
2546 AS_IF([test "$squid_host_os" = "mingw"],[
2547 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2548 ac_cv_func_getrusage="yes"
2549 AC_MSG_NOTICE([Using own rusage on Windows.])
2551 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2553 #include <sys/time.h>
2555 #if HAVE_SYS_RESOURCE_H
2556 #include <sys/resource.h>
2561 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2562 #if HAVE_SYS_TYPES_H
2563 #include <sys/types.h>
2565 #include <netinet/in.h>
2566 #include <netinet/in_systm.h>
2567 #include <netinet/ip.h>
2568 #if defined (__linux__) || defined (__CYGWIN__)
2577 dnl Check for typedefs
2578 AC_CHECK_SIZEOF(void *)
2580 # check for a bunch of types
2594 AC_CHECK_TYPE([bool])
2595 #need the defines for PRId64
2596 AC_CHECK_SIZEOF(int64_t)
2597 AC_CHECK_SIZEOF(long)
2598 #need the defines for PRIuSIZE
2599 AC_CHECK_SIZEOF(size_t)
2600 #need the define for overflow checks
2601 AC_CHECK_SIZEOF(off_t)
2602 AC_CHECK_SIZEOF(size_t)
2604 dnl Some C++11 types we try to use
2605 AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS
2606 SQUID_CXX_STD_UNDERLYING_TYPE
2607 SQUID_CXX_STD_IS_TRIVIALLY_COPYABLE
2609 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2610 dnl that is incompatible with the updated Solaris header files.
2611 dnl For this reason, we must check if pad128_t and upad128_t are defined.
2612 AC_CHECK_TYPE(pad128_t,
2613 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2614 ,SQUID_DEFAULT_INCLUDES)
2616 AC_CHECK_TYPE(upad128_t,
2617 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2618 ,SQUID_DEFAULT_INCLUDES)
2620 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2621 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2623 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2624 #include <sys/types.h>
2625 #include <sys/socket.h>
2630 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
2631 [mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2632 #include <sys/ipc.h>
2633 #include <sys/msg.h>])
2635 AC_CHECK_TYPE(cpu_set_t,
2636 AC_DEFINE(HAVE_CPU_SET_T,1,[cpu_set_t is defined by the system headers]),,[
2642 # check for compiler support of %zu printf macro
2643 AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro])
2644 AC_MSG_CHECKING([for compiler %zu support])
2645 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2647 ]],[[size_t n=1;printf("%zu",n);]])],[
2648 AC_DEFINE(PRIuSIZE,"zu")
2650 ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
2653 dnl Check for special functions
2656 SQUID_AUTO_LIB(cap,[Linux capabilities],[LIBCAP])
2657 AS_IF([test "x$with_cap" != "xno"],[
2658 SQUID_STATE_SAVE(squid_libcap_state)
2659 CXXFLAGS="$LIBCAP_CFLAGS $CXXFLAGS"
2660 LDFLAGS="$LIBCAP_PATH $LDFLAGS"
2661 PKG_CHECK_MODULES([LIBCAP],[libcap >= 2.09],[],[
2662 # cap_clear_flag is the most recent libcap function we require
2663 AC_CHECK_LIB([cap],[cap_clear_flag],[LIBCAP_LIBS="$LIBCAP_LIBS -lcap"])
2665 SQUID_CHECK_FUNCTIONAL_LIBCAP2
2666 AC_MSG_NOTICE([libcap headers are ok: $squid_cv_sys_capability_works])
2667 AS_IF([test "x$squid_cv_sys_capability_works" = "xno"],[LIBCAP_LIBS=""])
2668 SQUID_STATE_ROLLBACK(squid_libcap_state)
2670 AS_IF([test "x$LIBCAP_LIBS" != "x"],[
2672 CPPFLAGS="$LIBCAP_CFLAGS $CPPFLAGS"
2673 LIBCAP_LIBS="$LIBCAP_PATH $LIBCAP_LIBS"
2674 AC_DEFINE(USE_LIBCAP,1,[Linux capabilities library support])
2675 ],[test "x$with_cap" = "xyes"],[
2676 AC_MSG_ERROR([Required library libcap not found])
2678 AC_MSG_NOTICE([Library libcap not found])
2682 AC_MSG_NOTICE([Linux capabilities support enabled: ${with_cap} ${LIBCAP_LIBS}])
2684 dnl Check for needed libraries
2685 AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
2686 AC_SEARCH_LIBS([res_init],[resolv])
2687 AC_SEARCH_LIBS([__res_search],[resolv])
2688 AC_SEARCH_LIBS([bind],[socket])
2689 AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
2690 AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
2691 dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2692 AS_IF([test "x$squid_host_os" = "xmingw"],[
2693 SQUID_CHECK_WINSOCK_LIB
2699 #include <winsock2.h>
2702 #include <windows.h>
2705 #include <ws2tcpip.h>
2710 # check that we have unix sockets
2711 SQUID_CHECK_UNIX_SOCKET
2712 SQUID_DEFINE_BOOL(HAVE_UNIXSOCKET,$squid_cv_unixsocket,[System supports unix sockets])
2714 AC_CHECK_LIB(gnumalloc, malloc)
2715 AS_IF([test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"],[
2716 AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc])
2717 ac_cv_func_mallocblksize=no
2718 ac_cv_func_mallopt=no
2720 AS_CASE(["$squid_host_os"],
2721 [solaris],[AC_MSG_NOTICE([skipping libmalloc check for $host])],
2722 [freebsd],[AC_MSG_NOTICE([skipping libmalloc check for $host])],
2723 [AC_CHECK_LIB(malloc, main)]
2727 AS_IF([test "$squid_host_os" = "mingw"],[
2728 AC_MSG_NOTICE([Use MSVCRT for math functions.])
2730 dnl log() are only used in old C code for now.
2732 AC_SEARCH_LIBS([log],[m])
2736 dnl --with-maxfd present for compatibility with Squid-2.
2737 dnl undocumented in ./configure --help to encourage using the Squid-3 directive
2738 AC_ARG_WITH(maxfd,,[
2741 squid_filedescriptors_num=$withval
2742 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
2744 [AC_MSG_ERROR(--with-maxfd expects a numeric argument)]
2748 AC_ARG_WITH(filedescriptors,
2749 AS_HELP_STRING([--with-filedescriptors=NUMBER],
2750 [Force squid to support NUMBER filedescriptors]),
2753 squid_filedescriptors_num=$withval
2754 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])],
2755 [AC_MSG_ERROR([--with-filedescriptors expects a numeric argument])]
2759 SQUID_CHECK_DEFAULT_FD_SETSIZE
2763 dnl Enable IPv6 support
2764 AC_MSG_CHECKING([whether to enable IPv6])
2766 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support. The default is to probe system capabilities on startup.]), [
2767 SQUID_YESNO([$enableval],[--enable-ipv6])
2769 AC_MSG_RESULT(${enable_ipv6:=yes})
2770 SQUID_DEFINE_BOOL(USE_IPV6,$enable_ipv6,[Enable support for IPv6 ])
2772 AS_IF([test "x$enable_ipv6" = "xyes"],[SQUID_CHECK_SIN6_LEN_IN_SAI])
2773 SQUID_CHECK_SS_LEN_IN_SOCKADDR_STORAGE
2774 SQUID_CHECK_SIN_LEN_IN_SOCKADDR_IN
2776 dnl System-specific library modifications
2777 AH_TEMPLATE(GETTIMEOFDAY_NO_TZP,[Whether gettimeofday takes only one argument])
2780 # -lintl is needed on SCO version 3.2v4.2 for strftime()
2781 # Robert Side <rside@aiinc.bc.ca>
2782 # Mon, 18 Jan 1999 17:48:00 GMT
2783 AC_CHECK_LIB(intl, strftime)
2786 [i386-*-solaris2.*],[
2787 AS_IF([test "x$GCC" = "xyes"],[
2788 AC_MSG_NOTICE([Removing -O for gcc on $host])
2789 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9g]]*//'`"
2794 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
2795 LIBS=`echo $LIBS | sed -e s/-lsocket//`
2796 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
2797 LIBS=`echo $LIBS | sed -e s/-lnsl//`
2798 ac_cv_lib_nsl_main=no
2802 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_rtti],[-rtti],[[
2808 public:virtual ~Foo(){}
2810 class Bar:public Foo{
2811 public:Bar():Foo(){}
2814 Foo * myFoo=new Bar();
2815 Bar * myBar=dynamic_cast<Bar *>(myFoo);
2816 assert(myBar != NULL);
2818 AS_IF([test "$ac_cv_require_rtti" = "yes"],[
2819 SQUID_CFLAGS="-rtti $SQUID_CFLAGS"
2820 SQUID_CXXFLAGS="-rtti $SQUID_CXXFLAGS"
2824 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_qcpluscmt],[-qcpluscmt],[[]],[[//c++ cmt]])
2826 AS_IF([test "$ac_cv_require_qcpluscmt" = "yes"],[
2827 SQUID_CFLAGS="-qcpluscmt $SQUID_CFLAGS"
2831 [*-*-solaris2.[[0-4]]],[AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)],
2833 [*-sony-newsos[[56]]*],[AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)]
2836 dnl This has to be before AC_CHECK_FUNCS
2837 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2838 # when running configure.
2839 AS_IF([test "x$ac_cv_func_poll" = "x"],[
2843 AC_MSG_NOTICE([disabling poll for $host...])
2844 ac_cv_func_poll='no'
2848 # Henrik Nordstrom (hno@squid-cache.org) 19980817
2849 # poll is problematic on Linux. We disable it
2850 # by default until Linux gets it right.
2851 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2852 AS_IF([test $rev -lt 002002],[
2853 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
2854 ac_cv_func_poll='no'
2858 [powerpc-ibm-aix4.1.*],[
2859 # Mike Laster (mlaster@metavillage.com) 19981021
2860 AC_MSG_NOTICE([disabling poll for $host...])
2861 ac_cv_func_poll='no'
2866 dnl Check for library functions
2868 backtrace_symbols_fd \
2891 pthread_attr_setschedparam \
2892 pthread_attr_setscope \
2893 pthread_setschedparam \
2918 dnl ... and some we provide local replacements for
2927 AC_CHECK_DECLS([getaddrinfo,getnameinfo,inet_ntop,inet_pton,InetNtopA,InetPtonA],,,[
2929 * BSD requires sys/types.h, sys/socket.h, netinet/in.h, netdb.h, arpa/inet.h
2930 * Linux requires sys/types.h, sys/socket.h, arpa/inet.h
2931 * Windows requires sys/socket.h, winsock2.h, ws2tcpip.h
2933 #if HAVE_SYS_TYPES_H
2934 #include <sys/types.h>
2936 #if HAVE_NETINET_IN_H
2937 #include <netinet/in.h>
2939 #if HAVE_SYS_SOCKET_H
2940 #include <sys/socket.h>
2945 #if HAVE_ARPA_INET_H
2946 #include <arpa/inet.h>
2949 #include <winsock2.h>
2952 #include <ws2tcpip.h>
2956 # Magic which checks whether we are forcing a type of comm loop we
2957 # are actually going to (ab)use.
2958 # Mostly ripped from squid-commloops, thanks to adrian and benno
2960 AS_IF([test "x$squid_opt_io_loop_engine" != "x"],
2961 AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine]),
2962 [test "x$enable_epoll" != "xno" -a "x$squid_cv_epoll_works" = "xyes"],
2963 squid_opt_io_loop_engine="epoll",
2964 [test "x$enable_kqueue" != "xno"],
2965 squid_opt_io_loop_engine="kqueue",
2966 [test "x$enable_devpoll" != "xno"],
2967 squid_opt_io_loop_engine="devpoll",
2968 [test "x$enable_poll" != "xno" -a "x$ac_cv_func_poll" = "xyes"],
2969 squid_opt_io_loop_engine="poll",
2970 [test "x$enable_select" != "xno" -a "x$ac_cv_func_select" = "xyes"],
2971 squid_opt_io_loop_engine="select",
2972 [test "x$enable_select" != "xno" -a "x$squid_host_os" = "xmingw"],
2973 squid_opt_io_loop_engine="select_win32",
2975 AC_MSG_WARN([Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!])
2976 AC_MSG_WARN([Will try select and hope for the best.])
2977 squid_opt_io_loop_engine="select"
2981 AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.])
2983 AM_CONDITIONAL(ENABLE_POLL, test "x$squid_opt_io_loop_engine" = "xpoll")
2984 AM_CONDITIONAL(ENABLE_EPOLL, test "x$squid_opt_io_loop_engine" = "xepoll")
2985 AM_CONDITIONAL(ENABLE_SELECT, test "x$squid_opt_io_loop_engine" = "xselect")
2986 AM_CONDITIONAL(ENABLE_SELECT_WIN32, test "x$squid_opt_io_loop_engine" = "xselect_win32")
2987 AM_CONDITIONAL(ENABLE_KQUEUE, test "x$squid_opt_io_loop_engine" = "xkqueue")
2988 AM_CONDITIONAL(ENABLE_DEVPOLL, test "x$squid_opt_io_loop_engine" = "xdevpoll")
2990 AS_CASE([$squid_opt_io_loop_engine],
2991 [epoll],[AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])],
2992 [devpoll],[AC_DEFINE(USE_DEVPOLL,1,[Use /dev/poll for the IO loop])],
2993 [poll],[AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])],
2994 [kqueue],[AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])],
2995 [select_win32],[AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])],
2996 [select],[AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])],
2999 AS_IF([test "x$ac_cv_func_sched_getaffinity" = "xyes" -a "x$ac_cv_func_sched_setaffinity" = "xyes"],[
3000 AC_DEFINE(HAVE_CPU_AFFINITY,1,[Support setting CPU affinity for workers])
3003 SQUID_CHECK_SETRESUID_WORKS
3004 AS_IF([test "x$squid_cv_resuid_works" = "xyes"],[
3005 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.])
3008 AC_CHECK_HEADERS(mswsock.h)
3009 AC_MSG_CHECKING([for constant CMSG_SPACE])
3010 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3011 #if HAVE_SYS_SOCKET_H
3012 #include <sys/socket.h>
3015 #include <mswsock.h>
3018 int a[CMSG_SPACE(int)];
3021 AC_DEFINE(HAVE_CONSTANT_CMSG_SPACE, 1, [Define to 1 if CMSG_SPACE is constant])
3026 AC_CHECK_TYPE(struct cmsghdr,AC_DEFINE(HAVE_CMSGHDR,1,[The system provides struct cmsghdr]),,[
3027 #if HAVE_SYS_SOCKET_H
3028 #include <sys/socket.h>
3031 #include <mswsock.h>
3034 #include <winsock2.h>
3038 AC_CHECK_TYPE(struct iovec,AC_DEFINE(HAVE_IOVEC,1,[The system provides struct iovec]),,[
3039 #if HAVE_SYS_SOCKET_H
3040 #include <sys/socket.h>
3043 #include <winsock2.h>
3046 #include <sys/uio.h>
3050 AC_CHECK_TYPE(struct msghdr,AC_DEFINE(HAVE_MSGHDR,1,[The system provides struct msghdr]),,[
3051 #if HAVE_SYS_SOCKET_H
3052 #include <sys/socket.h>
3055 #include <mswsock.h>
3058 #include <winsock2.h>
3062 AC_CHECK_TYPE(struct sockaddr_un,AC_DEFINE(HAVE_SOCKADDR_UN,1,[The system provides sockaddr_un]),,[
3066 #if HAVE_SYS_SOCKET_H
3067 #include <sys/socket.h>
3070 #include <winsock2.h>
3074 SQUID_CHECK_FUNC_STRNSTR
3076 dnl IP-Filter support requires ipf header files. These aren't
3077 dnl installed by default, so we need to check for them
3078 AS_IF([test "x$enable_ipf_transparent" != "xno"],[
3079 SQUID_CHECK_BROKEN_SOLARIS_IPFILTER
3080 AC_MSG_CHECKING(for availability of IP-Filter header files)
3081 # hold on to your hats...
3083 [test "x$ac_cv_header_ip_compat_h" = "xyes" -o \
3084 "x$ac_cv_header_ip_fil_compat_h" = "xyes" -o \
3085 "x$ac_cv_header_netinet_ip_compat_h" = "xyes" -o \
3086 "x$ac_cv_header_netinet_ip_fil_compat_h" = "xyes"],
3087 [have_ipfilter_compat_header="yes"])
3090 [test "x$have_ipfilter_compat_header" = "xyes" -a \
3091 "x$ac_cv_header_ip_fil_h" = "xyes" -a \
3092 "x$ac_cv_header_ip_nat_h" = "xyes"],[enable_ipf_transparent="yes"],
3094 [test "x$have_ipfilter_compat_header" = "xyes" -a \
3095 "x$ac_cv_header_netinet_ip_fil_h" = "xyes" -a \
3096 "x$ac_cv_header_netinet_ip_nat_h" = "xyes"],[enable_ipf_transparent="yes"],
3097 [enable_ipf_transparent="no"])
3099 AC_MSG_RESULT($IPF_TRANSPARENT)
3101 ## On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3102 ## Solaris minor version (8, 9, 10, ...)
3103 AS_IF([test "x$enable_ipf_transparent" = "xyes" -a "x$squid_host_os" = "xsolaris"],[
3104 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3105 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3106 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3109 AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent])
3110 SQUID_DEFINE_BOOL(IPF_TRANSPARENT,$enable_ipf_transparent,
3111 [Enable support for IPF-style transparent proxying])
3113 dnl PF /dev/pf support requires a header file.
3114 AS_IF([test "x$with_nat_devpf" != "xno"],[
3115 AS_IF([test "x$ac_cv_header_net_pfvar_h" = "xyes" -o \
3116 "x$ac_cv_header_net_pf_pfvar_h" = "xyes"],[
3117 AS_IF([test "x$with_nat_devpf" = "xauto"],[with_nat_devpf="no"])
3119 AS_IF([test "x$with_nat_devpf" = "xyes"],[
3120 AC_MSG_ERROR([PF /dev/pf based NAT requested but needed header not found])
3125 SQUID_DEFINE_BOOL(PF_TRANSPARENT,${enable_pf_transparent:=no},
3126 [Enable support for PF-style transparent proxying])
3127 SQUID_DEFINE_BOOL(USE_NAT_DEVPF,${with_nat_devpf:=no},
3128 [Enable support for /dev/pf NAT lookups])
3130 AS_IF([test "x$enable_linux_netfilter" != "xno"],[
3131 AS_IF([test "x$ac_cv_header_linux_netfilter_ipv4_h" = "xyes"],[
3132 AS_IF([test "x$enable_linux_netfilter" = "xauto"],[enable_linux_netfilter=yes])
3134 AS_IF([test "x$enable_linux_netfilter" = "xauto"],[
3135 enable_linux_netfilter=no
3137 AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found])
3141 SQUID_DEFINE_BOOL(LINUX_NETFILTER,$enable_linux_netfilter,
3142 [Enable support for Transparent Proxy on Linux via Netfilter])
3144 dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3145 AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter])
3146 AS_IF([test "x$enable_linux_netfilter" = "xyes" -a "x$with_cap" != "xyes"],[
3147 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for TPROXY])
3148 AC_MSG_WARN([Linux Transparent Proxy (version 4+) support WILL NOT be enabled])
3149 AC_MSG_WARN([Reduced support to NAT Interception Proxy])
3152 AS_IF([test "x$with_netfilter_conntrack" = "xyes" -a "x$with_cap" != "xyes"],[
3153 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for netfilter mark support])
3154 AC_MSG_WARN([Linux netfilter marking support WILL NOT be enabled])
3155 with_netfilter_conntrack=no
3157 AC_MSG_NOTICE([Linux Netfilter Conntrack support enabled: ${with_netfilter_conntrack}])
3160 AC_ARG_ENABLE(zph-qos,
3161 AS_HELP_STRING([--disable-zph-qos],[Disable ZPH QOS support]), [
3162 SQUID_YESNO([$enableval],[--enable-zph-qos])
3164 SQUID_DEFINE_BOOL(USE_QOS_TOS,${enable_zph_qos:=yes},
3165 [Enable Zero Penalty Hit QOS. When set, Squid will alter the
3166 TOS field of HIT responses to help policing network traffic])
3167 AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos])
3168 AS_IF(test "x$enable_zph_qos" = "xyes"],[
3169 AC_MSG_NOTICE([QOS netfilter mark preservation enabled: $with_netfilter_conntrack])
3170 SQUID_DEFINE_BOOL(USE_LIBNETFILTERCONNTRACK,${with_netfilter_conntrack:=no},
3171 [Enable support for QOS netfilter mark preservation])
3174 AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB=''])
3175 AC_ARG_ENABLE(gnuregex,
3176 AS_HELP_STRING([--enable-gnuregex],
3177 [Compile GNUregex. Unless you have reason to use
3178 this option, you should not enable it.
3179 This library file is usually only required on Windows and
3180 very old Unix boxes which do not have their own regex
3181 library built in.]), [
3182 SQUID_YESNO([$enableval],[--enable-gnuregex])
3184 # force-enable on old solaris
3185 AS_IF([test "x${enable_gnuregex:=auto}" = "xauto"],[
3187 [*-sun-solaris2.[[0-4]]],[enable_gnuregex="yes"]
3191 # try detecting if it is needed
3192 AS_IF([test "x$enable_gnuregex" = "xauto"],[
3193 SQUID_CHECK_REGEX_WORKS
3194 AS_IF([test "x$squid_cv_regex_works" = "xyes"],[enable_gnuregex=no],[enable_gnuregex=yes])
3196 AC_MSG_CHECKING(if GNUregex needs to be compiled)
3197 AC_MSG_RESULT($enable_gnuregex)
3198 AS_IF([test "x$enable_gnuregex" = "xyes"],[
3199 # for some reason (force-enable, test..) gnuregex was found as needed. Override any system lib
3202 #if no reason was found to enable gnuregex, disable it
3203 AS_IF([test "x$enable_gnuregex" = "xauto"],[enable_gnuregex=no])
3204 SQUID_DEFINE_BOOL(USE_GNUREGEX,$enable_gnuregex,[Define if we should use GNU regex])
3207 SQUID_DETECT_UDP_SND_BUFSIZE
3208 SQUID_DETECT_UDP_RECV_BUFSIZE
3209 SQUID_DETECT_TCP_SND_BUFSIZE
3210 SQUID_DETECT_TCP_RECV_BUFSIZE
3212 SQUID_CHECK_NEED_SYS_ERRLIST
3213 SQUID_CHECK_MAXPATHLEN
3215 SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK
3216 SQUID_CHECK_RESOLVER_FIELDS
3218 AC_CHECK_HEADERS(sys/statvfs.h)
3219 AS_IF([test "x$ac_cv_header_sys_statvfs_h" = "xyes"],[SQUID_CHECK_WORKING_STATVFS])
3220 AS_IF([test "x$ac_cv_func_statvfs" != "xyes"],[
3221 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/vfs.h sys/statfs.h)
3222 AC_CHECK_FUNCS(statfs)
3223 SQUID_CHECK_F_FRSIZE_IN_STATFS
3226 dnl Squid will not usually attempt to translate templates when building
3227 AC_ARG_ENABLE(translation,
3228 AS_HELP_STRING([--enable-translation],[Generate the localized error page templates and manuals.
3229 Which can also be downloaded from http://www.squid-cache.org/Versions/langpack/.]), [
3230 SQUID_YESNO([$enableval],[--enable-translation])
3232 AS_IF([test "x${enable_translation:=no}" = "xyes"],[
3233 AX_WITH_PROG([PO2HTML],[po2html])
3234 AX_WITH_PROG([PO2TEXT],[po2txt])
3241 AM_CONDITIONAL(ENABLE_TRANSLATION, test "x${enable_translation:=no}" = "xyes")
3243 dnl Squid now has limited locale handling ...
3245 AC_ARG_ENABLE(auto-locale,
3246 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
3247 clients request headers.
3248 When disabled Squid requires explicit language configuration.]), [
3249 SQUID_YESNO([$enableval],[--enable-auto-locale])
3251 AC_MSG_NOTICE([Multi-Language support enabled: ${enable_auto_locale:=yes}])
3252 SQUID_DEFINE_BOOL(USE_ERR_LOCALES,$enable_auto_locale,
3253 [Use multi-language support on error pages])
3256 dnl Need the debugging version of malloc if available
3258 AS_IF([test "x$ac_cv_lib_malloc_main" = "xyes"],[
3259 AS_IF([test -r /usr/lib/debug/malloc.o],[XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"])
3260 AS_IF([test -r /usr/lib/debug/mallocmap.o],[XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"]);
3264 AS_IF([test "x$XTRA_LIBS" = "x"],[
3267 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3272 AC_SUBST(SQUID_CFLAGS)
3273 AC_SUBST(SQUID_CXXFLAGS)
3275 AC_ARG_VAR([BUILDCXXFLAGS],[C++ compiler flags for building compile-time tools. e.g. cf_gen])
3276 AS_IF([test "x$BUILDCXXFLAGS" = "x"],[
3277 # if we are NOT cross-compiling, use the default build flags for cf_gen and friends
3278 # otherwise rely on the user-provided value
3279 AS_IF([test "x$squid_cv_check_marchnative" = "xyes"],[
3280 # always valid for the Build compiler.
3281 BUILDCXXFLAGS="-march=native"
3283 BUILDCXXFLAGS="$BUILDCXXFLAGS $CXXFLAGS"
3285 AC_SUBST(BUILDCXXFLAGS)
3287 AC_MSG_NOTICE([BUILD LIBRARIES: $LIBS])
3288 AC_MSG_NOTICE([BUILD EXTRA LIBRARIES: $XTRA_LIBS])
3289 AC_MSG_NOTICE([BUILD OBJECTS: $OBJS])
3290 AC_MSG_NOTICE([BUILD EXTRA OBJECTS: $XTRA_OBJS])
3291 AC_MSG_NOTICE([BUILD C FLAGS: $CFLAGS])
3292 AC_MSG_NOTICE([BUILD EXTRA C FLAGS: $SQUID_CFLAGS])
3293 AC_MSG_NOTICE([BUILD C++ FLAGS: $CXXFLAGS])
3294 AC_MSG_NOTICE([BUILD EXTRA C++ FLAGS: $SQUID_CXXFLAGS])
3295 AC_MSG_NOTICE([BUILD Tools C++ FLAGS: $BUILDCXXFLAGS])
3297 dnl Clean up after OSF/1 core dump bug
3305 doc/manuals/Makefile
3306 doc/release-notes/Makefile
3310 lib/libTrie/Makefile
3311 lib/libTrie/test/Makefile
3312 lib/ntlmauth/Makefile
3315 lib/snmplib/Makefile
3319 src/acl/external/Makefile
3320 src/acl/external/AD_group/Makefile
3321 src/acl/external/delayer/Makefile
3322 src/acl/external/eDirectory_userip/Makefile
3323 src/acl/external/file_userip/Makefile
3324 src/acl/external/kerberos_ldap_group/Makefile
3325 src/acl/external/kerberos_sid_group/Makefile
3326 src/acl/external/LDAP_group/Makefile
3327 src/acl/external/LM_group/Makefile
3328 src/acl/external/session/Makefile
3329 src/acl/external/SQL_session/Makefile
3330 src/acl/external/unix_group/Makefile
3331 src/acl/external/wbinfo_group/Makefile
3332 src/acl/external/time_quota/Makefile
3333 src/adaptation/Makefile
3334 src/adaptation/icap/Makefile
3335 src/adaptation/ecap/Makefile
3338 src/auth/basic/Makefile
3339 src/auth/basic/DB/Makefile
3340 src/auth/basic/fake/Makefile
3341 src/auth/basic/getpwnam/Makefile
3342 src/auth/basic/LDAP/Makefile
3343 src/auth/basic/NCSA/Makefile
3344 src/auth/basic/NIS/Makefile
3345 src/auth/basic/PAM/Makefile
3346 src/auth/basic/POP3/Makefile
3347 src/auth/basic/RADIUS/Makefile
3348 src/auth/basic/SASL/Makefile
3349 src/auth/basic/SMB/Makefile
3350 src/auth/basic/SMB_LM/Makefile
3351 src/auth/basic/SSPI/Makefile
3352 src/auth/digest/Makefile
3353 src/auth/digest/eDirectory/Makefile
3354 src/auth/digest/file/Makefile
3355 src/auth/digest/LDAP/Makefile
3356 src/auth/negotiate/Makefile
3357 src/auth/negotiate/kerberos/Makefile
3358 src/auth/negotiate/SSPI/Makefile
3359 src/auth/negotiate/wrapper/Makefile
3360 src/auth/ntlm/Makefile
3361 src/auth/ntlm/fake/Makefile
3362 src/auth/ntlm/SMB_LM/Makefile
3363 src/auth/ntlm/SSPI/Makefile
3365 src/clients/Makefile
3370 src/DiskIO/AIO/Makefile
3371 src/DiskIO/Blocking/Makefile
3372 src/DiskIO/DiskDaemon/Makefile
3373 src/DiskIO/DiskThreads/Makefile
3374 src/DiskIO/IpcIo/Makefile
3375 src/DiskIO/Mmapped/Makefile
3384 src/http/one/Makefile
3385 src/http/url_rewriters/Makefile
3386 src/http/url_rewriters/fake/Makefile
3387 src/http/url_rewriters/LFS/Makefile
3394 src/log/file/Makefile
3401 src/security/Makefile
3402 src/security/cert_generators/Makefile
3403 src/security/cert_generators/file/Makefile
3404 src/security/cert_validators/Makefile
3405 src/security/cert_validators/fake/Makefile
3406 src/servers/Makefile
3410 src/store/id_rewriters/Makefile
3411 src/store/id_rewriters/file/Makefile
3415 tools/apparmor/Makefile
3416 tools/helper-mux/Makefile
3417 tools/purge/Makefile
3418 tools/squidclient/Makefile
3419 tools/systemd/Makefile
3420 tools/sysvinit/Makefile
3423 # must configure libltdl subdir unconditionally for "make distcheck" to work
3424 #AC_CONFIG_SUBDIRS(libltdl)