]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.ac
Fix libatomic detection in configure.ac
[thirdparty/squid.git] / configure.ac
CommitLineData
ef57eb7b 1## Copyright (C) 1996-2016 The Squid Software Foundation and contributors
5d2e6f19
AJ
2##
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.
6##
7
2552ca55 8AC_INIT([Squid Web Proxy],[4.0.3-BZR],[http://bugs.squid-cache.org/],[squid])
d966027f 9AC_PREREQ(2.61)
62979ab1 10AC_CONFIG_HEADERS([include/autoconf.h])
71b12d7c 11AC_CONFIG_AUX_DIR(cfgaux)
8d9ce05e 12AC_CONFIG_SRCDIR([src/main.cc])
f4405bd3 13AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects])
c2720d44 14AC_REVISION($Revision$)dnl
a2794549 15AC_PREFIX_DEFAULT(/usr/local/squid)
246d7ffc 16AM_MAINTAINER_MODE
a2794549 17
5d2e6f19 18m4_include([acinclude/ax_with_prog.m4])
4ecf021b 19m4_include([acinclude/init.m4])
fa522425 20m4_include([acinclude/squid-util.m4])
6a56798f 21m4_include([acinclude/compiler-flags.m4])
0abb39dd 22m4_include([acinclude/os-deps.m4])
c8093f05 23m4_include([acinclude/krb5.m4])
3c586e38 24m4_include([acinclude/pam.m4])
2b448046 25m4_include([acinclude/pkg.m4])
91983da0 26m4_include([acinclude/lib-checks.m4])
ea1cf567 27m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
a203dec7 28m4_include([acinclude/ax_cxx_0x_types.m4])
6a56798f 29
63e02610 30PRESET_CFLAGS="$CFLAGS"
a203dec7 31PRESET_CXXFLAGS="$CXXFLAGS"
63e02610 32PRESET_LDFLAGS="$LDFLAGS"
33
a2794549 34dnl Set default LDFLAGS
fcabe077 35if test "x$LDFLAGS" = "x" ; then
73862432 36 LDFLAGS="-g"
a2794549 37fi
38
aff48cc8 39# Check for GNU cc
a2794549 40AC_PROG_CC
e6c4cdd6 41AM_PROG_CC_C_O
29b8d8d6 42AC_PROG_CXX
62979ab1 43AC_LANG([C++])
88d50a22 44AC_CANONICAL_HOST
3e7b6055 45
c8640c9a
AJ
46# Clang 3.2 on some CPUs requires -march-native to detect correctly.
47# GCC 4.3+ can also produce faster executables when its used.
48# But building inside a virtual machine environment has been found to
49# cause random Illegal Instruction errors due to mis-detection of CPU.
50AC_ARG_ENABLE(arch-native,
51 AS_HELP_STRING([--disable-arch-native],[Some compilers offer CPU-specific
52 optimizations with the -march=native parameter.
53 This flag disables the optimization. The default is to
54 auto-detect compiler support and use where available.]), [
55 SQUID_YESNO([$enableval],
56 [Unrecognized argument to --disable-arch-native: $enableval])
57])
d8a4ba7c 58AC_MSG_NOTICE([CPU arch native optimization enabled: ${enable_arch_native:=auto}])
c8640c9a
AJ
59if test "x${enable_arch_native}" != "xno"; then
60 SQUID_CC_CHECK_ARGUMENT([squid_cv_check_marchnative],[-march=native])
61fi
e9d3951b
AJ
62
63# might be cross-compiling.
b2f0a375
AJ
64# NP: BUILDCXXFLAGS defined at the end of configure after CXXFLAGS fully known.
65AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen])
66if test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"; then
67 AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Uses BUILDCXX instead.])
68 BUILDCXX="$HOSTCXX"
69fi
70if test "x$BUILDCXX" = "x"; then
71 BUILDCXX="$CXX"
e9d3951b
AJ
72 if test "x$squid_cv_check_marchnative" = "xyes"; then
73 CXXFLAGS="$CXXFLAGS -march=native"
74 fi
75fi
b2f0a375 76AC_SUBST(BUILDCXX)
de051d9d 77
40503c27 78AC_MSG_CHECKING([simplified host os])
78a60bca 79simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'`
035a321e 80squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
6ca34f6f
HN
81if test -n "$squid_host_os_version"; then
82 squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`"
83else
84 squid_host_os="$simple_host_os"
85fi
40503c27
FC
86AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
87# on windows squid_host_os is either mingw or cygwin, version is 32
88
b2b60232
FC
89# this needs to be before any test is run, to have more standard
90# functions available on some Unix sysems (e.g. Solaris)
91if test "x$squid_host_os" = "solaris" -a "x$GCC" != "x" ; then
92 AC_USE_SYSTEM_EXTENSIONS
93fi
94
ea1cf567 95# Check for C++11 compiler support
07781e5d 96AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
a203dec7 97
aff48cc8 98# test for programs
aff48cc8
FC
99AC_PROG_RANLIB
100AC_PROG_CPP
101AC_PROG_INSTALL
102AC_PROG_LN_S
103AC_PROG_EGREP
104
105AC_PATH_PROG(SH, sh, /bin/sh)
106AC_PATH_PROG(FALSE, false, /usr/bin/false)
107AC_PATH_PROG(TRUE, true, /usr/bin/true)
108AC_PATH_PROG(MV, mv, $FALSE)
109AC_PATH_PROG(MKDIR, mkdir, $FALSE)
110AC_PATH_PROG(LN, ln, cp)
111AC_PATH_PROG(CHMOD, chmod, $FALSE)
6d1c1ab1 112AC_PATH_PROG(TR, tr, $FALSE)
aff48cc8 113AC_PATH_PROG(RM, rm, $FALSE)
ffa3bad9 114AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
aff48cc8
FC
115dnl Libtool 2.2.6 requires: rm -f
116RM="$RM -f"
117
118AC_PATH_PROG(PERL, perl, none)
fcabe077 119if test "x$ac_cv_path_PERL" = "xnone"; then
aff48cc8
FC
120 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
121fi
07f370ee 122AC_PATH_PROG(POD2MAN, pod2man, $FALSE)
33d1abfe 123AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE")
aff48cc8 124
52c549d9
AJ
125dnl set $(AR) if not provided by the build environment
126if test "x$AR" = "x"; then
127 AC_PATH_PROG(AR, ar, $FALSE)
128fi
aff48cc8 129AR_R="$AR r"
aff48cc8
FC
130AC_SUBST(AR_R)
131
86b8d400
AJ
132AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE)
133AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE")
134
cda5e747
AJ
135# pre-define DEFAULT_PREFIX, some modules need it.
136if test "${prefix}" = "NONE" ; then
137 squid_prefix=$ac_default_prefix
138else
139 squid_prefix=$prefix
140fi
141AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix])
142
0b45d157
FC
143AC_ARG_ENABLE(strict-error-checking,
144 AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
2d65bb9a 145 with all possible static compiler error-checks enabled.
cdb352bb
FC
146 This flag disables the behavior]), [
147 SQUID_YESNO([$enableval],
148 [Unrecognized argument to --disable-strict-error-checking: $enableval])
0b45d157 149])
cdb352bb 150AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}])
d1f95b42 151
3e7b6055
AR
152AC_MSG_CHECKING(whether to use loadable modules)
153AC_ARG_ENABLE(loadable-modules,
73862432
FC
154 AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [
155 SQUID_YESNO([$enableval],
156 [Unrecognized argument to --disable-loadable-modules: $enableval])
157])
cb5569cd 158AM_CONDITIONAL(ENABLE_LOADABLE_MODULES, test "x${enable_loadable_modules:=yes}" = "xyes")
73862432 159AC_MSG_RESULT([$enable_loadable_modules])
3e7b6055 160
73862432 161if test "x$enable_loadable_modules" = "xyes";
3e7b6055 162then
73862432
FC
163 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
164 AC_ENABLE_SHARED
3e7b6055 165else
73862432 166 AC_DISABLE_SHARED
3e7b6055
AR
167fi
168
4313559d 169# LT_INIT requires libtool v2, might as well state it loud
2663a9c8 170LT_PREREQ([2.2])
220d7675 171LT_INIT([dlopen],[disable-shared])
2148ef58
AJ
172if ! test "${ac_top_build_prefix}" = "";
173then
174 # LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
175 # But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
176 # This fixes Linux LTDLv3-v7, and BSD LTDL v2.2
177 top_build_prefix=${ac_top_build_prefix}
178 AC_SUBST(top_build_prefix)
179fi
bd9303f5 180LTDL_INIT
081863f3 181
d9a41469 182dnl LibTool environment is now prepared for setup. Check that it is usable and initialize.
081863f3 183LT_LIB_DLLOAD
3e7b6055
AR
184
185# Do we need these unconditionally for "make distcheck" to work?
186AC_SUBST(INCLTDL)
187AC_SUBST(LIBLTDL)
188
73862432 189if test "x$enable_loadable_modules" = "xyes";
3e7b6055 190then
73862432
FC
191 # Why is this needed? Should not LT_INIT (or LT_LIB_DLLOAD) from libtool do that?
192 LIBADD_DL=${lt_cv_dlopen_libs}
193 AC_SUBST([LIBADD_DL])
3e7b6055
AR
194fi
195
07f370ee 196SQUID_CC_GUESS_VARIANT
fa6307ae 197SQUID_CC_GUESS_OPTIONS
f9d138eb 198
be0c7ff0
FC
199dnl find out the exe extension for this platform.
200dnl If it is not empty, use it for CGI as well.
a2794549 201AC_EXEEXT
202AC_OBJEXT
203
fcabe077
FC
204if test "x$EXEEXT" = "x" ; then
205 CGIEXT=".cgi"
a2794549 206else
fcabe077
FC
207 # automake automatically adds .exe when installing binaries
208 CGIEXT=""
a2794549 209fi
7aeb8001 210AC_SUBST(CGIEXT)
a2794549 211
a396d1f8 212AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"])
daf2ddfa 213AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
fcabe077 214
b5467222
CT
215case "$squid_host_os" in
216mingw)
fcabe077
FC
217 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
218 CFLAGS="$CFLAGS -mthreads"
d66b42da 219 CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++"
fcabe077
FC
220 if test "x$ac_cv_path_WIN32_PSAPI" = "xnone"; then
221 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
222 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
223 else
224 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
225 LIBS="$LIBS -lpsapi"
226 fi
227 MINGW_LIBS="-lmingwex"
228 AC_SUBST(MINGW_LIBS)
b5467222
CT
229 ;;
230freebsd)
231 # FreeBSD places local libraries and packages in /usr/local
232 CFLAGS="$CFLAGS -I/usr/local/include"
233 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
234 LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib"
235 ;;
236*)
237 ;;
238esac
4b26fae9 239
f4aaf39c 240dnl Substitutions
6a9f6389 241AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
30a4f2a8 242
8075a4da
FC
243AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args",
244 [configure command line used to configure Squid])
090089c4 245
5483d916 246CACHE_EFFECTIVE_USER="nobody"
247AC_ARG_WITH(default-user,
62979ab1 248 AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
5483d916 249 [ CACHE_EFFECTIVE_USER="$withval" ]
250)
251AC_SUBST(CACHE_EFFECTIVE_USER)
252
c8d2dc9b
AJ
253DEFAULT_LOG_DIR="$localstatedir/logs"
254AC_ARG_WITH(logdir,
73862432 255 AS_HELP_STRING([--with-logdir=PATH],
cdb352bb 256 [Default location for squid logs. default: PREFIX/var/logs]), [
73862432
FC
257case $withval in
258 yes|no)
259 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
260 ;;
261 *)
262 DEFAULT_LOG_DIR="$withval"
263 ;;
264esac
c8d2dc9b
AJ
265 ]
266)
267AC_SUBST(DEFAULT_LOG_DIR)
268
2f36643c 269DEFAULT_PID_FILE="$localstatedir/run/@SERVICE_NAME@.pid"
a7f6af35 270AC_ARG_WITH(pidfile,
e0eb5853 271 AS_HELP_STRING([--with-pidfile=PATH],
cdb352bb 272 [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]), [
73862432
FC
273case $withval in
274 yes|no)
275 AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
276 ;;
277 *)
32f07882 278 DEFAULT_PID_FILE="$withval"
73862432
FC
279 ;;
280 esac
e0eb5853 281])
32f07882 282AC_SUBST(DEFAULT_PID_FILE)
a7f6af35 283
bf52b026
AJ
284DEFAULT_SWAP_DIR="$localstatedir/cache/squid"
285AC_ARG_WITH(swapdir,
286 AS_HELP_STRING([--with-swapdir=PATH],
287 [Default location for squid cache directories. Default: PREFIX/var/cache/squid]), [
288case $withval in
289 yes|no)
290 AC_MSG_ERROR( --with-swapdir requires a directory PATH. --with-swapdir=PATH )
291 ;;
292 *)
293 DEFAULT_SWAP_DIR="$withval"
294 ;;
295 esac
296])
297AC_SUBST(DEFAULT_SWAP_DIR)
298
30a4f2a8 299dnl Set Default CFLAGS
fcabe077 300if test "x$PRESET_CFLAGS" = "x"; then
f70e69c6 301 if test "$squid_cv_compiler" = "gcc"; then
fcabe077
FC
302 case "$host" in
303 *-sun-sunos*)
304 # sunos has too many warnings for this to be useful
305 # motorola too
306 ;;
307 *m88k*)
308 # Motorola cc/ld does not like -02 but is ok on -O
309 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
310 ;;
311 *)
312 CFLAGS="$squid_cv_cc_option_wall $CFLAGS"
313 ;;
314 esac
315 else
316 case "$host" in
317 *mips-sgi-irix6.*)
318 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
319 CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
320 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
321 -Wl,-woff,85,-woff,84,-woff,134 \
322 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
323 CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \
324 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
325 -Wl,-woff,85,-woff,84,-woff,134 \
326 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
327 ;;
30a4f2a8 328 *)
fcabe077
FC
329 ;;
330 esac
331 fi
30a4f2a8 332fi
333
d2e3605e 334dnl set squid required flags
f70e69c6 335if test "$squid_cv_compiler" = "gcc"; then
78a60bca
AJ
336 case "$squid_host_os" in
337 mingw)
9f68fb10 338dnl Guido Serassio (serassio@squid-cache.org) 20070811
339dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
0a13cc9d 340dnl -Werror -Wmissing-prototypes -Wmissing-declarations
9f68fb10 341dnl TODO: check if the problem will be present in any other newer MinGW release.
cb35a124 342 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow"
fcabe077
FC
343 ;;
344 *)
cb35a124 345 SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow"
fcabe077
FC
346 ;;
347 esac
cb35a124 348 SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow"
d2e3605e 349else
fcabe077
FC
350 SQUID_CFLAGS=
351 SQUID_CXXFLAGS=
d2e3605e 352fi
07f370ee 353
05c9db69 354dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features
629cb141 355SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]])
05c9db69 356
cdb352bb 357if test "x$enable_strict_error_checking" != "xno"; then
fcabe077 358 SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
59a09b98 359 SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror"
07f370ee
FC
360fi
361
0568bff2 362if test "x$ac_cv_require_wno_deprecated_register" = "xyes"; then
363 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Wno-deprecated-register"
364fi
365
e0eb5853
FC
366# squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS
367SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
368SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
2060fa9a 369
4fe75473
FC
370# possibly include some build info tag into squid -v
371SQUID_EMBED_BUILD_INFO
372
83079644 373AC_ARG_ENABLE(optimizations,
ffa3bad9 374 AS_HELP_STRING([--disable-optimizations],
be0c7ff0 375 [Do not compile Squid with compiler optimizations enabled.
a2f6a96c
FC
376 Optimization is good for production builds, but not
377 good for debugging. During development, use
378 --disable-optimizations to reduce compilation times
cdb352bb
FC
379 and allow easier debugging. This option implies
380 --disable-inline]), [
fcabe077
FC
381if test "x$enableval" = "xno" ; then
382 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
383 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
384 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
73862432 385 enable_inline="no"
fcabe077 386fi
83079644 387])
388
ffa3bad9 389AH_TEMPLATE(_USE_INLINE_,[Include inline methods into header file])
6c0c04db 390AC_ARG_ENABLE(inline,
be0c7ff0
FC
391 AS_HELP_STRING([--disable-inline],
392 [Do not compile trivial methods as inline. Squid
a2f6a96c
FC
393 is coded with much of the code able to be inlined.
394 Inlining is good for production builds, but not
395 good for development. During development, use
396 --disable-inline to reduce compilation times and
397 allow incremental builds to be quick. For
398 production builds, or load tests, use
399 --enable-inline to have squid make all trivial
73862432
FC
400 methods inlinable by the compiler.]), [
401SQUID_YESNO([$enableval],
402 [Unrecognized argument to --disable-inline: $enableval])
6c0c04db 403])
941c31f3 404AC_MSG_NOTICE([inlining optimizations enabled: ${enable_inline:=yes}])
73862432
FC
405SQUID_DEFINE_BOOL(_USE_INLINE_,$enable_inline,
406 [Include inline methods into header file])
407# to be used by sub-commands
408export enable_inline
6c0c04db 409
fa80a8ef 410AC_ARG_ENABLE(debug-cbdata,
8075a4da
FC
411 AS_HELP_STRING([--enable-debug-cbdata],
412 [Provide some debug information in cbdata]), [
50af7161
FC
413SQUID_YESNO([$enableval],
414 [unrecognized argument to --enable-debug-cbdata: $enableval])
fa80a8ef 415])
9a0a18de 416SQUID_DEFINE_BOOL(USE_CBDATA_DEBUG,${enable_debug_cbdata:=no},
50af7161
FC
417 [Enable support for cbdata debug information])
418AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata])
419
fa80a8ef 420
c9267250
AJ
421dnl Nasty hack to get autoconf 2.64 on Linux to run.
422dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
aff0e8fe 423AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:])
c9267250 424
0d00c98b 425AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics])
d9180414 426AC_ARG_ENABLE(xmalloc-statistics,
8075a4da
FC
427 AS_HELP_STRING([--enable-xmalloc-statistics],
428 [Show malloc statistics in status page]), [
4d1d2477
FC
429SQUID_YESNO([$enableval],
430 [unrecognized argument to --enable-xmalloc-statistics: $enableval])
e5f4e1b0 431])
4d1d2477
FC
432SQUID_DEFINE_BOOL(XMALLOC_STATISTICS,${enable_xmalloc_statistics:=no},
433 [Show malloc statistics in status page])
434AC_MSG_NOTICE([xmalloc stats display: $enable_xmalloc_statistics])
e5f4e1b0 435
8075a4da 436squid_opt_aufs_threads=""
f85c88f3 437AC_ARG_WITH(aufs-threads,
8075a4da
FC
438 AS_HELP_STRING([--with-aufs-threads=N_THREADS],
439 [Tune the number of worker threads for the aufs object store.]), [
440case $withval in
a3310b77 441 [[0-9]]*)
50fbcbd6 442 squid_opt_aufs_threads=$withval
a3310b77 443 ;;
444 *)
8b0d8e31 445 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
a3310b77 446 ;;
447 esac
448])
fcabe077 449if test "x$squid_opt_aufs_threads" != "x"; then
50fbcbd6
FC
450 AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads])
451 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads,
8075a4da 452 [Defines how many threads aufs uses for I/O])
cd748f27 453fi
454
50fbcbd6 455AC_ARG_WITH(dl, AS_HELP_STRING([--with-dl],[Use dynamic linking]))
fcabe077 456if test "x$with_dl" = "xyes"; then
eed82608 457 AC_MSG_NOTICE([With dl])
8154dd82 458fi
f85c88f3 459
4b0f8912 460## check for atomics library before anything that might need it
97c0a287
FC
461AC_SEARCH_LIBS([__atomic_load_8],[atomic])
462if test "x$ac_cv_search___atomic_load_8" = "-latomic"; then
463 ATOMICLIB="-latomic"
464fi
4b0f8912
AJ
465AC_SUBST(ATOMICLIB)
466
c975f532
DK
467AC_SEARCH_LIBS([shm_open], [rt])
468if test "x$ac_cv_search_shm_open" != "xno" ; then
469 AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
470fi
471
d235bc84 472AC_MSG_CHECKING([for DiskIO modules to be enabled])
50fbcbd6 473squid_disk_module_candidates=""
8075a4da 474squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules)
2513178d 475AC_ARG_ENABLE(disk-io,
50fbcbd6
FC
476 AS_HELP_STRING([--enable-disk-io="list of modules"],
477 [Build support for the list of disk I/O modules.
478 Set without a value or omitted, all available modules will be built.
479 See src/DiskIO for a list of available modules, or
480 Programmers Guide section on DiskIO
8075a4da
FC
481 for details on how to build your custom disk module]), [
482case $enableval in
2513178d 483 yes)
fe9ddf62 484 ${TRUE}
50fbcbd6 485 #do nothing, "auto" is ok
507ca601 486 ;;
2513178d 487 no)
8075a4da 488 squid_opt_enable_diskio="no"
507ca601 489 ;;
2513178d 490 *)
8075a4da 491 squid_opt_enable_diskio="yes"
47d80734 492 squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
d235bc84 493 SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
507ca601 494 ;;
2513178d 495 esac
50fbcbd6
FC
496])
497
d235bc84 498# if requested to autodetect, find out what we have
fcabe077 499if test "x$squid_opt_enable_diskio" = "xauto"; then
8075a4da 500 squid_opt_enable_diskio="yes"
50fbcbd6 501 SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
c975f532
DK
502 if test "x$ac_cv_search_shm_open" = "xno" ; then
503 # disable IpcIo
504 squid_disk_module_candidates=`echo $squid_disk_module_candidates|sed 's/IpcIo//'`
505 fi
50fbcbd6 506fi
d235bc84 507
47d80734 508AC_MSG_RESULT([${squid_disk_module_candidates:-none}])
dc299f29 509SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
0f658b5b 510SQUID_DEFINE_BOOL(USE_DISKIO,$squid_opt_enable_diskio,
50fbcbd6 511 [DiskIO modules are expected to be available.])
2513178d 512
dc299f29 513
40503c27 514
2513178d 515dnl Some autoconf.h defines we might enable later...
0b163dbb
FC
516AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
517AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
daf2ddfa 518ENABLE_WIN32_AIOPS=0
ffa3bad9
FC
519squid_opt_use_aio=
520squid_opt_use_diskthreads=
46577dd1 521AIOLIB=
2513178d
AJ
522
523dnl Setup the module paths etc.
2513178d
AJ
524DISK_LIBS=
525DISK_MODULES=
d9691f09
AJ
526AH_TEMPLATE(HAVE_DISKIO_MODULE_AIO, [Whether POSIX AIO Disk I/O module is built])
527AH_TEMPLATE(HAVE_DISKIO_MODULE_BLOCKING, [Whether Blocking Disk I/O module is built])
528AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKDAEMON, [Whether DiskDaemon Disk I/O module is built])
23ee12fb 529AH_TEMPLATE(HAVE_DISKIO_MODULE_DISKTHREADS, [Whether DiskThreads Disk I/O module is built])
d9691f09
AJ
530AH_TEMPLATE(HAVE_DISKIO_MODULE_IPCIO, [Whether IpcIo Disk I/O module is built])
531AH_TEMPLATE(HAVE_DISKIO_MODULE_MMAPPED, [Whether Mmapped Disk I/O module is built])
50fbcbd6 532for module in $squid_disk_module_candidates none; do
d235bc84 533 # maybe not needed
fcabe077 534 if test "x$module" = "xnone"; then
507ca601 535 continue
2513178d 536 fi
fcabe077 537 if ! test -d "$srcdir/src/DiskIO/$module"; then
2513178d
AJ
538 AC_MSG_ERROR(disk-io $module does not exist)
539 fi
540 case "$module" in
d9691f09
AJ
541
542 AIO)
543 dnl Check for POSIX AIO availability
544 squid_opt_use_aio="yes"
545 AIOLIB=
546 if test "x$with_aio" != "xno"; then
547 have_aio_header=no
548 AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
549 dnl On some systems POSIX AIO functions are in librt
550 dnl On some systems POSIX AIO functions are in libaio
551 AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
552 dnl Enable AIO if the library and headers are found
553 if test "x$AIOLIB" != "x" && test "x$have_aio_header" = "xyes"; then
554 AC_MSG_NOTICE([Native POSIX AIO support detected.])
555 squid_opt_use_aio="yes"
556 else
557 dnl Windows does things differently. We provide wrappers.
558 dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
559 case "$squid_host_os" in
560 mingw)
561 squid_opt_use_aio="yes"
562 AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
563 ;;
564 *)
565 AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
566 squid_opt_use_aio="no"
567 ;;
568 esac
569 fi
570 else
571 AC_MSG_NOTICE([POSIX AIO support manually disabled.])
572 squid_opt_use_aio="no"
573 fi
574 dnl Use the POSIX AIO pieces if we actually need them.
575 if test "x$squid_opt_use_aio" = "xyes" ; then
576 DISK_MODULES="$DISK_MODULES AIO"
d9691f09
AJ
577 AC_DEFINE([HAVE_DISKIO_MODULE_AIO],1,[POSIX AIO Disk I/O module is built])
578 case "$squid_host_os" in
579 mingw)
580 ENABLE_WIN32_AIO=1
581 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
582 ;;
583 *)
584 AC_MSG_NOTICE([Enabling AIO DiskIO module])
585 ;;
586 esac
587 else
588 AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
fedd516f 589 squid_disk_module_candidates_AIO=no
d9691f09
AJ
590 fi
591 ;;
592
593 Blocking)
594 AC_MSG_NOTICE([Enabling Blocking DiskIO module])
595 DISK_MODULES="$DISK_MODULES Blocking"
d9691f09
AJ
596 AC_DEFINE([HAVE_DISKIO_MODULE_BLOCKING],1,[Blocking Disk I/O module is built])
597 ;;
598
2513178d 599 DiskDaemon)
1d3aafe4
FC
600 case "$squid_host_os" in
601 mingw)
602 AC_MSG_NOTICE(["DiskDaemon not supported on MinGW"])
fedd516f 603 squid_disk_module_candidates_DiskDaemon=no
1d3aafe4
FC
604 ;;
605 *)
606 AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
1d3aafe4 607 DISK_MODULES="$DISK_MODULES DiskDaemon"
d9691f09 608 AC_DEFINE([HAVE_DISKIO_MODULE_DISKDAEMON],1,[DiskDaemon Disk I/O module is built])
1d3aafe4
FC
609 ;;
610 esac
507ca601 611 ;;
d9691f09 612
2513178d 613 DiskThreads)
507ca601
FC
614 squid_opt_use_diskthreads="yes"
615 LIBPTHREADS=
616 SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS])
617 if test "x$with_pthreads" != "xno"; then
618 dnl TODO: this needs to be extended to handle more systems and better
619 dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
620 dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
621 case "$squid_host_os" in
622 mingw)
daf2ddfa 623 ENABLE_WIN32_AIOPS=1
507ca601
FC
624 AC_MSG_NOTICE([Windows threads support automatically enabled])
625 ;;
626 freebsd)
2a76c9c4 627 if test `echo "$squid_host_os_version" | tr -d .` -lt 70 ; then
a0f82085
AJ
628 AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later)
629 squid_opt_use_diskthreads="no"
630 else
631 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
632 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
633 if test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x" ; then
634 LDFLAGS="$LDFLAGS -pthread"
635 fi
507ca601
FC
636 fi
637 ;;
ec264296
SH
638 openbsd)
639 if test `echo "$squid_host_os_version" | tr -d .` -lt 52 ; then
640 AC_MSG_NOTICE(pthread library requires OpenBSD 5.2 or later)
641 squid_opt_use_diskthreads="no"
642 else
643 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
644 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
645 LDFLAGS="$LDFLAGS -lpthread"
646 fi
647 ;;
507ca601
FC
648 solaris)
649 if test "x$GCC" = "xyes" ; then
650 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
651 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
652 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
653 AC_MSG_NOTICE(pthread library required but cannot be found.)
654 squid_opt_use_diskthreads="no"
655 ])
656 else
657 dnl test for -lpthread first. libc version is a stub apparently on Solaris.
658 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
659 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
660 AC_SEARCH_LIBS([pthread_create],[pthread thread],[
661 LIBPTHREADS="" #in LIBS
662 ],[
663 AC_MSG_NOTICE(pthread library required but cannot be found.)
664 squid_opt_use_diskthreads="no"
665 ])
666 fi
667 ;;
668 *)
669 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
670 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
671 AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [
40503c27
FC
672 AC_MSG_NOTICE(pthread library required but cannot be found.)
673 squid_opt_use_diskthreads="no"
674 ])
507ca601
FC
675 ;;
676 esac
677 else
678 AC_MSG_NOTICE([Native pthreads support manually disabled.])
679 squid_opt_use_diskthreads="no"
680 fi
681 if test "x$squid_opt_use_diskthreads" = "xyes" ; then
507ca601 682 AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
507ca601 683 DISK_MODULES="$DISK_MODULES DiskThreads"
d9691f09 684 AC_DEFINE([HAVE_DISKIO_MODULE_DISKTHREADS],1,[DiskThreads Disk I/O module is built])
507ca601 685 else
507ca601 686 AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
0b163dbb 687 SQUID_STATE_ROLLBACK([diskthreads_state])
fedd516f 688 squid_disk_module_candidates_DiskThreads=no
507ca601
FC
689 fi
690 ;;
2513178d 691
d9691f09 692 IpcIo)
d9691f09 693 if test "x$ac_cv_search_shm_open" = "xno" ; then
fedd516f
AJ
694 AC_MSG_NOTICE([DiskIO IpcIo module requires shared memory support])
695 squid_disk_module_candidates_IpcIo=no
696 else
23ee12fb 697 AC_MSG_NOTICE([Enabling IpcIo DiskIO module])
fedd516f 698 DISK_MODULES="$DISK_MODULES IpcIo"
fedd516f 699 AC_DEFINE([HAVE_DISKIO_MODULE_IPCIO],1,[IpcIo Disk I/O module is built])
507ca601
FC
700 fi
701 ;;
2513178d 702
e2851fe7 703 Mmapped)
e2cbb70e
FC
704 dnl TODO: use availability of sys/mman.h and/or mmap to define
705 dnl OR support windows mmap functions
706 if test "x$squid_host_os" = "xmingw" ; then
707 AC_MSG_NOTICE([Mmapped DiskIO is not available on Mingw])
fedd516f 708 squid_disk_module_candidates_Mmapped=no
e2cbb70e
FC
709 else
710 AC_MSG_NOTICE([Enabling Mmapped DiskIO module])
e2cbb70e 711 DISK_MODULES="$DISK_MODULES Mmapped"
d9691f09 712 AC_DEFINE([HAVE_DISKIO_MODULE_MMAPPED],1,[Mmapped Disk I/O module is built])
e2cbb70e 713 fi
e2851fe7
AR
714 ;;
715
2513178d 716 *)
507ca601 717 AC_MSG_NOTICE([Enabling $module DiskIO module])
d9691f09 718 DISK_LIBS="$DISK_LIBS lib${module}.la"
507ca601 719 DISK_MODULES="$DISK_MODULES ${module}"
507ca601 720 ;;
2513178d
AJ
721 esac
722done
723AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
724AC_SUBST(DISK_MODULES)
725AC_SUBST(DISK_LIBS)
ccca4016 726AM_CONDITIONAL([ENABLE_DISKIO_AIO], [test "x$squid_disk_module_candidates_AIO" = "xyes"])
d9691f09 727AC_SUBST(AIOLIB)
ccca4016
AJ
728AM_CONDITIONAL([ENABLE_WIN32_AIO], [test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1"])
729AM_CONDITIONAL([ENABLE_DISKIO_BLOCKING], [test "x$squid_disk_module_candidates_Blocking" = "xyes"])
730AM_CONDITIONAL([ENABLE_DISKIO_DISKDAEMON], [test "x$squid_disk_module_candidates_DiskDaemon" = "xyes"])
731AM_CONDITIONAL([ENABLE_DISKIO_DISKTHREADS], [test "x$squid_disk_module_candidates_DiskThreads" = "xyes"])
d9691f09 732AC_SUBST(LIBPTHREADS)
ccca4016
AJ
733AM_CONDITIONAL([ENABLE_WIN32_AIOPS], [test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1"])
734AM_CONDITIONAL([ENABLE_DISKIO_IPCIO], [test "x$squid_disk_module_candidates_IpcIo" = "xyes"])
735AM_CONDITIONAL([ENABLE_DISKIO_MMAPPED], [test "x$squid_disk_module_candidates_Mmapped" = "xyes"])
2513178d
AJ
736
737
738dnl Check what Storage formats are wanted.
739dnl This version will error out with a message saying why if a required DiskIO is missing.
dc299f29 740squid_opt_enable_storeio=auto
d235bc84
FC
741AC_ARG_ENABLE([storeio],
742 AS_HELP_STRING([--enable-storeio="list of modules"],
743 [Build support for the list of store I/O modules.
18cc92fb
FC
744 The default is only to build the "ufs" module.
745 See src/fs for a list of available modules, or
746 Programmers Guide section <not yet written>
507ca601
FC
747 for details on how to build your custom store module]), [
748case $enableval in
cd748f27 749 yes)
dc299f29 750 squid_opt_enable_storeio=auto
507ca601 751 ;;
cd748f27 752 no)
dc299f29 753 squid_opt_enable_storeio=no
507ca601 754 ;;
1c690e30 755 *)
dc299f29 756 squid_opt_enable_storeio=yes
507ca601 757 squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
80f756db 758 # ufs is really always needed as it has low-level routines
be0c7ff0 759 # if it is a dupe it will be cleaned-up later
80f756db 760 squid_storeio_module_candidates="$squid_storeio_module_candidates ufs"
507ca601 761 ;;
cd748f27 762 esac
cd748f27 763])
fcabe077 764if test "x$squid_opt_enable_storeio" = "xauto"; then
dc299f29 765 squid_opt_enable_storeio=yes
d235bc84
FC
766 AC_MSG_CHECKING([for available StoreIO modules])
767 SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
768 AC_MSG_RESULT([$squid_storeio_module_candidates])
769fi
770
dc299f29
FC
771SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates])
772SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
773AC_MSG_NOTICE([Store modules built: $squid_storeio_module_candidates])
774
775for fs in $squid_storeio_module_candidates none; do
507ca601 776 case "$fs" in
8154dd82 777 diskd)
507ca601 778 if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
80f756db 779 "$squid_disk_module_candidates_DiskDaemon" != "yes" ; then
507ca601
FC
780 AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon])
781 fi
782 ;;
8154dd82 783 aufs)
507ca601 784 if test "x$squid_disk_module_candidates_Blocking" != "xyes" -a \
80f756db 785 "$squid_disk_module_candidates_DiskThreads" != "yes" ; then
507ca601
FC
786 AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads])
787 fi
788 ;;
e2851fe7 789 rock)
be718d7a
DK
790 if test "x$squid_disk_module_candidates_IpcIo" != "xyes" -a \
791 "x$squid_disk_module_candidates_Blocking" != "xyes"; then
792 AC_MSG_ERROR([Storage module Rock requires IpcIo or Blocking DiskIO module])
c975f532 793 fi
b5377bef 794 squid_do_build_rock=true
e2851fe7 795 ;;
d3b3ab85 796 ufs)
b5377bef
FC
797 squid_do_build_ufs=true
798 ;;
8154dd82 799 esac
a2794549 800done
23ee12fb 801
b5377bef
FC
802AM_CONDITIONAL(HAVE_FS_UFS,[test "x$squid_do_build_ufs" = "xtrue" ])
803AM_CONDITIONAL(HAVE_FS_ROCK,[test "x$squid_do_build_rock" = "xtrue" ])
9d6186b1
FC
804dnl hack: need to define those even if not used in the build system to
805dnl make sure that global FS objects are linked to the squid binary.
7b5b7ba8
CT
806AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
807AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
808AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
e2851fe7 809AH_TEMPLATE(HAVE_FS_ROCK, "Define to 1 if rock filesystem module is build")
7b5b7ba8
CT
810
811
dc299f29 812dnl got final squid_storeio_module_candidates, build library lists
b66455ff
AR
813dnl This list will not be needed when each fs library has its own Makefile
814STORE_LIBS_TO_BUILD=
815dnl File system libraries to link executables with.
816dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
817STORE_LIBS_TO_ADD=
dc299f29 818for fs in $squid_storeio_module_candidates; do
7b5b7ba8
CT
819 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
820 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
6d1c1ab1
FC
821 SQUID_TOUPPER_VAR_CONTENTS([fs])
822 AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1)
b66455ff
AR
823done
824
825AC_SUBST(STORE_LIBS_TO_BUILD)
826AC_SUBST(STORE_LIBS_TO_ADD)
082a5e7a 827AC_SUBST(STORE_TESTS)
a2794549 828
24a04df9
AJ
829
830dnl At lest one removal policy is always needed.
831dnl 'lru' removal policy is currently hard-coded by name for tests
832dnl so we must set it as default.
833REPL_POLICIES="lru"
d9180414 834AC_ARG_ENABLE(removal-policies,
56ffc413
FC
835 AS_HELP_STRING([--enable-removal-policies="list of policies"],
836 [Build support for the list of removal policies.
18cc92fb
FC
837 The default is only to build the "lru" module.
838 See src/repl for a list of available modules, or
839 Programmers Guide section 9.9 for details on how
507ca601
FC
840 to build your custom policy]), [
841case $enableval in
6a566b9c 842 yes)
5069fb38 843 SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES])
507ca601 844 ;;
6a566b9c 845 no)
507ca601 846 ;;
1c690e30 847 *)
507ca601
FC
848 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
849 ;;
6a566b9c 850 esac
6a566b9c 851])
fcabe077 852if test "x$REPL_POLICIES" != "x" ; then
56ffc413 853 SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES])
5069fb38 854 AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES])
1c690e30 855 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
856 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
857fi
6a566b9c 858AC_SUBST(REPL_POLICIES)
6a566b9c 859AC_SUBST(REPL_OBJS)
f71946fc 860AC_SUBST(REPL_LIBS)
6a566b9c 861
d1da2d1f 862AM_CONDITIONAL(ENABLE_PINGER, false)
e5f4e1b0 863AC_ARG_ENABLE(icmp,
62979ab1 864 AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
fcabe077 865[ if test "x$enableval" = "xyes" ; then
eed82608 866 AC_MSG_NOTICE([ICMP enabled])
be0c7ff0 867 AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)])
d1da2d1f 868 AM_CONDITIONAL(ENABLE_PINGER, true)
e5f4e1b0 869 fi
870])
871
9a0a18de 872AM_CONDITIONAL(ENABLE_DELAY_POOLS, false)
d9180414 873AC_ARG_ENABLE(delay-pools,
62979ab1 874 AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
fcabe077 875[ if test "x$enableval" = "xyes" ; then
eed82608 876 AC_MSG_NOTICE([Delay pools enabled])
9a0a18de 877 AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".])
ffe4ffd8 878 AM_CONDITIONAL(ENABLE_DELAY_POOLS, true)
e5f4e1b0 879 fi
880])
881
5fa840c3 882dnl disable generic/common adaptation support by default
5069fb38 883squid_opt_use_adaptation=no
5fa840c3 884
5069fb38 885squid_opt_use_esi=yes
7eb77a5f
FC
886AH_TEMPLATE([USE_SQUID_ESI],
887 [Define to enable the ESI processor and Surrogate header support])
43ae1d95 888AC_ARG_ENABLE(esi,
7eb77a5f 889 AS_HELP_STRING([--enable-esi],
5069fb38 890 [Enable ESI for accelerators. Benefits from expat or libxml2.
7eb77a5f 891 Enabling ESI will cause squid reverse proxies to be capable
5069fb38 892 of the Edge Acceleration Specification (www.esi.org).]),
507ca601 893 [squid_opt_use_esi=$enableval], [squid_opt_use_esi=no])
88bfe098
AJ
894HAVE_LIBEXPAT=0
895EXPATLIB=
896HAVE_LIBXML2=0
897XMLLIB=
fcabe077 898if test "x$squid_opt_use_esi" = "xyes" ; then
3473acb1 899 AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.])
7eb77a5f 900 AC_DEFINE(USE_SQUID_ESI,1,
507ca601 901 [Compile the ESI processor and Surrogate header support])
7eb77a5f 902else
8075a4da 903 AC_MSG_NOTICE([Disabling ESI processor])
7eb77a5f 904fi
88bfe098 905
7eb77a5f
FC
906# ESI support libraries: expat
907AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect]))
fcabe077 908if test "x$squid_opt_use_esi" = "xyes" -a "x$with_expat" != "xno" ; then
7eb77a5f
FC
909 AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
910 AC_CHECK_HEADERS([expat.h])
911 AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
fcabe077 912 if test "x$with_expat" = "xyes" -a "x$HAVE_LIBEXPAT" != "x1" ; then
7eb77a5f 913 AC_MSG_ERROR([Required library expat is not able to be found.])
23df48fd 914 fi
7eb77a5f 915fi
ad32c661 916
7eb77a5f 917AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
fcabe077 918if test "x$squid_opt_use_esi" = "xyes" -a "x$with_libxml2" != "xno" ; then
7eb77a5f
FC
919 AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1])
920 dnl Find the main header and include path...
0dc1a86a
HN
921 AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [
922 AC_CHECK_HEADERS([libxml/parser.h], [], [
94ea9adc 923 AC_MSG_NOTICE([Testing in /usr/include/libxml2])
7eb77a5f
FC
924 SAVED_CPPFLAGS="$CPPFLAGS"
925 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
926 unset ac_cv_header_libxml_parser_h
0dc1a86a
HN
927 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/include/libxml2"], [
928 AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
929 CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS"
930 unset ac_cv_header_libxml_parser_h
931 AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/local/include/libxml2"], [
67840a07 932 AC_MSG_NOTICE([Failed to find libxml2 header file libxml/parser.h])
0dc1a86a 933 ])
7eb77a5f 934 ])
0dc1a86a
HN
935 CPPFLAGS="$SAVED_CPPFLAGS"
936 ])
937 ])
938 if test "x$ac_cv_libxml2_include" != "x"; then
939 SQUID_CXXFLAGS="$ac_cv_libxml2_include $SQUID_CXXFLAGS"
940 CPPFLAGS="$ac_cv_libxml2_include $CPPFLAGS"
7eb77a5f 941 fi
0dc1a86a
HN
942 dnl Now that we know where to look find the headers...
943 AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h)
7eb77a5f 944 AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
fcabe077 945 if test "x$with_libxml2" = "xyes" -a "$HAVE_LIBXML2" != "1" ; then
7eb77a5f
FC
946 AC_MSG_ERROR([Required library libxml2 is not able to be found.])
947 fi
43ae1d95 948fi
7eb77a5f 949
fcabe077
FC
950AM_CONDITIONAL(USE_ESI, test "x$squid_opt_use_esi" = "xyes")
951AM_CONDITIONAL(HAVE_LIBEXPAT, test "$HAVE_LIBEXPAT" = 1)
88bfe098 952AC_SUBST(EXPATLIB)
fcabe077 953AM_CONDITIONAL(HAVE_LIBXML2, test "$HAVE_LIBXML2" = 1)
88bfe098 954AC_SUBST(XMLLIB)
43ae1d95 955
8075a4da 956# icap argument handling
51952383 957AC_ARG_ENABLE(icap-client,
4f07726a
AJ
958 AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[
959 SQUID_YESNO([$enableval],[Unrecognized argument to --disable-icap-client: $enableval])
960])
961SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid])
962AM_CONDITIONAL(USE_ICAP_CLIENT, [test "x$enable_icap_client" != "xno" ])
963if test "x$enable_icap_client" != "xno" ; then
1f3c65fc 964 ICAP_LIBS="icap/libicap.la"
5069fb38 965 squid_opt_use_adaptation=yes
51952383 966else
c21ad0f5 967 ICAP_LIBS=""
51952383 968fi
c21ad0f5 969AC_SUBST(ICAP_LIBS)
51952383 970
5069fb38 971squid_opt_use_ecap=1
3e7b6055
AR
972AC_MSG_CHECKING(whether to support eCAP)
973AC_ARG_ENABLE(ecap,
8075a4da
FC
974 AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]), [
975 case "${enableval}" in
976 yes|no) squid_opt_use_ecap=$enableval ;;
977 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
978 esac
979AC_MSG_RESULT([$squid_opt_use_ecap, explicitly])
980 ], [
5069fb38
FC
981 squid_opt_use_ecap=no;
982 AC_MSG_RESULT([$squid_opt_use_ecap, implicitly])
3e7b6055
AR
983 ]
984)
985
80ab04bb
AR
986dnl Necessary if the first PKG_CHECK_MODULES call is conditional
987PKG_PROG_PKG_CONFIG
988
3e7b6055 989dnl Perform configuration consistency checks for eCAP
cbc14831 990if test "x$squid_opt_use_ecap" != "xno";
3e7b6055 991then
cbc14831
AJ
992 dnl eCAP support requires loadable modules, which are enabled by default
993 if test "x$enable_loadable_modules" != "xyes"
994 then
995 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.])
996 fi
4cfba571 997
cbc14831 998 if test -n "$PKG_CONFIG"; then
6666da11 999 dnl eCAP support requires libecap.
0a720258 1000 dnl This Squid supports libecap v1.0.x.
3e115aaf
AR
1001 dnl Use EXT_ prefix to distinguish external libecap (that we check for
1002 dnl here) from our own convenience ecap library in Makefiles.
0a720258 1003 PKG_CHECK_MODULES([EXT_LIBECAP],[libecap >= 1.0 libecap < 1.1])
cbc14831
AJ
1004 else
1005 AC_MSG_NOTICE([eCAP support requires pkg-config to verify the correct library version. Trouble may follow.])
1006 fi
3e7b6055
AR
1007fi
1008
fcabe077
FC
1009AM_CONDITIONAL(USE_ECAP, test "x$squid_opt_use_ecap" = "xyes")
1010if test "x$squid_opt_use_ecap" = "xyes";
3e7b6055
AR
1011then
1012 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
3e115aaf 1013 ECAP_LIBS="ecap/libsquid-ecap.la"
5069fb38 1014 squid_opt_use_adaptation=yes
3e7b6055 1015else
5fa840c3 1016 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
3e7b6055
AR
1017 ECAP_LIBS=""
1018fi
b61a58df 1019dnl convenience library
3e7b6055
AR
1020AC_SUBST(ECAP_LIBS)
1021
3e7b6055 1022
5fa840c3 1023dnl enable adaptation if requested by specific adaptation mechanisms
fcabe077
FC
1024AM_CONDITIONAL(USE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes")
1025if test "x$squid_opt_use_adaptation" = "xyes"
5fa840c3
AR
1026then
1027 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
1028 ADAPTATION_LIBS="adaptation/libadaptation.la"
51952383 1029else
5fa840c3
AR
1030 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
1031 ADAPTATION_LIBS=""
51952383 1032fi
5fa840c3 1033AC_SUBST(ADAPTATION_LIBS)
3e7b6055 1034
1d3aafe4 1035test "x$squid_host_os" = "xmingw" && enable_wccp=no
5069fb38 1036AC_ARG_ENABLE(wccp,
8075a4da 1037 AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [
1a6b111a 1038SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccp: $enableval])
5069fb38 1039])
0067eb06 1040SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP])
1a6b111a 1041AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp])
0b0cfcf2 1042
1d3aafe4 1043test "x$squid_host_os" = "xmingw" && enable_wccpv2=no
0b0cfcf2 1044AC_ARG_ENABLE(wccpv2,
1a6b111a
FC
1045 AS_HELP_STRING([--disable-wccpv2],
1046 [Disable Web Cache Coordination V2 Protocol]), [
1047SQUID_YESNO([$enableval],
1048 [unrecognized argument to --disable-wccpv2: $enableval])
0b0cfcf2 1049])
0067eb06 1050SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes},
1a6b111a
FC
1051 [Define to enable WCCP V2])
1052AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2])
320e9f36 1053
d9180414 1054AC_ARG_ENABLE(kill-parent-hack,
8075a4da 1055 AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [
1a6b111a
FC
1056SQUID_YESNO([$enableval],
1057 [unrecognized argument to --enable-kill-parent-hack: $enableval])
e5f4e1b0 1058])
0067eb06 1059SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no},
1a6b111a
FC
1060 [A dangerous feature which causes Squid to kill its parent
1061 process (presumably the RunCache script) upon receipt
1062 of SIGTERM or SIGINT. Deprecated, Use with caution.])
1063AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack])
20ad76ab 1064
e5f4e1b0 1065AC_ARG_ENABLE(snmp,
1d87b6b3 1066 AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
1a6b111a
FC
1067 SQUID_YESNO([$enableval],
1068 [unrecognized argument to --disable-snmp: $enableval])
87630341 1069])
0067eb06 1070SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes},
1a6b111a 1071 [Define to enable SNMP monitoring of Squid])
f738d783 1072AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"])
fcabe077 1073if test "x$enable_snmp" = "xyes"; then
4de1e2da 1074 SNMPLIB='../lib/snmplib/libsnmplib.la'
87630341 1075fi
1a6b111a 1076AC_MSG_NOTICE([SNMP support enabled: $enable_snmp])
e5f4e1b0 1077AC_SUBST(SNMPLIB)
e5f4e1b0 1078
d9180414 1079AC_ARG_ENABLE(cachemgr-hostname,
5069fb38
FC
1080 AS_HELP_STRING([--enable-cachemgr-hostname=hostname],
1081 [Make cachemgr.cgi default to this host.
1d87b6b3
FC
1082 If unspecified, uses the name of the build-host]), [
1083 case $enableval in
1084 yes)
1085 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1086 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1087 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1088 ;;
1089 no)
1090 : # Nothing to do..
1091 ;;
1092 *)
1093 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1094 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1095 ;;
1096 esac
e5f4e1b0 1097])
1098
ee0927b6 1099AC_ARG_ENABLE(eui,
1a6b111a 1100 AS_HELP_STRING([--disable-eui],
c8da66ba 1101 [Disable use of ARP / MAC/ EUI (ether address)]), [
1a6b111a
FC
1102SQUID_YESNO([$enableval],[--disable-eui expects no arguments])
1103])
fcabe077 1104if test "x${enable_eui:=yes}" = "xyes" ; then
507ca601 1105 case "$squid_host_os" in
a396d1f8 1106 linux|solaris|freebsd|openbsd|netbsd|cygwin)
507ca601
FC
1107 ${TRUE}
1108 ;;
a396d1f8 1109 mingw)
507ca601
FC
1110 EUILIB="-liphlpapi"
1111 ;;
1112 *)
1113 AC_MSG_WARN([EUI support probably will not work on host $host.])
1114 ;;
1115 esac
b966288b 1116 # iphlpapi.h check delayed after winsock2.h
507ca601 1117 AC_CHECK_HEADERS( \
32341684 1118 windows.h \
507ca601 1119 sys/sockio.h \
32341684
AJ
1120 sys/param.h,
1121 [], [], [[
1122#if HAVE_WINDOWS_H
1123include <windows.h>
54d47324 1124#endif
32341684 1125]]
507ca601 1126 )
29759678
FC
1127 AC_CHECK_HEADERS( \
1128 net/if_arp.h \
1129 net/route.h,
1130 [], [], [[
1131#include <sys/types.h>
1132#include <sys/socket.h>
1133]])
1134
43c1320a
AJ
1135 # OpenBSD, FreeBSD and NetBSD requires sys/param.h to be included before sysctl.h and net/if_dl.h
1136 AC_CHECK_HEADERS( \
1137 net/if_dl.h \
1138 sys/sysctl.h,
1139 [], [], [[
54d47324 1140#if HAVE_SYS_PARAM_H
29759678
FC
1141#include <sys/param.h>
1142#endif
1143 ]])
a98c2da5 1144fi
2ef664d8 1145AC_SUBST(EUILIB)
1a6b111a 1146AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui])
0067eb06 1147SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui,
1a6b111a 1148 [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.])
fcabe077 1149AM_CONDITIONAL(USE_SQUID_EUI, [test "x$enable_eui" = "xyes" ])
1a6b111a 1150
e5f4e1b0 1151
74075210 1152AC_ARG_ENABLE(htcp,
47d80734 1153 AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [
1a6b111a
FC
1154SQUID_YESNO([$enableval],
1155 [unrecognized argument to --disable-htcp: $enableval])
74075210 1156])
0f658b5b 1157SQUID_DEFINE_BOOL(USE_HTCP,${enable_htcp:=yes},
47d80734 1158 [Define this to include code for the Hypertext Cache Protocol (HTCP)])
fcabe077 1159AM_CONDITIONAL(ENABLE_HTCP, [test "x$enable_htcp" = "xyes"])
1a6b111a
FC
1160AC_MSG_NOTICE([HTCP support enabled: $enable_htcp])
1161
09cd7204
AJ
1162# Cryptograhic libraries
1163AC_ARG_WITH(nettle,
1164 AS_HELP_STRING([--without-nettle],[Compile without the Nettle crypto library.]),[
1165case "$with_nettle" in
1166 yes|no)
1167 : # Nothing special to do here
1168 ;;
1169 *)
1170 if test ! -d "$withval" ; then
1171 AC_MSG_ERROR([--with-nettle path does not point to a directory])
1172 fi
1173 NETTLELIBDIR="-L$with_nettle/lib"
1174 CPPFLAGS="-I$with_nettle/include $CPPFLAGS"
1175 with_nettle=yes
1176 esac
a9dfcab8 1177])
09cd7204
AJ
1178if test "x$with_nettle" != "xno" ; then
1179 AC_CHECK_LIB(nettle, nettle_md5_init,[
1180 NETTLELIB="$NETTLELIBDIR -lnettle"
f9ef3ed8 1181 AC_CHECK_HEADERS(nettle/md5.h)
09cd7204 1182 ],[with_nettle=no])
f9ef3ed8
AJ
1183 if test "x$with_nettle" != "xno" ; then
1184 # Base64 uses the nettle 3.0 API
1185 # which matters on 64-bit systems
1186 AC_CHECK_HEADERS(nettle/base64.h)
1187 AC_MSG_CHECKING([for Nettle 3.0 API compatibility])
1188 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1189# include <cstddef>
1190# include <cstdint>
1191# include <nettle/base64.h>
1192 ]],[[
1193 uint8_t inData[10]; inData[0] = '\0';
1194 size_t srcLen = 0;
1195 struct base64_decode_ctx ctx;
1196 base64_decode_init(&ctx);
1197 uint8_t outData[10];
1198 size_t dstLen = 0;
1199 if (!base64_decode_update(&ctx, &dstLen, outData, srcLen, inData) ||
1200 !base64_decode_final(&ctx)) {
1201 return 1;
1202 }
1203 ]])],[AC_MSG_RESULT(yes)
1204 AC_DEFINE(HAVE_NETTLE30_BASE64,1,[set to 1 if Nettle 3.0 API will link])
1205 ],[AC_MSG_RESULT(no)])
1206 fi
a9dfcab8 1207fi
09cd7204
AJ
1208AC_MSG_NOTICE([Using Nettle cryptographic library: ${with_nettle:=yes}])
1209AC_SUBST(NETTLELIB)
a9dfcab8 1210
e59a64d7
AJ
1211dnl Check for libcrypt
1212CRYPTLIB=
1213dnl Some of our helpers use crypt(3) which may be in libc, or in
1214dnl libcrypt (eg FreeBSD)
1215AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1216dnl Solaris10 provides MD5 natively through libmd5
1217AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
1218AC_SUBST(CRYPTLIB)
1219
b4f805f6
AJ
1220SSLLIB=""
1221
1222dnl User may want to disable GnuTLS
1223AC_ARG_WITH(gnutls,
1224 AS_HELP_STRING([--without-gnutls],
1225 [Do not use GnuTLS for SSL. Default: auto-detect]), [
1226case "$with_gnutls" in
1227 yes|no)
1228 : # Nothing special to do here
1229 ;;
1230 *)
1231 if test ! -d "$withval" ; then
1232 AC_MSG_ERROR([--with-gnutls path does not point to a directory])
1233 fi
1234 LIBGNUTLS_PATH="-L$with_gnutls/lib"
1235 CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
1236 esac
1237])
1238AH_TEMPLATE(USE_GNUTLS,[GnuTLS support is available])
1239if test "x$with_gnutls" != "xno"; then
1240 AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/x509.h)
1241
1242 # User may have provided a custom location for GnuTLS. Otherwise...
1243 SQUID_STATE_SAVE(squid_gnutls_state)
1244 LIBS="$LIBS $LIBGNUTLS_PATH"
1245
1246 # auto-detect using pkg-config
c113986e 1247 PKG_CHECK_MODULES([LIBGNUTLS],[gnutls >= 3.1.5],,[
b4f805f6 1248 ## find the package without pkg-config
c113986e
AJ
1249 ## check that the library is actually new enough.
1250 ## by testing for a 3.1.5+ function which we use
1251 AC_CHECK_LIB(gnutls,gnutls_certificate_verify_peers3,[LIBGNUTLS_LIBS="-lgnutls"])
b4f805f6
AJ
1252 ])
1253
1254 SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS
1255
1256 if test "x$with_gnutls" = "xyes" -a "x$LIBGNUTLS_LIBS" = "x"; then
1257 AC_MSG_ERROR([Required GnuTLS library not found])
1258 fi
1259 if test "x$LIBGNUTLS_LIBS" != "x" ; then
1260 CXXFLAGS="$LIBGNUTLS_CFLAGS $CXXFLAGS"
1261 SSLLIB="$LIBGNUTLS_PATH $LIBGNUTLS_LIBS $SSLLIB"
1262 AC_DEFINE(USE_GNUTLS,1,[GnuTLS support is available])
1263 else
1264 with_gnutls=no
1265 fi
1266fi
1267AC_MSG_NOTICE([GnuTLS library support: ${with_gnutls:=auto} ${LIBGNUTLS_PATH} ${LIBGNUTLS_LIBS}])
1268
3d4022fa 1269dnl User may specify OpenSSL is needed from a non-standard location
1f7c9178 1270AC_ARG_WITH(openssl,
f88ca0d1
FC
1271 AS_HELP_STRING([--with-openssl=PATH],
1272 [Compile with the OpenSSL libraries. The path to
86f53af2
FC
1273 the OpenSSL development libraries and headers
1274 installation can be specified if outside of the
f88ca0d1
FC
1275 system standard directories]), [
1276case "$with_openssl" in
a3b28798
HN
1277 yes|no)
1278 : # Nothing special to do here
1f7c9178 1279 ;;
1280 *)
fcabe077 1281 if test ! -d "$withval" ; then
f88ca0d1
FC
1282 AC_MSG_ERROR([--with-openssl path does not point to a directory])
1283 fi
84c3fc14 1284 LIBOPENSSL_PATH="-L$with_openssl/lib"
bcce53ce 1285 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
a3b28798 1286 with_openssl=yes
1f7c9178 1287 esac
1288])
cb4f4424 1289AH_TEMPLATE(USE_OPENSSL,[OpenSSL support is available])
c41db002
AJ
1290## OpenSSL is default disable due to licensing issues on some OS
1291if test "x$with_openssl" = "xyes"; then
1292 AC_CHECK_HEADERS( \
8693472e 1293 openssl/bio.h \
eacc1666 1294 openssl/crypto.h \
c41db002
AJ
1295 openssl/err.h \
1296 openssl/md5.h \
1297 openssl/opensslv.h \
1298 openssl/ssl.h \
1299 openssl/x509v3.h \
1300 openssl/engine.h \
1301 openssl/txt_db.h \
1302 )
1303
e0b98074 1304 # User may have provided a custom location for OpenSSL. Otherwise...
84c3fc14
AJ
1305 SQUID_STATE_SAVE(squid_openssl_state)
1306 LIBS="$LIBS $LIBOPENSSL_PATH"
1307
1308 # auto-detect using pkg-config
1309 PKG_CHECK_MODULES([LIBOPENSSL],[openssl],,[
1310 ## For some OS pkg-config is broken or unavailable.
1311 ## Detect libraries the hard way.
1312
1313 # Windows MinGW has some special libraries ...
1314 if test "x$squid_host_os" = "xmingw" ; then
1315 LIBOPENSSL_LIBS='-lssleay32 -leay32 -lgdi32 $LIBOPENSSL_LIBS'
1316 AC_MSG_NOTICE([Windows OpenSSL library support: yes -lssleay32 -leay32 -lgdi32])
1317 fi
e0b98074 1318
84c3fc14
AJ
1319 AC_CHECK_LIB(crypto,[CRYPTO_new_ex_data],[LIBOPENSSL_LIBS="-lcrypto $LIBOPENSSL_LIBS"],[
1320 AC_MSG_ERROR([library 'crypto' is required for OpenSSL])
1321 ])
1322 AC_CHECK_LIB(ssl,[SSL_library_init],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[
1323 AC_MSG_ERROR([library 'ssl' is required for OpenSSL])
e0b98074 1324 ])
84c3fc14 1325 ])
e0b98074 1326
84c3fc14
AJ
1327 # This is a workaround for RedHat 9 brain damage..
1328 if test -d /usr/kerberos/include -a -f /usr/include/openssl/kssl.h; then
1329 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1330 LIBOPENSSL_LIBS="-L/usr/kerberos/lib $LIBOPENSSL_LIBS"
1331 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
f11555e0 1332 fi
84c3fc14 1333 SQUID_STATE_ROLLBACK(squid_openssl_state) #de-pollute LIBS
1f7c9178 1334
e0b98074 1335 if test "x$LIBOPENSSL_LIBS" != "x"; then
c41db002 1336 CXXFLAGS="$LIBOPENSSL_CFLAGS $CXXFLAGS"
84c3fc14 1337 SSLLIB="$LIBOPENSSL_PATH $LIBOPENSSL_LIBS $SSLLIB"
cb4f4424 1338 AC_DEFINE(USE_OPENSSL,1,[OpenSSL support is available])
c41db002
AJ
1339
1340 # check for other specific broken implementations
1341 SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS
1342 SQUID_CHECK_OPENSSL_CONST_SSL_METHOD
1343 SQUID_CHECK_OPENSSL_TXTDB
a95989ed 1344 SQUID_CHECK_OPENSSL_HELLO_OVERWRITE_HACK
1f7c9178 1345 fi
e0b98074
AJ
1346 if test "x$SSLLIB" = "x"; then
1347 AC_MSG_ERROR([Required OpenSSL library not found])
f11555e0 1348 fi
1f7c9178 1349fi
84c3fc14 1350AC_MSG_NOTICE([OpenSSL library support: ${with_openssl:=no} ${LIBOPENSSL_PATH} ${LIBOPENSSL_LIBS}])
c41db002 1351AM_CONDITIONAL(ENABLE_SSL,[ test "x$with_openssl" = "xyes" ])
1f7c9178 1352AC_SUBST(SSLLIB)
1353
1a22a39e
MM
1354dnl User may specify MIT Kerberos is needed from a non-standard location
1355AC_ARG_WITH(mit-krb5,
a5c79bf3
AJ
1356 AS_HELP_STRING([--without-mit-krb5],
1357 [Compile without MIT Kerberos support.]), [
1a22a39e
MM
1358case "$with_mit_krb5" in
1359 yes|no)
1360 : # Nothing special to do here
1361 ;;
1362 *)
1363 if test ! -d "$withval" ; then
1364 AC_MSG_ERROR([--with-mit-krb5 path does not point to a directory])
1365 fi
1366 if test -d "$with_mit_krb5/lib64" ; then
1367 LIB_KRB5_PATH="-L$with_mit_krb5/lib64 -L$with_mit_krb5/lib"
1368 else
1369 LIB_KRB5_PATH="-L$with_mit_krb5/lib"
1370 fi
1371 CXXFLAGS="-I$with_mit_krb5/include $CXXFLAGS"
1372 krb5confpath="$with_mit_krb5/bin"
1373 with_mit_krb5=yes
1374esac
1375])
75f3c557 1376AH_TEMPLATE(USE_APPLE_KRB5,[Apple Kerberos support is available])
1a22a39e
MM
1377AH_TEMPLATE(USE_MIT_KRB5,[MIT Kerberos support is available])
1378AH_TEMPLATE(USE_SOLARIS_KRB5,[Solaris Kerberos support is available])
1379
75c5f82b
AJ
1380## find out if pkg-config or krb5-config will work
1381if test "x$with_mit_krb5" != "xno"; then
1a22a39e 1382 # find installed libs via pkg-config or krb5-config
75c5f82b 1383 squid_pc_krb5_name=
7c664dbc
AJ
1384 PKG_CHECK_EXISTS(mit-krb5-gssapi mit-krb5, [squid_pc_krb5_name="mit-krb5-gssapi mit-krb5"],[
1385 PKG_CHECK_EXISTS(gssapi-krb5 krb5, [squid_pc_krb5_name="gssapi-krb5 krb5"])
1386 ])
75c5f82b 1387 if test "x$squid_pc_krb5_name" = "x" -a "$cross_compiling" = "no"; then
77f4953d 1388 # Look for krb5-config (unless cross-compiling)
1a22a39e
MM
1389 AC_PATH_PROG(krb5_config,krb5-config,no)
1390 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1391 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1392 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1393 ac_solaris="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i solaris`"
75f3c557 1394 ac_apple="`$ac_cv_path_krb5_config --vendor 2>/dev/null | grep -c -i apple`"
1a22a39e
MM
1395 if test $ac_solaris -gt 0 ; then
1396 with_solaris_krb5=yes
75c5f82b 1397 elif test $ac_apple -gt 0 ; then
75f3c557 1398 with_apple_krb5=yes
75c5f82b
AJ
1399 elif test $ac_heimdal -gt 0; then
1400 with_mit_krb5=no
1401 if test "x$with_mit_krb5" = "xyes"; then
1402 AC_MSG_ERROR([Could not find pkg-config or krb5-config for MIT Kerberos])
1403 fi
1a22a39e
MM
1404 fi
1405 else
75c5f82b
AJ
1406 if test "x$with_mit_krb5" = "xyes"; then
1407 AC_MSG_ERROR([Could not find krb5-config in path])
1408 else
1409 with_mit_krb5=no
1410 fi
1a22a39e
MM
1411 fi
1412 fi
1413fi
1414
ed3a42d0
AJ
1415# detect MIT Kerberos dependencies (except on Solaris)
1416if test "x$with_mit_krb5" != "xno" -a "x$with_solaris_krb5" != "xyes"; then
1a22a39e
MM
1417 SQUID_STATE_SAVE([squid_krb5_save])
1418 LIBS="$LIBS $LIB_KRB5_PATH"
1419
1420 # auto-detect using pkg-config
75c5f82b 1421 PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[
77f4953d
AJ
1422 # look for krb5-config (unless cross-compiling)
1423 if test "$cross_compiling" = "no"; then
1424 if test "x$krb5confpath" = "x" ; then
1425 AC_PATH_PROG(krb5_config,krb5-config,no)
1426 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1427 ac_krb5_config="$ac_cv_path_krb5_config"
1428 fi
1429 else
1430 ac_krb5_config="$krb5confpath/krb5-config"
1a22a39e 1431 fi
1a22a39e
MM
1432 fi
1433 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1434 # Get libs, etc
1435 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1436 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1437 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1438 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1439 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1440 else
1441 ## For some OS pkg-config is broken or unavailable.
1442 ## Detect libraries the hard way.
1443
b2bdde72 1444 SQUID_STATE_SAVE([squid_mit_save])
ff78f3c3 1445 missing_required=
1a22a39e
MM
1446 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1447 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
ff78f3c3
AJ
1448 AC_MSG_WARN([library 'com_err' is required for MIT Kerberos])
1449 missing_required=yes
1a22a39e 1450 ])
b2bdde72 1451 LIBS=$LIB_KRB5_LIBS
1a22a39e 1452 AC_CHECK_LIB(k5crypto, [main], [LIB_KRB5_LIBS="-lk5crypto $LIB_KRB5_LIBS"],[
ff78f3c3
AJ
1453 AC_MSG_WARN([library 'k5crypto' is required for MIT Kerberos])
1454 missing_required=yes
1a22a39e 1455 ])
b2bdde72 1456 LIBS=$LIB_KRB5_LIBS
1a22a39e 1457 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
ff78f3c3
AJ
1458 AC_MSG_WARN([library 'krb5' is required for MIT Kerberos])
1459 missing_required=yes
1a22a39e 1460 ])
b2bdde72 1461 LIBS=$LIB_KRB5_LIBS
1a22a39e 1462 AC_CHECK_LIB(gssapi_krb5, [main], [LIB_KRB5_LIBS="-lgssapi_krb5 $LIB_KRB5_LIBS"],[
ff78f3c3
AJ
1463 AC_MSG_WARN([library 'gssapi_krb5' is required for MIT Kerberos])
1464 missing_required=yes
1a22a39e 1465 ])
b2bdde72 1466 SQUID_STATE_ROLLBACK([squid_mit_save])
ff78f3c3
AJ
1467 if test "x$missing_required" = "xyes"; then
1468 LIB_KRB5_LIBS=""
1469 fi
1a22a39e 1470 fi
1a22a39e
MM
1471 ])
1472
1473 if test "x$LIB_KRB5_LIBS" != "x"; then
75f3c557
MM
1474 if test "x$with_apple_krb5" = "xyes" ; then
1475 AC_DEFINE(USE_APPLE_KRB5,1,[Apple Kerberos support is available])
1476 KRB5_FLAVOUR="Apple"
1477 else
1478 AC_DEFINE(USE_MIT_KRB5,1,[MIT Kerberos support is available])
1479 KRB5_FLAVOUR="MIT"
1480 fi
1a22a39e
MM
1481 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1482 KRB5INCS="$LIB_KRB5_CFLAGS"
1a22a39e
MM
1483
1484 # check for other specific broken implementations
1485 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1486 LIBS="$LIBS $KRB5LIBS"
1487
1488 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1489 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1490 AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
1491 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1492 AC_CHECK_HEADERS(profile.h)
1493
1a22a39e 1494 SQUID_CHECK_KRB5_FUNCS
1a22a39e 1495 fi
75c5f82b 1496 if test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1a22a39e 1497 AC_MSG_ERROR([Required Kerberos library not found])
75c5f82b
AJ
1498 elif test "x$KRB5LIBS" = "x"; then
1499 with_mit_krb5=no
1500 with_apple_krb5=no
1a22a39e 1501 fi
1a22a39e
MM
1502 SQUID_STATE_ROLLBACK([squid_krb5_save])
1503fi
1504
75c5f82b
AJ
1505# detect Solaris Kerberos dependencies
1506if test "x$with_solaris_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1a22a39e
MM
1507 SQUID_STATE_SAVE([squid_krb5_save])
1508 LIBS="$LIBS $LIB_KRB5_PATH"
1509
1510 # no pkg-config for solaris native Kerberos
77f4953d
AJ
1511 # look for krb5-config (unless cross-compiling)
1512 if test "$cross_compiling" = "no"; then
1513 if test "x$krb5confpath" = "x" ; then
1514 AC_PATH_PROG(krb5_config,krb5-config,no)
1515 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1516 ac_krb5_config="$ac_cv_path_krb5_config"
1517 fi
1518 else
1519 ac_krb5_config="$krb5confpath/krb5-config"
1a22a39e 1520 fi
1a22a39e
MM
1521 fi
1522 if test "x$ac_krb5_config" != "x" && test -x "$ac_krb5_config"; then
1523 # Get libs, etc
1524 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1525 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1526 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
b2da83da
AJ
1527 # Solaris 10 Update 11 patches the krb5-config tool to produce stderr messages on stdout.
1528 SOLARIS_BROKEN_KRB5CONFIG_GSSAPI="`$ac_krb5_config --libs gssapi 2>/dev/null | grep "krb5-config"`"
1529 if test "x$SOLARIS_BROKEN_KRB5CONFIG_GSSAPI" = "x"; then
1530 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1531 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1532 fi
1a22a39e
MM
1533 else
1534 ## For some OS pkg-config is broken or unavailable.
1535 ## Detect libraries the hard way.
1536
1537 CXXFLAGS="-I/usr/include/kerberosv5 $CXXFLAGS"
1538
b2bdde72 1539 SQUID_STATE_SAVE([squid_solaris_save])
ff78f3c3 1540 missing_required=
1a22a39e
MM
1541 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1542 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
ff78f3c3
AJ
1543 AC_MSG_WARN([library 'krb5' is required for Solaris Kerberos])
1544 missing_required=yes
1a22a39e 1545 ])
b2bdde72 1546 LIBS=$LIB_KRB5_LIBS
1a22a39e 1547 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
ff78f3c3
AJ
1548 AC_MSG_WARN([library 'gss' is required for Solaris Kerberos])
1549 missing_required=yes
1a22a39e 1550 ])
b2bdde72 1551 SQUID_STATE_ROLLBACK([squid_solaris_save])
ff78f3c3
AJ
1552 if test "x$missing_required" = "xyes"; then
1553 LIB_KRB5_LIBS=""
1554 fi
1a22a39e
MM
1555 fi
1556
1557 if test "x$LIB_KRB5_LIBS" != "x"; then
1558 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1559 KRB5INCS="$LIB_KRB5_CFLAGS"
1560 AC_DEFINE(USE_SOLARIS_KRB5,1,[Solaris Kerberos support is available])
1561 KRB5_FLAVOUR="Solaris"
1562
1563 # check for other specific broken implementations
1564 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1565 LIBS="$LIBS $KRB5LIBS"
1566
1567 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1568 AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_ext.h)
1569 AC_CHECK_HEADERS(krb5.h com_err.h)
1570
1571 SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
1572 if test "x$squid_cv_broken_krb5_h" = "xyes"; then
1573 AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if Solaris krb5.h is broken for C++])
1574 AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.])
1575 AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512])
1576 AC_MSG_WARN([If you need Kerberos support you will have to patch])
1577 AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch])
1578 fi
1a22a39e 1579 SQUID_CHECK_KRB5_FUNCS
1a22a39e 1580 fi
75c5f82b
AJ
1581 if test "x$with_mit_krb5" = "xyes" -a "x$KRB5LIBS" = "x"; then
1582 # Error only if Solaris flavour was detected while looking for required MIT Kerberos
1a22a39e 1583 AC_MSG_ERROR([Required Kerberos library not found])
75c5f82b
AJ
1584 elif test "x$KRB5LIBS" = "x"; then
1585 with_solaris_krb5=no
1586 with_mit_krb5=no
1a22a39e 1587 fi
1a22a39e
MM
1588 SQUID_STATE_ROLLBACK([squid_krb5_save])
1589fi
1590
75c5f82b
AJ
1591dnl User may specify Heimdal Kerberos is needed from a non-standard location
1592AC_ARG_WITH(heimdal-krb5,
1593 AS_HELP_STRING([--without-heimdal-krb5],
1594 [Compile without Heimdal Kerberos support.]), [
1595case "$with_heimdal_krb5" in
1596 yes|no)
1597 : # Nothing special to do here
1598 ;;
1599 *)
1600 if test ! -d "$withval" ; then
1601 AC_MSG_ERROR([--with-heimdal-krb5 path does not point to a directory])
1602 fi
1603 if test -d "$with_heimdal_krb5/lib64" ; then
1604 LIB_KRB5_PATH="-L$with_heimdal_krb5/lib64 -L$with_heimdal_krb5/lib"
1605 else
1606 LIB_KRB5_PATH="-L$with_heimdal_krb5/lib"
1607 fi
1608 CXXFLAGS="-I$with_heimdal_krb5/include $CXXFLAGS"
1609 krb5confpath="$with_heimdal_krb5/bin"
1610 with_heimdal_krb5=yes
1611esac
1612])
1613AH_TEMPLATE(USE_HEIMDAL_KRB5,[Heimdal Kerberos support is available])
1614if test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"; then
1615 # find installed libs via pkg-config or krb5-config
1616 PKG_CHECK_EXISTS(heimdal-krb5, [squid_pc_krb5_name="heimdal-krb5"])
1617 if test "x$squid_pc_krb5_name" = "x"; then
1618 PKG_CHECK_EXISTS(heimdal-gssapi, [squid_pc_krb5_name="heimdal-gssapi"])
1619 fi
1620 if test "x$squid_pc_krb5_name" != "x" -a "$cross_compiling" = "no"; then
1621 # Look for krb5-config (unless cross-compiling)
1622 AC_PATH_PROG(krb5_config,krb5-config,no)
1623 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1624 krb5confpath="`dirname $ac_cv_path_krb5_config`"
1625 ac_heimdal="`$ac_cv_path_krb5_config --version 2>/dev/null | grep -c -i heimdal`"
1626 if test "x$with_heimdal_krb5" = "xyes"; then
1627 AC_MSG_ERROR([Could not find pkg-config or krb5-config for Heimdal Kerberos])
1628 fi
1629 else
1630 if test "x$with_heimdal_krb5" = "xyes"; then
1631 AC_MSG_ERROR([Could not find krb5-config in path])
1632 else
1633 AC_MSG_WARN([Could not find krb5-config in path])
1634 with_heimdal_krb5=no
1635 fi
1636 fi
1637 fi
1638fi
1639if test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"; then
1a22a39e
MM
1640 SQUID_STATE_SAVE([squid_krb5_save])
1641 LIBS="$LIBS $LIB_KRB5_PATH"
1642
1643 # auto-detect using pkg-config
75c5f82b 1644 PKG_CHECK_MODULES([LIB_KRB5], $squid_pc_krb5_name,,[
77f4953d
AJ
1645 # look for krb5-config (unless cross-compiling)
1646 if test "$cross_compiling" = "no"; then
1647 if test "x$krb5confpath" = "x" ; then
1648 AC_PATH_PROG(krb5_config,krb5-config,no)
1649 if test "x$ac_cv_path_krb5_config" != "xno" ; then
1650 ac_krb5_config="$ac_cv_path_krb5_config"
1651 fi
1652 else
1653 ac_krb5_config="$krb5confpath/krb5-config"
1a22a39e 1654 fi
1a22a39e 1655 fi
75c5f82b 1656 if test "x$ac_krb5_config" != "x" -a -x "$ac_krb5_config"; then
1a22a39e
MM
1657 # Get libs, etc
1658 AC_MSG_NOTICE([Use krb5-config to get CXXFLAGS and LIBS])
1659 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags krb5 2>/dev/null`"
1660 LIB_KRB5_LIBS="`$ac_krb5_config --libs krb5 2>/dev/null`"
1661 LIB_KRB5_CFLAGS="`$ac_krb5_config --cflags gssapi 2>/dev/null` $LIB_KRB5_CFLAGS"
1662 LIB_KRB5_LIBS="`$ac_krb5_config --libs gssapi 2>/dev/null` $LIB_KRB5_LIBS"
1663 else
1664 ## For some OS pkg-config is broken or unavailable.
1665 ## Detect libraries the hard way.
b2bdde72 1666 SQUID_STATE_SAVE([squid_heimdal_save])
87a4a80f 1667 missing_required=
1a22a39e
MM
1668 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1669 AC_CHECK_LIB(resolv, [main], [LIB_KRB5_LIBS="-lresolv $LIB_KRB5_LIBS"],[
87a4a80f
AJ
1670 AC_MSG_WARN([library 'resolv' is required for Heimdal Kerberos])
1671 missing_required=yes
1a22a39e 1672 ])
b2bdde72 1673 LIBS=$LIB_KRB5_LIBS
1a22a39e 1674 AC_CHECK_LIB(crypt, [main], [LIB_KRB5_LIBS="-lcrypt $LIB_KRB5_LIBS"],[
87a4a80f
AJ
1675 AC_MSG_WARN([library 'crypt' is required for Heimdal Kerberos])
1676 missing_required=yes
1a22a39e 1677 ])
b2bdde72 1678 LIBS=$LIB_KRB5_LIBS
1a22a39e 1679 AC_CHECK_LIB(roken, [main], [LIB_KRB5_LIBS="-lroken $LIB_KRB5_LIBS"],[
87a4a80f
AJ
1680 AC_MSG_WARN([library 'roken' is required for Heimdal Kerberos])
1681 missing_required=yes
1a22a39e 1682 ])
b2bdde72 1683 LIBS=$LIB_KRB5_LIBS
1a22a39e
MM
1684 AC_CHECK_LIB(heimbase, [main], [LIB_KRB5_LIBS="-lheimbase $LIB_KRB5_LIBS"],[
1685 AC_MSG_WARN([library 'heimbase' may be required for Heimdal Kerberos])
1686 ])
b2bdde72 1687 LIBS=$LIB_KRB5_LIBS
1a22a39e
MM
1688 AC_CHECK_LIB(wind, [main], [LIB_KRB5_LIBS="-lwind $LIB_KRB5_LIBS"],[
1689 AC_MSG_WARN([library 'wind' may be required for Heimdal Kerberos])
1690 ])
b2bdde72 1691 LIBS=$LIB_KRB5_LIBS
1a22a39e 1692 AC_CHECK_LIB(crypto, [main], [LIB_KRB5_LIBS="-lcrypto $LIB_KRB5_LIBS"],[
87a4a80f
AJ
1693 AC_MSG_WARN([library 'crypto' is required for Heimdal Kerberos])
1694 missing_required=yes
1a22a39e 1695 ])
b2bdde72 1696 LIBS=$LIB_KRB5_LIBS
1a22a39e 1697 AC_CHECK_LIB(com_err, [main], [LIB_KRB5_LIBS="-lcom_err $LIB_KRB5_LIBS"],[
87a4a80f
AJ
1698 AC_MSG_WARN([library 'com_err' is required for Heimdal Kerberos])
1699 missing_required=yes
1a22a39e 1700 ])
b2bdde72 1701 LIBS=$LIB_KRB5_LIBS
1a22a39e
MM
1702 AC_CHECK_LIB(hx509, [main], [LIB_KRB5_LIBS="-lhx509 $LIB_KRB5_LIBS"],[
1703 AC_MSG_WARN([library 'hx509' may be required for Heimdal Kerberos])
1704 ])
b2bdde72 1705 LIBS=$LIB_KRB5_LIBS
1a22a39e 1706 AC_CHECK_LIB(asn1, [main], [LIB_KRB5_LIBS="-lasn1 $LIB_KRB5_LIBS"],[
87a4a80f
AJ
1707 AC_MSG_WARN([library 'asn1' is required for Heimdal Kerberos])
1708 missing_required=yes
1a22a39e 1709 ])
b2bdde72 1710 LIBS=$LIB_KRB5_LIBS
1a22a39e 1711 AC_CHECK_LIB(krb5, [main], [LIB_KRB5_LIBS="-lkrb5 $LIB_KRB5_LIBS"],[
87a4a80f
AJ
1712 AC_MSG_WARN([library 'krb5' is required for Heimdal Kerberos])
1713 missing_required=yes
1a22a39e 1714 ])
b2bdde72 1715 LIBS=$LIB_KRB5_LIBS
1a22a39e
MM
1716 AC_CHECK_LIB(heimntlm, [main], [LIB_KRB5_LIBS="-lheimntlm $LIB_KRB5_LIBS"],[
1717 AC_MSG_WARN([library 'heimntlm' may be required for Heimdal Kerberos])
1718 ])
b2bdde72 1719 LIBS=$LIB_KRB5_LIBS
1a22a39e 1720 AC_CHECK_LIB(gssapi, [main], [LIB_KRB5_LIBS="-lgssapi $LIB_KRB5_LIBS"],[
87a4a80f
AJ
1721 AC_MSG_WARN([library 'gssapi' is required for Heimdal Kerberos])
1722 missing_required=yes
1a22a39e 1723 ])
b2bdde72 1724 SQUID_STATE_ROLLBACK([squid_heimdal_save])
87a4a80f
AJ
1725 if test "x$missing_required" = "xyes"; then
1726 LIB_KRB5_LIBS=""
1727 fi
1a22a39e 1728 fi
1a22a39e
MM
1729 ])
1730 if test "x$LIB_KRB5_LIBS" != "x"; then
1731 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1732 KRB5INCS="$LIB_KRB5_CFLAGS"
1733 AC_DEFINE(USE_HEIMDAL_KRB5,1,[Heimdal Kerberos support is available])
1734 KRB5_FLAVOUR="Heimdal"
1735
1736 # check for other specific broken implementations
1737 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1738 LIBS="$LIBS $KRB5LIBS"
1739
1740 AC_MSG_NOTICE([Try to find Kerberos headers in given path])
1741 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h)
1742 AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
1743
1744 SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
1745 if test "x$squid_cv_broken_heimdal_krb5_h" = "xyes"; then
1746 AC_DEFINE(HAVE_BROKEN_HEIMDAL_KRB5_H, 1, [Define to 1 if Heimdal krb5.h is broken for C++])
1747 fi
1a22a39e 1748 SQUID_CHECK_KRB5_FUNCS
1a22a39e
MM
1749 fi
1750 if test "x$KRB5LIBS" = "x"; then
75c5f82b
AJ
1751 if test test "x$with_heimdal_krb5" = "xyes"; then
1752 AC_MSG_ERROR([Required Heimdal Kerberos library not found])
1753 else
1754 AC_MSG_WARN([Heimdal Kerberos library not found])
1755 fi
1a22a39e 1756 fi
1a22a39e
MM
1757 SQUID_STATE_ROLLBACK([squid_krb5_save])
1758fi
1759
75c5f82b
AJ
1760dnl User may specify GNU gss is needed from a non-standard location
1761AC_ARG_WITH(gnugss,
1762 AS_HELP_STRING([--without-gnugss],
1763 [Compile without the GNU gss libraries.]), [
1764case "$with_gnugss" in
1765 yes|no)
1766 : # Nothing special to do here
1767 ;;
1768 *)
1769 if test ! -d "$withval" ; then
1770 AC_MSG_ERROR([--with-gnugss path does not point to a directory])
1771 fi
1772 if test ! -d "$with_gnugss/lib64" ; then
1773 LIB_KRB5_PATH="-L$with_gnugss/lib64 -L$with_gnugss/lib"
1774 else
1775 LIB_KRB5_PATH="-L$with_gnugss/lib"
1776 fi
1777 CXXFLAGS="-I$with_gnugss/include $CXXFLAGS"
1778 krb5confpath=
1779 with_gnugss=yes
1780esac
1781])
1782AH_TEMPLATE(USE_GNUGSS,[GNU gss support is available])
1783if test "x$with_gnugss" != "xno" -a "x$KRB5LIBS" = "x"; then
1a22a39e
MM
1784 SQUID_STATE_SAVE([squid_krb5_save])
1785 LIBS="$LIBS $LIB_KRB5_PATH"
1786
1787 # auto-detect using pkg-config
1788 PKG_CHECK_MODULES([LIB_KRB5],[gss],,[
1789 ## For some OS pkg-config is broken or unavailable.
1790 ## Detect libraries the hard way.
1791
1792 AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
1793 AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
75c5f82b 1794 AC_MSG_WARN([library 'com_err' is required for GNU Kerberos])
1a22a39e 1795 ])
1a22a39e
MM
1796 ])
1797
1798 if test "x$LIB_KRB5_LIBS" != "x"; then
1799 KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
1800 KRB5INCS="$LIB_KRB5_CFLAGS"
1801 AC_DEFINE(USE_GNUGSS,1,[GNU Kerberos support is available])
1802 KRB5_FLAVOUR="GNU GSS"
1803
1804 # check for other specific broken implementations
1805 CXXFLAGS="$CXXFLAGS $KRB5INCS"
1806 LIBS="$LIBS $KRB5LIBS"
1807
1808 AC_MSG_NOTICE([Try to find Kerbeors headers in given path])
1809 AC_CHECK_HEADERS(gss.h)
1810
1811 SQUID_CHECK_WORKING_GSSAPI
1812 SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support])
1813
1814 SQUID_CHECK_SPNEGO_SUPPORT
1815 SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support])
1816
1817 SQUID_CHECK_WORKING_KRB5
1818 SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support])
1a22a39e
MM
1819 fi
1820 if test "x$KRB5LIBS" = "x"; then
75c5f82b
AJ
1821 if test test "x$with_gnugss" = "xyes"; then
1822 AC_MSG_ERROR([Required GNU GSS Kerberos library not found])
1823 else
1824 AC_MSG_WARN([GNU GSS Kerberos library not found])
1825 fi
1a22a39e 1826 fi
1a22a39e
MM
1827 SQUID_STATE_ROLLBACK([squid_krb5_save])
1828fi
75c5f82b
AJ
1829
1830if test "x$KRB5LIBS" != "x"; then
1a22a39e
MM
1831 with_krb5=yes
1832fi
1833AC_MSG_NOTICE([$KRB5_FLAVOUR Kerberos library support: ${with_krb5:=no} ${LIB_KRB5_PATH} ${LIB_KRB5_LIBS}])
1834AC_SUBST(KRB5INCS)
1835AC_SUBST(KRB5LIBS)
1836AM_CONDITIONAL(HAVE_SPNEGO, test x"$squid_cv_have_spnego" = x"yes" )
1837
1838dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
1839dnl only with Windows LDAP libraries using -lwldap32
1840case "$squid_host_os" in
1841 mingw)
1842 LDAPLIB="-lwldap32"
1843 LBERLIB=""
1844 ;;
1845 *)
1846 AC_CHECK_LIB(ldap, ldap_init, [LDAPLIB="-lldap"])
1847 dnl LDAP helpers need to know if -llber is needed or not
1848 AC_CHECK_LIB(lber, ber_init, [LBERLIB="-llber"])
1849 dnl if no ldap lib found check for mozilla version
1850 if test "x$ac_cv_lib_ldap_ldap_init" != x""yes; then
1851 oLIBS=$LIBS
1852 LIBS="$LIBPTHREADS"
1853 AC_CHECK_LIB(ldap60, ldap_init, [LDAPLIB="-lldap60"])
1854 LIBS="$LDAPLIB $LIBPTHREADS"
1855 AC_CHECK_LIB(prldap60, prldap_init, [LDAPLIB="-lprldap60 $LDAPLIB"])
1856 LIBS="$LDAPLIB $LIBPTHREADS"
1857 AC_CHECK_LIB(ssldap60, ldapssl_init, [LDAPLIB="-lssldap60 $LDAPLIB"])
1858 LIBS=$oLIBS
1859 fi
1860
1861 AC_CHECK_HEADERS(ldap.h lber.h)
1862 AC_CHECK_HEADERS(mozldap/ldap.h)
1863
1864 dnl
1865 dnl Check for LDAP_OPT_DEBUG_LEVEL
1866 dnl
1867 AC_MSG_CHECKING([for LDAP_OPT_DEBUG_LEVEL])
1868 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1869# include <ldap.h>
1870 ]],[[
1871 int i=LDAP_OPT_DEBUG_LEVEL
1872 ]])],
1873 [ AC_MSG_RESULT(yes) ],
1874 [ AC_MSG_RESULT(no) ])
1875
1876 dnl
1877 dnl Check for working ldap
1878 dnl
1879 oLIBS=$LIBS
1880 LIBS="$LDAPLIB $LBERLIB $LIBPTHREADS"
1881 AC_MSG_CHECKING([for working ldap])
1882 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1883# define LDAP_DEPRECATED 1
1884# if HAVE_LDAP_H
1885# include <ldap.h>
1886# elif HAVE_MOZLDAP_LDAP_H
1887# include <mozldap/ldap.h>
1888# endif
1889 int
1890 main(void)
1891 {
1892 char host[]="";
1893 int port;
1894
1895 ldap_init((const char *)&host, port);
1896
1897 return 0;
1898 }
1899 ]])],
1900 [ AC_DEFINE(HAVE_LDAP, 1, [LDAP support])
1901 AC_MSG_RESULT(yes) ],
1902 [ AC_MSG_RESULT(no) ],
1903 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1904 LIBS=$oLIBS
1905
1906 dnl
1907 dnl Check for ldap vendor
1908 dnl
1909 AC_MSG_CHECKING([for OpenLDAP])
1910 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1911# if HAVE_LDAP_H
1912# include <ldap.h>
1913# endif
1914# include <string.h>
1915 int
1916 main(void)
1917 {
1918 return strcmp(LDAP_VENDOR_NAME,"OpenLDAP");
1919 }
1920 ]])],
1921 [ AC_DEFINE(HAVE_OPENLDAP, 1, [OpenLDAP support])
1922 AC_MSG_RESULT(yes) ],
1923 [ AC_MSG_RESULT(no) ],
1924 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1925
1926 AC_MSG_CHECKING([for Sun LDAP SDK])
1927 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1928# if HAVE_LDAP_H
1929# include <ldap.h>
1930# endif
1931# include <string.h>
1932 int
1933 main(void)
1934 {
1935 return strcmp(LDAP_VENDOR_NAME,"Sun Microsystems Inc.");
1936 }
1937 ]])],
1938 [ AC_DEFINE(HAVE_SUN_LDAP_SDK, 1, [Sun LDAP SDK support])
1939 AC_MSG_RESULT(yes) ],
1940 [ AC_MSG_RESULT(no) ],
1941 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1942
1943 AC_MSG_CHECKING([for Mozilla LDAP SDK])
1944 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1945# if HAVE_LDAP_H
1946# include <ldap.h>
1947# elif HAVE_MOZLDAP_LDAP_H
1948# include <mozldap/ldap.h>
1949# endif
1950# include <string.h>
1951 int
1952 main(void)
1953 {
1954 return strcmp(LDAP_VENDOR_NAME,"mozilla.org");
1955 }
1956 ]])],
1957 [ AC_DEFINE(HAVE_MOZILLA_LDAP_SDK, 1, [Mozilla LDAP SDK support])
1958 AC_MSG_RESULT(yes) ],
1959 [ AC_MSG_RESULT(no)],
1960 [ AC_MSG_RESULT(cross-compiler cant tell) ])
1961
1962 dnl
1963 dnl Check for LDAP_REBINDPROC_CALLBACK
1964 dnl
1965 AC_MSG_CHECKING([for LDAP_REBINDPROC_CALLBACK])
1966 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1967# if HAVE_LDAP_H
1968# include <ldap.h>
1969# elif HAVE_MOZLDAP_LDAP_H
1970# include <mozldap/ldap.h>
1971# endif
1972 ]],[[
1973 LDAP_REBINDPROC_CALLBACK ldap_rebind;
1974 ]])],
1975 [ AC_DEFINE(HAVE_LDAP_REBINDPROC_CALLBACK,1,[Define to 1 if you have LDAP_REBINDPROC_CALLBACK])
1976 AC_MSG_RESULT(yes) ],
1977 [ AC_MSG_RESULT(no) ])
1978
1979 dnl
1980 dnl Check for LDAP_REBIND_PROC
1981 dnl
1982 AC_MSG_CHECKING([for LDAP_REBIND_PROC])
1983 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1984# if HAVE_LDAP_H
1985# include <ldap.h>
1986# elif HAVE_MOZLDAP_LDAP_H
1987# include <mozldap/ldap.h>
1988# endif
1989 ]],[[
1990 LDAP_REBIND_PROC ldap_rebind;
1991 ]])],
1992 [ AC_DEFINE(HAVE_LDAP_REBIND_PROC,1,[Define to 1 if you have LDAP_REBIND_PROC])
1993 AC_MSG_RESULT(yes) ],
1994 [ AC_MSG_RESULT(no) ])
1995
1996 dnl
1997 dnl Check for LDAP_REBIND_FUNCTION
1998 dnl
1999 AC_MSG_CHECKING([for LDAP_REBIND_FUNCTION])
2000 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2001# define LDAP_REFERRALS
2002# if HAVE_LDAP_H
2003# include <ldap.h>
2004# elif HAVE_MOZLDAP_LDAP_H
2005# include <mozldap/ldap.h>
2006# endif
2007 ]],[[
2008 LDAP_REBIND_FUNCTION ldap_rebind;
2009 ]])],
2010 [ AC_DEFINE(HAVE_LDAP_REBIND_FUNCTION,1,[Define to 1 if you have LDAP_REBIND_FUNCTION])
2011 AC_MSG_RESULT(yes) ],
2012 [ AC_MSG_RESULT(no) ])
2013
2014 dnl
2015 dnl Check for LDAP_SCOPE_DEFAULT
2016 dnl
2017 AC_MSG_CHECKING([for LDAP_SCOPE_DEFAULT])
2018 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2019# if HAVE_LDAP_H
2020# include <ldap.h>
2021# elif HAVE_MOZLDAP_LDAP_H
2022# include <mozldap/ldap.h>
2023# endif
2024 ]],[[
2025 int i=LDAP_SCOPE_DEFAULT;
2026 ]])],
2027 [ AC_DEFINE(HAVE_LDAP_SCOPE_DEFAULT,1,[Define to 1 if you have LDAP_SCOPE_DEFAULT])
2028 AC_MSG_RESULT(yes) ],
2029 [ AC_MSG_RESULT(no) ])
2030
2031 dnl
2032 dnl Check for ldap_url_desc.lud_scheme
2033 dnl
2034 AC_CHECK_MEMBER(struct ldap_url_desc.lud_scheme,
2035 AC_DEFINE(HAVE_LDAP_URL_LUD_SCHEME,1,
2036 [Define to 1 if you have LDAPURLDesc.lud_scheme]),,[#include <ldap.h>])
2037
2038 dnl
2039 dnl Check for ldapssl_client_init
2040 dnl
2041 AC_CHECK_LIB(ldap,ldapssl_client_init,
2042 AC_DEFINE(HAVE_LDAPSSL_CLIENT_INIT,1,[Define to 1 if you have ldapssl_client_init]),)
2043
2044 dnl
2045 dnl Check for ldap_url_desc2str
2046 dnl
2047 AC_CHECK_LIB(ldap,ldap_url_desc2str,
2048 AC_DEFINE(HAVE_LDAP_URL_DESC2STR,1,[Define to 1 if you have ldap_url_desc2str]),)
2049
2050 dnl
2051 dnl Check for ldap_url_parse
2052 dnl
2053 AC_CHECK_LIB(ldap,ldap_url_parse,
2054 AC_DEFINE(HAVE_LDAP_URL_PARSE,1,[Define to 1 if you have ldap_url_parse]),)
2055
2056 dnl
2057 dnl Check for ldap_start_tls_s
2058 dnl
2059 AC_CHECK_LIB(ldap,ldap_start_tls_s,
2060 AC_DEFINE(HAVE_LDAP_START_TLS_S,1,[Define to 1 if you have ldap_start_tls_s]),)
2061 ;;
2062esac
2063
2064AC_SUBST(LDAPLIB)
2065AC_SUBST(LBERLIB)
2066
02749868 2067AC_ARG_ENABLE(forw-via-db,
47d80734
FC
2068 AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [
2069 SQUID_YESNO([$enableval],[unrecognized argument to --enable-forw-via-db: $enableval])
02749868 2070])
21f6708d 2071SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no},
9676633b
FC
2072 [Enable Forw/Via database])
2073AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db])
02749868 2074
6cfa8966 2075AC_ARG_ENABLE(cache-digests,
47d80734 2076 AS_HELP_STRING([--enable-cache-digests],
9676633b
FC
2077 [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
2078[
2079 SQUID_YESNO($enableval,
2080 [unrecognized argument to --enable-cache-digests: $enableval])
484f2ebc 2081])
0067eb06 2082SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no},
47d80734 2083 [Use Cache Digests for locating objects in neighbor caches.])
9676633b 2084AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests])
47d80734 2085
484f2ebc 2086
9676633b
FC
2087################################
2088# check for netio plugin stuff #
2089################################
2090dnl order of these options handling is relevant in case the user
2091dnl supplies more than one --enable option. Options handled later
2092dnl override those handled earlier for io loop method manual override
2093AC_ARG_ENABLE(select,
2094 AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
2095[
2096SQUID_YESNO($enableval,[--disable-select takes no extra argument])
39145d19
AJ
2097if test "x$enableval" = "xyes"; then
2098 if test "x$squid_host_os" = "xmingw"; then
2099 squid_opt_io_loop_engine="select_win32"
2100 else
2101 squid_opt_io_loop_engine="select"
2102 fi
2103fi
9676633b
FC
2104])
2105AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}])
cd748f27 2106
9bb83c8b 2107AC_ARG_ENABLE(poll,
62979ab1 2108 AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
1b3db6d9 2109[
9676633b 2110SQUID_YESNO($enableval,[--disable-poll takes no extra argument])
fcabe077 2111test "x$enableval" = "xyes" && squid_opt_io_loop_engine="poll"
9bb83c8b 2112])
9676633b 2113AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}])
9bb83c8b 2114
1b3db6d9 2115AC_ARG_ENABLE(kqueue,
26d50fd2
AJ
2116 AS_HELP_STRING([--disable-kqueue],
2117 [Disable kqueue(2) support.]), [
9676633b 2118SQUID_YESNO($enableval,[--enable-kqueue takes no extra argument])
1b3db6d9 2119])
26d50fd2
AJ
2120if test "x${enable_kqueue:=auto}" != "xno" ; then
2121 AC_CHECK_HEADERS([sys/event.h],[],[
2122 if test "x${enable_kqueue}" = "xyes" ; then
2123 AC_MSG_ERROR([kqueue support requires sys/event.h header file.])
2124 fi
2125 ])
2126 AC_CHECK_FUNCS(kqueue,[],[
2127 if test "x${enable_kqueue}" = "xyes" ; then
2128 AC_MSG_ERROR([kqueue support missing in libc library.])
2129 fi
2130 ])
2131 if test "x$ac_cv_func_kqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes" ; then
2132 squid_opt_io_loop_engine="kqueue"
2133 else
2134 enable_kqueue="no"
2135 fi
9676633b 2136fi
26d50fd2 2137AC_MSG_NOTICE([enabling kqueue for net I/O: ${enable_kqueue:=auto}])
1b3db6d9 2138
a46d2c0e 2139dnl Enable epoll()
a46d2c0e 2140AC_ARG_ENABLE(epoll,
62979ab1 2141 AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
a46d2c0e 2142[
9676633b 2143SQUID_YESNO($enableval,[--disable-epoll takes no extra argument])
fcabe077 2144test "x$enableval" = "xyes" && squid_opt_io_loop_engine="epoll"
a46d2c0e 2145])
9676633b 2146AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}])
2ca8b332 2147
9676633b
FC
2148# auto-detect and verify epoll header and library present and working
2149# logic mapping and loop method selection are performed later
fcabe077 2150if test "x$enable_epoll" != "xno" ; then
2ca8b332 2151
9676633b
FC
2152 # check if libs are needed to support epoll
2153 # note: this code block seems quite generic. Could it be extracted
2154 # into a squid specific configure function?
af1e01a8 2155 SQUID_STATE_SAVE(squid_epoll_state)
9676633b 2156 AC_SEARCH_LIBS(epoll_ctl,[epoll])
fcabe077 2157 if test "x$ac_cv_search_epoll_ctl" = "xno" ; then
9676633b 2158 enable_epoll=no #disable. Needed code not found
fcabe077 2159 elif test "x$ac_cv_search_epoll_ctl" = "xnone required" ; then
9676633b
FC
2160 EPOLL_LIBS=""
2161 else
2162 EPOLL_LIBS=$ac_cv_search_epoll_ctl
2163 fi
2164 AC_SUBST(EPOLL_LIBS)
2165 SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS
a46d2c0e 2166
9676633b 2167 # epoll requires sys/epoll.h
98d13964 2168 AC_CHECK_HEADERS([sys/epoll.h])
ad32c661
AJ
2169
2170 dnl Verify that epoll really works
dcac6885 2171 if test "x$ac_cv_search_epoll_ctl" != 'xno' ; then
af1e01a8 2172 SQUID_CHECK_EPOLL
ad32c661 2173 fi
2ca8b332 2174
fcabe077 2175 if test "x$enable_epoll" = "xyes" -a "x$squid_cv_epoll_works" = "xno" ; then
2ca8b332
AJ
2176 AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
2177 fi
ad32c661 2178fi
a46d2c0e 2179
a1ad2f9b
AJ
2180dnl Enable /dev/poll
2181AC_ARG_ENABLE(devpoll,
2182 AS_HELP_STRING([--disable-devpoll],[Disable Solaris /dev/poll support.]),
2183[
2184SQUID_YESNO($enableval,[--disable-devpoll takes no extra argument])
2185test "x$enableval" = "xyes" && squid_opt_io_loop_engine="devpoll"
2186])
2187AC_MSG_NOTICE([enabling /dev/poll for net I/O: ${enable_devpoll:=auto}])
2188
2189## auto-detect and verify devpoll header and library present and working
2190if test "x$enable_devpoll" != "xno"; then
2191
2192 # /dev/poll requires ioctl() and write()
2193 AC_CHECK_FUNCS(ioctl)
2194 AC_CHECK_FUNCS(write)
2195
2196 # /dev/poll requires sys/devpoll.h
2197 AC_CHECK_HEADERS([sys/devpoll.h],,[
2198 if test "x$enable_devpoll" = "xyes"; then
2199 AC_MSG_ERROR([--enable-devpoll specified but /dev/poll headers not found])
2200 fi
2201 enable_devpoll=no])
2202
2203 # Verify that /dev/poll really works
2204 if test "x$enable_devpoll" != 'xno' ; then
2205 SQUID_CHECK_DEVPOLL
2206 fi
2207
2208 if test "x$enable_devpoll" = "xyes" -a "x$squid_cv_devpoll_works" = "xno" ; then
2209 AC_MSG_ERROR([/dev/poll does not work. Force-enabling it is not going to help.])
2210 fi
2211fi
2212
9676633b 2213
72fd085a 2214AC_ARG_ENABLE(http-violations,
af1e01a8
FC
2215 AS_HELP_STRING([--disable-http-violations],
2216 [This allows you to remove code which is known to
47d80734 2217 violate the HTTP protocol specification.]), [
9676633b
FC
2218 SQUID_YESNO([$enableval],
2219 [unrecognized argument to --disable-http-violations: $enableval])
72fd085a 2220])
626096be 2221SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes},
47d80734 2222 [Define to enable code which volates the HTTP standard specification])
9676633b 2223AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations])
72fd085a 2224
47d80734 2225# IPFW Transparent Proxy
68075fad 2226AC_ARG_ENABLE(ipfw-transparent,
1d26e252
FC
2227 AS_HELP_STRING([--enable-ipfw-transparent],
2228 [Enable Transparent Proxy support for systems
47d80734 2229 using FreeBSD IPFW-style firewalling.]), [
1d26e252
FC
2230 SQUID_YESNO([$enableval],
2231 [unrecognized argument to --enable-ipfw-transparent: $enableval])
68075fad 2232])
0067eb06 2233SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no},
2277004e 2234 [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.])
1d26e252 2235AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent])
68075fad 2236
47d80734 2237# IP-Filter Transparent Proxy
5cafc1d6 2238AC_ARG_ENABLE(ipf-transparent,
2277004e 2239 AS_HELP_STRING([--enable-ipf-transparent],
1d26e252
FC
2240 [Enable Transparent Proxy support using IPFilter-style firewalling]), [
2241 SQUID_YESNO([$enableval],
2242 [unrecognized argument to --enable-ipf-transparent: $enableval])
5cafc1d6 2243])
be0c7ff0 2244#will be AC_DEFINEd later, after checking for appropriate infrastructure
4bd144d2
FC
2245#IPF currently broken. Default-disabled for now.
2246AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}])
5cafc1d6 2247
2b0dd4ac 2248dnl Enable PF Transparent Proxy
2249AC_ARG_ENABLE(pf-transparent,
2277004e 2250 AS_HELP_STRING([--enable-pf-transparent],
47d80734 2251 [Enable Transparent Proxy support for systems using PF network address redirection.]), [
1d26e252
FC
2252 SQUID_YESNO([$enableval],
2253 [unrecognized argument to --enable-pf-transparent: $enableval])
2b0dd4ac 2254])
be0c7ff0 2255#will be AC_DEFINEd later, after checking for appropriate infrastructure
b2192042
AJ
2256AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=no}])
2257
2258dnl Enable /dev/pf support for older PF Transparent Proxy systems (OpenBSD 4.x and older)
2259AC_ARG_WITH(nat-devpf,
2260 AS_HELP_STRING([--with-nat-devpf],
2261 [Enable /dev/pf support for NAT on older OpenBSD and FreeBSD kernels.]), [
2262 SQUID_YESNO([$enableval],
2263 [unrecognized argument to --with-nat-devpf: $enableval])
2264])
2265#will be AC_DEFINEd later, after checking for appropriate infrastructure
2266AC_MSG_NOTICE([NAT lookups via /dev/pf: ${with_nat_devpf:=no}])
2b0dd4ac 2267
4bd144d2 2268# Linux Netfilter Transparent Proxy
d852fbad 2269AC_ARG_ENABLE(linux-netfilter,
20ad76ab 2270 AS_HELP_STRING([--enable-linux-netfilter],
96f08e2d 2271 [Enable Transparent Proxy support for Linux (Netfilter)]), [
4bd144d2
FC
2272 SQUID_YESNO([$enableval],
2273 [unrecognized argument to --enable-linux-netfilter: $enableval])
d852fbad 2274])
4bd144d2 2275AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}])
be0c7ff0 2276#will be AC_DEFINEd later, after checking for appropriate infrastructure
d852fbad 2277
425de4c8
AJ
2278
2279dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking)
11e8cfe3 2280dnl squid_opt_netfilterconntrack is set only when option is explicity specified
425de4c8
AJ
2281AC_ARG_WITH(netfilter-conntrack,
2282 AS_HELP_STRING([--without-netfilter-conntrack],
2283 [Do not use Netfilter conntrack libraries for packet marking.
2284 A path to alternative library location may be specified by
2285 using --with-netfilter-conntrack=PATH. Default: auto-detect.]), [
f4f6c2e0
AJ
2286case "$with_netfilter_conntrack" in
2287 yes|no)
11e8cfe3 2288 squid_opt_netfilterconntrack=$with_netfilter_conntrack
f4f6c2e0
AJ
2289 ;;
2290 *)
2291 if test ! -d "$withval" ; then
2292 AC_MSG_ERROR([--without-netfilter-conntrack path does not point to a directory])
2293 fi
2294 squid_opt_netfilterconntrackpath=$withval
2295 LDFLAGS="-L$squid_opt_netfilterconntrackpath/lib $LDFLAGS"
2296 CPPFLAGS="-I$squid_opt_netfilterconntrackpath/include $CPPFLAGS"
425de4c8 2297 with_netfilter_conntrack=yes
11e8cfe3 2298 squid_opt_netfilterconntrack=yes
f4f6c2e0 2299 esac
425de4c8 2300])
f4f6c2e0
AJ
2301AC_MSG_NOTICE([Linux Netfilter Conntrack support requested: ${with_netfilter_conntrack:=auto}])
2302if test "x$with_netfilter_conntrack" != "xno"; then
2303 AC_SEARCH_LIBS([nfct_query], [netfilter_conntrack],,[
2304 if test x"$with_netfilter_conntrack" = "xyes"; then
2305 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack library not found])
425de4c8 2306 fi
f4f6c2e0 2307 with_netfilter_conntrack=no])
425de4c8 2308 AC_CHECK_HEADERS([libnetfilter_conntrack/libnetfilter_conntrack.h \
f4f6c2e0
AJ
2309 libnetfilter_conntrack/libnetfilter_conntrack_tcp.h],,[
2310 if test x"$with_netfilter_conntrack" = "xyes"; then
2311 AC_MSG_ERROR([--with-netfilter-conntrack specified but libnetfilter-conntrack headers not found])
2312 fi
2313 with_netfilter_conntrack=no])
88a2a8c6
AJ
2314 # If nothing is broken; enable the libraries usage.
2315 if test "x$with_netfilter_conntrack" != "xno"; then
2316 with_netfilter_conntrack=yes
2317 fi
425de4c8
AJ
2318fi
2319
2320
bb7b5fd0 2321dnl Enable Large file support
2df6213e 2322buildmodel=""
2277004e 2323squid_opt_enable_large_files=no
2df6213e 2324
2325AC_ARG_WITH(large-files,
507ca601
FC
2326 AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]), [
2327 if test "x$withval" = "xyes"; then
2328 squid_opt_enable_large_files=yes
bb7b5fd0 2329 fi
2330])
2331
2df6213e 2332dnl UNIX Build environment
be0c7ff0 2333dnl AS_HELP_STRING is not suited here because it cannot to specify newlines
2df6213e 2334AC_ARG_WITH(build-environment,
507ca601
FC
2335 AS_HELP_STRING([--with-build-environment=model],
2336 [The build environment to use. Normally one of
2337 POSIX_V6_ILP32_OFF32 (32 bits),
2338 POSIX_V6_ILP32_OFFBIG (32 bits with large file support),
2339 POSIX_V6_LP64_OFF64 (64 bits),
2340 POSIX_V6_LPBIG_OFFBIG (large pointers and files),
2341 XBS5_ILP32_OFF32 i(legacy, 32 bits),
2342 XBS5_ILP32_OFFBIG (legacy, 32 bits with large file support),
2343 XBS5_LP64_OFF64 (legacy, 64 bits),
2344 XBS5_LPBIG_OFFBIG (legacy, large pointers and files)
2345 or default (The default for your OS)]), [
2346case "$withval" in
2df6213e 2347 yes|no)
507ca601
FC
2348 AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf])
2349 ;;
2df6213e 2350 *)
507ca601
FC
2351 buildmodel="$withval"
2352 ;;
2353esac
2df6213e 2354])
2355
228332d3
FC
2356#hack. Let's early-detect sizeof(long)
2357AC_CHECK_SIZEOF(long)
2358
fcabe077 2359if test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"; then
2277004e
FC
2360 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
2361 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
2362 buildmodel=$model
2363 break
2364 fi
2365 done
fcabe077 2366 if test "x$buildmodel" = "x"; then
2277004e
FC
2367 AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
2368 fi
9b8002de 2369fi
0c0d381b 2370if test "x$buildmodel" = "xdefault" -o "x$buildmodel" = "x"; then
228332d3
FC
2371 # define _FILE_OFFSET_BITS if requested and needed
2372 if test "x$squid_opt_enable_large_files" = "xyes" -a $ac_cv_sizeof_long -le 4 ; then
507ca601
FC
2373 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
2374 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
2375 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2376 fi
2377else
2378 AC_MSG_NOTICE([Using $buildmodel build environment])
2379 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
2380 : # All fine
2381 else
2382 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
2383 fi
2384 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
2385 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2386 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
2387 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
941c31f3 2388 if test "x$squid_host_os" = "xsolaris" ; then
2277004e
FC
2389
2390# On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
2391# for LDFLAGS -xarch=generic64, but:
2392# "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
2393# For gcc "-xarch=generic64" must be replaced with "-m64"
2394# The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
fcabe077 2395 if test "x$GCC" = "xyes"; then
2277004e
FC
2396 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
2397 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
2398 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
2399 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
2400 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2401 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
2402 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
2403 fi
2404 AC_MSG_NOTICE([Removing -Usun on $host])
2405 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
2406 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
2407 fi
507ca601 2408fi
2df6213e 2409
5d620373 2410dnl Enable Leak Finding Functions
2411AC_ARG_ENABLE(leakfinder,
47d80734
FC
2412 AS_HELP_STRING([--enable-leakfinder],
2413 [Enable Leak Finding code. Enabling this alone does nothing;
2414 you also have to modify the source code to use the leak
2415 finding functions. Probably Useful for hackers only.]), [
89f640aa
FC
2416 SQUID_YESNO([$enableval],
2417 [unrecognized argument to --enable-leakfinder: $enableval])
5d620373 2418])
89f640aa
FC
2419AC_MSG_NOTICE([Leak Finder enabled: ${enable_leakfinder:=no}])
2420SQUID_DEFINE_BOOL(USE_LEAKFINDER,$enable_leakfinder,
47d80734 2421 [Enable code for assisting in finding memory leaks. Not for the faint of heart])
fcabe077 2422AM_CONDITIONAL(MAKE_LEAKFINDER, [test "x$enable_leakfinder" = "xyes"])
47d80734 2423
5d620373 2424
3d674977 2425AC_ARG_ENABLE(follow-x-forwarded-for,
6ec005b5
FC
2426 AS_HELP_STRING([--enable-follow-x-forwarded-for],
2427 [Enable support for following the X-Forwarded-For
19b4777c
FC
2428 HTTP header to try to find the IP address of the
2429 original or indirect client when a request has
8075a4da 2430 been forwarded through other proxies.]), [
6ec005b5
FC
2431 SQUID_YESNO([$enableval],
2432 [unrecognized argument to --enable-follow-x-forwarded-for: $enableval])
8075a4da 2433])
6ec005b5 2434AC_MSG_NOTICE([Support for X-Forwarded-For enabled: ${enable_follow_x_forwarded_for:=yes}])
3a5af257 2435SQUID_DEFINE_BOOL(FOLLOW_X_FORWARDED_FOR,$enable_follow_x_forwarded_for,
47d80734 2436 [Enable following X-Forwarded-For headers])
3d674977 2437
3898f57f 2438AC_ARG_ENABLE(ident-lookups,
8075a4da 2439 AS_HELP_STRING([--disable-ident-lookups],
47d80734
FC
2440 [Remove code that supports performing Ident (RFC 931) lookups.]), [
2441 SQUID_YESNO([$enableval],[unrecognized argument to --disable-ident-lookups: $enableval])
8075a4da 2442])
6c5dc16a
FC
2443AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}])
2444SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups])
3898f57f 2445
95d2589c
CT
2446AM_CONDITIONAL(USE_SSL_CRTD, false)
2447AC_ARG_ENABLE(ssl-crtd,
2448 AC_HELP_STRING([--enable-ssl-crtd],
2449 [Prevent Squid from directly generation of SSL private key and
2450 certificate request and instead enables the ssl_crtd processes.]), [
2451 SQUID_YESNO([$enableval],
2452 [unrecogized argument to --enable-ssl-crtd: $enableval])
2453])
2454
c41db002
AJ
2455if test "x$enable_ssl_crtd" = "xyes" -a "x$with_openssl" = "xno" ; then
2456 AC_MSG_ERROR([You need to enable ssl gatewaying support to use ssl_crtd feature. Try to use --with-openssl. ])
95d2589c
CT
2457fi
2458SQUID_DEFINE_BOOL(USE_SSL_CRTD, ${enable_ssl_crtd:=no},[Use ssl_crtd daemon])
2459AM_CONDITIONAL(USE_SSL_CRTD, [test "x$enable_ssl_crtd" = "xyes"])
2460
9d798391 2461dnl Select Default hosts file location
2462AC_ARG_ENABLE(default-hostsfile,
8ea232f5
FC
2463 AS_HELP_STRING([--enable-default-hostsfile=path],
2464 [Select default location for hosts file.
75eaac6c
FC
2465 See hosts_file directive in squid.conf for details]), [
2466if test "x$enableval" != "xnone" -a "x$enableval" != "xno" ; then
2467 if test \! -f "$enableval"; then
2468 AC_MSG_WARN([Unable to find file $enableval. I hope you know what you are doing.])
20ad76ab 2469 fi
75eaac6c
FC
2470 squid_opt_default_hosts=$enableval
2471else
2472 squid_opt_default_hosts="none"
2473fi
2474])
2475AC_MSG_NOTICE([Default hosts file set to: ${squid_opt_default_hosts:=/etc/hosts}])
2476DEFAULT_HOSTS=$squid_opt_default_hosts
2477AC_SUBST(DEFAULT_HOSTS)
9d798391 2478
47d80734 2479# Select auth schemes modules to build
94439e4e 2480AC_ARG_ENABLE(auth,
26ffc057
FC
2481 AS_HELP_STRING([--enable-auth],
2482 [Build global support for authentication. The list of schemes
2483 and helpers to be enabled is defined elsewhere]), [
2484SQUID_YESNO([$enableval],
2485 [unrecognized argument to --enable-auth: $enableval])
94439e4e 2486])
26ffc057 2487AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}])
2f1431ea
AJ
2488SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,[Enable support for authentication])
2489AM_CONDITIONAL(ENABLE_AUTH, test "x$enable_auth" != "xno")
26ffc057
FC
2490AUTH_MODULES=""
2491
2492AC_ARG_ENABLE(auth-basic,
2493 AS_HELP_STRING([--enable-auth-basic="list of helpers"],
2494 [Enable the basic authentication scheme, and build the specified helpers.
2495 Not providing an explicit list of helpers will attempt build of
2496 all possible helpers. Default is to do so.
2497 To disable the basic authentication scheme, use --disable-auth-basic.
d9655720 2498 To enable but build no helpers, specify "none".
26ffc057
FC
2499 To see available helpers, see the helpers/basic_auth directory. ]),[
2500#nothing to do really
2501])
5a0c5a92 2502m4_include([helpers/basic_auth/modules.m4])
94439e4e 2503
12daeef6
AJ
2504AC_ARG_ENABLE(auth-digest,
2505 AS_HELP_STRING([--enable-auth-digest="list of helpers"],
2506 [Enable the Digest authentication scheme, and build the specified helpers.
26ffc057
FC
2507 Not providing an explicit list of helpers will attempt build of
2508 all possible helpers. Default is to do so.
12daeef6 2509 To disable the Digest authentication scheme, use --disable-auth-digest.
26ffc057 2510 To enable but build no helpers, specify "none".
12daeef6
AJ
2511 To see available helpers, see the helpers/digest_auth directory. ]),[
2512#nothing to do, really
380f0a87 2513])
12daeef6 2514m4_include([helpers/digest_auth/modules.m4])
94439e4e 2515
26ffc057
FC
2516AC_ARG_ENABLE(auth-negotiate,
2517 AS_HELP_STRING([--enable-auth-negotiate="list of helpers"],
2518 [Enable the Negotiate authentication scheme, and build the specified
2519 helpers.
2520 Not providing an explicit list of helpers will attempt build of
2521 all possible helpers. Default is to do so.
2522 To disable the Negotiate authentication scheme,
2523 use --disable-auth-negotiate.
2524 To enable but build no helpers, specify "none".
2525 To see available helpers, see the helpers/negotiate_auth directory. ]),[
2526#nothing to do, really
6e785d85 2527])
5eabe4b4 2528m4_include([helpers/negotiate_auth/modules.m4])
6e785d85 2529
12daeef6
AJ
2530AC_ARG_ENABLE(auth-ntlm,
2531 AS_HELP_STRING([--enable-auth-ntlm="list of helpers"],
2532 [Enable the NTLM authentication scheme, and build the specified helpers.
26ffc057
FC
2533 Not providing an explicit list of helpers will attempt build of
2534 all possible helpers. Default is to do so.
12daeef6 2535 To disable the NTLM authentication scheme, use --disable-auth-ntlm.
1a22a39e 2536 To enable but build no helpers, specify "none".
12daeef6 2537 To see available helpers, see the helpers/ntlm_auth directory. ]),[
1a22a39e 2538])
12daeef6 2539m4_include([helpers/ntlm_auth/modules.m4])
c8093f05 2540
1a22a39e
MM
2541dnl Authentication libraries to build
2542dnl This list will not be needed when each auth library has its own Makefile
2543dnl this is to be placed AFTER each auth module's handler
2544AUTH_LIBS_TO_BUILD=
2545for module in $AUTH_MODULES; do
2546 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD ${module}/lib${module}.la"
2547done
2548AC_SUBST(AUTH_MODULES)
2549AC_SUBST(AUTH_LIBS_TO_BUILD)
3d62cc61 2550
1a22a39e
MM
2551dnl Select logging daemon helpers to build
2552AC_ARG_ENABLE(log-daemon-helpers,
2553 AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"],
2554 [This option selects which logging daemon helpers to
2555 build and install as part of the normal build process
2556 For a list of available helpers see the helpers/log_daemon
2557 directory.]),[
2558#nothing to do, really
2559])
2560m4_include([helpers/log_daemon/modules.m4])
9ca29d23 2561
c6588c68 2562AC_ARG_ENABLE(external-acl-helpers,
f2d9a578 2563 AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
8ea232f5 2564 [Enable external_acl helpers support and thelpers themselves.
d9655720 2565 Default is to build all buildable helpers and enable support.
8ea232f5 2566 To disable support, use --disable-external-acl-helpers.
d9655720 2567 To build no helpers, specify "none".
8ea232f5
FC
2568 To see available helpers, see the helpers/external_acl
2569 directory]), [
d9655720 2570#nothing to do, really
c6588c68 2571])
5eabe4b4 2572m4_include([helpers/external_acl/modules.m4])
d9655720 2573
fdbb3b19 2574dnl Select url_rewrite helpers to build
fdbb3b19 2575AC_ARG_ENABLE(url-rewrite-helpers,
081863f3 2576 AS_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"],
fdbb3b19
AJ
2577 [This option selects which url_rewrite helpers to
2578 build and install as part of the normal build
8ea232f5
FC
2579 process. The default is to attempt the build of all possible
2580 helpers. Use --disable-url-rewrite-helpers to build none.
2581 For a list of available helpers see the
2582 helpers/url_rewrite directory.]),[
fdbb3b19 2583])
5eabe4b4 2584m4_include([helpers/url_rewrite/modules.m4])
fdbb3b19 2585
0d5ee502
AM
2586dnl Select storeid_rewrite helpers to build
2587AC_ARG_ENABLE(storeid-rewrite-helpers,
2588 AS_HELP_STRING([--enable-storeid-rewrite-helpers="list of helpers"],
2589 [This option selects which Store-ID rewrite helpers to
2590 build and install as part of the normal build
2591 process. The default is to attempt the build of all possible
2592 helpers. Use --disable-storeid-rewrite-helpers to build none.
2593 For a list of available helpers see the
2594 helpers/storeid_rewrite directory.]),[
2595])
2596m4_include([helpers/storeid_rewrite/modules.m4])
2597
3a125142 2598AC_ARG_WITH(valgrind-debug,
0f705e3b
FC
2599 AS_HELP_STRING([--with-valgrind-debug],
2600 [Include debug instrumentation for use with valgrind]),
4e26f472
FC
2601[
2602 SQUID_YESNO([$withval],
2603 [unrecognized argument to --with-valgrind-debug: $withval])
fcabe077 2604 if test "x$withval" != "xno" ; then
4e26f472
FC
2605 AC_CHECK_HEADERS(valgrind/memcheck.h,[],[
2606 AC_MSG_ERROR([Valgrind support requested, needed headers not found.])
2607 ])
b4bab919 2608 fi
2609])
4e26f472
FC
2610SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no},
2611 [Valgrind memory debugger support])
2612AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug])
b4bab919 2613
d96ceb8e 2614dnl Disable "memPools" code
8730e87a
HN
2615#AC_ARG_ENABLE(chunkedmempools,
2616# AS_HELP_STRING([--enable-chunkedmempools],
2617# [Enable experimental chunked memPools. Note that this option
507ca601 2618# simply sets the default behaviour. Specific classes can override this
8730e87a
HN
2619# at runtime, and only lib/MemPool.c needs to be altered
2620# to change the squid-wide default for all classes.]), [
2621#SQUID_YESNO([$enableval],
2622# [--enable-chunkedmempools option takes no arguments])
2623#])
4d7cefbb
HN
2624SQUID_DEFINE_BOOL(USE_CHUNKEDMEMPOOLS,${enable_chunkedmempools:=no},
2625 [Enable chunked Memory Pools support (experimental)])
8730e87a 2626#AC_MSG_NOTICE([Chunked MemPools enabled: $enable_chunkedmempools])
d96ceb8e 2627
0e657244 2628dnl Enable WIN32 Service compile mode
2629AC_ARG_ENABLE(win32-service,
054a4caa 2630 AS_HELP_STRING([--enable-win32-service],
0f705e3b 2631 [Compile Squid as a WIN32 Service.
b284c470
FC
2632 Works only on MS-Windows platforms]), [
2633SQUID_YESNO([$enableval],
2634 [unrecognized argument to --enable-win32-service: $enableval])
0e657244 2635])
b284c470
FC
2636SQUID_DEFINE_BOOL(USE_WIN32_SERVICE,${enable_win32_service:=no},
2637 [Enable code supporting MS Windows service mode])
2638AC_MSG_NOTICE([MS Windows service mode enabled: $enable_win32_service])
0e657244 2639
b1485ff8 2640
29f22442 2641# Disable "unlinkd" code
fe0810ac 2642AC_ARG_ENABLE(unlinkd,
0a081cb0 2643 AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [
0f705e3b
FC
2644SQUID_YESNO([$enableval],
2645 [unrecognized argument to --disable-unlinkd: $enableval])
fe0810ac 2646])
0f658b5b 2647SQUID_DEFINE_BOOL(USE_UNLINKD,${enable_unlinkd:=yes},
0f705e3b 2648 [Enable useage of unlinkd])
fcabe077 2649AM_CONDITIONAL(ENABLE_UNLINKD,test "x$enable_unlinkd" = "xyes")
fbc04c0a 2650AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd])
fe0810ac 2651
0f705e3b 2652# Enable backtraces on fatal errors
ce3d30fb 2653AC_ARG_ENABLE(stacktraces,
0f705e3b
FC
2654 AS_HELP_STRING([--enable-stacktraces],
2655 [Enable automatic call backtrace on fatal errors]), [
2656SQUID_YESNO([$enableval],
2657 [unrecognized argument to --enable-stacktraces: $enableval])
ce3d30fb 2658])
0f658b5b 2659SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no},
0f705e3b 2660 [Print stack traces on fatal errors])
78614cd4 2661AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces])
0a081cb0 2662
ce3d30fb 2663
904676a2 2664# CPU Profiling options handling
88bfe092 2665AC_ARG_ENABLE(cpu-profiling,
0f705e3b
FC
2666 AS_HELP_STRING([--enable-cpu-profiling],
2667 [Enable instrumentation to try and understand how CPU power
2668 is spent by squid, by enabling specific probes in selected
2669 functions.
2670 New probes can only be added by modifying the source code.
2671 It is meant to help developers in optimizing performance
2672 of Squid internal functions.
87fa90fb 2673 If you are not developer you should not enable this,
0f705e3b
FC
2674 as it slows squid down somewhat.
2675 See lib/Profiler.c for more details.]), [
2676SQUID_YESNO([$enableval],
2677 [unrecognized argument to --enable-cpu-profiling: $enableval])
88bfe092 2678])
13e41ca5
AJ
2679# Default OFF. This is a debug feature. Only check and enable if forced ON.
2680if test "x$enable_cpu_profiling" = "xyes"; then
5e44eea8 2681 SQUID_CHECK_FUNCTIONAL_CPU_PROFILER
13e41ca5 2682 if test "x$squid_cv_cpu_profiler_works" = "xno"; then
5e44eea8 2683 AC_MSG_ERROR([CPU profiling will not be functional in this build.])
5e44eea8 2684 fi
5e44eea8 2685fi
0f658b5b 2686SQUID_DEFINE_BOOL(USE_XPROF_STATS,${enable_cpu_profiling:=no},
0f705e3b
FC
2687 [Define to enable CPU profiling within Squid])
2688AM_CONDITIONAL(ENABLE_XPROF_STATS,
fcabe077 2689 test "x$enable_cpu_profiling" = "xyes")
78614cd4 2690AC_MSG_NOTICE([CPU profiling enabled: $enable_cpu_profiling])
88bfe092 2691
904676a2 2692# Enable X-Accelerator-Vary for Vary support within an accelerator setup
2092c67d 2693AC_ARG_ENABLE(x-accelerator-vary,
904676a2
FC
2694 AS_HELP_STRING([--enable-x-accelerator-vary],
2695 [Enable support for the X-Accelerator-Vary
e702812e
FC
2696 HTTP header. Can be used to indicate
2697 variance within an accelerator setup.
2698 Typically used together with other code
904676a2
FC
2699 that adds custom HTTP headers to the requests.]), [
2700SQUID_YESNO([$enableval],
2701 [unrecognized argument to --enable-x-accelerator-vary: $enableval])
f66a9ef4 2702])
0f658b5b 2703SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no},
904676a2 2704 [Enable support for the X-Accelerator-Vary HTTP header])
78614cd4 2705AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary])
f66a9ef4 2706
87fa90fb 2707
8b5e106b 2708if $CPPUNITCONFIG --help >/dev/null; then
78cae3b4
FC
2709 squid_cv_cppunit_version="`$CPPUNITCONFIG --version`"
2710 AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version])
2711 unset squid_cv_cppunit_version
8b5e106b 2712 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2713 SQUID_CPPUNIT_LA=''
2714 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2715else
eed82608 2716 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
63d03edb 2717 SQUID_CPPUNIT_LA=''
2718 SQUID_CPPUNIT_LIBS=''
2719 SQUID_CPPUNIT_INC=''
f5691f9c 2720fi
8b5e106b 2721
f5691f9c 2722AC_ARG_WITH(cppunit-basedir,
1b9fe876 2723 AS_HELP_STRING([--with-cppunit-basedir=PATH],
3680cc44
FC
2724 [Path where the cppunit headers are libraries can be found ]), [
2725if test -f "$withval/include/cppunit/TestCase.h"; then
2726 AC_MSG_NOTICE([Using cppunit includes from $withval])
2727 SQUID_CPPUNIT_INC="-I${withval}/include"
2728else
2729 AC_MSG_ERROR(Cannot find cppunit at $withval)
2730fi
2731if test -f "$withval/lib/libcppunit.la"; then
2732 AC_MSG_NOTICE([Using cppunit lib from $withval])
2733 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2734 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2735else
2736 AC_MSG_ERROR(Cannot find cppunit at $withval)
2737fi
f5691f9c 2738])
7b81a8f7
AJ
2739SQUID_STATE_SAVE(squid_cppunit_state)
2740CXXFLAGS="$CXXFLAGS $SQUID_CPPUNIT_INC"
2741AC_CHECK_HEADERS(cppunit/extensions/HelperMacros.h)
2742SQUID_STATE_ROLLBACK(squid_cppunit_state)
8b5e106b 2743AC_SUBST(SQUID_CPPUNIT_LIBS)
f5691f9c 2744AC_SUBST(SQUID_CPPUNIT_LA)
2745AC_SUBST(SQUID_CPPUNIT_INC)
f5691f9c 2746
fd9aaa3e 2747# Force some compilers to use ANSI features
2748#
2749case "$host" in
3680cc44
FC
2750 *-hp-hpux*)
2751 if test "x$ac_cv_prog_CC" = "xcc" ; then
2752 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
2753 CC="cc -Ae";
2754 ac_cv_prog_CC="$CC"
2755 fi
2756 ;;
fd9aaa3e 2757esac
2758
dd56802c 2759
a2794549 2760dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
4e9d8e26 2761
6ad85e8a 2762case "$host" in
3680cc44
FC
2763 *hpux*)
2764 AC_MSG_NOTICE([Disabling ranlib for HP-UX...])
2765 RANLIB=":"
2766 ;;
6ad85e8a 2767esac
2768
090089c4 2769dnl Check for headers
2770AC_HEADER_DIRENT
2771AC_HEADER_STDC
db40ae20 2772
2773AC_CHECK_HEADERS( \
3680cc44
FC
2774 arpa/inet.h \
2775 arpa/nameser.h \
2776 assert.h \
2777 bstring.h \
3680cc44 2778 crypt.h \
3680cc44 2779 ctype.h \
ee4d4e85 2780 direct.h \
3680cc44
FC
2781 errno.h \
2782 execinfo.h \
2783 fcntl.h \
2784 fnmatch.h \
2785 getopt.h \
2786 glob.h \
2787 gnumalloc.h \
2788 grp.h \
3680cc44
FC
2789 ipl.h \
2790 lber.h \
2791 ldap.h \
2792 libc.h \
2793 limits.h \
2794 linux/posix_types.h \
2795 linux/types.h \
3680cc44 2796 malloc.h \
3680cc44
FC
2797 math.h \
2798 memory.h \
2799 mount.h \
2800 netdb.h \
2801 netinet/in.h \
2802 netinet/in_systm.h \
3680cc44 2803 netinet/tcp.h \
3680cc44
FC
2804 paths.h \
2805 poll.h \
2806 pwd.h \
3680cc44
FC
2807 regex.h \
2808 sched.h \
2ccf2eb2 2809 siginfo.h \
3680cc44 2810 signal.h \
3680cc44
FC
2811 stdarg.h \
2812 stddef.h \
3680cc44
FC
2813 stdio.h \
2814 stdlib.h \
3680cc44
FC
2815 string.h \
2816 strings.h \
2817 sys/bitypes.h \
3680cc44
FC
2818 sys/file.h \
2819 sys/ioctl.h \
d440d5a4 2820 sys/ipc.cc \
3680cc44
FC
2821 sys/param.h \
2822 sys/prctl.h \
2823 sys/md5.h \
c975f532 2824 sys/mman.h \
3680cc44
FC
2825 sys/msg.h \
2826 sys/resource.h \
2ccf2eb2 2827 sys/select.h \
d440d5a4 2828 sys/shm.h \
3680cc44
FC
2829 sys/socket.h \
2830 sys/stat.h \
3680cc44
FC
2831 syscall.h \
2832 sys/syscall.h \
2833 sys/time.h \
2834 sys/types.h \
2835 sys/uio.h \
2836 sys/un.h \
2837 sys/vfs.h \
2838 sys/wait.h \
2839 syslog.h \
2840 time.h \
2841 unistd.h \
2842 utime.h \
2843 varargs.h \
2844 byteswap.h \
2845 glib.h \
2846 stdint.h \
2847 inttypes.h \
3680cc44 2848 db.h \
cdb86165
FC
2849 db_185.h \
2850 wchar.h
db40ae20 2851)
3c586e38 2852
ee80a919
AR
2853AC_CHECK_HEADERS( \
2854 linux/netfilter_ipv4.h \
2855 linux/netfilter_ipv6/ip6_tables.h \
fc68f6b1 2856,,,
dcd1dc78 2857SQUID_DEFAULT_INCLUDES
2858#if HAVE_LIMITS_H
2859#include <limits.h>
2860#endif
a74968c2
AJ
2861/* Netfilter ip(6)tables v1.4.0 has broken headers */
2862#if HAVE_NETINET_IN_H
2863#include <netinet/in.h>
2864#endif
dcd1dc78 2865)
2866
cdb352bb 2867dnl *BSD dont include the dependencies for all their net/ and netinet/ files
c92b4732 2868dnl We must include a few basic type headers for them to work.
d1e5191e 2869AC_CHECK_HEADERS( \
0c0d381b
FC
2870 net/if.h \
2871 netinet/if_ether.h\
2872 netinet/icmp6.h \
2873 netinet/in.h \
2874 netinet/ip.h \
2875 netinet/ip6.h \
0c0d381b
FC
2876 netinet/ip_icmp.h \
2877 netinet/ipl.h \
0c0d381b
FC
2878 net/pf/pfvar.h \
2879 net/pfvar.h \
2880 sys/mount.h\
2881 resolv.h \
d1e5191e
AJ
2882,,,
2883SQUID_BSDNET_INCLUDES)
5a3237b0 2884
aee0606f 2885AC_C_CONST
d57288d2 2886AC_C_BIGENDIAN
aee0606f 2887
6a9f6389 2888AC_STRUCT_TM
2889AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2890#if TM_IN_SYS_TIME
2891#if HAVE_SYS_TIME_H
2892#include <sys/time.h>
2893#endif
2894#elif HAVE_TIME_H
2895#include <time.h>
2896#endif
5c51415d 2897])
46c883ed 2898
08caf8c6 2899dnl Override rusage() detect on MinGW because is emulated in source code
78a60bca
AJ
2900case "$squid_host_os" in
2901 mingw)
08caf8c6 2902 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2903 ac_cv_func_getrusage='yes'
eed82608 2904 AC_MSG_NOTICE([Using own rusage on Windows.])
08caf8c6 2905 ;;
2906 *)
2907 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
8ff51bba 2908#if HAVE_SYS_TIME_H
2909#include <sys/time.h>
2910#endif
b54a6789 2911#if HAVE_SYS_RESOURCE_H
2912#include <sys/resource.h>
6a9f6389 2913#endif])
08caf8c6 2914 ;;
2915esac
b54a6789 2916
6a9f6389 2917AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2918#if HAVE_SYS_TYPES_H
2919#include <sys/types.h>
2920#endif
a025a745 2921#include <netinet/in.h>
2922#include <netinet/in_systm.h>
6ad85e8a 2923#include <netinet/ip.h>
b05490a8 2924#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 2925#define ip_hl ihl
2926#endif
2927#ifndef __linux__
b05490a8 2928#ifndef __CYGWIN__
6ad85e8a 2929#define iphdr ip
b05490a8 2930#endif
6a9f6389 2931#endif])
a025a745 2932
090089c4 2933dnl Check for typedefs
77d6bd88 2934AC_CHECK_SIZEOF(void *)
090089c4 2935
41aa7d00
FC
2936# check for a bunch of types
2937AC_TYPE_INT8_T
2938AC_TYPE_UINT8_T
2939AC_TYPE_INT16_T
2940AC_TYPE_UINT16_T
2941AC_TYPE_INT32_T
2942AC_TYPE_UINT32_T
2943AC_TYPE_INT64_T
2944AC_TYPE_UINT64_T
2945AC_TYPE_PID_T
2946AC_TYPE_SIZE_T
2947AC_TYPE_SSIZE_T
2948AC_TYPE_OFF_T
2949AC_TYPE_UID_T
59a09b98 2950AC_CHECK_TYPE([bool])
41aa7d00
FC
2951#need the defines for PRId64
2952AC_CHECK_SIZEOF(int64_t)
2953AC_CHECK_SIZEOF(long)
fe1e5c91
AJ
2954#need the defines for PRIuSIZE
2955AC_CHECK_SIZEOF(size_t)
50f9c873
AR
2956#need the define for overflow checks
2957AC_CHECK_SIZEOF(off_t)
46e172d9 2958AC_CHECK_SIZEOF(size_t)
6a9f6389 2959
249b93df 2960dnl Some C++11 types we try to use
a203dec7
AJ
2961AX_CXX_TYPE_NULLPTR
2962AX_CXX_TYPE_UNIQUE_PTR
249b93df 2963AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS
2fefc43c 2964SQUID_CXX_STD_UNDERLYING_TYPE
a203dec7 2965
588e71df 2966dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2967dnl that is incompatible with the updated Solaris header files.
2968dnl For this reason, we must check if pad128_t and upad128_t are defined.
2969AC_CHECK_TYPE(pad128_t,
2970 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2971 ,SQUID_DEFAULT_INCLUDES)
2972
2973AC_CHECK_TYPE(upad128_t,
2974 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2975 ,SQUID_DEFAULT_INCLUDES)
2976
6a9f6389 2977AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2978AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
adcceb47 2979
6a9f6389 2980AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2981#include <sys/types.h>
6637e3a5 2982#include <sys/socket.h>
2983#if STDC_HEADERS
2984#include <stdlib.h>
2985#include <stddef.h>
6a9f6389 2986#endif])
6637e3a5 2987
cdb352bb
FC
2988AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
2989 [mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2990#include <sys/ipc.h>
2991#include <sys/msg.h>])
2992
fe1e5c91
AJ
2993# check for compiler support of %zu printf macro
2994AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro])
2995AC_MSG_CHECKING([for compiler %zu support])
2996AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2997#include <stdio.h>
2998 ]],[[size_t n=1;printf("%zu",n);]])],[
2999 AC_DEFINE(PRIuSIZE,"zu")
3000 AC_MSG_RESULT(yes)
3001 ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
3002
3003
cdb352bb
FC
3004dnl Check for special functions
3005AC_FUNC_ALLOCA
3006
3007
b50f1b2b 3008dnl Check for libcap header (assume its not broken unless
45c41a07
FC
3009AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],
3010 [disable usage of Linux capabilities library to control privileges]), [
3011SQUID_YESNO([$withval],[unrecognized argument to --without-libcap: $withval])
3012],[with_libcap=auto])
3013
3014if test "x$with_libcap" != "xno"; then
b64b6030 3015 # cap_clear_flag is the most recent libcap function we require
45c41a07 3016 AC_CHECK_HEADERS(sys/capability.h)
b64b6030 3017 AC_CHECK_LIB(cap, cap_clear_flag)
45c41a07
FC
3018 SQUID_CHECK_FUNCTIONAL_LIBCAP2
3019
3020 # if it can't be supported..
35e2b2e5 3021 if test "x$ac_cv_header_sys_capability_h" = "xno" -o \
46f50de9 3022 "x$ac_cv_lib_cap_cap_clear_flag" = "xno"; then
45c41a07 3023 # and it was forced on: error
46f50de9 3024 if test "x$with_libcap" = "xyes" ; then
ff8d255b 3025 AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
3fbda12c
FC
3026 else
3027 # with_libcap is "auto"; it can't be supported. Disable.
3028 with_libcap=no
b64b6030 3029 fi
45c41a07
FC
3030 else
3031 # header and lib are ok, we support
3032 with_libcap=yes
b64b6030 3033 fi
69367152 3034
b50f1b2b 3035fi
5b43d209 3036
45c41a07
FC
3037SQUID_DEFINE_BOOL(USE_LIBCAP,$with_libcap,
3038 [use libcap to set capabilities required for TPROXY])
3039AC_MSG_NOTICE([libcap support enabled: $with_libcap])
3040SQUID_DEFINE_BOOL(LIBCAP_BROKEN,${squid_cv_sys_capability_works:=no},
3041 [libcap2 headers are broken and clashing with glibc])
3042AC_MSG_NOTICE([libcap2 headers are ok: $squid_cv_sys_capability_works])
3043
b64b6030 3044
090089c4 3045dnl Check for needed libraries
54c95954 3046AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
819656da
AJ
3047AC_SEARCH_LIBS([res_init],[resolv])
3048AC_SEARCH_LIBS([__res_search],[resolv])
54c95954
FC
3049AC_SEARCH_LIBS([bind],[socket])
3050AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
3051AC_SEARCH_LIBS([strlcpy], [bsd])
85cd85f3 3052AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
bfe8dedf 3053dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
0c0d381b
FC
3054if test "x$squid_host_os" = "xmingw" ; then
3055 SQUID_CHECK_WINSOCK_LIB
32341684
AJ
3056 AC_CHECK_HEADERS( \
3057 windows.h \
3058 ws2tcpip.h \
b966288b 3059 iphlpapi.h ,,,[
2ff9dfaa
AJ
3060#if HAVE_WINSOCK2_H
3061#include <winsock2.h>
3062#endif
32341684
AJ
3063#if HAVE_WINDOWS_H
3064#include <windows.h>
3065#endif
2ff9dfaa
AJ
3066#if HAVE_WS2TCPIP_H
3067#include <ws2tcpip.h>
3068#endif
3069])
0c0d381b 3070fi
94d48591 3071
46f50de9
FC
3072# check that we have unix sockets
3073SQUID_CHECK_UNIX_SOCKET
3074SQUID_DEFINE_BOOL(HAVE_UNIXSOCKET,$squid_cv_unixsocket,[System supports unix sockets])
3075
3076AC_CHECK_LIB(gnumalloc, malloc)
3077if test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"; then
ef7ece58 3078 AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc])
46f50de9
FC
3079 ac_cv_func_mallocblksize=no
3080 ac_cv_func_mallopt=no
3081else
3082 case "$squid_host_os" in
3083 solaris)
3084 AC_MSG_NOTICE([skipping libmalloc check for $host])
3085 ;;
3086 freebsd)
3087 AC_MSG_NOTICE([skipping libmalloc check for $host])
3088 ;;
3089 *)
3090 #used later. FIXME
3091 AC_CHECK_LIB(malloc, main)
3092 ;;
cdb352bb
FC
3093 esac
3094fi
94d48591 3095
78a60bca
AJ
3096case "$squid_host_os" in
3097 mingw)
3098 AC_MSG_NOTICE([Use MSVCRT for math functions.])
3099 ;;
3100 *)
3101 dnl rint() and log() are only used in old C code for now.
3102 AC_LANG_PUSH([C])
3103 AC_SEARCH_LIBS([rint],[m])
3104 AC_SEARCH_LIBS([log],[m])
3105 AC_LANG_POP([C])
3106 ;;
08caf8c6 3107esac
090089c4 3108
f467f578
FC
3109dnl --with-maxfd present for compatibility with Squid-2.
3110dnl undocumented in ./configure --help to encourage using the Squid-3 directive
3111AC_ARG_WITH(maxfd,,
3112[
3113 case ${withval} in
3114 [[0-9]]*)
3115 squid_filedescriptors_num=$withval
acea95af 3116 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
f467f578
FC
3117 ;;
3118 *)
3119 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
3120 ;;
3121 esac
055421ee 3122])
001ad4cc 3123
f467f578
FC
3124AC_ARG_WITH(filedescriptors,
3125 AS_HELP_STRING([--with-filedescriptors=NUMBER],
3126 [Force squid to support NUMBER filedescriptors]),
3127[
3128 case ${withval} in
3129 [[0-9]]*)
3130 squid_filedescriptors_num=$withval
acea95af 3131 AC_MSG_NOTICE([forcing default of $squid_filedescriptors_num filedescriptors (user-forced)])
f467f578
FC
3132 ;;
3133 *)
3134 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
3135 ;;
3136 esac
001ad4cc 3137])
f467f578
FC
3138
3139SQUID_CHECK_DEFAULT_FD_SETSIZE
acea95af
AJ
3140SQUID_CHECK_MAXFD
3141if test "x$squid_filedescriptors_num" != "x"; then
3142 AC_MSG_NOTICE([Default number of fieldescriptors: $squid_filedescriptors_num])
001ad4cc 3143fi
f467f578
FC
3144if test "$squid_filedescriptors_num" -lt 512 ; then
3145 AC_MSG_WARN([$squid_filedescriptors_num may not be enough filedescriptors if your])
3146 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3147 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3148 AC_MSG_WARN([on how to increase your filedescriptor limit])
3149fi
3150AC_DEFINE_UNQUOTED(SQUID_MAXFD, $squid_filedescriptors_num,[Maximum number of open filedescriptors])
001ad4cc 3151
f467f578 3152
001ad4cc
AJ
3153dnl Enable IPv6 support
3154AC_MSG_CHECKING([whether to enable IPv6])
001ad4cc 3155AC_ARG_ENABLE(ipv6,
af494bc8
FC
3156 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support. The default is to probe system capabilities on startup.]), [
3157SQUID_YESNO([$enableval],[unrecognized argument to --disable-ipv6: $enableval])
001ad4cc 3158])
7d927f1f
AJ
3159AC_MSG_RESULT(${enable_ipv6:=yes})
3160SQUID_DEFINE_BOOL(USE_IPV6,$enable_ipv6,[Enable support for IPv6 ])
001ad4cc 3161
7d927f1f 3162if test "x$enable_ipv6" = "xyes" ; then
af494bc8 3163 SQUID_CHECK_SIN6_LEN_IN_SAI
001ad4cc 3164fi
7d553ad9
AJ
3165SQUID_CHECK_SS_LEN_IN_SOCKADDR_STORAGE
3166SQUID_CHECK_SIN_LEN_IN_SOCKADDR_IN
001ad4cc 3167
001ad4cc 3168
042b1f8a 3169dnl Check for libdl, used by auth_modules/PAM
fcabe077 3170if test "x$with_dl" = "xyes"; then
8154dd82 3171 AC_CHECK_LIB(dl, dlopen)
3172fi
042b1f8a 3173
86ec11aa 3174dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
3175dnl Robert Side <rside@aiinc.bc.ca>
3176dnl Mon, 18 Jan 1999 17:48:00 GMT
3177case "$host" in
3178 *-pc-sco3.2*)
3179 AC_CHECK_LIB(intl, strftime)
3180 ;;
3181esac
3182
b7a1c19e 3183dnl Check for libdb
6b5de50d 3184dnl this is not fully functional if db.h is for a differend db version
b7a1c19e 3185DBLIB=
6b5de50d
FC
3186
3187dnl check that dbopen is actually defined in the header
3188dnl FIXME: in case of failure undef db-related includes etc.
3189AC_CHECK_DECL(dbopen,,,[
06fbee01
FC
3190#if HAVE_SYS_TYPES_H
3191#include <sys/types.h>
3192#endif
3193#if HAVE_LIMITS_H
3194#include <limits.h>
3195#endif
6b5de50d
FC
3196#if HAVE_DB_185_H
3197#include <db_185.h>
3198#elif HAVE_DB_H
3199#include <db.h>
3200#endif])
3201
01b4931d 3202dnl 1.85
91983da0 3203SQUID_CHECK_DBOPEN_NEEDS_LIBDB
fcabe077 3204if test "x$ac_cv_dbopen_libdb" = "xyes"; then
32d0bbd7 3205 LIB_DB="-ldb"
3206fi
01b4931d 3207AC_SUBST(LIB_DB)
b7a1c19e 3208
77f675ad 3209dnl System-specific library modifications
3210dnl
3211case "$host" in
fcabe077
FC
3212 i386-*-solaris2.*)
3213 if test "x$GCC" = "xyes"; then
3214 AC_MSG_NOTICE([Removing -O for gcc on $host])
3215 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
3216 fi
3217 ;;
141eb4a6 3218
fcabe077
FC
3219 *-sgi-irix*)
3220 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
3221 LIBS=`echo $LIBS | sed -e s/-lsocket//`
3222 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
3223 LIBS=`echo $LIBS | sed -e s/-lnsl//`
3224 ac_cv_lib_nsl_main=no
3225 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
3226 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3227 ;;
4ba0bd0e 3228dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
3229dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
3230dnl Please change your configure script. AIX doesn't need -lbsd.
fcabe077
FC
3231 *-ibm-aix*)
3232 AC_MSG_NOTICE([Removing -lbsd for AIX...])
3233 LIBS=`echo $LIBS | sed -e s/-lbsd//`
3e1ce596
KB
3234
3235 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_rtti],[-rtti],[[
3236#include <assert.h>
3237#ifndef NULL
3238#define NULL 0
3239#endif
3240class Foo{
3241public:virtual ~Foo(){}
3242};
3243class Bar:public Foo{
3244public:Bar():Foo(){}
3245};
3246 ]],[[
3247Foo * myFoo=new Bar();
3248Bar * myBar=dynamic_cast<Bar *>(myFoo);
3249assert(myBar != NULL);
3250 ]])
3251 if test "$ac_cv_require_rtti" = "yes"; then
3252 SQUID_CFLAGS="-rtti $SQUID_CFLAGS"
3253 SQUID_CXXFLAGS="-rtti $SQUID_CXXFLAGS"
fcabe077 3254 fi
3e1ce596
KB
3255
3256 AC_LANG_PUSH([C])
3257 SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_qcpluscmt],[-qcpluscmt],[[]],[[//c++ cmt]])
fcabe077 3258 AC_LANG_POP([C])
3e1ce596
KB
3259 if test "$ac_cv_require_qcpluscmt" = "yes"; then
3260 SQUID_CFLAGS="-qcpluscmt $SQUID_CFLAGS"
3261 fi
fcabe077 3262 ;;
3e1ce596 3263
fcabe077
FC
3264 *m88k*)
3265 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
3266 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
3267 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,
3268 [If gettimeofday is known to take only one argument])
3269 ;;
3270 [*-*-solaris2.[0-4]])
3271 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3272 ;;
3273 [*-sony-newsos[56]*])
3274 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
3275 ;;
3276 esac
090089c4 3277
84cecfd2 3278dnl This has to be before AC_CHECK_FUNCS
3279# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
3280# when running configure.
fcabe077
FC
3281if test "x$ac_cv_func_poll" = "x" ; then
3282 case "$host" in
3283 [*-hp-hpux*.*])
3284 # Duane Wessels
3285 AC_MSG_NOTICE([disabling poll for $host...])
3286 ac_cv_func_poll='no'
3287 ;;
3288 [*-linux-*])
3289 # Henrik Nordstrom (hno@squid-cache.org) 19980817
3290 # poll is problematic on Linux. We disable it
3291 # by default until Linux gets it right.
3292 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
3293 if test $rev -lt 002002; then
3294 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
3295 ac_cv_func_poll='no'
3296 fi
3297 ;;
3298 [powerpc-ibm-aix4.1.*])
3299 # Mike Laster (mlaster@metavillage.com) 19981021
3300 AC_MSG_NOTICE([disabling poll for $host...])
3301 ac_cv_func_poll='no'
3302 ;;
3303 [*-pc-sco3.2*])
3304 # Robert Side <rside@aiinc.bc.ca>
3305 # Mon, 18 Jan 1999 17:48:00 GMT
3306 AC_MSG_NOTICE([disabling poll for $host...])
3307 ac_cv_func_poll='no'
3308 ;;
3309 esac
84cecfd2 3310fi
176d10ee 3311
6716b242 3312dnl Check for library functions
3313AC_CHECK_FUNCS(\
ce3d30fb 3314 backtrace_symbols_fd \
3a144521 3315 bcopy \
4de1e2da 3316 eui64_aton \
4ac29a5b 3317 fchmod \
6716b242 3318 getdtablesize \
8505e57b 3319 getpagesize \
230c091c 3320 getpass \
3a144521 3321 getrlimit \
30a4f2a8 3322 getrusage \
9c1d8929 3323 getspnam \
379d5751 3324 gettimeofday \
52303a3d 3325 glob \
0f5efab0 3326 mallocblksize \
6716b242 3327 mallopt \
2ae6b9b0 3328 memcpy \
30a4f2a8 3329 memmove \
ee4d4e85 3330 memrchr \
dac27377 3331 memset \
b99a6dec 3332 mkstemp \
1812b6c7 3333 mktime \
88738790 3334 mstats \
84cecfd2 3335 poll \
62ae0622 3336 prctl \
3a144521 3337 pthread_attr_setschedparam \
cd748f27 3338 pthread_attr_setscope \
3339 pthread_setschedparam \
42b51993 3340 pthread_sigmask \
c68e9c6b 3341 putenv \
6716b242 3342 regcomp \
3343 regexec \
3344 regfree \
819656da
AJ
3345 res_init \
3346 __res_init \
4915be3b 3347 rint \
96c2bb61
AR
3348 sched_getaffinity \
3349 sched_setaffinity \
3a144521 3350 select \
234967c9 3351 seteuid \
c415c128 3352 setgroups \
30a4f2a8 3353 setpgrp \
30a4f2a8 3354 setsid \
3355 sigaction \
11430c03 3356 snprintf \
1ccc0d40 3357 socketpair \
6716b242 3358 sysconf \
3359 syslog \
234967c9 3360 timegm \
28da5e0d 3361 vsnprintf \
6716b242 3362)
f5e5c4cf 3363dnl ... and some we provide local replacements for
3364AC_REPLACE_FUNCS(\
f5e5c4cf 3365 initgroups \
2ccf2eb2 3366 psignal \
f5e5c4cf 3367 strerror \
585cddda 3368 strtoll \
f5e5c4cf 3369 tempnam \
3370)
6716b242 3371
dfb96b6b 3372AC_CHECK_DECLS([getaddrinfo,getnameinfo,inet_ntop,inet_pton,InetNtopA,InetPtonA],,,[
55d7d5e9
AJ
3373/*
3374 * BSD requires sys/types.h, sys/socket.h, netinet/in.h, netdb.h, arpa/inet.h
3375 * Linux requires sys/types.h, sys/socket.h, arpa/inet.h
3376 * Windows requires sys/socket.h, winsock2.h, ws2tcpip.h
3377 */
3378#if HAVE_SYS_TYPES_H
3379#include <sys/types.h>
3380#endif
3381#if HAVE_NETINET_IN_H
3382#include <netinet/in.h>
3383#endif
3384#if HAVE_SYS_SOCKET_H
3385#include <sys/socket.h>
3386#endif
3387#if HAVE_NETDB_H
3388#include <netdb.h>
3389#endif
3390#if HAVE_ARPA_INET_H
3391#include <arpa/inet.h>
3392#endif
3393#if HAVE_WINSOCK2_H
3394#include <winsock2.h>
3395#endif
3396#if HAVE_WS2TCPIP_H
3397#include <ws2tcpip.h>
3398#endif
3399])
3400
9676633b
FC
3401# Magic which checks whether we are forcing a type of comm loop we
3402# are actually going to (ab)use.
3403# Mostly ripped from squid-commloops, thanks to adrian and benno
1b3db6d9 3404
fcabe077 3405if test "x$squid_opt_io_loop_engine" != "x"; then
8075a4da 3406 AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine])
fcabe077 3407elif test "x$enable_epoll" != "xno" -a "x$squid_cv_epoll_works" = "xyes" ; then
8075a4da 3408 squid_opt_io_loop_engine="epoll"
26d50fd2 3409elif test "x$enable_kqueue" != "xno" ; then
8075a4da 3410 squid_opt_io_loop_engine="kqueue"
a1ad2f9b
AJ
3411elif test "x$enable_devpoll" != "xno" ; then
3412 squid_opt_io_loop_engine="devpoll"
fcabe077 3413elif test "x$enable_poll" != "xno" -a "x$ac_cv_func_poll" = "xyes" ; then
8075a4da 3414 squid_opt_io_loop_engine="poll"
39145d19 3415elif test "x$enable_select" != "xno" -a "x$ac_cv_func_select" = "xyes"; then
8075a4da 3416 squid_opt_io_loop_engine="select"
39145d19
AJ
3417elif test "x$enable_select" != "xno" -a "x$squid_host_os" = "xmingw"; then
3418 squid_opt_io_loop_engine="select_win32"
1b3db6d9 3419else
a1ad2f9b 3420 AC_MSG_WARN([Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!])
be0c7ff0 3421 AC_MSG_WARN([Will try select and hope for the best.])
8075a4da 3422 squid_opt_io_loop_engine="select"
1b3db6d9 3423fi
d474c7a6 3424
8075a4da 3425AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.])
d474c7a6 3426
8075a4da
FC
3427AM_CONDITIONAL([USE_POLL], [test $squid_opt_io_loop_engine = poll])
3428AM_CONDITIONAL([USE_EPOLL], [test $squid_opt_io_loop_engine = epoll])
3429AM_CONDITIONAL([USE_SELECT], [test $squid_opt_io_loop_engine = select])
8075a4da
FC
3430AM_CONDITIONAL([USE_SELECT_WIN32], [test $squid_opt_io_loop_engine = select_win32])
3431AM_CONDITIONAL([USE_KQUEUE], [test $squid_opt_io_loop_engine = kqueue])
3432AM_CONDITIONAL([USE_DEVPOLL], [test $squid_opt_io_loop_engine = devpoll])
d474c7a6 3433
8075a4da 3434case $squid_opt_io_loop_engine in
0abb39dd 3435 epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;;
a1ad2f9b 3436 devpoll) AC_DEFINE(USE_DEVPOLL,1,[Use /dev/poll for the IO loop]) ;;
0abb39dd
FC
3437 poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;;
3438 kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;;
3439 select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;;
3440 select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;;
d474c7a6 3441esac
1b3db6d9 3442
96c2bb61
AR
3443if test "x$ac_cv_func_sched_getaffinity" = "xyes" -a "x$ac_cv_func_sched_setaffinity" = "xyes" ; then
3444 AC_DEFINE(HAVE_CPU_AFFINITY,1,[Support setting CPU affinity for workers])
3445fi
3446
91983da0
FC
3447SQUID_CHECK_SETRESUID_WORKS
3448if test "x$squid_cv_resuid_works" = "xyes" ; then
be0c7ff0 3449 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.])
5c51415d 3450fi
60939927 3451
2ff9dfaa 3452AC_CHECK_HEADERS(mswsock.h)
14c0d3ab
DK
3453AC_MSG_CHECKING([for constant CMSG_SPACE])
3454AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3455 #if HAVE_SYS_SOCKET_H
3456 #include <sys/socket.h>
3457 #endif
2ff9dfaa
AJ
3458 #if HAVE_MSWSOCK_H
3459 #include <mswsock.h>
3460 #endif
14c0d3ab
DK
3461
3462 int a[CMSG_SPACE(int)];
3463]])], [
3464 AC_MSG_RESULT(yes)
3465 AC_DEFINE(HAVE_CONSTANT_CMSG_SPACE, 1, [Define to 1 if CMSG_SPACE is constant])
3466], [
3467 AC_MSG_RESULT(no)
3468])
3469
ecd8516d 3470AC_CHECK_TYPE(struct cmsghdr,AC_DEFINE(HAVE_CMSGHDR,1,[The system provides struct cmsghdr]),,[
c72f8c2e
AJ
3471 #if HAVE_SYS_SOCKET_H
3472 #include <sys/socket.h>
3473 #endif
2ff9dfaa
AJ
3474 #if HAVE_MSWSOCK_H
3475 #include <mswsock.h>
3476 #endif
c72f8c2e
AJ
3477 #if HAVE_WINSOCK2_H
3478 #include <winsock2.h>
3479 #endif
3480])
3481
ecd8516d 3482AC_CHECK_TYPE(struct iovec,AC_DEFINE(HAVE_IOVEC,1,[The system provides struct iovec]),,[
c72f8c2e
AJ
3483 #if HAVE_SYS_SOCKET_H
3484 #include <sys/socket.h>
3485 #endif
3486 #if HAVE_WINSOCK2_H
3487 #include <winsock2.h>
3488 #endif
9ac84dcf
FC
3489 #if HAVE_SYS_UIO_H
3490 #include <sys/uio.h>
3491 #endif
c72f8c2e
AJ
3492])
3493
ecd8516d 3494AC_CHECK_TYPE(struct msghdr,AC_DEFINE(HAVE_MSGHDR,1,[The system provides struct msghdr]),,[
c72f8c2e
AJ
3495 #if HAVE_SYS_SOCKET_H
3496 #include <sys/socket.h>
3497 #endif
2ff9dfaa
AJ
3498 #if HAVE_MSWSOCK_H
3499 #include <mswsock.h>
3500 #endif
c72f8c2e
AJ
3501 #if HAVE_WINSOCK2_H
3502 #include <winsock2.h>
3503 #endif
3504])
3505
ecd8516d 3506AC_CHECK_TYPE(struct sockaddr_un,AC_DEFINE(HAVE_SOCKADDR_UN,1,[The system provides sockaddr_un]),,[
c72f8c2e
AJ
3507 #if HAVE_SYS_UN_H
3508 #include <sys/un.h>
3509 #endif
3510 #if HAVE_SYS_SOCKET_H
3511 #include <sys/socket.h>
3512 #endif
3513 #if HAVE_WINSOCK2_H
3514 #include <winsock2.h>
3515 #endif
3516])
3517
0abb39dd
FC
3518SQUID_CHECK_FUNC_STRNSTR
3519SQUID_CHECK_FUNC_VACOPY
3520SQUID_CHECK_FUNC___VACOPY
cee08cbc 3521
5cafc1d6 3522dnl IP-Filter support requires ipf header files. These aren't
3523dnl installed by default, so we need to check for them
fcabe077 3524if test "x$enable_ipf_transparent" != "xno" ; then
d25bbe26 3525 SQUID_CHECK_BROKEN_SOLARIS_IPFILTER
20ad76ab 3526 AC_MSG_CHECKING(for availability of IP-Filter header files)
42b51993 3527 # hold on to your hats...
fcabe077
FC
3528 if test "x$ac_cv_header_ip_compat_h" = "xyes" -o \
3529 "x$ac_cv_header_ip_fil_compat_h" = "xyes" -o \
3530 "x$ac_cv_header_netinet_ip_compat_h" = "xyes" -o \
3531 "x$ac_cv_header_netinet_ip_fil_compat_h" = "xyes" ; then
42b51993 3532 have_ipfilter_compat_header="yes"
d25bbe26
AJ
3533 fi
3534 if test "x$have_ipfilter_compat_header" = "xyes" -a \
fcabe077
FC
3535 "x$ac_cv_header_ip_fil_h" = "xyes" -a \
3536 "x$ac_cv_header_ip_nat_h" = "xyes" ; then
1d26e252 3537 enable_ipf_transparent="yes"
fcabe077
FC
3538 elif test "x$have_ipfilter_compat_header" = "xyes" -a \
3539 "x$ac_cv_header_netinet_ip_fil_h" = "xyes" -a \
3540 "x$ac_cv_header_netinet_ip_nat_h" = "xyes" ; then
1d26e252 3541 enable_ipf_transparent="yes"
eb824054 3542 else
1d26e252 3543 enable_ipf_transparent="no"
5cafc1d6 3544 fi
3545 AC_MSG_RESULT($IPF_TRANSPARENT)
d25bbe26
AJ
3546
3547## On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3548## Solaris minor version (8, 9, 10, ...)
3549 if test "x$enable_ipf_transparent" = "xyes" -a "x$squid_host_os" = "xsolaris" ; then
3550 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3551 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3552 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3553 fi
3554
1d26e252
FC
3555fi
3556AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent])
0f658b5b 3557SQUID_DEFINE_BOOL(IPF_TRANSPARENT,$enable_ipf_transparent,
1d26e252
FC
3558 [Enable support for IPF-style transparent proxying])
3559
b2192042
AJ
3560dnl PF /dev/pf support requires a header file.
3561if test "x$with_nat_devpf" != "xno" ; then
fcabe077
FC
3562 if test "x$ac_cv_header_net_pfvar_h" = "xyes" -o \
3563 "x$ac_cv_header_net_pf_pfvar_h" = "xyes"; then
b2192042
AJ
3564 if test "x$with_nat_devpf" = "xauto" ; then
3565 with_nat_devpf="no"
fcabe077
FC
3566 fi
3567 else
b2192042
AJ
3568 if test "x$with_nat_devpf" = "xyes" ; then
3569 AC_MSG_ERROR([PF /dev/pf based NAT requested but needed header not found])
fcabe077 3570 fi
b2192042 3571 with_nat_devpf="no"
fcabe077 3572 fi
2b0dd4ac 3573fi
b2192042 3574SQUID_DEFINE_BOOL(PF_TRANSPARENT,${enable_pf_transparent:=no},
38ff0a40 3575 [Enable support for PF-style transparent proxying])
b2192042
AJ
3576SQUID_DEFINE_BOOL(USE_NAT_DEVPF,${with_nat_devpf:=no},
3577 [Enable support for /dev/pf NAT lookups])
2b0dd4ac 3578
fcabe077
FC
3579if test "x$enable_linux_netfilter" != "xno" ; then
3580 if test "x$ac_cv_header_linux_netfilter_ipv4_h" = "xyes"; then
3581 if test "x$enable_linux_netfilter" = "xauto" ; then
4bd144d2
FC
3582 enable_linux_netfilter=yes
3583 fi
3584 else
fcabe077 3585 if test "x$enable_linux_netfilter" = "xauto" ; then
4bd144d2 3586 enable_linux_netfilter=no
d852fbad 3587 else
4bd144d2 3588 AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found])
d852fbad 3589 fi
4bd144d2 3590 fi
b50f1b2b 3591fi
0f658b5b 3592SQUID_DEFINE_BOOL(LINUX_NETFILTER,$enable_linux_netfilter,
969d4051 3593 [Enable support for Transparent Proxy on Linux via Netfilter])
20ad76ab 3594
b50f1b2b 3595dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
4bd144d2 3596AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter])
fcabe077 3597if test "x$enable_linux_netfilter" = "xyes" -a "x$with_libcap" != "xyes" ; then
3b7a7630
AJ
3598 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for TPROXY])
3599 AC_MSG_WARN([Linux Transparent Proxy (version 4+) support WILL NOT be enabled])
3600 AC_MSG_WARN([Reduced support to NAT Interception Proxy])
be0c7ff0 3601 # AC_DEFINEd later
96f08e2d
FC
3602fi
3603
11e8cfe3 3604if test "x$squid_opt_netfilterconntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then
3b7a7630 3605 AC_MSG_ERROR([Linux netfilter conntrack requires libcap support (libcap 2.09+)])
11e8cfe3
AB
3606fi
3607if test "x$with_netfilter_conntrack" = "xyes" -a "x$with_libcap" != "xyes" ; then
3b7a7630 3608 AC_MSG_WARN([Missing needed capabilities (libcap 2.09+) for netfilter mark support])
11e8cfe3
AB
3609 AC_MSG_WARN([Linux netfilter marking support WILL NOT be enabled])
3610 with_netfilter_conntrack=no
3611fi
3612AC_MSG_NOTICE([Linux Netfilter Conntrack support enabled: ${with_netfilter_conntrack} ${squid_opt_netfilterconntrackpath}])
3613
3614
3615AC_ARG_ENABLE(zph-qos,
3616 AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]), [
3617SQUID_YESNO([$enableval],
3618 [unrecognized argument to --enable-zph-qos: $enableval])
3619])
3620SQUID_DEFINE_BOOL(USE_QOS_TOS,${enable_zph_qos:=yes},
3621 [Enable Zero Penalty Hit QOS. When set, Squid will alter the
3622 TOS field of HIT responses to help policing network traffic])
3623AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos])
3624if test x"$enable_zph_qos" = "xyes" ; then
3625 AC_MSG_NOTICE([QOS netfilter mark preservation enabled: $with_netfilter_conntrack])
3626 SQUID_DEFINE_BOOL(USE_LIBNETFILTERCONNTRACK,${with_netfilter_conntrack:=no},
3627 [Enable support for QOS netfilter mark preservation])
3628fi
3629
3630
0f13ff28 3631AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB=''])
cc937513 3632AC_ARG_ENABLE(gnuregex,
a5eb3731
FC
3633 AS_HELP_STRING([--enable-gnuregex],
3634 [Compile GNUregex. Unless you have reason to use
cc937513
AJ
3635 this option, you should not enable it.
3636 This library file is usually only required on Windows and
3637 very old Unix boxes which do not have their own regex
0f13ff28
FC
3638 library built in.]), [
3639SQUID_YESNO([$enableval],[unrecognized argument to --enable-gnuregex: $enableval])
3640])
cdb352bb 3641# force-enable on old solaris and nextstep
fcabe077 3642if test "x${enable_gnuregex:=auto}" = "xauto" ; then
91bc414e 3643 case "$host" in
3644 *-sun-solaris2.[[0-4]])
0f13ff28 3645 enable_gnuregex="yes"
91bc414e 3646 ;;
3647 *-next-nextstep*)
0f13ff28 3648 enable_gnuregex="yes"
91bc414e 3649 ;;
3650 esac
3651fi
7a081912 3652
0f13ff28 3653# try detecting if it is needed
fcabe077 3654if test "x$enable_gnuregex" = "xauto" ; then
91983da0
FC
3655 SQUID_CHECK_REGEX_WORKS
3656 if test "x$squid_cv_regex_works" = "xyes" ; then
3657 enable_gnuregex=no
3658 else
3659 enable_gnuregex=yes
3660 fi
f49be7d1 3661fi
91983da0 3662AC_MSG_CHECKING(if GNUregex needs to be compiled)
0f13ff28 3663AC_MSG_RESULT($enable_gnuregex)
fcabe077 3664if test "x$enable_gnuregex" = "xyes"; then
0f13ff28
FC
3665 # for some reason (force-enable, test..) gnuregex was found as needed. Override any system lib
3666 REGEXLIB=""
80ab193b 3667fi
0f13ff28 3668#if no reason was found to enable gnuregex, disable it
fcabe077 3669if test "x$enable_gnuregex" = "xauto" ; then
0f13ff28 3670 enable_gnuregex=no
a4d7e961 3671fi
0f13ff28 3672SQUID_DEFINE_BOOL(USE_GNUREGEX,$enable_gnuregex,[Define if we should use GNU regex])
26675bf4 3673AC_SUBST(REGEXLIB)
a4d7e961 3674
8e0acaf5
FC
3675SQUID_DETECT_UDP_SND_BUFSIZE
3676SQUID_DETECT_UDP_RECV_BUFSIZE
3677SQUID_DETECT_TCP_SND_BUFSIZE
3678SQUID_DETECT_TCP_RECV_BUFSIZE
6bf65235 3679
fa8be5b5 3680SQUID_CHECK_RECV_ARG_TYPE
5c3c56fa
FC
3681SQUID_CHECK_NEED_SYS_ERRLIST
3682SQUID_CHECK_MAXPATHLEN
cc192b50 3683
819656da
AJ
3684SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK
3685SQUID_CHECK_RESOLVER_FIELDS
3686
615540cd 3687AC_CHECK_HEADERS(sys/statvfs.h)
fcabe077 3688if test "x$ac_cv_header_sys_statvfs_h" = "xyes" ; then
bb214e97 3689 SQUID_CHECK_WORKING_STATVFS
c68e9c6b 3690fi
615540cd
AJ
3691if test "x$ac_cv_func_statvfs" != "xyes" ; then
3692 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/vfs.h sys/statfs.h)
3693 AC_CHECK_FUNCS(statfs)
3694 SQUID_CHECK_F_FRSIZE_IN_STATFS
3695fi
c68e9c6b 3696
4eb85b7a 3697dnl Squid will not usually attempt to translate templates when building
461b8219 3698AC_ARG_ENABLE(translation,
4eb85b7a
AJ
3699 AS_HELP_STRING([--enable-translation],[Generate the localized error page templates and manuals.
3700 Which can also be downloaded from http://www.squid-cache.org/Versions/langpack/.]), [
3701 SQUID_YESNO([$enableval],
3702 [unrecognized argument to --enable-translation: $enableval])
461b8219 3703])
4eb85b7a 3704if test "x${enable_translation:=no}" = "xyes" ; then
461b8219 3705 AX_WITH_PROG([PO2HTML],[po2html])
02259ff8 3706 AX_WITH_PROG([PO2TEXT],[po2txt])
461b8219
AJ
3707else
3708 PO2HTML="off"
02259ff8 3709 PO2TEXT="off"
461b8219
AJ
3710fi
3711AC_SUBST(PO2HTML)
02259ff8 3712AC_SUBST(PO2TEXT)
ee1a8ac2 3713
43000484
AJ
3714dnl Squid now has limited locale handling ...
3715dnl on error pages
3716AC_ARG_ENABLE(auto-locale,
62979ab1 3717 AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
21d5413e 3718 clients request headers.
fb46b778
FC
3719 When disabled Squid requires explicit language configuration.]), [
3720SQUID_YESNO([$enableval],
3721 [unrecognized argument to --disable-auto-locale: $enableval])
8db7a54b 3722])
fb46b778
FC
3723AC_MSG_NOTICE([Multi-Language support enabled: ${enable_auto_locale:=yes}])
3724SQUID_DEFINE_BOOL(USE_ERR_LOCALES,$enable_auto_locale,
3725 [Use multi-language support on error pages])
3726
43000484 3727
090089c4 3728dnl Need the debugging version of malloc if available
3729XTRA_OBJS=''
fcabe077 3730if test "x$ac_cv_lib_malloc_main" = "xyes" ; then
090089c4 3731 if test -r /usr/lib/debug/malloc.o ; then
3732 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3733 fi
3734 if test -r /usr/lib/debug/mallocmap.o ; then
3735 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3736 fi
3737fi
3738AC_SUBST(XTRA_OBJS)
3739
fcabe077 3740if test "x$XTRA_LIBS" = "x"; then
38fea766 3741 XTRA_LIBS="$LIBS"
0f5a16f8 3742 dnl minor cleanup
3743 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 3744 LIBS=''
3745fi
090089c4 3746AC_SUBST(XTRA_LIBS)
3747
daed6927
FC
3748AC_SUBST(SQUID_CFLAGS)
3749AC_SUBST(SQUID_CXXFLAGS)
3750
b2f0a375
AJ
3751AC_ARG_VAR([BUILDCXXFLAGS],[C++ compiler flags for building compile-time tools. e.g. cf_gen])
3752if test "x$BUILDCXXFLAGS" = "x"; then
3753 # if we are NOT cross-compiling, use the default build flags for cf_gen and friends
3754 # otherwise rely on the user-provided value
3755 if test "x$squid_cv_check_marchnative" = "xyes"; then
3756 # always valid for the Build compiler.
b3080eec 3757 BUILDCXXFLAGS="-march=native"
b2f0a375
AJ
3758 fi
3759 BUILDCXXFLAGS="$BUILDCXXFLAGS $CXXFLAGS"
3760fi
3761AC_SUBST(BUILDCXXFLAGS)
3762
90b412dd
AJ
3763AC_MSG_NOTICE([BUILD LIBRARIES: $LIBS])
3764AC_MSG_NOTICE([BUILD EXTRA LIBRARIES: $XTRA_LIBS])
3765AC_MSG_NOTICE([BUILD OBJECTS: $OBJS])
3766AC_MSG_NOTICE([BUILD EXTRA OBJECTS: $XTRA_OBJS])
3767AC_MSG_NOTICE([BUILD C FLAGS: $CFLAGS])
3768AC_MSG_NOTICE([BUILD EXTRA C FLAGS: $SQUID_CFLAGS])
3769AC_MSG_NOTICE([BUILD C++ FLAGS: $CXXFLAGS])
3770AC_MSG_NOTICE([BUILD EXTRA C++ FLAGS: $SQUID_CXXFLAGS])
b2f0a375 3771AC_MSG_NOTICE([BUILD Tools C++ FLAGS: $BUILDCXXFLAGS])
daed6927 3772
090089c4 3773dnl Clean up after OSF/1 core dump bug
3774rm -f core
3775
7a03447c
AJ
3776AC_CONFIG_FILES([
3777 Makefile
3778 compat/Makefile
7a03447c 3779 contrib/Makefile
7a03447c
AJ
3780 doc/Makefile
3781 doc/manuals/Makefile
86b8d400 3782 doc/release-notes/Makefile
6b99776c 3783 errors/Makefile
7a03447c
AJ
3784 helpers/Makefile
3785 helpers/basic_auth/Makefile
3786 helpers/basic_auth/DB/Makefile
3787 helpers/basic_auth/fake/Makefile
3788 helpers/basic_auth/getpwnam/Makefile
3789 helpers/basic_auth/LDAP/Makefile
7a03447c
AJ
3790 helpers/basic_auth/NCSA/Makefile
3791 helpers/basic_auth/NIS/Makefile
3792 helpers/basic_auth/PAM/Makefile
3793 helpers/basic_auth/POP3/Makefile
3794 helpers/basic_auth/RADIUS/Makefile
3795 helpers/basic_auth/SASL/Makefile
3796 helpers/basic_auth/SMB/Makefile
8f0e29d2 3797 helpers/basic_auth/SMB_LM/Makefile
7a03447c
AJ
3798 helpers/basic_auth/SSPI/Makefile
3799 helpers/digest_auth/Makefile
3800 helpers/digest_auth/eDirectory/Makefile
3801 helpers/digest_auth/file/Makefile
3802 helpers/digest_auth/LDAP/Makefile
7a03447c
AJ
3803 helpers/external_acl/Makefile
3804 helpers/external_acl/AD_group/Makefile
ec1fac73 3805 helpers/external_acl/delayer/Makefile
7a03447c
AJ
3806 helpers/external_acl/eDirectory_userip/Makefile
3807 helpers/external_acl/file_userip/Makefile
3808 helpers/external_acl/kerberos_ldap_group/Makefile
3809 helpers/external_acl/LDAP_group/Makefile
3810 helpers/external_acl/LM_group/Makefile
3811 helpers/external_acl/session/Makefile
3812 helpers/external_acl/SQL_session/Makefile
3813 helpers/external_acl/unix_group/Makefile
3814 helpers/external_acl/wbinfo_group/Makefile
3815 helpers/external_acl/time_quota/Makefile
3816 helpers/log_daemon/Makefile
3817 helpers/log_daemon/DB/Makefile
3818 helpers/log_daemon/file/Makefile
6b99776c
AJ
3819 helpers/negotiate_auth/Makefile
3820 helpers/negotiate_auth/kerberos/Makefile
3821 helpers/negotiate_auth/SSPI/Makefile
3822 helpers/negotiate_auth/wrapper/Makefile
3823 helpers/ntlm_auth/Makefile
3824 helpers/ntlm_auth/fake/Makefile
3825 helpers/ntlm_auth/smb_lm/Makefile
3826 helpers/ntlm_auth/SSPI/Makefile
7a03447c
AJ
3827 helpers/ssl/Makefile
3828 helpers/storeid_rewrite/Makefile
3829 helpers/storeid_rewrite/file/Makefile
6b99776c
AJ
3830 helpers/url_rewrite/Makefile
3831 helpers/url_rewrite/fake/Makefile
3832 helpers/url_rewrite/LFS/Makefile
3833 icons/Makefile
3834 lib/Makefile
3835 lib/libTrie/Makefile
3836 lib/libTrie/test/Makefile
3837 lib/ntlmauth/Makefile
3838 lib/profiler/Makefile
3839 lib/rfcnb/Makefile
3840 lib/smblib/Makefile
3841 lib/snmplib/Makefile
3842 scripts/Makefile
3843 src/Makefile
3844 src/acl/Makefile
3845 src/adaptation/Makefile
3846 src/adaptation/icap/Makefile
3847 src/adaptation/ecap/Makefile
3848 src/anyp/Makefile
3849 src/auth/Makefile
3850 src/auth/basic/Makefile
3851 src/auth/digest/Makefile
3852 src/auth/negotiate/Makefile
3853 src/auth/ntlm/Makefile
3854 src/base/Makefile
3855 src/clients/Makefile
3856 src/comm/Makefile
4a3b98d7 3857 src/dns/Makefile
13d8c08c 3858 src/DiskIO/Makefile
d9691f09
AJ
3859 src/DiskIO/AIO/Makefile
3860 src/DiskIO/Blocking/Makefile
3861 src/DiskIO/DiskDaemon/Makefile
3862 src/DiskIO/DiskThreads/Makefile
3863 src/DiskIO/IpcIo/Makefile
3864 src/DiskIO/Mmapped/Makefile
6b99776c
AJ
3865 src/esi/Makefile
3866 src/eui/Makefile
3867 src/format/Makefile
3868 src/fs/Makefile
3869 src/ftp/Makefile
3870 src/helper/Makefile
3871 src/http/Makefile
3872 src/http/one/Makefile
3873 src/icmp/Makefile
3874 src/ident/Makefile
3875 src/ip/Makefile
3876 src/ipc/Makefile
3877 src/log/Makefile
3878 src/mem/Makefile
3879 src/mgr/Makefile
3880 src/parser/Makefile
3881 src/repl/Makefile
7dcca85b 3882 src/security/Makefile
6b99776c
AJ
3883 src/servers/Makefile
3884 src/snmp/Makefile
3885 src/ssl/Makefile
2745fea5 3886 src/store/Makefile
6b99776c 3887 test-suite/Makefile
94ab55b0 3888 tools/Makefile
33d1abfe 3889 tools/helper-mux/Makefile
2ccf2eb2 3890 tools/purge/Makefile
a35a0ac7 3891 tools/squidclient/Makefile
422cb5da 3892 tools/systemd/Makefile
a35a0ac7 3893 tools/sysvinit/Makefile
53cbe3e4 3894])
43ae1d95 3895
3e7b6055 3896# must configure libltdl subdir unconditionally for "make distcheck" to work
081863f3 3897#AC_CONFIG_SUBDIRS(libltdl)
3e7b6055 3898
6a9f6389 3899AC_OUTPUT