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