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