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