]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
Dist the Digest LDAP helper
[thirdparty/squid.git] / configure.in
CommitLineData
1b3db6d9 1
2877b8a9 2dnl Configuration input file for Squid
090089c4 3dnl
983061ed 4dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
090089c4 5dnl
55013f9c 6dnl $Id: configure.in,v 1.394 2005/12/29 02:21:46 hno Exp $
090089c4 7dnl
8dnl
090089c4 9dnl
6a9f6389 10AC_INIT
856e69c5 11AC_PREREQ(2.52)
e6ccf245 12AC_CONFIG_SRCDIR([src/main.cc])
71b12d7c 13AC_CONFIG_AUX_DIR(cfgaux)
13d69257 14AM_INIT_AUTOMAKE(squid, 3.0-PRE3-CVS)
a2794549 15AM_CONFIG_HEADER(include/autoconf.h)
55013f9c 16AC_REVISION($Revision: 1.394 $)dnl
a2794549 17AC_PREFIX_DEFAULT(/usr/local/squid)
246d7ffc 18AM_MAINTAINER_MODE
a2794549 19
20dnl Set default LDFLAGS
21if test -z "$LDFLAGS"; then
22 LDFLAGS="-g"
23fi
24
25PRESET_CFLAGS="$CFLAGS"
090089c4 26
a2794549 27dnl Check for GNU cc
28AC_PROG_CC
c4b0db82 29AC_LANG_C
29b8d8d6 30AC_PROG_CXX
a2794549 31AM_PROG_CC_C_O
88d50a22 32AC_CANONICAL_HOST
645aa936 33AC_DISABLE_SHARED
34AC_PROG_LIBTOOL
f5691f9c 35AC_LTDL_DLLIB
645aa936 36AC_PROG_RANLIB
88d50a22 37
a2794549 38
26675bf4 39CRYPTLIB=''
00fa2c12 40REGEXLIB='' # -lregex
41LIBREGEX='' # libregex.a
090089c4 42
a2794549 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
7aeb8001 50 # automake automatically adds .exe when installing binaries
51 CGIEXT=""
a2794549 52fi
7aeb8001 53AC_SUBST(CGIEXT)
a2794549 54
0e6d05ef 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
df087e68 57case "$host_os" in
4b26fae9 58mingw|mingw32|cygwin|cygwin32)
a2794549 59 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
df087e68 60 ;;
61*)
a2794549 62 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
df087e68 63 ;;
64esac
df087e68 65
4b26fae9 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
790ebe36 78 MINGW_LIBS="-lmingwex"
79 AC_SUBST(MINGW_LIBS)
4b26fae9 80 ;;
81esac
82
a26bdc75 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
a26bdc75 89
f4aaf39c 90dnl Substitutions
6a9f6389 91AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
92[What default TCP port to use for HTTP listening?])
58c1507a 93AC_SUBST(CACHE_HTTP_PORT)
6a9f6389 94AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
58c1507a 95AC_SUBST(CACHE_ICP_PORT)
6a9f6389 96[What default UDP port to use for ICP listening?])
090089c4 97
6a9f6389 98AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
30a4f2a8 99
6a9f6389 100AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
090089c4 101
d96ceb8e 102dnl Check for GNU cc
103AC_PROG_CC
104
6ad85e8a 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
4c43504f 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"
dd81cb63 120 sleep 5
4c43504f 121 fi
122 ;;
123 esac
124 unset GCCVER
125 unset GCCVER2
126fi
127
30a4f2a8 128dnl Set Default CFLAGS
129if test -z "$PRESET_CFLAGS"; then
130 if test "$GCC" = "yes"; then
131 case "$host" in
97b12a5b 132 *-sun-sunos*)
30a4f2a8 133 # sunos has too many warnings for this to be useful
134 # motorola too
135 ;;
97b12a5b 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 ;;
30a4f2a8 140 *)
141 CFLAGS="$CFLAGS -Wall"
142 ;;
143 esac
81a820c6 144 else
145 case "$host" in
c415c128 146 *mips-sgi-irix6.*)
81a820c6 147 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
c415c128 148 CFLAGS="$CFLAGS -n32 -mips3 -O3 -OPT:Olimit=0:space=OFF \
58dc050d 149 -woff 1009,1014,1110,1116,1185,1188,1204,1230,1233 \
81a820c6 150 -Wl,-woff,85,-woff,84,-woff,134 \
151 -nostdinc -I/usr/include -D_BSD_SIGNALS"
152 ;;
e8f5fb18 153 alpha-dec-osf4.*)
553c24ae 154 # Mogul says DEC compilers take both -g and -O2
b6a2f15e 155 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
553c24ae 156 CFLAGS="$CFLAGS -O2"
157 ;;
81a820c6 158 *)
159 ;;
160 esac
30a4f2a8 161 fi
30a4f2a8 162fi
163
d2e3605e 164dnl set squid required flags
165if test "$GCC" = "yes"; then
166 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
495b968e 167 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
d2e3605e 168else
169 SQUID_CFLAGS=
170 SQUID_CXXFLAGS=
171fi
172AC_SUBST(SQUID_CFLAGS)
173AC_SUBST(SQUID_CXXFLAGS)
174
d7c59e37 175AC_TEST_CHECKFORHUGEOBJECTS
176SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
177
30a4f2a8 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
81a820c6 186 else
187 case "$host" in
c415c128 188 *mips-sgi-irix6.*)
81a820c6 189 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
c415c128 190 LDFLAGS="-n32 -mips3 -nostdlib -L/usr/lib32"
81a820c6 191 ;;
192 esac
30a4f2a8 193 fi
194fi
2060fa9a 195
e5f4e1b0 196dnl Enable optional modules
197AC_ARG_ENABLE(dlmalloc,
94d48591 198[ --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea],
e5f4e1b0 199[
94d48591 200 case "$enableval" in
201 'yes')
029ce4ae 202 use_dlmalloc="yes"
94d48591 203 LIBDLMALLOC="libdlmalloc.a"
204 LIB_MALLOC="-L../lib -ldlmalloc"
029ce4ae 205 echo "dlmalloc enabled"
94d48591 206 ;;
207 'no')
029ce4ae 208 use_dlmalloc="no"
209 echo "dlmalloc disabled"
94d48591 210 ;;
029ce4ae 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"
d20b1cd0 221 LIBDLMALLOC="libdlmalloc.a"
222 LIB_MALLOC="-L../lib -ldlmalloc"
029ce4ae 223 ;;
e8dbaa90 224 *-sgi-irix*)
225 echo "Enabling dlmalloc for $host"
226 use_dlmalloc="yes"
227 LIBDLMALLOC="libdlmalloc.a"
228 LIB_MALLOC="-L../lib -ldlmalloc"
229 ;;
029ce4ae 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
94d48591 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"
94d48591 267 ac_cv_func_mallopt="yes"
268 ac_cv_lib_gnumalloc="no"
85efe3ec 269 ac_cv_header_gnumalloc_h="no"
94d48591 270 ac_cv_lib_malloc="no"
271 ac_cv_enabled_dlmalloc="yes"
6a9f6389 272 AC_DEFINE(USE_DLMALLOC, 1, [Compile & use the malloc package by Doug Lea])
029ce4ae 273fi
274
e5f4e1b0 275AC_SUBST(LIBDLMALLOC)
276AC_SUBST(LIB_MALLOC)
277
278AC_ARG_ENABLE(gnuregex,
2c5d82f9 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.],
e5f4e1b0 284[USE_GNUREGEX=$enableval])
285
6c0c04db 286SquidInline="yes"
83079644 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
6c0c04db 303AC_ARG_ENABLE(inline,
304[ --disable-inline Don't compile trivial methods as inline. Squid
83079644 305 is coded with much of the code able to be inlined.
306 Inlining is good for production builds, but not
6c0c04db 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
83079644 322 echo "Inlining optimization disabled"
6c0c04db 323 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
324fi
325
fa80a8ef 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"
6a9f6389 330 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
fa80a8ef 331 fi
332])
333
0961c811 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"
6a9f6389 340dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
0961c811 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"
6a9f6389 351dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
352dnl AC_DEFINE(XMALLOC_DEBUG,1)
0961c811 353dnl fi
354dnl ])
e5f4e1b0 355
d9180414 356AC_ARG_ENABLE(xmalloc-statistics,
e5f4e1b0 357[ --enable-xmalloc-statistics
358 Show malloc statistics in status page],
359[ if test "$enableval" = "yes" ; then
360 echo "Malloc statistics enabled"
6a9f6389 361 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
e5f4e1b0 362 fi
363])
364
14b32873 365use_carp=1
323fe0d4 366AC_ARG_ENABLE(carp,
f7c8dc02 367[ --disable-carp Disable CARP support],
368[ if test "$enableval" = "no" ; then
369 echo "CARP disabled"
14b32873 370 use_carp=0
323fe0d4 371 fi
f7c8dc02 372])
14b32873 373if test $use_carp = 1; then
374 AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol])
375else
376 AC_DEFINE(USE_CARP, 1)
377fi
323fe0d4 378
cd748f27 379AC_ARG_ENABLE(async-io,
9bc73deb 380[ --enable-async-io[=N_THREADS]
cd748f27 381 Shorthand for
f85c88f3 382 --with-aufs-threads=N_THREADS
cd748f27 383 --with-pthreads
384 --enable-storeio=ufs,aufs],
385[ case $enableval in
9bc73deb 386 yes)
69144041 387 with_pthreads="yes"
cd748f27 388 STORE_MODULES="ufs aufs"
9bc73deb 389 ;;
390 no)
9bc73deb 391 ;;
392 *)
f85c88f3 393 aufs_io_threads=$enableval
69144041 394 with_pthreads="yes"
cd748f27 395 STORE_MODULES="ufs aufs"
9bc73deb 396 ;;
397 esac
398])
399
f85c88f3 400AC_ARG_WITH(aufs-threads,
401[ --with-aufs-threads=N_THREADS
cd748f27 402 Tune the number of worker threads for the aufs object
403 store.],
a3310b77 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])
f85c88f3 414if test "$aufs_io_threads"; then
415 echo "With $aufs_io_threads aufs threads"
6a9f6389 416 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
417 [Defines how many threads aufs uses for I/O])
cd748f27 418fi
419
420AC_ARG_WITH(pthreads,
8154dd82 421[ --with-pthreads Use POSIX Threads])
422if test "$with_pthreads" = "yes"; then
cd748f27 423 echo "With pthreads"
9bc73deb 424fi
e5f4e1b0 425
f85c88f3 426AC_ARG_WITH(aio,
8154dd82 427[ --with-aio Use POSIX AIO])
428if test "$with_aio" = "yes"; then
f85c88f3 429 echo "With aio"
f85c88f3 430fi
8154dd82 431
432AC_ARG_WITH(dl,
433[ --with-dl Use dynamic linking])
434if test "$with_dl" = "yes"; then
435 echo "With dl"
436fi
f85c88f3 437
cd748f27 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)
1c690e30 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"
8154dd82 451 fi
cd748f27 452 done
453 ;;
454 no)
455 ;;
1c690e30 456 *)
457 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
cd748f27 458 ;;
459 esac
460],
461[ if test -z "$STORE_MODULES"; then
462 STORE_MODULES="ufs"
463 fi
464])
1c690e30 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"
59b2d47f 475 STORE_LINKOBJS=
476 for module in $STORE_MODULES; do
477 STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
478 done
1c690e30 479fi
a2794549 480dnl remove all but diskd - its the only module that needs to recurse
481dnl into the sub directory
d3b3ab85 482UFS_FOUND=
1c690e30 483NEED_UFS=
b9ae18aa 484NEED_BLOCKING=
485NEED_DISKDAEMON=
486NEED_DISKTHREADS=
487NEED_AIO=
a2794549 488for fs in $STORE_MODULES none; do
8154dd82 489 case "$fs" in
490 diskd)
1c690e30 491 NEED_UFS="true"
b9ae18aa 492 NEED_BLOCKING="true"
493 NEED_DISKDAEMON="true"
8154dd82 494 ;;
495 aufs)
1c690e30 496 NEED_UFS="true"
b9ae18aa 497 NEED_BLOCKING="true"
498 NEED_DISKTHREADS="true"
8154dd82 499 ;;
500 coss)
b9ae18aa 501 NEED_AIO="true"
8154dd82 502 ;;
d3b3ab85 503 ufs)
504 UFS_FOUND="true"
8154dd82 505 esac
a2794549 506done
b9ae18aa 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
d3b3ab85 520
1c690e30 521if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
d3b3ab85 522 echo "adding UFS, as it contains core logic for diskd and aufs"
523 STORE_OBJS="$STORE_OBJS fs/libufs.a"
d3b3ab85 524 STORE_LIBS="$STORE_LIBS libufs.a"
d3b3ab85 525 STORE_MODULES="$STORE_MODULES ufs"
16a9d900 526 STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
d3b3ab85 527fi
528
1c690e30 529AC_SUBST(STORE_OBJS)
530AC_SUBST(STORE_LIBS)
59b2d47f 531AC_SUBST(STORE_LINKOBJS)
a2794549 532
b9ae18aa 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
d9180414 642AC_ARG_ENABLE(removal-policies,
6a566b9c 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)
1c690e30 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"
6a566b9c 655 fi
656 done
657 ;;
658 no)
659 ;;
1c690e30 660 *)
661 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
6a566b9c 662 ;;
663 esac
664],
665[ if test -z "$REPL_POLICIES"; then
666 REPL_POLICIES="lru"
667 fi
668])
1c690e30 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
6a566b9c 682AC_SUBST(REPL_POLICIES)
6a566b9c 683AC_SUBST(REPL_OBJS)
f71946fc 684AC_SUBST(REPL_LIBS)
6a566b9c 685
d1da2d1f 686AM_CONDITIONAL(ENABLE_PINGER, false)
e5f4e1b0 687AC_ARG_ENABLE(icmp,
688[ --enable-icmp Enable ICMP pinging],
689[ if test "$enableval" = "yes" ; then
690 echo "ICMP enabled"
6a9f6389 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.])
d1da2d1f 700 AM_CONDITIONAL(ENABLE_PINGER, true)
e5f4e1b0 701 fi
702])
703
a2794549 704AM_CONDITIONAL(USE_DELAY_POOLS, false)
d9180414 705AC_ARG_ENABLE(delay-pools,
76d83c52 706[ --enable-delay-pools Enable delay pools to limit bandwidth usage],
e5f4e1b0 707[ if test "$enableval" = "yes" ; then
95e36d02 708 echo "Delay pools enabled"
6a9f6389 709 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
710 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
e5f4e1b0 711 fi
712])
713
43ae1d95 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)
964b44c3 722 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
a787b56a 723else
724 AC_DEFINE(ESI,0,[Compile the ESI processor and Surrogate header support])
43ae1d95 725fi
726
51952383 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
0961c811 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"
6a9f6389 745dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
0961c811 746dnl fi
747dnl ])
36a97e19 748
d9180414 749AC_ARG_ENABLE(useragent-log,
e5f4e1b0 750[ --enable-useragent-log Enable logging of User-Agent header],
751[ if test "$enableval" = "yes" ; then
752 echo "User-Agent logging enabled"
6a9f6389 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.])
e5f4e1b0 756 fi
757])
758
dfca7e1a 759AC_ARG_ENABLE(referer-log,
0961c811 760[ --enable-referer-log Enable logging of Referer header],
dfca7e1a 761[ if test "$enableval" = "yes" ; then
762 echo "Referer logging enabled"
6a9f6389 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.])
dfca7e1a 766 fi
767])
768
14b32873 769use_wccp=1
320e9f36 770AC_ARG_ENABLE(wccp,
0961c811 771[ --disable-wccp Disable Web Cache Coordination Protocol],
eb824054 772[ if test "$enableval" = "no" ; then
773 echo "Web Cache Coordination Protocol disabled"
14b32873 774 use_wccp=0
320e9f36 775 fi
776])
14b32873 777if test $use_wccp = 1; then
778 AC_DEFINE(USE_WCCP, 1,[Define to enable WCCP])
779else
780 AC_DEFINE(USE_WCCP, 0)
781fi
320e9f36 782
d9180414 783AC_ARG_ENABLE(kill-parent-hack,
9fc0b4b8 784[ --enable-kill-parent-hack
785 Kill parent on shutdown],
e5f4e1b0 786[ if test "$enableval" = "yes" ; then
787 echo "Kill parent on shutdown"
6a9f6389 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.])
e5f4e1b0 791 fi
792])
793
a2794549 794AM_CONDITIONAL(USE_SNMP, false)
e5f4e1b0 795AC_ARG_ENABLE(snmp,
796[ --enable-snmp Enable SNMP monitoring],
797[ if test "$enableval" = "yes" ; then
798 echo "SNMP monitoring enabled"
6a9f6389 799 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
e5f4e1b0 800 SNMPLIB='-L../snmplib -lsnmp'
a2794549 801 AM_CONDITIONAL(USE_SNMP, true)
8a7f0105 802 SNMP_MAKEFILE=./snmplib/Makefile
e5f4e1b0 803 makesnmplib=snmplib
804 fi
805])
806AC_SUBST(SNMPLIB)
e5f4e1b0 807AC_SUBST(makesnmplib)
808
d9180414 809AC_ARG_ENABLE(cachemgr-hostname,
e5f4e1b0 810[ --enable-cachemgr-hostname[=hostname]
811 Make cachemgr.cgi default to this host],
812[ case $enableval in
813 yes)
6a9f6389 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()])
e5f4e1b0 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
b0dd28ba 828AM_CONDITIONAL(ENABLE_ARP_ACL, false)
d9180414 829AC_ARG_ENABLE(arp-acl,
e5f4e1b0 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)"
933cc58d 833 case "$host" in
ef614b1c 834 *-linux-*)
835 ;;
9d8d033e 836 *-solaris*)
a931a29b 837 ;;
9a2f1170 838 *-freebsd*)
839 ;;
5700029a 840 *-cygwin*)
841 LIBS="$LIBS -liphlpapi"
842 ;;
843 *-mingw*)
844 LIBS="$LIBS -liphlpapi"
845 ;;
933cc58d 846 *)
ef614b1c 847 echo "WARNING: ARP ACL support probably won't work on $host."
933cc58d 848 sleep 10
849 ;;
850 esac
6a9f6389 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, ?).])
b0dd28ba 852 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
e5f4e1b0 853 fi
854])
855
a2794549 856AM_CONDITIONAL(ENABLE_HTCP, false)
74075210 857AC_ARG_ENABLE(htcp,
88b7de25 858[ --enable-htcp Enable HTCP protocol],
b4b8b6da 859[ if test "$enableval" = "yes" ; then
860 echo "HTCP enabled"
6a9f6389 861 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
a2794549 862 AM_CONDITIONAL(ENABLE_HTCP, true)
b4b8b6da 863 fi
74075210 864])
a2794549 865
866AM_CONDITIONAL(ENABLE_SSL, false)
74075210 867
1f7c9178 868AC_ARG_ENABLE(ssl,
869[ --enable-ssl Enable ssl gatewaying support using OpenSSL],
870[ if test "$enableval" != "no"; then
3dff197f 871 echo "SSL gatewaying using OpenSSL enabled"
6a9f6389 872 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
a2794549 873 AM_CONDITIONAL(ENABLE_SSL, true)
4b26fae9 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
1f7c9178 883 USE_OPENSSL=1
884 fi
885])
886
3dff197f 887AM_CONDITIONAL(NEED_OWN_MD5, true)
888
1f7c9178 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[
46ce628c 896 case "$with_openssl" in
1f7c9178 897 yes)
898 USE_OPENSSL=1
899 ;;
900 no)
901 USE_OPENSSL=
902 ;;
903 *)
46ce628c 904 SSLLIBDIR="$with_openssl/lib"
bcce53ce 905 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1f7c9178 906 USE_OPENSSL=1
907 esac
908])
909
910if test -n "$USE_OPENSSL"; then
3dff197f 911 echo "Using OpenSSL MD5 implementation"
6a9f6389 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)])
3dff197f 913 AM_CONDITIONAL(NEED_OWN_MD5, false)
1f7c9178 914 if test -z "$SSLLIB"; then
915 SSLLIB="-lcrypto" # for MD5 routines
916 fi
f11555e0 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
1f7c9178 923fi
924if test -n "$SSLLIBDIR"; then
925 SSLLIB="-L$SSLLIBDIR $SSLLIB"
926fi
1f7c9178 927AC_SUBST(SSLLIB)
928
02749868 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"
6a9f6389 933 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
02749868 934 fi
935])
936
6cfa8966 937AC_ARG_ENABLE(cache-digests,
22df58ea 938[ --enable-cache-digests Use Cache Digests
2b6662ba 939 see http://www.squid-cache.org/FAQ/FAQ-16.html],
484f2ebc 940[ if test "$enableval" = "yes" ; then
6cfa8966 941 echo "USE_CACHE_DIGESTS enabled"
6a9f6389 942 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
484f2ebc 943 fi
944])
945
8c3926c5 946dnl Select Default Error language
947AC_ARG_ENABLE(default-err-language,
948[ --enable-default-err-language=lang
0961c811 949 Select default language for Error pages (see
950 errors directory) ],
933cc58d 951[
cf9d704a 952 if test -d $srcdir/errors/$enableval; then
8c3926c5 953 ERR_DEFAULT_LANGUAGE=$enableval
933cc58d 954 else
0961c811 955 echo "ERROR! Unknown language $enableval, see errors/ directory"
933cc58d 956 exit 1
957 fi
8c3926c5 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..\"
0961c811 964 Select languages to be installed. (All will be
965 installed by default) ],
8c3926c5 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
cbbe101f 977 if test -f $l/ERR_ACCESS_DENIED; then
8c3926c5 978 ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
979 fi
980 done
981])
982AC_SUBST(ERR_LANGUAGES)
933cc58d 983
cd748f27 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"
6a9f6389 989 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
cd748f27 990 fi
991])
992
1b3db6d9 993dnl check for netio plugin stuff
9bb83c8b 994dnl Enable poll()
995AC_ARG_ENABLE(poll,
0961c811 996[ --enable-poll Enable poll() support.
997 --disable-poll Disable poll() support. ],
1b3db6d9 998
999[
c68e9c6b 1000 case "$enableval" in
1001 yes)
9bb83c8b 1002 echo "Forcing poll() to be enabled"
1003 ac_cv_func_poll='yes'
c68e9c6b 1004 ;;
1005 no)
1006 echo "Forcing poll() to be disabled"
1007 ac_cv_func_poll='no'
1008 ;;
1009 esac
9bb83c8b 1010])
1011
1b3db6d9 1012dnl Enable select()
1013AC_ARG_ENABLE(select,
0961c811 1014[ --enable-select Enable select() support.
1015 --disable-select Disable select() support. ],
1b3db6d9 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,
0961c811 1032[ --enable-kqueue Enable kqueue() support.
1033 --disable-kqueue Disable kqueue() support. ],
1b3db6d9 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
a46d2c0e 1048dnl Enable epoll()
a46d2c0e 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'
a46d2c0e 1058 ;;
1059 no)
1060 echo "Forcing epoll() to be disabled"
1061 ac_cv_func_epoll='no'
1062 ;;
1063esac
1064])
1065
1066
72fd085a 1067dnl Disable HTTP violations
14b32873 1068http_violations=1
72fd085a 1069AC_ARG_ENABLE(http-violations,
1070[ --disable-http-violations
1071 This allows you to remove code which is known to
c68e9c6b 1072 violate the HTTP protocol specification.],
72fd085a 1073[ if test "$enableval" = "no" ; then
1074 echo "Disabling HTTP Violations"
14b32873 1075 http_violations=0
72fd085a 1076 fi
1077])
14b32873 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
72fd085a 1083
5cafc1d6 1084dnl Enable IP-Filter Transparent Proxy
1085AC_ARG_ENABLE(ipf-transparent,
1086[ --enable-ipf-transparent
1087 Enable Transparent Proxy support for systems
c68e9c6b 1088 using IP-Filter network address redirection.],
5cafc1d6 1089[ if test "$enableval" = "yes" ; then
1090 echo "IP-Filter Transparent Proxy enabled"
6a9f6389 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.])
5cafc1d6 1092 IPF_TRANSPARENT="yes"
1093 fi
1094])
1095
2b0dd4ac 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"
6a9f6389 1103 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
2b0dd4ac 1104 PF_TRANSPARENT="yes"
1105 fi
1106])
1107
d6d62546 1108dnl Enable Linux Netfilter Transparent Proxy
d852fbad 1109AC_ARG_ENABLE(linux-netfilter,
1110[ --enable-linux-netfilter
d6d62546 1111 Enable Transparent Proxy support for Linux (Netfilter) systems.],
d852fbad 1112[ if test "$enableval" = "yes" ; then
d6d62546 1113 echo "Linux (Netfilter) Transparent Proxy enabled"
1114 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
d852fbad 1115 LINUX_NETFILTER="yes"
1116 fi
1117])
1118
bb7b5fd0 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"
fa035612 1125 SQUID_CFLAGS="$SQUID_CFLAGS -D_FILE_OFFSET_BITS=64"
1126 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_FILE_OFFSET_BITS=64"
bb7b5fd0 1127 fi
1128])
1129
a2794549 1130AM_CONDITIONAL(MAKE_LEAKFINDER, false)
5d620373 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"
6a9f6389 1140 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
5d620373 1141 USE_LEAKFINDER="yes"
a2794549 1142 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
5d620373 1143 fi
1144])
5d620373 1145
14b32873 1146use_ident=1
3898f57f 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"
14b32873 1153 use_ident=0
3898f57f 1154 fi
1155])
14b32873 1156if test $use_ident = 1; then
1157 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
8000a965 1158 AM_CONDITIONAL(ENABLE_IDENT, true)
14b32873 1159else
1160 AC_DEFINE(USE_IDENT, 0)
8000a965 1161 AM_CONDITIONAL(ENABLE_IDENT, false)
14b32873 1162fi
3898f57f 1163
a2794549 1164AM_CONDITIONAL(USE_DNSSERVER, false)
3c573763 1165use_dnsserver=
eb824054 1166AC_ARG_ENABLE(internal-dns,
7e3ce7b9 1167[ --disable-internal-dns This prevents Squid from directly sending and
eb824054 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"
3c573763 1172 use_dnsserver="yes"
eb824054 1173 fi
1174])
3c573763 1175if test "$use_dnsserver" = "yes"; then
6a9f6389 1176 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
a2794549 1177 AM_CONDITIONAL(USE_DNSSERVER, true)
3c573763 1178fi
eb824054 1179
1180AC_ARG_ENABLE(truncate,
7e3ce7b9 1181[ --enable-truncate This uses truncate() instead of unlink() when
eb824054 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"
6a9f6389 1188 AC_DEFINE(USE_TRUNCATE,1,[Do we want to use truncate(2) or unlink(2)?])
eb824054 1189 fi
1190])
1191
4fa7a4ba 1192dnl Disable hostname checks
338b5499 1193AC_ARG_ENABLE(hostname-checks,
8fca0346 1194[ --enable-hostname-checks
1195 Tells Squid to rejects any host names with
4fa7a4ba 1196 odd characters in their name to conform with
8fca0346 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
801d5137 1201 echo "Enabling hostname sanity checks"
338b5499 1202 AC_DEFINE(CHECK_HOSTNAMES, 1, [Enable hostname sanity checks])
4fa7a4ba 1203 fi
1204])
4fa7a4ba 1205
9bc73deb 1206dnl Enable underscore in hostnames
1207AC_ARG_ENABLE(underscores,
1208[ --enable-underscores Squid by default rejects any host names with _
76d83c52 1209 in their name to conform with internet standards.
9bc73deb 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"
6a9f6389 1216 AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1,[Allow underscores in host names])
9bc73deb 1217 fi
1218])
1219
9d798391 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
94439e4e 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)
1c42c4a1 1251 for dir in $srcdir/src/auth/*; do
1252 module="`basename $dir`"
1c690e30 1253 if test -d "$dir" && test "$module" != CVS; then
1c42c4a1 1254 AUTH_MODULES="$AUTH_MODULES $module"
94439e4e 1255 fi
1256 done
1257 ;;
1258 no)
1259 ;;
1c690e30 1260 *)
1261 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1262 ;;
94439e4e 1263 esac
1264],
1265[ if test -z "$AUTH_MODULES"; then
6bf4f823 1266 AUTH_MODULES="ntlm basic digest negotiate"
94439e4e 1267 fi
1268])
1c690e30 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
f5691f9c 1282AUTH_LINKOBJS=
1283for module in $AUTH_MODULES; do
1284 AUTH_LINKOBJS="$AUTH_LINKOBJS auth/${module}/${module}Scheme.o"
1285done
94439e4e 1286AC_SUBST(AUTH_MODULES)
94439e4e 1287AC_SUBST(AUTH_LIBS)
f5691f9c 1288AC_SUBST(AUTH_LINKOBJS)
1289AC_SUBST(AUTH_OBJS)
94439e4e 1290
1291dnl Select basic auth scheme helpers to build
1292BASIC_AUTH_HELPERS=""
94439e4e 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
0c510f3c 1298 helpers see the helpers/basic_auth directory.],
94439e4e 1299[ case "$enableval" in
1300 yes)
1c690e30 1301 for dir in $srcdir/helpers/basic_auth/*; do
1302 helper="`basename $dir`"
3c02c9ae 1303 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1c690e30 1304 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1305 fi
1306 done
1307 ;;
94439e4e 1308 no)
1c690e30 1309 ;;
94439e4e 1310 *)
1c690e30 1311 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1312 ;;
94439e4e 1313 esac
1314])
fc83a946 1315if test -n "$BASIC_AUTH_HELPERS"; then
20d8bfe4 1316 for helper in $BASIC_AUTH_HELPERS; do
1c690e30 1317 if test -d $srcdir/helpers/basic_auth/$helper; then
2adff954 1318 case $helper in
1319 SASL)
1320 require_sasl=yes
1321 ;;
1322 esac
20d8bfe4 1323 else
1c690e30 1324 echo "ERROR: Basic auth helper $helper does not exists"
1325 exit 1
20d8bfe4 1326 fi
1327 done
fc83a946 1328 echo "Basic auth helpers built: $BASIC_AUTH_HELPERS"
94439e4e 1329fi
fc83a946 1330AC_SUBST(BASIC_AUTH_HELPERS)
94439e4e 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
0c510f3c 1338 process. For a list of available helpers see
1339 the helpers/ntlm_auth directory.],
380f0a87 1340[ case "$enableval" in
1341 yes)
1c690e30 1342 for dir in $srcdir/helpers/ntlm_auth/*; do
1343 helper="`basename $dir`"
3c02c9ae 1344 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1c690e30 1345 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1346 fi
1347 done
1348 ;;
380f0a87 1349 no)
1c690e30 1350 ;;
380f0a87 1351 *)
1c690e30 1352 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1353 ;;
380f0a87 1354 esac
1355])
94439e4e 1356if test -n "$NTLM_AUTH_HELPERS"; then
20d8bfe4 1357 for helper in $NTLM_AUTH_HELPERS; do
1c690e30 1358 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1359 :
20d8bfe4 1360 else
1c690e30 1361 echo "ERROR: NTLM Auth helper $helper does not exists"
1362 exit 1
20d8bfe4 1363 fi
1364 done
94439e4e 1365 echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS"
380f0a87 1366fi
94439e4e 1367AC_SUBST(NTLM_AUTH_HELPERS)
1368
6e785d85 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`"
3c02c9ae 1381 if test -f $dir/config.test && sh $dir/config.test "$@"; then
6e785d85 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
2d70df72 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
0c510f3c 1412 process. For a list of available helpers see the
1413 helpers/digest_auth directory.],
2d70df72 1414[ case "$enableval" in
1415 yes)
1c690e30 1416 for dir in $srcdir/helpers/digest_auth/*; do
1417 helper="`basename $dir`"
3c02c9ae 1418 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1c690e30 1419 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1420 fi
1421 done
1422 ;;
2d70df72 1423 no)
1c690e30 1424 ;;
2d70df72 1425 *)
1c690e30 1426 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1427 ;;
2d70df72 1428 esac
1429])
1430if test -n "$DIGEST_AUTH_HELPERS"; then
1daefc1a 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
2d70df72 1439 echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1440fi
1441AC_SUBST(DIGEST_AUTH_HELPERS)
380f0a87 1442
6437ac71 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
0961c811 1446 Authentication steps can allow squid to still authenticate
1447 the user.],
6437ac71 1448[ if test "$enableval" = "yes" ; then
6a9f6389 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.])
6437ac71 1450 fi
1451])
1452
c6588c68 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)
1c690e30 1463 for dir in $srcdir/helpers/external_acl/*; do
1464 helper="`basename $dir`"
3c02c9ae 1465 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1c690e30 1466 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1467 fi
1468 done
1469 ;;
c6588c68 1470 no)
1c690e30 1471 ;;
c6588c68 1472 *)
1c690e30 1473 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1474 ;;
c6588c68 1475 esac
1476])
1477if test -n "$EXTERNAL_ACL_HELPERS"; then
20d8bfe4 1478 for helper in $EXTERNAL_ACL_HELPERS; do
1479 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1480 :
1481 else
1daefc1a 1482 echo "ERROR: external acl helper $helper does not exists"
20d8bfe4 1483 exit 1
1484 fi
1485 done
c6588c68 1486 echo "External acl helpers built: $EXTERNAL_ACL_HELPERS"
1487fi
1488AC_SUBST(EXTERNAL_ACL_HELPERS)
1489
d96ceb8e 1490dnl Disable "memPools" code
b001e822 1491AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 1492AC_ARG_ENABLE(mempools,
b001e822 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.],
d96ceb8e 1497[ if test "$enableval" = "no" ; then
1498 echo "memPools disabled"
6a9f6389 1499 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
d96ceb8e 1500 fi
1501])
1502
0e657244 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
b1485ff8 1513
2adff954 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
3c573763 1532dnl Disable "unlinkd" code
fe0810ac 1533AC_ARG_ENABLE(unlinkd,
1534[ --disable-unlinkd Do not use unlinkd],
1535[ if test "$enableval" = "no" ; then
3c573763 1536 use_unlinkd=no
fe0810ac 1537 else
3c573763 1538 use_unlinkd=yes
fe0810ac 1539 fi
1540],[
1541 # Here we should probably use some magic depending on the selected
1542 # storage models
3c573763 1543 use_unlinkd=yes
fe0810ac 1544])
3c573763 1545if test "$use_unlinkd" = "yes"; then
fe0810ac 1546 echo "unlinkd enabled"
6a9f6389 1547 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
a2794549 1548 AM_CONDITIONAL(ENABLE_UNLINKD, true)
fe0810ac 1549else
1550 echo "unlinkd disabled"
a2794549 1551 AM_CONDITIONAL(ENABLE_UNLINKD, false)
fe0810ac 1552fi
fe0810ac 1553
ce3d30fb 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"
6a9f6389 1559 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
ce3d30fb 1560 fi
1561])
1562
88bfe092 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"
6a9f6389 1579 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
88bfe092 1580 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1581 fi
1582])
1583
f66a9ef4 1584dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1585AC_ARG_ENABLE(x_accelerator_vary,
0961c811 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.],
f66a9ef4 1592[ if test "$enableval" = "yes" ; then
1593 echo "Enabling support for X-Accelerator-Vary"
6a9f6389 1594 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
f66a9ef4 1595 fi
1596])
1597
f49be7d1 1598AC_ARG_WITH(filedescriptors,
1599[ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors],
1600[ squid_filedescriptors_num=$withval ])
1601
f5691f9c 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
fd9aaa3e 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 ;;
c68e9c6b 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 ;;
fd9aaa3e 1655esac
1656
090089c4 1657dnl Check for programs
1658AC_PROG_CPP
1659AC_PROG_INSTALL
090089c4 1660AC_PROG_LN_S
81280a96 1661AC_PATH_PROG(SH, sh, /bin/sh)
d9f67e6f 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)
090089c4 1667AC_PATH_PROG(LN, ln, cp)
4e9d8e26 1668AC_PATH_PROG(PERL, perl, none)
a2794549 1669dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
6ad85e8a 1670AC_PATH_PROG(AR, ar, $FALSE)
1671
4e9d8e26 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
6ad85e8a 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)
090089c4 1693
1694dnl Check for headers
1695AC_HEADER_DIRENT
1696AC_HEADER_STDC
db40ae20 1697
1698AC_CHECK_HEADERS( \
db40ae20 1699 arpa/inet.h \
30a4f2a8 1700 arpa/nameser.h \
9441aa34 1701 assert.h \
db40ae20 1702 bstring.h \
db40ae20 1703 crypt.h \
30a4f2a8 1704 ctype.h \
1705 errno.h \
ce3d30fb 1706 execinfo.h \
db40ae20 1707 fcntl.h \
42ad37af 1708 fnmatch.h \
9c1d8929 1709 getopt.h \
88738790 1710 gnumalloc.h \
30a4f2a8 1711 grp.h \
5cafc1d6 1712 ip_compat.h \
42b51993 1713 ip_fil_compat.h \
5cafc1d6 1714 ip_fil.h \
1715 ip_nat.h \
dbc5782a 1716 ipl.h \
30a4f2a8 1717 libc.h \
6ad85e8a 1718 limits.h \
30a4f2a8 1719 malloc.h \
e0bddc45 1720 math.h \
db40ae20 1721 memory.h \
b075cbb1 1722 mount.h \
2b0dd4ac 1723 net/pfvar.h \
30a4f2a8 1724 netdb.h \
db40ae20 1725 netinet/in.h \
30a4f2a8 1726 netinet/tcp.h \
42b51993 1727 netinet/ip_fil_compat.h \
1f7c9178 1728 openssl/err.h \
1729 openssl/md5.h \
1730 openssl/ssl.h \
a7ad6e4e 1731 openssl/engine.h \
dcfe6390 1732 poll.h \
30a4f2a8 1733 pwd.h \
1734 regex.h \
c68e9c6b 1735 sched.h \
30a4f2a8 1736 signal.h \
1737 stdarg.h \
1738 stddef.h \
1739 stdio.h \
db40ae20 1740 stdlib.h \
1741 string.h \
1742 strings.h \
0a4e8536 1743 sys/bitypes.h \
f9576890 1744 sys/bswap.h \
1745 sys/endian.h \
db40ae20 1746 sys/file.h \
5cafc1d6 1747 sys/ioctl.h \
30a4f2a8 1748 sys/param.h \
62ae0622 1749 sys/prctl.h \
77e4c0c9 1750 sys/msg.h \
30a4f2a8 1751 sys/resource.h \
db40ae20 1752 sys/select.h\
30a4f2a8 1753 sys/socket.h \
1754 sys/stat.h \
b075cbb1 1755 sys/statvfs.h \
3c641669 1756 syscall.h \
30a4f2a8 1757 sys/syscall.h \
db40ae20 1758 sys/time.h \
1759 sys/types.h \
30a4f2a8 1760 sys/un.h \
b075cbb1 1761 sys/vfs.h \
30a4f2a8 1762 sys/wait.h \
db40ae20 1763 syslog.h \
30a4f2a8 1764 time.h \
1765 unistd.h \
3c641669 1766 utime.h \
30a4f2a8 1767 varargs.h \
77d6bd88 1768 byteswap.h \
1769 glib.h \
60d096f4 1770 stdint.h \
1771 inttypes.h \
3c641669 1772 grp.h \
1773 nss_common.h \
1774 nss.h
db40ae20 1775)
1776
5a3237b0 1777AC_CHECK_HEADERS(linux/netfilter_ipv4.h,,,
dcd1dc78 1778SQUID_DEFAULT_INCLUDES
1779#if HAVE_LIMITS_H
1780#include <limits.h>
1781#endif
1782)
1783
5a3237b0 1784AC_CHECK_HEADERS(net/if.h \
1785 netinet/if_ether.h\
1786 netinet/ip_compat.h\
1787 netinet/ip_fil.h\
77e4c0c9 1788 netinet/ip_nat.h\
dbc5782a 1789 netinet/ipl.h \
77e4c0c9 1790 sys/mount.h\
1791 resolv.h,,,SQUID_BSDNET_INCLUDES)
5a3237b0 1792
aee0606f 1793AC_C_CONST
d57288d2 1794AC_C_BIGENDIAN
aee0606f 1795
5c51415d 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
6a9f6389 1803 AC_DEFINE(HAVE_ANSI_PROTOTYPES,1,[Define if your compiler supports prototyping])
5c51415d 1804fi
20a50bb9 1805
6a9f6389 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
5c51415d 1815])
46c883ed 1816
6a9f6389 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
eb824054 1821#if HAVE_MALLOC_H
1822#include <malloc.h>
6a9f6389 1823#endif])
eb824054 1824
6a9f6389 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])
090089c4 1832
6a9f6389 1833AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
8ff51bba 1834#if HAVE_SYS_TIME_H
1835#include <sys/time.h>
1836#endif
b54a6789 1837#if HAVE_SYS_RESOURCE_H
1838#include <sys/resource.h>
6a9f6389 1839#endif])
b54a6789 1840
6a9f6389 1841AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
1842#if HAVE_SYS_TYPES_H
1843#include <sys/types.h>
1844#endif
a025a745 1845#include <netinet/in.h>
1846#include <netinet/in_systm.h>
6ad85e8a 1847#include <netinet/ip.h>
b05490a8 1848#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 1849#define ip_hl ihl
1850#endif
1851#ifndef __linux__
b05490a8 1852#ifndef __CYGWIN__
6ad85e8a 1853#define iphdr ip
b05490a8 1854#endif
6a9f6389 1855#endif])
a025a745 1856
090089c4 1857dnl Check for typedefs
77d6bd88 1858AC_CHECK_SIZEOF(void *)
090089c4 1859
6a9f6389 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,[
856e69c5 1868 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 1869 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
1870 ],,SQUID_DEFAULT_INCLUDES)
1871
1872dnl fallback #2
1873AC_CHECK_TYPE(int,[
856e69c5 1874 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 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,[
856e69c5 1898 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 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,[
856e69c5 1928 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 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
588e71df 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
6a9f6389 1955AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 1956AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 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)
856e69c5 1959AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 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)
adcceb47 1963
77d6bd88 1964dnl Check for special functions
1965AC_FUNC_ALLOCA
1966
6a9f6389 1967AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
1968#include <sys/types.h>
6637e3a5 1969#include <sys/socket.h>
1970#if STDC_HEADERS
1971#include <stdlib.h>
1972#include <stddef.h>
6a9f6389 1973#endif])
6637e3a5 1974
6a9f6389 1975AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
aea1be68 1976#include <sys/ipc.h>
6a9f6389 1977#include <sys/msg.h>])
aea1be68 1978
090089c4 1979dnl Check for needed libraries
30a4f2a8 1980AC_CHECK_LIB(nsl, main)
6716b242 1981AC_CHECK_LIB(socket, main)
4b26fae9 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
94d48591 2014
3c641669 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
6a9f6389 2029 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
3c641669 2030fi
2031dnl end rip
2032
94d48591 2033if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then
2034 echo "skipping libmalloc check (--enable-dlmalloc specified)"
5c51415d 2035else
94d48591 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
8a15e65e 2056fi
94d48591 2057
6716b242 2058AC_CHECK_LIB(bsd, main)
be79ade0 2059AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
04a56fa3 2060AC_CHECK_LIB(bind, gethostbyname)
2061if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2062 case "$host" in
78743365 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 ;;
04a56fa3 2070 esac
2071fi
e0bddc45 2072AC_CHECK_LIB(m, main)
090089c4 2073
2074dnl Check for libcrypt
8154dd82 2075dnl Some of our helpers use crypt(3) which may be in libc, or in
2076dnl libcrypt (eg FreeBSD)
042b1f8a 2077AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
be79ade0 2078AC_SUBST(CRYPTLIB)
77f675ad 2079
042b1f8a 2080dnl Check for libdl, used by auth_modules/PAM
8154dd82 2081if test "$with_dl" = "yes"; then
2082 AC_CHECK_LIB(dl, dlopen)
2083fi
042b1f8a 2084
e5f4e1b0 2085dnl Check for pthreads
2086dnl We use pthreads when doing ASYNC I/O
8154dd82 2087if test "$with_pthreads" = "yes"; then
fa035612 2088 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
2089 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
e685e3c6 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
fa035612 2100 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
2101 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
e685e3c6 2102 else
fa035612 2103 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
2104 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
e685e3c6 2105 fi
2106 ;;
2107 esac
8154dd82 2108 AC_CHECK_LIB(pthread, main)
2109fi
71f8abc8 2110
f85c88f3 2111dnl Check for librt
2112dnl We use AIO in the coss store
8154dd82 2113if test "$with_aio" = "yes"; then
580e2134 2114 dnl On some systems POSIX AIO functions are in libaio
2115 AC_CHECK_LIB(rt, aio_read,,AC_CHECK_LIB(aio, aio_read))
8154dd82 2116fi
f85c88f3 2117
86ec11aa 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
20e869bf 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
77f675ad 2143dnl System-specific library modifications
2144dnl
2145case "$host" in
88738790 2146 i386-*-solaris2.*)
7149a49f 2147 if test "$GCC" = "yes"; then
2148 echo "Removing -O for gcc on $host"
80e92d6d 2149 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 2150 fi
2151 ;;
77f675ad 2152 *-sgi-irix*)
2153 echo "Removing -lsocket for IRIX..."
6716b242 2154 LIBS=`echo $LIBS | sed -e s/-lsocket//`
77f675ad 2155 echo "Removing -lnsl for IRIX..."
6716b242 2156 LIBS=`echo $LIBS | sed -e s/-lnsl//`
c415c128 2157 ac_cv_lib_nsl_main=no
b44c0fb4 2158 echo "Removing -lbsd for IRIX..."
2159 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 2160 ;;
4ba0bd0e 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//`
a6e0ad1e 2167 case "$host" in
c68e9c6b 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.
a6e0ad1e 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
4ba0bd0e 2178 ;;
30a4f2a8 2179 *m88k*)
fa035612 2180 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2181 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
6a9f6389 2182 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
7149a49f 2183 ;;
580ce039 2184 [*-*-solaris2.[0-4]])
6a9f6389 2185 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
30a4f2a8 2186 ;;
711fa75e 2187 [*-sony-newsos[56]*])
6a9f6389 2188 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
f62c73dc 2189 ;;
77f675ad 2190esac
090089c4 2191
57faa85a 2192# Remove optimization for GCC 2.95.[123]
d20b1cd0 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
57faa85a 2197 [2.95.[123]])
d20b1cd0 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
176d10ee 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
84cecfd2 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-*])
f5cec332 2230 # Henrik Nordstrom (hno@squid-cache.org) 19980817
9bb83c8b 2231 # poll is problematic on Linux. We disable it
2232 # by default until Linux gets it right.
b6a2f15e 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
84cecfd2 2238 ;;
c68e9c6b 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 ;;
86ec11aa 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 ;;
84cecfd2 2250 esac
2251fi
176d10ee 2252
6716b242 2253dnl Check for library functions
2254AC_CHECK_FUNCS(\
ce3d30fb 2255 backtrace_symbols_fd \
3a144521 2256 bcopy \
2257 bswap_16 \
2258 bswap_32 \
f9576890 2259 bswap16 \
2260 bswap32 \
df087e68 2261 crypt \
4ac29a5b 2262 fchmod \
6716b242 2263 getdtablesize \
8505e57b 2264 getpagesize \
230c091c 2265 getpass \
3a144521 2266 getrlimit \
30a4f2a8 2267 getrusage \
9c1d8929 2268 getspnam \
f9576890 2269 htobe16 \
2270 htole16 \
30a4f2a8 2271 lrand48 \
6716b242 2272 mallinfo \
0f5efab0 2273 mallocblksize \
6716b242 2274 mallopt \
2ae6b9b0 2275 memcpy \
30a4f2a8 2276 memmove \
dac27377 2277 memset \
b99a6dec 2278 mkstemp \
1812b6c7 2279 mktime \
88738790 2280 mstats \
84cecfd2 2281 poll \
62ae0622 2282 prctl \
3a144521 2283 pthread_attr_setschedparam \
cd748f27 2284 pthread_attr_setscope \
2285 pthread_setschedparam \
42b51993 2286 pthread_sigmask \
c68e9c6b 2287 putenv \
b1e77ec1 2288 random \
6716b242 2289 regcomp \
2290 regexec \
2291 regfree \
30a4f2a8 2292 res_init \
4915be3b 2293 rint \
a4ba1105 2294 sbrk \
3a144521 2295 select \
234967c9 2296 seteuid \
c415c128 2297 setgroups \
30a4f2a8 2298 setpgrp \
6716b242 2299 setrlimit \
30a4f2a8 2300 setsid \
2301 sigaction \
11430c03 2302 snprintf \
1ccc0d40 2303 socketpair \
30a4f2a8 2304 srand48 \
b1e77ec1 2305 srandom \
0343b99c 2306 statfs \
6716b242 2307 sysconf \
2308 syslog \
234967c9 2309 timegm \
28da5e0d 2310 vsnprintf \
6716b242 2311)
2312
1b3db6d9 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
6c9797b9 2319if test "$ac_cv_func_kqueue" = "yes" ; then
92b9f1fd 2320 SELECT_TYPE="kqueue"
6a9f6389 2321 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
a46d2c0e 2322elif test "$ac_cv_func_epoll" = "yes" ; then
2323 SELECT_TYPE="epoll"
2324 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
48510020 2325 AC_CHECK_LIB(epoll, epoll_create, [EPOLL_LIBS="-lepoll"])
2326 AC_SUBST(EPOLL_LIBS)
6c9797b9 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])
1b3db6d9 2333else
a46d2c0e 2334 echo "Eep! Can't find poll, kqueue, epoll, or select!"
1b3db6d9 2335 echo "I'll try select and hope for the best."
2336 SELECT_TYPE="select"
6a9f6389 2337 AC_DEFINE(USE_SELECT,1)
1b3db6d9 2338fi
2339echo "Using ${SELECT_TYPE} for select loop."
1b3db6d9 2340
2341
60939927 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,
5c51415d 2347 AC_TRY_RUN([
60939927 2348#include <stdlib.h>
5c51415d 2349 int main() {
2350 if(setresuid(-1,-1,-1)) {
2351 perror("setresuid:");
2352 exit(1);
60939927 2353 }
2354 exit(0);
5c51415d 2355 }
2356 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
60939927 2357)
5c51415d 2358if test "$ac_cv_func_setresuid" = "yes" ; then
6a9f6389 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.])
5c51415d 2360fi
60939927 2361
c3d0c8b5 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
eee79a2e 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
a45f884d 2388 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
eee79a2e 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
a45f884d 2412 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
eee79a2e 2413fi
c3d0c8b5 2414
5cafc1d6 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)
42b51993 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" ||
87d21d8b 2422 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
2423 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
42b51993 2424 have_ipfilter_compat_header="yes"
2425 fi
2426 if test "x$have_ipfilter_compat_header" = "xyes" &&
eb824054 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)
42b51993 2431 elif test "$have_ipfilter_compat_header" = "yes" &&
eb824054 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
5cafc1d6 2437 IPF_TRANSPARENT="no"
2438 AC_DEFINE(IPF_TRANSPARENT, 0)
5cafc1d6 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
8f6ca20d 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"
20b3ae10 2453 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
8f6ca20d 2454 ;;
2455 *)
2456 ;;
2457 esac
5cafc1d6 2458fi
2459
2b0dd4ac 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
d852fbad 2479dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
2480dnl Shamelessly copied from above
2481if test "$LINUX_NETFILTER" ; then
d6d62546 2482 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
d852fbad 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
d6d62546 2494 echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
2495 echo " Linux Transparent Proxy support WILL NOT be enabled"
d852fbad 2496 sleep 10
2497fi
2498
91bc414e 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
7a081912 2509AC_MSG_CHECKING(if GNUregex needs to be compiled)
91bc414e 2510if test -z "$USE_GNUREGEX"; then
55878dfd 2511if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
74946a0f 2512 USE_GNUREGEX="yes"
00fa2c12 2513else
0cccc031 2514 AC_TRY_COMPILE([#include <sys/types.h>
2515#include <regex.h>],[regex_t t; regcomp(&t,"",0);],
91bc414e 2516 USE_GNUREGEX="no",
2517 USE_GNUREGEX="yes")
2518fi
00fa2c12 2519fi
74946a0f 2520AC_MSG_RESULT($USE_GNUREGEX)
2521if test "$USE_GNUREGEX" = "yes"; then
26675bf4 2522 REGEXLIB="-lregex"
7a081912 2523 LIBREGEX="libregex.a"
6a9f6389 2524 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
7a081912 2525fi
26675bf4 2526AC_SUBST(REGEXLIB)
00fa2c12 2527AC_SUBST(LIBREGEX)
7a081912 2528
3f6fcd8a 2529AC_REPLACE_FUNCS(\
3d0cf10e 2530 drand48 \
3f6fcd8a 2531 tempnam \
4d38fc7e 2532 strerror \
e3d74828 2533 initgroups
3f6fcd8a 2534)
2535
5c51415d 2536dnl Not cached since people are likely to tune this
e924600d 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() {
635e6242 2555 FILE *fp = fopen("conftestval", "w");
2556 fprintf (fp, "%d\n", FD_SETSIZE);
e924600d 2557 exit(0);
2558}
2559],
2560DEFAULT_FD_SETSIZE=`cat conftestval`,
2561DEFAULT_FD_SETSIZE=256,
2562DEFAULT_FD_SETSIZE=256)
2563AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
6a9f6389 2564AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
e924600d 2565
f49be7d1 2566
5c51415d 2567dnl Not cached since people are likely to tune this
234967c9 2568AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
c76d8acc 2569dnl damn! FreeBSD's pthreads breaks dup2().
f49be7d1 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([
8cca06da 2582#include <stdio.h>
234967c9 2583#include <unistd.h>
30a4f2a8 2584#include <sys/time.h> /* needed on FreeBSD */
234967c9 2585#include <sys/param.h>
2586#include <sys/resource.h>
2587main() {
635e6242 2588 FILE *fp;
234967c9 2589 int i,j;
42b51993 2590#if defined(__CYGWIN32__) || defined (__CYGWIN__)
b05490a8 2591 /* getrlimit and sysconf returns bogous values on cygwin32.
df087e68 2592 * Number of fds is virtually unlimited in cygwin (sys/param.h)
b05490a8 2593 * __CYGWIN32__ is deprecated.
df087e68 2594 */
2595 i = NOFILE;
b05490a8 2596#else
2597#if HAVE_SETRLIMIT
234967c9 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 */
d9399075 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++;
b05490a8 2632#endif /* IF !DEF CYGWIN */
635e6242 2633 fp = fopen("conftestval", "w");
a4d7e961 2634 fprintf (fp, "%d\n", i & ~0x3F);
234967c9 2635 exit(0);
2636}
f49be7d1 2637 ],
2638 SQUID_MAXFD=`cat conftestval`,
2639 SQUID_MAXFD=256,
2640 SQUID_MAXFD=256)
4b26fae9 2641 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
2642 case "$host_os" in
2643 mingw|mingw32)
2644 SQUID_MAXFD="2048"
2645 ;;
2646 esac
f49be7d1 2647 AC_MSG_RESULT($SQUID_MAXFD)
2648fi
6a9f6389 2649AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
b9cc811d 2650if test "$SQUID_MAXFD" -lt 512 ; then
80ab193b 2651 echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
2652 echo " cache will be very busy. Please see the FAQ page"
2b6662ba 2653 echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
e692ff35 2654 echo " on how to increase your filedescriptor limit"
933cc58d 2655 sleep 10
80ab193b 2656fi
c76d8acc 2657LDFLAGS="$TLDFLAGS"
234967c9 2658
d0f9207a 2659if test `expr $SQUID_MAXFD % 64` != 0; then
a4d7e961 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
5c51415d 2665dnl Not cached since people are likely to tune this
30a4f2a8 2666AC_MSG_CHECKING(Default UDP send buffer size)
2667AC_TRY_RUN([
8cca06da 2668#include <stdlib.h>
2669#include <stdio.h>
30a4f2a8 2670#include <sys/types.h>
2671#include <sys/socket.h>
2672#include <netinet/in.h>
2673main ()
2674{
635e6242 2675 FILE *fp;
30a4f2a8 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);
635e6242 2680 fp = fopen("conftestval", "w");
2681 fprintf (fp, "%d\n", val);
30a4f2a8 2682 exit(0);
2683}
2684],
6a9f6389 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])
30a4f2a8 2690
5c51415d 2691dnl Not cached since people are likely to tune this
30a4f2a8 2692AC_MSG_CHECKING(Default UDP receive buffer size)
2693AC_TRY_RUN([
8cca06da 2694#include <stdlib.h>
2695#include <stdio.h>
30a4f2a8 2696#include <sys/types.h>
2697#include <sys/socket.h>
2698#include <netinet/in.h>
2699main ()
2700{
635e6242 2701 FILE *fp;
30a4f2a8 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);
635e6242 2706 fp = fopen("conftestval", "w");
2707 fprintf (fp, "%d\n", val);
30a4f2a8 2708 exit(0);
2709}
2710],
6a9f6389 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])
30a4f2a8 2716
5c51415d 2717dnl Not cached since people are likely to tune this
30a4f2a8 2718AC_MSG_CHECKING(Default TCP send buffer size)
2719AC_TRY_RUN([
8cca06da 2720#include <stdlib.h>
2721#include <stdio.h>
30a4f2a8 2722#include <sys/types.h>
2723#include <sys/socket.h>
2724#include <netinet/in.h>
2725main ()
2726{
635e6242 2727 FILE *fp;
30a4f2a8 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);
635e6242 2732 fp = fopen("conftestval", "w");
2733 fprintf (fp, "%d\n", val);
30a4f2a8 2734 exit(0);
2735}
2736],
2737SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1c481e00 2738SQUID_TCP_SO_SNDBUF=16384,
2739SQUID_TCP_SO_SNDBUF=16384)
30a4f2a8 2740AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2aa6ca58 2741if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
2742 echo "Limiting send buffer size to 32K"
2743 SQUID_TCP_SO_SNDBUF=32768
2744fi
6a9f6389 2745AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
30a4f2a8 2746
5c51415d 2747dnl Not cached since people are likely to tune this
30a4f2a8 2748AC_MSG_CHECKING(Default TCP receive buffer size)
2749AC_TRY_RUN([
8cca06da 2750#include <stdlib.h>
2751#include <stdio.h>
30a4f2a8 2752#include <sys/types.h>
2753#include <sys/socket.h>
2754#include <netinet/in.h>
2755main ()
2756{
635e6242 2757 FILE *fp;
30a4f2a8 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);
635e6242 2762 fp = fopen("conftestval", "w");
2763 fprintf (fp, "%d\n", val);
30a4f2a8 2764 exit(0);
2765}
2766],
2767SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1c481e00 2768SQUID_TCP_SO_RCVBUF=16384,
2769SQUID_TCP_SO_RCVBUF=16384)
30a4f2a8 2770AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2aa6ca58 2771if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
2772 echo "Limiting receive buffer size to 64K"
2773 SQUID_TCP_SO_RCVBUF=65535
2774fi
6a9f6389 2775AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
5c51415d 2776AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
9bc73deb 2777 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
5c51415d 2778 ac_cv_needs_sys_errlist="no",
2779 ac_cv_needs_sys_errlist="yes")
2780)
2781if test "$ac_cv_needs_sys_errlist" = "yes" ; then
6a9f6389 2782 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
5c51415d 2783fi
30a4f2a8 2784
5c51415d 2785dnl Not cached since people are likely to change this
6bf65235 2786AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
2787AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
2788[AC_MSG_RESULT(yes)
6a9f6389 2789AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
6bf65235 2790AC_MSG_RESULT(no))
2791
a937d5e3 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{
635e6242 2801 FILE *fp;
a937d5e3 2802 struct in_addr in;
2803 in.s_addr = inet_addr("1.2.3.4");
635e6242 2804 fp = fopen("conftestval", "w");
2805 fprintf (fp, "%s\n", inet_ntoa(in));
a937d5e3 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")
4b26fae9 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
a937d5e3 2829fi
2830
b6a2f15e 2831if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
c68e9c6b 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)
6b8e7481 2848if test "$ac_cv_func_statvfs" = "yes" ; then
6a9f6389 2849 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
b6a2f15e 2850fi
6b8e7481 2851fi
c68e9c6b 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
6a9f6389 2875 AC_DEFINE(HAVE_RES_NSADDR_LIST,1,[If _res structure has nsaddr_list member])
c68e9c6b 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
6a9f6389 2901 AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
c68e9c6b 2902fi
2903fi
2904
090089c4 2905dnl Need the debugging version of malloc if available
2906XTRA_OBJS=''
6509a1a0 2907if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 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
2bbd722b 2915
090089c4 2916AC_SUBST(XTRA_OBJS)
2917
38fea766 2918if test -z "$XTRA_LIBS"; then
2919 XTRA_LIBS="$LIBS"
0f5a16f8 2920 dnl minor cleanup
2921 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 2922 LIBS=''
2923fi
090089c4 2924AC_SUBST(XTRA_LIBS)
2925
090089c4 2926dnl Clean up after OSF/1 core dump bug
2927rm -f core
2928
6a9f6389 2929AC_CONFIG_FILES([\
a2794549 2930 Makefile \
2931 lib/Makefile \
a2794549 2932 scripts/Makefile \
2933 scripts/RunCache \
2934 scripts/RunAccel \
2935 src/Makefile \
2936 src/fs/Makefile \
2937 src/repl/Makefile \
2938 src/auth/Makefile \
51952383 2939 src/ICAP/Makefile \
a2794549 2940 contrib/Makefile \
2941 snmplib/Makefile \
2942 icons/Makefile \
2943 errors/Makefile \
1077c1b8 2944 test-suite/Makefile \
99db07b3 2945 doc/Makefile \
0c510f3c 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 \
6e785d85 2953 helpers/basic_auth/mswin_sspi/Makefile \
0c510f3c 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 \
0c510f3c 2958 helpers/digest_auth/Makefile \
2959 helpers/digest_auth/password/Makefile \
55013f9c 2960 helpers/digest_auth/ldap/Makefile \
0c510f3c 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 \
6e785d85 2966 helpers/ntlm_auth/mswin_sspi/Makefile \
2967 helpers/negotiate_auth/Makefile \
2968 helpers/negotiate_auth/mswin_sspi/Makefile \
c6588c68 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 \
736a9a4d 2973 helpers/external_acl/wbinfo_group/Makefile \
2974 helpers/external_acl/mswin_lm_group/Makefile
53cbe3e4 2975])
43ae1d95 2976
2977AC_CONFIG_SUBDIRS(lib/libTrie)
f5691f9c 2978AC_CONFIG_SUBDIRS(lib/cppunit-1.10.0)
43ae1d95 2979
6a9f6389 2980AC_OUTPUT