]> git.ipfire.org Git - thirdparty/squid.git/blob - configure.in
Alan Barrett's fix for inconsistent bootstrapping on some platforms
[thirdparty/squid.git] / configure.in
1
2 dnl Configuration input file for Squid
3 dnl
4 dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
5 dnl
6 dnl $Id: configure.in,v 1.342 2003/07/28 20:41:05 robertc Exp $
7 dnl
8 dnl
9 dnl
10 AC_INIT
11 AC_PREREQ(2.52)
12 AC_CONFIG_SRCDIR([src/main.cc])
13 AC_CONFIG_AUX_DIR(cfgaux)
14 AM_INIT_AUTOMAKE(squid, 3.0-PRE2-CVS)
15 AM_CONFIG_HEADER(include/autoconf.h)
16 AC_REVISION($Revision: 1.342 $)dnl
17 AC_PREFIX_DEFAULT(/usr/local/squid)
18 AM_MAINTAINER_MODE
19
20 dnl Set default LDFLAGS
21 if test -z "$LDFLAGS"; then
22 LDFLAGS="-g"
23 fi
24
25 PRESET_CFLAGS="$CFLAGS"
26
27 dnl Check for GNU cc
28 AC_PROG_CC
29 AC_LANG_C
30 AC_PROG_CXX
31 AM_PROG_CC_C_O
32 AC_CANONICAL_HOST
33
34
35 CRYPTLIB=''
36 REGEXLIB='' # -lregex
37 LIBREGEX='' # libregex.a
38
39 dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
40 AC_EXEEXT
41 AC_OBJEXT
42
43 if test -z "$EXEEXT"; then
44 CGIEXT=".cgi"
45 else
46 # automake automatically adds .exe when installing binaries
47 CGIEXT=""
48 fi
49 AC_SUBST(CGIEXT)
50
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
53 case "$host_os" in
54 cygwin|cygwin32)
55 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
56 ;;
57 *)
58 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
59 ;;
60 esac
61
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
68
69 dnl Subsitutions
70 AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
71 [What default TCP port to use for HTTP listening?])
72 AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
73 [What default UDP port to use for ICP listening?])
74
75 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
76
77 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
78
79 dnl Check for GNU cc
80 AC_PROG_CC
81
82 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
83 case "$host" in
84 mab-next-nextstep3)
85 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
86 ;;
87 esac
88
89 dnl Set Default CFLAGS
90 if test -z "$PRESET_CFLAGS"; then
91 if test "$GCC" = "yes"; then
92 case "$host" in
93 *-sun-sunos*)
94 # sunos has too many warnings for this to be useful
95 # motorola too
96 ;;
97 *m88k*)
98 # Motorola cc/ld does not like -02 but is ok on -O
99 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
100 ;;
101 *)
102 CFLAGS="$CFLAGS -Wall"
103 ;;
104 esac
105 else
106 case "$host" in
107 *mips-sgi-irix6.*)
108 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
109 CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \
110 -woff 1009,1014,1110,1116,1185,1188,1204,1230,1233 \
111 -Wl,-woff,85,-woff,84,-woff,134 \
112 -nostdinc -I/usr/include -D_BSD_SIGNALS"
113 ;;
114 alpha-dec-osf4.*)
115 # Mogul says DEC compilers take both -g and -O2
116 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
117 CFLAGS="$CFLAGS -O2"
118 ;;
119 *)
120 ;;
121 esac
122 fi
123 fi
124
125 dnl set squid required flags
126 if test "$GCC" = "yes"; then
127 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
128 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wcomments"
129 else
130 SQUID_CFLAGS=
131 SQUID_CXXFLAGS=
132 fi
133 AC_SUBST(SQUID_CFLAGS)
134 AC_SUBST(SQUID_CXXFLAGS)
135
136 dnl Set LDFLAGS
137 if test -z "$PRESET_LDFLAGS"; then
138 if test "$GCC" = "yes"; then
139 case "$host" in
140 *)
141 # nothing
142 ;;
143 esac
144 else
145 case "$host" in
146 *mips-sgi-irix6.*)
147 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
148 LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32"
149 ;;
150 esac
151 fi
152 fi
153
154 dnl Enable optional modules
155 AC_ARG_ENABLE(dlmalloc,
156 [ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
157 [
158 case "$enableval" in
159 'yes')
160 use_dlmalloc="yes"
161 LIBDLMALLOC="libdlmalloc.a"
162 LIB_MALLOC="-L../lib -ldlmalloc"
163 echo "dlmalloc enabled"
164 ;;
165 'no')
166 use_dlmalloc="no"
167 echo "dlmalloc disabled"
168 ;;
169 *) use_dlmalloc="yes"
170 LIB_MALLOC="$enableval"
171 echo "dlmalloc enabled with $LIB_MALLOC"
172 esac
173 ])
174 if test "${use_dlmalloc-unset}" = unset; then
175 case "$host" in
176 i386-*-solaris2.*)
177 echo "Enabling dlmalloc for $host"
178 use_dlmalloc="yes"
179 LIBDLMALLOC="libdlmalloc.a"
180 LIB_MALLOC="-L../lib -ldlmalloc"
181 ;;
182 *-sgi-irix*)
183 echo "Enabling dlmalloc for $host"
184 use_dlmalloc="yes"
185 LIBDLMALLOC="libdlmalloc.a"
186 LIB_MALLOC="-L../lib -ldlmalloc"
187 ;;
188 esac
189 fi
190 if test "x$ac_cv_enabled_dlmalloc" = "xyes"; then
191 # Ok. dlmalloc was enabled before, but state may be changed.
192 # we have to test these again
193 unset ac_cv_func_mallinfo
194 unset ac_cv_func_mallocblksize
195 unset ac_cv_func_free
196 unset ac_cv_func_realloc
197 unset ac_cv_func_memalign
198 unset ac_cv_func_valloc
199 unset ac_cv_func_pvalloc
200 unset ac_cv_func_calloc
201 unset ac_cv_func_cfree
202 unset ac_cv_func_malloc_trim
203 unset ac_cv_func_malloc_usable_size
204 unset ac_cv_func_malloc_stats
205 unset ac_cv_func_mallinfo
206 unset ac_cv_func_mallopt
207 unset ac_cv_lib_gnumalloc
208 unset ac_cv_header_gnumalloc_h
209 unset ac_cv_lib_malloc
210 unset ac_cv_enabled_dlmalloc
211 fi
212 if test "$use_dlmalloc" = yes; then
213 ac_cv_func_mallinfo="yes"
214 ac_cv_func_mallocblksize="no"
215 ac_cv_func_free="yes"
216 ac_cv_func_realloc="yes"
217 ac_cv_func_memalign="yes"
218 ac_cv_func_valloc="yes"
219 ac_cv_func_pvalloc="yes"
220 ac_cv_func_calloc="yes"
221 ac_cv_func_cfree="yes"
222 ac_cv_func_malloc_trim="yes"
223 ac_cv_func_malloc_usable_size="yes"
224 ac_cv_func_malloc_stats="yes"
225 ac_cv_func_mallopt="yes"
226 ac_cv_lib_gnumalloc="no"
227 ac_cv_header_gnumalloc_h="no"
228 ac_cv_lib_malloc="no"
229 ac_cv_enabled_dlmalloc="yes"
230 AC_DEFINE(USE_DLMALLOC, 1, [Compile & use the malloc package by Doug Lea])
231 fi
232
233 AC_SUBST(LIBDLMALLOC)
234 AC_SUBST(LIB_MALLOC)
235
236 AC_ARG_ENABLE(gnuregex,
237 [ --enable-gnuregex Compile GNUregex],
238 [USE_GNUREGEX=$enableval])
239
240 SquidInline="yes"
241
242 AC_ARG_ENABLE(optimizations,
243 [ --disable-optimizations Don't compile Squid with compiler optimizations enabled.
244 Optimization is good for production builds, but not
245 good for debugging. During development, use
246 --disable-optimizations to reduce compilation times
247 and allow easier debugging. This option implicitly
248 also enabled --disable-inline],
249 [ if test "$enableval" = "no" ; then
250 echo "Disabling compiler optimizations (-O flag)"
251 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
252 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
253 SquidInline="no"
254 fi
255 ])
256
257 AC_ARG_ENABLE(inline,
258 [ --disable-inline Don't compile trivial methods as inline. Squid
259 is coded with much of the code able to be inlined.
260 Inlining is good for production builds, but not
261 good for development. During development, use
262 --disable-inline to reduce compilation times and
263 allow incremental builds to be quick. For
264 production builds, or load tests, use
265 --enable-inline to have squid make all trivial
266 methods inlinable by the compiler.],
267 [ if test "$enableval" = "no" ; then
268 SquidInline="no"
269 fi
270 ])
271
272 if test "$SquidInline" = "yes" ; then
273 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
274 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
275 else
276 echo "Inlining optimization disabled"
277 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
278 fi
279
280 AC_ARG_ENABLE(debug-cbdata,
281 [ --enable-debug-cbdata Provide some debug information in cbdata],
282 [ if test "$enableval" = "yes" ; then
283 echo "cbdata debugging enabled"
284 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
285 fi
286 ])
287
288 dnl This is a developer only option.. developers know how to set defines
289 dnl
290 dnl AC_ARG_ENABLE(xmalloc-debug,
291 dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
292 dnl [ if test "$enableval" = "yes" ; then
293 dnl echo "Malloc debugging enabled"
294 dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
295 dnl fi
296 dnl ])
297
298 dnl This is a developer only option.. developers know how to set defines
299 dnl
300 dnl AC_ARG_ENABLE(xmalloc-debug-trace,
301 dnl [ --enable-xmalloc-debug-trace
302 dnl Detailed trace of memory allocations],
303 dnl [ if test "$enableval" = "yes" ; then
304 dnl echo "Malloc debug trace enabled"
305 dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
306 dnl AC_DEFINE(XMALLOC_DEBUG,1)
307 dnl fi
308 dnl ])
309
310 AC_ARG_ENABLE(xmalloc-statistics,
311 [ --enable-xmalloc-statistics
312 Show malloc statistics in status page],
313 [ if test "$enableval" = "yes" ; then
314 echo "Malloc statistics enabled"
315 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
316 fi
317 ])
318
319 use_carp=1
320 AC_ARG_ENABLE(carp,
321 [ --disable-carp Disable CARP support],
322 [ if test "$enableval" = "no" ; then
323 echo "CARP disabled"
324 use_carp=0
325 fi
326 ])
327 if test $use_carp = 1; then
328 AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol])
329 else
330 AC_DEFINE(USE_CARP, 1)
331 fi
332
333 AC_ARG_ENABLE(async-io,
334 [ --enable-async-io[=N_THREADS]
335 Shorthand for
336 --with-aufs-threads=N_THREADS
337 --with-pthreads
338 --enable-storeio=ufs,aufs],
339 [ case $enableval in
340 yes)
341 with_pthreads="yes"
342 STORE_MODULES="ufs aufs"
343 ;;
344 no)
345 ;;
346 *)
347 aufs_io_threads=$enableval
348 with_pthreads="yes"
349 STORE_MODULES="ufs aufs"
350 ;;
351 esac
352 ])
353
354 AC_ARG_WITH(aufs-threads,
355 [ --with-aufs-threads=N_THREADS
356 Tune the number of worker threads for the aufs object
357 store.],
358 [ case $withval in
359 [[0-9]]*)
360 aufs_io_threads=$withval
361 ;;
362 *)
363 echo "ERROR: Invalid --with-aufs-threads argument"
364 exit 1
365 ;;
366 esac
367 ])
368 if test "$aufs_io_threads"; then
369 echo "With $aufs_io_threads aufs threads"
370 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
371 [Defines how many threads aufs uses for I/O])
372 fi
373
374 AC_ARG_WITH(pthreads,
375 [ --with-pthreads Use POSIX Threads])
376 if test "$with_pthreads" = "yes"; then
377 echo "With pthreads"
378 fi
379
380 AC_ARG_WITH(aio,
381 [ --with-aio Use POSIX AIO])
382 if test "$with_aio" = "yes"; then
383 echo "With aio"
384 fi
385
386 AC_ARG_WITH(dl,
387 [ --with-dl Use dynamic linking])
388 if test "$with_dl" = "yes"; then
389 echo "With dl"
390 fi
391
392 AC_ARG_ENABLE(storeio,
393 [ --enable-storeio=\"list of modules\"
394 Build support for the list of store I/O modules.
395 The default is only to build the "ufs" module.
396 See src/fs for a list of available modules, or
397 Programmers Guide section <not yet written>
398 for details on how to build your custom store module],
399 [ case $enableval in
400 yes)
401 for dir in $srcdir/src/fs/*; do
402 module="`basename $dir`"
403 if test -d "$dir" && test "$module" != CVS; then
404 STORE_MODULES="$STORE_MODULES $module"
405 fi
406 done
407 ;;
408 no)
409 ;;
410 *)
411 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
412 ;;
413 esac
414 ],
415 [ if test -z "$STORE_MODULES"; then
416 STORE_MODULES="ufs"
417 fi
418 ])
419 if test -n "$STORE_MODULES"; then
420 for module in $STORE_MODULES; do
421 if test -d $srcdir/src/fs/$module; then
422 :
423 else
424 echo "ERROR: storeio $module does not exists"
425 exit 1
426 fi
427 done
428 echo "Store modules built: $STORE_MODULES"
429 STORE_OBJS="fs/lib`echo $STORE_MODULES|sed -e 's% %.a fs/lib%g'`.a"
430 STORE_LIBS="`echo $STORE_OBJS|sed -e 's%fs/%%g'`"
431 STORE_LINKOBJS=
432 for module in $STORE_MODULES; do
433 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
434 done
435 fi
436 dnl remove all but diskd - its the only module that needs to recurse
437 dnl into the sub directory
438 STORE_MODULE_SUBDIRS=
439 UFS_FOUND=
440 NEED_UFS=
441 for fs in $STORE_MODULES none; do
442 case "$fs" in
443 diskd)
444 STORE_MODULE_SUBDIRS="$STORE_MODULE_SUBDIRS $fs"
445 STORE_PROGRAMS="$STORE_PROGRAMS diskd/diskd"
446 NEED_UFS="true"
447 ;;
448 aufs)
449 if test -z "$with_pthreads"; then
450 echo "aufs store used, pthreads support automatically enabled"
451 with_pthreads=yes
452 fi
453 NEED_UFS="true"
454 ;;
455 coss)
456 if test -z "$with_aio"; then
457 echo "coss store used, aio support automatically enabled"
458 with_aio=yes
459 fi
460 ;;
461 ufs)
462 UFS_FOUND="true"
463 esac
464 done
465
466 if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
467 echo "adding UFS, as it contains core logic for diskd and aufs"
468 STORE_OBJS="$STORE_OBJS fs/libufs.a"
469 STORE_LIBS="$STORE_LIBS libufs.a"
470 STORE_MODULES="$STORE_MODULES ufs"
471 STORE_LINKOBJS="$STORE_SOURCE fs/ufs/StoreFSufs.o"
472 fi
473
474 AC_SUBST(STORE_OBJS)
475 AC_SUBST(STORE_LIBS)
476 AC_SUBST(STORE_PROGRAMS)
477 AC_SUBST(STORE_MODULE_SUBDIRS)
478 AC_SUBST(STORE_LINKOBJS)
479
480 AC_ARG_ENABLE(removal-policies,
481 [ --enable-removal-policies=\"list of policies\"
482 Build support for the list of removal policies.
483 The default is only to build the "lru" module.
484 See src/repl for a list of available modules, or
485 Programmers Guide section 9.9 for details on how
486 to build your custom policy],
487 [ case $enableval in
488 yes)
489 for dir in $srcdir/src/repl/*; do
490 module="`basename $dir`"
491 if test -d "$dir" && test "$module" != CVS; then
492 REPL_POLICIES="$REPL_POLICIES $module"
493 fi
494 done
495 ;;
496 no)
497 ;;
498 *)
499 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
500 ;;
501 esac
502 ],
503 [ if test -z "$REPL_POLICIES"; then
504 REPL_POLICIES="lru"
505 fi
506 ])
507 if test -n "$REPL_POLICIES"; then
508 for module in $REPL_POLICIES; do
509 if test -d $srcdir/src/repl/$module; then
510 :
511 else
512 echo "ERROR: Removal policy $module does not exists"
513 exit 1
514 fi
515 done
516 echo "Removal policies built: $REPL_POLICIES"
517 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
518 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
519 fi
520 AC_SUBST(REPL_POLICIES)
521 AC_SUBST(REPL_OBJS)
522 AC_SUBST(REPL_LIBS)
523
524 AM_CONDITIONAL(ENABLE_PINGER, false)
525 AC_ARG_ENABLE(icmp,
526 [ --enable-icmp Enable ICMP pinging],
527 [ if test "$enableval" = "yes" ; then
528 echo "ICMP enabled"
529 AC_DEFINE(USE_ICMP,1,
530 [If you want to use Squid's ICMP features (highly recommended!) then
531 define this. When USE_ICMP is defined, Squid will send ICMP pings
532 to origin server sites. This information is used in numerous ways:
533 - Sent in ICP replies so neighbor caches know how close
534 you are to the source.
535 - For finding the closest instance of a URN.
536 - With the 'test_reachability' option. Squid will return
537 ICP_OP_MISS_NOFETCH for sites which it cannot ping.])
538 AM_CONDITIONAL(ENABLE_PINGER, true)
539 fi
540 ])
541
542 AM_CONDITIONAL(USE_DELAY_POOLS, false)
543 AC_ARG_ENABLE(delay-pools,
544 [ --enable-delay-pools Enable delay pools to limit bandwidth usage],
545 [ if test "$enableval" = "yes" ; then
546 echo "Delay pools enabled"
547 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
548 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
549 fi
550 ])
551
552 AM_CONDITIONAL(USE_ESI, false)
553 AC_ARG_ENABLE(esi,
554 AC_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat. Enabling ESI will cause squid to follow the Edge Acceleration Specification (www.esi.org). This causes squid to IGNORE client Cache-Control headers. DO NOT use this in a squid configured as a web proxy, ONLY use it in a squid configured for webserver acceleration.]),
555 ac_cv_use_esi=$enableval, ac_cv_use_esi=no)
556 AC_CACHE_CHECK(whether to enable ESI,ac_cv_use_esi, ac_cv_use_esi=no)
557 if test "$ac_cv_use_esi" = "yes" ; then
558 AC_DEFINE(ESI,1,[Compile the ESI processor and Surrogate header support])
559 AM_CONDITIONAL(USE_ESI, true)
560 XTRA_LIBS="$XTRA_LIBS -lexpat"
561 else
562 AC_DEFINE(ESI,0,[Compile the ESI processor and Surrogate header support])
563 fi
564
565 dnl This is a developer only option. Developers know how to set defines
566 dnl
567 dnl AC_ARG_ENABLE(mem-gen-trace,
568 dnl [ --enable-mem-gen-trace Do trace of memory stuff],
569 dnl [ if test "$enableval" = "yes" ; then
570 dnl echo "Memory trace (to file) enabled"
571 dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
572 dnl fi
573 dnl ])
574
575 AC_ARG_ENABLE(useragent-log,
576 [ --enable-useragent-log Enable logging of User-Agent header],
577 [ if test "$enableval" = "yes" ; then
578 echo "User-Agent logging enabled"
579 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
580 By default, they are written to useragent.log in the Squid log
581 directory.])
582 fi
583 ])
584
585 AC_ARG_ENABLE(referer-log,
586 [ --enable-referer-log Enable logging of Referer header],
587 [ if test "$enableval" = "yes" ; then
588 echo "Referer logging enabled"
589 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
590 By default, they are written to referer.log in the Squid log
591 directory.])
592 fi
593 ])
594
595 use_wccp=1
596 AC_ARG_ENABLE(wccp,
597 [ --disable-wccp Disable Web Cache Coordination Protocol],
598 [ if test "$enableval" = "no" ; then
599 echo "Web Cache Coordination Protocol disabled"
600 use_wccp=0
601 fi
602 ])
603 if test $use_wccp = 1; then
604 AC_DEFINE(USE_WCCP, 1,[Define to enable WCCP])
605 else
606 AC_DEFINE(USE_WCCP, 0)
607 fi
608
609 AC_ARG_ENABLE(kill-parent-hack,
610 [ --enable-kill-parent-hack
611 Kill parent on shutdown],
612 [ if test "$enableval" = "yes" ; then
613 echo "Kill parent on shutdown"
614 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
615 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
616 Use with caution.])
617 fi
618 ])
619
620 AM_CONDITIONAL(USE_SNMP, false)
621 AC_ARG_ENABLE(snmp,
622 [ --enable-snmp Enable SNMP monitoring],
623 [ if test "$enableval" = "yes" ; then
624 echo "SNMP monitoring enabled"
625 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
626 SNMPLIB='-L../snmplib -lsnmp'
627 AM_CONDITIONAL(USE_SNMP, true)
628 SNMP_MAKEFILE=./snmplib/Makefile
629 makesnmplib=snmplib
630 fi
631 ])
632 AC_SUBST(SNMPLIB)
633 AC_SUBST(makesnmplib)
634
635 AC_ARG_ENABLE(cachemgr-hostname,
636 [ --enable-cachemgr-hostname[=hostname]
637 Make cachemgr.cgi default to this host],
638 [ case $enableval in
639 yes)
640 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
641 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
642 echo "Cachemgr default hostname == host where cachemgr runs"
643 ;;
644 no)
645 : # Nothing to do..
646 ;;
647 *)
648 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
649 echo "Cachemgr default hostname set to ${enableval}"
650 ;;
651 esac
652 ])
653
654 AM_CONDITIONAL(ENABLE_ARP_ACL, false)
655 AC_ARG_ENABLE(arp-acl,
656 [ --enable-arp-acl Enable use of ARP ACL lists (ether address)],
657 [ if test "$enableval" = "yes" ; then
658 echo "ARP ACL lists enabled (ether address)"
659 case "$host" in
660 *-linux-*)
661 ;;
662 *-solaris-*)
663 ;;
664 *)
665 echo "WARNING: ARP ACL support probably won't work on $host."
666 sleep 10
667 ;;
668 esac
669 AC_DEFINE(USE_ARP_ACL,1,[Define this to include code which lets you specify access control elements based on ethernet hardware addresses. This code uses functions found in 4.4 BSD derviations (e.g. FreeBSD, ?).])
670 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
671 fi
672 ])
673
674 AM_CONDITIONAL(ENABLE_HTCP, false)
675 AC_ARG_ENABLE(htcp,
676 [ --enable-htcp Enable HTCP protocol],
677 [ if test "$enableval" = "yes" ; then
678 echo "HTCP enabled"
679 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
680 AM_CONDITIONAL(ENABLE_HTCP, true)
681 fi
682 ])
683
684 AM_CONDITIONAL(ENABLE_SSL, false)
685
686 AC_ARG_ENABLE(ssl,
687 [ --enable-ssl Enable ssl gatewaying support using OpenSSL],
688 [ if test "$enableval" != "no"; then
689 echo "SSL gatewaying using OpenSSL enabled"
690 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
691 AM_CONDITIONAL(ENABLE_SSL, true)
692 SSLLIB='-lssl -lcrypto'
693 USE_OPENSSL=1
694 fi
695 ])
696
697 AM_CONDITIONAL(NEED_OWN_MD5, true)
698
699 AC_ARG_WITH(openssl,
700 [ --with-openssl[=prefix]
701 Compile with the OpenSSL libraries. The path to
702 the OpenSSL development libraries and headers
703 installation can be specified if outside of the
704 system standard directories],
705 [
706 case "$with_openssl" in
707 yes)
708 USE_OPENSSL=1
709 ;;
710 no)
711 USE_OPENSSL=
712 ;;
713 *)
714 SSLLIBDIR="$with_openssl/lib"
715 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
716 USE_OPENSSL=1
717 esac
718 ])
719
720 if test -n "$USE_OPENSSL"; then
721 echo "Using OpenSSL MD5 implementation"
722 AC_DEFINE(USE_OPENSSL,1,[Define this to make use of the OpenSSL libraries for MD5 calculation rather than Squid's own MD5 implementation or if building with SSL encryption (USE_SSL)])
723 AM_CONDITIONAL(NEED_OWN_MD5, false)
724 if test -z "$SSLLIB"; then
725 SSLLIB="-lcrypto" # for MD5 routines
726 fi
727 dnl This is a workaround for RedHat 9 brain damage..
728 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
729 echo "OpenSSL depends on Kerberos"
730 SSLLIBDIR="/usr/kerberos/lib"
731 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
732 fi
733 fi
734 if test -n "$SSLLIBDIR"; then
735 SSLLIB="-L$SSLLIBDIR $SSLLIB"
736 fi
737 AC_SUBST(SSLLIB)
738
739 AC_ARG_ENABLE(forw-via-db,
740 [ --enable-forw-via-db Enable Forw/Via database],
741 [ if test "$enableval" = "yes" ; then
742 echo "FORW-VIA enabled"
743 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
744 fi
745 ])
746
747 AC_ARG_ENABLE(cache-digests,
748 [ --enable-cache-digests Use Cache Digests
749 see http://www.squid-cache.org/FAQ/FAQ-16.html],
750 [ if test "$enableval" = "yes" ; then
751 echo "USE_CACHE_DIGESTS enabled"
752 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
753 fi
754 ])
755
756 dnl Select Default Error language
757 AC_ARG_ENABLE(default-err-language,
758 [ --enable-default-err-language=lang
759 Select default language for Error pages (see
760 errors directory) ],
761 [
762 if test -d $srcdir/errors/$enableval; then
763 ERR_DEFAULT_LANGUAGE=$enableval
764 else
765 echo "ERROR! Unknown language $enableval, see errors/ directory"
766 exit 1
767 fi
768 ],[ERR_DEFAULT_LANGUAGE="English"])
769 AC_SUBST(ERR_DEFAULT_LANGUAGE)
770
771 dnl Select languages to be installed
772 AC_ARG_ENABLE(err-languages,
773 [ --enable-err-languages=\"lang1 lang2..\"
774 Select languages to be installed. (All will be
775 installed by default) ],
776 [
777 for l in $enableval; do
778 if test -d $srcdir/errors/$l; then :; else
779 echo "ERROR! Unknown language $$l, see errors/"
780 exit 1
781 fi
782 done
783 ERR_LANGUAGES=$enableval
784 ],[
785 ERR_LANGUAGES=
786 for l in $srcdir/errors/*; do
787 if test -f $l/ERR_ACCESS_DENIED; then
788 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
789 fi
790 done
791 ])
792 AC_SUBST(ERR_LANGUAGES)
793
794 dnl Size of COSS memory buffer
795 AC_ARG_WITH(coss-membuf-size,
796 [ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
797 [ if test "$with_coss_membuf_size"; then
798 echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
799 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
800 fi
801 ])
802
803 dnl check for netio plugin stuff
804 dnl Enable poll()
805 AC_ARG_ENABLE(poll,
806 [ --enable-poll Enable poll() support.
807 --disable-poll Disable poll() support. ],
808
809 [
810 case "$enableval" in
811 yes)
812 echo "Forcing poll() to be enabled"
813 ac_cv_func_poll='yes'
814 ;;
815 no)
816 echo "Forcing poll() to be disabled"
817 ac_cv_func_poll='no'
818 ;;
819 esac
820 ])
821
822 dnl Enable select()
823 AC_ARG_ENABLE(select,
824 [ --enable-select Enable select() support.
825 --disable-select Disable select() support. ],
826
827 [
828 case "$enableval" in
829 yes)
830 echo "Forcing select() to be enabled"
831 ac_cv_func_select='yes'
832 ;;
833 no)
834 echo "Forcing select() to be disabled"
835 ac_cv_func_select='no'
836 ;;
837 esac
838 ])
839
840 dnl Enable kqueue()
841 AC_ARG_ENABLE(kqueue,
842 [ --enable-kqueue Enable kqueue() support.
843 --disable-kqueue Disable kqueue() support. ],
844
845 [
846 case "$enableval" in
847 yes)
848 echo "Forcing kqueue() to be enabled"
849 ac_cv_func_kqueue='yes'
850 ;;
851 no)
852 echo "Forcing kqueue() to be disabled"
853 ac_cv_func_kqueue='no'
854 ;;
855 esac
856 ])
857
858 dnl Enable epoll()
859 AM_CONDITIONAL(USE_EPOLL, false)
860 AC_DEFINE(USE_EPOLL,0,[Use epoll type polling])
861 AC_ARG_ENABLE(epoll,
862 [ --enable-epoll Enable epoll() support.
863 --disable-epoll Disable epoll() support. ],
864
865 [
866 case "$enableval" in
867 yes)
868 echo "Forcing epoll() to be enabled"
869 ac_cv_func_epoll='yes'
870 if test -z "$EPOLL_LIBS"; then
871 EPOLL_LIBS="-lepoll"
872 fi
873 AC_SUBST(EPOLL_LIBS)
874 AM_CONDITIONAL(USE_EPOLL, true)
875 ;;
876 no)
877 echo "Forcing epoll() to be disabled"
878 ac_cv_func_epoll='no'
879 ;;
880 esac
881 ])
882
883
884 dnl Disable HTTP violations
885 http_violations=1
886 AC_ARG_ENABLE(http-violations,
887 [ --disable-http-violations
888 This allows you to remove code which is known to
889 violate the HTTP protocol specification.],
890 [ if test "$enableval" = "no" ; then
891 echo "Disabling HTTP Violations"
892 http_violations=0
893 fi
894 ])
895 if test $http_violations = 1; then
896 AC_DEFINE(HTTP_VIOLATIONS, 1,[By default (for now anyway) Squid includes options which allows the cache administrator to violate the HTTP protocol specification in terms of cache behaviour. Setting this to '0' will disable such code.])
897 else
898 AC_DEFINE(HTTP_VIOLATIONS, 0)
899 fi
900
901 dnl Enable IP-Filter Transparent Proxy
902 AC_ARG_ENABLE(ipf-transparent,
903 [ --enable-ipf-transparent
904 Enable Transparent Proxy support for systems
905 using IP-Filter network address redirection.],
906 [ if test "$enableval" = "yes" ; then
907 echo "IP-Filter Transparent Proxy enabled"
908 AC_DEFINE(IPF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.])
909 IPF_TRANSPARENT="yes"
910 fi
911 ])
912
913 dnl Enable PF Transparent Proxy
914 AC_ARG_ENABLE(pf-transparent,
915 [ --enable-pf-transparent
916 Enable Transparent Proxy support for systems
917 using PF network address redirection.],
918 [ if test "$enableval" = "yes" ; then
919 echo "PF Transparent Proxy enabled"
920 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
921 PF_TRANSPARENT="yes"
922 fi
923 ])
924
925 dnl Enable Linux Netfilter (2.4) Transparent Proxy
926 AC_ARG_ENABLE(linux-netfilter,
927 [ --enable-linux-netfilter
928 Enable Transparent Proxy support for Linux 2.4.],
929 [ if test "$enableval" = "yes" ; then
930 echo "Linux-Netfilter Transparent Proxy enabled"
931 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux 2.4 systems])
932 LINUX_NETFILTER="yes"
933 fi
934 ])
935
936 dnl Enable Large file support
937 AC_ARG_ENABLE(large-files,
938 [ --enable-large-files Enable support for large files (>2GB). Still
939 experimental.],
940 [ if test "$enableval" = "yes" ; then
941 echo "Large file support enabled"
942 CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
943 CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
944 fi
945 ])
946
947 AM_CONDITIONAL(MAKE_LEAKFINDER, false)
948 dnl Enable Leak Finding Functions
949 AC_ARG_ENABLE(leakfinder,
950 [ --enable-leakfinder
951 Enable Leak Finding code. Enabling this alone
952 does nothing; you also have to modify the source
953 code to use the leak finding functions. Probably
954 Useful for hackers only.],
955 [ if test "$enableval" = "yes" ; then
956 echo "Leak-Finding enabled"
957 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
958 USE_LEAKFINDER="yes"
959 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
960 fi
961 ])
962
963 use_ident=1
964 AC_ARG_ENABLE(ident-lookups,
965 [ --disable-ident-lookups
966 This allows you to remove code that performs
967 Ident (RFC 931) lookups.],
968 [ if test "$enableval" = "no" ; then
969 echo "Disabling Ident Lookups"
970 use_ident=0
971 fi
972 ])
973 if test $use_ident = 1; then
974 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
975 AM_CONDITIONAL(ENABLE_IDENT, true)
976 else
977 AC_DEFINE(USE_IDENT, 0)
978 AM_CONDITIONAL(ENABLE_IDENT, false)
979 fi
980
981 AM_CONDITIONAL(USE_DNSSERVER, false)
982 use_dnsserver=
983 AC_ARG_ENABLE(internal-dns,
984 [ --disable-internal-dns This prevents Squid from directly sending and
985 receiving DNS messages, and instead enables the
986 old external 'dnsserver' processes.],
987 [ if test "$enableval" = "no" ; then
988 echo "Disabling Internal DNS queries"
989 use_dnsserver="yes"
990 fi
991 ])
992 if test "$use_dnsserver" = "yes"; then
993 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
994 AM_CONDITIONAL(USE_DNSSERVER, true)
995 fi
996
997 AC_ARG_ENABLE(truncate,
998 [ --enable-truncate This uses truncate() instead of unlink() when
999 removing cache files. Truncate gives a little
1000 performance improvement, but may cause problems
1001 when used with async I/O. Truncate uses more
1002 filesystem inodes than unlink..],
1003 [ if test "$enableval" = "yes" ; then
1004 echo "Enabling truncate instead of unlink"
1005 AC_DEFINE(USE_TRUNCATE,1,[Do we want to use truncate(2) or unlink(2)?])
1006 fi
1007 ])
1008
1009 dnl Disable hostname checks
1010 enable_hostname_checks=0
1011 AC_ARG_ENABLE(hostname_checks,
1012 [ --enable-hostname-checks
1013 Tells Squid to rejects any host names with
1014 odd characters in their name to conform with
1015 internet standards. This was the default in
1016 prior Squid versions, but since Squid-3 Squid
1017 no longer tries to police the use of DNS],
1018 [ if test "$enableval" = "yes"; then
1019 echo "Enabling hostname sanity checks"
1020 enable_hostname_checks=1
1021 fi
1022 ])
1023 if test "$enable_hostname_checks" = 1; then
1024 AC_DEFINE(CHECK_HOSTNAMES, 1, [Enable hostname sanity checks])
1025 fi
1026
1027 dnl Enable underscore in hostnames
1028 AC_ARG_ENABLE(underscores,
1029 [ --enable-underscores Squid by default rejects any host names with _
1030 in their name to conform with internet standards.
1031 If you disagree with this you may allow _ in
1032 hostnames by using this switch, provided that
1033 the resolver library on the host where Squid runs
1034 does not reject _ in hostnames...],
1035 [ if test "$enableval" = "yes" ; then
1036 echo "Enabling the use of underscores in host names"
1037 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1,[Allow underscores in host names])
1038 fi
1039 ])
1040
1041 dnl Select Default hosts file location
1042 AC_ARG_ENABLE(default-hostsfile,
1043 [ --enable-default-hostsfile=path
1044 Select default location for hosts file.
1045 See hosts_file directive in squid.conf for details],
1046 [
1047 if test "$enableval" != "none" ; then
1048 if test -f $enableval; then
1049 OPT_DEFAULT_HOSTS=$enableval
1050 else
1051 echo "Warning Unable to find $enableval"
1052 sleep 5
1053 fi
1054 else
1055 OPT_DEFAULT_HOSTS="none"
1056 fi
1057 echo "Default hosts file set to: $enableval"
1058 ],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1059 AC_SUBST(OPT_DEFAULT_HOSTS)
1060
1061 dnl Select auth schemes modules to build
1062 AC_ARG_ENABLE(auth,
1063 [ --enable-auth=\"list of auth scheme modules\"
1064 Build support for the list of authentication schemes.
1065 The default is to build support for the Basic scheme.
1066 See src/auth for a list of available modules, or
1067 Programmers Guide section authentication schemes
1068 for details on how to build your custom auth scheme
1069 module],
1070 [ case $enableval in
1071 yes)
1072 for dir in $srcdir/src/auth/*; do
1073 module="`basename $dir`"
1074 if test -d "$dir" && test "$module" != CVS; then
1075 AUTH_MODULES="$AUTH_MODULES $module"
1076 fi
1077 done
1078 ;;
1079 no)
1080 ;;
1081 *)
1082 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1083 ;;
1084 esac
1085 ],
1086 [ if test -z "$AUTH_MODULES"; then
1087 AUTH_MODULES="basic"
1088 fi
1089 ])
1090 if test -n "$AUTH_MODULES"; then
1091 for module in $AUTH_MODULES; do
1092 if test -d $srcdir/src/auth/$module; then
1093 :
1094 else
1095 echo "ERROR: Auth scheme $module does not exists"
1096 exit 1
1097 fi
1098 done
1099 echo "Auth scheme modules built: $AUTH_MODULES"
1100 AUTH_OBJS="auth/lib`echo $AUTH_MODULES|sed -e 's% %.a auth/lib%g'`.a"
1101 AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`"
1102 fi
1103 AC_SUBST(AUTH_MODULES)
1104 AC_SUBST(AUTH_OBJS)
1105 AC_SUBST(AUTH_LIBS)
1106
1107 dnl Select basic auth scheme helpers to build
1108 BASIC_AUTH_HELPERS=""
1109 AC_ARG_ENABLE(basic-auth-helpers,
1110 [ --enable-basic-auth-helpers=\"list of helpers\"
1111 This option selects which basic scheme proxy_auth
1112 helpers to build and install as part of the normal
1113 build process. For a list of available
1114 helpers see the helpers/basic_auth directory.],
1115 [ case "$enableval" in
1116 yes)
1117 for dir in $srcdir/helpers/basic_auth/*; do
1118 helper="`basename $dir`"
1119 if test -d "$dir" && test "$helper" != CVS; then
1120 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1121 fi
1122 done
1123 ;;
1124 no)
1125 ;;
1126 *)
1127 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1128 ;;
1129 esac
1130 ])
1131 if test -n "$BASIC_AUTH_HELPERS"; then
1132 for helper in $BASIC_AUTH_HELPERS; do
1133 if test -d $srcdir/helpers/basic_auth/$helper; then
1134 :
1135 else
1136 echo "ERROR: Basic auth helper $helper does not exists"
1137 exit 1
1138 fi
1139 done
1140 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
1141 fi
1142 AC_SUBST(BASIC_AUTH_HELPERS)
1143
1144 dnl Select ntlm auth helpers to build
1145 NTLM_AUTH_HELPERS=
1146 AC_ARG_ENABLE(ntlm-auth-helpers,
1147 [ --enable-ntlm-auth-helpers=\"list of helpers\"
1148 This option selects which proxy_auth ntlm helpers
1149 to build and install as part of the normal build
1150 process. For a list of available helpers see
1151 the helpers/ntlm_auth directory.],
1152 [ case "$enableval" in
1153 yes)
1154 for dir in $srcdir/helpers/ntlm_auth/*; do
1155 helper="`basename $dir`"
1156 if test -d "$dir" && test "$helper" != CVS; then
1157 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1158 fi
1159 done
1160 ;;
1161 no)
1162 ;;
1163 *)
1164 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1165 ;;
1166 esac
1167 ])
1168 if test -n "$NTLM_AUTH_HELPERS"; then
1169 for helper in $NTLM_AUTH_HELPERS; do
1170 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1171 :
1172 else
1173 echo "ERROR: NTLM Auth helper $helper does not exists"
1174 exit 1
1175 fi
1176 done
1177 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
1178 fi
1179 AC_SUBST(NTLM_AUTH_HELPERS)
1180
1181 dnl Select digest auth scheme helpers to build
1182 DIGEST_AUTH_HELPERS=
1183 AC_ARG_ENABLE(digest-auth-helpers,
1184 [ --enable-digest-auth-helpers=\"list of helpers\"
1185 This option selects which digest scheme authentication
1186 helpers to build and install as part of the normal build
1187 process. For a list of available helpers see the
1188 helpers/digest_auth directory.],
1189 [ case "$enableval" in
1190 yes)
1191 for dir in $srcdir/helpers/digest_auth/*; do
1192 helper="`basename $dir`"
1193 if test -d "$dir" && test "$helper" != CVS; then
1194 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1195 fi
1196 done
1197 ;;
1198 no)
1199 ;;
1200 *)
1201 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1202 ;;
1203 esac
1204 ])
1205 if test -n "$DIGEST_AUTH_HELPERS"; then
1206 for helper in $DIGEST_AUTH_HELPERS; do
1207 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1208 :
1209 else
1210 echo "ERROR: digest auth helper $helper does not exists"
1211 exit 1
1212 fi
1213 done
1214 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1215 fi
1216 AC_SUBST(DIGEST_AUTH_HELPERS)
1217
1218 dnl Enable "NTLM fail open"
1219 AC_ARG_ENABLE(ntlm-fail-open,
1220 [ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1221 Authentication steps can allow squid to still authenticate
1222 the user.],
1223 [ if test "$enableval" = "yes" ; then
1224 AC_DEFINE(NTLM_FAIL_OPEN,1,[Define if NTLM is allowed to fail gracefully when a helper has problems. WARNING: This has security implications. DO NOT enable unless you KNOW you need it.])
1225 fi
1226 ])
1227
1228 dnl Select external_acl helpers to build
1229 EXTERNAL_ACL_HELPERS=
1230 AC_ARG_ENABLE(external-acl-helpers,
1231 [ --enable-external-acl-helpers=\"list of helpers\"
1232 This option selects which external_acl helpers to
1233 build and install as part of the normal build
1234 process. For a list of available helpers see the
1235 helpers/external_acl directory.],
1236 [ case "$enableval" in
1237 yes)
1238 for dir in $srcdir/helpers/external_acl/*; do
1239 helper="`basename $dir`"
1240 if test -d "$dir" && test "$helper" != CVS; then
1241 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1242 fi
1243 done
1244 ;;
1245 no)
1246 ;;
1247 *)
1248 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1249 ;;
1250 esac
1251 ])
1252 if test -n "$EXTERNAL_ACL_HELPERS"; then
1253 for helper in $EXTERNAL_ACL_HELPERS; do
1254 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1255 :
1256 else
1257 echo "ERROR: external acl helper $helper does not exists"
1258 exit 1
1259 fi
1260 done
1261 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1262 fi
1263 AC_SUBST(EXTERNAL_ACL_HELPERS)
1264
1265 dnl Disable "memPools" code
1266 AC_ARG_ENABLE(mempools,
1267 [ --disable-mempools Disable memPools],
1268 [ if test "$enableval" = "no" ; then
1269 echo "memPools disabled"
1270 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
1271 fi
1272 ])
1273
1274 dnl Enable WIN32 Service compile mode
1275 AC_ARG_ENABLE(win32-service,
1276 [ --enable-win32-service Compile Squid as a WIN32 Service
1277 Works only on Windows NT and Windows 2000 Platforms.],
1278 [ if test "$enableval" = "yes" ; then
1279 echo "Enabling WIN32 run service mode"
1280 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1281 fi
1282 ])
1283
1284
1285 SAMBASOURCES='$(top_srcdir)/include/samba'
1286 AC_ARG_WITH(samba-sources,
1287 [ --with-samba-sources=/path/to/samba-source-tree
1288 Path where the correct Samba source files can be
1289 found while building winbind helpers. (defaults to
1290 use internal copies of the headers from Samba-2.2.7)
1291 ],
1292 [ if test -f $withval/source/nsswitch/winbind_nss_config.h; then
1293 echo "Using Samba sources from $withval"
1294 SAMBASOURCES="$withval/source"
1295 else
1296 echo "ERROR: Cannot find Samba sources at $withval"
1297 exit 1
1298 fi
1299 ])
1300 AC_SUBST(SAMBASOURCES)
1301
1302 dnl Disable "unlinkd" code
1303 AC_ARG_ENABLE(unlinkd,
1304 [ --disable-unlinkd Do not use unlinkd],
1305 [ if test "$enableval" = "no" ; then
1306 use_unlinkd=no
1307 else
1308 use_unlinkd=yes
1309 fi
1310 ],[
1311 # Here we should probably use some magic depending on the selected
1312 # storage models
1313 use_unlinkd=yes
1314 ])
1315 if test "$use_unlinkd" = "yes"; then
1316 echo "unlinkd enabled"
1317 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
1318 AM_CONDITIONAL(ENABLE_UNLINKD, true)
1319 else
1320 echo "unlinkd disabled"
1321 AM_CONDITIONAL(ENABLE_UNLINKD, false)
1322 fi
1323
1324 dnl Enable backtraces on fatal errors
1325 AC_ARG_ENABLE(stacktraces,
1326 [ --enable-stacktraces Enable automatic call backtrace on fatal errors],
1327 [ if test "$enableval" = "yes" ; then
1328 echo "Enabling automatic stack backtraces on fatal errors"
1329 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
1330 fi
1331 ])
1332
1333 AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1334 dnl Enable USE_XPROF_STATS
1335 AC_ARG_ENABLE(cpu-profiling,
1336 [ --enable-cpu-profiling
1337 This option allows you to see which internal functions
1338 in Squid are consuming how much CPU. Compiles in probes
1339 that measure time spent in probed functions. Needs
1340 source modifications to add new probes. This is meant
1341 for developers to assist in performance optimisations
1342 of Squid internal functions.
1343 If you are not developer and not interested in the stats
1344 you shouldn't enable this, as overhead added, although
1345 small, is still overhead. See lib/Profiler.c for more.
1346 ],
1347 [ if test "$enableval" = "yes" ; then
1348 echo "Enabling cpu-profiling"
1349 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1350 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1351 fi
1352 ])
1353
1354 dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1355 AC_ARG_ENABLE(x_accelerator_vary,
1356 [ --enable-x-accelerator-vary
1357 Enable support for the X-Accelerator-Vary
1358 HTTP header. Can be used to indicate
1359 variance within an accelerator setup.
1360 Typically used together with other code
1361 that adds custom HTTP headers to the requests.],
1362 [ if test "$enableval" = "yes" ; then
1363 echo "Enabling support for X-Accelerator-Vary"
1364 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
1365 fi
1366 ])
1367
1368 AC_ARG_WITH(filedescriptors,
1369 [ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors],
1370 [ squid_filedescriptors_num=$withval ])
1371
1372 # Force some compilers to use ANSI features
1373 #
1374 case "$host" in
1375 alpha-dec-osf*)
1376 if test "$ac_cv_prog_CC" = "cc" ; then
1377 echo "adding '-std1' to cc args for $host"
1378 CC="cc -std1";
1379 ac_cv_prog_CC="$CC"
1380 fi
1381 ;;
1382 *-hp-hpux*)
1383 if test "$ac_cv_prog_CC" = "cc" ; then
1384 echo "adding '-Ae' to cc args for $host"
1385 CC="cc -Ae";
1386 ac_cv_prog_CC="$CC"
1387 fi
1388 ;;
1389 esac
1390
1391 dnl Check for programs
1392 AC_PROG_CPP
1393 AC_PROG_INSTALL
1394 AC_PROG_RANLIB
1395 AC_PROG_LN_S
1396 AC_PATH_PROG(SH, sh, /bin/sh)
1397 AC_PATH_PROG(FALSE, false, /usr/bin/false)
1398 AC_PATH_PROG(TRUE, true, /usr/bin/true)
1399 AC_PATH_PROG(RM, rm, $FALSE)
1400 AC_PATH_PROG(MV, mv, $FALSE)
1401 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
1402 AC_PATH_PROG(LN, ln, cp)
1403 AC_PATH_PROG(PERL, perl, none)
1404 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
1405 AC_PATH_PROG(AR, ar, $FALSE)
1406
1407 if test "$ac_cv_path_PERL" = "none"; then
1408 echo "Perl is required to compile Squid"
1409 echo "Please install Perl and then re-run configure"
1410 exit 1
1411 fi
1412
1413 case "$host" in
1414 *-hp-hpux*)
1415 echo "Disabling 'ranlib' for HP-UX..."
1416 RANLIB=":"
1417 ;;
1418 esac
1419
1420 dnl set $(AR)
1421 AR_R="$AR r"
1422 case "$host" in
1423 *-next-nextstep3)
1424 AR="libtool -o"
1425 ;;
1426 esac
1427 AC_SUBST(AR_R)
1428
1429 dnl Check for headers
1430 AC_HEADER_DIRENT
1431 AC_HEADER_STDC
1432
1433 AC_CHECK_HEADERS( \
1434 arpa/inet.h \
1435 arpa/nameser.h \
1436 assert.h \
1437 bstring.h \
1438 crypt.h \
1439 ctype.h \
1440 errno.h \
1441 execinfo.h \
1442 fcntl.h \
1443 getopt.h \
1444 gnumalloc.h \
1445 grp.h \
1446 ip_compat.h \
1447 ip_fil_compat.h \
1448 ip_fil.h \
1449 ip_nat.h \
1450 libc.h \
1451 limits.h \
1452 malloc.h \
1453 math.h \
1454 memory.h \
1455 mount.h \
1456 net/pfvar.h \
1457 netdb.h \
1458 netinet/in.h \
1459 netinet/tcp.h \
1460 netinet/ip_fil_compat.h \
1461 openssl/err.h \
1462 openssl/md5.h \
1463 openssl/ssl.h \
1464 openssl/engine.h \
1465 poll.h \
1466 pwd.h \
1467 regex.h \
1468 sched.h \
1469 signal.h \
1470 stdarg.h \
1471 stddef.h \
1472 stdio.h \
1473 stdlib.h \
1474 string.h \
1475 strings.h \
1476 sys/bitypes.h \
1477 sys/file.h \
1478 sys/ioctl.h \
1479 sys/param.h \
1480 sys/msg.h \
1481 sys/resource.h \
1482 sys/select.h\
1483 sys/socket.h \
1484 sys/stat.h \
1485 sys/statvfs.h \
1486 syscall.h \
1487 sys/syscall.h \
1488 sys/time.h \
1489 sys/types.h \
1490 sys/un.h \
1491 sys/vfs.h \
1492 sys/wait.h \
1493 syslog.h \
1494 time.h \
1495 unistd.h \
1496 utime.h \
1497 varargs.h \
1498 byteswap.h \
1499 glib.h \
1500 stdint.h \
1501 inttypes.h \
1502 grp.h \
1503 nss_common.h \
1504 nss.h
1505 )
1506
1507 AC_CHECK_HEADERS(linux/netfilter_ipv4.h,,,
1508 SQUID_DEFAULT_INCLUDES
1509 #if HAVE_LIMITS_H
1510 #include <limits.h>
1511 #endif
1512 )
1513
1514 AC_CHECK_HEADERS(net/if.h \
1515 netinet/if_ether.h\
1516 netinet/ip_compat.h\
1517 netinet/ip_fil.h\
1518 netinet/ip_nat.h\
1519 sys/mount.h\
1520 resolv.h,,,SQUID_BSDNET_INCLUDES)
1521
1522 AC_C_CONST
1523 AC_C_BIGENDIAN
1524
1525 AC_CACHE_CHECK(if ANSI prototypes work,ac_cv_have_ansi_prototypes, [
1526 AC_TRY_COMPILE([int foo(char *); int foo (char *bar) {return 1;}],
1527 [foo("bar")],
1528 ac_cv_have_ansi_prototypes="yes",
1529 ac_cv_have_ansi_prototypes="no")
1530 ])
1531 if test $ac_cv_have_ansi_prototypes = "yes" ; then
1532 AC_DEFINE(HAVE_ANSI_PROTOTYPES,1,[Define if your compiler supports prototyping])
1533 fi
1534
1535 AC_STRUCT_TM
1536 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
1537 #if TM_IN_SYS_TIME
1538 #if HAVE_SYS_TIME_H
1539 #include <sys/time.h>
1540 #endif
1541 #elif HAVE_TIME_H
1542 #include <time.h>
1543 #endif
1544 ])
1545
1546 AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
1547 #if HAVE_SYS_TYPES_H
1548 #include <sys/types.h>
1549 #endif
1550 #if HAVE_MALLOC_H
1551 #include <malloc.h>
1552 #endif])
1553
1554 AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
1555 #if HAVE_SYS_TYPES_H
1556 #include <sys/types.h>
1557 #endif
1558 #if HAVE_MALLOC_H
1559 #include <malloc.h>
1560 #endif])
1561
1562 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
1563 #if HAVE_SYS_TIME_H
1564 #include <sys/time.h>
1565 #endif
1566 #if HAVE_SYS_RESOURCE_H
1567 #include <sys/resource.h>
1568 #endif])
1569
1570 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
1571 #if HAVE_SYS_TYPES_H
1572 #include <sys/types.h>
1573 #endif
1574 #include <netinet/in.h>
1575 #include <netinet/in_systm.h>
1576 #include <netinet/ip.h>
1577 #if defined (__linux__) || defined (__CYGWIN__)
1578 #define ip_hl ihl
1579 #endif
1580 #ifndef __linux__
1581 #ifndef __CYGWIN__
1582 #define iphdr ip
1583 #endif
1584 #endif])
1585
1586 dnl Check for typedefs
1587 AC_CHECK_SIZEOF(void *)
1588
1589 dnl 16 bit integers - int16_t and u_int16_t
1590 dnl if this is defined we trust it to be 16 bits
1591 AC_CHECK_TYPE(int16_t,
1592 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers]),
1593 ,SQUID_DEFAULT_INCLUDES)
1594
1595 dnl fallback #1
1596 AC_CHECK_TYPE(short,[
1597 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1598 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
1599 ],,SQUID_DEFAULT_INCLUDES)
1600
1601 dnl fallback #2
1602 AC_CHECK_TYPE(int,[
1603 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1604 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
1605 ],,SQUID_DEFAULT_INCLUDES)
1606
1607 dnl unsigned 16 bit ints - u_int16_t
1608 dnl if this is defined we trust it to be 16 bits
1609 AC_CHECK_TYPE(u_int16_t,
1610 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers]),
1611 ,SQUID_DEFAULT_INCLUDES)
1612
1613 dnl fallback #1
1614 dnl if this is defined we trust it to be 16 bits
1615 AC_CHECK_TYPE(uint16_t,
1616 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers]),
1617 ,SQUID_DEFAULT_INCLUDES)
1618
1619 dnl 32 bit signed int - int32_t
1620 dnl if this is defined we trust it to be 32 bits
1621 AC_CHECK_TYPE(int32_t,
1622 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers]),
1623 ,SQUID_DEFAULT_INCLUDES)
1624
1625 dnl fallback #1
1626 AC_CHECK_TYPE(long,[
1627 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1628 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
1629 ],,SQUID_DEFAULT_INCLUDES)
1630
1631 dnl 32 bit unsigned int - u_int32_t
1632 dnl if this is defined we trust it to be 32 bits
1633 AC_CHECK_TYPE(u_int32_t,
1634 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers]),
1635 ,SQUID_DEFAULT_INCLUDES)
1636
1637 dnl fallback #1
1638 dnl if this is defined we trust it to be 32 bits
1639 AC_CHECK_TYPE(uint32_t,
1640 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers]),
1641 ,SQUID_DEFAULT_INCLUDES)
1642
1643 dnl 64 bit signed - int64_t
1644 dnl if this is defind we trust it to be 64 bits
1645 AC_CHECK_TYPE(int64_t,
1646 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers]),
1647 ,SQUID_DEFAULT_INCLUDES)
1648
1649 dnl fallback #1
1650 dnl if this is defind we trust it to be 64 bits
1651 AC_CHECK_TYPE(__int64,
1652 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers]),
1653 ,SQUID_DEFAULT_INCLUDES)
1654
1655 dnl fallback #2
1656 AC_CHECK_TYPE(long long,[
1657 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1658 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
1659 ],,SQUID_DEFAULT_INCLUDES)
1660
1661 dnl 64 bit unsigned - u_int64_t
1662 dnl if this is defind we trust it to be 64 bits
1663 AC_CHECK_TYPE(u_int64_t,
1664 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers]),
1665 ,SQUID_DEFAULT_INCLUDES)
1666
1667 dnl fallback #1
1668 dnl if this is defind we trust it to be 64 bits
1669 AC_CHECK_TYPE(uint64_t,
1670 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers]),
1671 ,SQUID_DEFAULT_INCLUDES)
1672
1673 AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1674 AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1675 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1676 AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1677 AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
1678 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
1679 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1680 AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
1681
1682 dnl Check for special functions
1683 AC_FUNC_ALLOCA
1684
1685 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
1686 #include <sys/types.h>
1687 #include <sys/socket.h>
1688 #if STDC_HEADERS
1689 #include <stdlib.h>
1690 #include <stddef.h>
1691 #endif])
1692
1693 AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
1694 #include <sys/ipc.h>
1695 #include <sys/msg.h>])
1696
1697 dnl Check for needed libraries
1698 AC_CHECK_LIB(nsl, main)
1699 AC_CHECK_LIB(socket, main)
1700
1701 dnl Ripped from the Samba sources
1702 AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
1703 AC_TRY_COMPILE([
1704 #include <sys/types.h>
1705 #include <stdlib.h>
1706 #include <stddef.h>
1707 #include <sys/socket.h>
1708 #include <sys/un.h>],
1709 [
1710 struct sockaddr_un sunaddr;
1711 sunaddr.sun_family = AF_UNIX;
1712 ],
1713 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
1714 if test x"$squid_cv_unixsocket" = x"yes"; then
1715 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
1716 fi
1717 dnl end rip
1718
1719 if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
1720 echo "skipping libmalloc check (--enable-dlmalloc specified)"
1721 else
1722 AC_CHECK_LIB(gnumalloc, main)
1723 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
1724 echo "Disabling extended malloc functions when using gnumalloc"
1725 ac_cv_func_mallinfo=no
1726 ac_cv_func_mallocblksize=no
1727 ac_cv_func_mallopt=no
1728 else
1729 case "$host" in
1730 *-sun-solaris*)
1731 echo "skipping libmalloc check for $host"
1732 ;;
1733 i386-*-freebsd*)
1734 echo "skipping libmalloc check for $host"
1735 ;;
1736 *)
1737
1738 AC_CHECK_LIB(malloc, main)
1739 ;;
1740 esac
1741 fi
1742 fi
1743
1744 AC_CHECK_LIB(bsd, main)
1745 AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
1746 AC_CHECK_LIB(bind, gethostbyname)
1747 if test $ac_cv_lib_bind_gethostbyname = "no" ; then
1748 case "$host" in
1749 i386-*-freebsd*)
1750 echo "skipping libresolv checks for $host"
1751 ;;
1752 *)
1753 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
1754 AC_CHECK_LIB(resolv, main)
1755 ;;
1756 esac
1757 fi
1758 AC_CHECK_LIB(m, main)
1759
1760 dnl Check for libcrypt
1761 dnl Some of our helpers use crypt(3) which may be in libc, or in
1762 dnl libcrypt (eg FreeBSD)
1763 AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
1764 AC_SUBST(CRYPTLIB)
1765
1766 dnl Check for libdl, used by auth_modules/PAM
1767 if test "$with_dl" = "yes"; then
1768 AC_CHECK_LIB(dl, dlopen)
1769 fi
1770
1771 dnl Check for pthreads
1772 dnl We use pthreads when doing ASYNC I/O
1773 if test "$with_pthreads" = "yes"; then
1774 CFLAGS="$CFLAGS -D_REENTRANT"
1775 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
1776 case "$host" in
1777 i386-unknown-freebsd*)
1778 if test "$GCC" = "yes" ; then
1779 if test -z "$PRESET_LDFLAGS"; then
1780 LDFLAGS="$LDFLAGS -pthread"
1781 fi
1782 fi
1783 ;;
1784 *-solaris2.*)
1785 if test "$GCC" = "yes" ; then
1786 CFLAGS="$CFLAGS -pthreads"
1787 CXXFLAGS="$CXXFLAGS -pthreads"
1788 else
1789 CFLAGS="$CFLAGS -mt"
1790 CXXFLAGS="$CXXFLAGS -mt"
1791 fi
1792 ;;
1793 esac
1794 AC_CHECK_LIB(pthread, main)
1795 fi
1796
1797 dnl Check for librt
1798 dnl We use AIO in the coss store
1799 if test "$with_aio" = "yes"; then
1800 AC_CHECK_LIB(rt, aio_read)
1801 fi
1802
1803 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
1804 dnl Robert Side <rside@aiinc.bc.ca>
1805 dnl Mon, 18 Jan 1999 17:48:00 GMT
1806 case "$host" in
1807 *-pc-sco3.2*)
1808 AC_CHECK_LIB(intl, strftime)
1809 ;;
1810 esac
1811
1812 dnl System-specific library modifications
1813 dnl
1814 case "$host" in
1815 i386-*-solaris2.*)
1816 if test "$GCC" = "yes"; then
1817 echo "Removing -O for gcc on $host"
1818 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1819 fi
1820 ;;
1821 *-sgi-irix*)
1822 echo "Removing -lsocket for IRIX..."
1823 LIBS=`echo $LIBS | sed -e s/-lsocket//`
1824 echo "Removing -lnsl for IRIX..."
1825 LIBS=`echo $LIBS | sed -e s/-lnsl//`
1826 ac_cv_lib_nsl_main=no
1827 echo "Removing -lbsd for IRIX..."
1828 LIBS=`echo $LIBS | sed -e s/-lbsd//`
1829 ;;
1830 dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
1831 dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
1832 dnl Please change your configure script. AIX doesn't need -lbsd.
1833 *-ibm-aix*)
1834 echo "Removing -lbsd for AIX..."
1835 LIBS=`echo $LIBS | sed -e s/-lbsd//`
1836 case "$host" in
1837 dnl From: mlaster@metavillage.com (Mike Laster)
1838 dnl AIX 4.1.4.x does not have header files for snprintf/vsnprintf
1839 dnl So using the internal versions generates a load of warnings
1840 dnl during compile.
1841 *-ibm-aix4*)
1842 echo "disabling snprintf/vsnprintf for $host"
1843 ac_cv_func_snprintf=no
1844 ac_cv_func_vsnprintf=no
1845 ;;
1846 esac
1847 ;;
1848 *m88k*)
1849 CFLAGS="$CFLAGS -D_SQUID_MOTOROLA_"
1850 CXXFLAGS="$CXXFLAGS -D_SQUID_MOTOROLA_"
1851 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
1852 ;;
1853 [*-*-solaris2.[0-4]])
1854 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
1855 ;;
1856 [*-sony-newsos[56]*])
1857 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
1858 ;;
1859 esac
1860
1861 # Remove optimization for GCC 2.95.[123]
1862 # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
1863 if test "$GCC" = "yes"; then
1864 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
1865 case "$GCCVER" in
1866 [2.95.[123]])
1867 echo "Removing -O for gcc on $host with GCC $GCCVER"
1868 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
1869 ;;
1870 esac
1871 fi
1872
1873 # Recommended by Balint Nagy Endre <bne@CareNet.hu>
1874 case "$host" in
1875 *-univel-sysv4.2MP)
1876 if test `uname -v` = "2.03"; then
1877 echo "disabling mallinfo for $host"
1878 ac_cv_func_mallinfo=no
1879 fi
1880 ;;
1881 esac
1882
1883 dnl This has to be before AC_CHECK_FUNCS
1884 # Disable poll() on certain platforms. Override by setting ac_cv_func_poll
1885 # when running configure.
1886 if test -z "$ac_cv_func_poll"; then
1887 case "$host" in
1888 [alpha-dec-osf3.*])
1889 # John Kay (jkay@nlanr.net) 19970818
1890 echo "disabling poll for $host..."
1891 ac_cv_func_poll='no'
1892 ;;
1893 [*-hp-hpux*.*])
1894 # Duane Wessels
1895 echo "disabling poll for $host..."
1896 ac_cv_func_poll='no'
1897 ;;
1898 [*-linux-*])
1899 # Henrik Nordstrom (hno@squid-cache.org) 19980817
1900 # poll is problematic on Linux. We disable it
1901 # by default until Linux gets it right.
1902 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
1903 if test $rev -lt 002002; then
1904 echo "disabling poll for $host < 2.2..."
1905 ac_cv_func_poll='no'
1906 fi
1907 ;;
1908 [powerpc-ibm-aix4.1.*])
1909 # Mike Laster (mlaster@metavillage.com) 19981021
1910 echo "disabling poll for $host..."
1911 ac_cv_func_poll='no'
1912 ;;
1913 [*-pc-sco3.2*])
1914 # Robert Side <rside@aiinc.bc.ca>
1915 # Mon, 18 Jan 1999 17:48:00 GMT
1916 echo "disabling poll for $host..."
1917 ac_cv_func_poll='no'
1918 ;;
1919 esac
1920 fi
1921
1922 dnl Check for library functions
1923 AC_CHECK_FUNCS(\
1924 backtrace_symbols_fd \
1925 bcopy \
1926 bswap_16 \
1927 bswap_32 \
1928 crypt \
1929 fchmod \
1930 getdtablesize \
1931 getpagesize \
1932 getpass \
1933 getrlimit \
1934 getrusage \
1935 getspnam \
1936 lrand48 \
1937 mallinfo \
1938 mallocblksize \
1939 mallopt \
1940 memcpy \
1941 memmove \
1942 memset \
1943 mkstemp \
1944 mktime \
1945 mstats \
1946 poll \
1947 pthread_attr_setschedparam \
1948 pthread_attr_setscope \
1949 pthread_setschedparam \
1950 pthread_sigmask \
1951 putenv \
1952 random \
1953 regcomp \
1954 regexec \
1955 regfree \
1956 res_init \
1957 rint \
1958 sbrk \
1959 select \
1960 seteuid \
1961 setgroups \
1962 setpgrp \
1963 setrlimit \
1964 setsid \
1965 sigaction \
1966 snprintf \
1967 socketpair \
1968 srand48 \
1969 srandom \
1970 statfs \
1971 sysconf \
1972 syslog \
1973 timegm \
1974 vsnprintf \
1975 )
1976
1977 dnl Magic which checks whether we are forcing a type of comm loop we
1978 dnl are actually going to (ab)use
1979
1980 dnl Actually do the define magic now
1981 dnl mostly ripped from squid-commloops, thanks to adrian and benno
1982
1983 if test "$ac_cv_func_poll" = "yes" ; then
1984 SELECT_TYPE="poll"
1985 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
1986 elif test "$ac_cv_func_select" = "yes" ; then
1987 SELECT_TYPE="select"
1988 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
1989 elif test "$ac_cv_func_kqueue" = "yes" ; then
1990 SELECT_TYPE="kqueue"
1991 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
1992 elif test "$ac_cv_func_epoll" = "yes" ; then
1993 SELECT_TYPE="epoll"
1994 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
1995 else
1996 echo "Eep! Can't find poll, kqueue, epoll, or select!"
1997 echo "I'll try select and hope for the best."
1998 SELECT_TYPE="select"
1999 AC_DEFINE(USE_SELECT,1)
2000 fi
2001 echo "Using ${SELECT_TYPE} for select loop."
2002
2003
2004 dnl Yay! Another Linux brokenness. Its not good enough
2005 dnl to know that setresuid() exists, because RedHat 5.0 declares
2006 dnl setresuid() but doesn't implement it.
2007 dnl
2008 AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
2009 AC_TRY_RUN([
2010 #include <stdlib.h>
2011 int main() {
2012 if(setresuid(-1,-1,-1)) {
2013 perror("setresuid:");
2014 exit(1);
2015 }
2016 exit(0);
2017 }
2018 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
2019 )
2020 if test "$ac_cv_func_setresuid" = "yes" ; then
2021 AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Its not good enough to know that setresuid() exists, because RedHat 5.0 declare setresuid() but doesn't implement it.])
2022 fi
2023
2024 AM_CONDITIONAL(NEED_OWN_SNPRINTF, false)
2025 if test "$ac_cv_func_snprintf" = "no" || test "$ac_cv_func_vsnprintf" = "no" ; then
2026 AM_CONDITIONAL(NEED_OWN_SNPRINTF, true)
2027 fi
2028
2029 dnl IP-Filter support requires ipf header files. These aren't
2030 dnl installed by default, so we need to check for them
2031 if test "$IPF_TRANSPARENT" ; then
2032 AC_MSG_CHECKING(if IP-Filter header files are installed)
2033 # hold on to your hats...
2034 if test "$ac_cv_header_ip_compat_h" = "yes" ||
2035 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
2036 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
2037 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
2038 have_ipfilter_compat_header="yes"
2039 fi
2040 if test "x$have_ipfilter_compat_header" = "xyes" &&
2041 test "$ac_cv_header_ip_fil_h" = "yes" &&
2042 test "$ac_cv_header_ip_nat_h" = "yes" ; then
2043 IPF_TRANSPARENT="yes"
2044 AC_DEFINE(IPF_TRANSPARENT, 1)
2045 elif test "$have_ipfilter_compat_header" = "yes" &&
2046 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
2047 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
2048 IPF_TRANSPARENT="yes"
2049 AC_DEFINE(IPF_TRANSPARENT, 1)
2050 else
2051 IPF_TRANSPARENT="no"
2052 AC_DEFINE(IPF_TRANSPARENT, 0)
2053 fi
2054 AC_MSG_RESULT($IPF_TRANSPARENT)
2055 fi
2056 if test "$IPF_TRANSPARENT" = "no" ; then
2057 echo "WARNING: Cannot find necessary IP-Filter header files"
2058 echo " Transparent Proxy support WILL NOT be enabled"
2059 sleep 10
2060 fi
2061
2062 dnl PF support requires a header file.
2063 if test "$PF_TRANSPARENT" ; then
2064 AC_MSG_CHECKING(if PF header file is installed)
2065 # hold on to your hats...
2066 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
2067 PF_TRANSPARENT="yes"
2068 AC_DEFINE(PF_TRANSPARENT, 1)
2069 else
2070 PF_TRANSPARENT="no"
2071 AC_DEFINE(PF_TRANSPARENT, 0)
2072 fi
2073 AC_MSG_RESULT($PF_TRANSPARENT)
2074 fi
2075 if test "$PF_TRANSPARENT" = "no" ; then
2076 echo "WARNING: Cannot find necessary PF header file"
2077 echo " Transparent Proxy support WILL NOT be enabled"
2078 sleep 10
2079 fi
2080
2081 dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
2082 dnl Shamelessly copied from above
2083 if test "$LINUX_NETFILTER" ; then
2084 AC_MSG_CHECKING(if Linux 2.4 kernel header files are installed)
2085 # hold on to your hats...
2086 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
2087 LINUX_NETFILTER="yes"
2088 AC_DEFINE(LINUX_NETFILTER, 1)
2089 else
2090 LINUX_NETFILTER="no"
2091 AC_DEFINE(LINUX_NETFILTER, 0)
2092 fi
2093 AC_MSG_RESULT($LINUX_NETFILTER)
2094 fi
2095 if test "$LINUX_NETFILTER" = "no" ; then
2096 echo "WARNING: Cannot find necessary Linux 2.4 kernel header files"
2097 echo " Linux 2.4 Transparent Proxy support WILL NOT be enabled"
2098 sleep 10
2099 fi
2100
2101 if test -z "$USE_GNUREGEX" ; then
2102 case "$host" in
2103 *-sun-solaris2.[[0-4]])
2104 USE_GNUREGEX="yes"
2105 ;;
2106 *-next-nextstep*)
2107 USE_GNUREGEX="yes"
2108 ;;
2109 esac
2110 fi
2111 AC_MSG_CHECKING(if GNUregex needs to be compiled)
2112 if test -z "$USE_GNUREGEX"; then
2113 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
2114 USE_GNUREGEX="yes"
2115 else
2116 AC_TRY_COMPILE([#include <sys/types.h>
2117 #include <regex.h>],[regex_t t; regcomp(&t,"",0);],
2118 USE_GNUREGEX="no",
2119 USE_GNUREGEX="yes")
2120 fi
2121 fi
2122 AC_MSG_RESULT($USE_GNUREGEX)
2123 if test "$USE_GNUREGEX" = "yes"; then
2124 REGEXLIB="-lregex"
2125 LIBREGEX="libregex.a"
2126 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
2127 fi
2128 AC_SUBST(REGEXLIB)
2129 AC_SUBST(LIBREGEX)
2130
2131 AC_REPLACE_FUNCS(\
2132 drand48 \
2133 tempnam \
2134 strerror \
2135 )
2136
2137 dnl Not cached since people are likely to tune this
2138 AC_MSG_CHECKING(Default FD_SETSIZE value)
2139 AC_TRY_RUN([
2140 #if HAVE_STDIO_H
2141 #include <stdio.h>
2142 #endif
2143 #if HAVE_UNISTD_H
2144 #include <unistd.h>
2145 #endif
2146 #if HAVE_SYS_TIME_H
2147 #include <sys/time.h>
2148 #endif
2149 #if HAVE_SYS_SELECT_H
2150 #include <sys/select.h>
2151 #endif
2152 #if HAVE_SYS_TYPES_H
2153 #include <sys/types.h>
2154 #endif
2155 main() {
2156 FILE *fp = fopen("conftestval", "w");
2157 fprintf (fp, "%d\n", FD_SETSIZE);
2158 exit(0);
2159 }
2160 ],
2161 DEFAULT_FD_SETSIZE=`cat conftestval`,
2162 DEFAULT_FD_SETSIZE=256,
2163 DEFAULT_FD_SETSIZE=256)
2164 AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
2165 AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
2166
2167
2168 dnl Not cached since people are likely to tune this
2169 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
2170 dnl damn! FreeBSD's pthreads breaks dup2().
2171 if test -n "$squid_filedescriptors_num" ; then
2172 SQUID_MAXFD=$squid_filedescriptors_num
2173 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
2174 else
2175 TLDFLAGS="$LDFLAGS"
2176 case $host in
2177 i386-unknown-freebsd*)
2178 if echo "$LDFLAGS" | grep -q pthread; then
2179 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
2180 fi
2181 esac
2182 AC_TRY_RUN([
2183 #include <stdio.h>
2184 #include <unistd.h>
2185 #include <sys/time.h> /* needed on FreeBSD */
2186 #include <sys/param.h>
2187 #include <sys/resource.h>
2188 main() {
2189 FILE *fp;
2190 int i,j;
2191 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
2192 /* getrlimit and sysconf returns bogous values on cygwin32.
2193 * Number of fds is virtually unlimited in cygwin (sys/param.h)
2194 * __CYGWIN32__ is deprecated.
2195 */
2196 i = NOFILE;
2197 #else
2198 #if HAVE_SETRLIMIT
2199 struct rlimit rl;
2200 #if defined(RLIMIT_NOFILE)
2201 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
2202 perror("getrlimit: RLIMIT_NOFILE");
2203 } else {
2204 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2205 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
2206 perror("setrlimit: RLIMIT_NOFILE");
2207 }
2208 }
2209 #elif defined(RLIMIT_OFILE)
2210 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
2211 perror("getrlimit: RLIMIT_OFILE");
2212 } else {
2213 rl.rlim_cur = rl.rlim_max; /* set it to the max */
2214 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
2215 perror("setrlimit: RLIMIT_OFILE");
2216 }
2217 }
2218 #endif /* RLIMIT_NOFILE */
2219 #endif /* HAVE_SETRLIMIT */
2220 /* by starting at 2^14, we will never get higher
2221 than 2^15 for SQUID_MAXFD */
2222 i = j = 1<<14;
2223 while (j) {
2224 j >>= 1;
2225 if (dup2(0, i) < 0) {
2226 i -= j;
2227 } else {
2228 close(i);
2229 i += j;
2230 }
2231 }
2232 i++;
2233 #endif /* IF !DEF CYGWIN */
2234 fp = fopen("conftestval", "w");
2235 fprintf (fp, "%d\n", i);
2236 exit(0);
2237 }
2238 ],
2239 SQUID_MAXFD=`cat conftestval`,
2240 SQUID_MAXFD=256,
2241 SQUID_MAXFD=256)
2242 AC_MSG_RESULT($SQUID_MAXFD)
2243 fi
2244 AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
2245 if test "$SQUID_MAXFD" -lt 512 ; then
2246 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
2247 echo " cache will be very busy. Please see the FAQ page"
2248 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
2249 echo " on how to increase your filedescriptor limit"
2250 sleep 10
2251 fi
2252 LDFLAGS="$TLDFLAGS"
2253
2254 dnl Not cached since people are likely to tune this
2255 AC_MSG_CHECKING(Default UDP send buffer size)
2256 AC_TRY_RUN([
2257 #include <stdlib.h>
2258 #include <stdio.h>
2259 #include <sys/types.h>
2260 #include <sys/socket.h>
2261 #include <netinet/in.h>
2262 main ()
2263 {
2264 FILE *fp;
2265 int fd,val=0,len=sizeof(int);
2266 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2267 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2268 if (val<=0) exit(1);
2269 fp = fopen("conftestval", "w");
2270 fprintf (fp, "%d\n", val);
2271 exit(0);
2272 }
2273 ],
2274 SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
2275 SQUID_DETECT_UDP_SO_SNDBUF=16384,
2276 SQUID_DETECT_UDP_SO_SNDBUF=16384)
2277 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
2278 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
2279
2280 dnl Not cached since people are likely to tune this
2281 AC_MSG_CHECKING(Default UDP receive buffer size)
2282 AC_TRY_RUN([
2283 #include <stdlib.h>
2284 #include <stdio.h>
2285 #include <sys/types.h>
2286 #include <sys/socket.h>
2287 #include <netinet/in.h>
2288 main ()
2289 {
2290 FILE *fp;
2291 int fd,val=0,len=sizeof(int);
2292 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2293 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2294 if (val <= 0) exit(1);
2295 fp = fopen("conftestval", "w");
2296 fprintf (fp, "%d\n", val);
2297 exit(0);
2298 }
2299 ],
2300 SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
2301 SQUID_DETECT_UDP_SO_RCVBUF=16384,
2302 SQUID_DETECT_UDP_SO_RCVBUF=16384)
2303 AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
2304 AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
2305
2306 dnl Not cached since people are likely to tune this
2307 AC_MSG_CHECKING(Default TCP send buffer size)
2308 AC_TRY_RUN([
2309 #include <stdlib.h>
2310 #include <stdio.h>
2311 #include <sys/types.h>
2312 #include <sys/socket.h>
2313 #include <netinet/in.h>
2314 main ()
2315 {
2316 FILE *fp;
2317 int fd,val=0,len=sizeof(int);
2318 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2319 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2320 if (val <= 0) exit(1);
2321 fp = fopen("conftestval", "w");
2322 fprintf (fp, "%d\n", val);
2323 exit(0);
2324 }
2325 ],
2326 SQUID_TCP_SO_SNDBUF=`cat conftestval`,
2327 SQUID_TCP_SO_SNDBUF=16384,
2328 SQUID_TCP_SO_SNDBUF=16384)
2329 AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2330 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
2331
2332 dnl Not cached since people are likely to tune this
2333 AC_MSG_CHECKING(Default TCP receive buffer size)
2334 AC_TRY_RUN([
2335 #include <stdlib.h>
2336 #include <stdio.h>
2337 #include <sys/types.h>
2338 #include <sys/socket.h>
2339 #include <netinet/in.h>
2340 main ()
2341 {
2342 FILE *fp;
2343 int fd,val=0,len=sizeof(int);
2344 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2345 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
2346 if (val <= 0) exit(1);
2347 fp = fopen("conftestval", "w");
2348 fprintf (fp, "%d\n", val);
2349 exit(0);
2350 }
2351 ],
2352 SQUID_TCP_SO_RCVBUF=`cat conftestval`,
2353 SQUID_TCP_SO_RCVBUF=16384,
2354 SQUID_TCP_SO_RCVBUF=16384)
2355 AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2356 AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
2357
2358 AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
2359 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
2360 ac_cv_needs_sys_errlist="no",
2361 ac_cv_needs_sys_errlist="yes")
2362 )
2363 if test "$ac_cv_needs_sys_errlist" = "yes" ; then
2364 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
2365 fi
2366
2367 dnl Not cached since people are likely to change this
2368 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
2369 AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
2370 [AC_MSG_RESULT(yes)
2371 AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
2372 AC_MSG_RESULT(no))
2373
2374 AC_MSG_CHECKING(if inet_ntoa() actually works)
2375 AC_TRY_RUN([
2376 #include <stdlib.h>
2377 #include <stdio.h>
2378 #include <sys/types.h>
2379 #include <netinet/in.h>
2380 #include <arpa/inet.h>
2381 main ()
2382 {
2383 FILE *fp;
2384 struct in_addr in;
2385 in.s_addr = inet_addr("1.2.3.4");
2386 fp = fopen("conftestval", "w");
2387 fprintf (fp, "%s\n", inet_ntoa(in));
2388 exit(0);
2389 }
2390 ],
2391 INET_NTOA_RESULT=`cat conftestval`,
2392 INET_NTOA_RESULT="broken",
2393 INET_NTOA_RESULT="broken")
2394 if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
2395 AC_MSG_RESULT("yes")
2396 else
2397 AC_MSG_RESULT("no")
2398 echo "Will use our own inet_ntoa()."
2399 AC_LIBOBJ(inet_ntoa)
2400 # echo "WARNING: This looks bad, and probably prevents Squid from working."
2401 # echo " If you're on IRIX and using GCC 2.8, you probably need"
2402 # echo " to use the IRIX C compiler instead."
2403 # sleep 10
2404 fi
2405
2406 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
2407 AC_MSG_CHECKING(for working statvfs() interface)
2408 AC_TRY_COMPILE([
2409 #include <stdlib.h>
2410 #include <stdio.h>
2411 #include <sys/types.h>
2412 #include <sys/statvfs.h>
2413 ],
2414 [
2415 struct statvfs sfs;
2416 sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
2417 sfs.f_files = sfs.f_ffree = 0;
2418 statvfs("/tmp", &sfs);
2419 ],
2420 ac_cv_func_statvfs=yes,
2421 ac_cv_func_statvfs=no)
2422 AC_MSG_RESULT($ac_cv_func_statvfs)
2423 if test "$ac_cv_func_statvfs" = "yes" ; then
2424 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
2425 fi
2426 fi
2427
2428 AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
2429 AC_TRY_COMPILE([
2430 #if HAVE_SYS_TYPES_H
2431 #include <sys/types.h>
2432 #endif
2433 #if HAVE_NETINET_IN_H
2434 #include <netinet/in.h>
2435 #endif
2436 #if HAVE_ARPA_INET_H
2437 #include <arpa/inet.h>
2438 #endif
2439 #if HAVE_ARPA_NAMESER_H
2440 #include <arpa/nameser.h>
2441 #endif
2442 #if HAVE_RESOLV_H
2443 #include <resolv.h>
2444 #endif
2445 ],
2446 [_res.nsaddr_list[[0]];],
2447 ac_cv_have_res_nsaddr_list="yes",
2448 ac_cv_have_res_nsaddr_list="no"))
2449 if test $ac_cv_have_res_nsaddr_list = "yes" ; then
2450 AC_DEFINE(HAVE_RES_NSADDR_LIST,1,[If _res structure has nsaddr_list member])
2451 fi
2452
2453 if test $ac_cv_have_res_nsaddr_list = "no" ; then
2454 AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
2455 AC_TRY_COMPILE([
2456 #if HAVE_SYS_TYPES_H
2457 #include <sys/types.h>
2458 #endif
2459 #if HAVE_NETINET_IN_H
2460 #include <netinet/in.h>
2461 #endif
2462 #if HAVE_ARPA_INET_H
2463 #include <arpa/inet.h>
2464 #endif
2465 #if HAVE_ARPA_NAMESER_H
2466 #include <arpa/nameser.h>
2467 #endif
2468 #if HAVE_RESOLV_H
2469 #include <resolv.h>
2470 #endif
2471 ],
2472 [_res.ns_list[[0]].addr;],
2473 ac_cv_have_res_ns_list="yes",
2474 ac_cv_have_res_ns_list="no"))
2475 if test $ac_cv_have_res_ns_list = "yes" ; then
2476 AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
2477 fi
2478 fi
2479
2480 dnl Need the debugging version of malloc if available
2481 XTRA_OBJS=''
2482 if test "$ac_cv_lib_malloc_main" = "yes" ; then
2483 if test -r /usr/lib/debug/malloc.o ; then
2484 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
2485 fi
2486 if test -r /usr/lib/debug/mallocmap.o ; then
2487 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
2488 fi
2489 fi
2490
2491 AC_SUBST(XTRA_OBJS)
2492
2493 if test -z "$XTRA_LIBS"; then
2494 XTRA_LIBS="$LIBS"
2495 dnl minor cleanup
2496 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
2497 LIBS=''
2498 fi
2499 AC_SUBST(XTRA_LIBS)
2500
2501 dnl Clean up after OSF/1 core dump bug
2502 rm -f core
2503
2504 AC_CONFIG_FILES([\
2505 Makefile \
2506 lib/Makefile \
2507 scripts/Makefile \
2508 scripts/RunCache \
2509 scripts/RunAccel \
2510 src/Makefile \
2511 src/fs/Makefile \
2512 src/repl/Makefile \
2513 src/auth/Makefile \
2514 contrib/Makefile \
2515 snmplib/Makefile \
2516 icons/Makefile \
2517 errors/Makefile \
2518 test-suite/Makefile \
2519 doc/Makefile \
2520 helpers/Makefile \
2521 helpers/basic_auth/Makefile \
2522 helpers/basic_auth/LDAP/Makefile \
2523 helpers/basic_auth/MSNT/Makefile \
2524 helpers/basic_auth/NCSA/Makefile \
2525 helpers/basic_auth/PAM/Makefile \
2526 helpers/basic_auth/SMB/Makefile \
2527 helpers/basic_auth/YP/Makefile \
2528 helpers/basic_auth/getpwnam/Makefile \
2529 helpers/basic_auth/multi-domain-NTLM/Makefile \
2530 helpers/basic_auth/SASL/Makefile \
2531 helpers/basic_auth/winbind/Makefile \
2532 helpers/digest_auth/Makefile \
2533 helpers/digest_auth/password/Makefile \
2534 helpers/ntlm_auth/Makefile \
2535 helpers/ntlm_auth/fakeauth/Makefile \
2536 helpers/ntlm_auth/no_check/Makefile \
2537 helpers/ntlm_auth/SMB/Makefile \
2538 helpers/ntlm_auth/SMB/smbval/Makefile \
2539 helpers/ntlm_auth/winbind/Makefile \
2540 helpers/external_acl/Makefile \
2541 helpers/external_acl/ip_user/Makefile \
2542 helpers/external_acl/ldap_group/Makefile \
2543 helpers/external_acl/unix_group/Makefile \
2544 helpers/external_acl/wbinfo_group/Makefile \
2545 helpers/external_acl/winbind_group/Makefile
2546 ])
2547
2548 AC_CONFIG_SUBDIRS(lib/libTrie)
2549
2550 AC_OUTPUT