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