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