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