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