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