]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
SourceLayout: esi/, take 1
[thirdparty/squid.git] / configure.in
CommitLineData
1b3db6d9 1
2877b8a9 2dnl Configuration input file for Squid
090089c4 3dnl
262a0e14 4dnl $Id$
090089c4 5dnl
090089c4 6dnl
7dnl
39e4ea99 8AC_INIT(Squid Web Proxy, 3.HEAD-BZR, http://www.squid-cache.org/bugs/, squid)
197c404c 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])
52303a3d 14AC_REVISION($Revision: 1.497 $)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
29b8d8d6 29AC_PROG_CXX
78013592 30AC_LANG_CPLUSPLUS
88d50a22 31AC_CANONICAL_HOST
3e7b6055 32
d1f95b42
AJ
33dnl Make the squid top srcdir available to sub-packages as --with-squid=PATH
34new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir"
35ac_configure_args="$new_configure_args"
36
37
3e7b6055
AR
38use_loadable_modules=1
39AC_MSG_CHECKING(whether to use loadable modules)
40AC_ARG_ENABLE(loadable-modules,
21d5413e 41 AC_HELP_STRING( [--disable-loadable-modules], [do not support loadable modules]) ,
3e7b6055
AR
42 [
43 case "${enableval}" in
44 yes) use_loadable_modules=yes ;;
45 no) use_loadable_modules=no ;;
46 *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
47 esac
48 AC_MSG_RESULT([$use_loadable_modules, explicitly])
49 ],
50 [
51 use_loadable_modules=yes;
52 AC_MSG_RESULT([$use_loadable_modules, implicitly])
53 ]
a7e513e9 54)
3e7b6055
AR
55
56AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
57
58if test $use_loadable_modules = yes;
59then
60 AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
61 AC_ENABLE_SHARED
62else
63 AC_DISABLE_SHARED
64fi
65
66AC_LIBTOOL_DLOPEN
67if test $use_loadable_modules = yes;
68then
69 AC_LIBLTDL_CONVENIENCE(lib/libLtdl)
70fi
645aa936 71AC_PROG_LIBTOOL
f5691f9c 72AC_LTDL_DLLIB
3e7b6055
AR
73
74# Do we need these unconditionally for "make distcheck" to work?
75AC_SUBST(INCLTDL)
76AC_SUBST(LIBLTDL)
77
78if test $use_loadable_modules = yes;
79then
80 # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
81 LIBADD_DL=${lt_cv_dlopen_libs}
82 AC_SUBST([LIBADD_DL])
83fi
84
645aa936 85AC_PROG_RANLIB
88d50a22 86
a2794549 87
26675bf4 88CRYPTLIB=''
00fa2c12 89REGEXLIB='' # -lregex
cc937513 90# LIBREGEX='' # libregex.a
090089c4 91
a2794549 92dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
93AC_EXEEXT
94AC_OBJEXT
95
96if test -z "$EXEEXT"; then
97 CGIEXT=".cgi"
98else
7aeb8001 99 # automake automatically adds .exe when installing binaries
100 CGIEXT=""
a2794549 101fi
7aeb8001 102AC_SUBST(CGIEXT)
a2794549 103
0e6d05ef 104dnl this should be expanded to a list of platform sensible support requirements.
105dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
df087e68 106case "$host_os" in
4b26fae9 107mingw|mingw32|cygwin|cygwin32)
a2794549 108 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
df087e68 109 ;;
110*)
a2794549 111 AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
df087e68 112 ;;
113esac
df087e68 114
4b26fae9 115case "$host_os" in
116mingw|mingw32)
117 AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
118 CFLAGS="$CFLAGS -mthreads"
119 CXXFLAGS="$CXXFLAGS -mthreads"
120 if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
eed82608
AJ
121 AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
122 AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
4b26fae9 123 else
124 AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
125 LIBS="$LIBS -lpsapi"
126 fi
790ebe36 127 MINGW_LIBS="-lmingwex"
b5d712b5 128 AM_CONDITIONAL(USE_IPC_WIN32, true)
790ebe36 129 AC_SUBST(MINGW_LIBS)
4b26fae9 130 ;;
b5d712b5 131*)
132 AM_CONDITIONAL(USE_IPC_WIN32, false)
133 ;;
4b26fae9 134esac
135
a26bdc75 136if test -z "$CACHE_HTTP_PORT"; then
137 CACHE_HTTP_PORT="3128"
138fi
139if test -z "$CACHE_ICP_PORT"; then
140 CACHE_ICP_PORT="3130"
141fi
a26bdc75 142
f4aaf39c 143dnl Substitutions
6a9f6389 144AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
145[What default TCP port to use for HTTP listening?])
58c1507a 146AC_SUBST(CACHE_HTTP_PORT)
6a9f6389 147AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
148[What default UDP port to use for ICP listening?])
f5e5c4cf 149AC_SUBST(CACHE_ICP_PORT)
090089c4 150
6a9f6389 151AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
30a4f2a8 152
6a9f6389 153AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
090089c4 154
5483d916 155CACHE_EFFECTIVE_USER="nobody"
156AC_ARG_WITH(default-user,
a2f6a96c
FC
157 AC_HELP_STRING([--with-default-user=USER],
158 [System user account for squid permissions. Default: nobody]),
5483d916 159 [ CACHE_EFFECTIVE_USER="$withval" ]
160)
161AC_SUBST(CACHE_EFFECTIVE_USER)
162
c8d2dc9b
AJ
163DEFAULT_LOG_DIR="$localstatedir/logs"
164AC_ARG_WITH(logdir,
a2f6a96c 165 AC_HELP_STRING([--with-logdir=PATH],
b0e7900f 166 Default location for squid logs. default: $DEFAULT_LOG_DIR),
c8d2dc9b
AJ
167 [ case $withval in
168 yes|no)
169 AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
170 ;;
171 *)
172 DEFAULT_LOG_DIR="$withval"
173 ;;
174 esac
175 ]
176)
177AC_SUBST(DEFAULT_LOG_DIR)
178
6ad85e8a 179dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
180case "$host" in
181 mab-next-nextstep3)
182 CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
183 ;;
184esac
185
4c43504f 186if test "$GCC" = "yes"; then
187 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
188 GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
189 case "$host" in
190 i386-*-freebsd*)
191 if test $GCCVER2 -lt 300 ; then
eed82608 192 AC_MSG_FAILURE([GCC $GCCVER causes a coredump on $host. Try a more recent GCC version])
dd81cb63 193 sleep 5
4c43504f 194 fi
195 ;;
196 esac
197 unset GCCVER
198 unset GCCVER2
199fi
200
30a4f2a8 201dnl Set Default CFLAGS
202if test -z "$PRESET_CFLAGS"; then
203 if test "$GCC" = "yes"; then
204 case "$host" in
97b12a5b 205 *-sun-sunos*)
30a4f2a8 206 # sunos has too many warnings for this to be useful
207 # motorola too
208 ;;
97b12a5b 209 *m88k*)
210 # Motorola cc/ld does not like -02 but is ok on -O
211 CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
212 ;;
30a4f2a8 213 *)
63e02610 214 CFLAGS="-Wall $CFLAGS"
30a4f2a8 215 ;;
216 esac
81a820c6 217 else
218 case "$host" in
c415c128 219 *mips-sgi-irix6.*)
81a820c6 220 # suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
63e02610 221 CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
776b0191 222 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
81a820c6 223 -Wl,-woff,85,-woff,84,-woff,134 \
63e02610 224 -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
776b0191 225 CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
226 -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
227 -Wl,-woff,85,-woff,84,-woff,134 \
228 -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
81a820c6 229 ;;
e8f5fb18 230 alpha-dec-osf4.*)
553c24ae 231 # Mogul says DEC compilers take both -g and -O2
b6a2f15e 232 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
63e02610 233 CFLAGS="-O2 $CFLAGS"
553c24ae 234 ;;
81a820c6 235 *)
236 ;;
237 esac
30a4f2a8 238 fi
30a4f2a8 239fi
240
d2e3605e 241dnl set squid required flags
242if test "$GCC" = "yes"; then
9f68fb10 243dnl Guido Serassio (serassio@squid-cache.org) 20070811
244dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
245dnl -Wmissing-prototypes -Wmissing-declarations
246dnl TODO: check if the problem will be present in any other newer MinGW release.
247 case "$host_os" in
248 mingw|mingw32)
249 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
250 ;;
251 *)
252 SQUID_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
253 ;;
254 esac
255 SQUID_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments"
d2e3605e 256else
9f68fb10 257 SQUID_CFLAGS=
258 SQUID_CXXFLAGS=
d2e3605e 259fi
260AC_SUBST(SQUID_CFLAGS)
261AC_SUBST(SQUID_CXXFLAGS)
262
d7c59e37 263AC_TEST_CHECKFORHUGEOBJECTS
264SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
265
30a4f2a8 266dnl Set LDFLAGS
267if test -z "$PRESET_LDFLAGS"; then
268 if test "$GCC" = "yes"; then
269 case "$host" in
63e02610 270 *mips-sgi-irix6.*)
271 # Silence Linker warnings 84, 85 and 134
272 LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
273 ;;
30a4f2a8 274 *)
275 # nothing
276 ;;
277 esac
81a820c6 278 else
279 case "$host" in
63e02610 280 *)
281 # nothing
81a820c6 282 ;;
283 esac
30a4f2a8 284 fi
285fi
2060fa9a 286
6c0c04db 287SquidInline="yes"
83079644 288
289AC_ARG_ENABLE(optimizations,
a2f6a96c
FC
290 AC_HELP_STRING([--disable-optimizations],
291 [Don't compile Squid with compiler optimizations enabled.
292 Optimization is good for production builds, but not
293 good for debugging. During development, use
294 --disable-optimizations to reduce compilation times
295 and allow easier debugging. This option implicitly
296 also enabled --disable-inline]),
83079644 297[ if test "$enableval" = "no" ; then
eed82608 298 AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
83079644 299 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
300 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
301 SquidInline="no"
302 fi
303])
304
6c0c04db 305AC_ARG_ENABLE(inline,
a2f6a96c
FC
306 AC_HELP_STRING([--disable-inline],
307 [Don't compile trivial methods as inline. Squid
308 is coded with much of the code able to be inlined.
309 Inlining is good for production builds, but not
310 good for development. During development, use
311 --disable-inline to reduce compilation times and
312 allow incremental builds to be quick. For
313 production builds, or load tests, use
314 --enable-inline to have squid make all trivial
315 methods inlinable by the compiler.]),
6c0c04db 316[ if test "$enableval" = "no" ; then
317 SquidInline="no"
318 fi
319])
320
321if test "$SquidInline" = "yes" ; then
322 AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
323 AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
324else
eed82608 325 AC_MSG_NOTICE([Inlining optimization disabled])
6c0c04db 326 AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
327fi
328
fa80a8ef 329AC_ARG_ENABLE(debug-cbdata,
a2f6a96c
FC
330 AC_HELP_STRING([--enable-debug-cbdata],
331 [Provide some debug information in cbdata]),
fa80a8ef 332[ if test "$enableval" = "yes" ; then
eed82608 333 AC_MSG_NOTICE([cbdata debugging enabled])
6a9f6389 334 AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
fa80a8ef 335 fi
336])
337
0961c811 338dnl This is a developer only option.. developers know how to set defines
339dnl
340dnl AC_ARG_ENABLE(xmalloc-debug,
341dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
342dnl [ if test "$enableval" = "yes" ; then
eed82608 343dnl AC_MSG_NOTICE([malloc debugging enabled])
6a9f6389 344dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
0961c811 345dnl fi
346dnl ])
347
348dnl This is a developer only option.. developers know how to set defines
349dnl
350dnl AC_ARG_ENABLE(xmalloc-debug-trace,
351dnl [ --enable-xmalloc-debug-trace
352dnl Detailed trace of memory allocations],
353dnl [ if test "$enableval" = "yes" ; then
eed82608 354dnl AC_MSG_NOTICE([malloc debug trace enabled])
6a9f6389 355dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
356dnl AC_DEFINE(XMALLOC_DEBUG,1)
0961c811 357dnl fi
358dnl ])
e5f4e1b0 359
d9180414 360AC_ARG_ENABLE(xmalloc-statistics,
a2f6a96c
FC
361 AC_HELP_STRING([--enable-xmalloc-statistics],
362 [Show malloc statistics in status page]),
e5f4e1b0 363[ if test "$enableval" = "yes" ; then
eed82608 364 AC_MSG_NOTICE([malloc statistics enabled])
6a9f6389 365 AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
e5f4e1b0 366 fi
367])
368
cd748f27 369AC_ARG_ENABLE(async-io,
18cc92fb 370 AC_HELP_STRING([--enable-async-io[=N_THREADS]],
b0e7900f
FC
371 [Shorthand for "--with-aufs-threads=N_THREADS --with-pthreads
372 --enable-storeio=ufs,aufs"]),
cd748f27 373[ case $enableval in
9bc73deb 374 yes)
69144041 375 with_pthreads="yes"
cd748f27 376 STORE_MODULES="ufs aufs"
9bc73deb 377 ;;
378 no)
9bc73deb 379 ;;
380 *)
f85c88f3 381 aufs_io_threads=$enableval
69144041 382 with_pthreads="yes"
cd748f27 383 STORE_MODULES="ufs aufs"
9bc73deb 384 ;;
385 esac
386])
387
f85c88f3 388AC_ARG_WITH(aufs-threads,
18cc92fb
FC
389 AC_HELP_STRING([--with-aufs-threads=N_THREADS],
390 [Tune the number of worker threads for the aufs object store.]),
a3310b77 391[ case $withval in
392 [[0-9]]*)
393 aufs_io_threads=$withval
394 ;;
395 *)
8b0d8e31 396 AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
a3310b77 397 ;;
398 esac
399])
f85c88f3 400if test "$aufs_io_threads"; then
eed82608 401 AC_MSG_NOTICE([With $aufs_io_threads aufs threads])
6a9f6389 402 AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
403 [Defines how many threads aufs uses for I/O])
cd748f27 404fi
405
406AC_ARG_WITH(pthreads,
18cc92fb 407 AC_HELP_STRING([--with-pthreads],[Use POSIX Threads]))
8154dd82 408if test "$with_pthreads" = "yes"; then
eed82608 409 AC_MSG_NOTICE([With pthreads])
9bc73deb 410fi
e5f4e1b0 411
f85c88f3 412AC_ARG_WITH(aio,
18cc92fb 413 AC_HELP_STRING([--with-aio],[Use POSIX AIO]))
8154dd82 414if test "$with_aio" = "yes"; then
eed82608 415 AC_MSG_NOTICE([With aio])
f85c88f3 416fi
8154dd82 417
638b9bab 418
8154dd82 419AC_ARG_WITH(dl,
18cc92fb 420 AC_HELP_STRING([--with-dl],[Use dynamic linking]))
8154dd82 421if test "$with_dl" = "yes"; then
eed82608 422 AC_MSG_NOTICE([With dl])
8154dd82 423fi
f85c88f3 424
cd748f27 425AC_ARG_ENABLE(storeio,
b0e7900f 426 AC_HELP_STRING([--enable-storeio="list of modules"],
18cc92fb
FC
427 [Build support for the list of store I/O modules.
428 The default is only to build the "ufs" module.
429 See src/fs for a list of available modules, or
430 Programmers Guide section <not yet written>
431 for details on how to build your custom store module]),
cd748f27 432[ case $enableval in
433 yes)
1c690e30 434 for dir in $srcdir/src/fs/*; do
435 module="`basename $dir`"
db263d62 436 if test -d "$dir" && test "$module" != CVS && test "$module" != coss; then
1c690e30 437 STORE_MODULES="$STORE_MODULES $module"
8154dd82 438 fi
cd748f27 439 done
440 ;;
441 no)
442 ;;
1c690e30 443 *)
444 STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
cd748f27 445 ;;
446 esac
447],
448[ if test -z "$STORE_MODULES"; then
449 STORE_MODULES="ufs"
450 fi
451])
1c690e30 452if test -n "$STORE_MODULES"; then
3fcdb6b9
AJ
453 dnl ensure that all modules a) exist and b) only include once.
454 STORE_MODULES_FULL=$STORE_MODULES
455 STORE_MODULES=
3fcdb6b9
AJ
456 for module in $STORE_MODULES_FULL; do
457 have_mod=`echo "$STORE_MODULES" | grep "$module"`
458 if test "$have_mod" != ""; then
eed82608 459 AC_MSG_NOTICE([Removing duplicate $module from storeio])
3fcdb6b9
AJ
460 elif test -d $srcdir/src/fs/$module; then
461 STORE_MODULES="$STORE_MODULES $module"
1c690e30 462 else
8b0d8e31 463 AC_MSG_ERROR(storeio $module does not exist)
1c690e30 464 fi
465 done
eed82608 466 AC_MSG_NOTICE([Store modules built: $STORE_MODULES])
1c690e30 467fi
a2794549 468dnl remove all but diskd - its the only module that needs to recurse
469dnl into the sub directory
d3b3ab85 470UFS_FOUND=
1c690e30 471NEED_UFS=
b9ae18aa 472NEED_BLOCKING=
473NEED_DISKDAEMON=
474NEED_DISKTHREADS=
475NEED_AIO=
082a5e7a 476STORE_TESTS=
a2794549 477for fs in $STORE_MODULES none; do
8154dd82 478 case "$fs" in
479 diskd)
1c690e30 480 NEED_UFS="true"
b9ae18aa 481 NEED_BLOCKING="true"
482 NEED_DISKDAEMON="true"
8154dd82 483 ;;
484 aufs)
1c690e30 485 NEED_UFS="true"
b9ae18aa 486 NEED_BLOCKING="true"
487 NEED_DISKTHREADS="true"
8154dd82 488 ;;
489 coss)
082a5e7a 490 NEED_AIO="true"
3256ae73 491 dnl
492 dnl Automake om MinGW needs explicit exe extension
493 dnl for STORE_TESTS substition
494 dnl
082a5e7a 495 STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
496 ;;
d3b3ab85 497 ufs)
082a5e7a 498 UFS_FOUND="true"
499 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
8154dd82 500 esac
a2794549 501done
d3b3ab85 502
1c690e30 503if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
eed82608 504 AC_MSG_NOTICE([Adding UFS, as it contains core logic for diskd and aufs])
3256ae73 505 STORE_MODULES="$STORE_MODULES ufs"
3256ae73 506 dnl
507 dnl Automake om MinGW needs explicit exe extension
508 dnl for STORE_TESTS substition
509 dnl
510 STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
d3b3ab85 511fi
b66455ff
AR
512
513dnl got final STORE_MODULES, build library lists
514dnl This list will not be needed when each fs library has its own Makefile
515STORE_LIBS_TO_BUILD=
516dnl File system libraries to link executables with.
517dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
518STORE_LIBS_TO_ADD=
519for fs in $STORE_MODULES; do
520 STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.a"
521 STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.a"
522done
523
524AC_SUBST(STORE_LIBS_TO_BUILD)
525AC_SUBST(STORE_LIBS_TO_ADD)
082a5e7a 526AC_SUBST(STORE_TESTS)
a2794549 527
b9ae18aa 528AC_ARG_ENABLE(disk-io,
b0e7900f 529 AC_HELP_STRING([--enable-disk-io="list of modules"],
18cc92fb 530 [Build support for the list of disk I/O modules.
09c5ae5a
AJ
531 If unset only the "Blocking" module will be built.
532 Set without a value all available modules will be built.
18cc92fb 533 See src/DiskIO for a list of available modules, or
09c5ae5a 534 Programmers Guide section on DiskIO
18cc92fb 535 for details on how to build your custom disk module]),
b9ae18aa 536[ case $enableval in
537 yes)
538 for dir in $srcdir/src/DiskIO/*; do
539 module="`basename $dir`"
540 if test -d "$dir" && test "$module" != CVS; then
eed82608 541 AC_MSG_NOTICE([Autodetected $module DiskIO module])
b9ae18aa 542 DISK_MODULES="$DISK_MODULES $module"
543 fi
544 done
633c035d 545 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
b9ae18aa 546 ;;
547 no)
633c035d 548 AC_DEFINE(USE_DISKIO,0,[DiskIO modules are expected to be available.])
b9ae18aa 549 ;;
550 *)
551 DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
633c035d 552 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
b9ae18aa 553 ;;
554 esac
555],
556[ if test -z "$DISK_MODULES"; then
557 DISK_MODULES="Blocking"
eed82608 558 AC_MSG_NOTICE([Enabling Blocking DiskIO module (required default)])
633c035d 559 AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
b9ae18aa 560 fi
561])
562if test -n "$DISK_MODULES"; then
563 for module in $DISK_MODULES; do
564 if test -d $srcdir/src/DiskIO/$module; then
565 :
566 else
8b0d8e31 567 AC_MSG_ERROR(disk-io $module does not exist)
b9ae18aa 568 fi
569 done
570 DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
571 DISK_LINKOBJS=
572 for module in $DISK_MODULES; do
eed82608 573 AC_MSG_NOTICE([Enabling $module DiskIO module])
b9ae18aa 574 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
575 done
576fi
577for fs in $DISK_MODULES none; do
578 case "$fs" in
579 DiskDaemon)
580 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
581 FOUND_DISKDAEMON="true"
582 ;;
583 DiskThreads)
584 FOUND_DISKTHREADS="true"
585 ;;
586 AIO)
587 FOUND_AIO="true"
588 ;;
589 Blocking)
590 FOUND_BLOCKING="true"
591 esac
592done
593
594if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
eed82608 595 AC_MSG_NOTICE([adding Blocking, as it is used by an active, legacy Store Module])
abb2a3d9 596 DISK_LIBS="$DISK_LIBS libBlocking.a"
597 DISK_MODULES="$DISK_MODULES Blocking"
598 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
b9ae18aa 599fi
600
601if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
eed82608 602 AC_MSG_NOTICE(["adding DiskDaemon, as it is used by an active, legacy Store Module])
abb2a3d9 603 DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
604 DISK_MODULES="$DISK_MODULES DiskDaemon"
605 DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
606 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
b9ae18aa 607fi
608
609if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
eed82608 610 AC_MSG_NOTICE([adding DiskThreads, as it is used by an active, legacy Store Module])
abb2a3d9 611 DISK_LIBS="$DISK_LIBS libDiskThreads.a"
612 DISK_MODULES="$DISK_MODULES DiskThreads"
613 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
b9ae18aa 614fi
595c7973 615
b9ae18aa 616if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
eed82608 617 AC_MSG_NOTICE([adding AIO, as it is used by an active, legacy Store Module])
abb2a3d9 618 DISK_LIBS="$DISK_LIBS libAIO.a"
619 DISK_MODULES="$DISK_MODULES AIO"
620 DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
b9ae18aa 621fi
eed82608 622AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
00dae584 623USE_AIOPS_WIN32=0
624USE_AIO_WIN32=0
b9ae18aa 625dnl we know what is being built. now add dependencies.
626for fs in $DISK_MODULES none; do
627 case "$fs" in
628 DiskThreads)
629 if test -z "$with_pthreads"; then
595c7973 630 case "$host_os" in
61163411 631 mingw|mingw32)
00dae584 632 USE_AIOPS_WIN32=1
eed82608 633 AC_MSG_NOTICE([DiskThreads IO Module used, Windows threads support automatically enabled])
595c7973 634 ;;
635 *)
eed82608 636 AC_MSG_NOTICE([DiskThreads IO Module used, pthreads support automatically enabled])
595c7973 637 with_pthreads=yes
638 ;;
639 esac
b9ae18aa 640 fi
641 ;;
642 AIO)
643 if test -z "$with_aio"; then
abb2a3d9 644 case "$host_os" in
61163411 645 mingw|mingw32)
00dae584 646 USE_AIO_WIN32=1
eed82608 647 AC_MSG_NOTICE([Aio IO Module used, Windows overlapped I/O support automatically enabled])
abb2a3d9 648 ;;
649 *)
eed82608 650 AC_MSG_NOTICE([Aio IO Module used, aio support automatically enabled])
abb2a3d9 651 with_aio=yes
652 ;;
653 esac
b9ae18aa 654 fi
655 ;;
656 esac
657done
638b9bab
AJ
658
659dnl Check for librt
660dnl We use AIO in the coss store
661if test "$with_aio" = "yes"; then
662 dnl On some systems POSIX AIO functions are in libaio
663 AC_CHECK_LIB(rt, aio_read,
664 [DISK_LIBS="$DISK_LIBS -lrt"],
665 AC_CHECK_LIB(aio, aio_read,[DISK_LIBS="$DISK_LIBS -laio"])
666 )
667fi
668
5a3a3a6c
AJ
669dnl Check for pthreads
670dnl We use pthreads when doing ASYNC I/O
671if test "$with_pthreads" = "yes"; then
672 SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
673 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
674 case "$host" in
675 i386-unknown-freebsd*)
676 if test "$GCC" = "yes" ; then
677 if test -z "$PRESET_LDFLAGS"; then
678 LDFLAGS="$LDFLAGS -pthread"
679 fi
680 fi
681 ;;
682 *-solaris2.*)
683 if test "$GCC" = "yes" ; then
684 SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
685 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
686 else
687 SQUID_CFLAGS="$SQUID_CFLAGS -mt"
688 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
689 fi
690 ;;
691 esac
692 AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
693 [ AC_MSG_ERROR(pthread library required but cannot be found.) ])
694fi
695
09c5ae5a 696AC_SUBST(DISK_MODULES)
b9ae18aa 697AC_SUBST(DISK_LIBS)
698AC_SUBST(DISK_PROGRAMS)
699AC_SUBST(DISK_LINKOBJS)
00dae584 700AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
701AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
b9ae18aa 702
24a04df9
AJ
703
704dnl At lest one removal policy is always needed.
705dnl 'lru' removal policy is currently hard-coded by name for tests
706dnl so we must set it as default.
707REPL_POLICIES="lru"
d9180414 708AC_ARG_ENABLE(removal-policies,
b0e7900f 709 AC_HELP_STRING([--enable-removal-policies="list of policies"],
18cc92fb
FC
710 [Build support for the list of removal policies.
711 The default is only to build the "lru" module.
712 See src/repl for a list of available modules, or
713 Programmers Guide section 9.9 for details on how
714 to build your custom policy]),
6a566b9c 715[ case $enableval in
716 yes)
1c690e30 717 for dir in $srcdir/src/repl/*; do
718 module="`basename $dir`"
24a04df9 719 if test -d "$dir" && test "$module" != CVS && test "$module" != "lru"; then
1c690e30 720 REPL_POLICIES="$REPL_POLICIES $module"
6a566b9c 721 fi
722 done
723 ;;
724 no)
725 ;;
1c690e30 726 *)
727 REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
6a566b9c 728 ;;
729 esac
6a566b9c 730])
1c690e30 731if test -n "$REPL_POLICIES"; then
732 for module in $REPL_POLICIES; do
733 if test -d $srcdir/src/repl/$module; then
734 :
735 else
8b0d8e31 736 AC_MSG_ERROR(Removal policy $module does not exist)
1c690e30 737 fi
738 done
eed82608 739 AC_MSG_NOTICE([Removal policies built: $REPL_POLICIES])
1c690e30 740 REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
741 REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
742fi
6a566b9c 743AC_SUBST(REPL_POLICIES)
6a566b9c 744AC_SUBST(REPL_OBJS)
f71946fc 745AC_SUBST(REPL_LIBS)
6a566b9c 746
d1da2d1f 747AM_CONDITIONAL(ENABLE_PINGER, false)
e5f4e1b0 748AC_ARG_ENABLE(icmp,
ddfc433e 749 AC_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
e5f4e1b0 750[ if test "$enableval" = "yes" ; then
eed82608 751 AC_MSG_NOTICE([ICMP enabled])
8e62bf65 752 AC_DEFINE(USE_ICMP,1,[Define to use Squid's ICMP and Network Measurement features (highly recommended!)])
d1da2d1f 753 AM_CONDITIONAL(ENABLE_PINGER, true)
e5f4e1b0 754 fi
755])
756
a2794549 757AM_CONDITIONAL(USE_DELAY_POOLS, false)
d9180414 758AC_ARG_ENABLE(delay-pools,
18cc92fb
FC
759 AC_HELP_STRING([--enable-delay-pools],
760 [Enable delay pools to limit bandwidth usage]),
e5f4e1b0 761[ if test "$enableval" = "yes" ; then
eed82608 762 AC_MSG_NOTICE([Delay pools enabled])
6a9f6389 763 AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
764 AM_CONDITIONAL(USE_DELAY_POOLS, true,)
e5f4e1b0 765 fi
766])
767
5fa840c3
AR
768dnl disable generic/common adaptation support by default
769use_adaptation=no
770
43ae1d95 771AM_CONDITIONAL(USE_ESI, false)
772AC_ARG_ENABLE(esi,
18cc92fb
FC
773 AC_HELP_STRING([--enable-esi],
774 [Enable ESI for accelerators. Requires libexpat.
775 Enabling ESI will cause squid to follow the
776 Edge Acceleration Specification (www.esi.org).
777 This causes squid to IGNORE client Cache-Control headers.
778 DO NOT use this in a squid configured as a web proxy,
779 ONLY use it in a squid configured for webserver acceleration.]),
328c40de 780 use_esi=$enableval, use_esi=no)
781if test "$use_esi" = "yes" ; then
f41735ea 782 AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
43ae1d95 783 AM_CONDITIONAL(USE_ESI, true)
ad32c661
AJ
784
785 dnl Perform configuration consistency checks for ESI
786 dnl ESI support requires libexpat
787 AC_CHECK_LIB([expat], [main],
788 [ESI_LIBS="-lexpat"],
789 [AC_MSG_FAILURE([ESI support requires libexpat library, but no usable library was found])]
790 )
791 AC_CHECK_LIB([xml2], [main],
792 [ESI_LIBS="-lxml2"],
793 [AC_MSG_FAILURE([ESI support requires libxml2 library, but no usable library was found])]
794 )
964b44c3 795 XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
ad32c661 796
a787b56a 797else
f41735ea 798 AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
43ae1d95 799fi
800
51952383 801AM_CONDITIONAL(USE_ICAP_CLIENT, false)
802AC_ARG_ENABLE(icap-client,
86f53af2 803 AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
328c40de 804 use_icap_client=$enableval, use_icap_client=no)
805if test "$use_icap_client" = "yes" ; then
51952383 806 AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
807 AM_CONDITIONAL(USE_ICAP_CLIENT, true)
1f3c65fc 808 ICAP_LIBS="icap/libicap.la"
5fa840c3 809 use_adaptation=yes
51952383 810else
811 AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
c21ad0f5 812 ICAP_LIBS=""
51952383 813fi
c21ad0f5 814AC_SUBST(ICAP_LIBS)
51952383 815
3e7b6055
AR
816use_ecap=1
817AC_MSG_CHECKING(whether to support eCAP)
818AC_ARG_ENABLE(ecap,
86f53af2
FC
819 AC_HELP_STRING([--enable-ecap],
820 [support loadable content adaptation modules]),
3e7b6055
AR
821 [
822 case "${enableval}" in
823 yes) use_ecap=yes ;;
824 no) use_ecap=no ;;
825 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
826 esac
827 AC_MSG_RESULT([$use_ecap, explicitly])
828 ],
829 [
830 use_ecap=no;
831 AC_MSG_RESULT([$use_ecap, implicitly])
832 ]
833)
834
835dnl Perform configuration consistency checks for eCAP
3e7b6055
AR
836if test $use_ecap = yes;
837then
5fa840c3 838 dnl eCAP support requires loadable modules, which are enabled by default
3e7b6055
AR
839 if test "$use_loadable_modules" != "yes"
840 then
945980c0 841 AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
3e7b6055 842 fi
4cfba571
AR
843
844 dnl eCAP support requires libecap
845 AC_CHECK_LIB([ecap], [main],
846 [ECAP_LIBS="-lecap"],
591e6db0 847 [AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])]
4cfba571 848 )
3e7b6055
AR
849fi
850
851AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
852if test $use_ecap = yes;
853then
854 AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
1f3c65fc 855 ECAP_LIBS="ecap/libecap.la $ECAP_LIBS"
5fa840c3 856 use_adaptation=yes
3e7b6055 857else
5fa840c3 858 AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
3e7b6055
AR
859 ECAP_LIBS=""
860fi
861AC_SUBST(ECAP_LIBS)
862
3e7b6055 863
5fa840c3
AR
864dnl enable adaptation if requested by specific adaptation mechanisms
865AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
866if test $use_adaptation = yes
867then
868 AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
869 ADAPTATION_LIBS="adaptation/libadaptation.la"
51952383 870else
5fa840c3
AR
871 AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
872 ADAPTATION_LIBS=""
51952383 873fi
5fa840c3 874AC_SUBST(ADAPTATION_LIBS)
3e7b6055
AR
875
876
0961c811 877dnl This is a developer only option. Developers know how to set defines
878dnl
879dnl AC_ARG_ENABLE(mem-gen-trace,
880dnl [ --enable-mem-gen-trace Do trace of memory stuff],
881dnl [ if test "$enableval" = "yes" ; then
eed82608 882dnl AC_MSG_NOTICE([Memory trace (to file) enabled])
6a9f6389 883dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
0961c811 884dnl fi
885dnl ])
36a97e19 886
d9180414 887AC_ARG_ENABLE(useragent-log,
86f53af2
FC
888 AC_HELP_STRING([--enable-useragent-log],
889 [Enable logging of User-Agent header]),
e5f4e1b0 890[ if test "$enableval" = "yes" ; then
eed82608 891 AC_MSG_NOTICE([User-Agent logging enabled])
6a9f6389 892 AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
893 By default, they are written to useragent.log in the Squid log
894 directory.])
e5f4e1b0 895 fi
896])
897
dfca7e1a 898AC_ARG_ENABLE(referer-log,
86f53af2 899 AC_HELP_STRING([--enable-referer-log],[Enable logging of Referer header]),
dfca7e1a 900[ if test "$enableval" = "yes" ; then
eed82608 901 AC_MSG_NOTICE([Referer logging enabled])
6a9f6389 902 AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
903 By default, they are written to referer.log in the Squid log
904 directory.])
dfca7e1a 905 fi
906])
907
0b0cfcf2 908USE_WCCP=1
320e9f36 909AC_ARG_ENABLE(wccp,
86f53af2 910 AC_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]),
eb824054 911[ if test "$enableval" = "no" ; then
eed82608 912 AC_MSG_NOTICE([Web Cache Coordination Protocol disabled])
0b0cfcf2 913 USE_WCCP=0
320e9f36 914 fi
915])
0b0cfcf2 916if test $USE_WCCP = 1; then
917 AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
918fi
919
920USE_WCCPv2=1
921AC_ARG_ENABLE(wccpv2,
86f53af2
FC
922 AC_HELP_STRING([--disable-wccpv2],
923 [Disable Web Cache Coordination V2 Protocol]),
0b0cfcf2 924[ if test "$enableval" = "no" ; then
eed82608 925 AC_MSG_NOTICE(["Web Cache Coordination V2 Protocol disabled])
0b0cfcf2 926 USE_WCCPv2=0
927 fi
928])
929if test $USE_WCCPv2 = 1; then
930 AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
14b32873 931fi
320e9f36 932
d9180414 933AC_ARG_ENABLE(kill-parent-hack,
86f53af2 934 AC_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]),
e5f4e1b0 935[ if test "$enableval" = "yes" ; then
eed82608 936 AC_MSG_NOTICE([Kill parent on shutdown])
6a9f6389 937 AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process
938 (presumably the RunCache script) upon receipt of SIGTERM or SIGINT.
939 Use with caution.])
e5f4e1b0 940 fi
941])
942
87630341 943USE_SNMP=true
e5f4e1b0 944AC_ARG_ENABLE(snmp,
86f53af2 945 AC_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]),
87630341 946[ if test "$enableval" = "no" ; then
eed82608 947 AC_MSG_NOTICE([SNMP monitoring disabled])
87630341 948 USE_SNMP=
949 fi
950])
10faea39 951if test x"$USE_SNMP" = xtrue; then
6a9f6389 952 AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
63705952 953 SNMPLIB='../snmplib/libsnmp.a'
e5f4e1b0 954 makesnmplib=snmplib
87630341 955fi
cb50b537 956AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
e5f4e1b0 957AC_SUBST(SNMPLIB)
e5f4e1b0 958AC_SUBST(makesnmplib)
959
d9180414 960AC_ARG_ENABLE(cachemgr-hostname,
86f53af2
FC
961 AC_HELP_STRING([--enable-cachemgr-hostname=hostname],
962 [Make cachemgr.cgi default to this host.
963 If unspecified, uses the name of the build-host]),
e5f4e1b0 964[ case $enableval in
965 yes)
6a9f6389 966 AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
967 [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
eed82608 968 AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
e5f4e1b0 969 ;;
970 no)
971 : # Nothing to do..
972 ;;
973 *)
974 AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
eed82608 975 AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
e5f4e1b0 976 ;;
977 esac
978])
979
b0dd28ba 980AM_CONDITIONAL(ENABLE_ARP_ACL, false)
d9180414 981AC_ARG_ENABLE(arp-acl,
86f53af2
FC
982 AC_HELP_STRING([--enable-arp-acl],
983 [Enable use of ARP ACL lists (ether address)]),
e5f4e1b0 984[ if test "$enableval" = "yes" ; then
eed82608 985 AC_MSG_NOTICE([ARP ACL lists enabled (ether address)])
933cc58d 986 case "$host" in
ef614b1c 987 *-linux-*)
988 ;;
9d8d033e 989 *-solaris*)
a931a29b 990 ;;
9a2f1170 991 *-freebsd*)
992 ;;
f71a524f 993 *-openbsd*)
994 ;;
074bf084 995 *-netbsd*)
996 ;;
5700029a 997 *-cygwin*)
998 LIBS="$LIBS -liphlpapi"
999 ;;
1000 *-mingw*)
1001 LIBS="$LIBS -liphlpapi"
1002 ;;
933cc58d 1003 *)
eed82608 1004 AC_MSG_WARN([ARP ACL support probably won't work on $host.])
933cc58d 1005 sleep 10
1006 ;;
1007 esac
6a9f6389 1008 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 1009 AM_CONDITIONAL(ENABLE_ARP_ACL, true)
e5f4e1b0 1010 fi
1011])
1012
87630341 1013USE_HTCP=true
a2794549 1014AM_CONDITIONAL(ENABLE_HTCP, false)
74075210 1015AC_ARG_ENABLE(htcp,
86f53af2 1016 AC_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]),
87630341 1017[ if test "$enableval" = "no" ; then
eed82608 1018 AC_MSG_NOTICE([HTCP support disabled])
b4b8b6da 1019 fi
74075210 1020])
87630341 1021if test x$USE_HTCP = xtrue; then
1022 AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1023fi
1024AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
a2794549 1025
3d4022fa 1026dnl SSL is not enabled by default.
a2794549 1027AM_CONDITIONAL(ENABLE_SSL, false)
74075210 1028
3d4022fa 1029dnl Default is to use OpenSSL when available
1f7c9178 1030AC_ARG_ENABLE(ssl,
86f53af2 1031 AC_HELP_STRING([--enable-ssl],[Enable ssl gatewaying support using OpenSSL]),
1f7c9178 1032[ if test "$enableval" != "no"; then
eed82608 1033 AC_MSG_NOTICE([SSL gatewaying using OpenSSL enabled])
6a9f6389 1034 AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
a2794549 1035 AM_CONDITIONAL(ENABLE_SSL, true)
4b26fae9 1036 case "$host_os" in
1037 mingw|mingw32)
1038 dnl Native Windows port of OpenSSL needs -lgdi32
ee86c79b 1039 SSLLIB='-lssleay32 -leay32 -lgdi32'
4b26fae9 1040 ;;
1041 *)
1042 SSLLIB='-lssl -lcrypto'
1043 ;;
1044 esac
1f7c9178 1045 USE_OPENSSL=1
1046 fi
1047])
1048
3d4022fa 1049dnl User may specify OpenSSL is needed from a non-standard location
1f7c9178 1050AC_ARG_WITH(openssl,
21d5413e 1051 AC_HELP_STRING([--with-openssl{=PATH}],
86f53af2
FC
1052 [Compile with the OpenSSL libraries. The path to
1053 the OpenSSL development libraries and headers
1054 installation can be specified if outside of the
1055 system standard directories]),
1f7c9178 1056[
46ce628c 1057 case "$with_openssl" in
1f7c9178 1058 yes)
1059 USE_OPENSSL=1
1060 ;;
1061 no)
1062 USE_OPENSSL=
1063 ;;
1064 *)
46ce628c 1065 SSLLIBDIR="$with_openssl/lib"
bcce53ce 1066 CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1f7c9178 1067 USE_OPENSSL=1
1068 esac
1069])
1f7c9178 1070if test -n "$USE_OPENSSL"; then
eed82608 1071 AC_MSG_NOTICE([Using OpenSSL MD5 implementation])
6a9f6389 1072 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)])
1f7c9178 1073 if test -z "$SSLLIB"; then
1074 SSLLIB="-lcrypto" # for MD5 routines
1075 fi
f11555e0 1076 dnl This is a workaround for RedHat 9 brain damage..
1077 if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
eed82608 1078 AC_MSG_NOTICE([OpenSSL depends on Kerberos])
f11555e0 1079 SSLLIBDIR="/usr/kerberos/lib"
1080 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1081 fi
1f7c9178 1082fi
1083if test -n "$SSLLIBDIR"; then
1084 SSLLIB="-L$SSLLIBDIR $SSLLIB"
1085fi
1f7c9178 1086AC_SUBST(SSLLIB)
1087
3d4022fa 1088
02749868 1089AC_ARG_ENABLE(forw-via-db,
86f53af2 1090 AC_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]),
02749868 1091[ if test "$enableval" = "yes" ; then
eed82608 1092 AC_MSG_NOTICE([FORW-VIA enabled])
6a9f6389 1093 AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
02749868 1094 fi
1095])
1096
6cfa8966 1097AC_ARG_ENABLE(cache-digests,
86f53af2
FC
1098 AC_HELP_STRING([--enable-cache-digests],
1099 [Use Cache Digests.
1100 See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
484f2ebc 1101[ if test "$enableval" = "yes" ; then
eed82608 1102 AC_MSG_NOTICE([Cache Disgests enabled])
6a9f6389 1103 AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
484f2ebc 1104 fi
1105])
1106
cd748f27 1107dnl Size of COSS memory buffer
1108AC_ARG_WITH(coss-membuf-size,
86f53af2
FC
1109 AC_HELP_STRING([--with-coss-membuf-size=size],
1110 [COSS membuf size (default 1048576 bytes)]),
8b0d8e31 1111[ if test -n "$withval" -a "x$withval" != "xno" ; then
eed82608 1112 AC_MSG_NOTICE([Setting COSS membuf size to $with_coss_membuf_size bytes])
6a9f6389 1113 AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
cd748f27 1114 fi
1115])
1116
1b3db6d9 1117dnl check for netio plugin stuff
6564c397 1118
9bb83c8b 1119dnl Enable poll()
6564c397 1120disable_poll=
9bb83c8b 1121AC_ARG_ENABLE(poll,
86f53af2 1122 AC_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
1b3db6d9 1123[
c68e9c6b 1124 case "$enableval" in
1125 yes)
eed82608 1126 AC_MSG_WARN([Forcing poll() to be enabled])
d474c7a6 1127 SELECT_TYPE="poll"
c68e9c6b 1128 ;;
1129 no)
eed82608 1130 AC_MSG_WARN([Forcing poll() to be disabled])
6564c397 1131 disable_poll=true
c68e9c6b 1132 ;;
1133 esac
9bb83c8b 1134])
1135
1b3db6d9 1136dnl Enable select()
6564c397 1137disable_select=
1b3db6d9 1138AC_ARG_ENABLE(select,
86f53af2 1139 AC_HELP_STRING([--disable-select],[Disable select(2) support.]),
1b3db6d9 1140[
1141 case "$enableval" in
1142 yes)
eed82608 1143 AC_MSG_WARN([Forcing select() to be enabled])
d474c7a6 1144 SELECT_TYPE="select"
1b3db6d9 1145 ;;
1146 no)
eed82608 1147 AC_MSG_WARN([Forcing select() to be disabled])
6564c397 1148 disable_select=true
1b3db6d9 1149 ;;
1150 esac
1151])
1152
1153dnl Enable kqueue()
6564c397 1154dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1155disable_kqueue=true
1b3db6d9 1156AC_ARG_ENABLE(kqueue,
86f53af2 1157 AC_HELP_STRING([--enable-kqueue],[Enable kqueue(2) support (experimental).]),
1b3db6d9 1158[
1159 case "$enableval" in
1160 yes)
eed82608 1161 AC_MSG_WARN([Forcing kqueue() to be enabled])
d474c7a6 1162 SELECT_TYPE="kqueue"
11f11b5c
AJ
1163 AC_CHECK_HEADERS([sys/event.h],[],
1164 [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ])
1b3db6d9 1165 ;;
1166 no)
eed82608 1167 AC_MSG_WARN([Forcing kqueue() to be disabled])
6564c397 1168 disable_kqueue=true
1b3db6d9 1169 ;;
11f11b5c
AJ
1170 *)
1171 AC_CHECK_HEADERS([sys/event.h])
1172 ;;
1b3db6d9 1173esac
1174])
1175
a46d2c0e 1176dnl Enable epoll()
6564c397 1177disable_epoll=
a46d2c0e 1178AC_ARG_ENABLE(epoll,
86f53af2 1179 AC_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
a46d2c0e 1180[
1181 case "$enableval" in
1182 yes)
eed82608 1183 AC_MSG_WARN([Forcing epoll() to be enabled])
d474c7a6 1184 SELECT_TYPE="epoll"
ad32c661
AJ
1185 dnl epoll requires header file and library to be installed
1186 AC_CHECK_HEADERS([sys/epoll.h],[],
1187 [ AC_MSG_ERROR([required sys/epoll.h header file is missing.]) ])
1188 AC_CHECK_LIB(epoll, epoll_ctl, [],
1189 [ AC_MSG_ERROR([required libepoll library is missing.]) ])
a46d2c0e 1190 ;;
1191 no)
eed82608 1192 AC_MSG_WARN([Forcing epoll() to be disabled])
6564c397 1193 disable_epoll=true
a46d2c0e 1194 ;;
1195esac
1196])
07c4ce92 1197dnl epoll requires sys/epoll.h and libepoll
ad32c661
AJ
1198if test -z "$disable_epoll"; then
1199 # Check for libepoll
1200 EPOLL_LIB=
1201 AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
1202 AC_SUBST(EPOLL_LIBS)
1203
1204 # Check for epoll_ctl, may need -lepoll
1205 SAVED_LIBS="$LIBS"
1206 LIBS="$LIBS $LIB_EPOLL"
1207 AC_CHECK_FUNCS(epoll_ctl)
1208 LIBS="$SAVED_LIBS"
a46d2c0e 1209
ad32c661
AJ
1210 AC_CHECK_HEADERS([sys/epoll.h])
1211
1212 dnl Verify that epoll really works
1213 if test $ac_cv_func_epoll_ctl = yes; then
1214 AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
1215 AC_TRY_RUN([
1216#include <sys/epoll.h>
1217#include <stdlib.h>
1218#include <stdio.h>
1219int main(int argc, char **argv)
1220{
1221 int fd = epoll_create(256);
1222 if (fd < 0) {
1223 perror("epoll_create:");
1224 exit(1);
1225 }
1226 exit(0);
1227}
1228 ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
1229 fi
1230fi
a46d2c0e 1231
72fd085a 1232dnl Disable HTTP violations
14b32873 1233http_violations=1
72fd085a 1234AC_ARG_ENABLE(http-violations,
ddfc433e
FC
1235 AC_HELP_STRING([--disable-http-violations],
1236 [This allows you to remove code which is known to
1237 violate the HTTP protocol specification.]),
72fd085a 1238[ if test "$enableval" = "no" ; then
eed82608 1239 AC_MSG_NOTICE([Disabling HTTP Violations])
14b32873 1240 http_violations=0
72fd085a 1241 fi
1242])
14b32873 1243if test $http_violations = 1; then
1244 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.])
1245else
1246 AC_DEFINE(HTTP_VIOLATIONS, 0)
1247fi
72fd085a 1248
68075fad 1249dnl Enable IPFW Transparent Proxy
1250AC_ARG_ENABLE(ipfw-transparent,
ddfc433e
FC
1251 AC_HELP_STRING([--enable-ipfw-transparent],
1252 [Enable Transparent Proxy support for systems
1253 using FreeBSD IPFW style redirection.]),
68075fad 1254[ if test "$enableval" = "yes" ; then
eed82608 1255 AC_MSG_NOTICE([IPFW Transparent Proxy enabled])
68075fad 1256 AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1257 IPFW_TRANSPARENT="yes"
a74968c2
AJ
1258 else
1259 AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
68075fad 1260 fi
1261])
1262
5cafc1d6 1263dnl Enable IP-Filter Transparent Proxy
1264AC_ARG_ENABLE(ipf-transparent,
ddfc433e
FC
1265 AC_HELP_STRING([--enable-ipf-transparent],
1266 [Enable Transparent Proxy support for systems
1267 using IP-Filter network address redirection.]),
5cafc1d6 1268[ if test "$enableval" = "yes" ; then
eed82608 1269 AC_MSG_NOTICE([IP-Filter Transparent Proxy enabled])
6a9f6389 1270 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 1271 IPF_TRANSPARENT="yes"
a74968c2
AJ
1272 else
1273 AC_DEFINE(IPF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.])
5cafc1d6 1274 fi
1275])
1276
2b0dd4ac 1277dnl Enable PF Transparent Proxy
1278AC_ARG_ENABLE(pf-transparent,
ddfc433e
FC
1279 AC_HELP_STRING([--enable-pf-transparent],
1280 [Enable Transparent Proxy support for systems
1281 using PF network address redirection.]),
2b0dd4ac 1282[ if test "$enableval" = "yes" ; then
eed82608 1283 AC_MSG_NOTICE([PF Transparent Proxy enabled])
6a9f6389 1284 AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
2b0dd4ac 1285 PF_TRANSPARENT="yes"
a74968c2
AJ
1286 else
1287 AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
2b0dd4ac 1288 fi
1289])
1290
d6d62546 1291dnl Enable Linux Netfilter Transparent Proxy
d852fbad 1292AC_ARG_ENABLE(linux-netfilter,
ddfc433e
FC
1293 AC_HELP_STRING([--enable-linux-netfilter],
1294 [Enable Transparent Proxy support for Linux (Netfilter)]),
d852fbad 1295[ if test "$enableval" = "yes" ; then
eed82608 1296 AC_MSG_NOTICE([Linux (Netfilter) Transparent Proxy enabled])
d6d62546 1297 AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
d852fbad 1298 LINUX_NETFILTER="yes"
a74968c2
AJ
1299 else
1300 AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
d852fbad 1301 fi
1302])
1303
bb7b5fd0 1304dnl Enable Large file support
2df6213e 1305buildmodel=""
1306needlargefiles=
1307
1308AC_ARG_WITH(large-files,
19b4777c 1309 AC_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]),
8b0d8e31 1310[ if test "x$withval" = "xyes"; then
2df6213e 1311 needlargefiles=1
bb7b5fd0 1312 fi
1313])
1314
2df6213e 1315dnl UNIX Build environment
19b4777c 1316dnl AC_HELP_STRING is not suited here because it doesn't allow to specify newlines
2df6213e 1317AC_ARG_WITH(build-environment,
1318[ --with-build-environment=model
1319 The build environment to use. Normally one of
1320 POSIX_V6_ILP32_OFF32 32 bits
1321 POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1322 POSIX_V6_LP64_OFF64 64 bits
1323 POSIX_V6_LPBIG_OFFBIG large pointers and files
1324 XBS5_ILP32_OFF32 32 bits (legacy)
1325 XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1326 XBS5_LP64_OFF64 64 bits (legacy)
1327 XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1328 default The default for your OS],
1329[ case "$withval" in
1330 yes|no)
eed82608 1331 AC_MSG_FAILURE(["--with-build-environment expects a build environment string as used by getconf])
2df6213e 1332 ;;
1333 *)
1334 buildmodel="$withval"
1335 ;;
1336 esac
1337])
1338
1339if test $needlargefiles && test -z "$buildmodel"; then
f6fd3d67 1340 for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do
2df6213e 1341 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1342 buildmodel=$model
1343 break
1344 fi
1345 done
1346 if test -z "$buildmodel"; then
eed82608 1347 AC_MSG_WARN(["No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
2df6213e 1348 sleep 1
9b8002de
HN
1349 fi
1350fi
1351case "$buildmodel" in
1352default|"")
1353 if test "$needlargefiles"; then
eed82608 1354 AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
2df6213e 1355 CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
cca81db1 1356 CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
2df6213e 1357 fi
9b8002de
HN
1358 ;;
1359*)
eed82608 1360 AC_MSG_NOTICE([Using $buildmodel build environment])
2df6213e 1361 if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1362 : # All fine
1363 else
8b0d8e31 1364 AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
2df6213e 1365 fi
1366 CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
cca81db1 1367 CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
2df6213e 1368 LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1369 LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
63e02610 1370 case "$host" in
2df6213e 1371dnl
a078ea4d
GS
1372dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1373dnl for LDFLAGS -xarch=generic64, but:
1374dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1375dnl For gcc "-xarch=generic64" must be replaced with "-m64"
1376dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
2df6213e 1377 *-solaris*)
1378 if test "$GCC" = "yes"; then
eed82608 1379 AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
2df6213e 1380 CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
cca81db1 1381 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
eed82608 1382 AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
a078ea4d 1383 CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
bb60974e 1384 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
a078ea4d 1385 LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
2df6213e 1386 fi
eed82608 1387 AC_MSG_NOTICE([Removing -Usun on $host])
2df6213e 1388 CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
cca81db1 1389 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
2df6213e 1390 ;;
eed82608 1391dnl
63e02610 1392dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1393dnl so we must adjust something to avoid gcc errors.
1394dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1395dnl remove "-n32" from LDFLAGS
1396dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1397dnl "-64" from LDFLAGS
1398 *-sgi-irix6.*)
1399 if test "$GCC" = "yes"; then
1400 CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
ff37fe61 1401 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
63e02610 1402 LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1403 CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
ff37fe61 1404 CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
63e02610 1405 LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1406 fi
1407 ;;
2df6213e 1408 *)
1409 ;;
1410 esac
993f04c1 1411 ;;
9b8002de 1412esac
2df6213e 1413
7b0a0d1f 1414dnl Enable Linux transparent proxy support for obsolete TPROXY
e8cca4ac 1415AC_ARG_ENABLE(linux-tproxy,
19b4777c
FC
1416 AC_HELP_STRING([--enable-linux-tproxy],
1417 [Enable real Transparent Proxy support for Netfilter TPROXY
1418 (version 2).]),
fc68f6b1 1419[ if test "$enableval" = "yes" ; then
eed82608 1420 AC_MSG_NOTICE(["Linux Netfilter/TPROXY v2 enabled])
f1e0717c
AJ
1421 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1422 LINUX_TPROXY2="yes"
1423 if test -z "$LINUX_NETFILTER"; then
eed82608 1424 AC_MSG_NOTICE([Linux-Netfilter Transparent Proxy automatically enabled])
f1e0717c
AJ
1425 LINUX_NETFILTER="yes"
1426 fi
a74968c2
AJ
1427 else
1428 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
f1e0717c
AJ
1429 fi
1430])
fc68f6b1 1431
a2794549 1432AM_CONDITIONAL(MAKE_LEAKFINDER, false)
5d620373 1433dnl Enable Leak Finding Functions
1434AC_ARG_ENABLE(leakfinder,
19b4777c
FC
1435 AC_HELP_STRING([--enable-leakfinder],
1436 [Enable Leak Finding code. Enabling this alone
1437 does nothing; you also have to modify the source
1438 code to use the leak finding functions. Probably
1439 Useful for hackers only.]),
5d620373 1440[ if test "$enableval" = "yes" ; then
eed82608 1441 AC_MSG_NOTICE([Leak-Finding enabled])
6a9f6389 1442 AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
5d620373 1443 USE_LEAKFINDER="yes"
a2794549 1444 AM_CONDITIONAL(MAKE_LEAKFINDER, true)
5d620373 1445 fi
1446])
5d620373 1447
3d674977
AJ
1448follow_xff=1
1449AC_ARG_ENABLE(follow-x-forwarded-for,
19b4777c
FC
1450 AC_HELP_STRING([--enable-follow-x-forwarded-for],
1451 [Enable support for following the X-Forwarded-For
1452 HTTP header to try to find the IP address of the
1453 original or indirect client when a request has
1454 been forwarded through other proxies.]),
3d674977 1455[ if test "$enableval" = "yes" ; then
eed82608 1456 AC_MSG_NOTICE([follow X-Forwarded-For enabled])
3d674977
AJ
1457 follow_xff=1
1458 fi
1459])
1460if test $follow_xff = 1; then
1461 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1462else
1463 AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1464fi
1465
14b32873 1466use_ident=1
3898f57f 1467AC_ARG_ENABLE(ident-lookups,
19b4777c
FC
1468 AC_HELP_STRING([--disable-ident-lookups],
1469 [This allows you to remove code that performs Ident (RFC 931) lookups.]),
3898f57f 1470[ if test "$enableval" = "no" ; then
eed82608 1471 AC_MSG_NOTICE([Disabling Ident Lookups])
14b32873 1472 use_ident=0
3898f57f 1473 fi
1474])
14b32873 1475if test $use_ident = 1; then
1476 AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
8000a965 1477 AM_CONDITIONAL(ENABLE_IDENT, true)
14b32873 1478else
1479 AC_DEFINE(USE_IDENT, 0)
8000a965 1480 AM_CONDITIONAL(ENABLE_IDENT, false)
14b32873 1481fi
3898f57f 1482
a2794549 1483AM_CONDITIONAL(USE_DNSSERVER, false)
3c573763 1484use_dnsserver=
eb824054 1485AC_ARG_ENABLE(internal-dns,
19b4777c
FC
1486 AC_HELP_STRING([--disable-internal-dns],
1487 [Prevents Squid from directly sending and receiving DNS messages,
1488 and instead enables the old external 'dnsserver' processes.]),
eb824054 1489[ if test "$enableval" = "no" ; then
eed82608 1490 AC_MSG_WARN([Disabling Internal DNS queries])
3c573763 1491 use_dnsserver="yes"
eb824054 1492 fi
1493])
3c573763 1494if test "$use_dnsserver" = "yes"; then
6a9f6389 1495 AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
a2794549 1496 AM_CONDITIONAL(USE_DNSSERVER, true)
3c573763 1497fi
eb824054 1498
9d798391 1499dnl Select Default hosts file location
1500AC_ARG_ENABLE(default-hostsfile,
19b4777c
FC
1501 AC_HELP_STRING([--enable-default-hostsfile=path],
1502 [Select default location for hosts file.
1503 See hosts_file directive in squid.conf for details]),
9d798391 1504[
1505 if test "$enableval" != "none" ; then
1506 if test -f $enableval; then
1507 OPT_DEFAULT_HOSTS=$enableval
1508 else
eed82608 1509 AC_MSG_WARN([Unable to find $enableval])
9d798391 1510 sleep 5
1511 fi
1512 else
eed82608 1513 OPT_DEFAULT_HOSTS="none"
9d798391 1514 fi
eed82608 1515 AC_MSG_NOTICE([Default hosts file set to: $enableval])
9d798391 1516],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1517AC_SUBST(OPT_DEFAULT_HOSTS)
1518
94439e4e 1519dnl Select auth schemes modules to build
1520AC_ARG_ENABLE(auth,
19b4777c
FC
1521 AC_HELP_STRING([--enable-auth="list of auth scheme modules"],
1522 [Build support for the list of authentication schemes.
1523 The default is to build support for the Basic scheme.
1524 See src/auth for a list of available modules, or
1525 Programmers Guide section authentication schemes
1526 for details on how to build your custom auth scheme
1527 module]),
94439e4e 1528[ case $enableval in
1529 yes)
1c42c4a1 1530 for dir in $srcdir/src/auth/*; do
1531 module="`basename $dir`"
1c690e30 1532 if test -d "$dir" && test "$module" != CVS; then
1c42c4a1 1533 AUTH_MODULES="$AUTH_MODULES $module"
94439e4e 1534 fi
1535 done
1536 ;;
1537 no)
1538 ;;
1c690e30 1539 *)
1540 AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1541 ;;
94439e4e 1542 esac
1543],
1544[ if test -z "$AUTH_MODULES"; then
6bf4f823 1545 AUTH_MODULES="ntlm basic digest negotiate"
94439e4e 1546 fi
1547])
1c690e30 1548if test -n "$AUTH_MODULES"; then
1549 for module in $AUTH_MODULES; do
1550 if test -d $srcdir/src/auth/$module; then
1551 :
1552 else
8b0d8e31 1553 AC_MSG_ERROR(Auth scheme $module does not exist)
1c690e30 1554 fi
7f18d2bd 1555 eval AUTH_MODULE_${module}=yes
1c690e30 1556 done
eed82608 1557 AC_MSG_NOTICE([Auth scheme modules built: $AUTH_MODULES])
d0571da6 1558else
eed82608 1559 AC_MSG_WARN([Auth scheme modules built: None])
1c690e30 1560fi
2d2b0bb7
AR
1561dnl Authentication libraries to build
1562dnl This list will not be needed when each auth library has its own Makefile
1563AUTH_LIBS_TO_BUILD=
f5691f9c 1564for module in $AUTH_MODULES; do
bcf44a2c 1565 AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD lib${module}.la"
f5691f9c 1566done
94439e4e 1567AC_SUBST(AUTH_MODULES)
2d2b0bb7 1568AC_SUBST(AUTH_LIBS_TO_BUILD)
94439e4e 1569
7762106d
FC
1570dnl bundled auth modules, in order to have handy defines for the cppunit testsuite
1571test -n "$AUTH_MODULE_basic" && AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built])
1572test -n "$AUTH_MODULE_digest" && AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built])
1573test -n "$AUTH_MODULE_ntlm" && AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
1574test -n "$AUTH_MODULE_negotiate" && AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built])
1575
94439e4e 1576dnl Select basic auth scheme helpers to build
7f18d2bd 1577if test -n "$AUTH_MODULE_basic"; then
1578 BASIC_AUTH_HELPERS="all"
1579fi
94439e4e 1580AC_ARG_ENABLE(basic-auth-helpers,
19b4777c
FC
1581 AC_HELP_STRING([--enable-basic-auth-helpers="list of helpers"],
1582 [This option selects which basic scheme proxy_auth
1583 helpers to build and install as part of the normal
1584 build process. For a list of available
1585 helpers see the helpers/basic_auth directory.]),
94439e4e 1586[ case "$enableval" in
7f18d2bd 1587 yes)
1588 BASIC_AUTH_HELPERS="all"
1c690e30 1589 ;;
94439e4e 1590 no)
7f18d2bd 1591 BASIC_AUTH_HELPERS=""
1c690e30 1592 ;;
94439e4e 1593 *)
7f18d2bd 1594 if test -z "$AUTH_MODULE_basic"; then
eed82608 1595 AC_MSG_WARN([Basic auth helpers selected without the basic scheme enabled])
7f18d2bd 1596 sleep 15
1597 fi
1c690e30 1598 BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1599 ;;
94439e4e 1600 esac
1601])
7f18d2bd 1602if test "$BASIC_AUTH_HELPERS" = "all" ; then
1603 BASIC_AUTH_HELPERS=""
1604 for dir in $srcdir/helpers/basic_auth/*; do
1605 helper="`basename $dir`"
1606 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1607 BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1608 fi
1609 done
1610fi
fc83a946 1611if test -n "$BASIC_AUTH_HELPERS"; then
20d8bfe4 1612 for helper in $BASIC_AUTH_HELPERS; do
1c690e30 1613 if test -d $srcdir/helpers/basic_auth/$helper; then
2adff954 1614 case $helper in
1615 SASL)
1616 require_sasl=yes
1617 ;;
1618 esac
20d8bfe4 1619 else
8b0d8e31 1620 AC_MSG_ERROR(Basic auth helper $helper does not exist)
20d8bfe4 1621 fi
1622 done
eed82608 1623 AC_MSG_NOTICE([Basic auth helpers built: $BASIC_AUTH_HELPERS])
94439e4e 1624fi
fc83a946 1625AC_SUBST(BASIC_AUTH_HELPERS)
94439e4e 1626
1627dnl Select ntlm auth helpers to build
7f18d2bd 1628if test -n "$AUTH_MODULE_ntlm"; then
1629 NTLM_AUTH_HELPERS="all"
1630fi
94439e4e 1631AC_ARG_ENABLE(ntlm-auth-helpers,
19b4777c
FC
1632 AC_HELP_STRING([--enable-ntlm-auth-helpers="list of helpers"],
1633 [This option selects which proxy_auth ntlm helpers
1634 to build and install as part of the normal build
1635 process. For a list of available helpers see
1636 the helpers/ntlm_auth directory.]),
380f0a87 1637[ case "$enableval" in
1638 yes)
7f18d2bd 1639 NTLM_AUTH_HELPERS="all"
1c690e30 1640 ;;
380f0a87 1641 no)
7f18d2bd 1642 NTLM_AUTH_HELPERS=""
1c690e30 1643 ;;
380f0a87 1644 *)
1c690e30 1645 NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1646 ;;
380f0a87 1647 esac
1648])
7f18d2bd 1649if test "$NTLM_AUTH_HELPERS" = "all" ; then
1650 NTLM_AUTH_HELPERS=""
1651 for dir in $srcdir/helpers/ntlm_auth/*; do
1652 helper="`basename $dir`"
1653 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1654 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1655 fi
1656 done
1657fi
94439e4e 1658if test -n "$NTLM_AUTH_HELPERS"; then
20d8bfe4 1659 for helper in $NTLM_AUTH_HELPERS; do
1c690e30 1660 if test -d $srcdir/helpers/ntlm_auth/$helper; then
1661 :
20d8bfe4 1662 else
8b0d8e31 1663 AC_MSG_ERROR(NTLM Auth helper $helper does not exist)
20d8bfe4 1664 fi
1665 done
eed82608 1666 AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS])
380f0a87 1667fi
94439e4e 1668AC_SUBST(NTLM_AUTH_HELPERS)
1669
6e785d85 1670dnl Select negotiate auth helpers to build
7f18d2bd 1671if test -n "$AUTH_MODULE_negotiate"; then
1672 NEGOTIATE_AUTH_HELPERS="all"
1673fi
6e785d85 1674AC_ARG_ENABLE(negotiate-auth-helpers,
e702812e
FC
1675 AC_HELP_STRING([--enable-negotiate-auth-helpers="list of helpers"],
1676 [This option selects which proxy_auth negotiate helpers
1677 to build and install as part of the normal build
1678 process. For a list of available helpers see
1679 the helpers/negotiate_auth directory.]),
6e785d85 1680[ case "$enableval" in
1681 yes)
7f18d2bd 1682 NEGOTIATE_AUTH_HELPERS="all"
6e785d85 1683 ;;
1684 no)
7f18d2bd 1685 NEGOTIATE_AUTH_HELPERS=""
6e785d85 1686 ;;
1687 *)
1688 NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1689 ;;
1690 esac
1691])
7f18d2bd 1692if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1693 NEGOTIATE_AUTH_HELPERS=""
1694 for dir in $srcdir/helpers/negotiate_auth/*; do
1695 helper="`basename $dir`"
1696 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1697 NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1698 fi
1699 done
1700fi
6e785d85 1701if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1702 for helper in $NEGOTIATE_AUTH_HELPERS; do
1703 if test -d $srcdir/helpers/negotiate_auth/$helper; then
1704 :
1705 else
8b0d8e31 1706 AC_MSG_ERROR(Negotiate Auth helper $helper does not exist)
6e785d85 1707 fi
1708 done
eed82608 1709 AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS])
6e785d85 1710fi
1711AC_SUBST(NEGOTIATE_AUTH_HELPERS)
95329c22 1712AC_CONFIG_SUBDIRS(helpers/negotiate_auth/squid_kerb_auth)
6e785d85 1713
2d70df72 1714dnl Select digest auth scheme helpers to build
7f18d2bd 1715if test -n "$AUTH_MODULE_digest"; then
1716 DIGEST_AUTH_HELPERS=all
1717fi
2d70df72 1718AC_ARG_ENABLE(digest-auth-helpers,
e702812e
FC
1719 AC_HELP_STRING([--enable-digest-auth-helpers="list of helpers"],
1720 [This option selects which digest scheme authentication
1721 helpers to build and install as part of the normal build
1722 process. For a list of available helpers see the
1723 helpers/digest_auth directory.]),
2d70df72 1724[ case "$enableval" in
1725 yes)
7f18d2bd 1726 DIGEST_AUTH_HELPERS="all"
1c690e30 1727 ;;
2d70df72 1728 no)
7f18d2bd 1729 DIGEST_AUTH_HELPERS=""
1c690e30 1730 ;;
2d70df72 1731 *)
1c690e30 1732 DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1733 ;;
2d70df72 1734 esac
1735])
7f18d2bd 1736if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1737 DIGEST_AUTH_HELPERS=""
1738 for dir in $srcdir/helpers/digest_auth/*; do
1739 helper="`basename $dir`"
1740 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1741 DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1742 fi
1743 done
1744fi
2d70df72 1745if test -n "$DIGEST_AUTH_HELPERS"; then
1daefc1a 1746 for helper in $DIGEST_AUTH_HELPERS; do
1747 if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1748 :
1749 else
8b0d8e31 1750 AC_MSG_ERROR(digest auth helper $helper does not exist)
1daefc1a 1751 fi
1752 done
eed82608 1753 AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
2d70df72 1754fi
1755AC_SUBST(DIGEST_AUTH_HELPERS)
380f0a87 1756
6437ac71 1757dnl Enable "NTLM fail open"
1758AC_ARG_ENABLE(ntlm-fail-open,
e702812e
FC
1759 AC_HELP_STRING([--enable-ntlm-fail-open],
1760 [Enable NTLM fail open, where a helper that fails one of the
1761 Authentication steps can allow squid to still authenticate
1762 the user.]),
6437ac71 1763[ if test "$enableval" = "yes" ; then
6a9f6389 1764 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 1765 fi
1766])
1767
c6588c68 1768dnl Select external_acl helpers to build
7f18d2bd 1769EXTERNAL_ACL_HELPERS=all
c6588c68 1770AC_ARG_ENABLE(external-acl-helpers,
e702812e
FC
1771 AC_HELP_STRING([--enable-external-acl-helpers="list of helpers"],
1772 [This option selects which external_acl helpers to
1773 build and install as part of the normal build
1774 process. For a list of available helpers see the
1775 helpers/external_acl directory.]),
c6588c68 1776[ case "$enableval" in
1777 yes)
7f18d2bd 1778 EXTERNAL_ACL_HELPERS=all
1c690e30 1779 ;;
c6588c68 1780 no)
7f18d2bd 1781 EXTERNAL_ACL_HELPERS=""
1c690e30 1782 ;;
c6588c68 1783 *)
1c690e30 1784 EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1785 ;;
c6588c68 1786 esac
1787])
7f18d2bd 1788if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
39ee7289 1789 EXTERNAL_ACL_HELPERS=""
7f18d2bd 1790 for dir in $srcdir/helpers/external_acl/*; do
1791 helper="`basename $dir`"
1792 if test -f $dir/config.test && sh $dir/config.test "$@"; then
1793 EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1794 fi
1795 done
1796fi
c6588c68 1797if test -n "$EXTERNAL_ACL_HELPERS"; then
20d8bfe4 1798 for helper in $EXTERNAL_ACL_HELPERS; do
1799 if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1800 :
1801 else
8b0d8e31 1802 AC_MSG_ERROR(external acl helper $helper does not exist)
20d8bfe4 1803 fi
1804 done
eed82608 1805 AC_MSG_NOTICE([External acl helpers built: $EXTERNAL_ACL_HELPERS])
c6588c68 1806fi
1807AC_SUBST(EXTERNAL_ACL_HELPERS)
1808
3a125142 1809AC_ARG_WITH(valgrind-debug,
e702812e
FC
1810 AC_HELP_STRING([--with-valgrind-debug],
1811 [Include debug instrumentation for use with valgrind]),
b4bab919 1812[ case $withval in
1813 yes)
1814 valgrind=1
1815 ;;
1816 no)
1817 valgrind=
1818 ;;
1819 *)
1820 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
1821 valgrind=1
1822 ;;
1823 esac
1824 if test $valgrind; then
ad32c661
AJ
1825 AC_CHECK_HEADERS(valgrind/memcheck.h,
1826 [ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
eed82608
AJ
1827 AC_MSG_NOTICE([Valgrind debug support enabled]) ],
1828 [ AC_MSG_WARN([Valgrind header not found. Valgrind support disabled.]) ]
ad32c661 1829 )
b4bab919 1830 fi
1831])
1832
d96ceb8e 1833dnl Disable "memPools" code
1834AC_ARG_ENABLE(mempools,
e702812e
FC
1835 AC_HELP_STRING([--disable-mempools],
1836 [Disable memPools. Note that this option now simply sets the
1837 default behaviour. Specific classes can override this at runtime, and
1838 only lib/MemPool.c needs to be altered to change the squid-wide
1839 default for all classes.]),
d96ceb8e 1840[ if test "$enableval" = "no" ; then
eed82608 1841 AC_MSG_NOTICE([memPools disabled])
6a9f6389 1842 AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
3e0dc9a8 1843 else
1844 AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 1845 fi
3e0dc9a8 1846],
1847[ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
d96ceb8e 1848])
1849
0e657244 1850dnl Enable WIN32 Service compile mode
1851AC_ARG_ENABLE(win32-service,
e702812e
FC
1852 AC_HELP_STRING([--enable-win32-service],
1853 [Compile Squid as a WIN32 Service.
1854 Works only on MS-Windows platforms (NT and up).]),
0e657244 1855[ if test "$enableval" = "yes" ; then
eed82608 1856 AC_MSG_NOTICE([Enabling WIN32 run service mode])
0e657244 1857 AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
1858 fi
1859])
1860
b1485ff8 1861
2adff954 1862dnl Check for Cyrus SASL
1863if test "$require_sasl" = "yes"; then
1864 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
1865 if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
eed82608 1866 AC_MSG_NOTICE([using SASL2])
2adff954 1867 LIBSASL="-lsasl2"
1868 else
1869 if test "$ac_cv_header_sasl_h" = "yes"; then
eed82608 1870 AC_MSG_NOTICE([using SASL])
2adff954 1871 LIBSASL="-lsasl"
1872 else
8b0d8e31 1873 AC_MSG_ERROR(Neither SASL nor SASL2 found)
2adff954 1874 fi
1875 fi
1876 AC_SUBST(LIBSASL)
1877fi
1878
3c573763 1879dnl Disable "unlinkd" code
fe0810ac 1880AC_ARG_ENABLE(unlinkd,
e702812e 1881 AC_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]),
fe0810ac 1882[ if test "$enableval" = "no" ; then
3c573763 1883 use_unlinkd=no
fe0810ac 1884 else
3c573763 1885 use_unlinkd=yes
fe0810ac 1886 fi
1887],[
1888 # Here we should probably use some magic depending on the selected
1889 # storage models
3c573763 1890 use_unlinkd=yes
fe0810ac 1891])
3c573763 1892if test "$use_unlinkd" = "yes"; then
eed82608 1893 AC_MSG_NOTICE([unlinkd enabled])
6a9f6389 1894 AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
a2794549 1895 AM_CONDITIONAL(ENABLE_UNLINKD, true)
fe0810ac 1896else
eed82608 1897 AC_MSG_NOTICE([unlinkd disabled])
a2794549 1898 AM_CONDITIONAL(ENABLE_UNLINKD, false)
fe0810ac 1899fi
fe0810ac 1900
ce3d30fb 1901dnl Enable backtraces on fatal errors
1902AC_ARG_ENABLE(stacktraces,
e702812e
FC
1903 AC_HELP_STRING([--enable-stacktraces],
1904 [Enable automatic call backtrace on fatal errors]),
ce3d30fb 1905[ if test "$enableval" = "yes" ; then
eed82608 1906 AC_MSG_NOTICE([Enabling automatic stack backtraces on fatal errors])
6a9f6389 1907 AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
ce3d30fb 1908 fi
1909])
1910
88bfe092 1911AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1912dnl Enable USE_XPROF_STATS
1913AC_ARG_ENABLE(cpu-profiling,
e702812e
FC
1914 AC_HELP_STRING([--enable-cpu-profiling],
1915 [Enable instrumentation to try and understand how CPU power
1916 is spent by squid, by enabling specific probes in selected
1917 functions. New probes can only be added by modifying the source code.
1918 It is meant to help developers in optimizing performance
1919 of Squid internal functions.
1920 If you are not developer you shouldn't enable this,
1921 as it slows squid down somewhat. See lib/Profiler.c for more details.]),
88bfe092 1922[ if test "$enableval" = "yes" ; then
eed82608 1923 AC_MSG_NOTICE([Enabling cpu-profiling])
6a9f6389 1924 AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
88bfe092 1925 AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1926 fi
1927])
1928
f66a9ef4 1929dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
2092c67d 1930AC_ARG_ENABLE(x-accelerator-vary,
e702812e
FC
1931 AC_HELP_STRING([--enable-x-accelerator-vary],
1932 [Enable support for the X-Accelerator-Vary
1933 HTTP header. Can be used to indicate
1934 variance within an accelerator setup.
1935 Typically used together with other code
1936 that adds custom HTTP headers to the requests.]),
f66a9ef4 1937[ if test "$enableval" = "yes" ; then
eed82608 1938 AC_MSG_NOTICE([Enabling support for X-Accelerator-Vary])
6a9f6389 1939 AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
f66a9ef4 1940 fi
1941])
1942
cc192b50 1943dnl Enable IPv6 support
1944AC_MSG_CHECKING([whether to enable IPv6])
2c520d90 1945use_ipng=yes
cc192b50 1946AC_ARG_ENABLE(ipv6,
aa952ca8
AJ
1947 AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1948[ if test "x$enableval" = "xyes" ; then
1949 AC_MSG_RESULT(yes)
1950 else
1951 AC_MSG_RESULT(no)
1952 use_ipng=no
1953 fi
1954],[AC_MSG_RESULT(yes)])
1955
1956if test "$use_ipng" = "yes"; then
0d7a087c
AJ
1957 SAVED_LIBS="$LIBS"
1958 dnl Solaris 10/11 requires -lsocket
1959 case "$host" in
1960 *-solaris*)
1961 LIBS="$LIBS -lsocket"
1962 ;;
1963 *)
1964 ;;
1965 esac
aa952ca8 1966 AC_CACHE_CHECK([if PF_INET6 is available], $use_ipng,
e46d1db0 1967 AC_TRY_RUN([ /* PF_INET6 available check */
cc192b50 1968# include <sys/types.h>
1969# include <sys/socket.h>
e46d1db0 1970 int main() {
cc192b50 1971 if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
e46d1db0 1972 return 1;
cc192b50 1973 else
e46d1db0 1974 return 0;
cc192b50 1975 }
1976 ],
aa952ca8 1977 [ AC_MSG_RESULT(yes)
7f85cca1 1978 use_ipng=yes
0d7a087c 1979 SAVED_LIBS="$LIBS"
cc192b50 1980 ],
2c520d90
AJ
1981 [ AC_MSG_RESULT(no)
1982 use_ipng=no
cc192b50 1983 ])
1984 )
0d7a087c 1985 LIBS="$SAVED_LIBS"
aa952ca8 1986fi
7f85cca1
AJ
1987
1988if test "$use_ipng" = "yes"; then
1989
aa952ca8
AJ
1990AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
1991
48f05c97
AJ
1992dnl Check for IPv6 Windows Vista option
1993dnl Also useful for other OS with hybrid-stack defaults turned OFF
1994AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
1995
cc192b50 1996dnl Check for Windows XP option
1997AC_MSG_CHECKING([for IPv6 split-stack requirement])
1998AC_ARG_WITH(ipv6-split-stack,
21d5413e
AJ
1999 AC_HELP_STRING([--with-ipv6-split-stack],
2000 [Enable experimental split-stack support for Windows XP. Requires IPv6.]),
48f05c97
AJ
2001 [ AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
2002 AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2003 AC_MSG_RESULT(yes)
2004 ],
7f85cca1 2005 [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(no)]
cc192b50 2006)
2007
e46d1db0
AJ
2008dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2009AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2010 ac_cv_have_sin6_len_in_struct_sai, [
2011 AC_TRY_COMPILE([
2012#include <sys/types.h>
2013#include <sys/socket.h>
2014#include <netinet/in.h>
2015 ],
2016 [ struct sockaddr_in6 s; s.sin6_len = 1; ],
2017 [ ac_cv_have_sin6_len_in_struct_sai="yes" ],
2018 [ ac_cv_have_sin6_len_in_struct_sai="no" ]
2019 )
2020])
2021if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2022 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2023else
2024 AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2025fi
2026
2027
2c520d90
AJ
2028else
2029 # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
eed82608 2030 AC_MSG_WARN([IPv6 is not available on this system.])
2c520d90
AJ
2031 AC_DEFINE(USE_IPV6,0,[Enable support for IPv6])
2032 AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
2c520d90 2033 AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
cc192b50 2034fi
2035
7172612f 2036AC_ARG_ENABLE(zph-qos,
e702812e 2037 AC_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]),
7172612f 2038[ if test "$enableval" = "yes" ; then
eed82608 2039 AC_MSG_NOTICE([ZPH QOS enabled])
7172612f
AJ
2040 AC_DEFINE(USE_ZPH_QOS,1,
2041 [ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
2042 When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
2043 fi
2044])
2045
8c37ea44
AJ
2046dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2047AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2048 ac_cv_have_ss_len_in_struct_ss, [
2049 AC_TRY_COMPILE([
2050#include <sys/types.h>
2051#include <sys/socket.h>
cda4116f 2052#include <netinet/in.h>
8c37ea44
AJ
2053 ],
2054 [ struct sockaddr_storage s; s.ss_len = 1; ],
2055 [ ac_cv_have_ss_len_in_struct_ss="yes" ],
2056 [ ac_cv_have_ss_len_in_struct_ss="no" ]
2057 )
2058])
2059if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2060 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2061else
2062 AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2063fi
2064
2065dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2066AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2067 ac_cv_have_sin_len_in_struct_sai, [
2068 AC_TRY_COMPILE([
2069#include <sys/types.h>
2070#include <sys/socket.h>
12f45551 2071#include <netinet/in.h>
8c37ea44
AJ
2072 ],
2073 [ struct sockaddr_in s; s.sin_len = 1; ],
2074 [ ac_cv_have_sin_len_in_struct_sai="yes" ],
2075 [ ac_cv_have_sin_len_in_struct_sai="no" ]
2076 )
2077])
2078if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
2079 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2080else
2081 AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2082fi
2083
a41b3435
AJ
2084dnl --with-maxfd present for compatibility with Squid-2.
2085dnl undocumented in ./configure --help to encourage using the Squid-3 directive.
2086AC_ARG_WITH(maxfd,,
2087[
2088 case ${withval} in
2089 [[0-9]]*)
2090 squid_filedescriptors_num=$withval
2091 ;;
2092 *)
2093 AC_MSG_ERROR(--with-maxfd expects a numeric argument)
2094 ;;
2095 esac
2096])
f49be7d1 2097AC_ARG_WITH(filedescriptors,
e702812e
FC
2098 AC_HELP_STRING([--with-filedescriptors=NUMBER],
2099 [Force squid to support NUMBER filedescriptors]),
8b0d8e31
AJ
2100[
2101 case ${withval} in
2102 [[0-9]]*)
2103 squid_filedescriptors_num=$withval
2104 ;;
2105 *)
2106 AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
2107 ;;
2108 esac
2109])
f49be7d1 2110
8b5e106b 2111AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
2112if $CPPUNITCONFIG --help >/dev/null; then
eed82608 2113 AC_MSG_NOTICE([using system installed cppunit])
8b5e106b 2114 SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2115 SQUID_CPPUNIT_LA=''
2116 SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2117else
eed82608 2118 AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
63d03edb 2119 SQUID_CPPUNIT_LA=''
2120 SQUID_CPPUNIT_LIBS=''
2121 SQUID_CPPUNIT_INC=''
f5691f9c 2122fi
8b5e106b 2123
f5691f9c 2124AC_ARG_WITH(cppunit-basedir,
21d5413e 2125 AC_HELP_STRING([--with-cppunit-basedir=PATH],
b0e7900f
FC
2126 [Path where the cppunit headers are libraries are found
2127 for unit testing.]),
f5691f9c 2128[ if test -f $withval/include/cppunit/TestCase.h; then
eed82608 2129 AC_MSG_NOTICE([Using cppunit includes from $withval])
f5691f9c 2130 SQUID_CPPUNIT_INC="-I${withval}/include"
2131 else
8b0d8e31 2132 AC_MSG_ERROR(Cannot find cppunit at $withval)
f5691f9c 2133 fi
2134 if test -f $withval/lib/libcppunit.la; then
eed82608 2135 AC_MSG_NOTICE([Using cppunit lib from $withval])
549b1e60 2136 SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
8b5e106b 2137 SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
f5691f9c 2138 else
8b0d8e31 2139 AC_MSG_ERROR(Cannot find cppunit at $withval)
f5691f9c 2140 exit 1
2141 fi
f5691f9c 2142])
8b5e106b 2143AC_SUBST(SQUID_CPPUNIT_LIBS)
f5691f9c 2144AC_SUBST(SQUID_CPPUNIT_LA)
2145AC_SUBST(SQUID_CPPUNIT_INC)
f5691f9c 2146
fd9aaa3e 2147# Force some compilers to use ANSI features
2148#
2149case "$host" in
2150 alpha-dec-osf*)
2151 if test "$ac_cv_prog_CC" = "cc" ; then
eed82608 2152 AC_MSG_NOTICE([adding '-std1' to cc args for $host])
fd9aaa3e 2153 CC="cc -std1";
2154 ac_cv_prog_CC="$CC"
2155 fi
2156 ;;
c68e9c6b 2157 *-hp-hpux*)
2158 if test "$ac_cv_prog_CC" = "cc" ; then
eed82608 2159 AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
c68e9c6b 2160 CC="cc -Ae";
2161 ac_cv_prog_CC="$CC"
2162 fi
2163 ;;
fd9aaa3e 2164esac
2165
090089c4 2166dnl Check for programs
2167AC_PROG_CPP
2168AC_PROG_INSTALL
090089c4 2169AC_PROG_LN_S
81280a96 2170AC_PATH_PROG(SH, sh, /bin/sh)
d9f67e6f 2171AC_PATH_PROG(FALSE, false, /usr/bin/false)
2172AC_PATH_PROG(TRUE, true, /usr/bin/true)
2173AC_PATH_PROG(RM, rm, $FALSE)
2174AC_PATH_PROG(MV, mv, $FALSE)
2175AC_PATH_PROG(MKDIR, mkdir, $FALSE)
090089c4 2176AC_PATH_PROG(LN, ln, cp)
a2794549 2177dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
d69f0c78 2178AC_PROG_EGREP
6ad85e8a 2179
d69f0c78 2180AC_PATH_PROG(PERL, perl, none)
4e9d8e26 2181if test "$ac_cv_path_PERL" = "none"; then
eed82608 2182 AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
4e9d8e26 2183fi
2184
6ad85e8a 2185case "$host" in
2186 *-hp-hpux*)
eed82608 2187 AC_MSG_NOTICE([Disabling 'ranlib' for HP-UX...])
6ad85e8a 2188 RANLIB=":"
2189 ;;
2190esac
2191
2192dnl set $(AR)
d69f0c78 2193AC_PATH_PROG(AR, ar, $FALSE)
6ad85e8a 2194AR_R="$AR r"
2195case "$host" in
2196 *-next-nextstep3)
2197 AR="libtool -o"
2198 ;;
2199esac
2200AC_SUBST(AR_R)
090089c4 2201
2202dnl Check for headers
2203AC_HEADER_DIRENT
2204AC_HEADER_STDC
db40ae20 2205
2206AC_CHECK_HEADERS( \
db40ae20 2207 arpa/inet.h \
30a4f2a8 2208 arpa/nameser.h \
9441aa34 2209 assert.h \
db40ae20 2210 bstring.h \
db40ae20 2211 crypt.h \
30a4f2a8 2212 ctype.h \
2213 errno.h \
ce3d30fb 2214 execinfo.h \
db40ae20 2215 fcntl.h \
42ad37af 2216 fnmatch.h \
9c1d8929 2217 getopt.h \
52303a3d 2218 glob.h \
88738790 2219 gnumalloc.h \
30a4f2a8 2220 grp.h \
5cafc1d6 2221 ip_compat.h \
42b51993 2222 ip_fil_compat.h \
5cafc1d6 2223 ip_fil.h \
2224 ip_nat.h \
dbc5782a 2225 ipl.h \
30a4f2a8 2226 libc.h \
6ad85e8a 2227 limits.h \
30a4f2a8 2228 malloc.h \
e0bddc45 2229 math.h \
db40ae20 2230 memory.h \
b075cbb1 2231 mount.h \
30a4f2a8 2232 netdb.h \
db40ae20 2233 netinet/in.h \
cc192b50 2234 netinet/in_systm.h \
42b51993 2235 netinet/ip_fil_compat.h \
1f7c9178 2236 openssl/err.h \
2237 openssl/md5.h \
2238 openssl/ssl.h \
cc192b50 2239 netinet/tcp.h \
a7ad6e4e 2240 openssl/engine.h \
4da086c4 2241 paths.h \
dcfe6390 2242 poll.h \
30a4f2a8 2243 pwd.h \
b5e4d7d4 2244 shadow.h \
30a4f2a8 2245 regex.h \
c68e9c6b 2246 sched.h \
30a4f2a8 2247 signal.h \
2248 stdarg.h \
2249 stddef.h \
2250 stdio.h \
db40ae20 2251 stdlib.h \
2252 string.h \
2253 strings.h \
0a4e8536 2254 sys/bitypes.h \
f9576890 2255 sys/bswap.h \
2256 sys/endian.h \
db40ae20 2257 sys/file.h \
5cafc1d6 2258 sys/ioctl.h \
30a4f2a8 2259 sys/param.h \
62ae0622 2260 sys/prctl.h \
3d4022fa 2261 sys/md5.h \
77e4c0c9 2262 sys/msg.h \
30a4f2a8 2263 sys/resource.h \
db40ae20 2264 sys/select.h\
30a4f2a8 2265 sys/socket.h \
2266 sys/stat.h \
b075cbb1 2267 sys/statvfs.h \
3c641669 2268 syscall.h \
30a4f2a8 2269 sys/syscall.h \
db40ae20 2270 sys/time.h \
2271 sys/types.h \
30a4f2a8 2272 sys/un.h \
b075cbb1 2273 sys/vfs.h \
30a4f2a8 2274 sys/wait.h \
db40ae20 2275 syslog.h \
30a4f2a8 2276 time.h \
2277 unistd.h \
3c641669 2278 utime.h \
30a4f2a8 2279 varargs.h \
77d6bd88 2280 byteswap.h \
2281 glib.h \
60d096f4 2282 stdint.h \
2283 inttypes.h \
3c641669 2284 grp.h \
94331f58 2285 db.h \
329ce686 2286 db_185.h \
2287 sys/capability.h
db40ae20 2288)
2289
fc68f6b1 2290AC_CHECK_HEADERS(
2291 linux/netfilter_ipv4.h \
2292 linux/netfilter_ipv4/ip_tproxy.h \
2293,,,
dcd1dc78 2294SQUID_DEFAULT_INCLUDES
2295#if HAVE_LIMITS_H
2296#include <limits.h>
2297#endif
a74968c2
AJ
2298/* Netfilter ip(6)tables v1.4.0 has broken headers */
2299#if HAVE_NETINET_IN_H
2300#include <netinet/in.h>
2301#endif
dcd1dc78 2302)
2303
d1e5191e 2304dnl *BSD dont include the depenencies for all their net/ and netinet/ files
c92b4732 2305dnl We must include a few basic type headers for them to work.
d1e5191e
AJ
2306AC_CHECK_HEADERS( \
2307 net/if.h \
5a3237b0 2308 netinet/if_ether.h\
d1e5191e
AJ
2309 netinet/icmp6.h \
2310 netinet/ip.h \
2311 netinet/ip6.h \
5a3237b0 2312 netinet/ip_compat.h\
2313 netinet/ip_fil.h\
d1e5191e 2314 netinet/ip_icmp.h \
77e4c0c9 2315 netinet/ip_nat.h\
dbc5782a 2316 netinet/ipl.h \
d1e5191e 2317 net/pfvar.h \
77e4c0c9 2318 sys/mount.h\
d1e5191e
AJ
2319 resolv.h \
2320,,,
2321SQUID_BSDNET_INCLUDES)
5a3237b0 2322
a1559187 2323AC_CHECK_HEADERS([libxml/parser.h], [], [
2324 SAVED_CPPFLAGS="$CPPFLAGS"
2325 CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
2326 unset ac_cv_header_libxml_parser_h
2327 AC_CHECK_HEADERS([libxml/parser.h], [], [
2328 CPPFLAGS="$SAVED_CPPFLAGS"
2329 ])
2330 ])
2331
aee0606f 2332AC_C_CONST
d57288d2 2333AC_C_BIGENDIAN
aee0606f 2334
6a9f6389 2335AC_STRUCT_TM
2336AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2337#if TM_IN_SYS_TIME
2338#if HAVE_SYS_TIME_H
2339#include <sys/time.h>
2340#endif
2341#elif HAVE_TIME_H
2342#include <time.h>
2343#endif
5c51415d 2344])
46c883ed 2345
6a9f6389 2346AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2347#if HAVE_SYS_TYPES_H
2348#include <sys/types.h>
2349#endif
eb824054 2350#if HAVE_MALLOC_H
2351#include <malloc.h>
6a9f6389 2352#endif])
eb824054 2353
6a9f6389 2354AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2355#if HAVE_SYS_TYPES_H
2356#include <sys/types.h>
2357#endif
2358#if HAVE_MALLOC_H
2359#include <malloc.h>
2360#endif])
090089c4 2361
08caf8c6 2362dnl Override rusage() detect on MinGW because is emulated in source code
2363case "$host_os" in
2364 mingw|mingw32)
2365 AC_DEFINE(HAVE_STRUCT_RUSAGE)
2366 ac_cv_func_getrusage='yes'
eed82608 2367 AC_MSG_NOTICE([Using own rusage on Windows.])
08caf8c6 2368 ;;
2369 *)
2370 AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
8ff51bba 2371#if HAVE_SYS_TIME_H
2372#include <sys/time.h>
2373#endif
b54a6789 2374#if HAVE_SYS_RESOURCE_H
2375#include <sys/resource.h>
6a9f6389 2376#endif])
08caf8c6 2377 ;;
2378esac
b54a6789 2379
6a9f6389 2380AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2381#if HAVE_SYS_TYPES_H
2382#include <sys/types.h>
2383#endif
a025a745 2384#include <netinet/in.h>
2385#include <netinet/in_systm.h>
6ad85e8a 2386#include <netinet/ip.h>
b05490a8 2387#if defined (__linux__) || defined (__CYGWIN__)
6ad85e8a 2388#define ip_hl ihl
2389#endif
2390#ifndef __linux__
b05490a8 2391#ifndef __CYGWIN__
6ad85e8a 2392#define iphdr ip
b05490a8 2393#endif
6a9f6389 2394#endif])
a025a745 2395
090089c4 2396dnl Check for typedefs
77d6bd88 2397AC_CHECK_SIZEOF(void *)
090089c4 2398
0409a509 2399dnl 8 bit integers - int8_t
2400dnl if this is defined we trust it to be 8 bits
2401AC_CHECK_TYPE(int8_t,[
2402 AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2403 AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2404 ],,SQUID_DEFAULT_INCLUDES)
2405
2406dnl fallback #1
2407AC_CHECK_TYPE(char,[
2408 AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2409 AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2410 ],,SQUID_DEFAULT_INCLUDES)
2411
2412dnl unsigned 8 bit ints - u_int8_t
2413dnl if this is defined we trust it to be 8 bits
2414AC_CHECK_TYPE(u_int8_t,[
2415 AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2416 AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2417 ],,SQUID_DEFAULT_INCLUDES)
2418
2419dnl fallback #1
2420dnl if this is defined we trust it to be 8 bits
2421AC_CHECK_TYPE(uint8_t,[
2422 AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2423 AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2424 ],,SQUID_DEFAULT_INCLUDES)
2425
2426dnl 16 bit integers - int16_t
6a9f6389 2427dnl if this is defined we trust it to be 16 bits
62266438 2428AC_CHECK_TYPE(int16_t,[
2429 AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2430 AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2431 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2432
2433dnl fallback #1
2434AC_CHECK_TYPE(short,[
856e69c5 2435 AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2436 AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2437 ],,SQUID_DEFAULT_INCLUDES)
2438
2439dnl fallback #2
2440AC_CHECK_TYPE(int,[
856e69c5 2441 AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2442 AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2443 ],,SQUID_DEFAULT_INCLUDES)
2444
2445dnl unsigned 16 bit ints - u_int16_t
2446dnl if this is defined we trust it to be 16 bits
62266438 2447AC_CHECK_TYPE(u_int16_t,[
2448 AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2449 AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2450 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2451
2452dnl fallback #1
2453dnl if this is defined we trust it to be 16 bits
62266438 2454AC_CHECK_TYPE(uint16_t,[
2455 AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2456 AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2457 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2458
2459dnl 32 bit signed int - int32_t
2460dnl if this is defined we trust it to be 32 bits
62266438 2461AC_CHECK_TYPE(int32_t,[
2462 AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2463 AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2464 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2465
2466dnl fallback #1
2467AC_CHECK_TYPE(long,[
856e69c5 2468 AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2469 AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2470 ],,SQUID_DEFAULT_INCLUDES)
2471
2472dnl 32 bit unsigned int - u_int32_t
2473dnl if this is defined we trust it to be 32 bits
62266438 2474AC_CHECK_TYPE(u_int32_t,[
2475 AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2476 AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2477 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2478
2479dnl fallback #1
2480dnl if this is defined we trust it to be 32 bits
62266438 2481AC_CHECK_TYPE(uint32_t,[
2482 AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2483 AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2484 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2485
2486dnl 64 bit signed - int64_t
2487dnl if this is defind we trust it to be 64 bits
62266438 2488AC_CHECK_TYPE(int64_t,[
2489 AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2490 AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2491 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2492
2493dnl fallback #1
2494dnl if this is defind we trust it to be 64 bits
62266438 2495AC_CHECK_TYPE(__int64,[
2496 AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2497 AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2498 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2499
2500dnl fallback #2
2501AC_CHECK_TYPE(long long,[
856e69c5 2502 AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2503 AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2504 ],,SQUID_DEFAULT_INCLUDES)
2505
2506dnl 64 bit unsigned - u_int64_t
2507dnl if this is defind we trust it to be 64 bits
62266438 2508AC_CHECK_TYPE(u_int64_t,[
2509 AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2510 AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2511 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2512
2513dnl fallback #1
2514dnl if this is defind we trust it to be 64 bits
62266438 2515AC_CHECK_TYPE(uint64_t,[
2516 AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2517 AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2518 ],,SQUID_DEFAULT_INCLUDES)
6a9f6389 2519
588e71df 2520dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2521dnl that is incompatible with the updated Solaris header files.
2522dnl For this reason, we must check if pad128_t and upad128_t are defined.
2523AC_CHECK_TYPE(pad128_t,
2524 AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2525 ,SQUID_DEFAULT_INCLUDES)
2526
2527AC_CHECK_TYPE(upad128_t,
2528 AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2529 ,SQUID_DEFAULT_INCLUDES)
2530
6a9f6389 2531AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2532AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2533 AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2534AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
856e69c5 2535AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
6a9f6389 2536 AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2537AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2538AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
adcceb47 2539
77d6bd88 2540dnl Check for special functions
2541AC_FUNC_ALLOCA
2542
6a9f6389 2543AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2544#include <sys/types.h>
6637e3a5 2545#include <sys/socket.h>
2546#if STDC_HEADERS
2547#include <stdlib.h>
2548#include <stddef.h>
6a9f6389 2549#endif])
6637e3a5 2550
6a9f6389 2551AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
aea1be68 2552#include <sys/ipc.h>
6a9f6389 2553#include <sys/msg.h>])
aea1be68 2554
090089c4 2555dnl Check for needed libraries
30a4f2a8 2556AC_CHECK_LIB(nsl, main)
6716b242 2557AC_CHECK_LIB(socket, main)
bfe8dedf 2558dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
4b26fae9 2559case "$host_os" in
2560 mingw|mingw32)
2561 AC_MSG_CHECKING(for winsock)
2562 save_LIBS="$LIBS"
2563 for curlib in ws2_32 wsock32; do
2564 LIBS="$LIBS -l$curlib"
2565 AC_TRY_LINK([
2566 char __attribute__((stdcall)) socket(int,int,int);
2567 char __attribute__((stdcall)) select(int,int,int,int,int);
2568 char __attribute__((stdcall)) closesocket(int);
2569 char __attribute__((stdcall)) gethostname(int,int);
2570 ],
2571 [
2572 socket(1,2,3);
2573 select(1,2,3,4,5);
2574 closesocket(1);
2575 gethostname(1,2);
2576 ],
2577 have_winsock=yes, have_winsock=no)
2578
2579 if test $have_winsock = yes; then
2580 ac_cv_func_select='yes'
2581 if test $curlib = ws2_32; then
2582 have_winsock=winsock2
2583 fi
2584 break
2585 fi
2586 LIBS="$save_LIBS"
2587 done
2588 AC_MSG_RESULT($have_winsock)
bfe8dedf
GS
2589 if test $have_winsock = winsock2; then
2590 AC_CHECK_HEADERS(winsock2.h)
2591 else
2592 AC_CHECK_HEADERS(winsock.h)
2593 fi
4b26fae9 2594 ;;
2595esac
94d48591 2596
3c641669 2597dnl Ripped from the Samba sources
2598AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2599 AC_TRY_COMPILE([
2600#include <sys/types.h>
2601#include <stdlib.h>
2602#include <stddef.h>
2603#include <sys/socket.h>
2604#include <sys/un.h>],
2605[
2606 struct sockaddr_un sunaddr;
2607 sunaddr.sun_family = AF_UNIX;
2608],
2609 squid_cv_unixsocket=yes,squid_cv_unixsocket=no)])
2610if test x"$squid_cv_unixsocket" = x"yes"; then
6a9f6389 2611 AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
3c641669 2612fi
2613dnl end rip
2614
94d48591 2615 AC_CHECK_LIB(gnumalloc, main)
2616 if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
eed82608 2617 AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc])
94d48591 2618 ac_cv_func_mallinfo=no
2619 ac_cv_func_mallocblksize=no
2620 ac_cv_func_mallopt=no
2621 else
2622 case "$host" in
2623 *-sun-solaris*)
eed82608 2624 AC_MSG_NOTICE([skipping libmalloc check for $host])
94d48591 2625 ;;
2626 i386-*-freebsd*)
eed82608 2627 AC_MSG_NOTICE([skipping libmalloc check for $host])
94d48591 2628 ;;
2629 *)
2630
2631 AC_CHECK_LIB(malloc, main)
2632 ;;
2633 esac
2634 fi
94d48591 2635
6716b242 2636AC_CHECK_LIB(bsd, main)
be79ade0 2637AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
04a56fa3 2638AC_CHECK_LIB(bind, gethostbyname)
2639if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2640 case "$host" in
78743365 2641 i386-*-freebsd*)
eed82608 2642 AC_MSG_NOTICE([skipping libresolv checks for $host])
78743365 2643 ;;
2644 *)
78743365 2645 AC_CHECK_LIB(resolv, main)
2646 ;;
04a56fa3 2647 esac
2648fi
08caf8c6 2649case "$host_os" in
2650mingw|mingw32)
eed82608 2651 AC_MSG_NOTICE([Use MSVCRT for math functions.])
08caf8c6 2652 ;;
2653 *)
2654 AC_CHECK_LIB(m, main)
2655 ;;
2656esac
090089c4 2657
2658dnl Check for libcrypt
8154dd82 2659dnl Some of our helpers use crypt(3) which may be in libc, or in
2660dnl libcrypt (eg FreeBSD)
c1dc012a 2661AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
3d4022fa 2662dnl Solaris10 provides MD5 natively through libmd5
c1dc012a 2663AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
be79ade0 2664AC_SUBST(CRYPTLIB)
77f675ad 2665
042b1f8a 2666dnl Check for libdl, used by auth_modules/PAM
8154dd82 2667if test "$with_dl" = "yes"; then
2668 AC_CHECK_LIB(dl, dlopen)
2669fi
042b1f8a 2670
86ec11aa 2671dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2672dnl Robert Side <rside@aiinc.bc.ca>
2673dnl Mon, 18 Jan 1999 17:48:00 GMT
2674case "$host" in
2675 *-pc-sco3.2*)
2676 AC_CHECK_LIB(intl, strftime)
2677 ;;
2678esac
2679
20e869bf 2680dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2681dnl only with Windows LDAP libraries using -lwldap32
2682case "$host_os" in
2683mingw|mingw32)
2684 LIB_LDAP="-lwldap32"
2685 LIB_LBER=""
2686 ;;
2687*)
2688 LIB_LDAP="-lldap"
2689 dnl LDAP helpers need to know if -llber is needed or not
2690 AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2691 ;;
2692esac
2693AC_SUBST(LIB_LDAP)
2694AC_SUBST(LIB_LBER)
2695
b7a1c19e 2696dnl Check for libdb
2697DBLIB=
01b4931d 2698dnl 1.85
a258dfca 2699AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
32d0bbd7 2700SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2701 AC_TRY_LINK([
a258dfca 2702#if HAVE_SYS_TYPES_H
2703#include <sys/types.h>
2704#endif
2705#if HAVE_LIMITS_H
2706#include <limits.h>
2707#endif
2708#if HAVE_DB_185_H
2709#include <db_185.h>
2710#elif HAVE_DB_H
2711#include <db.h>
2712#endif],
21372988 2713 [dbopen("", 0, 0, DB_HASH, (void *)0L)],
a258dfca 2714 ac_cv_dbopen_libdb="yes",
2715 ac_cv_dbopen_libdb="no")
32d0bbd7 2716LIBS="$SAVED_LIBS"
a258dfca 2717])
2b2161bb 2718if test $ac_cv_dbopen_libdb = yes; then
32d0bbd7 2719 LIB_DB="-ldb"
2720fi
01b4931d 2721AC_SUBST(LIB_DB)
b7a1c19e 2722
77f675ad 2723dnl System-specific library modifications
2724dnl
2725case "$host" in
88738790 2726 i386-*-solaris2.*)
7149a49f 2727 if test "$GCC" = "yes"; then
eed82608 2728 AC_MSG_NOTICE([Removing -O for gcc on $host])
80e92d6d 2729 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
7149a49f 2730 fi
2731 ;;
77f675ad 2732 *-sgi-irix*)
eed82608 2733 AC_MSG_NOTICE([Removing -lsocket for IRIX...])
6716b242 2734 LIBS=`echo $LIBS | sed -e s/-lsocket//`
eed82608 2735 AC_MSG_NOTICE([Removing -lnsl for IRIX...])
6716b242 2736 LIBS=`echo $LIBS | sed -e s/-lnsl//`
c415c128 2737 ac_cv_lib_nsl_main=no
eed82608 2738 AC_MSG_NOTICE([Removing -lbsd for IRIX...])
b44c0fb4 2739 LIBS=`echo $LIBS | sed -e s/-lbsd//`
77f675ad 2740 ;;
4ba0bd0e 2741dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2742dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2743dnl Please change your configure script. AIX doesn't need -lbsd.
2744 *-ibm-aix*)
eed82608 2745 AC_MSG_NOTICE([Removing -lbsd for AIX...])
4ba0bd0e 2746 LIBS=`echo $LIBS | sed -e s/-lbsd//`
2747 ;;
30a4f2a8 2748 *m88k*)
fa035612 2749 SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2750 SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
6a9f6389 2751 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
7149a49f 2752 ;;
580ce039 2753 [*-*-solaris2.[0-4]])
6a9f6389 2754 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
30a4f2a8 2755 ;;
711fa75e 2756 [*-sony-newsos[56]*])
6a9f6389 2757 AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
f62c73dc 2758 ;;
77f675ad 2759esac
090089c4 2760
57faa85a 2761# Remove optimization for GCC 2.95.[123]
d20b1cd0 2762# gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2763if test "$GCC" = "yes"; then
2764 GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2765 case "$GCCVER" in
57faa85a 2766 [2.95.[123]])
eed82608 2767 AC_MSG_NOTICE([Removing -O for gcc on $host with GCC $GCCVER])
d20b1cd0 2768 CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2769 ;;
2770 esac
2771fi
2772
176d10ee 2773# Recommended by Balint Nagy Endre <bne@CareNet.hu>
2774case "$host" in
2775 *-univel-sysv4.2MP)
2776 if test `uname -v` = "2.03"; then
eed82608 2777 AC_MSG_NOTICE([disabling mallinfo for $host])
176d10ee 2778 ac_cv_func_mallinfo=no
2779 fi
2780 ;;
2781esac
2782
84cecfd2 2783dnl This has to be before AC_CHECK_FUNCS
2784# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2785# when running configure.
2786if test -z "$ac_cv_func_poll"; then
2787 case "$host" in
2788 [alpha-dec-osf3.*])
2789 # John Kay (jkay@nlanr.net) 19970818
eed82608 2790 AC_MSG_NOTICE([disabling poll for $host...])
84cecfd2 2791 ac_cv_func_poll='no'
2792 ;;
2793 [*-hp-hpux*.*])
2794 # Duane Wessels
eed82608 2795 AC_MSG_NOTICE([disabling poll for $host...])
84cecfd2 2796 ac_cv_func_poll='no'
2797 ;;
2798 [*-linux-*])
f5cec332 2799 # Henrik Nordstrom (hno@squid-cache.org) 19980817
9bb83c8b 2800 # poll is problematic on Linux. We disable it
2801 # by default until Linux gets it right.
b6a2f15e 2802 rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2803 if test $rev -lt 002002; then
eed82608 2804 AC_MSG_NOTICE([disabling poll for $host < 2.2...])
b6a2f15e 2805 ac_cv_func_poll='no'
2806 fi
84cecfd2 2807 ;;
c68e9c6b 2808 [powerpc-ibm-aix4.1.*])
2809 # Mike Laster (mlaster@metavillage.com) 19981021
eed82608 2810 AC_MSG_NOTICE([disabling poll for $host...])
c68e9c6b 2811 ac_cv_func_poll='no'
2812 ;;
86ec11aa 2813 [*-pc-sco3.2*])
2814 # Robert Side <rside@aiinc.bc.ca>
2815 # Mon, 18 Jan 1999 17:48:00 GMT
eed82608 2816 AC_MSG_NOTICE([disabling poll for $host...])
86ec11aa 2817 ac_cv_func_poll='no'
2818 ;;
84cecfd2 2819 esac
2820fi
176d10ee 2821
08caf8c6 2822dnl Override statfs() detect on MinGW becasue is emulated in source code
2823case "$host_os" in
2824mingw|mingw32)
2825 ac_cv_func_statfs='yes'
2826 ;;
2827esac
2828
6716b242 2829dnl Check for library functions
2830AC_CHECK_FUNCS(\
ce3d30fb 2831 backtrace_symbols_fd \
3a144521 2832 bcopy \
2833 bswap_16 \
2834 bswap_32 \
f9576890 2835 bswap16 \
2836 bswap32 \
4ac29a5b 2837 fchmod \
6716b242 2838 getdtablesize \
8505e57b 2839 getpagesize \
230c091c 2840 getpass \
3a144521 2841 getrlimit \
30a4f2a8 2842 getrusage \
9c1d8929 2843 getspnam \
379d5751 2844 gettimeofday \
52303a3d 2845 glob \
f9576890 2846 htobe16 \
2847 htole16 \
d474c7a6 2848 kqueue\
30a4f2a8 2849 lrand48 \
6716b242 2850 mallinfo \
0f5efab0 2851 mallocblksize \
6716b242 2852 mallopt \
2ae6b9b0 2853 memcpy \
30a4f2a8 2854 memmove \
dac27377 2855 memset \
b99a6dec 2856 mkstemp \
1812b6c7 2857 mktime \
88738790 2858 mstats \
84cecfd2 2859 poll \
62ae0622 2860 prctl \
3a144521 2861 pthread_attr_setschedparam \
cd748f27 2862 pthread_attr_setscope \
2863 pthread_setschedparam \
42b51993 2864 pthread_sigmask \
c68e9c6b 2865 putenv \
b1e77ec1 2866 random \
6716b242 2867 regcomp \
2868 regexec \
2869 regfree \
30a4f2a8 2870 res_init \
af76ec93 2871 __res_init \
4915be3b 2872 rint \
a4ba1105 2873 sbrk \
3a144521 2874 select \
234967c9 2875 seteuid \
c415c128 2876 setgroups \
30a4f2a8 2877 setpgrp \
6716b242 2878 setrlimit \
30a4f2a8 2879 setsid \
2880 sigaction \
11430c03 2881 snprintf \
1ccc0d40 2882 socketpair \
30a4f2a8 2883 srand48 \
b1e77ec1 2884 srandom \
0343b99c 2885 statfs \
1cd53467 2886 strsep \
2733d426 2887 strtoll \
6716b242 2888 sysconf \
2889 syslog \
234967c9 2890 timegm \
28da5e0d 2891 vsnprintf \
6716b242 2892)
f5e5c4cf 2893dnl ... and some we provide local replacements for
2894AC_REPLACE_FUNCS(\
2895 drand48 \
cc192b50 2896 inet_ntop \
2897 inet_pton \
f5e5c4cf 2898 initgroups \
cc192b50 2899 getaddrinfo \
2900 getnameinfo \
f5e5c4cf 2901 strerror \
2902 tempnam \
2903)
6716b242 2904
d06d566f 2905# check for crypt, may require -lcrypt
2906SAVED_LIBS="$LIBS"
2907LIBS="$LIBS $CRYPTLIB"
2908AC_CHECK_FUNCS(crypt)
2909LIBS="$SAVED_LIBS"
2910
1b3db6d9 2911dnl Magic which checks whether we are forcing a type of comm loop we
2912dnl are actually going to (ab)use
2913
2914dnl Actually do the define magic now
2915dnl mostly ripped from squid-commloops, thanks to adrian and benno
2916
d474c7a6 2917if test -n "$SELECT_TYPE"; then
2918 : # Already decided above. Nothing to do here
6564c397 2919elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
a46d2c0e 2920 SELECT_TYPE="epoll"
6564c397 2921elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
2922 SELECT_TYPE="kqueue"
2923elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
6c9797b9 2924 SELECT_TYPE="poll"
6564c397 2925elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
663c0a38 2926 case "$host_os" in
2927 mingw|mingw32)
2928 SELECT_TYPE="select_win32"
663c0a38 2929 ;;
2930 *)
2931 SELECT_TYPE="select"
663c0a38 2932 ;;
2933 esac
1b3db6d9 2934else
eed82608
AJ
2935 AC_MSG_WARN([Eep! Can't find poll, kqueue, epoll, or select!])
2936 AC_MSG_WARN([I'll try select and hope for the best.])
1b3db6d9 2937 SELECT_TYPE="select"
6a9f6389 2938 AC_DEFINE(USE_SELECT,1)
1b3db6d9 2939fi
d474c7a6 2940
eed82608 2941AC_MSG_NOTICE([Using ${SELECT_TYPE} for the IO loop.])
d474c7a6 2942
2943AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
2944AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
2945AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
2946AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
2947AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
2948AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
2949AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
2950
2951case $SELECT_TYPE in
2952epoll)
2953 AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
2954 ;;
2955poll)
2956 AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
2957 ;;
2958kqueue)
2959 AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
2960 ;;
2961select_win32)
2962 AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
2963 ;;
2964select)
2965 AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
2966 ;;
2967esac
1b3db6d9 2968
2969
d06d566f 2970
60939927 2971dnl Yay! Another Linux brokenness. Its not good enough
2972dnl to know that setresuid() exists, because RedHat 5.0 declares
2973dnl setresuid() but doesn't implement it.
2974dnl
2975AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
5c51415d 2976 AC_TRY_RUN([
60939927 2977#include <stdlib.h>
5c51415d 2978 int main() {
2979 if(setresuid(-1,-1,-1)) {
2980 perror("setresuid:");
2981 exit(1);
60939927 2982 }
2983 exit(0);
5c51415d 2984 }
2985 ],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
60939927 2986)
5c51415d 2987if test "$ac_cv_func_setresuid" = "yes" ; then
6a9f6389 2988 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 2989fi
60939927 2990
cee08cbc
AJ
2991dnl Yay! This one is a MacOSX brokenness. Its not good enough
2992dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
2993dnl copy that crashes with a buffer over-run!
2994dnl
2995AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
2996 AC_TRY_RUN([
2997#include <stdlib.h>
2998#include <stdio.h>
2999#include <string.h>
3000 // we expect this to succeed, or crash on over-run.
3001 // if it passes otherwise we may need a better check.
3002int main(int argc, char **argv)
3003{
3004 int size = 20;
3005 char *str = malloc(size);
3006 memset(str, 'x', size);
3007 strnstr(str, "fubar", size);
3008 return 0;
3009}
3010 ],ac_cv_func_strnstr="yes",ac_cv_func_strnstr="no")
3011)
3012if test "$ac_cv_func_strnstr" = "yes" ; then
3013 AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
3014else
3015 AC_DEFINE(HAVE_STRNSTR,0,[Yay! A MacOS X brokenness. Its not good enough to know that strnstr() exists, because MacOSX 10.4 and earlier may have a buffer overrun.])
3016fi
3017
3018
1cd53467 3019AM_CONDITIONAL(NEED_OWN_STRSEP, false)
3020if test "$ac_cv_func_strsep" = "no" ; then
3021 AM_CONDITIONAL(NEED_OWN_STRSEP, true)
3022fi
3023
2733d426 3024AM_CONDITIONAL(NEED_OWN_STRTOLL, false)
3025if test "$ac_cv_func_strtoll" = "no" ; then
3026 AM_CONDITIONAL(NEED_OWN_STRTOLL, true)
3027fi
3028
eee79a2e 3029dnl
3030dnl Test for va_copy
3031dnl
3032AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
3033 AC_TRY_RUN([
3034 #include <stdarg.h>
cf69e4f2 3035 #include <stdlib.h>
eee79a2e 3036 void f (int i, ...) {
3037 va_list args1, args2;
3038 va_start (args1, i);
3039 va_copy (args2, args1);
3040 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3041 exit (1);
3042 va_end (args1); va_end (args2);
3043 }
3044 int main() {
3045 f (0, 42);
3046 return 0;
3047 }
3048 ],ac_cv_func_va_copy="yes",ac_cv_func_va_copy="no")
3049)
3050if test "$ac_cv_func_va_copy" = "yes" ; then
a45f884d 3051 AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
eee79a2e 3052fi
3053
3054dnl
3055dnl Some systems support __va_copy
3056dnl
3057AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
3058 AC_TRY_RUN([
3059 #include <stdarg.h>
cf69e4f2 3060 #include <stdlib.h>
eee79a2e 3061 void f (int i, ...) {
3062 va_list args1, args2;
3063 va_start (args1, i);
3064 __va_copy (args2, args1);
3065 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3066 exit (1);
3067 va_end (args1); va_end (args2);
3068 }
3069 int main() {
3070 f (0, 42);
3071 return 0;
3072 }
3073 ],ac_cv_func___va_copy="yes",ac_cv_func___va_copy="no")
3074)
3075if test "$ac_cv_func___va_copy" = "yes" ; then
a45f884d 3076 AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
eee79a2e 3077fi
c3d0c8b5 3078
5cafc1d6 3079dnl IP-Filter support requires ipf header files. These aren't
3080dnl installed by default, so we need to check for them
3081if test "$IPF_TRANSPARENT" ; then
3082 AC_MSG_CHECKING(if IP-Filter header files are installed)
42b51993 3083 # hold on to your hats...
3084 if test "$ac_cv_header_ip_compat_h" = "yes" ||
3085 test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
87d21d8b 3086 test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3087 test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
42b51993 3088 have_ipfilter_compat_header="yes"
3089 fi
3090 if test "x$have_ipfilter_compat_header" = "xyes" &&
eb824054 3091 test "$ac_cv_header_ip_fil_h" = "yes" &&
3092 test "$ac_cv_header_ip_nat_h" = "yes" ; then
3093 IPF_TRANSPARENT="yes"
3094 AC_DEFINE(IPF_TRANSPARENT, 1)
42b51993 3095 elif test "$have_ipfilter_compat_header" = "yes" &&
eb824054 3096 test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3097 test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3098 IPF_TRANSPARENT="yes"
3099 AC_DEFINE(IPF_TRANSPARENT, 1)
3100 else
5cafc1d6 3101 IPF_TRANSPARENT="no"
3102 AC_DEFINE(IPF_TRANSPARENT, 0)
5cafc1d6 3103 fi
3104 AC_MSG_RESULT($IPF_TRANSPARENT)
3105fi
3106if test "$IPF_TRANSPARENT" = "no" ; then
eed82608
AJ
3107 AC_MSG_WARN([Cannot find necessary IP-Filter header files])
3108 AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
5cafc1d6 3109 sleep 10
8f6ca20d 3110elif test "$IPF_TRANSPARENT" = "yes" ; then
3111dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3112dnl Solaris minor version (8, 9, 10, ...)
3113 case "$host" in
3114 *-solaris*)
3115 solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3116 CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
20b3ae10 3117 CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
8f6ca20d 3118 ;;
3119 *)
3120 ;;
3121 esac
5cafc1d6 3122fi
3123
2b0dd4ac 3124dnl PF support requires a header file.
3125if test "$PF_TRANSPARENT" ; then
3126 AC_MSG_CHECKING(if PF header file is installed)
3127 # hold on to your hats...
3128 if test "$ac_cv_header_net_pfvar_h" = "yes"; then
3129 PF_TRANSPARENT="yes"
3130 AC_DEFINE(PF_TRANSPARENT, 1)
3131 else
3132 PF_TRANSPARENT="no"
3133 AC_DEFINE(PF_TRANSPARENT, 0)
3134 fi
3135 AC_MSG_RESULT($PF_TRANSPARENT)
3136fi
3137if test "$PF_TRANSPARENT" = "no" ; then
eed82608
AJ
3138 AC_MSG_WARN([Cannot find necessary PF header file])
3139 AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
2b0dd4ac 3140 sleep 10
3141fi
3142
d852fbad 3143dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3144dnl Shamelessly copied from above
3145if test "$LINUX_NETFILTER" ; then
d6d62546 3146 AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
d852fbad 3147 # hold on to your hats...
3148 if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3149 LINUX_NETFILTER="yes"
3150 AC_DEFINE(LINUX_NETFILTER, 1)
3151 else
3152 LINUX_NETFILTER="no"
3153 AC_DEFINE(LINUX_NETFILTER, 0)
3154 fi
3155 AC_MSG_RESULT($LINUX_NETFILTER)
3156fi
3157if test "$LINUX_NETFILTER" = "no" ; then
eed82608
AJ
3158 AC_MSG_WARN([Cannot find necessary Linux kernel (Netfilter) header files])
3159 AC_MSG_WARN([Linux Transparent and Intercepting Proxy support WILL NOT be enabled])
d852fbad 3160 sleep 10
3161fi
3162
f1e0717c 3163dnl Linux Netfilter/TPROXYv2 support requires some specific header files
fc68f6b1 3164dnl Shamelessly copied from shamelessly copied from above
f1e0717c
AJ
3165if test "$LINUX_TPROXY2" ; then
3166 AC_MSG_CHECKING(if TPROXYv2 header files are installed)
fc68f6b1 3167 # hold on to your hats...
3168 if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
f1e0717c
AJ
3169 LINUX_TPROXY2="yes"
3170 AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
fc68f6b1 3171 else
f1e0717c
AJ
3172 LINUX_TPROXY2="no"
3173 AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3174 fi
3175 AC_MSG_RESULT($LINUX_TPROXY2)
3176 if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
eed82608
AJ
3177 AC_MSG_WARN([Cannot find TPROXY v2 headers, you need to patch the kernel with ])
3178 AC_MSG_WARN([tproxy package from:])
3179 AC_MSG_WARN([ - lynx http://www.balabit.com/downloads/files/tproxy/])
3180 AC_MSG_WARN([Or select the '--enable-linux-netfilter' option instead for Netfilter support.])
f1e0717c 3181 sleep 10
fc68f6b1 3182 fi
fc68f6b1 3183fi
3184
cc937513
AJ
3185AC_ARG_ENABLE(gnuregex,
3186 AC_HELP_STRING([--enable-gnuregex],
3187 [Compile GNUregex. Unless you have reason to use
3188 this option, you should not enable it.
3189 This library file is usually only required on Windows and
3190 very old Unix boxes which do not have their own regex
3191 library built in.]),
3192[USE_GNUREGEX=$enableval])
91bc414e 3193if test -z "$USE_GNUREGEX" ; then
3194 case "$host" in
3195 *-sun-solaris2.[[0-4]])
3196 USE_GNUREGEX="yes"
3197 ;;
3198 *-next-nextstep*)
3199 USE_GNUREGEX="yes"
3200 ;;
3201 esac
3202fi
7a081912 3203AC_MSG_CHECKING(if GNUregex needs to be compiled)
91bc414e 3204if test -z "$USE_GNUREGEX"; then
55878dfd 3205if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
74946a0f 3206 USE_GNUREGEX="yes"
00fa2c12 3207else
0cccc031 3208 AC_TRY_COMPILE([#include <sys/types.h>
3209#include <regex.h>],[regex_t t; regcomp(&t,"",0);],
91bc414e 3210 USE_GNUREGEX="no",
3211 USE_GNUREGEX="yes")
3212fi
00fa2c12 3213fi
74946a0f 3214AC_MSG_RESULT($USE_GNUREGEX)
3215if test "$USE_GNUREGEX" = "yes"; then
cc937513
AJ
3216 # override system regex with ours. Not good. But what was asked for.
3217 REGEXLIB=""
6a9f6389 3218 AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
7a081912 3219fi
26675bf4 3220AC_SUBST(REGEXLIB)
cc937513 3221#AC_SUBST(LIBREGEX)
7a081912 3222
5c51415d 3223dnl Not cached since people are likely to tune this
e924600d 3224AC_MSG_CHECKING(Default FD_SETSIZE value)
3225AC_TRY_RUN([
3226#if HAVE_STDIO_H
3227#include <stdio.h>
3228#endif
3229#if HAVE_UNISTD_H
3230#include <unistd.h>
3231#endif
cf69e4f2
HN
3232#if HAVE_STDLIB_H
3233#include <stdlib.h>
3234#endif
e924600d 3235#if HAVE_SYS_TIME_H
3236#include <sys/time.h>
3237#endif
3238#if HAVE_SYS_SELECT_H
3239#include <sys/select.h>
3240#endif
3241#if HAVE_SYS_TYPES_H
3242#include <sys/types.h>
3243#endif
bfe8dedf
GS
3244#if HAVE_WINSOCK_H
3245#include <winsock.h>
3246#endif
3247#if HAVE_WINSOCK2_H
3248#include <winsock2.h>
3249#endif
e924600d 3250main() {
635e6242 3251 FILE *fp = fopen("conftestval", "w");
3252 fprintf (fp, "%d\n", FD_SETSIZE);
e924600d 3253 exit(0);
3254}
3255],
3256DEFAULT_FD_SETSIZE=`cat conftestval`,
3257DEFAULT_FD_SETSIZE=256,
3258DEFAULT_FD_SETSIZE=256)
3259AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
6a9f6389 3260AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
e924600d 3261
f49be7d1 3262
5c51415d 3263dnl Not cached since people are likely to tune this
234967c9 3264AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
c76d8acc 3265dnl damn! FreeBSD's pthreads breaks dup2().
5132a9eb 3266TLDFLAGS="$LDFLAGS"
f49be7d1 3267if test -n "$squid_filedescriptors_num" ; then
3268 SQUID_MAXFD=$squid_filedescriptors_num
3269 AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3270else
f49be7d1 3271 case $host in
3272 i386-unknown-freebsd*)
3273 if echo "$LDFLAGS" | grep -q pthread; then
3274 LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3275 fi
3276 esac
3277 AC_TRY_RUN([
8cca06da 3278#include <stdio.h>
234967c9 3279#include <unistd.h>
cf69e4f2 3280#include <stdlib.h>
30a4f2a8 3281#include <sys/time.h> /* needed on FreeBSD */
234967c9 3282#include <sys/param.h>
3283#include <sys/resource.h>
3284main() {
635e6242 3285 FILE *fp;
234967c9 3286 int i,j;
42b51993 3287#if defined(__CYGWIN32__) || defined (__CYGWIN__)
b05490a8 3288 /* getrlimit and sysconf returns bogous values on cygwin32.
df087e68 3289 * Number of fds is virtually unlimited in cygwin (sys/param.h)
b05490a8 3290 * __CYGWIN32__ is deprecated.
df087e68 3291 */
3292 i = NOFILE;
b05490a8 3293#else
3294#if HAVE_SETRLIMIT
234967c9 3295 struct rlimit rl;
3296#if defined(RLIMIT_NOFILE)
3297 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3298 perror("getrlimit: RLIMIT_NOFILE");
3299 } else {
f168f0c5
AJ
3300#if defined(__APPLE__)
3301 /* asking for more than OPEN_MAX fails on Leopard */
3302 rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3303#else
234967c9 3304 rl.rlim_cur = rl.rlim_max; /* set it to the max */
f168f0c5 3305#endif
234967c9 3306 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3307 perror("setrlimit: RLIMIT_NOFILE");
3308 }
3309 }
3310#elif defined(RLIMIT_OFILE)
3311 if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3312 perror("getrlimit: RLIMIT_OFILE");
3313 } else {
3314 rl.rlim_cur = rl.rlim_max; /* set it to the max */
3315 if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3316 perror("setrlimit: RLIMIT_OFILE");
3317 }
3318 }
3319#endif /* RLIMIT_NOFILE */
3320#endif /* HAVE_SETRLIMIT */
d9399075 3321 /* by starting at 2^14, we will never get higher
3322 than 2^15 for SQUID_MAXFD */
3323 i = j = 1<<14;
3324 while (j) {
3325 j >>= 1;
3326 if (dup2(0, i) < 0) {
3327 i -= j;
3328 } else {
3329 close(i);
3330 i += j;
3331 }
3332 }
3333 i++;
b05490a8 3334#endif /* IF !DEF CYGWIN */
635e6242 3335 fp = fopen("conftestval", "w");
a4d7e961 3336 fprintf (fp, "%d\n", i & ~0x3F);
234967c9 3337 exit(0);
3338}
f49be7d1 3339 ],
3340 SQUID_MAXFD=`cat conftestval`,
3341 SQUID_MAXFD=256,
3342 SQUID_MAXFD=256)
4b26fae9 3343 dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3344 case "$host_os" in
3345 mingw|mingw32)
3346 SQUID_MAXFD="2048"
3347 ;;
3348 esac
f49be7d1 3349 AC_MSG_RESULT($SQUID_MAXFD)
3350fi
6a9f6389 3351AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
b9cc811d 3352if test "$SQUID_MAXFD" -lt 512 ; then
eed82608
AJ
3353 AC_MSG_WARN([$SQUID_MAXFD may not be enough filedescriptors if your])
3354 AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3355 AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3356 AC_MSG_WARN([on how to increase your filedescriptor limit])
933cc58d 3357 sleep 10
80ab193b 3358fi
c76d8acc 3359LDFLAGS="$TLDFLAGS"
234967c9 3360
d0f9207a 3361if test `expr $SQUID_MAXFD % 64` != 0; then
eed82608 3362 AC_MSG_WARN([$SQUID_MAXFD is not an multiple of 64. This may cause issues on certain platforms.])
a4d7e961 3363 sleep 10
3364fi
3365
5c51415d 3366dnl Not cached since people are likely to tune this
30a4f2a8 3367AC_MSG_CHECKING(Default UDP send buffer size)
3368AC_TRY_RUN([
8cca06da 3369#include <stdlib.h>
3370#include <stdio.h>
30a4f2a8 3371#include <sys/types.h>
bfe8dedf 3372#if HAVE_SYS_SOCKET_H
30a4f2a8 3373#include <sys/socket.h>
bfe8dedf
GS
3374#endif
3375#if HAVE_NETINET_IN_H
30a4f2a8 3376#include <netinet/in.h>
bfe8dedf
GS
3377#endif
3378#if HAVE_WINSOCK_H
3379#include <winsock.h>
3380#endif
3381#if HAVE_WINSOCK2_H
3382#include <winsock2.h>
3383#endif
30a4f2a8 3384main ()
3385{
635e6242 3386 FILE *fp;
30a4f2a8 3387 int fd,val=0,len=sizeof(int);
bfe8dedf
GS
3388#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3389 WSADATA wsaData;
3390 WSAStartup(2, &wsaData);
3391#endif
30a4f2a8 3392 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3393 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
bfe8dedf
GS
3394#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3395 WSACleanup();
3396#endif
30a4f2a8 3397 if (val<=0) exit(1);
635e6242 3398 fp = fopen("conftestval", "w");
3399 fprintf (fp, "%d\n", val);
30a4f2a8 3400 exit(0);
3401}
3402],
6a9f6389 3403SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3404SQUID_DETECT_UDP_SO_SNDBUF=16384,
3405SQUID_DETECT_UDP_SO_SNDBUF=16384)
3406AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3407AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
30a4f2a8 3408
5c51415d 3409dnl Not cached since people are likely to tune this
30a4f2a8 3410AC_MSG_CHECKING(Default UDP receive buffer size)
3411AC_TRY_RUN([
8cca06da 3412#include <stdlib.h>
3413#include <stdio.h>
30a4f2a8 3414#include <sys/types.h>
bfe8dedf 3415#if HAVE_SYS_SOCKET_H
30a4f2a8 3416#include <sys/socket.h>
bfe8dedf
GS
3417#endif
3418#if HAVE_NETINET_IN_H
30a4f2a8 3419#include <netinet/in.h>
bfe8dedf
GS
3420#endif
3421#if HAVE_WINSOCK_H
3422#include <winsock.h>
3423#endif
3424#if HAVE_WINSOCK2_H
3425#include <winsock2.h>
3426#endif
30a4f2a8 3427main ()
3428{
635e6242 3429 FILE *fp;
30a4f2a8 3430 int fd,val=0,len=sizeof(int);
bfe8dedf
GS
3431#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3432 WSADATA wsaData;
3433 WSAStartup(2, &wsaData);
3434#endif
30a4f2a8 3435 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3436 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
bfe8dedf
GS
3437#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3438 WSACleanup();
3439#endif
30a4f2a8 3440 if (val <= 0) exit(1);
635e6242 3441 fp = fopen("conftestval", "w");
3442 fprintf (fp, "%d\n", val);
30a4f2a8 3443 exit(0);
3444}
3445],
6a9f6389 3446SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3447SQUID_DETECT_UDP_SO_RCVBUF=16384,
3448SQUID_DETECT_UDP_SO_RCVBUF=16384)
3449AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3450AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
30a4f2a8 3451
5c51415d 3452dnl Not cached since people are likely to tune this
30a4f2a8 3453AC_MSG_CHECKING(Default TCP send buffer size)
3454AC_TRY_RUN([
8cca06da 3455#include <stdlib.h>
3456#include <stdio.h>
30a4f2a8 3457#include <sys/types.h>
bfe8dedf 3458#if HAVE_SYS_SOCKET_H
30a4f2a8 3459#include <sys/socket.h>
bfe8dedf
GS
3460#endif
3461#if HAVE_NETINET_IN_H
30a4f2a8 3462#include <netinet/in.h>
bfe8dedf
GS
3463#endif
3464#if HAVE_WINSOCK_H
3465#include <winsock.h>
3466#endif
3467#if HAVE_WINSOCK2_H
3468#include <winsock2.h>
3469#endif
30a4f2a8 3470main ()
3471{
635e6242 3472 FILE *fp;
30a4f2a8 3473 int fd,val=0,len=sizeof(int);
bfe8dedf
GS
3474#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3475 WSADATA wsaData;
3476 WSAStartup(2, &wsaData);
3477#endif
30a4f2a8 3478 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3479 if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
bfe8dedf
GS
3480#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3481 WSACleanup();
3482#endif
30a4f2a8 3483 if (val <= 0) exit(1);
635e6242 3484 fp = fopen("conftestval", "w");
3485 fprintf (fp, "%d\n", val);
30a4f2a8 3486 exit(0);
3487}
3488],
3489SQUID_TCP_SO_SNDBUF=`cat conftestval`,
1c481e00 3490SQUID_TCP_SO_SNDBUF=16384,
3491SQUID_TCP_SO_SNDBUF=16384)
30a4f2a8 3492AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
2aa6ca58 3493if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
eed82608 3494 AC_MSG_NOTICE([Limiting send buffer size to 32K])
2aa6ca58 3495 SQUID_TCP_SO_SNDBUF=32768
3496fi
6a9f6389 3497AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
30a4f2a8 3498
5c51415d 3499dnl Not cached since people are likely to tune this
30a4f2a8 3500AC_MSG_CHECKING(Default TCP receive buffer size)
3501AC_TRY_RUN([
8cca06da 3502#include <stdlib.h>
3503#include <stdio.h>
30a4f2a8 3504#include <sys/types.h>
bfe8dedf 3505#if HAVE_SYS_SOCKET_H
30a4f2a8 3506#include <sys/socket.h>
bfe8dedf
GS
3507#endif
3508#if HAVE_NETINET_IN_H
30a4f2a8 3509#include <netinet/in.h>
bfe8dedf
GS
3510#endif
3511#if HAVE_WINSOCK_H
3512#include <winsock.h>
3513#endif
3514#if HAVE_WINSOCK2_H
3515#include <winsock2.h>
3516#endif
30a4f2a8 3517main ()
3518{
635e6242 3519 FILE *fp;
30a4f2a8 3520 int fd,val=0,len=sizeof(int);
bfe8dedf
GS
3521#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3522 WSADATA wsaData;
3523 WSAStartup(2, &wsaData);
3524#endif
30a4f2a8 3525 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3526 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
bfe8dedf
GS
3527#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3528 WSACleanup();
3529#endif
30a4f2a8 3530 if (val <= 0) exit(1);
635e6242 3531 fp = fopen("conftestval", "w");
3532 fprintf (fp, "%d\n", val);
30a4f2a8 3533 exit(0);
3534}
3535],
3536SQUID_TCP_SO_RCVBUF=`cat conftestval`,
1c481e00 3537SQUID_TCP_SO_RCVBUF=16384,
3538SQUID_TCP_SO_RCVBUF=16384)
30a4f2a8 3539AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
2aa6ca58 3540if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
eed82608 3541 AC_MSG_NOTICE([Limiting receive buffer size to 64K])
2aa6ca58 3542 SQUID_TCP_SO_RCVBUF=65535
3543fi
6a9f6389 3544AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
5c51415d 3545AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
9bc73deb 3546 AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
5c51415d 3547 ac_cv_needs_sys_errlist="no",
3548 ac_cv_needs_sys_errlist="yes")
3549)
3550if test "$ac_cv_needs_sys_errlist" = "yes" ; then
6a9f6389 3551 AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
5c51415d 3552fi
30a4f2a8 3553
5c51415d 3554dnl Not cached since people are likely to change this
6bf65235 3555AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3556AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3557[AC_MSG_RESULT(yes)
6a9f6389 3558AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
6bf65235 3559AC_MSG_RESULT(no))
3560
a937d5e3 3561AC_MSG_CHECKING(if inet_ntoa() actually works)
3562AC_TRY_RUN([
3563#include <stdlib.h>
3564#include <stdio.h>
3565#include <sys/types.h>
3566#include <netinet/in.h>
3567#include <arpa/inet.h>
3568main ()
3569{
635e6242 3570 FILE *fp;
a937d5e3 3571 struct in_addr in;
3572 in.s_addr = inet_addr("1.2.3.4");
635e6242 3573 fp = fopen("conftestval", "w");
3574 fprintf (fp, "%s\n", inet_ntoa(in));
a937d5e3 3575 exit(0);
3576}
3577],
3578INET_NTOA_RESULT=`cat conftestval`,
3579INET_NTOA_RESULT="broken",
3580INET_NTOA_RESULT="broken")
3581if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3582 AC_MSG_RESULT("yes")
3583else
3584 AC_MSG_RESULT("no")
4b26fae9 3585 case "$host_os" in
3586 mingw|mingw32)
eed82608 3587 AC_MSG_NOTICE([Using Win32 resolver instead.])
4b26fae9 3588 ;;
f5e5c4cf 3589 *)
eed82608 3590 AC_MSG_NOTICE([Will use our own inet_ntoa().])
4b26fae9 3591 AC_LIBOBJ(inet_ntoa)
eed82608
AJ
3592# AC_MSG_WARN([This looks bad, and probably prevents Squid from working.])
3593# AC_MSG_WARN([If you're on IRIX and using GCC 2.8, you probably need])
3594# AC_MSG_WARN([to use the IRIX C compiler instead.])
4b26fae9 3595# sleep 10
3596 ;;
3597 esac
a937d5e3 3598fi
3599
b6a2f15e 3600if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
c68e9c6b 3601AC_MSG_CHECKING(for working statvfs() interface)
3602AC_TRY_COMPILE([
3603#include <stdlib.h>
3604#include <stdio.h>
3605#include <sys/types.h>
3606#include <sys/statvfs.h>
3607],
3608[
3609struct statvfs sfs;
3610sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3611sfs.f_files = sfs.f_ffree = 0;
3612statvfs("/tmp", &sfs);
3613],
3614 ac_cv_func_statvfs=yes,
3615 ac_cv_func_statvfs=no)
3616AC_MSG_RESULT($ac_cv_func_statvfs)
6b8e7481 3617if test "$ac_cv_func_statvfs" = "yes" ; then
6a9f6389 3618 AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
b6a2f15e 3619fi
6b8e7481 3620fi
c68e9c6b 3621
cc192b50 3622dnl Detect what resolver fields we have available to use...
3623AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3624AC_TRY_COMPILE([
3625#if HAVE_SYS_TYPES_H
3626#include <sys/types.h>
3627#endif
3628#if HAVE_NETINET_IN_H
3629#include <netinet/in.h>
3630#endif
3631#if HAVE_ARPA_INET_H
3632#include <arpa/inet.h>
3633#endif
3634#if HAVE_ARPA_NAMESER_H
3635#include <arpa/nameser.h>
3636#endif
3637#if HAVE_RESOLV_H
3638#include <resolv.h>
3639#endif
3640],
3641[_res_ext.nsaddr_list[[0]].s_addr;],
3642ac_cv_have_res_ext_nsaddr_list="yes",
3643ac_cv_have_res_ext_nsaddr_list="no"))
3644if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3645 AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3646 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3647fi
3648
0873b2ab 3649if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
cc192b50 3650AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3651AC_TRY_COMPILE([
3652#if HAVE_SYS_TYPES_H
3653#include <sys/types.h>
3654#endif
3655#if HAVE_NETINET_IN_H
3656#include <netinet/in.h>
3657#endif
3658#if HAVE_ARPA_INET_H
3659#include <arpa/inet.h>
3660#endif
3661#if HAVE_ARPA_NAMESER_H
3662#include <arpa/nameser.h>
3663#endif
3664#if HAVE_RESOLV_H
3665#include <resolv.h>
3666#endif
3667],
3668[_res._u._ext.nsaddrs[[0]]->sin6_addr;],
3669ac_cv_have_res_ext_nsaddrs="yes",
3670ac_cv_have_res_ext_nsaddrs="no"))
3671if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3672 AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3673 AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3674fi
3675fi
3676
c68e9c6b 3677AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3678AC_TRY_COMPILE([
3679#if HAVE_SYS_TYPES_H
3680#include <sys/types.h>
3681#endif
3682#if HAVE_NETINET_IN_H
3683#include <netinet/in.h>
3684#endif
3685#if HAVE_ARPA_INET_H
3686#include <arpa/inet.h>
3687#endif
3688#if HAVE_ARPA_NAMESER_H
3689#include <arpa/nameser.h>
3690#endif
3691#if HAVE_RESOLV_H
3692#include <resolv.h>
3693#endif
3694],
3695[_res.nsaddr_list[[0]];],
3696ac_cv_have_res_nsaddr_list="yes",
3697ac_cv_have_res_nsaddr_list="no"))
3698if test $ac_cv_have_res_nsaddr_list = "yes" ; then
cc192b50 3699 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3700 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3701fi
3702
0873b2ab 3703if test "$_SQUID_RES_NSADDR_LIST" = ""; then
c68e9c6b 3704AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3705AC_TRY_COMPILE([
3706#if HAVE_SYS_TYPES_H
3707#include <sys/types.h>
3708#endif
3709#if HAVE_NETINET_IN_H
3710#include <netinet/in.h>
3711#endif
3712#if HAVE_ARPA_INET_H
3713#include <arpa/inet.h>
3714#endif
3715#if HAVE_ARPA_NAMESER_H
3716#include <arpa/nameser.h>
3717#endif
3718#if HAVE_RESOLV_H
3719#include <resolv.h>
3720#endif
3721],
3722[_res.ns_list[[0]].addr;],
3723ac_cv_have_res_ns_list="yes",
3724ac_cv_have_res_ns_list="no"))
3725if test $ac_cv_have_res_ns_list = "yes" ; then
cc192b50 3726 AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3727 AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
c68e9c6b 3728fi
3729fi
3730
e4b70b44
AJ
3731dnl Squid now has .po translation capability, given the right toolkit
3732AX_WITH_PROG([PO2HTML],[po2html])
ee1a8ac2 3733
43000484
AJ
3734dnl Squid now has limited locale handling ...
3735dnl on error pages
8db7a54b 3736use_errlocale=yes
43000484 3737AC_ARG_ENABLE(auto-locale,
21d5413e
AJ
3738 AC_HELP_STRING([--disable-auto-locale],
3739 [This prevents Squid providing localized error pages based on the
3740 clients request headers.
3741 When disabled Squid requires explicit language configuration.]),
8db7a54b
AJ
3742[ if test "$enableval" = "no" ; then
3743 use_errlocale=no
3744 fi
3745])
3746if test "$use_errlocale" = "yes" ; then
eed82608 3747 AC_MSG_NOTICE([Enabling Multi-Language Support])
43000484 3748 AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
8db7a54b 3749else
eed82608 3750 AC_MSG_WARN([Disabling Multi-Language Support])
43000484 3751 AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
e420a18f
AJ
3752 dnl So we don't want to even attempt translation if its forcibly disabled.
3753 PO2HTML="off"
8db7a54b 3754fi
e420a18f 3755AC_SUBST(PO2HTML)
43000484 3756
090089c4 3757dnl Need the debugging version of malloc if available
3758XTRA_OBJS=''
6509a1a0 3759if test "$ac_cv_lib_malloc_main" = "yes" ; then
090089c4 3760 if test -r /usr/lib/debug/malloc.o ; then
3761 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3762 fi
3763 if test -r /usr/lib/debug/mallocmap.o ; then
3764 XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3765 fi
3766fi
3767AC_SUBST(XTRA_OBJS)
3768
38fea766 3769if test -z "$XTRA_LIBS"; then
3770 XTRA_LIBS="$LIBS"
0f5a16f8 3771 dnl minor cleanup
3772 XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
38fea766 3773 LIBS=''
3774fi
090089c4 3775AC_SUBST(XTRA_LIBS)
3776
090089c4 3777dnl Clean up after OSF/1 core dump bug
3778rm -f core
3779
6a9f6389 3780AC_CONFIG_FILES([\
a2794549 3781 Makefile \
eee95dfe 3782 compat/Makefile \
a2794549 3783 lib/Makefile \
a2794549 3784 scripts/Makefile \
3785 scripts/RunCache \
3786 scripts/RunAccel \
3787 src/Makefile \
5bd7a218 3788 src/base/Makefile \
bcf44a2c 3789 src/acl/Makefile \
a2794549 3790 src/fs/Makefile \
3791 src/repl/Makefile \
3792 src/auth/Makefile \
5fa840c3 3793 src/adaptation/Makefile \
1f3c65fc
AR
3794 src/adaptation/icap/Makefile \
3795 src/adaptation/ecap/Makefile \
f99c2cfe 3796 src/esi/Makefile \
663ff9aa 3797 src/icmp/Makefile \
f963428c 3798 src/ip/Makefile \
a2794549 3799 contrib/Makefile \
3800 snmplib/Makefile \
3801 icons/Makefile \
3802 errors/Makefile \
1077c1b8 3803 test-suite/Makefile \
99db07b3 3804 doc/Makefile \
0c510f3c 3805 helpers/Makefile \
3806 helpers/basic_auth/Makefile \
3807 helpers/basic_auth/LDAP/Makefile \
3808 helpers/basic_auth/MSNT/Makefile \
3809 helpers/basic_auth/NCSA/Makefile \
3810 helpers/basic_auth/PAM/Makefile \
3811 helpers/basic_auth/SMB/Makefile \
6e785d85 3812 helpers/basic_auth/mswin_sspi/Makefile \
0c510f3c 3813 helpers/basic_auth/YP/Makefile \
3814 helpers/basic_auth/getpwnam/Makefile \
3815 helpers/basic_auth/multi-domain-NTLM/Makefile \
3816 helpers/basic_auth/SASL/Makefile \
bcf74be7 3817 helpers/basic_auth/POP3/Makefile \
002d9b03 3818 helpers/basic_auth/DB/Makefile \
d80aac12 3819 helpers/basic_auth/squid_radius_auth/Makefile \
0c510f3c 3820 helpers/digest_auth/Makefile \
3821 helpers/digest_auth/password/Makefile \
55013f9c 3822 helpers/digest_auth/ldap/Makefile \
89f77e43 3823 helpers/digest_auth/eDirectory/Makefile \
0c510f3c 3824 helpers/ntlm_auth/Makefile \
3825 helpers/ntlm_auth/fakeauth/Makefile \
3826 helpers/ntlm_auth/no_check/Makefile \
3963d7b1
AJ
3827 helpers/ntlm_auth/smb_lm/Makefile \
3828 helpers/ntlm_auth/smb_lm/smbval/Makefile \
6e785d85 3829 helpers/ntlm_auth/mswin_sspi/Makefile \
3830 helpers/negotiate_auth/Makefile \
3831 helpers/negotiate_auth/mswin_sspi/Makefile \
c6588c68 3832 helpers/external_acl/Makefile \
3833 helpers/external_acl/ip_user/Makefile \
3834 helpers/external_acl/ldap_group/Makefile \
74ab8d10 3835 helpers/external_acl/session/Makefile \
c6588c68 3836 helpers/external_acl/unix_group/Makefile \
736a9a4d 3837 helpers/external_acl/wbinfo_group/Makefile \
9e6e0372 3838 helpers/external_acl/mswin_ad_group/Makefile \
94ab55b0 3839 helpers/external_acl/mswin_lm_group/Makefile \
3840 tools/Makefile
53cbe3e4 3841])
43ae1d95 3842
377792e4 3843AC_CONFIG_SUBDIRS(lib/libTrie)
3844
3e7b6055
AR
3845# must configure libltdl subdir unconditionally for "make distcheck" to work
3846AC_CONFIG_SUBDIRS(lib/libLtdl)
3847
6a9f6389 3848AC_OUTPUT