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