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