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