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