]>
Commit | Line | Data |
---|---|---|
1b3db6d9 | 1 | |
2877b8a9 | 2 | dnl Configuration input file for Squid |
090089c4 | 3 | dnl |
983061ed | 4 | dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) |
090089c4 | 5 | dnl |
0961c811 | 6 | dnl $Id: configure.in,v 1.259 2002/04/01 13:06:28 hno Exp $ |
090089c4 | 7 | dnl |
8 | dnl | |
090089c4 | 9 | dnl |
a26bdc75 | 10 | AC_INIT(src/main.c) |
71b12d7c | 11 | AC_CONFIG_AUX_DIR(cfgaux) |
8ea177f7 | 12 | AM_INIT_AUTOMAKE(squid, 2.6-DEVEL) |
a2794549 | 13 | AM_CONFIG_HEADER(include/autoconf.h) |
0961c811 | 14 | AC_REVISION($Revision: 1.259 $)dnl |
a2794549 | 15 | AC_PREFIX_DEFAULT(/usr/local/squid) |
246d7ffc | 16 | AM_MAINTAINER_MODE |
a2794549 | 17 | |
18 | dnl Set default LDFLAGS | |
19 | if test -z "$LDFLAGS"; then | |
20 | LDFLAGS="-g" | |
21 | fi | |
22 | ||
23 | PRESET_CFLAGS="$CFLAGS" | |
090089c4 | 24 | |
a2794549 | 25 | dnl Check for GNU cc |
26 | AC_PROG_CC | |
27 | AM_PROG_CC_C_O | |
88d50a22 | 28 | AC_CANONICAL_HOST |
29 | ||
a2794549 | 30 | |
26675bf4 | 31 | CRYPTLIB='' |
00fa2c12 | 32 | REGEXLIB='' # -lregex |
33 | LIBREGEX='' # libregex.a | |
090089c4 | 34 | |
a2794549 | 35 | dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well. |
36 | AC_EXEEXT | |
37 | AC_OBJEXT | |
38 | ||
39 | if test -z "$EXEEXT"; then | |
40 | CGIEXT=".cgi" | |
41 | else | |
42 | CGIEXT="$EXEEXT" | |
43 | fi | |
44 | ||
0e6d05ef | 45 | dnl this should be expanded to a list of platform sensible support requirements. |
46 | dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001 | |
df087e68 | 47 | case "$host_os" in |
a2794549 | 48 | cygwin|cygwin32) |
49 | AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true) | |
df087e68 | 50 | ;; |
51 | *) | |
a2794549 | 52 | AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false) |
df087e68 | 53 | ;; |
54 | esac | |
df087e68 | 55 | |
a26bdc75 | 56 | if test -z "$CACHE_HTTP_PORT"; then |
57 | CACHE_HTTP_PORT="3128" | |
58 | fi | |
59 | if test -z "$CACHE_ICP_PORT"; then | |
60 | CACHE_ICP_PORT="3130" | |
61 | fi | |
a26bdc75 | 62 | |
090089c4 | 63 | dnl Subsitutions |
4d683a65 | 64 | AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT) |
65 | AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT) | |
090089c4 | 66 | |
30a4f2a8 | 67 | AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host") |
68 | ||
781ba3fb | 69 | AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args") |
090089c4 | 70 | |
6ad85e8a | 71 | dnl Gerben Wierda <Gerben_Wierda@RnA.nl> |
72 | case "$host" in | |
73 | mab-next-nextstep3) | |
74 | CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc" | |
75 | ;; | |
76 | esac | |
77 | ||
30a4f2a8 | 78 | dnl Set Default CFLAGS |
79 | if test -z "$PRESET_CFLAGS"; then | |
80 | if test "$GCC" = "yes"; then | |
81 | case "$host" in | |
97b12a5b | 82 | *-sun-sunos*) |
30a4f2a8 | 83 | # sunos has too many warnings for this to be useful |
84 | # motorola too | |
85 | ;; | |
97b12a5b | 86 | *m88k*) |
87 | # Motorola cc/ld does not like -02 but is ok on -O | |
88 | CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'` | |
89 | ;; | |
30a4f2a8 | 90 | *) |
91 | CFLAGS="$CFLAGS -Wall" | |
92 | ;; | |
93 | esac | |
81a820c6 | 94 | else |
95 | case "$host" in | |
c415c128 | 96 | *mips-sgi-irix6.*) |
81a820c6 | 97 | # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com> |
c415c128 | 98 | CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \ |
58dc050d | 99 | -woff 1009,1014,1110,1116,1185,1188,1204,1230,1233 \ |
81a820c6 | 100 | -Wl,-woff,85,-woff,84,-woff,134 \ |
101 | -nostdinc -I/usr/include -D_BSD_SIGNALS" | |
102 | ;; | |
e8f5fb18 | 103 | alpha-dec-osf4.*) |
553c24ae | 104 | # Mogul says DEC compilers take both -g and -O2 |
b6a2f15e | 105 | CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'` |
553c24ae | 106 | CFLAGS="$CFLAGS -O2" |
107 | ;; | |
81a820c6 | 108 | *) |
109 | ;; | |
110 | esac | |
30a4f2a8 | 111 | fi |
30a4f2a8 | 112 | fi |
113 | ||
114 | dnl Set LDFLAGS | |
115 | if test -z "$PRESET_LDFLAGS"; then | |
116 | if test "$GCC" = "yes"; then | |
117 | case "$host" in | |
118 | *) | |
119 | # nothing | |
120 | ;; | |
121 | esac | |
81a820c6 | 122 | else |
123 | case "$host" in | |
c415c128 | 124 | *mips-sgi-irix6.*) |
81a820c6 | 125 | # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com> |
c415c128 | 126 | LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32" |
81a820c6 | 127 | ;; |
128 | esac | |
30a4f2a8 | 129 | fi |
130 | fi | |
2060fa9a | 131 | |
e5f4e1b0 | 132 | dnl Enable optional modules |
133 | AC_ARG_ENABLE(dlmalloc, | |
94d48591 | 134 | [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea], |
e5f4e1b0 | 135 | [ |
94d48591 | 136 | case "$enableval" in |
137 | 'yes') | |
029ce4ae | 138 | use_dlmalloc="yes" |
94d48591 | 139 | LIBDLMALLOC="libdlmalloc.a" |
140 | LIB_MALLOC="-L../lib -ldlmalloc" | |
029ce4ae | 141 | echo "dlmalloc enabled" |
94d48591 | 142 | ;; |
143 | 'no') | |
029ce4ae | 144 | use_dlmalloc="no" |
145 | echo "dlmalloc disabled" | |
94d48591 | 146 | ;; |
029ce4ae | 147 | *) use_dlmalloc="yes" |
148 | LIB_MALLOC="$enableval" | |
149 | echo "dlmalloc enabled with $LIB_MALLOC" | |
150 | esac | |
151 | ]) | |
152 | if test "${use_dlmalloc-unset}" = unset; then | |
153 | case "$host" in | |
154 | i386-*-solaris2.*) | |
155 | echo "Enabling dlmalloc for $host" | |
156 | use_dlmalloc="yes" | |
d20b1cd0 | 157 | LIBDLMALLOC="libdlmalloc.a" |
158 | LIB_MALLOC="-L../lib -ldlmalloc" | |
029ce4ae | 159 | ;; |
e8dbaa90 | 160 | *-sgi-irix*) |
161 | echo "Enabling dlmalloc for $host" | |
162 | use_dlmalloc="yes" | |
163 | LIBDLMALLOC="libdlmalloc.a" | |
164 | LIB_MALLOC="-L../lib -ldlmalloc" | |
165 | ;; | |
029ce4ae | 166 | esac |
167 | fi | |
168 | if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then | |
169 | # Ok. dlmalloc was enabled before, but state may be changed. | |
170 | # we have to test these again | |
171 | unset ac_cv_func_mallinfo | |
172 | unset ac_cv_func_mallocblksize | |
173 | unset ac_cv_func_free | |
174 | unset ac_cv_func_realloc | |
175 | unset ac_cv_func_memalign | |
176 | unset ac_cv_func_valloc | |
177 | unset ac_cv_func_pvalloc | |
178 | unset ac_cv_func_calloc | |
179 | unset ac_cv_func_cfree | |
180 | unset ac_cv_func_malloc_trim | |
181 | unset ac_cv_func_malloc_usable_size | |
182 | unset ac_cv_func_malloc_stats | |
183 | unset ac_cv_func_mallinfo | |
184 | unset ac_cv_func_mallopt | |
185 | unset ac_cv_lib_gnumalloc | |
186 | unset ac_cv_header_gnumalloc_h | |
187 | unset ac_cv_lib_malloc | |
188 | unset ac_cv_enabled_dlmalloc | |
189 | fi | |
190 | if test "$use_dlmalloc" = yes; then | |
94d48591 | 191 | ac_cv_func_mallinfo="yes" |
192 | ac_cv_func_mallocblksize="no" | |
193 | ac_cv_func_free="yes" | |
194 | ac_cv_func_realloc="yes" | |
195 | ac_cv_func_memalign="yes" | |
196 | ac_cv_func_valloc="yes" | |
197 | ac_cv_func_pvalloc="yes" | |
198 | ac_cv_func_calloc="yes" | |
199 | ac_cv_func_cfree="yes" | |
200 | ac_cv_func_malloc_trim="yes" | |
201 | ac_cv_func_malloc_usable_size="yes" | |
202 | ac_cv_func_malloc_stats="yes" | |
94d48591 | 203 | ac_cv_func_mallopt="yes" |
204 | ac_cv_lib_gnumalloc="no" | |
85efe3ec | 205 | ac_cv_header_gnumalloc_h="no" |
94d48591 | 206 | ac_cv_lib_malloc="no" |
207 | ac_cv_enabled_dlmalloc="yes" | |
029ce4ae | 208 | fi |
209 | ||
e5f4e1b0 | 210 | AC_SUBST(LIBDLMALLOC) |
211 | AC_SUBST(LIB_MALLOC) | |
212 | ||
213 | AC_ARG_ENABLE(gnuregex, | |
214 | [ --enable-gnuregex Compile GNUregex], | |
215 | [USE_GNUREGEX=$enableval]) | |
216 | ||
0961c811 | 217 | dnl This is a developer only option.. developers know how to set defines |
218 | dnl | |
219 | dnl AC_ARG_ENABLE(xmalloc-debug, | |
220 | dnl [ --enable-xmalloc-debug Do some simple malloc debugging], | |
221 | dnl [ if test "$enableval" = "yes" ; then | |
222 | dnl echo "Malloc debugging enabled" | |
223 | dnl AC_DEFINE(XMALLOC_DEBUG) | |
224 | dnl fi | |
225 | dnl ]) | |
226 | ||
227 | dnl This is a developer only option.. developers know how to set defines | |
228 | dnl | |
229 | dnl AC_ARG_ENABLE(xmalloc-debug-trace, | |
230 | dnl [ --enable-xmalloc-debug-trace | |
231 | dnl Detailed trace of memory allocations], | |
232 | dnl [ if test "$enableval" = "yes" ; then | |
233 | dnl echo "Malloc debug trace enabled" | |
234 | dnl AC_DEFINE(XMALLOC_TRACE) | |
235 | dnl AC_DEFINE(XMALLOC_DEBUG) | |
236 | dnl fi | |
237 | dnl ]) | |
e5f4e1b0 | 238 | |
d9180414 | 239 | AC_ARG_ENABLE(xmalloc-statistics, |
e5f4e1b0 | 240 | [ --enable-xmalloc-statistics |
241 | Show malloc statistics in status page], | |
242 | [ if test "$enableval" = "yes" ; then | |
243 | echo "Malloc statistics enabled" | |
244 | AC_DEFINE(XMALLOC_STATISTICS) | |
245 | fi | |
246 | ]) | |
247 | ||
323fe0d4 | 248 | AC_ARG_ENABLE(carp, |
249 | [ --enable-carp Enable CARP support], | |
250 | [ if test "$enableval" = "yes" ; then | |
251 | echo "CARP support enabled" | |
252 | AC_DEFINE(USE_CARP) | |
253 | fi | |
254 | ]) | |
255 | ||
cd748f27 | 256 | AC_ARG_ENABLE(async-io, |
9bc73deb | 257 | [ --enable-async-io[=N_THREADS] |
cd748f27 | 258 | Shorthand for |
f85c88f3 | 259 | --with-aufs-threads=N_THREADS |
cd748f27 | 260 | --with-pthreads |
261 | --enable-storeio=ufs,aufs], | |
262 | [ case $enableval in | |
9bc73deb | 263 | yes) |
cd748f27 | 264 | with_pthreads=yes |
265 | STORE_MODULES="ufs aufs" | |
9bc73deb | 266 | ;; |
267 | no) | |
9bc73deb | 268 | ;; |
269 | *) | |
f85c88f3 | 270 | aufs_io_threads=$enableval |
cd748f27 | 271 | with_pthreads=yes |
272 | STORE_MODULES="ufs aufs" | |
9bc73deb | 273 | ;; |
274 | esac | |
275 | ]) | |
276 | ||
f85c88f3 | 277 | AC_ARG_WITH(aufs-threads, |
278 | [ --with-aufs-threads=N_THREADS | |
cd748f27 | 279 | Tune the number of worker threads for the aufs object |
280 | store.], | |
f85c88f3 | 281 | [ aufs_io_threads=$withval ]) |
282 | if test "$aufs_io_threads"; then | |
283 | echo "With $aufs_io_threads aufs threads" | |
cd748f27 | 284 | with_pthreads=yes |
f85c88f3 | 285 | AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads) |
cd748f27 | 286 | fi |
287 | ||
288 | AC_ARG_WITH(pthreads, | |
289 | [ --with-pthreads Use POSIX Threads], | |
290 | [ if test "$enableval" = "yes"; then | |
291 | with_pthreads=yes | |
292 | fi | |
293 | ]) | |
294 | if test "$with_pthreads"; then | |
295 | echo "With pthreads" | |
9fc0b4b8 | 296 | SQUID_PTHREAD_LIB='$(PTHREADLIB)' |
297 | CFLAGS="$CFLAGS -D_REENTRANT" | |
c68e9c6b | 298 | case "$host" in |
299 | i386-unknown-freebsd*) | |
cd748f27 | 300 | if test "$GCC" = "yes" ; then |
301 | if test -z "$PRESET_LDFLAGS"; then | |
302 | LDFLAGS="$LDFLAGS -pthread" | |
303 | fi | |
304 | fi | |
305 | ;; | |
b71119d9 | 306 | *-solaris2.*) |
307 | if test "$GCC" = "yes" ; then | |
308 | CFLAGS="$CFLAGS -pthreads" | |
309 | else | |
310 | CFLAGS="$CFLAGS -mt" | |
311 | fi | |
312 | ;; | |
c68e9c6b | 313 | esac |
9bc73deb | 314 | fi |
e5f4e1b0 | 315 | AC_SUBST(SQUID_PTHREAD_LIB) |
316 | ||
f85c88f3 | 317 | AC_ARG_WITH(aio, |
318 | [ --with-aio Use POSIX AIO], | |
319 | [ if test "$enableval" = "yes"; then | |
320 | with_aio=yes | |
321 | fi | |
322 | ]) | |
323 | if test "$with_aio"; then | |
324 | echo "With aio" | |
325 | SQUID_AIO_LIB='$(AIOLIB)' | |
326 | fi | |
327 | AC_SUBST(SQUID_AIO_LIB) | |
328 | ||
cd748f27 | 329 | AC_ARG_ENABLE(storeio, |
330 | [ --enable-storeio=\"list of modules\" | |
331 | Build support for the list of store I/O modules. | |
332 | The default is only to build the "ufs" module. | |
333 | See src/fs for a list of available modules, or | |
334 | Programmers Guide section <not yet written> | |
335 | for details on how to build your custom store module], | |
336 | [ case $enableval in | |
337 | yes) | |
338 | for module in $srcdir/src/fs/*; do | |
339 | if test -f $module/Makefile.in; then | |
340 | STORE_MODULES="$STORE_MODULES `basename $module`" | |
a2794549 | 341 | fi |
cd748f27 | 342 | done |
343 | ;; | |
344 | no) | |
345 | ;; | |
346 | *) STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
347 | ;; | |
348 | esac | |
349 | ], | |
350 | [ if test -z "$STORE_MODULES"; then | |
351 | STORE_MODULES="ufs" | |
352 | fi | |
353 | ]) | |
d1aad03d | 354 | echo "Store modules built: $STORE_MODULES" |
a2794549 | 355 | STORE_OBJS="fs/lib`echo $STORE_MODULES|sed -e 's% %.a fs/lib%g'`.a" |
cd748f27 | 356 | AC_SUBST(STORE_OBJS) |
6652c622 | 357 | STORE_LIBS="`echo $STORE_OBJS|sed -e 's%fs/%%g'`" |
f71946fc | 358 | AC_SUBST(STORE_LIBS) |
a2794549 | 359 | dnl remove all but diskd - its the only module that needs to recurse |
360 | dnl into the sub directory | |
361 | STORE_MODULE_SUBDIRS= | |
362 | for fs in $STORE_MODULES none; do | |
f6ff4419 | 363 | if test "$fs" = "diskd"; then |
a2794549 | 364 | STORE_MODULE_SUBDIRS="$STORE_MODULE_SUBDIRS $fs" |
bacca099 | 365 | OPT_DISKD_EXE='diskd$(EXEEXT)' |
a2794549 | 366 | fi |
367 | done | |
368 | AC_SUBST(STORE_MODULES) | |
369 | AC_SUBST(STORE_MODULE_SUBDIRS) | |
bacca099 | 370 | AC_SUBST(OPT_DISKD_EXE) |
a2794549 | 371 | |
cd748f27 | 372 | |
6a566b9c | 373 | dnl --enable-heap-replacement compability option |
374 | AC_ARG_ENABLE(heap-replacement, | |
375 | [ --enable-heap-replacement | |
376 | Backwards compability option. Please use the | |
377 | new --enable-removal-policies directive instead.], | |
378 | [ if test "$enableval" = "yes" ; then | |
379 | echo "--enable-heap-replacement is obsolete. please use the new" | |
380 | echo "--enable-removal-policies directive instead" | |
381 | sleep 5 | |
382 | REPL_POLICIES="heap" | |
383 | fi | |
384 | ]) | |
385 | ||
d9180414 | 386 | AC_ARG_ENABLE(removal-policies, |
6a566b9c | 387 | [ --enable-removal-policies=\"list of policies\" |
388 | Build support for the list of removal policies. | |
389 | The default is only to build the "lru" module. | |
390 | See src/repl for a list of available modules, or | |
391 | Programmers Guide section 9.9 for details on how | |
392 | to build your custom policy], | |
393 | [ case $enableval in | |
394 | yes) | |
395 | for module in $srcdir/src/repl/*; do | |
396 | if test -f $module/Makefile.in; then | |
397 | REPL_POLICIES="$REPL_POLICIES `basename $module`" | |
398 | fi | |
399 | done | |
400 | ;; | |
401 | no) | |
402 | ;; | |
403 | *) REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
404 | ;; | |
405 | esac | |
406 | ], | |
407 | [ if test -z "$REPL_POLICIES"; then | |
408 | REPL_POLICIES="lru" | |
409 | fi | |
410 | ]) | |
65033bdd | 411 | echo "Removal policies built: $REPL_POLICIES" |
6a566b9c | 412 | AC_SUBST(REPL_POLICIES) |
a2794549 | 413 | REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a" |
6a566b9c | 414 | AC_SUBST(REPL_OBJS) |
6652c622 | 415 | REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`" |
f71946fc | 416 | AC_SUBST(REPL_LIBS) |
6a566b9c | 417 | |
8efddab9 | 418 | OPT_PINGER='' |
3c573763 | 419 | OPT_PINGER_EXE='' |
e5f4e1b0 | 420 | AC_ARG_ENABLE(icmp, |
421 | [ --enable-icmp Enable ICMP pinging], | |
422 | [ if test "$enableval" = "yes" ; then | |
423 | echo "ICMP enabled" | |
424 | AC_DEFINE(USE_ICMP) | |
8efddab9 | 425 | OPT_PINGER='pinger' |
426 | OPT_PINGER_EXE='pinger$(EXEEXT)' | |
e5f4e1b0 | 427 | fi |
428 | ]) | |
8efddab9 | 429 | AC_SUBST(OPT_PINGER) |
3c573763 | 430 | AC_SUBST(OPT_PINGER_EXE) |
e5f4e1b0 | 431 | |
a2794549 | 432 | AM_CONDITIONAL(USE_DELAY_POOLS, false) |
d9180414 | 433 | AC_ARG_ENABLE(delay-pools, |
76d83c52 | 434 | [ --enable-delay-pools Enable delay pools to limit bandwidth usage], |
e5f4e1b0 | 435 | [ if test "$enableval" = "yes" ; then |
95e36d02 | 436 | echo "Delay pools enabled" |
95e36d02 | 437 | AC_DEFINE(DELAY_POOLS) |
a2794549 | 438 | AM_CONDITIONAL(USE_DELAY_POOLS, true) |
e5f4e1b0 | 439 | fi |
440 | ]) | |
441 | ||
0961c811 | 442 | dnl This is a developer only option. Developers know how to set defines |
443 | dnl | |
444 | dnl AC_ARG_ENABLE(mem-gen-trace, | |
445 | dnl [ --enable-mem-gen-trace Do trace of memory stuff], | |
446 | dnl [ if test "$enableval" = "yes" ; then | |
447 | dnl echo "Memory trace (to file) enabled" | |
448 | dnl AC_DEFINE(MEM_GEN_TRACE) | |
449 | dnl fi | |
450 | dnl ]) | |
36a97e19 | 451 | |
d9180414 | 452 | AC_ARG_ENABLE(useragent-log, |
e5f4e1b0 | 453 | [ --enable-useragent-log Enable logging of User-Agent header], |
454 | [ if test "$enableval" = "yes" ; then | |
455 | echo "User-Agent logging enabled" | |
456 | AC_DEFINE(USE_USERAGENT_LOG) | |
457 | fi | |
458 | ]) | |
459 | ||
dfca7e1a | 460 | AC_ARG_ENABLE(referer-log, |
0961c811 | 461 | [ --enable-referer-log Enable logging of Referer header], |
dfca7e1a | 462 | [ if test "$enableval" = "yes" ; then |
463 | echo "Referer logging enabled" | |
464 | AC_DEFINE(USE_REFERER_LOG) | |
465 | fi | |
466 | ]) | |
467 | ||
320e9f36 | 468 | AC_ARG_ENABLE(wccp, |
0961c811 | 469 | [ --disable-wccp Disable Web Cache Coordination Protocol], |
eb824054 | 470 | [ if test "$enableval" = "no" ; then |
471 | echo "Web Cache Coordination Protocol disabled" | |
472 | AC_DEFINE(USE_WCCP, 0) | |
473 | else | |
474 | AC_DEFINE(USE_WCCP, 1) | |
320e9f36 | 475 | fi |
476 | ]) | |
320e9f36 | 477 | |
d9180414 | 478 | AC_ARG_ENABLE(kill-parent-hack, |
9fc0b4b8 | 479 | [ --enable-kill-parent-hack |
480 | Kill parent on shutdown], | |
e5f4e1b0 | 481 | [ if test "$enableval" = "yes" ; then |
482 | echo "Kill parent on shutdown" | |
483 | AC_DEFINE(KILL_PARENT_OPT) | |
484 | fi | |
485 | ]) | |
486 | ||
a2794549 | 487 | AM_CONDITIONAL(USE_SNMP, false) |
e5f4e1b0 | 488 | AC_ARG_ENABLE(snmp, |
489 | [ --enable-snmp Enable SNMP monitoring], | |
490 | [ if test "$enableval" = "yes" ; then | |
491 | echo "SNMP monitoring enabled" | |
492 | AC_DEFINE(SQUID_SNMP) | |
493 | SNMPLIB='-L../snmplib -lsnmp' | |
a2794549 | 494 | AM_CONDITIONAL(USE_SNMP, true) |
8a7f0105 | 495 | SNMP_MAKEFILE=./snmplib/Makefile |
e5f4e1b0 | 496 | makesnmplib=snmplib |
497 | fi | |
498 | ]) | |
499 | AC_SUBST(SNMPLIB) | |
e5f4e1b0 | 500 | AC_SUBST(makesnmplib) |
501 | ||
0961c811 | 502 | dnl This do not work well.. disable for now so people do not |
503 | dnl enable it and thereby cause problems.. (tired of seeing people | |
504 | dnl having enabled this, and then complaining...) | |
505 | dnl | |
506 | dnl AC_ARG_ENABLE(time-hack, | |
507 | dnl [ --enable-time-hack Update internal timestamp only once per second], | |
508 | dnl [ if test "$enableval" = "yes" ; then | |
509 | dnl echo "Update internal timestamp only once per second" | |
510 | dnl AC_DEFINE(ALARM_UPDATES_TIME) | |
511 | dnl fi | |
512 | dnl ]) | |
e5f4e1b0 | 513 | |
d9180414 | 514 | AC_ARG_ENABLE(cachemgr-hostname, |
e5f4e1b0 | 515 | [ --enable-cachemgr-hostname[=hostname] |
516 | Make cachemgr.cgi default to this host], | |
517 | [ case $enableval in | |
518 | yes) | |
519 | AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()]) | |
520 | echo "Cachemgr default hostname == host where cachemgr runs" | |
521 | ;; | |
522 | no) | |
523 | : # Nothing to do.. | |
524 | ;; | |
525 | *) | |
526 | AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}") | |
527 | echo "Cachemgr default hostname set to ${enableval}" | |
528 | ;; | |
529 | esac | |
530 | ]) | |
531 | ||
d9180414 | 532 | AC_ARG_ENABLE(arp-acl, |
e5f4e1b0 | 533 | [ --enable-arp-acl Enable use of ARP ACL lists (ether address)], |
534 | [ if test "$enableval" = "yes" ; then | |
535 | echo "ARP ACL lists enabled (ether address)" | |
933cc58d | 536 | case "$host" in |
ef614b1c | 537 | *-linux-*) |
538 | ;; | |
539 | *-solaris-*) | |
a931a29b | 540 | ;; |
933cc58d | 541 | *) |
ef614b1c | 542 | echo "WARNING: ARP ACL support probably won't work on $host." |
933cc58d | 543 | sleep 10 |
544 | ;; | |
545 | esac | |
e5f4e1b0 | 546 | AC_DEFINE(USE_ARP_ACL) |
547 | fi | |
548 | ]) | |
549 | ||
a2794549 | 550 | AM_CONDITIONAL(ENABLE_HTCP, false) |
74075210 | 551 | AC_ARG_ENABLE(htcp, |
88b7de25 | 552 | [ --enable-htcp Enable HTCP protocol], |
b4b8b6da | 553 | [ if test "$enableval" = "yes" ; then |
554 | echo "HTCP enabled" | |
b4b8b6da | 555 | AC_DEFINE(USE_HTCP) |
a2794549 | 556 | AM_CONDITIONAL(ENABLE_HTCP, true) |
b4b8b6da | 557 | fi |
74075210 | 558 | ]) |
a2794549 | 559 | |
560 | AM_CONDITIONAL(ENABLE_SSL, false) | |
74075210 | 561 | |
1f7c9178 | 562 | AC_ARG_ENABLE(ssl, |
563 | [ --enable-ssl Enable ssl gatewaying support using OpenSSL], | |
564 | [ if test "$enableval" != "no"; then | |
3dff197f | 565 | echo "SSL gatewaying using OpenSSL enabled" |
1f7c9178 | 566 | AC_DEFINE(USE_SSL) |
a2794549 | 567 | AM_CONDITIONAL(ENABLE_SSL, true) |
1f7c9178 | 568 | SSLLIB='-lssl -lcrypto' |
569 | USE_OPENSSL=1 | |
570 | fi | |
571 | ]) | |
572 | ||
3dff197f | 573 | AM_CONDITIONAL(NEED_OWN_MD5, true) |
574 | ||
1f7c9178 | 575 | AC_ARG_WITH(openssl, |
576 | [ --with-openssl[=prefix] | |
577 | Compile with the OpenSSL libraries. The path to | |
578 | the OpenSSL development libraries and headers | |
579 | installation can be specified if outside of the | |
580 | system standard directories], | |
581 | [ | |
46ce628c | 582 | case "$with_openssl" in |
1f7c9178 | 583 | yes) |
584 | USE_OPENSSL=1 | |
585 | ;; | |
586 | no) | |
587 | USE_OPENSSL= | |
588 | ;; | |
589 | *) | |
46ce628c | 590 | SSLLIBDIR="$with_openssl/lib" |
bcce53ce | 591 | CPPFLAGS="-I$with_openssl/include $CPPFLAGS" |
1f7c9178 | 592 | USE_OPENSSL=1 |
593 | esac | |
594 | ]) | |
595 | ||
596 | if test -n "$USE_OPENSSL"; then | |
3dff197f | 597 | echo "Using OpenSSL MD5 implementation" |
1f7c9178 | 598 | AC_DEFINE(USE_OPENSSL) |
3dff197f | 599 | AM_CONDITIONAL(NEED_OWN_MD5, false) |
1f7c9178 | 600 | if test -z "$SSLLIB"; then |
601 | SSLLIB="-lcrypto" # for MD5 routines | |
602 | fi | |
603 | fi | |
604 | if test -n "$SSLLIBDIR"; then | |
605 | SSLLIB="-L$SSLLIBDIR $SSLLIB" | |
606 | fi | |
1f7c9178 | 607 | AC_SUBST(SSLLIB) |
608 | ||
02749868 | 609 | AC_ARG_ENABLE(forw-via-db, |
610 | [ --enable-forw-via-db Enable Forw/Via database], | |
611 | [ if test "$enableval" = "yes" ; then | |
612 | echo "FORW-VIA enabled" | |
613 | AC_DEFINE(FORW_VIA_DB) | |
614 | fi | |
615 | ]) | |
616 | ||
6cfa8966 | 617 | AC_ARG_ENABLE(cache-digests, |
22df58ea | 618 | [ --enable-cache-digests Use Cache Digests |
2b6662ba | 619 | see http://www.squid-cache.org/FAQ/FAQ-16.html], |
484f2ebc | 620 | [ if test "$enableval" = "yes" ; then |
6cfa8966 | 621 | echo "USE_CACHE_DIGESTS enabled" |
622 | AC_DEFINE(USE_CACHE_DIGESTS) | |
484f2ebc | 623 | fi |
624 | ]) | |
625 | ||
8c3926c5 | 626 | dnl Select Default Error language |
627 | AC_ARG_ENABLE(default-err-language, | |
628 | [ --enable-default-err-language=lang | |
0961c811 | 629 | Select default language for Error pages (see |
630 | errors directory) ], | |
933cc58d | 631 | [ |
cf9d704a | 632 | if test -d $srcdir/errors/$enableval; then |
8c3926c5 | 633 | ERR_DEFAULT_LANGUAGE=$enableval |
933cc58d | 634 | else |
0961c811 | 635 | echo "ERROR! Unknown language $enableval, see errors/ directory" |
933cc58d | 636 | exit 1 |
637 | fi | |
8c3926c5 | 638 | ],[ERR_DEFAULT_LANGUAGE="English"]) |
639 | AC_SUBST(ERR_DEFAULT_LANGUAGE) | |
640 | ||
641 | dnl Select languages to be installed | |
642 | AC_ARG_ENABLE(err-languages, | |
643 | [ --enable-err-languages=\"lang1 lang2..\" | |
0961c811 | 644 | Select languages to be installed. (All will be |
645 | installed by default) ], | |
8c3926c5 | 646 | [ |
647 | for l in $enableval; do | |
648 | if test -d $srcdir/errors/$l; then :; else | |
649 | echo "ERROR! Unknown language $$l, see errors/" | |
650 | exit 1 | |
651 | fi | |
652 | done | |
653 | ERR_LANGUAGES=$enableval | |
654 | ],[ | |
655 | ERR_LANGUAGES= | |
656 | for l in $srcdir/errors/*; do | |
cbbe101f | 657 | if test -f $l/ERR_ACCESS_DENIED; then |
8c3926c5 | 658 | ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`" |
659 | fi | |
660 | done | |
661 | ]) | |
662 | AC_SUBST(ERR_LANGUAGES) | |
933cc58d | 663 | |
cd748f27 | 664 | dnl Size of COSS memory buffer |
665 | AC_ARG_WITH(coss-membuf-size, | |
666 | [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ], | |
667 | [ if test "$with_coss_membuf_size"; then | |
668 | echo "Setting COSS membuf size to $with_coss_membuf_size bytes" | |
669 | AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size) | |
670 | fi | |
671 | ]) | |
672 | ||
1b3db6d9 | 673 | dnl check for netio plugin stuff |
9bb83c8b | 674 | dnl Enable poll() |
675 | AC_ARG_ENABLE(poll, | |
0961c811 | 676 | [ --enable-poll Enable poll() support. |
677 | --disable-poll Disable poll() support. ], | |
1b3db6d9 | 678 | |
679 | [ | |
c68e9c6b | 680 | case "$enableval" in |
681 | yes) | |
9bb83c8b | 682 | echo "Forcing poll() to be enabled" |
683 | ac_cv_func_poll='yes' | |
c68e9c6b | 684 | ;; |
685 | no) | |
686 | echo "Forcing poll() to be disabled" | |
687 | ac_cv_func_poll='no' | |
688 | ;; | |
689 | esac | |
9bb83c8b | 690 | ]) |
691 | ||
1b3db6d9 | 692 | dnl Enable select() |
693 | AC_ARG_ENABLE(select, | |
0961c811 | 694 | [ --enable-select Enable select() support. |
695 | --disable-select Disable select() support. ], | |
1b3db6d9 | 696 | |
697 | [ | |
698 | case "$enableval" in | |
699 | yes) | |
700 | echo "Forcing select() to be enabled" | |
701 | ac_cv_func_select='yes' | |
702 | ;; | |
703 | no) | |
704 | echo "Forcing select() to be disabled" | |
705 | ac_cv_func_select='no' | |
706 | ;; | |
707 | esac | |
708 | ]) | |
709 | ||
710 | dnl Enable kqueue() | |
711 | AC_ARG_ENABLE(kqueue, | |
0961c811 | 712 | [ --enable-kqueue Enable kqueue() support. |
713 | --disable-kqueue Disable kqueue() support. ], | |
1b3db6d9 | 714 | |
715 | [ | |
716 | case "$enableval" in | |
717 | yes) | |
718 | echo "Forcing kqueue() to be enabled" | |
719 | ac_cv_func_kqueue='yes' | |
720 | ;; | |
721 | no) | |
722 | echo "Forcing kqueue() to be disabled" | |
723 | ac_cv_func_kqueue='no' | |
724 | ;; | |
725 | esac | |
726 | ]) | |
727 | ||
72fd085a | 728 | dnl Disable HTTP violations |
729 | AC_ARG_ENABLE(http-violations, | |
730 | [ --disable-http-violations | |
731 | This allows you to remove code which is known to | |
c68e9c6b | 732 | violate the HTTP protocol specification.], |
72fd085a | 733 | [ if test "$enableval" = "no" ; then |
734 | echo "Disabling HTTP Violations" | |
6eec93b2 | 735 | AC_DEFINE(HTTP_VIOLATIONS, 0) |
72fd085a | 736 | else |
6eec93b2 | 737 | AC_DEFINE(HTTP_VIOLATIONS, 1) |
72fd085a | 738 | fi |
739 | ]) | |
740 | ||
5cafc1d6 | 741 | dnl Enable IP-Filter Transparent Proxy |
742 | AC_ARG_ENABLE(ipf-transparent, | |
743 | [ --enable-ipf-transparent | |
744 | Enable Transparent Proxy support for systems | |
c68e9c6b | 745 | using IP-Filter network address redirection.], |
5cafc1d6 | 746 | [ if test "$enableval" = "yes" ; then |
747 | echo "IP-Filter Transparent Proxy enabled" | |
748 | AC_DEFINE(IPF_TRANSPARENT) | |
749 | IPF_TRANSPARENT="yes" | |
750 | fi | |
751 | ]) | |
752 | ||
d852fbad | 753 | dnl Enable Linux Netfilter (2.4) Transparent Proxy |
754 | AC_ARG_ENABLE(linux-netfilter, | |
755 | [ --enable-linux-netfilter | |
756 | Enable Transparent Proxy support for Linux 2.4.], | |
757 | [ if test "$enableval" = "yes" ; then | |
758 | echo "Linux-Netfilter Transparent Proxy enabled" | |
759 | AC_DEFINE(LINUX_NETFILTER) | |
760 | LINUX_NETFILTER="yes" | |
761 | fi | |
762 | ]) | |
763 | ||
bb7b5fd0 | 764 | dnl Enable Large file support |
765 | AC_ARG_ENABLE(large-files, | |
766 | [ --enable-large-files Enable support for large files (>2GB). Still | |
767 | experimental.], | |
768 | [ if test "$enableval" = "yes" ; then | |
769 | echo "Large file support enabled" | |
770 | CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" | |
771 | fi | |
772 | ]) | |
773 | ||
a2794549 | 774 | AM_CONDITIONAL(MAKE_LEAKFINDER, false) |
5d620373 | 775 | dnl Enable Leak Finding Functions |
776 | AC_ARG_ENABLE(leakfinder, | |
777 | [ --enable-leakfinder | |
778 | Enable Leak Finding code. Enabling this alone | |
779 | does nothing; you also have to modify the source | |
780 | code to use the leak finding functions. Probably | |
781 | Useful for hackers only.], | |
782 | [ if test "$enableval" = "yes" ; then | |
783 | echo "Leak-Finding enabled" | |
784 | AC_DEFINE(USE_LEAKFINDER) | |
5d620373 | 785 | USE_LEAKFINDER="yes" |
a2794549 | 786 | AM_CONDITIONAL(MAKE_LEAKFINDER, true) |
5d620373 | 787 | fi |
788 | ]) | |
5d620373 | 789 | |
3898f57f | 790 | AC_ARG_ENABLE(ident-lookups, |
791 | [ --disable-ident-lookups | |
792 | This allows you to remove code that performs | |
793 | Ident (RFC 931) lookups.], | |
794 | [ if test "$enableval" = "no" ; then | |
795 | echo "Disabling Ident Lookups" | |
796 | AC_DEFINE(USE_IDENT, 0) | |
797 | else | |
798 | AC_DEFINE(USE_IDENT, 1) | |
799 | fi | |
800 | ]) | |
801 | ||
a2794549 | 802 | AM_CONDITIONAL(USE_DNSSERVER, false) |
3c573763 | 803 | use_dnsserver= |
eb824054 | 804 | AC_ARG_ENABLE(internal-dns, |
7e3ce7b9 | 805 | [ --disable-internal-dns This prevents Squid from directly sending and |
eb824054 | 806 | receiving DNS messages, and instead enables the |
807 | old external 'dnsserver' processes.], | |
808 | [ if test "$enableval" = "no" ; then | |
809 | echo "Disabling Internal DNS queries" | |
3c573763 | 810 | use_dnsserver="yes" |
eb824054 | 811 | fi |
812 | ]) | |
3c573763 | 813 | if test "$use_dnsserver" = "yes"; then |
7b800d9f | 814 | AC_DEFINE(USE_DNSSERVERS) |
bacca099 | 815 | OPT_DNSSERVER_EXE='dnsserver$(EXEEXT)' |
a2794549 | 816 | AM_CONDITIONAL(USE_DNSSERVER, true) |
3c573763 | 817 | else |
818 | OPT_DNSSERVER_EXE='' | |
3c573763 | 819 | fi |
820 | AC_SUBST(OPT_DNSSERVER_EXE) | |
eb824054 | 821 | |
822 | AC_ARG_ENABLE(truncate, | |
7e3ce7b9 | 823 | [ --enable-truncate This uses truncate() instead of unlink() when |
eb824054 | 824 | removing cache files. Truncate gives a little |
825 | performance improvement, but may cause problems | |
826 | when used with async I/O. Truncate uses more | |
827 | filesystem inodes than unlink..], | |
828 | [ if test "$enableval" = "yes" ; then | |
829 | echo "Enabling truncate instead of unlink" | |
830 | AC_DEFINE(USE_TRUNCATE) | |
831 | fi | |
832 | ]) | |
833 | ||
9bc73deb | 834 | dnl Enable underscore in hostnames |
835 | AC_ARG_ENABLE(underscores, | |
836 | [ --enable-underscores Squid by default rejects any host names with _ | |
76d83c52 | 837 | in their name to conform with internet standards. |
9bc73deb | 838 | If you disagree with this you may allow _ in |
839 | hostnames by using this switch, provided that | |
840 | the resolver library on the host where Squid runs | |
841 | does not reject _ in hostnames...], | |
842 | [ if test "$enableval" = "yes" ; then | |
843 | echo "Enabling the use of underscores in host names" | |
844 | AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1) | |
845 | fi | |
846 | ]) | |
847 | ||
94439e4e | 848 | |
849 | dnl Select auth schemes modules to build | |
850 | AC_ARG_ENABLE(auth, | |
851 | [ --enable-auth=\"list of auth scheme modules\" | |
852 | Build support for the list of authentication schemes. | |
853 | The default is to build support for the Basic scheme. | |
854 | See src/auth for a list of available modules, or | |
855 | Programmers Guide section authentication schemes | |
856 | for details on how to build your custom auth scheme | |
857 | module], | |
858 | [ case $enableval in | |
859 | yes) | |
860 | for module in $srcdir/src/auth/*; do | |
861 | if test -f $module/Makefile.in; then | |
862 | AUTH_MODULES="$AUTH_MODULES `basename $module`" | |
863 | fi | |
864 | done | |
865 | ;; | |
866 | no) | |
867 | ;; | |
868 | *) AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
869 | ;; | |
870 | esac | |
871 | ], | |
872 | [ if test -z "$AUTH_MODULES"; then | |
873 | AUTH_MODULES="basic" | |
874 | fi | |
875 | ]) | |
876 | echo "Auth scheme modules built: $AUTH_MODULES" | |
877 | AC_SUBST(AUTH_MODULES) | |
a2794549 | 878 | AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a" |
94439e4e | 879 | AC_SUBST(AUTH_OBJS) |
6652c622 | 880 | AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`" |
94439e4e | 881 | AC_SUBST(AUTH_LIBS) |
882 | ||
883 | dnl Select basic auth scheme helpers to build | |
884 | BASIC_AUTH_HELPERS="" | |
380f0a87 | 885 | AC_ARG_ENABLE(auth-modules, |
94439e4e | 886 | [ --enable-auth-modules=\"list of helpers\" |
887 | Backwards compability alias for | |
888 | --enable-basic-auth-helpers], | |
889 | [ echo "--enable-auth-modules is obsolete. Please use the new" | |
890 | echo "option --enable-basic-auth-helpers" | |
891 | sleep 5 | |
892 | case "$enableval" in | |
893 | yes) | |
894 | for helper in $srcdir/src/auth/basic/helpers/*; do | |
895 | if test -f $helper/Makefile.in; then | |
fc83a946 | 896 | BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`" |
94439e4e | 897 | fi |
898 | done | |
899 | ;; | |
900 | no) | |
901 | ;; | |
902 | *) | |
fc83a946 | 903 | BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
94439e4e | 904 | esac |
905 | ]) | |
906 | AC_ARG_ENABLE(basic-auth-helpers, | |
907 | [ --enable-basic-auth-helpers=\"list of helpers\" | |
908 | This option selects which basic scheme proxy_auth | |
909 | helpers to build and install as part of the normal | |
910 | build process. For a list of available | |
911 | helpers see the src/auth/basic/helpers directory.], | |
912 | [ case "$enableval" in | |
913 | yes) | |
914 | BASIC_AUTH_HELPERS="" | |
915 | for helper in $srcdir/src/auth/basic/helpers/*; do | |
916 | if test -f $helper/Makefile.in; then | |
fc83a946 | 917 | BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`" |
94439e4e | 918 | fi |
919 | done | |
920 | ;; | |
921 | no) | |
922 | ;; | |
923 | *) | |
fc83a946 | 924 | BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
94439e4e | 925 | esac |
926 | ]) | |
fc83a946 | 927 | if test -n "$BASIC_AUTH_HELPERS"; then |
928 | echo "Basic auth helpers built: $BASIC_AUTH_HELPERS" | |
94439e4e | 929 | fi |
fc83a946 | 930 | AC_SUBST(BASIC_AUTH_HELPERS) |
94439e4e | 931 | |
932 | dnl Select ntlm auth helpers to build | |
933 | NTLM_AUTH_HELPERS= | |
934 | AC_ARG_ENABLE(ntlm-auth-helpers, | |
935 | [ --enable-ntlm-auth-helpers=\"list of helpers\" | |
936 | This option selects which proxy_auth ntlm helpers | |
937 | to build and install as part of the normal build | |
380f0a87 | 938 | process. For a list of available modules see |
94439e4e | 939 | the src/auth/ntlm/helpers directory.], |
380f0a87 | 940 | [ case "$enableval" in |
941 | yes) | |
94439e4e | 942 | for helper in $srcdir/src/auth/ntlm/helpers/*; do |
943 | if test -f $helper/Makefile.in; then | |
944 | NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS `basename $helper`" | |
380f0a87 | 945 | fi |
946 | done | |
947 | ;; | |
948 | no) | |
949 | ;; | |
950 | *) | |
94439e4e | 951 | NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" |
380f0a87 | 952 | esac |
953 | ]) | |
94439e4e | 954 | if test -n "$NTLM_AUTH_HELPERS"; then |
955 | echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS" | |
380f0a87 | 956 | fi |
94439e4e | 957 | AC_SUBST(NTLM_AUTH_HELPERS) |
958 | ||
2d70df72 | 959 | dnl Select digest auth scheme helpers to build |
960 | DIGEST_AUTH_HELPERS= | |
961 | AC_ARG_ENABLE(digest-auth-helpers, | |
962 | [ --enable-digest-auth-helpers=\"list of helpers\" | |
963 | This option selects which digest scheme authentication | |
964 | helpers to build and install as part of the normal build | |
965 | process. For a list of available modules see the | |
966 | src/auth/digest/helpers directory.], | |
967 | [ case "$enableval" in | |
968 | yes) | |
969 | for helper in $srcdir/src/auth/digest/helpers/*; do | |
970 | if test -f $helper/Makefile.in; then | |
971 | DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS `basename $helper`" | |
972 | fi | |
973 | done | |
974 | ;; | |
975 | no) | |
976 | ;; | |
977 | *) | |
978 | DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" | |
979 | esac | |
980 | ]) | |
981 | if test -n "$DIGEST_AUTH_HELPERS"; then | |
982 | echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS" | |
983 | fi | |
984 | AC_SUBST(DIGEST_AUTH_HELPERS) | |
380f0a87 | 985 | |
6437ac71 | 986 | dnl Enable "NTLM fail open" |
987 | AC_ARG_ENABLE(ntlm-fail-open, | |
988 | [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the | |
0961c811 | 989 | Authentication steps can allow squid to still authenticate |
990 | the user.], | |
6437ac71 | 991 | [ if test "$enableval" = "yes" ; then |
992 | AC_DEFINE(NTLM_FAIL_OPEN) | |
993 | fi | |
994 | ]) | |
995 | ||
3c573763 | 996 | dnl Disable "unlinkd" code |
fe0810ac | 997 | AC_ARG_ENABLE(unlinkd, |
998 | [ --disable-unlinkd Do not use unlinkd], | |
999 | [ if test "$enableval" = "no" ; then | |
3c573763 | 1000 | use_unlinkd=no |
fe0810ac | 1001 | else |
3c573763 | 1002 | use_unlinkd=yes |
fe0810ac | 1003 | fi |
1004 | ],[ | |
1005 | # Here we should probably use some magic depending on the selected | |
1006 | # storage models | |
3c573763 | 1007 | use_unlinkd=yes |
fe0810ac | 1008 | ]) |
3c573763 | 1009 | if test "$use_unlinkd" = "yes"; then |
fe0810ac | 1010 | echo "unlinkd enabled" |
1011 | AC_DEFINE(USE_UNLINKD) | |
a2794549 | 1012 | AM_CONDITIONAL(ENABLE_UNLINKD, true) |
fe0810ac | 1013 | else |
1014 | echo "unlinkd disabled" | |
a2794549 | 1015 | AM_CONDITIONAL(ENABLE_UNLINKD, false) |
fe0810ac | 1016 | fi |
fe0810ac | 1017 | |
ce3d30fb | 1018 | dnl Enable backtraces on fatal errors |
1019 | AC_ARG_ENABLE(stacktraces, | |
1020 | [ --enable-stacktraces Enable automatic call backtrace on fatal errors], | |
1021 | [ if test "$enableval" = "yes" ; then | |
1022 | echo "Enabling automatic stack backtraces on fatal errors" | |
1023 | AC_DEFINE(PRINT_STACK_TRACE, 1) | |
1024 | fi | |
1025 | ]) | |
1026 | ||
f66a9ef4 | 1027 | dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup |
1028 | AC_ARG_ENABLE(x_accelerator_vary, | |
0961c811 | 1029 | [ --enable-x-accelerator-vary |
1030 | Enable support for the X-Accelerator-Vary | |
1031 | HTTP header. Can be used to indicate | |
1032 | variance within an accelerator setup. | |
1033 | Typically used together with other code | |
1034 | that adds custom HTTP headers to the requests.], | |
f66a9ef4 | 1035 | [ if test "$enableval" = "yes" ; then |
1036 | echo "Enabling support for X-Accelerator-Vary" | |
1037 | AC_DEFINE(X_ACCELERATOR_VARY, 1) | |
1038 | fi | |
1039 | ]) | |
1040 | ||
fd9aaa3e | 1041 | # Force some compilers to use ANSI features |
1042 | # | |
1043 | case "$host" in | |
1044 | alpha-dec-osf*) | |
1045 | if test "$ac_cv_prog_CC" = "cc" ; then | |
1046 | echo "adding '-std1' to cc args for $host" | |
1047 | CC="cc -std1"; | |
1048 | ac_cv_prog_CC="$CC" | |
1049 | fi | |
1050 | ;; | |
c68e9c6b | 1051 | *-hp-hpux*) |
1052 | if test "$ac_cv_prog_CC" = "cc" ; then | |
1053 | echo "adding '-Ae' to cc args for $host" | |
1054 | CC="cc -Ae"; | |
1055 | ac_cv_prog_CC="$CC" | |
1056 | fi | |
1057 | ;; | |
fd9aaa3e | 1058 | esac |
1059 | ||
090089c4 | 1060 | dnl Check for programs |
1061 | AC_PROG_CPP | |
1062 | AC_PROG_INSTALL | |
1063 | AC_PROG_RANLIB | |
1064 | AC_PROG_LN_S | |
81280a96 | 1065 | AC_PATH_PROG(SH, sh, /bin/sh) |
d9f67e6f | 1066 | AC_PATH_PROG(FALSE, false, /usr/bin/false) |
1067 | AC_PATH_PROG(TRUE, true, /usr/bin/true) | |
1068 | AC_PATH_PROG(RM, rm, $FALSE) | |
1069 | AC_PATH_PROG(MV, mv, $FALSE) | |
1070 | AC_PATH_PROG(MKDIR, mkdir, $FALSE) | |
090089c4 | 1071 | AC_PATH_PROG(LN, ln, cp) |
4e9d8e26 | 1072 | AC_PATH_PROG(PERL, perl, none) |
a2794549 | 1073 | dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE) |
6ad85e8a | 1074 | AC_PATH_PROG(AR, ar, $FALSE) |
1075 | ||
4e9d8e26 | 1076 | if test "$ac_cv_path_PERL" = "none"; then |
1077 | echo "Perl is required to compile Squid" | |
1078 | echo "Please install Perl and then re-run configure" | |
1079 | exit 1 | |
1080 | fi | |
1081 | ||
6ad85e8a | 1082 | case "$host" in |
1083 | *-hp-hpux*) | |
1084 | echo "Disabling 'ranlib' for HP-UX..." | |
1085 | RANLIB=":" | |
1086 | ;; | |
1087 | esac | |
1088 | ||
1089 | dnl set $(AR) | |
1090 | AR_R="$AR r" | |
1091 | case "$host" in | |
1092 | *-next-nextstep3) | |
1093 | AR="libtool -o" | |
1094 | ;; | |
1095 | esac | |
1096 | AC_SUBST(AR_R) | |
090089c4 | 1097 | |
1098 | dnl Check for headers | |
1099 | AC_HEADER_DIRENT | |
1100 | AC_HEADER_STDC | |
db40ae20 | 1101 | |
1102 | AC_CHECK_HEADERS( \ | |
db40ae20 | 1103 | arpa/inet.h \ |
30a4f2a8 | 1104 | arpa/nameser.h \ |
9441aa34 | 1105 | assert.h \ |
db40ae20 | 1106 | bstring.h \ |
db40ae20 | 1107 | crypt.h \ |
30a4f2a8 | 1108 | ctype.h \ |
1109 | errno.h \ | |
ce3d30fb | 1110 | execinfo.h \ |
db40ae20 | 1111 | fcntl.h \ |
9c1d8929 | 1112 | getopt.h \ |
88738790 | 1113 | gnumalloc.h \ |
30a4f2a8 | 1114 | grp.h \ |
5cafc1d6 | 1115 | ip_compat.h \ |
42b51993 | 1116 | ip_fil_compat.h \ |
5cafc1d6 | 1117 | ip_fil.h \ |
1118 | ip_nat.h \ | |
30a4f2a8 | 1119 | libc.h \ |
6ad85e8a | 1120 | limits.h \ |
d852fbad | 1121 | linux/netfilter_ipv4.h \ |
30a4f2a8 | 1122 | malloc.h \ |
e0bddc45 | 1123 | math.h \ |
db40ae20 | 1124 | memory.h \ |
b075cbb1 | 1125 | mount.h \ |
5cafc1d6 | 1126 | net/if.h \ |
30a4f2a8 | 1127 | netdb.h \ |
c415c128 | 1128 | netinet/if_ether.h \ |
db40ae20 | 1129 | netinet/in.h \ |
30a4f2a8 | 1130 | netinet/tcp.h \ |
eb824054 | 1131 | netinet/ip_compat.h \ |
42b51993 | 1132 | netinet/ip_fil_compat.h \ |
eb824054 | 1133 | netinet/ip_fil.h \ |
1134 | netinet/ip_nat.h \ | |
1f7c9178 | 1135 | openssl/err.h \ |
1136 | openssl/md5.h \ | |
1137 | openssl/ssl.h \ | |
dcfe6390 | 1138 | poll.h \ |
30a4f2a8 | 1139 | pwd.h \ |
1140 | regex.h \ | |
1141 | resolv.h \ | |
c68e9c6b | 1142 | sched.h \ |
30a4f2a8 | 1143 | signal.h \ |
1144 | stdarg.h \ | |
1145 | stddef.h \ | |
1146 | stdio.h \ | |
db40ae20 | 1147 | stdlib.h \ |
1148 | string.h \ | |
1149 | strings.h \ | |
1150 | sys/file.h \ | |
5cafc1d6 | 1151 | sys/ioctl.h \ |
0343b99c | 1152 | sys/mount.h \ |
ebb3c3ba | 1153 | sys/msg.h \ |
30a4f2a8 | 1154 | sys/param.h \ |
1155 | sys/resource.h \ | |
db40ae20 | 1156 | sys/select.h\ |
30a4f2a8 | 1157 | sys/socket.h \ |
1158 | sys/stat.h \ | |
b075cbb1 | 1159 | sys/statvfs.h \ |
3c641669 | 1160 | syscall.h \ |
30a4f2a8 | 1161 | sys/syscall.h \ |
db40ae20 | 1162 | sys/time.h \ |
1163 | sys/types.h \ | |
30a4f2a8 | 1164 | sys/un.h \ |
b075cbb1 | 1165 | sys/vfs.h \ |
30a4f2a8 | 1166 | sys/wait.h \ |
db40ae20 | 1167 | syslog.h \ |
30a4f2a8 | 1168 | time.h \ |
1169 | unistd.h \ | |
3c641669 | 1170 | utime.h \ |
30a4f2a8 | 1171 | varargs.h \ |
77d6bd88 | 1172 | byteswap.h \ |
1173 | glib.h \ | |
60d096f4 | 1174 | stdint.h \ |
1175 | inttypes.h \ | |
3c641669 | 1176 | grp.h \ |
1177 | nss_common.h \ | |
1178 | nss.h | |
db40ae20 | 1179 | ) |
1180 | ||
aee0606f | 1181 | AC_C_CONST |
d57288d2 | 1182 | AC_C_BIGENDIAN |
aee0606f | 1183 | |
5c51415d | 1184 | AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [ |
1185 | AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}], | |
1186 | [foo("bar")], | |
1187 | ac_cv_have_ansi_prototypes="yes", | |
1188 | ac_cv_have_ansi_prototypes="no") | |
1189 | ]) | |
1190 | if test $ac_cv_have_ansi_prototypes = "yes" ; then | |
1191 | AC_DEFINE(HAVE_ANSI_PROTOTYPES) | |
1192 | fi | |
20a50bb9 | 1193 | |
5c51415d | 1194 | AC_CACHE_CHECK(for tm->tm_gmtoff,ac_cv_have_tm_gmoff, [ |
1195 | AC_TRY_COMPILE([#include <time.h> | |
46c883ed | 1196 | #include <sys/time.h>], |
5c51415d | 1197 | [struct tm foo; |
1198 | foo.tm_gmtoff = 0;], | |
1199 | ac_cv_have_tm_gmoff="yes", | |
1200 | ac_cv_have_tm_gmoff="no") | |
1201 | ]) | |
1202 | if test $ac_cv_have_tm_gmoff = "yes" ; then | |
1203 | AC_DEFINE(HAVE_TM_GMTOFF) | |
1204 | fi | |
46c883ed | 1205 | |
eb824054 | 1206 | AC_CACHE_CHECK(for struct mallinfo,ac_cv_have_struct_mallinfo, [ |
1207 | AC_TRY_COMPILE([#include <sys/types.h> | |
1208 | #if HAVE_MALLOC_H | |
1209 | #include <malloc.h> | |
1210 | #endif], | |
1211 | [struct mallinfo foo; | |
1212 | foo.arena = 0; | |
1213 | foo.ordblks = 0; | |
1214 | foo.smblks = 0; | |
1215 | foo.hblks = 0; | |
1216 | foo.hblkhd = 0; | |
1217 | foo.uordblks = 0; | |
1218 | foo.fordblks = 0; | |
1219 | foo.keepcost = 0;], | |
1220 | ac_cv_have_struct_mallinfo="yes", | |
1221 | ac_cv_have_struct_mallinfo="no") | |
1222 | ]) | |
1223 | if test $ac_cv_have_struct_mallinfo = "yes" ; then | |
1224 | AC_DEFINE(HAVE_STRUCT_MALLINFO) | |
1225 | fi | |
1226 | ||
5c51415d | 1227 | AC_CACHE_CHECK(for extended mallinfo,ac_cv_have_ext_mallinfo, [ |
1228 | AC_TRY_COMPILE([#include <sys/types.h> | |
46c883ed | 1229 | #include <malloc.h>], |
5c51415d | 1230 | [struct mallinfo foo; |
1231 | foo.mxfast = 0;], | |
1232 | ac_cv_have_ext_mallinfo="yes", | |
1233 | ac_cv_have_ext_mallinfo="no") | |
1234 | ]) | |
1235 | if test $ac_cv_have_ext_mallinfo = "yes" ; then | |
1236 | AC_DEFINE(HAVE_EXT_MALLINFO) | |
1237 | fi | |
090089c4 | 1238 | |
b54a6789 | 1239 | AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [ |
1240 | AC_TRY_COMPILE([ | |
8ff51bba | 1241 | #if HAVE_SYS_TIME_H |
1242 | #include <sys/time.h> | |
1243 | #endif | |
b54a6789 | 1244 | #if HAVE_SYS_RESOURCE_H |
1245 | #include <sys/resource.h> | |
1246 | #endif], | |
1247 | [struct rusage R;], | |
1248 | ac_cv_have_struct_rusage="yes", | |
1249 | ac_cv_have_struct_rusage="no") | |
1250 | ]) | |
1251 | if test $ac_cv_have_struct_rusage = "yes" ; then | |
1252 | AC_DEFINE(HAVE_STRUCT_RUSAGE) | |
1253 | fi | |
1254 | ||
5c51415d | 1255 | AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [ |
1256 | AC_TRY_COMPILE([#include <sys/types.h> | |
a025a745 | 1257 | #include <netinet/in.h> |
1258 | #include <netinet/in_systm.h> | |
6ad85e8a | 1259 | #include <netinet/ip.h> |
b05490a8 | 1260 | #if defined (__linux__) || defined (__CYGWIN__) |
6ad85e8a | 1261 | #define ip_hl ihl |
1262 | #endif | |
1263 | #ifndef __linux__ | |
b05490a8 | 1264 | #ifndef __CYGWIN__ |
6ad85e8a | 1265 | #define iphdr ip |
b05490a8 | 1266 | #endif |
6ad85e8a | 1267 | #endif], |
5c51415d | 1268 | [struct iphdr ip; |
1269 | ip.ip_hl= 0;], | |
1270 | ac_cv_have_ip_hl="yes", | |
1271 | ac_cv_have_ip_hl="no") | |
1272 | ]) | |
1273 | if test $ac_cv_have_ip_hl = "yes" ; then | |
1274 | AC_DEFINE(HAVE_IP_HL) | |
1275 | fi | |
a025a745 | 1276 | |
090089c4 | 1277 | dnl Check for typedefs |
77d6bd88 | 1278 | AC_CHECK_SIZEOF(void *) |
1279 | AC_CHECK_SIZEOF(short) | |
090089c4 | 1280 | AC_CHECK_SIZEOF(int) |
1281 | AC_CHECK_SIZEOF(long) | |
77d6bd88 | 1282 | AC_CHECK_SIZEOF(long long) |
1283 | AC_CHECK_SIZEOF(__int64) | |
1284 | AC_CHECK_SIZEOF(int16_t) | |
1285 | AC_CHECK_SIZEOF(uint16_t) | |
1286 | AC_CHECK_SIZEOF(u_int16_t) | |
1287 | AC_CHECK_SIZEOF(int32_t) | |
1288 | AC_CHECK_SIZEOF(uint32_t) | |
1289 | AC_CHECK_SIZEOF(u_int32_t) | |
1290 | AC_CHECK_SIZEOF(int64_t) | |
1291 | AC_CHECK_SIZEOF(uint64_t) | |
1292 | AC_CHECK_SIZEOF(u_int64_t) | |
1293 | ||
1294 | dnl int16_t | |
1295 | if test "x$ac_cv_sizeof_short" = "x2"; then | |
1296 | AC_CHECK_TYPE(int16_t,short) | |
1297 | elif test "x$ac_cv_sizeof_int" = "x2"; then | |
1298 | AC_CHECK_TYPE(int16_t,int) | |
1299 | fi | |
1300 | dnl u_int16t_t | |
1301 | if test "x$ac_cv_sizeof_uint16_t" = "x2"; then | |
1302 | AC_CHECK_TYPE(u_int16_t,uint16_t) | |
1303 | elif test "x$ac_cv_sizeof_short" = "x2"; then | |
1304 | AC_CHECK_TYPE(u_int16_t,unsigned short) | |
1305 | elif test "x$ac_cv_sizeof_int" = "x2"; then | |
1306 | AC_CHECK_TYPE(u_int16_t,unsigned int) | |
1307 | fi | |
1308 | dnl int32_t | |
1309 | if test "x$ac_cv_sizeof_int" = "x4"; then | |
1310 | AC_CHECK_TYPE(int32_t,int) | |
1311 | elif "x$ac_cv_sizeof_long" = "x4"; then | |
1312 | AC_CHECK_TYPE(int32_t,long) | |
1313 | fi | |
1314 | dnl u_int32_t | |
1315 | if test "x$ac_cv_sizeof_uint32_t" = "x4"; then | |
1316 | AC_CHECK_TYPE(u_int32_t,uint32_t) | |
1317 | elif test "x$ac_cv_sizeof_int" = "x4"; then | |
1318 | AC_CHECK_TYPE(u_int32_t,unsigned int) | |
1319 | elif test "x$ac_cv_sizeof_long" = "x4"; then | |
1320 | AC_CHECK_TYPE(u_int32_t,unsigned long) | |
1321 | fi | |
1322 | dnl int64_t | |
1323 | if test "x$ac_cv_sizeof_long" = "x8"; then | |
1324 | AC_CHECK_TYPE(int64_t,long) | |
1325 | elif test "x$ac_cv_sizeof_long_long" = "x8"; then | |
1326 | AC_CHECK_TYPE(int64_t,long long) | |
1327 | elif test "x$ac_cv_sizeof___int64" = "x8"; then | |
1328 | AC_CHECK_TYPE(int64_t,__int64) | |
1329 | fi | |
1330 | dnl u_int64_t | |
1331 | if test "x$ac_cv_sizeof_uint64_t" = "x8"; then | |
1332 | AC_CHECK_TYPE(u_int64_t,uint64_t) | |
1333 | elif test "x$ac_cv_sizeof_long" = "x8"; then | |
1334 | AC_CHECK_TYPE(u_int64_t,unsigned long) | |
1335 | elif test "x$ac_cv_sizeof_long_long" = "x8"; then | |
1336 | AC_CHECK_TYPE(u_int64_t,unsigned long long) | |
1337 | elif test "x$ac_cv_sizeof___int64" = "x8"; then | |
1338 | AC_CHECK_TYPE(int64_t,unsigned __int64) | |
1339 | fi | |
090089c4 | 1340 | |
3f6fcd8a | 1341 | AC_CHECK_TYPE(pid_t, int) |
0897af2d | 1342 | AC_CHECK_TYPE(size_t, unsigned int) |
1343 | AC_CHECK_TYPE(ssize_t, int) | |
3f6fcd8a | 1344 | AC_CHECK_TYPE(off_t, int) |
95cf2361 | 1345 | AC_CHECK_TYPE(mode_t, u_short) |
c716a1dd | 1346 | AC_CHECK_TYPE(fd_mask, int) |
3f6fcd8a | 1347 | |
77d6bd88 | 1348 | dnl Check for special functions |
1349 | AC_FUNC_ALLOCA | |
1350 | ||
1351 | ||
6637e3a5 | 1352 | dnl Check for type in sys/socket.h |
1353 | AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [ | |
1354 | AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h> | |
1355 | #include <sys/socket.h> | |
1356 | #if STDC_HEADERS | |
1357 | #include <stdlib.h> | |
1358 | #include <stddef.h> | |
1359 | #endif], | |
1360 | ac_cv_type_socklen_t=yes, | |
1361 | ac_cv_type_socklen_t=no) | |
1362 | ]) | |
1363 | if test $ac_cv_type_socklen_t = no; then | |
1364 | AC_DEFINE(socklen_t, int) | |
1365 | fi | |
1366 | ||
aea1be68 | 1367 | dnl Check for mtyp_t in some headers |
1368 | AC_CACHE_CHECK(for mtyp_t, ac_cv_type_mtyp_t, [ | |
1369 | AC_EGREP_CPP([mtyp_t[^a-zA-Z_0-9]], [#include <sys/types.h> | |
1370 | #include <sys/ipc.h> | |
1371 | #include <sys/msg.h>], | |
1372 | ac_cv_type_mtyp_t=yes, | |
1373 | ac_cv_type_mtyp_t=no) | |
1374 | ]) | |
1375 | if test $ac_cv_type_mtyp_t = no; then | |
1376 | AC_DEFINE(mtyp_t, long) | |
1377 | fi | |
1378 | ||
090089c4 | 1379 | dnl Check for needed libraries |
30a4f2a8 | 1380 | AC_CHECK_LIB(nsl, main) |
6716b242 | 1381 | AC_CHECK_LIB(socket, main) |
94d48591 | 1382 | |
3c641669 | 1383 | dnl Ripped from the Samba sources |
1384 | AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [ | |
1385 | AC_TRY_COMPILE([ | |
1386 | #include <sys/types.h> | |
1387 | #include <stdlib.h> | |
1388 | #include <stddef.h> | |
1389 | #include <sys/socket.h> | |
1390 | #include <sys/un.h>], | |
1391 | [ | |
1392 | struct sockaddr_un sunaddr; | |
1393 | sunaddr.sun_family = AF_UNIX; | |
1394 | ], | |
1395 | squid_cv_unixsocket=yes,squid_cv_unixsocket=no)]) | |
1396 | if test x"$squid_cv_unixsocket" = x"yes"; then | |
1397 | AC_DEFINE(HAVE_UNIXSOCKET) | |
1398 | fi | |
1399 | dnl end rip | |
1400 | ||
94d48591 | 1401 | if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then |
1402 | echo "skipping libmalloc check (--enable-dlmalloc specified)" | |
5c51415d | 1403 | else |
94d48591 | 1404 | AC_CHECK_LIB(gnumalloc, main) |
1405 | if test "$ac_cv_lib_gnumalloc_main" = "yes"; then | |
1406 | echo "Disabling extended malloc functions when using gnumalloc" | |
1407 | ac_cv_func_mallinfo=no | |
1408 | ac_cv_func_mallocblksize=no | |
1409 | ac_cv_func_mallopt=no | |
1410 | else | |
1411 | case "$host" in | |
1412 | *-sun-solaris*) | |
1413 | echo "skipping libmalloc check for $host" | |
1414 | ;; | |
1415 | i386-*-freebsd*) | |
1416 | echo "skipping libmalloc check for $host" | |
1417 | ;; | |
1418 | *) | |
1419 | ||
1420 | AC_CHECK_LIB(malloc, main) | |
1421 | ;; | |
1422 | esac | |
1423 | fi | |
8a15e65e | 1424 | fi |
94d48591 | 1425 | |
6716b242 | 1426 | AC_CHECK_LIB(bsd, main) |
be79ade0 | 1427 | AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"]) |
04a56fa3 | 1428 | AC_CHECK_LIB(bind, gethostbyname) |
1429 | if test $ac_cv_lib_bind_gethostbyname = "no" ; then | |
1430 | case "$host" in | |
78743365 | 1431 | i386-*-freebsd*) |
1432 | echo "skipping libresolv checks for $host" | |
1433 | ;; | |
1434 | *) | |
1435 | AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton)) | |
1436 | AC_CHECK_LIB(resolv, main) | |
1437 | ;; | |
04a56fa3 | 1438 | esac |
1439 | fi | |
e0bddc45 | 1440 | AC_CHECK_LIB(m, main) |
090089c4 | 1441 | |
1442 | dnl Check for libcrypt | |
b8de7ebe | 1443 | dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) |
042b1f8a | 1444 | AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) |
be79ade0 | 1445 | AC_SUBST(CRYPTLIB) |
77f675ad | 1446 | |
042b1f8a | 1447 | dnl Check for libdl, used by auth_modules/PAM |
1448 | AC_CHECK_LIB(dl, dlopen, [DLLIB="-ldl"]) | |
1449 | AC_SUBST(DLLIB) | |
1450 | ||
e5f4e1b0 | 1451 | dnl Check for pthreads |
1452 | dnl We use pthreads when doing ASYNC I/O | |
042b1f8a | 1453 | AC_CHECK_LIB(pthread, main, [PTHREADLIB="-lpthread"]) |
71f8abc8 | 1454 | AC_SUBST(PTHREADLIB) |
1455 | ||
f85c88f3 | 1456 | dnl Check for librt |
1457 | dnl We use AIO in the coss store | |
1458 | AC_CHECK_LIB(rt, aio_read, [AIOLIB="-lrt"]) | |
1459 | AC_SUBST(AIOLIB) | |
1460 | ||
86ec11aa | 1461 | dnl -lintl is needed on SCO version 3.2v4.2 for strftime() |
1462 | dnl Robert Side <rside@aiinc.bc.ca> | |
1463 | dnl Mon, 18 Jan 1999 17:48:00 GMT | |
1464 | case "$host" in | |
1465 | *-pc-sco3.2*) | |
1466 | AC_CHECK_LIB(intl, strftime) | |
1467 | ;; | |
1468 | esac | |
1469 | ||
77f675ad | 1470 | dnl System-specific library modifications |
1471 | dnl | |
1472 | case "$host" in | |
88738790 | 1473 | i386-*-solaris2.*) |
7149a49f | 1474 | if test "$GCC" = "yes"; then |
1475 | echo "Removing -O for gcc on $host" | |
80e92d6d | 1476 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" |
7149a49f | 1477 | fi |
1478 | ;; | |
77f675ad | 1479 | *-sgi-irix*) |
1480 | echo "Removing -lsocket for IRIX..." | |
6716b242 | 1481 | LIBS=`echo $LIBS | sed -e s/-lsocket//` |
77f675ad | 1482 | echo "Removing -lnsl for IRIX..." |
6716b242 | 1483 | LIBS=`echo $LIBS | sed -e s/-lnsl//` |
c415c128 | 1484 | ac_cv_lib_nsl_main=no |
b44c0fb4 | 1485 | echo "Removing -lbsd for IRIX..." |
1486 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
77f675ad | 1487 | ;; |
4ba0bd0e | 1488 | dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher) |
1489 | dnl Date: Thu, 17 Oct 1996 04:09:30 +0200 | |
1490 | dnl Please change your configure script. AIX doesn't need -lbsd. | |
1491 | *-ibm-aix*) | |
1492 | echo "Removing -lbsd for AIX..." | |
1493 | LIBS=`echo $LIBS | sed -e s/-lbsd//` | |
c68e9c6b | 1494 | dnl From: mlaster@metavillage.com (Mike Laster) |
1495 | dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf | |
1496 | dnl So using the internal versions generates a load of warnings | |
1497 | dnl during compile. | |
1498 | echo "disabling snprintf/vsnprintf for $host" | |
1499 | ac_cv_func_snprintf=no | |
1500 | ac_cv_func_vsnprintf=no | |
4ba0bd0e | 1501 | ;; |
30a4f2a8 | 1502 | *m88k*) |
1503 | CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_" | |
7149a49f | 1504 | AC_DEFINE(GETTIMEOFDAY_NO_TZP) |
1505 | ;; | |
580ce039 | 1506 | [*-*-solaris2.[0-4]]) |
7149a49f | 1507 | AC_DEFINE(GETTIMEOFDAY_NO_TZP) |
30a4f2a8 | 1508 | ;; |
711fa75e | 1509 | [*-sony-newsos[56]*]) |
f62c73dc | 1510 | AC_DEFINE(GETTIMEOFDAY_NO_TZP) |
1511 | ;; | |
77f675ad | 1512 | esac |
090089c4 | 1513 | |
57faa85a | 1514 | # Remove optimization for GCC 2.95.[123] |
d20b1cd0 | 1515 | # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL |
1516 | if test "$GCC" = "yes"; then | |
1517 | GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'` | |
1518 | case "$GCCVER" in | |
57faa85a | 1519 | [2.95.[123]]) |
d20b1cd0 | 1520 | echo "Removing -O for gcc on $host with GCC $GCCVER" |
1521 | CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" | |
1522 | ;; | |
1523 | esac | |
1524 | fi | |
1525 | ||
176d10ee | 1526 | # Recommended by Balint Nagy Endre <bne@CareNet.hu> |
1527 | case "$host" in | |
1528 | *-univel-sysv4.2MP) | |
1529 | if test `uname -v` = "2.03"; then | |
1530 | echo "disabling mallinfo for $host" | |
1531 | ac_cv_func_mallinfo=no | |
1532 | fi | |
1533 | ;; | |
1534 | esac | |
1535 | ||
84cecfd2 | 1536 | dnl This has to be before AC_CHECK_FUNCS |
1537 | # Disable poll() on certain platforms. Override by setting ac_cv_func_poll | |
1538 | # when running configure. | |
1539 | if test -z "$ac_cv_func_poll"; then | |
1540 | case "$host" in | |
1541 | [alpha-dec-osf3.*]) | |
1542 | # John Kay (jkay@nlanr.net) 19970818 | |
1543 | echo "disabling poll for $host..." | |
1544 | ac_cv_func_poll='no' | |
1545 | ;; | |
1546 | [*-hp-hpux*.*]) | |
1547 | # Duane Wessels | |
1548 | echo "disabling poll for $host..." | |
1549 | ac_cv_func_poll='no' | |
1550 | ;; | |
1551 | [*-linux-*]) | |
f5cec332 | 1552 | # Henrik Nordstrom (hno@squid-cache.org) 19980817 |
9bb83c8b | 1553 | # poll is problematic on Linux. We disable it |
1554 | # by default until Linux gets it right. | |
b6a2f15e | 1555 | rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'` |
1556 | if test $rev -lt 002002; then | |
1557 | echo "disabling poll for $host < 2.2..." | |
1558 | ac_cv_func_poll='no' | |
1559 | fi | |
84cecfd2 | 1560 | ;; |
c68e9c6b | 1561 | [powerpc-ibm-aix4.1.*]) |
1562 | # Mike Laster (mlaster@metavillage.com) 19981021 | |
1563 | echo "disabling poll for $host..." | |
1564 | ac_cv_func_poll='no' | |
1565 | ;; | |
86ec11aa | 1566 | [*-pc-sco3.2*]) |
1567 | # Robert Side <rside@aiinc.bc.ca> | |
1568 | # Mon, 18 Jan 1999 17:48:00 GMT | |
1569 | echo "disabling poll for $host..." | |
1570 | ac_cv_func_poll='no' | |
1571 | ;; | |
84cecfd2 | 1572 | esac |
1573 | fi | |
176d10ee | 1574 | |
6716b242 | 1575 | dnl Check for library functions |
1576 | AC_CHECK_FUNCS(\ | |
30a4f2a8 | 1577 | bcopy \ |
ce3d30fb | 1578 | backtrace_symbols_fd \ |
df087e68 | 1579 | crypt \ |
4ac29a5b | 1580 | fchmod \ |
6716b242 | 1581 | getdtablesize \ |
8505e57b | 1582 | getpagesize \ |
30a4f2a8 | 1583 | getrusage \ |
9c1d8929 | 1584 | getspnam \ |
30a4f2a8 | 1585 | lrand48 \ |
6716b242 | 1586 | mallinfo \ |
0f5efab0 | 1587 | mallocblksize \ |
6716b242 | 1588 | mallopt \ |
2ae6b9b0 | 1589 | memcpy \ |
30a4f2a8 | 1590 | memmove \ |
dac27377 | 1591 | memset \ |
b99a6dec | 1592 | mkstemp \ |
1812b6c7 | 1593 | mktime \ |
88738790 | 1594 | mstats \ |
84cecfd2 | 1595 | poll \ |
cd748f27 | 1596 | pthread_attr_setscope \ |
1597 | pthread_setschedparam \ | |
1598 | pthread_attr_setschedparam \ | |
42b51993 | 1599 | pthread_sigmask \ |
c68e9c6b | 1600 | putenv \ |
b1e77ec1 | 1601 | random \ |
6716b242 | 1602 | regcomp \ |
1603 | regexec \ | |
1604 | regfree \ | |
30a4f2a8 | 1605 | res_init \ |
4915be3b | 1606 | rint \ |
234967c9 | 1607 | seteuid \ |
c415c128 | 1608 | setgroups \ |
30a4f2a8 | 1609 | setpgrp \ |
6716b242 | 1610 | setrlimit \ |
b6a2f15e | 1611 | getrlimit \ |
30a4f2a8 | 1612 | setsid \ |
1613 | sigaction \ | |
11430c03 | 1614 | snprintf \ |
30a4f2a8 | 1615 | srand48 \ |
b1e77ec1 | 1616 | srandom \ |
0343b99c | 1617 | statfs \ |
6716b242 | 1618 | sysconf \ |
1619 | syslog \ | |
234967c9 | 1620 | timegm \ |
28da5e0d | 1621 | vsnprintf \ |
77d6bd88 | 1622 | bswap_16 \ |
1623 | bswap_32 \ | |
6716b242 | 1624 | ) |
1625 | ||
1b3db6d9 | 1626 | dnl Magic which checks whether we are forcing a type of comm loop we |
1627 | dnl are actually going to (ab)use | |
1628 | ||
1629 | dnl Actually do the define magic now | |
1630 | dnl mostly ripped from squid-commloops, thanks to adrian and benno | |
1631 | ||
1632 | if test "$ac_cv_func_poll" = "yes" ; then | |
1633 | SELECT_TYPE="poll" | |
1634 | AC_DEFINE(USE_POLL) | |
1635 | elif test "$ac_cv_func_select" = "yes" ; then | |
1636 | SELECT_TYPE="select" | |
1637 | AC_DEFINE(USE_SELECT) | |
92b9f1fd | 1638 | elif test "$ac_cv_func_kqueue" = "yes" ; then |
1639 | SELECT_TYPE="kqueue" | |
1640 | AC_DEFINE(USE_KQUEUE) | |
1b3db6d9 | 1641 | else |
92b9f1fd | 1642 | echo "Eep! Can't find poll, kqueue or select!" |
1b3db6d9 | 1643 | echo "I'll try select and hope for the best." |
1644 | SELECT_TYPE="select" | |
1645 | AC_DEFINE(USE_SELECT) | |
1646 | fi | |
1647 | echo "Using ${SELECT_TYPE} for select loop." | |
1b3db6d9 | 1648 | |
1649 | ||
60939927 | 1650 | dnl Yay! Another Linux brokenness. Its not good enough |
1651 | dnl to know that setresuid() exists, because RedHat 5.0 declares | |
1652 | dnl setresuid() but doesn't implement it. | |
1653 | dnl | |
1654 | AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid, | |
5c51415d | 1655 | AC_TRY_RUN([ |
60939927 | 1656 | #include <stdlib.h> |
5c51415d | 1657 | int main() { |
1658 | if(setresuid(-1,-1,-1)) { | |
1659 | perror("setresuid:"); | |
1660 | exit(1); | |
60939927 | 1661 | } |
1662 | exit(0); | |
5c51415d | 1663 | } |
1664 | ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no") | |
60939927 | 1665 | ) |
5c51415d | 1666 | if test "$ac_cv_func_setresuid" = "yes" ; then |
1667 | AC_DEFINE(HAVE_SETRESUID) | |
1668 | fi | |
60939927 | 1669 | |
c3d0c8b5 | 1670 | AM_CONDITIONAL(NEED_OWN_SNPRINTF, false) |
1671 | if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then | |
1672 | AM_CONDITIONAL(NEED_OWN_SNPRINTF, true) | |
1673 | fi | |
1674 | ||
5cafc1d6 | 1675 | dnl IP-Filter support requires ipf header files. These aren't |
1676 | dnl installed by default, so we need to check for them | |
1677 | if test "$IPF_TRANSPARENT" ; then | |
1678 | AC_MSG_CHECKING(if IP-Filter header files are installed) | |
42b51993 | 1679 | # hold on to your hats... |
1680 | if test "$ac_cv_header_ip_compat_h" = "yes" || | |
1681 | test "$ac_cv_header_ip_fil_compat_h" = "yes" || | |
87d21d8b | 1682 | test "$ac_cv_header_netinet_ip_compat_h" = "yes" || |
1683 | test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then | |
42b51993 | 1684 | have_ipfilter_compat_header="yes" |
1685 | fi | |
1686 | if test "x$have_ipfilter_compat_header" = "xyes" && | |
eb824054 | 1687 | test "$ac_cv_header_ip_fil_h" = "yes" && |
1688 | test "$ac_cv_header_ip_nat_h" = "yes" ; then | |
1689 | IPF_TRANSPARENT="yes" | |
1690 | AC_DEFINE(IPF_TRANSPARENT, 1) | |
42b51993 | 1691 | elif test "$have_ipfilter_compat_header" = "yes" && |
eb824054 | 1692 | test "$ac_cv_header_netinet_ip_fil_h" = "yes" && |
1693 | test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then | |
1694 | IPF_TRANSPARENT="yes" | |
1695 | AC_DEFINE(IPF_TRANSPARENT, 1) | |
1696 | else | |
5cafc1d6 | 1697 | IPF_TRANSPARENT="no" |
1698 | AC_DEFINE(IPF_TRANSPARENT, 0) | |
5cafc1d6 | 1699 | fi |
1700 | AC_MSG_RESULT($IPF_TRANSPARENT) | |
1701 | fi | |
1702 | if test "$IPF_TRANSPARENT" = "no" ; then | |
1703 | echo "WARNING: Cannot find necessary IP-Filter header files" | |
1704 | echo " Transparent Proxy support WILL NOT be enabled" | |
1705 | sleep 10 | |
1706 | fi | |
1707 | ||
d852fbad | 1708 | dnl Linux-Netfilter support requires Linux 2.4 kernel header files. |
1709 | dnl Shamelessly copied from above | |
1710 | if test "$LINUX_NETFILTER" ; then | |
1711 | AC_MSG_CHECKING(if Linux 2.4 kernel header files are installed) | |
1712 | # hold on to your hats... | |
1713 | if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then | |
1714 | LINUX_NETFILTER="yes" | |
1715 | AC_DEFINE(LINUX_NETFILTER, 1) | |
1716 | else | |
1717 | LINUX_NETFILTER="no" | |
1718 | AC_DEFINE(LINUX_NETFILTER, 0) | |
1719 | fi | |
1720 | AC_MSG_RESULT($LINUX_NETFILTER) | |
1721 | fi | |
1722 | if test "$LINUX_NETFILTER" = "no" ; then | |
1723 | echo "WARNING: Cannot find necessary Linux 2.4 kernel header files" | |
1724 | echo " Linux 2.4 Transparent Proxy support WILL NOT be enabled" | |
1725 | sleep 10 | |
1726 | fi | |
1727 | ||
91bc414e | 1728 | if test -z "$USE_GNUREGEX" ; then |
1729 | case "$host" in | |
1730 | *-sun-solaris2.[[0-4]]) | |
1731 | USE_GNUREGEX="yes" | |
1732 | ;; | |
1733 | *-next-nextstep*) | |
1734 | USE_GNUREGEX="yes" | |
1735 | ;; | |
1736 | esac | |
1737 | fi | |
7a081912 | 1738 | AC_MSG_CHECKING(if GNUregex needs to be compiled) |
91bc414e | 1739 | if test -z "$USE_GNUREGEX"; then |
55878dfd | 1740 | if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then |
74946a0f | 1741 | USE_GNUREGEX="yes" |
00fa2c12 | 1742 | else |
0cccc031 | 1743 | AC_TRY_COMPILE([#include <sys/types.h> |
1744 | #include <regex.h>],[regex_t t; regcomp(&t,"",0);], | |
91bc414e | 1745 | USE_GNUREGEX="no", |
1746 | USE_GNUREGEX="yes") | |
1747 | fi | |
00fa2c12 | 1748 | fi |
74946a0f | 1749 | AC_MSG_RESULT($USE_GNUREGEX) |
1750 | if test "$USE_GNUREGEX" = "yes"; then | |
26675bf4 | 1751 | REGEXLIB="-lregex" |
7a081912 | 1752 | LIBREGEX="libregex.a" |
74946a0f | 1753 | AC_DEFINE(USE_GNUREGEX) |
7a081912 | 1754 | fi |
26675bf4 | 1755 | AC_SUBST(REGEXLIB) |
00fa2c12 | 1756 | AC_SUBST(LIBREGEX) |
7a081912 | 1757 | |
3f6fcd8a | 1758 | AC_REPLACE_FUNCS(\ |
3d0cf10e | 1759 | drand48 \ |
3f6fcd8a | 1760 | tempnam \ |
4d38fc7e | 1761 | strerror \ |
3f6fcd8a | 1762 | ) |
1763 | ||
5c51415d | 1764 | dnl Not cached since people are likely to tune this |
e924600d | 1765 | AC_MSG_CHECKING(Default FD_SETSIZE value) |
1766 | AC_TRY_RUN([ | |
1767 | #if HAVE_STDIO_H | |
1768 | #include <stdio.h> | |
1769 | #endif | |
1770 | #if HAVE_UNISTD_H | |
1771 | #include <unistd.h> | |
1772 | #endif | |
1773 | #if HAVE_SYS_TIME_H | |
1774 | #include <sys/time.h> | |
1775 | #endif | |
1776 | #if HAVE_SYS_SELECT_H | |
1777 | #include <sys/select.h> | |
1778 | #endif | |
1779 | #if HAVE_SYS_TYPES_H | |
1780 | #include <sys/types.h> | |
1781 | #endif | |
1782 | main() { | |
635e6242 | 1783 | FILE *fp = fopen("conftestval", "w"); |
1784 | fprintf (fp, "%d\n", FD_SETSIZE); | |
e924600d | 1785 | exit(0); |
1786 | } | |
1787 | ], | |
1788 | DEFAULT_FD_SETSIZE=`cat conftestval`, | |
1789 | DEFAULT_FD_SETSIZE=256, | |
1790 | DEFAULT_FD_SETSIZE=256) | |
1791 | AC_MSG_RESULT($DEFAULT_FD_SETSIZE) | |
1792 | AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE) | |
1793 | ||
5c51415d | 1794 | dnl Not cached since people are likely to tune this |
234967c9 | 1795 | AC_MSG_CHECKING(Maximum number of filedescriptors we can open) |
c76d8acc | 1796 | dnl damn! FreeBSD's pthreads breaks dup2(). |
1797 | TLDFLAGS="$LDFLAGS" | |
1798 | case $host in | |
1799 | i386-unknown-freebsd*) | |
1800 | if echo "$LDFLAGS" | grep -q pthread; then | |
1801 | LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"` | |
1802 | fi | |
1803 | esac | |
234967c9 | 1804 | AC_TRY_RUN([ |
8cca06da | 1805 | #include <stdio.h> |
234967c9 | 1806 | #include <unistd.h> |
30a4f2a8 | 1807 | #include <sys/time.h> /* needed on FreeBSD */ |
234967c9 | 1808 | #include <sys/param.h> |
1809 | #include <sys/resource.h> | |
1810 | main() { | |
635e6242 | 1811 | FILE *fp; |
234967c9 | 1812 | int i,j; |
42b51993 | 1813 | #if defined(__CYGWIN32__) || defined (__CYGWIN__) |
b05490a8 | 1814 | /* getrlimit and sysconf returns bogous values on cygwin32. |
df087e68 | 1815 | * Number of fds is virtually unlimited in cygwin (sys/param.h) |
b05490a8 | 1816 | * __CYGWIN32__ is deprecated. |
df087e68 | 1817 | */ |
1818 | i = NOFILE; | |
b05490a8 | 1819 | #else |
1820 | #if HAVE_SETRLIMIT | |
234967c9 | 1821 | struct rlimit rl; |
1822 | #if defined(RLIMIT_NOFILE) | |
1823 | if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { | |
1824 | perror("getrlimit: RLIMIT_NOFILE"); | |
1825 | } else { | |
1826 | rl.rlim_cur = rl.rlim_max; /* set it to the max */ | |
1827 | if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { | |
1828 | perror("setrlimit: RLIMIT_NOFILE"); | |
1829 | } | |
1830 | } | |
1831 | #elif defined(RLIMIT_OFILE) | |
1832 | if (getrlimit(RLIMIT_OFILE, &rl) < 0) { | |
1833 | perror("getrlimit: RLIMIT_OFILE"); | |
1834 | } else { | |
1835 | rl.rlim_cur = rl.rlim_max; /* set it to the max */ | |
1836 | if (setrlimit(RLIMIT_OFILE, &rl) < 0) { | |
1837 | perror("setrlimit: RLIMIT_OFILE"); | |
1838 | } | |
1839 | } | |
1840 | #endif /* RLIMIT_NOFILE */ | |
1841 | #endif /* HAVE_SETRLIMIT */ | |
d9399075 | 1842 | /* by starting at 2^14, we will never get higher |
1843 | than 2^15 for SQUID_MAXFD */ | |
1844 | i = j = 1<<14; | |
1845 | while (j) { | |
1846 | j >>= 1; | |
1847 | if (dup2(0, i) < 0) { | |
1848 | i -= j; | |
1849 | } else { | |
1850 | close(i); | |
1851 | i += j; | |
1852 | } | |
1853 | } | |
1854 | i++; | |
b05490a8 | 1855 | #endif /* IF !DEF CYGWIN */ |
635e6242 | 1856 | fp = fopen("conftestval", "w"); |
1857 | fprintf (fp, "%d\n", i); | |
234967c9 | 1858 | exit(0); |
1859 | } | |
1860 | ], | |
431d84c5 | 1861 | SQUID_MAXFD=`cat conftestval`, |
1862 | SQUID_MAXFD=256, | |
1863 | SQUID_MAXFD=256) | |
1864 | AC_MSG_RESULT($SQUID_MAXFD) | |
1865 | AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD) | |
b9cc811d | 1866 | if test "$SQUID_MAXFD" -lt 512 ; then |
80ab193b | 1867 | echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your" |
1868 | echo " cache will be very busy. Please see the FAQ page" | |
2b6662ba | 1869 | echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors" |
e692ff35 | 1870 | echo " on how to increase your filedescriptor limit" |
933cc58d | 1871 | sleep 10 |
80ab193b | 1872 | fi |
c76d8acc | 1873 | LDFLAGS="$TLDFLAGS" |
234967c9 | 1874 | |
5c51415d | 1875 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 1876 | AC_MSG_CHECKING(Default UDP send buffer size) |
1877 | AC_TRY_RUN([ | |
8cca06da | 1878 | #include <stdlib.h> |
1879 | #include <stdio.h> | |
30a4f2a8 | 1880 | #include <sys/types.h> |
1881 | #include <sys/socket.h> | |
1882 | #include <netinet/in.h> | |
1883 | main () | |
1884 | { | |
635e6242 | 1885 | FILE *fp; |
30a4f2a8 | 1886 | int fd,val=0,len=sizeof(int); |
1887 | if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); | |
1888 | if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); | |
1889 | if (val<=0) exit(1); | |
635e6242 | 1890 | fp = fopen("conftestval", "w"); |
1891 | fprintf (fp, "%d\n", val); | |
30a4f2a8 | 1892 | exit(0); |
1893 | } | |
1894 | ], | |
1895 | SQUID_UDP_SO_SNDBUF=`cat conftestval`, | |
1c481e00 | 1896 | SQUID_UDP_SO_SNDBUF=16384, |
1897 | SQUID_UDP_SO_SNDBUF=16384) | |
30a4f2a8 | 1898 | AC_MSG_RESULT($SQUID_UDP_SO_SNDBUF) |
1899 | AC_DEFINE_UNQUOTED(SQUID_UDP_SO_SNDBUF, $SQUID_UDP_SO_SNDBUF) | |
1900 | ||
5c51415d | 1901 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 1902 | AC_MSG_CHECKING(Default UDP receive buffer size) |
1903 | AC_TRY_RUN([ | |
8cca06da | 1904 | #include <stdlib.h> |
1905 | #include <stdio.h> | |
30a4f2a8 | 1906 | #include <sys/types.h> |
1907 | #include <sys/socket.h> | |
1908 | #include <netinet/in.h> | |
1909 | main () | |
1910 | { | |
635e6242 | 1911 | FILE *fp; |
30a4f2a8 | 1912 | int fd,val=0,len=sizeof(int); |
1913 | if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); | |
1914 | if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); | |
1915 | if (val <= 0) exit(1); | |
635e6242 | 1916 | fp = fopen("conftestval", "w"); |
1917 | fprintf (fp, "%d\n", val); | |
30a4f2a8 | 1918 | exit(0); |
1919 | } | |
1920 | ], | |
1921 | SQUID_UDP_SO_RCVBUF=`cat conftestval`, | |
1c481e00 | 1922 | SQUID_UDP_SO_RCVBUF=16384, |
1923 | SQUID_UDP_SO_RCVBUF=16384) | |
30a4f2a8 | 1924 | AC_MSG_RESULT($SQUID_UDP_SO_RCVBUF) |
1925 | AC_DEFINE_UNQUOTED(SQUID_UDP_SO_RCVBUF, $SQUID_UDP_SO_RCVBUF) | |
1926 | ||
5c51415d | 1927 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 1928 | AC_MSG_CHECKING(Default TCP send buffer size) |
1929 | AC_TRY_RUN([ | |
8cca06da | 1930 | #include <stdlib.h> |
1931 | #include <stdio.h> | |
30a4f2a8 | 1932 | #include <sys/types.h> |
1933 | #include <sys/socket.h> | |
1934 | #include <netinet/in.h> | |
1935 | main () | |
1936 | { | |
635e6242 | 1937 | FILE *fp; |
30a4f2a8 | 1938 | int fd,val=0,len=sizeof(int); |
1939 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); | |
1940 | if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); | |
1941 | if (val <= 0) exit(1); | |
635e6242 | 1942 | fp = fopen("conftestval", "w"); |
1943 | fprintf (fp, "%d\n", val); | |
30a4f2a8 | 1944 | exit(0); |
1945 | } | |
1946 | ], | |
1947 | SQUID_TCP_SO_SNDBUF=`cat conftestval`, | |
1c481e00 | 1948 | SQUID_TCP_SO_SNDBUF=16384, |
1949 | SQUID_TCP_SO_SNDBUF=16384) | |
30a4f2a8 | 1950 | AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF) |
1951 | AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF) | |
1952 | ||
5c51415d | 1953 | dnl Not cached since people are likely to tune this |
30a4f2a8 | 1954 | AC_MSG_CHECKING(Default TCP receive buffer size) |
1955 | AC_TRY_RUN([ | |
8cca06da | 1956 | #include <stdlib.h> |
1957 | #include <stdio.h> | |
30a4f2a8 | 1958 | #include <sys/types.h> |
1959 | #include <sys/socket.h> | |
1960 | #include <netinet/in.h> | |
1961 | main () | |
1962 | { | |
635e6242 | 1963 | FILE *fp; |
30a4f2a8 | 1964 | int fd,val=0,len=sizeof(int); |
1965 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); | |
1966 | if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); | |
1967 | if (val <= 0) exit(1); | |
635e6242 | 1968 | fp = fopen("conftestval", "w"); |
1969 | fprintf (fp, "%d\n", val); | |
30a4f2a8 | 1970 | exit(0); |
1971 | } | |
1972 | ], | |
1973 | SQUID_TCP_SO_RCVBUF=`cat conftestval`, | |
1c481e00 | 1974 | SQUID_TCP_SO_RCVBUF=16384, |
1975 | SQUID_TCP_SO_RCVBUF=16384) | |
30a4f2a8 | 1976 | AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF) |
1977 | AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF) | |
1978 | ||
5c51415d | 1979 | AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist, |
9bc73deb | 1980 | AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;], |
5c51415d | 1981 | ac_cv_needs_sys_errlist="no", |
1982 | ac_cv_needs_sys_errlist="yes") | |
1983 | ) | |
1984 | if test "$ac_cv_needs_sys_errlist" = "yes" ; then | |
1985 | AC_DEFINE(NEED_SYS_ERRLIST) | |
1986 | fi | |
30a4f2a8 | 1987 | |
5c51415d | 1988 | dnl Not cached since people are likely to change this |
6bf65235 | 1989 | AC_MSG_CHECKING(for libresolv _dns_ttl_ hack) |
1990 | AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;, | |
1991 | [AC_MSG_RESULT(yes) | |
1992 | AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)], | |
1993 | AC_MSG_RESULT(no)) | |
1994 | ||
a937d5e3 | 1995 | AC_MSG_CHECKING(if inet_ntoa() actually works) |
1996 | AC_TRY_RUN([ | |
1997 | #include <stdlib.h> | |
1998 | #include <stdio.h> | |
1999 | #include <sys/types.h> | |
2000 | #include <netinet/in.h> | |
2001 | #include <arpa/inet.h> | |
2002 | main () | |
2003 | { | |
635e6242 | 2004 | FILE *fp; |
a937d5e3 | 2005 | struct in_addr in; |
2006 | in.s_addr = inet_addr("1.2.3.4"); | |
635e6242 | 2007 | fp = fopen("conftestval", "w"); |
2008 | fprintf (fp, "%s\n", inet_ntoa(in)); | |
a937d5e3 | 2009 | exit(0); |
2010 | } | |
2011 | ], | |
2012 | INET_NTOA_RESULT=`cat conftestval`, | |
2013 | INET_NTOA_RESULT="broken", | |
2014 | INET_NTOA_RESULT="broken") | |
2015 | if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then | |
2016 | AC_MSG_RESULT("yes") | |
2017 | else | |
2018 | AC_MSG_RESULT("no") | |
b6a2f15e | 2019 | echo "Will use our own inet_ntoa()." |
2020 | LIBOBJS="$LIBOBJS inet_ntoa.o" | |
2021 | # echo "WARNING: This looks bad, and probably prevents Squid from working." | |
2022 | # echo " If you're on IRIX and using GCC 2.8, you probably need" | |
2023 | # echo " to use the IRIX C compiler instead." | |
2024 | # sleep 10 | |
a937d5e3 | 2025 | fi |
2026 | ||
b6a2f15e | 2027 | if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then |
c68e9c6b | 2028 | AC_MSG_CHECKING(for working statvfs() interface) |
2029 | AC_TRY_COMPILE([ | |
2030 | #include <stdlib.h> | |
2031 | #include <stdio.h> | |
2032 | #include <sys/types.h> | |
2033 | #include <sys/statvfs.h> | |
2034 | ], | |
2035 | [ | |
2036 | struct statvfs sfs; | |
2037 | sfs.f_blocks = sfs.f_bfree = sfs.f_frsize = | |
2038 | sfs.f_files = sfs.f_ffree = 0; | |
2039 | statvfs("/tmp", &sfs); | |
2040 | ], | |
2041 | ac_cv_func_statvfs=yes, | |
2042 | ac_cv_func_statvfs=no) | |
2043 | AC_MSG_RESULT($ac_cv_func_statvfs) | |
6b8e7481 | 2044 | if test "$ac_cv_func_statvfs" = "yes" ; then |
b6a2f15e | 2045 | AC_DEFINE(HAVE_STATVFS) |
2046 | fi | |
6b8e7481 | 2047 | fi |
c68e9c6b | 2048 | |
2049 | AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list, | |
2050 | AC_TRY_COMPILE([ | |
2051 | #if HAVE_SYS_TYPES_H | |
2052 | #include <sys/types.h> | |
2053 | #endif | |
2054 | #if HAVE_NETINET_IN_H | |
2055 | #include <netinet/in.h> | |
2056 | #endif | |
2057 | #if HAVE_ARPA_INET_H | |
2058 | #include <arpa/inet.h> | |
2059 | #endif | |
2060 | #if HAVE_ARPA_NAMESER_H | |
2061 | #include <arpa/nameser.h> | |
2062 | #endif | |
2063 | #if HAVE_RESOLV_H | |
2064 | #include <resolv.h> | |
2065 | #endif | |
2066 | ], | |
2067 | [_res.nsaddr_list[[0]];], | |
2068 | ac_cv_have_res_nsaddr_list="yes", | |
2069 | ac_cv_have_res_nsaddr_list="no")) | |
2070 | if test $ac_cv_have_res_nsaddr_list = "yes" ; then | |
2071 | AC_DEFINE(HAVE_RES_NSADDR_LIST) | |
2072 | fi | |
2073 | ||
2074 | if test $ac_cv_have_res_nsaddr_list = "no" ; then | |
2075 | AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list, | |
2076 | AC_TRY_COMPILE([ | |
2077 | #if HAVE_SYS_TYPES_H | |
2078 | #include <sys/types.h> | |
2079 | #endif | |
2080 | #if HAVE_NETINET_IN_H | |
2081 | #include <netinet/in.h> | |
2082 | #endif | |
2083 | #if HAVE_ARPA_INET_H | |
2084 | #include <arpa/inet.h> | |
2085 | #endif | |
2086 | #if HAVE_ARPA_NAMESER_H | |
2087 | #include <arpa/nameser.h> | |
2088 | #endif | |
2089 | #if HAVE_RESOLV_H | |
2090 | #include <resolv.h> | |
2091 | #endif | |
2092 | ], | |
2093 | [_res.ns_list[[0]].addr;], | |
2094 | ac_cv_have_res_ns_list="yes", | |
2095 | ac_cv_have_res_ns_list="no")) | |
2096 | if test $ac_cv_have_res_ns_list = "yes" ; then | |
2097 | AC_DEFINE(HAVE_RES_NS_LIST) | |
2098 | fi | |
2099 | fi | |
2100 | ||
090089c4 | 2101 | dnl Need the debugging version of malloc if available |
2102 | XTRA_OBJS='' | |
6509a1a0 | 2103 | if test "$ac_cv_lib_malloc_main" = "yes" ; then |
090089c4 | 2104 | if test -r /usr/lib/debug/malloc.o ; then |
2105 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o" | |
2106 | fi | |
2107 | if test -r /usr/lib/debug/mallocmap.o ; then | |
2108 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o" | |
2109 | fi | |
2110 | fi | |
2bbd722b | 2111 | |
090089c4 | 2112 | AC_SUBST(XTRA_OBJS) |
2113 | ||
38fea766 | 2114 | if test -z "$XTRA_LIBS"; then |
2115 | XTRA_LIBS="$LIBS" | |
0f5a16f8 | 2116 | dnl minor cleanup |
2117 | XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"` | |
38fea766 | 2118 | LIBS='' |
2119 | fi | |
090089c4 | 2120 | AC_SUBST(XTRA_LIBS) |
2121 | ||
090089c4 | 2122 | dnl Clean up after OSF/1 core dump bug |
2123 | rm -f core | |
2124 | ||
a2794549 | 2125 | dnl FS_MAKEFILES="" |
2126 | dnl for fs in $STORE_MODULES none; do | |
2127 | dnl if test $fs != none; then | |
2128 | dnl FS_MAKEFILES="$FS_MAKEFILES ./src/fs/$fs/Makefile" | |
2129 | dnl fi | |
2130 | dnl done | |
2131 | dnl REPL_MAKEFILES="" | |
2132 | dnl for repl in $REPL_POLICIES none; do | |
2133 | dnl if test $repl != none; then | |
2134 | dnl REPL_MAKEFILES="$REPL_MAKEFILES ./src/repl/$repl/Makefile" | |
2135 | dnl fi | |
2136 | dnl done | |
caa4f581 | 2137 | |
63bf42ae | 2138 | dnl This could actually be used to find all the Makefiles.. |
a2794549 | 2139 | dnl One of Automake's limitations is that it needs to know all the created makefiles. |
2140 | dnl AUTH_MAKEFILES="" | |
2141 | dnl for auth in `find $srcdir/src/auth -type d -print`; do | |
2142 | dnl if test -f $auth/Makefile.in; then | |
2143 | dnl dir=`echo $auth | sed -e "s|^$srcdir/||"` | |
2144 | dnl AUTH_MAKEFILES="$AUTH_MAKEFILES ./$dir/Makefile" | |
2145 | dnl fi | |
2146 | dnl done | |
2147 | ||
2148 | ||
2149 | dnl src/fs/aufs/Makefile \ | |
2150 | dnl src/fs/coss/Makefile \ | |
2151 | dnl src/fs/diskd/Makefile \ | |
2152 | dnl src/fs/null/Makefile \ | |
2153 | dnl src/fs/ufs/Makefile \ | |
2154 | dnl src/repl/heap/Makefile \ | |
2155 | dnl src/repl/lru/Makefile \ | |
2156 | AC_OUTPUT([\ | |
2157 | Makefile \ | |
2158 | lib/Makefile \ | |
a2794549 | 2159 | scripts/Makefile \ |
2160 | scripts/RunCache \ | |
2161 | scripts/RunAccel \ | |
2162 | src/Makefile \ | |
2163 | src/fs/Makefile \ | |
2164 | src/repl/Makefile \ | |
2165 | src/auth/Makefile \ | |
2166 | src/auth/basic/Makefile \ | |
2167 | src/auth/basic/helpers/Makefile \ | |
2168 | src/auth/basic/helpers/LDAP/Makefile \ | |
2169 | src/auth/basic/helpers/MSNT/Makefile \ | |
2170 | src/auth/basic/helpers/NCSA/Makefile \ | |
2171 | src/auth/basic/helpers/PAM/Makefile \ | |
2172 | src/auth/basic/helpers/SMB/Makefile \ | |
2173 | src/auth/basic/helpers/YP/Makefile \ | |
2174 | src/auth/basic/helpers/getpwnam/Makefile \ | |
2175 | src/auth/basic/helpers/multi-domain-NTLM/Makefile \ | |
4e2c57a0 | 2176 | src/auth/basic/helpers/SASL/Makefile \ |
a2794549 | 2177 | src/auth/digest/Makefile \ |
2178 | src/auth/digest/helpers/Makefile \ | |
2179 | src/auth/digest/helpers/password/Makefile \ | |
2180 | src/auth/ntlm/Makefile \ | |
2181 | src/auth/ntlm/helpers/Makefile \ | |
2182 | src/auth/ntlm/helpers/fakeauth/Makefile \ | |
2183 | src/auth/ntlm/helpers/no_check/Makefile \ | |
2184 | src/auth/ntlm/helpers/NTLMSSP/Makefile \ | |
2185 | src/auth/ntlm/helpers/NTLMSSP/smbval/Makefile \ | |
2186 | contrib/Makefile \ | |
2187 | snmplib/Makefile \ | |
2188 | icons/Makefile \ | |
2189 | errors/Makefile \ | |
c0f59984 | 2190 | src/fs/aufs/Makefile \ |
2191 | src/fs/coss/Makefile \ | |
2192 | src/fs/diskd/Makefile \ | |
2193 | src/fs/null/Makefile \ | |
2194 | src/fs/ufs/Makefile \ | |
2195 | src/repl/heap/Makefile \ | |
2196 | src/repl/lru/Makefile \ | |
99db07b3 | 2197 | doc/Makefile \ |
53cbe3e4 | 2198 | ]) |