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