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