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