5
AC_INIT([Squid Web Proxy],[3.1.10],[http://www.squid-cache.org/bugs/],[squid])
7
AC_CONFIG_HEADERS([include/autoconf.h])
8
AC_CONFIG_AUX_DIR(cfgaux)
9
AC_CONFIG_SRCDIR([src/main.cc])
10
AM_INIT_AUTOMAKE([tar-ustar nostdinc])
11
AC_REVISION($Revision$)dnl
12
AC_PREFIX_DEFAULT(/usr/local/squid)
15
PRESET_CFLAGS="$CFLAGS"
16
PRESET_LDFLAGS="$LDFLAGS"
18
dnl Set default LDFLAGS
19
if test -z "$LDFLAGS"; then
30
AC_MSG_CHECKING([simplified host os])
31
simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'`
32
squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"`
33
if test -n "$squid_host_os_version"; then
34
squid_host_os="`echo $simple_host_os| sed s/$squid_host_os_version//g`"
36
squid_host_os="$simple_host_os"
38
AC_MSG_RESULT($squid_host_os (version $squid_host_os_version))
39
# on windows squid_host_os is either mingw or cygwin, version is 32
42
dnl Make the squid top srcdir available to sub-packages as --with-squid=PATH
43
new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir"
44
ac_configure_args="$new_configure_args"
46
squid_disable_werror="no"
47
AC_ARG_ENABLE(strict-error-checking,
48
AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
49
with all possible static compiler error-checks enbled.
50
This flag disables the behavior]),
52
if test "${enableval}" = "no"
54
squid_disable_werror="yes"
58
use_loadable_modules=1
59
AC_MSG_CHECKING(whether to use loadable modules)
60
AC_ARG_ENABLE(loadable-modules,
61
AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) ,
63
case "${enableval}" in
64
yes) use_loadable_modules=yes ;;
65
no) use_loadable_modules=no ;;
66
*) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
68
AC_MSG_RESULT([$use_loadable_modules, explicitly])
71
use_loadable_modules=yes;
72
AC_MSG_RESULT([$use_loadable_modules, implicitly])
76
AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
78
if test $use_loadable_modules = yes;
80
AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
87
if ! test "${ac_top_build_prefix}" = "";
89
# LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
90
# But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
91
# This fixes Linux LTDLv3-v7, and BSD LTDL v2.2
92
top_build_prefix=${ac_top_build_prefix}
93
AC_SUBST(top_build_prefix)
98
# Do we need these unconditionally for "make distcheck" to work?
102
if test $use_loadable_modules = yes;
104
# Why is this needed? Should not LT_INIT (or LT_LIB_DLLOAD) from libtool do that?
105
LIBADD_DL=${lt_cv_dlopen_libs}
106
AC_SUBST([LIBADD_DL])
113
REGEXLIB='' # -lregex
114
# LIBREGEX='' # libregex.a
116
dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
120
if test -z "$EXEEXT"; then
123
# automake automatically adds .exe when installing binaries
128
dnl this should be expanded to a list of platform sensible support requirements.
129
dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001
131
mingw|mingw32|cygwin|cygwin32)
132
AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true)
135
AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, false)
141
AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
142
CFLAGS="$CFLAGS -mthreads"
143
CXXFLAGS="$CXXFLAGS -mthreads"
144
if test "$ac_cv_path_WIN32_PSAPI" = "none"; then
145
AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
146
AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
148
AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
151
MINGW_LIBS="-lmingwex"
152
AM_CONDITIONAL(USE_IPC_WIN32, true)
156
AM_CONDITIONAL(USE_IPC_WIN32, false)
160
if test -z "$CACHE_HTTP_PORT"; then
161
CACHE_HTTP_PORT="3128"
163
if test -z "$CACHE_ICP_PORT"; then
164
CACHE_ICP_PORT="3130"
168
AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
169
[What default TCP port to use for HTTP listening?])
170
AC_SUBST(CACHE_HTTP_PORT)
171
AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
172
[What default UDP port to use for ICP listening?])
173
AC_SUBST(CACHE_ICP_PORT)
175
AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
177
AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid])
179
CACHE_EFFECTIVE_USER="nobody"
180
AC_ARG_WITH(default-user,
181
AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]),
182
[ CACHE_EFFECTIVE_USER="$withval" ]
184
AC_SUBST(CACHE_EFFECTIVE_USER)
186
DEFAULT_LOG_DIR="$localstatedir/logs"
188
AS_HELP_STRING([--with-logdir=PATH],[Default location for squid logs. default: $DEFAULT_LOG_DIR]),
191
AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
194
DEFAULT_LOG_DIR="$withval"
199
AC_SUBST(DEFAULT_LOG_DIR)
201
DEFAULT_PIDFILE="$localstatedir/run/squid.pid"
203
AS_HELP_STRING([--with-pidfile=PATH],[Default location for squid PID file. default: PREFIX/var/run/squid.pid]),
206
AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
209
DEFAULT_PIDFILE="$withval"
214
AC_SUBST(DEFAULT_PIDFILE)
216
dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
219
CC="$CC -arch m68k -arch i486 -arch hppa -arch sparc"
223
if test "$GCC" = "yes"; then
224
GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
225
GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'`
228
if test $GCCVER2 -lt 300 ; then
229
AC_MSG_FAILURE([GCC $GCCVER causes a coredump on $host. Try a more recent GCC version])
238
dnl Set Default CFLAGS
239
if test -z "$PRESET_CFLAGS"; then
240
if test "$GCC" = "yes"; then
243
# sunos has too many warnings for this to be useful
247
# Motorola cc/ld does not like -02 but is ok on -O
248
CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'`
251
CFLAGS="-Wall $CFLAGS"
257
# suggested by Rafael Seidl <rafaels@cthulhu.engr.sgi.com>
258
CFLAGS="-O3 -OPT:Olimit=0:space=OFF \
259
-woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
260
-Wl,-woff,85,-woff,84,-woff,134 \
261
-nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS"
262
CXXFLAGS="-O3 -OPT:Olimit=0:space=OFF \
263
-woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \
264
-Wl,-woff,85,-woff,84,-woff,134 \
265
-nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS"
268
# Mogul says DEC compilers take both -g and -O2
269
CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'`
278
dnl set squid required flags
279
if test "$GCC" = "yes"; then
280
dnl Guido Serassio (serassio@squid-cache.org) 20070811
281
dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
282
dnl -Werror -Wmissing-prototypes -Wmissing-declarations
283
dnl TODO: check if the problem will be present in any other newer MinGW release.
286
SQUID_CFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wcomments"
289
# FreeBSD places local libraries and packages in /usr/local
290
CFLAGS="$CFLAGS -I/usr/local/include"
291
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
292
LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-R/usr/local/lib"
295
SQUID_CFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments"
298
SQUID_CXXFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wcomments"
299
if test "$squid_disable_werror" = "no"
301
SQUID_CFLAGS="$SQUID_CFLAGS -Werror"
302
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -Werror"
308
AC_SUBST(SQUID_CFLAGS)
309
AC_SUBST(SQUID_CXXFLAGS)
311
if test "$GCC" = "yes"; then
312
AC_TEST_CHECKFORHUGEOBJECTS
313
SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG"
317
if test -z "$PRESET_LDFLAGS"; then
318
if test "$GCC" = "yes"; then
321
# Silence Linker warnings 84, 85 and 134
322
LDFLAGS="-Wl,-woff,85 -Wl,-woff,84 -Wl,-woff,134 $LDFLAGS"
339
AC_ARG_ENABLE(optimizations,
340
AS_HELP_STRING([--disable-optimizations],[Don't compile Squid with compiler optimizations enabled.
341
Optimization is good for production builds, but not
342
good for debugging. During development, use
343
--disable-optimizations to reduce compilation times
344
and allow easier debugging. This option implicitly
345
also enabled --disable-inline]),
346
[ if test "$enableval" = "no" ; then
347
AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
348
CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
349
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
354
AC_ARG_ENABLE(inline,
355
AS_HELP_STRING([--disable-inline],[Don't compile trivial methods as inline. Squid
356
is coded with much of the code able to be inlined.
357
Inlining is good for production builds, but not
358
good for development. During development, use
359
--disable-inline to reduce compilation times and
360
allow incremental builds to be quick. For
361
production builds, or load tests, use
362
--enable-inline to have squid make all trivial
363
methods inlinable by the compiler.]),
364
[ if test "$enableval" = "no" ; then
369
if test "$SquidInline" = "yes" ; then
370
AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
371
AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
373
AC_MSG_NOTICE([Inlining optimization disabled])
374
AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
377
AC_ARG_ENABLE(debug-cbdata,
378
AS_HELP_STRING([--enable-debug-cbdata],[Provide some debug information in cbdata]),
379
[ if test "$enableval" = "yes" ; then
380
AC_MSG_NOTICE([cbdata debugging enabled])
381
AC_DEFINE(CBDATA_DEBUG,1,[Enable for cbdata debug information])
385
dnl Nasty hack to get autoconf 2.64 on Linux to run.
386
dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64
387
AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[:])
389
dnl This is a developer only option.. developers know how to set defines
391
dnl AC_ARG_ENABLE(xmalloc-debug,
392
dnl [ --enable-xmalloc-debug Do some simple malloc debugging],
393
dnl [ if test "$enableval" = "yes" ; then
394
dnl AC_MSG_NOTICE([malloc debugging enabled])
395
dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging])
399
dnl This is a developer only option.. developers know how to set defines
401
dnl AC_ARG_ENABLE(xmalloc-debug-trace,
402
dnl [ --enable-xmalloc-debug-trace
403
dnl Detailed trace of memory allocations],
404
dnl [ if test "$enableval" = "yes" ; then
405
dnl AC_MSG_NOTICE([malloc debug trace enabled])
406
dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations])
407
dnl AC_DEFINE(XMALLOC_DEBUG,1)
411
AC_ARG_ENABLE(xmalloc-statistics,
412
AS_HELP_STRING([--enable-xmalloc-statistics],[Show malloc statistics in status page]),
413
[ if test "$enableval" = "yes" ; then
414
AC_MSG_NOTICE([malloc statistics enabled])
415
AC_DEFINE(XMALLOC_STATISTICS,1,[Define to have malloc statistics])
419
AC_ARG_ENABLE(async-io,
420
AS_HELP_STRING([--enable-async-io[=N_THREADS]],[Shorthand for "--with-aufs-threads=N_THREADS --with-pthreads
421
--enable-storeio=ufs,aufs"]),
425
STORE_MODULES="ufs aufs"
430
aufs_io_threads=$enableval
432
STORE_MODULES="ufs aufs"
437
AC_ARG_WITH(aufs-threads,
438
AS_HELP_STRING([--with-aufs-threads=N_THREADS],[Tune the number of worker threads for the aufs object store.]),
441
aufs_io_threads=$withval
444
AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
448
if test "$aufs_io_threads"; then
449
AC_MSG_NOTICE([With $aufs_io_threads aufs threads])
450
AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
451
[Defines how many threads aufs uses for I/O])
455
AS_HELP_STRING([--with-dl],[Use dynamic linking]))
456
if test "$with_dl" = "yes"; then
457
AC_MSG_NOTICE([With dl])
460
AC_ARG_ENABLE(disk-io,
461
AS_HELP_STRING([--enable-disk-io="list of modules"],[Build support for the list of disk I/O modules.
462
Set without a value or omitted, all available modules will be built.
463
See src/DiskIO for a list of available modules, or
464
Programmers Guide section on DiskIO
465
for details on how to build your custom disk module]),
468
for dir in $srcdir/src/DiskIO/*; do
469
module="`basename $dir`"
470
if test -d "$dir" && test "$module" != CVS; then
471
AC_MSG_NOTICE([Autodetected $module DiskIO module])
472
MAYBE_DISK_MODULES="$MAYBE_DISK_MODULES $module"
475
AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
478
AC_DEFINE(USE_DISKIO,0,[DiskIO modules are expected to be available.])
481
MAYBE_DISK_MODULES=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
482
AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
486
[ if test -z "$MAYBE_DISK_MODULES"; then
487
AC_MSG_NOTICE([Enabling all available DiskIO modules (default)...])
488
for dir in $srcdir/src/DiskIO/*; do
489
module="`basename $dir`"
490
if test -d "$dir" && test "$module" != CVS; then
491
AC_MSG_NOTICE([Autodetected $module DiskIO module])
492
MAYBE_DISK_MODULES="$MAYBE_DISK_MODULES $module"
495
AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
498
dnl Some autoconf.h defines we might enable later...
504
dnl Setup the module paths etc.
506
FOUND_DISKIO_BLOCKING=
507
FOUND_DISKIO_DISKDAEMON=
508
FOUND_DISKIO_DISKTHREADS=
513
for module in $MAYBE_DISK_MODULES none; do
514
if test "$module" = "none"; then
517
if ! test -d $srcdir/src/DiskIO/$module; then
518
AC_MSG_ERROR(disk-io $module does not exist)
522
if test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
523
AC_MSG_ERROR([DiskIO DiskDaemon module listed twice.])
525
FOUND_DISKIO_DISKDAEMON="yes"
526
AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
527
DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
528
DISK_MODULES="$DISK_MODULES DiskDaemon"
529
DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
530
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
533
if test "$FOUND_DISKIO_DISKTHREADS" = "yes" ; then
534
AC_MSG_ERROR([DiskIO DiskThreads module listed twice.])
536
FOUND_DISKIO_DISKTHREADS="yes"
537
use_diskthreads="yes"
539
SAVE_SQUID_CFLAGS="$SQUID_CFLAGS"
540
SAVE_SQUID_CXXFLAGS="$SQUID_CXXFLAGS"
541
AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
542
if test "$with_pthreads" != "no"; then
543
dnl TODO: this needs to be extended to handle more systems and better
544
dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
545
dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
549
AC_MSG_NOTICE([Windows threads support automatically enabled])
551
i386-unknown-freebsd*)
552
if test `echo "$squid_host_os_version" | cut -b1` -lt 7 ; then
553
AC_MSG_NOTICE(pthread library requires FreeBSD 7 or later)
556
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
557
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
558
if test "x$GCC" = "xyes" -a "x$PRESET_LDFLAGS" = "x" ; then
559
LDFLAGS="$LDFLAGS -pthread"
564
if test "$GCC" = "yes" ; then
565
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
566
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
567
AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
568
[ AC_MSG_NOTICE(pthread library required but cannot be found.)
572
dnl test for -lpthread first. libc version is a stub apparently on Solaris.
573
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
574
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
575
AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
576
[ SQUID_CFLAGS="$SAVE_SQUID_CFLAGS -D_REENTRANT -lpthread -mt"
577
SQUID_CXXFLAGS="$SAVE_SQUID_CXXFLAGS -D_REENTRANT -lpthread -mt"
578
AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
579
[ AC_MSG_NOTICE(pthread library required but cannot be found.)
586
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
587
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
588
AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
589
[ AC_MSG_NOTICE(pthread library required but cannot be found.)
595
AC_MSG_NOTICE([Native pthreads support manually disabled.])
598
if test "$use_diskthreads" = "yes" ; then
599
AC_DEFINE(USE_DISKIO_DISKTHREADS, 1, [Whether pthreads support is needed. Automatic])
600
AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
601
DISK_LIBS="$DISK_LIBS libDiskThreads.a"
602
DISK_OS_LIBS="$DISK_OS_LIBS $LIBPTHREADS"
603
DISK_MODULES="$DISK_MODULES DiskThreads"
604
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
606
AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic])
607
AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
608
SQUID_CFLAGS="$SAVE_SQUID_CFLAGS"
609
SQUID_CXXFLAGS="$SAVE_SQUID_CXXFLAGS"
614
if test "$FOUND_DISKIO_AIO" = "yes" ; then
615
AC_MSG_ERROR([DiskIO AIO module listed twice.])
617
FOUND_DISKIO_AIO="yes"
618
dnl Check for POSIX AIO availability
621
AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
622
if test "$with_aio" != "no"; then
624
AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
625
dnl On some systems POSIX AIO functions are in librt
626
dnl On some systems POSIX AIO functions are in libaio
627
AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
628
dnl Enable AIO if the library and headers are found
629
if test "$AIOLIB" != "" && test "$have_aio_header" = "yes"; then
630
AC_MSG_NOTICE([Native POSIX AIO support detected.])
633
dnl Windows does things differently. We provide wrappers.
634
dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
638
AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
641
AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
647
AC_MSG_NOTICE([POSIX AIO support manually disabled.])
650
dnl Use the POSIX AIO pieces if we actually need them.
651
if test "$use_aio" = "yes" ; then
652
AC_DEFINE(USE_DISKIO_AIO, 1, [Whether POSIX AIO support is needed. Automatic])
653
DISK_MODULES="$DISK_MODULES AIO"
654
DISK_LIBS="$DISK_LIBS libAIO.a"
655
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
659
AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
662
AC_MSG_NOTICE([Enabling AIO DiskIO module])
663
DISK_OS_LIBS="$DISK_OS_LIBS $AIOLIB"
667
AC_DEFINE(USE_DISKIO_AIO, 0, [Whether POSIX AIO support is needed. Automatic])
668
AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
673
if test "$FOUND_DISKIO_BLOCKING" = "yes" ; then
674
AC_MSG_ERROR([DiskIO Blocking module listed twice.])
676
FOUND_DISKIO_BLOCKING="yes"
677
AC_MSG_NOTICE([Enabling Blocking DiskIO module])
678
DISK_LIBS="$DISK_LIBS libBlocking.a"
679
DISK_MODULES="$DISK_MODULES Blocking"
680
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
684
AC_MSG_NOTICE([Enabling $module DiskIO module])
685
DISK_LIBS="$DISK_LIBS lib${module}.a"
686
DISK_MODULES="$DISK_MODULES ${module}"
687
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
691
AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
692
AC_SUBST(DISK_MODULES)
694
AC_SUBST(DISK_PROGRAMS)
695
AC_SUBST(DISK_LINKOBJS)
696
AC_SUBST(DISK_OS_LIBS)
697
AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
698
AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
701
dnl Check what Storage formats are wanted.
702
dnl This version will error out with a message saying why if a required DiskIO is missing.
703
AC_ARG_ENABLE(storeio,
704
AS_HELP_STRING([--enable-storeio="list of modules"],[Build support for the list of store I/O modules.
705
The default is only to build the "ufs" module.
706
See src/fs for a list of available modules, or
707
Programmers Guide section <not yet written>
708
for details on how to build your custom store module]),
711
for dir in $srcdir/src/fs/*; do
712
module="`basename $dir`"
713
if test -d "$dir" && test "$module" != CVS && test "$module" != coss; then
714
STORE_MODULES="$STORE_MODULES $module"
721
STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
725
[ if test -z "$STORE_MODULES"; then
729
if test -n "$STORE_MODULES"; then
730
dnl ensure that all modules a) exist and b) only include once.
731
STORE_MODULES_FULL=$STORE_MODULES
733
for module in $STORE_MODULES_FULL; do
734
have_mod=`echo "$STORE_MODULES" | grep "$module"`
735
if test "$have_mod" != ""; then
736
AC_MSG_NOTICE([Removing duplicate $module from storeio])
737
elif test -d $srcdir/src/fs/$module; then
738
STORE_MODULES="$STORE_MODULES $module"
740
AC_MSG_ERROR(storeio $module does not exist)
743
AC_MSG_NOTICE([Store modules built: $STORE_MODULES])
745
for fs in $STORE_MODULES none; do
748
if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
749
AC_MSG_ERROR([Storage diskd module requires DiskIO modules: Blocking or DiskDaemon])
754
if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKTHREADS" = "yes" ; then
755
AC_MSG_ERROR([Storage diskd module requires DiskIO modules: Blocking or DiskThreads])
760
if ! test "$FOUND_DISKIO_AIO" = "yes"; then
761
AC_MSG_ERROR([COSS requires POSIX AIO which is not available.])
764
dnl Automake om MinGW needs explicit exe extension
765
dnl for STORE_TESTS substition
767
STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
771
STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
775
if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
776
AC_MSG_NOTICE([Adding UFS, as it contains core logic for diskd and aufs])
777
STORE_MODULES="$STORE_MODULES ufs"
779
dnl Automake om MinGW needs explicit exe extension
780
dnl for STORE_TESTS substition
782
STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
785
AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
786
AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
787
AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
788
AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build")
791
dnl got final STORE_MODULES, build library lists
792
dnl This list will not be needed when each fs library has its own Makefile
794
dnl File system libraries to link executables with.
795
dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
797
for fs in $STORE_MODULES; do
798
STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
799
STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
800
HAVE_FS_TYPE=HAVE_FS_`echo $fs | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
801
AC_DEFINE_UNQUOTED($HAVE_FS_TYPE, 1)
804
AC_SUBST(STORE_LIBS_TO_BUILD)
805
AC_SUBST(STORE_LIBS_TO_ADD)
806
AC_SUBST(STORE_TESTS)
809
dnl At lest one removal policy is always needed.
810
dnl 'lru' removal policy is currently hard-coded by name for tests
811
dnl so we must set it as default.
813
AC_ARG_ENABLE(removal-policies,
814
AS_HELP_STRING([--enable-removal-policies="list of policies"],[Build support for the list of removal policies.
815
The default is only to build the "lru" module.
816
See src/repl for a list of available modules, or
817
Programmers Guide section 9.9 for details on how
818
to build your custom policy]),
821
for dir in $srcdir/src/repl/*; do
822
module="`basename $dir`"
823
if test -d "$dir" && test "$module" != CVS && test "$module" != "lru"; then
824
REPL_POLICIES="$REPL_POLICIES $module"
831
REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
835
if test -n "$REPL_POLICIES"; then
836
for module in $REPL_POLICIES; do
837
if test -d $srcdir/src/repl/$module; then
840
AC_MSG_ERROR(Removal policy $module does not exist)
843
AC_MSG_NOTICE([Removal policies built: $REPL_POLICIES])
844
REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a"
845
REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`"
847
AC_SUBST(REPL_POLICIES)
851
AM_CONDITIONAL(ENABLE_PINGER, false)
853
AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
854
[ if test "$enableval" = "yes" ; then
855
AC_MSG_NOTICE([ICMP enabled])
856
AC_DEFINE(USE_ICMP,1,[Define to use Squid's ICMP and Network Measurement features (highly recommended!)])
857
AM_CONDITIONAL(ENABLE_PINGER, true)
861
AM_CONDITIONAL(USE_DELAY_POOLS, false)
862
AC_ARG_ENABLE(delay-pools,
863
AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
864
[ if test "$enableval" = "yes" ; then
865
AC_MSG_NOTICE([Delay pools enabled])
866
AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
867
AM_CONDITIONAL(USE_DELAY_POOLS, true,)
871
dnl disable generic/common adaptation support by default
876
AS_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Benefits from expat or libxml2.
877
Enabling ESI will cause squid reverse proxies to be capable of the
878
Edge Acceleration Specification (www.esi.org).]),
879
use_esi=$enableval, use_esi=no)
884
if test "$use_esi" = "yes" ; then
885
AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.])
886
AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
888
AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect]))
889
if test "$with_expat" != "no" ; then
890
AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
891
AC_CHECK_HEADERS([expat.h])
892
AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
893
if test "$with_expat" = "yes" && test "$HAVE_LIBEXPAT" != "1" ; then
894
AC_MSG_ERROR([Required library expat is not able to be found.])
898
AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
899
if test "$with_libxml2" != "no" ; then
900
AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1])
901
dnl Find the main header and include path...
902
ac_cv_libxml2_include='no'
903
AC_CHECK_HEADERS([libxml/parser.h], [], [
904
AC_MSG_NOTICE([Testing in /usr/include/libxml2])
905
SAVED_CPPFLAGS="$CPPFLAGS"
906
CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
907
unset ac_cv_header_libxml_parser_h
908
AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="/usr/include/libxml2"], [])
909
CPPFLAGS="$SAVED_CPPFLAGS"
910
if test "x$ac_cv_libxml2_include" = "xno"; then
911
AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
912
SAVED_CPPFLAGS="$CPPFLAGS"
913
CPPFLAGS="-I/usr/local/include/libxml2 $CPPFLAGS"
914
unset ac_cv_header_libxml_parser_h
915
AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="/usr/local/include/libxml2"], [])
916
CPPFLAGS="$SAVED_CPPFLAGS"
919
if test "x$ac_cv_libxml2_include" != "xno"; then
920
SQUID_CXXFLAGS="-I$ac_cv_libxml2_include $SQUID_CXXFLAGS"
921
CPPFLAGS="-I$ac_cv_libxml2_include $CPPFLAGS"
923
dnl Now that we know where to look find the other headers...
924
AC_CHECK_HEADERS(libxml/HTMLparser.h libxml/HTMLtree.h)
925
AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
926
if test "$with_libxml2" = "yes" && test "$HAVE_LIBXML2" != "1" ; then
927
AC_MSG_ERROR([Required library libxml2 is not able to be found.])
932
AC_MSG_NOTICE([Disabling ESI processor and Surrogate header support.])
934
AM_CONDITIONAL(USE_ESI, test "$use_esi" = "yes")
935
AM_CONDITIONAL(HAVE_LIBEXPAT, test $HAVE_LIBEXPAT = 1)
937
AM_CONDITIONAL(HAVE_LIBXML2, test $HAVE_LIBXML2 = 1)
940
AM_CONDITIONAL(USE_ICAP_CLIENT, false)
941
AC_ARG_ENABLE(icap-client,
942
AS_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
943
use_icap_client=$enableval, use_icap_client=no)
944
if test "$use_icap_client" = "yes" ; then
945
AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
946
AM_CONDITIONAL(USE_ICAP_CLIENT, true)
947
ICAP_LIBS="icap/libicap.la"
950
AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
956
AC_MSG_CHECKING(whether to support eCAP)
958
AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]),
960
case "${enableval}" in
963
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
965
AC_MSG_RESULT([$use_ecap, explicitly])
969
AC_MSG_RESULT([$use_ecap, implicitly])
973
dnl Perform configuration consistency checks for eCAP
975
if test $use_ecap = yes;
977
dnl eCAP support requires loadable modules, which are enabled by default
978
if test "$use_loadable_modules" != "yes"
980
AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
983
dnl eCAP support requires libecap
984
AC_CHECK_LIB([ecap], [main],
986
[AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])]
990
AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
991
if test $use_ecap = yes;
993
AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
994
ECAP_LIBS="ecap/libecap.la $ECAP_LIBS"
997
AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
1000
dnl convenience library
1002
dnl -lecap if needed
1006
dnl enable adaptation if requested by specific adaptation mechanisms
1007
AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
1008
if test $use_adaptation = yes
1010
AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
1011
ADAPTATION_LIBS="adaptation/libadaptation.la"
1013
AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
1016
AC_SUBST(ADAPTATION_LIBS)
1019
dnl This is a developer only option. Developers know how to set defines
1021
dnl AC_ARG_ENABLE(mem-gen-trace,
1022
dnl [ --enable-mem-gen-trace Do trace of memory stuff],
1023
dnl [ if test "$enableval" = "yes" ; then
1024
dnl AC_MSG_NOTICE([Memory trace (to file) enabled])
1025
dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
1029
AC_ARG_ENABLE(useragent-log,
1030
AS_HELP_STRING([--enable-useragent-log],[Enable logging of User-Agent header]),
1031
[ if test "$enableval" = "yes" ; then
1032
AC_MSG_NOTICE([User-Agent logging enabled])
1033
AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
1034
By default, they are written to useragent.log in the Squid log
1039
AC_ARG_ENABLE(referer-log,
1040
AS_HELP_STRING([--enable-referer-log],[Enable logging of Referer header]),
1041
[ if test "$enableval" = "yes" ; then
1042
AC_MSG_NOTICE([Referer logging enabled])
1043
AC_DEFINE(USE_REFERER_LOG,1,[If you want to log Referer request header values, define this.
1044
By default, they are written to referer.log in the Squid log
1051
AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]),
1052
[ if test "$enableval" = "no" ; then
1053
AC_MSG_NOTICE([Web Cache Coordination Protocol disabled])
1057
if test $USE_WCCP = 1; then
1058
AC_DEFINE(USE_WCCP, 1, [Define to enable WCCP])
1062
AC_ARG_ENABLE(wccpv2,
1063
AS_HELP_STRING([--disable-wccpv2],[Disable Web Cache Coordination V2 Protocol]),
1064
[ if test "$enableval" = "no" ; then
1065
AC_MSG_NOTICE(["Web Cache Coordination V2 Protocol disabled])
1069
if test $USE_WCCPv2 = 1; then
1070
AC_DEFINE(USE_WCCPv2, 1, [Define to enable WCCP V2])
1073
AC_ARG_ENABLE(kill-parent-hack,
1074
AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]),
1075
[ if test "$enableval" = "yes" ; then
1076
AC_MSG_NOTICE([Kill parent on shutdown])
1077
AC_DEFINE(KILL_PARENT_OPT,1,[A dangerous feature which causes Squid to kill its parent process upon receipt of SIGTERM or SIGINT. Use with caution.])
1083
AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]),
1084
[ if test "$enableval" = "no" ; then
1085
AC_MSG_NOTICE([SNMP monitoring disabled])
1089
if test x"$USE_SNMP" = xtrue; then
1090
AC_DEFINE(SQUID_SNMP,1,[Define to enable SNMP monitoring of Squid])
1091
SNMPLIB='../snmplib/libsnmp.a'
1094
AM_CONDITIONAL(USE_SNMP, [test x$USE_SNMP = xtrue])
1096
AC_SUBST(makesnmplib)
1098
AC_ARG_ENABLE(cachemgr-hostname,
1099
AS_HELP_STRING([--enable-cachemgr-hostname=hostname],[Make cachemgr.cgi default to this host.
1100
If unspecified, uses the name of the build-host]),
1101
[ case $enableval in
1103
AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()],
1104
[If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()])
1105
AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs])
1111
AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}")
1112
AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}])
1117
AM_CONDITIONAL(ENABLE_ARP_ACL, false)
1118
AC_ARG_ENABLE(arp-acl,
1119
AS_HELP_STRING([--enable-arp-acl],[Enable use of ARP ACL lists (ether address)]),
1120
[ if test "$enableval" = "yes" ; then
1121
AC_MSG_NOTICE([ARP ACL lists enabled (ether address)])
1134
LIBS="$LIBS -liphlpapi"
1137
LIBS="$LIBS -liphlpapi"
1140
AC_MSG_WARN([ARP ACL support probably won't work on $host.])
1144
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, ?).])
1145
AM_CONDITIONAL(ENABLE_ARP_ACL, true)
1150
AM_CONDITIONAL(ENABLE_HTCP, false)
1152
AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]),
1153
[ if test "$enableval" = "no" ; then
1154
AC_MSG_NOTICE([HTCP support disabled])
1157
if test x$USE_HTCP = xtrue; then
1158
AC_DEFINE(USE_HTCP,1, [Define this to include code for the Hypertext Cache Protocol (HTCP)])
1160
AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
1162
dnl SSL is not enabled by default.
1163
AM_CONDITIONAL(ENABLE_SSL, false)
1165
dnl Default is to use OpenSSL when available
1167
AS_HELP_STRING([--enable-ssl],[Enable ssl gatewaying support using OpenSSL]),
1168
[ if test "$enableval" != "no"; then
1169
AC_MSG_NOTICE([SSL gatewaying using OpenSSL enabled])
1170
AC_DEFINE(USE_SSL,1,[Define this to include code for SSL encryption.])
1171
AM_CONDITIONAL(ENABLE_SSL, true)
1174
dnl Native Windows port of OpenSSL needs -lgdi32
1175
SSLLIB='-lssleay32 -leay32 -lgdi32'
1178
SSLLIB='-lssl -lcrypto'
1185
dnl User may specify OpenSSL is needed from a non-standard location
1186
AC_ARG_WITH(openssl,
1187
AS_HELP_STRING([--with-openssl{=PATH}],[Compile with the OpenSSL libraries. The path to
1188
the OpenSSL development libraries and headers
1189
installation can be specified if outside of the
1190
system standard directories]),
1192
case "$with_openssl" in
1200
SSLLIBDIR="$with_openssl/lib"
1201
CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
1205
if test -n "$USE_OPENSSL"; then
1206
AC_MSG_NOTICE([Using OpenSSL MD5 implementation])
1207
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)])
1208
if test -z "$SSLLIB"; then
1209
SSLLIB="-lcrypto" # for MD5 routines
1211
dnl This is a workaround for RedHat 9 brain damage..
1212
if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then
1213
AC_MSG_NOTICE([OpenSSL depends on Kerberos])
1214
SSLLIBDIR="/usr/kerberos/lib"
1215
CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1218
if test -n "$SSLLIBDIR"; then
1219
SSLLIB="-L$SSLLIBDIR $SSLLIB"
1224
AC_ARG_ENABLE(forw-via-db,
1225
AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]),
1226
[ if test "$enableval" = "yes" ; then
1227
AC_MSG_NOTICE([FORW-VIA enabled])
1228
AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
1232
AC_ARG_ENABLE(cache-digests,
1233
AS_HELP_STRING([--enable-cache-digests],[Use Cache Digests.
1234
See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
1235
[ if test "$enableval" = "yes" ; then
1236
AC_MSG_NOTICE([Cache Disgests enabled])
1237
AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
1241
dnl Size of COSS memory buffer
1242
AC_ARG_WITH(coss-membuf-size,
1243
AS_HELP_STRING([--with-coss-membuf-size=size],[COSS membuf size (default 1048576 bytes)]),
1244
[ if test -n "$withval" -a "x$withval" != "xno" ; then
1245
AC_MSG_NOTICE([Setting COSS membuf size to $with_coss_membuf_size bytes])
1246
AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
1250
dnl check for netio plugin stuff
1255
AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]),
1257
case "$enableval" in
1259
AC_MSG_WARN([Forcing poll() to be enabled])
1263
AC_MSG_WARN([Forcing poll() to be disabled])
1271
AC_ARG_ENABLE(select,
1272
AS_HELP_STRING([--disable-select],[Disable select(2) support.]),
1274
case "$enableval" in
1276
AC_MSG_WARN([Forcing select() to be enabled])
1277
SELECT_TYPE="select"
1280
AC_MSG_WARN([Forcing select() to be disabled])
1287
dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1289
AC_ARG_ENABLE(kqueue,
1290
AS_HELP_STRING([--enable-kqueue],[Enable kqueue(2) support (experimental).]),
1292
case "$enableval" in
1294
AC_MSG_WARN([Forcing kqueue() to be enabled])
1295
SELECT_TYPE="kqueue"
1296
AC_CHECK_HEADERS([sys/event.h],[],
1297
[ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ])
1300
AC_MSG_WARN([Forcing kqueue() to be disabled])
1304
AC_CHECK_HEADERS([sys/event.h])
1312
AC_ARG_ENABLE(epoll,
1313
AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
1315
case "$enableval" in
1317
AC_MSG_WARN([Forcing epoll() to be enabled])
1322
AC_MSG_WARN([Forcing epoll() to be disabled])
1327
dnl auto-detect and verify epoll header and library present and working
1328
if test -z "$disable_epoll"; then
1330
# Check for libepoll
1332
AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
1333
AC_SUBST(EPOLL_LIBS)
1335
dnl on some systems it is provided by libc
1336
dnl not to worry, the working test below will catch them
1337
dnl and we don't want to force additional libraries
1340
# Check for epoll_ctl, may need -lepoll
1342
LIBS="$LIBS $EPOLL_LIBS"
1343
AC_CHECK_FUNCS(epoll_ctl)
1346
dnl epoll requires sys/epoll.h
1347
AC_CHECK_HEADERS([sys/epoll.h])
1349
dnl Verify that epoll really works
1350
if test $ac_cv_func_epoll_ctl = yes; then
1351
AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
1352
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1353
#include <sys/epoll.h>
1356
int main(int argc, char **argv)
1358
int fd = epoll_create(256);
1360
perror("epoll_create:");
1365
]])],[ac_cv_epoll_works=yes],[ac_cv_epoll_works=no],[:]))
1368
if test "$force_epoll" = "yes" && test "$ac_cv_epoll_works" = "no" ; then
1369
AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
1373
dnl Enable solaris /dev/poll
1375
AC_ARG_ENABLE(devpoll,
1376
AS_HELP_STRING([--disable-devpoll],[Disable Solaris /dev/poll support.]),
1378
case "$enableval" in
1380
AC_MSG_WARN([Forcing devpoll() to be enabled])
1381
SELECT_TYPE="devpoll"
1382
enable_devpoll="yes"
1385
AC_MSG_WARN([Forcing devpoll() to be disabled])
1390
dnl auto-detect and verify devpoll header and library present and working
1391
if test "x$enable_devpoll" != "xno"; then
1393
# Check for /dev/poll
1394
AC_CHECK_FUNCS(ioctl)
1395
AC_CHECK_FUNCS(write)
1397
dnl devpoll requires sys/devpoll.h
1398
AC_CHECK_HEADERS([sys/devpoll.h],,[
1399
if test "x$enable_devpoll" = "xyes"; then
1400
AC_MSG_ERROR([--enable-devpoll specified but /dev/poll headers not found])
1404
dnl Verify that /dev/poll really works
1405
if test "$ac_cv_func_ioctl" = "yes" && test "$ac_cv_func_write" = "yes"; then
1406
AC_CACHE_CHECK(if /dev/poll works, ac_cv_devpoll_works,
1407
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1408
#include <sys/devpoll.h>
1412
int main(int argc, char **argv)
1414
int fd = open("/dev/poll", O_RDWR);
1416
perror("devpoll_create:");
1421
]])],[ac_cv_devpoll_works=yes],[ac_cv_devpoll_works=no],[:]))
1424
if test "x$enable_devpoll" = "xyes" && test "x$ac_cv_devpoll_works" = "xno" ; then
1425
AC_MSG_ERROR([/dev/poll does not work. Force-enabling it is not going to help.])
1429
dnl Disable HTTP violations
1431
AC_ARG_ENABLE(http-violations,
1432
AS_HELP_STRING([--disable-http-violations],[This allows you to remove code which is known to
1433
violate the HTTP protocol specification.]),
1434
[ if test "$enableval" = "no" ; then
1435
AC_MSG_NOTICE([Disabling HTTP Violations])
1439
if test $http_violations = 1; then
1440
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.])
1442
AC_DEFINE(HTTP_VIOLATIONS, 0)
1445
dnl Enable IPFW Transparent Proxy
1446
AC_ARG_ENABLE(ipfw-transparent,
1447
AS_HELP_STRING([--enable-ipfw-transparent],[Enable Transparent Proxy support for systems
1448
using FreeBSD IPFW style redirection.]),
1449
[ if test "$enableval" = "yes" ; then
1450
AC_MSG_NOTICE([IPFW Transparent Proxy enabled])
1451
AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1452
IPFW_TRANSPARENT="yes"
1454
AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.])
1458
dnl Enable IP-Filter Transparent Proxy
1459
AC_ARG_ENABLE(ipf-transparent,
1460
AS_HELP_STRING([--enable-ipf-transparent],[Enable Transparent Proxy support for systems
1461
using IP-Filter network address redirection.]),
1462
[ if test "$enableval" = "yes" ; then
1463
AC_MSG_NOTICE([IP-Filter Transparent Proxy enabled])
1464
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.])
1465
IPF_TRANSPARENT="yes"
1467
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.])
1471
dnl Enable PF Transparent Proxy
1472
AC_ARG_ENABLE(pf-transparent,
1473
AS_HELP_STRING([--enable-pf-transparent],[Enable Transparent Proxy support for systems
1474
using PF network address redirection.]),
1475
[ if test "$enableval" = "yes" ; then
1476
AC_MSG_NOTICE([PF Transparent Proxy enabled])
1477
AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1478
PF_TRANSPARENT="yes"
1480
AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.])
1484
dnl Enable Linux Netfilter Transparent Proxy
1485
AC_ARG_ENABLE(linux-netfilter,
1486
AS_HELP_STRING([--enable-linux-netfilter],[Enable Transparent Proxy support for Linux (Netfilter)]),
1487
[ if test "$enableval" = "yes" ; then
1488
AC_MSG_NOTICE([Linux (Netfilter) Transparent Proxy enabled])
1489
AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1490
LINUX_NETFILTER="yes"
1492
AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems])
1496
dnl Enable Large file support
1500
AC_ARG_WITH(large-files,
1501
AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]),
1502
[ if test "x$withval" = "xyes"; then
1507
dnl UNIX Build environment
1508
dnl AS_HELP_STRING is not suited here because it doesn't allow to specify newlines
1509
AC_ARG_WITH(build-environment,
1510
[ --with-build-environment=model
1511
The build environment to use. Normally one of
1512
POSIX_V6_ILP32_OFF32 32 bits
1513
POSIX_V6_ILP32_OFFBIG 32 bits with large file support
1514
POSIX_V6_LP64_OFF64 64 bits
1515
POSIX_V6_LPBIG_OFFBIG large pointers and files
1516
XBS5_ILP32_OFF32 32 bits (legacy)
1517
XBS5_ILP32_OFFBIG 32 bits with large file support (legacy)
1518
XBS5_LP64_OFF64 64 bits (legacy)
1519
XBS5_LPBIG_OFFBIG large pointers and files (legacy)
1520
default The default for your OS],
1521
[ case "$withval" in
1523
AC_MSG_FAILURE(["--with-build-environment expects a build environment string as used by getconf])
1526
buildmodel="$withval"
1531
if test $needlargefiles && test -z "$buildmodel"; then
1532
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
1533
if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
1538
if test -z "$buildmodel"; then
1539
AC_MSG_WARN(["No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64])
1543
case "$buildmodel" in
1545
if test "$needlargefiles"; then
1546
AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64])
1547
CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
1548
CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
1552
AC_MSG_NOTICE([Using $buildmodel build environment])
1553
if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
1556
AC_MSG_ERROR(Build environment $buildmodel not known to getconf.)
1558
CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
1559
CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS"
1560
LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
1561
LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1564
dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1565
dnl for LDFLAGS -xarch=generic64, but:
1566
dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1567
dnl For gcc "-xarch=generic64" must be replaced with "-m64"
1568
dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1570
if test "$GCC" = "yes"; then
1571
AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host])
1572
CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1573
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`"
1574
AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host])
1575
CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1576
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1577
LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1579
AC_MSG_NOTICE([Removing -Usun on $host])
1580
CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
1581
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`"
1584
dnl On Irix 6.x getconf returns options valid only for the SGI MipsPRO compiler,
1585
dnl so we must adjust something to avoid gcc errors.
1586
dnl On Irix 6.x 32/64 bit we must replace "-n32" with "-mabi=n32" in CFLAGS and
1587
dnl remove "-n32" from LDFLAGS
1588
dnl On Irix 6.x 64 bit we must replace "-64" with "-mabi=64" in CFLAGS and remove
1589
dnl "-64" from LDFLAGS
1591
if test "$GCC" = "yes"; then
1592
CFLAGS="`echo $CFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1593
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-n32/-mabi=n32/'`"
1594
LDFLAGS="`echo $LDFLAGS | sed -e 's/-n32//'`"
1595
CFLAGS="`echo $CFLAGS | sed -e 's/-64/-mabi=64/'`"
1596
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-64/-mabi=64/'`"
1597
LDFLAGS="`echo $LDFLAGS | sed -e 's/-64//'`"
1606
dnl Enable Linux transparent proxy support for obsolete TPROXY
1607
AC_ARG_ENABLE(linux-tproxy,
1608
AS_HELP_STRING([--enable-linux-tproxy],[Enable real Transparent Proxy support for Netfilter TPROXY
1610
[ if test "$enableval" = "yes" ; then
1611
AC_MSG_NOTICE([Linux Netfilter/TPROXY v2 enabled])
1612
AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1614
if test -z "$LINUX_NETFILTER"; then
1615
AC_MSG_NOTICE([Linux-Netfilter Transparent Proxy automatically enabled])
1616
LINUX_NETFILTER="yes"
1619
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
1623
AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1624
dnl Enable Leak Finding Functions
1625
AC_ARG_ENABLE(leakfinder,
1626
AS_HELP_STRING([--enable-leakfinder],[Enable Leak Finding code. Enabling this alone
1627
does nothing; you also have to modify the source
1628
code to use the leak finding functions. Probably
1629
Useful for hackers only.]),
1630
[ if test "$enableval" = "yes" ; then
1631
AC_MSG_NOTICE([Leak-Finding enabled])
1632
AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1633
USE_LEAKFINDER="yes"
1634
AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1639
AC_ARG_ENABLE(follow-x-forwarded-for,
1640
AS_HELP_STRING([--enable-follow-x-forwarded-for],[Enable support for following the X-Forwarded-For
1641
HTTP header to try to find the IP address of the
1642
original or indirect client when a request has
1643
been forwarded through other proxies.]),
1644
[ if test "$enableval" = "yes" ; then
1645
AC_MSG_NOTICE([follow X-Forwarded-For enabled])
1649
if test $follow_xff = 1; then
1650
AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1652
AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1656
AC_ARG_ENABLE(ident-lookups,
1657
AS_HELP_STRING([--disable-ident-lookups],[This allows you to remove code that performs Ident (RFC 931) lookups.]),
1658
[ if test "$enableval" = "no" ; then
1659
AC_MSG_NOTICE([Disabling Ident Lookups])
1663
if test $use_ident = 1; then
1664
AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1666
AC_DEFINE(USE_IDENT, 0)
1669
AM_CONDITIONAL(USE_DNSSERVER, false)
1671
AC_ARG_ENABLE(internal-dns,
1672
AS_HELP_STRING([--disable-internal-dns],[Prevents Squid from directly sending and receiving DNS messages,
1673
and instead enables the old external 'dnsserver' processes.]),
1674
[ if test "$enableval" = "no" ; then
1675
AC_MSG_WARN([Disabling Internal DNS queries])
1679
if test "$use_dnsserver" = "yes"; then
1680
AC_DEFINE(USE_DNSSERVERS,1,[Use dnsserver processes instead of the internal DNS protocol support])
1681
AM_CONDITIONAL(USE_DNSSERVER, true)
1684
dnl Select Default hosts file location
1685
AC_ARG_ENABLE(default-hostsfile,
1686
AS_HELP_STRING([--enable-default-hostsfile=path],[Select default location for hosts file.
1687
See hosts_file directive in squid.conf for details]),
1689
if test "$enableval" != "none" ; then
1690
if test -f $enableval; then
1691
OPT_DEFAULT_HOSTS=$enableval
1693
AC_MSG_WARN([Unable to find $enableval])
1697
OPT_DEFAULT_HOSTS="none"
1699
AC_MSG_NOTICE([Default hosts file set to: $enableval])
1700
],[OPT_DEFAULT_HOSTS="/etc/hosts"])
1701
AC_SUBST(OPT_DEFAULT_HOSTS)
1703
dnl Select auth schemes modules to build
1705
AS_HELP_STRING([--enable-auth="list of auth scheme modules"],[Build support for the list of authentication schemes.
1706
The default is to build support for the Basic scheme.
1707
See src/auth for a list of available modules, or
1708
Programmers Guide section authentication schemes
1709
for details on how to build your custom auth scheme
1711
[ case $enableval in
1713
for dir in $srcdir/src/auth/*; do
1714
module="`basename $dir`"
1715
if test -d "$dir" && test "$module" != CVS; then
1716
AUTH_MODULES="$AUTH_MODULES $module"
1723
AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1727
[ if test -z "$AUTH_MODULES"; then
1728
AUTH_MODULES="ntlm basic digest negotiate"
1731
if test -n "$AUTH_MODULES"; then
1732
for module in $AUTH_MODULES; do
1733
if test -d $srcdir/src/auth/$module; then
1736
AC_MSG_ERROR(Auth scheme $module does not exist)
1738
eval AUTH_MODULE_${module}=yes
1740
AC_MSG_NOTICE([Auth scheme modules built: $AUTH_MODULES])
1742
AC_MSG_WARN([Auth scheme modules built: None])
1744
dnl Authentication libraries to build
1745
dnl This list will not be needed when each auth library has its own Makefile
1747
for module in $AUTH_MODULES; do
1748
AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD lib${module}.la"
1750
AC_SUBST(AUTH_MODULES)
1751
AC_SUBST(AUTH_LIBS_TO_BUILD)
1753
dnl bundled auth modules, in order to have handy defines for the cppunit testsuite
1754
test -n "$AUTH_MODULE_basic" && AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built])
1755
test -n "$AUTH_MODULE_digest" && AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built])
1756
test -n "$AUTH_MODULE_ntlm" && AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
1757
test -n "$AUTH_MODULE_negotiate" && AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built])
1759
dnl Select basic auth scheme helpers to build
1760
if test -n "$AUTH_MODULE_basic"; then
1761
BASIC_AUTH_HELPERS="all"
1763
AC_ARG_ENABLE(basic-auth-helpers,
1764
AS_HELP_STRING([--enable-basic-auth-helpers="list of helpers"],[This option selects which basic scheme proxy_auth
1765
helpers to build and install as part of the normal
1766
build process. For a list of available
1767
helpers see the helpers/basic_auth directory.]),
1768
[ case "$enableval" in
1770
BASIC_AUTH_HELPERS="all"
1773
BASIC_AUTH_HELPERS=""
1776
if test -z "$AUTH_MODULE_basic"; then
1777
AC_MSG_WARN([Basic auth helpers selected without the basic scheme enabled])
1780
BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1784
if test "$BASIC_AUTH_HELPERS" = "all" ; then
1785
BASIC_AUTH_HELPERS=""
1786
for dir in $srcdir/helpers/basic_auth/*; do
1787
helper="`basename $dir`"
1788
if test -f $dir/config.test && sh $dir/config.test "$@"; then
1789
BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper"
1793
if test -n "$BASIC_AUTH_HELPERS"; then
1794
for helper in $BASIC_AUTH_HELPERS; do
1795
if test -d $srcdir/helpers/basic_auth/$helper; then
1802
AC_MSG_ERROR(Basic auth helper $helper does not exist)
1805
AC_MSG_NOTICE([Basic auth helpers built: $BASIC_AUTH_HELPERS])
1807
AC_SUBST(BASIC_AUTH_HELPERS)
1809
dnl Select ntlm auth helpers to build
1810
if test -n "$AUTH_MODULE_ntlm"; then
1811
NTLM_AUTH_HELPERS="all"
1813
AC_ARG_ENABLE(ntlm-auth-helpers,
1814
AS_HELP_STRING([--enable-ntlm-auth-helpers="list of helpers"],[This option selects which proxy_auth ntlm helpers
1815
to build and install as part of the normal build
1816
process. For a list of available helpers see
1817
the helpers/ntlm_auth directory.]),
1818
[ case "$enableval" in
1820
NTLM_AUTH_HELPERS="all"
1823
NTLM_AUTH_HELPERS=""
1826
NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1830
if test "$NTLM_AUTH_HELPERS" = "all" ; then
1831
NTLM_AUTH_HELPERS=""
1832
for dir in $srcdir/helpers/ntlm_auth/*; do
1833
helper="`basename $dir`"
1834
if test -f $dir/config.test && sh $dir/config.test "$@"; then
1835
NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
1839
if test -n "$NTLM_AUTH_HELPERS"; then
1840
for helper in $NTLM_AUTH_HELPERS; do
1841
if test -d $srcdir/helpers/ntlm_auth/$helper; then
1844
AC_MSG_ERROR(NTLM Auth helper $helper does not exist)
1847
AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS])
1849
AC_SUBST(NTLM_AUTH_HELPERS)
1851
dnl Select negotiate auth helpers to build
1852
if test -n "$AUTH_MODULE_negotiate"; then
1853
NEGOTIATE_AUTH_HELPERS="all"
1855
AC_ARG_ENABLE(negotiate-auth-helpers,
1856
AS_HELP_STRING([--enable-negotiate-auth-helpers="list of helpers"],[This option selects which proxy_auth negotiate helpers
1857
to build and install as part of the normal build
1858
process. For a list of available helpers see
1859
the helpers/negotiate_auth directory.]),
1860
[ case "$enableval" in
1862
NEGOTIATE_AUTH_HELPERS="all"
1865
NEGOTIATE_AUTH_HELPERS=""
1868
NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1872
if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
1873
NEGOTIATE_AUTH_HELPERS=""
1874
for dir in $srcdir/helpers/negotiate_auth/*; do
1875
helper="`basename $dir`"
1876
if test -f $dir/config.test && sh $dir/config.test "$@"; then
1877
NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
1881
if test -n "$NEGOTIATE_AUTH_HELPERS"; then
1882
for helper in $NEGOTIATE_AUTH_HELPERS; do
1883
if test -d $srcdir/helpers/negotiate_auth/$helper; then
1886
AC_MSG_ERROR(Negotiate Auth helper $helper does not exist)
1889
AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS])
1891
AC_SUBST(NEGOTIATE_AUTH_HELPERS)
1892
AC_CONFIG_SUBDIRS(helpers/negotiate_auth/squid_kerb_auth)
1894
dnl Select digest auth scheme helpers to build
1895
if test -n "$AUTH_MODULE_digest"; then
1896
DIGEST_AUTH_HELPERS=all
1898
AC_ARG_ENABLE(digest-auth-helpers,
1899
AS_HELP_STRING([--enable-digest-auth-helpers="list of helpers"],[This option selects which digest scheme authentication
1900
helpers to build and install as part of the normal build
1901
process. For a list of available helpers see the
1902
helpers/digest_auth directory.]),
1903
[ case "$enableval" in
1905
DIGEST_AUTH_HELPERS="all"
1908
DIGEST_AUTH_HELPERS=""
1911
DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1915
if test "$DIGEST_AUTH_HELPERS" = "all" ; then
1916
DIGEST_AUTH_HELPERS=""
1917
for dir in $srcdir/helpers/digest_auth/*; do
1918
helper="`basename $dir`"
1919
if test -f $dir/config.test && sh $dir/config.test "$@"; then
1920
DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
1924
if test -n "$DIGEST_AUTH_HELPERS"; then
1925
for helper in $DIGEST_AUTH_HELPERS; do
1926
if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1929
AC_MSG_ERROR(digest auth helper $helper does not exist)
1932
AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
1934
AC_SUBST(DIGEST_AUTH_HELPERS)
1936
dnl Enable "NTLM fail open"
1937
AC_ARG_ENABLE(ntlm-fail-open,
1938
AS_HELP_STRING([--enable-ntlm-fail-open],[Enable NTLM fail open, where a helper that fails one of the
1939
Authentication steps can allow squid to still authenticate
1941
[ if test "$enableval" = "yes" ; then
1942
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.])
1946
dnl Select external_acl helpers to build
1947
EXTERNAL_ACL_HELPERS=all
1948
AC_ARG_ENABLE(external-acl-helpers,
1949
AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"],[This option selects which external_acl helpers to
1950
build and install as part of the normal build
1951
process. For a list of available helpers see the
1952
helpers/external_acl directory.]),
1953
[ case "$enableval" in
1955
EXTERNAL_ACL_HELPERS=all
1958
EXTERNAL_ACL_HELPERS=""
1961
EXTERNAL_ACL_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
1965
if test "$EXTERNAL_ACL_HELPERS" = "all" ; then
1966
EXTERNAL_ACL_HELPERS=""
1967
for dir in $srcdir/helpers/external_acl/*; do
1968
helper="`basename $dir`"
1969
if test -f $dir/config.test && sh $dir/config.test "$@"; then
1970
EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper"
1974
if test -n "$EXTERNAL_ACL_HELPERS"; then
1975
for helper in $EXTERNAL_ACL_HELPERS; do
1976
if test -f $srcdir/helpers/external_acl/$helper/Makefile.in; then
1979
AC_MSG_ERROR(external acl helper $helper does not exist)
1982
AC_MSG_NOTICE([External acl helpers built: $EXTERNAL_ACL_HELPERS])
1984
AC_SUBST(EXTERNAL_ACL_HELPERS)
1986
AC_ARG_WITH(valgrind-debug,
1987
AS_HELP_STRING([--with-valgrind-debug],[Include debug instrumentation for use with valgrind]),
1996
CPPFLAGS="$CPPFLAGS -I${enableval}/include"
2000
if test $valgrind; then
2001
AC_CHECK_HEADERS(valgrind/memcheck.h,
2002
[ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
2003
AC_MSG_NOTICE([Valgrind debug support enabled]) ],
2004
[ AC_MSG_ERROR([Valgrind header not found. Valgrind support cannot be built.]) ]
2009
dnl Disable "memPools" code
2010
#AC_ARG_ENABLE(chunkedmempools,
2011
# AS_HELP_STRING([--enable-chunkedmempools],
2012
# [Enable experimental chunked memPools. Note that this option
2013
# simply sets the default behaviour. Specific classes can override this
2014
# at runtime, and only lib/MemPool.c needs to be altered
2015
# to change the squid-wide default for all classes.]), [
2016
# if test "x$enableval" = "xyes" ; then
2017
# AC_DEFINE(USE_CHUNKEDMEMPOOLS, 1, [Define to Enable chunked Memory Pools support (experimental)])
2019
# AC_MSG_NOTICE([chunked memPools disabled])
2020
# AC_DEFINE(USE_CHUNKEDMEMPOOLS, 0, [Define to Enable chunked Memory Pools support (experimental)])
2023
#[ AC_MSG_NOTICE([chunked memPools disabled])
2024
AC_DEFINE(USE_CHUNKEDMEMPOOLS, 0, [Define to Enable chunked Memory Pools support (experimental)])
2027
dnl Enable WIN32 Service compile mode
2028
AC_ARG_ENABLE(win32-service,
2029
AS_HELP_STRING([--enable-win32-service],[Compile Squid as a WIN32 Service.
2030
Works only on MS-Windows platforms (NT and up).]),
2031
[ if test "$enableval" = "yes" ; then
2032
AC_MSG_NOTICE([Enabling WIN32 run service mode])
2033
AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])
2038
dnl Check for Cyrus SASL
2039
if test "$require_sasl" = "yes"; then
2040
AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
2041
if test "$ac_cv_header_sasl_sasl_h" = "yes"; then
2042
AC_MSG_NOTICE([using SASL2])
2045
if test "$ac_cv_header_sasl_h" = "yes"; then
2046
AC_MSG_NOTICE([using SASL])
2049
AC_MSG_ERROR(Neither SASL nor SASL2 found)
2055
dnl Disable "unlinkd" code
2056
AC_ARG_ENABLE(unlinkd,
2057
AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]),
2058
[ if test "$enableval" = "no" ; then
2064
# Here we should probably use some magic depending on the selected
2068
if test "$use_unlinkd" = "yes"; then
2069
AC_MSG_NOTICE([unlinkd enabled])
2070
AC_DEFINE(USE_UNLINKD,1,[Define this if unlinkd is required (strongly recommended for ufs storage type)])
2071
AM_CONDITIONAL(ENABLE_UNLINKD, true)
2073
AC_MSG_NOTICE([unlinkd disabled])
2074
AM_CONDITIONAL(ENABLE_UNLINKD, false)
2077
dnl Enable backtraces on fatal errors
2078
AC_ARG_ENABLE(stacktraces,
2079
AS_HELP_STRING([--enable-stacktraces],[Enable automatic call backtrace on fatal errors]),
2080
[ if test "$enableval" = "yes" ; then
2081
AC_MSG_NOTICE([Enabling automatic stack backtraces on fatal errors])
2082
AC_DEFINE(PRINT_STACK_TRACE, 1,[Print stacktraces on fatal errors])
2086
AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
2087
dnl Enable USE_XPROF_STATS
2088
AC_ARG_ENABLE(cpu-profiling,
2089
AS_HELP_STRING([--enable-cpu-profiling],[Enable instrumentation to try and understand how CPU power
2090
is spent by squid, by enabling specific probes in selected
2091
functions. New probes can only be added by modifying the source code.
2092
It is meant to help developers in optimizing performance
2093
of Squid internal functions.
2094
If you are not developer you shouldn't enable this,
2095
as it slows squid down somewhat. See lib/Profiler.c for more details.]),
2096
[ if test "$enableval" = "yes" ; then
2097
AC_MSG_NOTICE([Enabling cpu-profiling])
2098
AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
2099
AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
2103
dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
2104
AC_ARG_ENABLE(x-accelerator-vary,
2105
AS_HELP_STRING([--enable-x-accelerator-vary],[Enable support for the X-Accelerator-Vary
2106
HTTP header. Can be used to indicate
2107
variance within an accelerator setup.
2108
Typically used together with other code
2109
that adds custom HTTP headers to the requests.]),
2110
[ if test "$enableval" = "yes" ; then
2111
AC_MSG_NOTICE([Enabling support for X-Accelerator-Vary])
2112
AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
2116
AC_ARG_ENABLE(zph-qos,
2117
AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]),
2118
[ if test "$enableval" = "yes" ; then
2119
AC_MSG_NOTICE([ZPH QOS enabled])
2120
AC_DEFINE(USE_ZPH_QOS,1,
2121
[ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
2122
When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
2126
dnl --with-maxfd present for compatibility with Squid-2.
2127
dnl undocumented in ./configure --help to encourage using the Squid-3 directive.
2132
squid_filedescriptors_num=$withval
2135
AC_MSG_ERROR(--with-maxfd expects a numeric argument)
2139
AC_ARG_WITH(filedescriptors,
2140
AS_HELP_STRING([--with-filedescriptors=NUMBER],[Force squid to support NUMBER filedescriptors]),
2144
squid_filedescriptors_num=$withval
2147
AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
2152
AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
2153
if $CPPUNITCONFIG --help >/dev/null; then
2154
AC_MSG_NOTICE([using system installed cppunit])
2155
SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
2157
SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
2159
AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
2161
SQUID_CPPUNIT_LIBS=''
2162
SQUID_CPPUNIT_INC=''
2165
AC_ARG_WITH(cppunit-basedir,
2166
AS_HELP_STRING([--with-cppunit-basedir=PATH],[Path where the cppunit headers are libraries are found
2167
for unit testing.]),
2168
[ if test -f $withval/include/cppunit/TestCase.h; then
2169
AC_MSG_NOTICE([Using cppunit includes from $withval])
2170
SQUID_CPPUNIT_INC="-I${withval}/include"
2172
AC_MSG_ERROR(Cannot find cppunit at $withval)
2174
if test -f $withval/lib/libcppunit.la; then
2175
AC_MSG_NOTICE([Using cppunit lib from $withval])
2176
SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
2177
SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
2179
AC_MSG_ERROR(Cannot find cppunit at $withval)
2182
AC_SUBST(SQUID_CPPUNIT_LIBS)
2183
AC_SUBST(SQUID_CPPUNIT_LA)
2184
AC_SUBST(SQUID_CPPUNIT_INC)
2186
# Force some compilers to use ANSI features
2190
if test "$ac_cv_prog_CC" = "cc" ; then
2191
AC_MSG_NOTICE([adding '-std1' to cc args for $host])
2197
if test "$ac_cv_prog_CC" = "cc" ; then
2198
AC_MSG_NOTICE([adding '-Ae' to cc args for $host])
2205
dnl Check for programs
2209
AC_PATH_PROG(SH, sh, /bin/sh)
2210
AC_PATH_PROG(FALSE, false, /usr/bin/false)
2211
AC_PATH_PROG(TRUE, true, /usr/bin/true)
2212
AC_PATH_PROG(MV, mv, $FALSE)
2213
AC_PATH_PROG(MKDIR, mkdir, $FALSE)
2214
AC_PATH_PROG(LN, ln, cp)
2215
AC_PATH_PROG(CHMOD, chmod, $FALSE)
2217
AC_PATH_PROG(RM, rm, $FALSE)
2218
dnl Libtool 2.2.6 requires: rm -f
2221
dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
2224
AC_PATH_PROG(PERL, perl, none)
2225
if test "$ac_cv_path_PERL" = "none"; then
2226
AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ])
2231
AC_MSG_NOTICE([Disabling 'ranlib' for HP-UX...])
2237
AC_PATH_PROG(AR, ar, $FALSE)
2246
dnl Check for headers
2278
linux/posix_types.h \
2280
machine/byte_swap.h \
2287
netinet/in_systm.h \
2288
netinet/ip_fil_compat.h \
2302
security/pam_appl.h \
2349
linux/netfilter_ipv4.h \
2350
linux/netfilter_ipv4/ip_tproxy.h \
2352
SQUID_DEFAULT_INCLUDES
2356
/* Netfilter ip(6)tables v1.4.0 has broken headers */
2357
#if HAVE_NETINET_IN_H
2358
#include <netinet/in.h>
2362
dnl *BSD dont include the depenencies for all their net/ and netinet/ files
2363
dnl We must include a few basic type headers for them to work.
2371
netinet/ip_compat.h\
2372
netinet/ip_fil_compat.h\
2382
SQUID_BSDNET_INCLUDES)
2388
AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2391
#include <sys/time.h>
2398
AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[
2399
#if HAVE_SYS_TYPES_H
2400
#include <sys/types.h>
2406
AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[
2407
#if HAVE_SYS_TYPES_H
2408
#include <sys/types.h>
2414
dnl Override rusage() detect on MinGW because is emulated in source code
2417
AC_DEFINE(HAVE_STRUCT_RUSAGE)
2418
ac_cv_func_getrusage='yes'
2419
AC_MSG_NOTICE([Using own rusage on Windows.])
2422
AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
2424
#include <sys/time.h>
2426
#if HAVE_SYS_RESOURCE_H
2427
#include <sys/resource.h>
2432
AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
2433
#if HAVE_SYS_TYPES_H
2434
#include <sys/types.h>
2436
#include <netinet/in.h>
2437
#include <netinet/in_systm.h>
2438
#include <netinet/ip.h>
2439
#if defined (__linux__) || defined (__CYGWIN__)
2448
dnl Check for typedefs
2449
AC_CHECK_SIZEOF(void *)
2451
dnl 8 bit integers - int8_t
2452
dnl if this is defined we trust it to be 8 bits
2453
AC_CHECK_TYPE(int8_t,[
2454
AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2455
AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers])
2456
],,SQUID_DEFAULT_INCLUDES)
2459
AC_CHECK_TYPE(char,[
2460
AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2461
AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers])
2462
],,SQUID_DEFAULT_INCLUDES)
2464
dnl unsigned 8 bit ints - u_int8_t
2465
dnl if this is defined we trust it to be 8 bits
2466
AC_CHECK_TYPE(u_int8_t,[
2467
AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2468
AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
2469
],,SQUID_DEFAULT_INCLUDES)
2472
dnl if this is defined we trust it to be 8 bits
2473
AC_CHECK_TYPE(uint8_t,[
2474
AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2475
AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
2476
],,SQUID_DEFAULT_INCLUDES)
2478
dnl 16 bit integers - int16_t
2479
dnl if this is defined we trust it to be 16 bits
2480
AC_CHECK_TYPE(int16_t,[
2481
AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2482
AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers])
2483
],,SQUID_DEFAULT_INCLUDES)
2486
AC_CHECK_TYPE(short,[
2487
AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2488
AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers])
2489
],,SQUID_DEFAULT_INCLUDES)
2493
AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2494
AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
2495
],,SQUID_DEFAULT_INCLUDES)
2497
dnl unsigned 16 bit ints - u_int16_t
2498
dnl if this is defined we trust it to be 16 bits
2499
AC_CHECK_TYPE(u_int16_t,[
2500
AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2501
AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
2502
],,SQUID_DEFAULT_INCLUDES)
2505
dnl if this is defined we trust it to be 16 bits
2506
AC_CHECK_TYPE(uint16_t,[
2507
AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2508
AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
2509
],,SQUID_DEFAULT_INCLUDES)
2511
dnl 32 bit signed int - int32_t
2512
dnl if this is defined we trust it to be 32 bits
2513
AC_CHECK_TYPE(int32_t,[
2514
AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2515
AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers])
2516
],,SQUID_DEFAULT_INCLUDES)
2519
AC_CHECK_TYPE(long,[
2520
AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2521
AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
2522
],,SQUID_DEFAULT_INCLUDES)
2524
dnl 32 bit unsigned int - u_int32_t
2525
dnl if this is defined we trust it to be 32 bits
2526
AC_CHECK_TYPE(u_int32_t,[
2527
AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2528
AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
2529
],,SQUID_DEFAULT_INCLUDES)
2532
dnl if this is defined we trust it to be 32 bits
2533
AC_CHECK_TYPE(uint32_t,[
2534
AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2535
AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
2536
],,SQUID_DEFAULT_INCLUDES)
2538
dnl 64 bit signed - int64_t
2539
dnl if this is defind we trust it to be 64 bits
2540
AC_CHECK_TYPE(int64_t,[
2541
AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2542
AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers])
2543
],,SQUID_DEFAULT_INCLUDES)
2546
dnl if this is defind we trust it to be 64 bits
2547
AC_CHECK_TYPE(__int64,[
2548
AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2549
AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers])
2550
],,SQUID_DEFAULT_INCLUDES)
2553
AC_CHECK_TYPE(long long,[
2554
AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2555
AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers])
2556
],,SQUID_DEFAULT_INCLUDES)
2558
dnl 64 bit unsigned - u_int64_t
2559
dnl if this is defind we trust it to be 64 bits
2560
AC_CHECK_TYPE(u_int64_t,[
2561
AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2562
AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
2563
],,SQUID_DEFAULT_INCLUDES)
2566
dnl if this is defind we trust it to be 64 bits
2567
AC_CHECK_TYPE(uint64_t,[
2568
AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2569
AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers])
2570
],,SQUID_DEFAULT_INCLUDES)
2571
#need the define for overflow checks
2572
AC_CHECK_SIZEOF(off_t)
2574
dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
2575
dnl that is incompatible with the updated Solaris header files.
2576
dnl For this reason, we must check if pad128_t and upad128_t are defined.
2577
AC_CHECK_TYPE(pad128_t,
2578
AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]),
2579
,SQUID_DEFAULT_INCLUDES)
2581
AC_CHECK_TYPE(upad128_t,
2582
AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]),
2583
,SQUID_DEFAULT_INCLUDES)
2585
AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2586
AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2587
AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2588
AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2589
AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
2590
AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES)
2591
AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2592
AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
2594
dnl On AIX uchar is pre-defined by the headers
2595
AC_CHECK_TYPE(uchar,[AC_DEFINE([HAVE_UCHAR],[1],[uchar is defined in system headers])],,SQUID_DEFAULT_INCLUDES)
2597
dnl Check for special functions
2600
AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
2601
#include <sys/types.h>
2602
#include <sys/socket.h>
2608
dnl Check for libcap header (assume its not broken unless
2610
AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],[disable usage of Linux capabilities library to control privileges]),
2611
[ if test "x$withval" = "xyes" ; then
2612
AC_MSG_RESULT(libcap forced enabled)
2615
AC_MSG_RESULT(libcap forced disabled)
2619
if test "x$use_libcap" != "xno"; then
2620
# cap_clear_flag is the most recent libcap function we require
2621
AC_CHECK_LIB(cap, cap_clear_flag)
2622
if test "x$ac_cv_lib_cap_cap_clear_flag" = xyes; then
2625
if test "x$use_libcap" = "xyes"; then
2626
AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
2632
if test "x$use_libcap" = "xyes"; then
2633
AC_DEFINE(USE_LIBCAP, 1, [use libcap to set capabilities required for TPROXY])
2634
dnl Check for libcap headader breakage.
2635
AC_CHECK_HEADERS(sys/capability.h)
2636
AC_CACHE_CHECK([for operational libcap2 headers], squid_cv_sys_capability_works,
2637
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2640
#include <sys/capability.h>
2644
]])],[squid_cv_sys_capability_works=yes],[squid_cv_sys_capability_works=no])
2646
if test x$squid_cv_sys_capability_works != xyes; then
2647
AC_DEFINE([LIBCAP_BROKEN],1,[if libcap2 headers are broken and clashing with glibc])
2652
AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2653
#include <sys/ipc.h>
2654
#include <sys/msg.h>])
2656
dnl Check for needed libraries
2657
AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
2658
AC_SEARCH_LIBS([res_init],[resolv])
2659
AC_SEARCH_LIBS([bind],[socket])
2660
AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
2661
AC_SEARCH_LIBS([strlcpy], [bsd])
2662
AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
2663
dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2666
AC_MSG_CHECKING(for winsock)
2668
for curlib in ws2_32 wsock32; do
2669
LIBS="$LIBS -l$curlib"
2670
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>]], [[
2672
select(0,NULL,NULL,NULL,NULL);
2674
gethostname(NULL,0);
2675
]])],[have_winsock=yes],[have_winsock=no])
2677
if test $have_winsock = yes; then
2678
ac_cv_func_select='yes'
2679
if test $curlib = ws2_32; then
2680
have_winsock=winsock2
2686
AC_MSG_RESULT($have_winsock)
2687
if test $have_winsock = winsock2; then
2688
AC_CHECK_HEADERS(winsock2.h)
2690
AC_CHECK_HEADERS(winsock.h)
2695
dnl Ripped from the Samba sources
2696
AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2697
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2698
#include <sys/types.h>
2701
#include <sys/socket.h>
2702
#include <sys/un.h>]], [[
2703
struct sockaddr_un sunaddr;
2704
sunaddr.sun_family = AF_UNIX;
2705
]])],[squid_cv_unixsocket=yes],[squid_cv_unixsocket=no])])
2706
if test x"$squid_cv_unixsocket" = x"yes"; then
2707
AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper])
2711
AC_CHECK_LIB(gnumalloc, main)
2712
if test "$ac_cv_lib_gnumalloc_main" = "yes"; then
2713
AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc])
2714
ac_cv_func_mallinfo=no
2715
ac_cv_func_mallocblksize=no
2716
ac_cv_func_mallopt=no
2720
AC_MSG_NOTICE([skipping libmalloc check for $host])
2723
AC_MSG_NOTICE([skipping libmalloc check for $host])
2727
AC_CHECK_LIB(malloc, main)
2732
AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2735
AC_MSG_NOTICE([Use MSVCRT for math functions.])
2738
dnl rint() and log() are only used in old C code for now.
2740
AC_SEARCH_LIBS([rint],[m])
2741
AC_SEARCH_LIBS([log],[m])
2746
dnl Enable IPv6 support
2747
AC_MSG_CHECKING([whether to enable IPv6])
2750
AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support. The default is to probe system capabilities on startup.]),
2751
[ case $enableval in
2759
AC_MSG_RESULT($use_ipng)
2761
if test "$use_ipng" != "no"; then
2762
AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
2764
AC_DEFINE(USE_IPV6,0,[Enable support for IPv6 ])
2767
dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2768
AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2769
ac_cv_have_sin6_len_in_struct_sai, [
2770
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2771
#include <sys/types.h>
2772
#include <sys/socket.h>
2773
#include <netinet/in.h>
2774
]], [[ 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"
2777
if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2778
AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2780
AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2783
dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2784
AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2785
ac_cv_have_ss_len_in_struct_ss, [
2786
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2787
#include <sys/types.h>
2788
#include <sys/socket.h>
2789
#include <netinet/in.h>
2790
]], [[ 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"
2793
if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2794
AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2796
AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2799
dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2800
AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2801
ac_cv_have_sin_len_in_struct_sai, [
2802
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2803
#include <sys/types.h>
2804
#include <sys/socket.h>
2805
#include <netinet/in.h>
2806
]], [[ 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"
2809
if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
2810
AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2812
AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2815
dnl Check for libcrypt
2816
dnl Some of our helpers use crypt(3) which may be in libc, or in
2817
dnl libcrypt (eg FreeBSD)
2818
AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2819
dnl Solaris10 provides MD5 natively through libmd5
2820
AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
2823
dnl Check for libdl, used by auth_modules/PAM
2824
if test "$with_dl" = "yes"; then
2825
AC_CHECK_LIB(dl, dlopen)
2828
dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
2829
dnl Robert Side <rside@aiinc.bc.ca>
2830
dnl Mon, 18 Jan 1999 17:48:00 GMT
2833
AC_CHECK_LIB(intl, strftime)
2837
dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
2838
dnl only with Windows LDAP libraries using -lwldap32
2841
LIB_LDAP="-lwldap32"
2846
dnl LDAP helpers need to know if -llber is needed or not
2847
AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
2854
dnl this is not fully functional if db.h is for a differend db version
2857
dnl check that dbopen is actually defined in the header
2858
dnl FIXME: in case of failure undef db-related includes etc.
2859
AC_CHECK_DECL(dbopen,,,[
2860
#if HAVE_SYS_TYPES_H
2861
#include <sys/types.h>
2873
AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
2874
SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
2875
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2876
#if HAVE_SYS_TYPES_H
2877
#include <sys/types.h>
2886
#endif]], [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],[ac_cv_dbopen_libdb="yes"],[ac_cv_dbopen_libdb="no"])
2889
if test $ac_cv_dbopen_libdb = yes; then
2894
dnl System-specific library modifications
2898
if test "$GCC" = "yes"; then
2899
AC_MSG_NOTICE([Removing -O for gcc on $host])
2900
CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2904
AC_MSG_NOTICE([Removing -lsocket for IRIX...])
2905
LIBS=`echo $LIBS | sed -e s/-lsocket//`
2906
AC_MSG_NOTICE([Removing -lnsl for IRIX...])
2907
LIBS=`echo $LIBS | sed -e s/-lnsl//`
2908
ac_cv_lib_nsl_main=no
2909
AC_MSG_NOTICE([Removing -lbsd for IRIX...])
2910
LIBS=`echo $LIBS | sed -e s/-lbsd//`
2912
dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher)
2913
dnl Date: Thu, 17 Oct 1996 04:09:30 +0200
2914
dnl Please change your configure script. AIX doesn't need -lbsd.
2916
AC_MSG_NOTICE([Removing -lbsd for AIX...])
2917
LIBS=`echo $LIBS | sed -e s/-lbsd//`
2918
AC_MSG_CHECKING(for aix xlc c++ comments support)
2920
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[//c++ cmt]])],[AIX_CPPCMT_SUPPORT=yes],[AIX_CPPCMT_SUPPORT=no])
2921
AC_MSG_RESULT($AIX_CPPCMT_SUPPORT)
2922
if test -n `echo $CC | grep cc` 2>/dev/null && \
2923
test -n `cc -qversion 2>/dev/null | grep "IBM XL C/C++ for AIX"` 2>/dev/null;then
2924
if test "$AIX_CPPCMT_SUPPORT"="no";then
2925
SQUID_CFLAGS="-qcpluscmt $SQUID_CFLAGS"
2931
SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_"
2932
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_"
2933
AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument])
2935
[*-*-solaris2.[0-4]])
2936
AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2938
[*-sony-newsos[56]*])
2939
AC_DEFINE(GETTIMEOFDAY_NO_TZP,1)
2943
# Remove optimization for GCC 2.95.[123]
2944
# gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL
2945
if test "$GCC" = "yes"; then
2946
GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'`
2949
AC_MSG_NOTICE([Removing -O for gcc on $host with GCC $GCCVER])
2950
CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
2955
# Recommended by Balint Nagy Endre <bne@CareNet.hu>
2958
if test `uname -v` = "2.03"; then
2959
AC_MSG_NOTICE([disabling mallinfo for $host])
2960
ac_cv_func_mallinfo=no
2965
dnl This has to be before AC_CHECK_FUNCS
2966
# Disable poll() on certain platforms. Override by setting ac_cv_func_poll
2967
# when running configure.
2968
if test -z "$ac_cv_func_poll"; then
2971
# John Kay (jkay@nlanr.net) 19970818
2972
AC_MSG_NOTICE([disabling poll for $host...])
2973
ac_cv_func_poll='no'
2977
AC_MSG_NOTICE([disabling poll for $host...])
2978
ac_cv_func_poll='no'
2981
# Henrik Nordstrom (hno@squid-cache.org) 19980817
2982
# poll is problematic on Linux. We disable it
2983
# by default until Linux gets it right.
2984
rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'`
2985
if test $rev -lt 002002; then
2986
AC_MSG_NOTICE([disabling poll for $host < 2.2...])
2987
ac_cv_func_poll='no'
2990
[powerpc-ibm-aix4.1.*])
2991
# Mike Laster (mlaster@metavillage.com) 19981021
2992
AC_MSG_NOTICE([disabling poll for $host...])
2993
ac_cv_func_poll='no'
2996
# Robert Side <rside@aiinc.bc.ca>
2997
# Mon, 18 Jan 1999 17:48:00 GMT
2998
AC_MSG_NOTICE([disabling poll for $host...])
2999
ac_cv_func_poll='no'
3004
dnl Override statfs() detect on MinGW becasue is emulated in source code
3007
ac_cv_func_statfs='yes'
3011
dnl Check for library functions
3013
backtrace_symbols_fd \
3043
pthread_attr_setschedparam \
3044
pthread_attr_setscope \
3045
pthread_setschedparam \
3073
dnl ... and some we provide local replacements for
3087
# check for crypt, may require -lcrypt
3089
LIBS="$LIBS $CRYPTLIB"
3090
AC_CHECK_FUNCS(crypt)
3093
dnl Magic which checks whether we are forcing a type of comm loop we
3094
dnl are actually going to (ab)use
3096
dnl Actually do the define magic now
3097
dnl mostly ripped from squid-commloops, thanks to adrian and benno
3099
if test -n "$SELECT_TYPE"; then
3100
: # Already decided above. Nothing to do here
3101
elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then
3103
elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then
3104
SELECT_TYPE="kqueue"
3105
elif test "x$enable_devpoll" != "xno" && test "x$ac_cv_devpoll_works" = "xyes"; then
3106
SELECT_TYPE="devpoll"
3107
elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then
3109
elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then
3112
SELECT_TYPE="select_win32"
3115
SELECT_TYPE="select"
3119
AC_MSG_WARN([Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!])
3120
AC_MSG_WARN([I'll try select and hope for the best.])
3121
SELECT_TYPE="select"
3122
AC_DEFINE(USE_SELECT,1)
3125
AC_MSG_NOTICE([Using ${SELECT_TYPE} for the IO loop.])
3127
AM_CONDITIONAL([USE_POLL], [test $SELECT_TYPE = poll])
3128
AM_CONDITIONAL([USE_EPOLL], [test $SELECT_TYPE = epoll])
3129
AM_CONDITIONAL([USE_SELECT], [test $SELECT_TYPE = select])
3130
AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple])
3131
AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32])
3132
AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue])
3133
AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll])
3135
case $SELECT_TYPE in
3137
AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
3140
AC_DEFINE(USE_DEVPOLL,1,[Use /dev/poll for the IO loop])
3143
AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
3146
AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
3149
AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop])
3152
AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
3158
dnl Yay! Another Linux brokenness. Its not good enough
3159
dnl to know that setresuid() exists, because RedHat 5.0 declares
3160
dnl setresuid() but doesn't implement it.
3162
AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
3163
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3165
int main(int argc, char **argv) {
3166
if(setresuid(-1,-1,-1)) {
3167
perror("setresuid:");
3172
]])],[ac_cv_func_setresuid="yes"],[ac_cv_func_setresuid="no"],[:])
3174
if test "$ac_cv_func_setresuid" = "yes" ; then
3175
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.])
3178
dnl Yay! This one is a MacOSX brokenness. Its not good enough
3179
dnl to know that strnstr() exists, because MacOSX 10.4 have a bad
3180
dnl copy that crashes with a buffer over-run!
3182
AC_CACHE_CHECK(if strnstr is well implemented, ac_cv_func_strnstr,
3183
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3187
// we expect this to succeed, or crash on over-run.
3188
// if it passes otherwise we may need a better check.
3189
int main(int argc, char **argv)
3192
char *str = malloc(size);
3193
memset(str, 'x', size);
3194
strnstr(str, "fubar", size);
3197
]])],[ac_cv_func_strnstr="yes"],[ac_cv_func_strnstr="no"],[:])
3199
if test "$ac_cv_func_strnstr" = "yes" ; then
3200
AC_DEFINE(HAVE_STRNSTR,1,[Yay! We have a working strnstr!])
3202
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.])
3206
dnl Test for va_copy
3208
AC_CACHE_CHECK(if va_copy is implemented, ac_cv_func_va_copy,
3209
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3212
int f (int i, ...) {
3213
va_list args1, args2;
3214
va_start (args1, i);
3215
va_copy (args2, args1);
3216
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3218
va_end (args1); va_end (args2);
3221
int main(int argc, char **argv) { return f (0, 42); }
3222
]])],[ac_cv_func_va_copy="yes"],[ac_cv_func_va_copy="no"],[:])
3224
if test "$ac_cv_func_va_copy" = "yes" ; then
3225
AC_DEFINE(HAVE_VA_COPY, 1, [If your system have va_copy])
3229
dnl Some systems support __va_copy
3231
AC_CACHE_CHECK(if __va_copy is implemented, ac_cv_func___va_copy,
3232
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3235
int f (int i, ...) {
3236
va_list args1, args2;
3237
va_start (args1, i);
3238
__va_copy (args2, args1);
3239
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3241
va_end (args1); va_end (args2);
3244
int main(int argc, char **argv) { return f (0, 42); }
3245
]])],[ac_cv_func___va_copy="yes"],[ac_cv_func___va_copy="no"],[:])
3247
if test "$ac_cv_func___va_copy" = "yes" ; then
3248
AC_DEFINE(HAVE___VA_COPY, 1, [Some systems have __va_copy instead of va_copy])
3251
dnl IP-Filter support requires ipf header files. These aren't
3252
dnl installed by default, so we need to check for them
3253
if test "$IPF_TRANSPARENT" ; then
3254
AC_MSG_CHECKING(if IP-Filter header files are installed)
3255
# hold on to your hats...
3256
if test "$ac_cv_header_ip_compat_h" = "yes" ||
3257
test "$ac_cv_header_ip_fil_compat_h" = "yes" ||
3258
test "$ac_cv_header_netinet_ip_compat_h" = "yes" ||
3259
test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then
3260
have_ipfilter_compat_header="yes"
3262
if test "x$have_ipfilter_compat_header" = "xyes" &&
3263
test "$ac_cv_header_ip_fil_h" = "yes" &&
3264
test "$ac_cv_header_ip_nat_h" = "yes" ; then
3265
IPF_TRANSPARENT="yes"
3266
AC_DEFINE(IPF_TRANSPARENT, 1)
3267
elif test "$have_ipfilter_compat_header" = "yes" &&
3268
test "$ac_cv_header_netinet_ip_fil_h" = "yes" &&
3269
test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then
3270
IPF_TRANSPARENT="yes"
3271
AC_DEFINE(IPF_TRANSPARENT, 1)
3273
IPF_TRANSPARENT="no"
3274
AC_DEFINE(IPF_TRANSPARENT, 0)
3276
AC_MSG_RESULT($IPF_TRANSPARENT)
3278
if test "$IPF_TRANSPARENT" = "no" ; then
3279
AC_MSG_WARN([Cannot find necessary IP-Filter header files])
3280
AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
3282
elif test "$IPF_TRANSPARENT" = "yes" ; then
3283
dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the
3284
dnl Solaris minor version (8, 9, 10, ...)
3287
solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'`
3288
CFLAGS="-DSOLARIS2=$solrev $CFLAGS"
3289
CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS"
3296
dnl PF support requires a header file.
3297
if test "$PF_TRANSPARENT" ; then
3298
AC_MSG_CHECKING(if PF header file is installed)
3299
# hold on to your hats...
3300
if test "$ac_cv_header_net_pfvar_h" = "yes" || test "$ac_cv_header_net_pf_pfvar_h" = "yes"; then
3301
PF_TRANSPARENT="yes"
3302
AC_DEFINE(PF_TRANSPARENT, 1)
3305
AC_DEFINE(PF_TRANSPARENT, 0)
3307
AC_MSG_RESULT($PF_TRANSPARENT)
3309
if test "$PF_TRANSPARENT" = "no" ; then
3310
AC_MSG_WARN([Cannot find necessary PF header file])
3311
AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled])
3315
dnl Linux-Netfilter support requires Linux 2.4 kernel header files.
3316
dnl Shamelessly copied from above
3317
if test "$LINUX_NETFILTER" ; then
3318
AC_MSG_CHECKING(if Linux (Netfilter) kernel header files are installed)
3319
# hold on to your hats...
3320
if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then
3321
LINUX_NETFILTER="yes"
3322
AC_DEFINE(LINUX_NETFILTER, 1)
3324
LINUX_NETFILTER="no"
3325
AC_DEFINE(LINUX_NETFILTER, 0)
3327
AC_MSG_RESULT($LINUX_NETFILTER)
3329
if test "$LINUX_NETFILTER" = "no" ; then
3330
AC_MSG_WARN([Cannot find necessary Linux kernel (Netfilter) header files])
3331
AC_MSG_WARN([Linux Transparent and Intercepting Proxy support WILL NOT be enabled])
3333
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3336
dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3337
if test "$LINUX_NETFILTER" = "yes" && test "$use_libcap" != "yes" ; then
3338
AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3339
AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3340
AC_MSG_WARN([Reduced support to Interception Proxy])
3342
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3346
dnl Linux Netfilter/TPROXYv2 support requires some specific header files
3347
dnl Shamelessly copied from above
3348
if test "$LINUX_TPROXY2"; then
3349
if test "$use_libcap" = "yes"; then
3350
AC_MSG_CHECKING(if TPROXYv2 header files are installed)
3351
# hold on to your hats...
3352
if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
3354
AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3357
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3359
AC_MSG_RESULT($LINUX_TPROXY2)
3360
if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3361
AC_MSG_WARN([Cannot find TPROXY v2 headers, you need to patch the kernel with ])
3362
AC_MSG_WARN([tproxy package from:])
3363
AC_MSG_WARN([ - lynx http://www.balabit.com/downloads/files/tproxy/])
3364
AC_MSG_WARN([Or select the '--enable-linux-netfilter' option instead for Netfilter support.])
3368
AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY v2])
3369
AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3371
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3376
AC_ARG_ENABLE(gnuregex,
3377
AS_HELP_STRING([--enable-gnuregex],[Compile GNUregex. Unless you have reason to use
3378
this option, you should not enable it.
3379
This library file is usually only required on Windows and
3380
very old Unix boxes which do not have their own regex
3381
library built in.]),
3382
[USE_GNUREGEX=$enableval])
3383
if test -z "$USE_GNUREGEX" ; then
3385
*-sun-solaris2.[[0-4]])
3393
AC_MSG_CHECKING(if GNUregex needs to be compiled)
3394
if test -z "$USE_GNUREGEX"; then
3395
if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
3398
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
3399
#include <regex.h>]], [[regex_t t; regcomp(&t,"",0);]])],[USE_GNUREGEX="no"],[USE_GNUREGEX="yes"])
3402
AC_MSG_RESULT($USE_GNUREGEX)
3403
if test "$USE_GNUREGEX" = "yes"; then
3404
# override system regex with ours. Not good. But what was asked for.
3406
AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex])
3411
dnl Not cached since people are likely to tune this
3412
AC_MSG_CHECKING(Default FD_SETSIZE value)
3413
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3424
#include <sys/time.h>
3426
#if HAVE_SYS_SELECT_H
3427
#include <sys/select.h>
3429
#if HAVE_SYS_TYPES_H
3430
#include <sys/types.h>
3433
#include <winsock.h>
3436
#include <winsock2.h>
3438
int main(int argc, char **argv) {
3439
FILE *fp = fopen("conftestval", "w");
3440
fprintf (fp, "%d\n", FD_SETSIZE);
3443
]])],[DEFAULT_FD_SETSIZE=`cat conftestval`],[DEFAULT_FD_SETSIZE=256],[DEFAULT_FD_SETSIZE=256])
3444
AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
3445
AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value])
3448
dnl Not cached since people are likely to tune this
3449
AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
3450
dnl damn! FreeBSD's pthreads breaks dup2().
3452
if test -n "$squid_filedescriptors_num" ; then
3453
SQUID_MAXFD=$squid_filedescriptors_num
3454
AC_MSG_RESULT($SQUID_MAXFD (user-forced))
3457
i386-unknown-freebsd*)
3458
if echo "$LDFLAGS" | grep -q pthread; then
3459
LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
3462
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3466
#include <sys/time.h> /* needed on FreeBSD */
3467
#include <sys/param.h>
3468
#include <sys/resource.h>
3469
int main(int argc, char **argv) {
3472
#if defined(__CYGWIN32__) || defined (__CYGWIN__)
3473
/* getrlimit and sysconf returns bogous values on cygwin32.
3474
* Number of fds is virtually unlimited in cygwin (sys/param.h)
3475
* __CYGWIN32__ is deprecated.
3481
#if defined(RLIMIT_NOFILE)
3482
if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
3483
perror("getrlimit: RLIMIT_NOFILE");
3485
#if defined(__APPLE__)
3486
/* asking for more than OPEN_MAX fails on Leopard */
3487
rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
3489
rl.rlim_cur = rl.rlim_max; /* set it to the max */
3491
if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
3492
perror("setrlimit: RLIMIT_NOFILE");
3495
#elif defined(RLIMIT_OFILE)
3496
if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
3497
perror("getrlimit: RLIMIT_OFILE");
3499
rl.rlim_cur = rl.rlim_max; /* set it to the max */
3500
if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
3501
perror("setrlimit: RLIMIT_OFILE");
3504
#endif /* RLIMIT_NOFILE */
3505
#endif /* HAVE_SETRLIMIT */
3506
/* by starting at 2^14, we will never get higher
3507
than 2^15 for SQUID_MAXFD */
3511
if (dup2(0, i) < 0) {
3519
#endif /* IF !DEF CYGWIN */
3520
fp = fopen("conftestval", "w");
3521
fprintf (fp, "%d\n", i & ~0x3F);
3524
]])],[SQUID_MAXFD=`cat conftestval`],[SQUID_MAXFD=256],[SQUID_MAXFD=256])
3525
dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs
3531
AC_MSG_RESULT($SQUID_MAXFD)
3533
AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors])
3534
if test "$SQUID_MAXFD" -lt 512 ; then
3535
AC_MSG_WARN([$SQUID_MAXFD may not be enough filedescriptors if your])
3536
AC_MSG_WARN([cache will be very busy. Please see the FAQ page])
3537
AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting])
3538
AC_MSG_WARN([on how to increase your filedescriptor limit])
3543
if test `expr $SQUID_MAXFD % 64` != 0; then
3544
AC_MSG_WARN([$SQUID_MAXFD is not an multiple of 64. This may cause issues on certain platforms.])
3548
dnl Not cached since people are likely to tune this
3549
AC_MSG_CHECKING(Default UDP send buffer size)
3550
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3553
#include <sys/types.h>
3554
#if HAVE_SYS_SOCKET_H
3555
#include <sys/socket.h>
3557
#if HAVE_NETINET_IN_H
3558
#include <netinet/in.h>
3561
#include <winsock.h>
3564
#include <winsock2.h>
3566
int main(int argc, char **argv)
3570
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3571
int len=sizeof(int);
3573
WSAStartup(2, &wsaData);
3575
socklen_t len=sizeof(socklen_t);
3577
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3578
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3579
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3582
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3584
if (val<=0) return 1;
3585
fp = fopen("conftestval", "w");
3586
fprintf (fp, "%d\n", val);
3589
]])],[SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_SNDBUF=16384],[SQUID_DETECT_UDP_SO_SNDBUF=16384])
3590
AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3591
AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3593
dnl Not cached since people are likely to tune this
3594
AC_MSG_CHECKING(Default UDP receive buffer size)
3595
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3598
#include <sys/types.h>
3599
#if HAVE_SYS_SOCKET_H
3600
#include <sys/socket.h>
3602
#if HAVE_NETINET_IN_H
3603
#include <netinet/in.h>
3606
#include <winsock.h>
3609
#include <winsock2.h>
3611
int main(int argc, char **argv)
3615
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3616
int len=sizeof(int);
3618
WSAStartup(2, &wsaData);
3620
socklen_t len=sizeof(socklen_t);
3622
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3623
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3624
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3627
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3629
if (val <= 0) return 1;
3630
fp = fopen("conftestval", "w");
3631
fprintf (fp, "%d\n", val);
3634
]])],[SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_RCVBUF=16384],[SQUID_DETECT_UDP_SO_RCVBUF=16384])
3635
AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3636
AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3638
dnl Not cached since people are likely to tune this
3639
AC_MSG_CHECKING(Default TCP send buffer size)
3640
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3643
#include <sys/types.h>
3644
#if HAVE_SYS_SOCKET_H
3645
#include <sys/socket.h>
3647
#if HAVE_NETINET_IN_H
3648
#include <netinet/in.h>
3651
#include <winsock.h>
3654
#include <winsock2.h>
3656
int main(int argc, char **argv)
3660
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3661
int len=sizeof(int);
3663
WSAStartup(2, &wsaData);
3665
socklen_t len=sizeof(socklen_t);
3667
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3668
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3669
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3672
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3674
if (val <= 0) return 1;
3675
fp = fopen("conftestval", "w");
3676
fprintf (fp, "%d\n", val);
3679
]])],[SQUID_TCP_SO_SNDBUF=`cat conftestval`],[SQUID_TCP_SO_SNDBUF=16384],[SQUID_TCP_SO_SNDBUF=16384])
3680
AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3681
if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3682
AC_MSG_NOTICE([Limiting send buffer size to 32K])
3683
SQUID_TCP_SO_SNDBUF=32768
3685
AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3687
dnl Not cached since people are likely to tune this
3688
AC_MSG_CHECKING(Default TCP receive buffer size)
3689
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3692
#include <sys/types.h>
3693
#if HAVE_SYS_SOCKET_H
3694
#include <sys/socket.h>
3696
#if HAVE_NETINET_IN_H
3697
#include <netinet/in.h>
3700
#include <winsock.h>
3703
#include <winsock2.h>
3705
int main(int argc, char **argv)
3709
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3710
int len=sizeof(int);
3712
WSAStartup(2, &wsaData);
3714
socklen_t len=sizeof(socklen_t);
3716
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3717
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3718
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3721
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3723
if (val <= 0) return 1;
3724
fp = fopen("conftestval", "w");
3725
fprintf (fp, "%d\n", val);
3728
]])],[SQUID_TCP_SO_RCVBUF=`cat conftestval`],[SQUID_TCP_SO_RCVBUF=16384],[SQUID_TCP_SO_RCVBUF=16384])
3729
AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3730
if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3731
AC_MSG_NOTICE([Limiting receive buffer size to 64K])
3732
SQUID_TCP_SO_RCVBUF=65535
3734
AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3735
AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3736
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"])
3738
if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3739
AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3742
dnl Not cached since people are likely to change this
3743
AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3744
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
3745
AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],[AC_MSG_RESULT(no)])
3747
if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3748
AC_MSG_CHECKING(for working statvfs() interface)
3749
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3752
#include <sys/types.h>
3753
#include <sys/statvfs.h>
3756
sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3757
sfs.f_files = sfs.f_ffree = 0;
3758
statvfs("/tmp", &sfs);
3759
]])],[ac_cv_func_statvfs=yes],[ac_cv_func_statvfs=no])
3760
AC_MSG_RESULT($ac_cv_func_statvfs)
3761
if test "$ac_cv_func_statvfs" = "yes" ; then
3762
AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3766
dnl Detect what resolver fields we have available to use...
3767
AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3768
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3769
#if HAVE_SYS_TYPES_H
3770
#include <sys/types.h>
3772
#if HAVE_NETINET_IN_H
3773
#include <netinet/in.h>
3775
#if HAVE_ARPA_INET_H
3776
#include <arpa/inet.h>
3778
#if HAVE_ARPA_NAMESER_H
3779
#include <arpa/nameser.h>
3784
]], [[_res_ext.nsaddr_list[[0]].s_addr;]])],[ac_cv_have_res_ext_nsaddr_list="yes"],[ac_cv_have_res_ext_nsaddr_list="no"]))
3785
if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3786
AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3787
AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3790
if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
3791
AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3792
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3793
#if HAVE_SYS_TYPES_H
3794
#include <sys/types.h>
3796
#if HAVE_NETINET_IN_H
3797
#include <netinet/in.h>
3799
#if HAVE_ARPA_INET_H
3800
#include <arpa/inet.h>
3802
#if HAVE_ARPA_NAMESER_H
3803
#include <arpa/nameser.h>
3808
]], [[_res._u._ext.nsaddrs[[0]]->sin6_addr;]])],[ac_cv_have_res_ext_nsaddrs="yes"],[ac_cv_have_res_ext_nsaddrs="no"]))
3809
if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3810
AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3811
AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3815
AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3816
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3817
#if HAVE_SYS_TYPES_H
3818
#include <sys/types.h>
3820
#if HAVE_NETINET_IN_H
3821
#include <netinet/in.h>
3823
#if HAVE_ARPA_INET_H
3824
#include <arpa/inet.h>
3826
#if HAVE_ARPA_NAMESER_H
3827
#include <arpa/nameser.h>
3832
]], [[_res.nsaddr_list[[0]];]])],[ac_cv_have_res_nsaddr_list="yes"],[ac_cv_have_res_nsaddr_list="no"]))
3833
if test $ac_cv_have_res_nsaddr_list = "yes" ; then
3834
AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member])
3835
AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3838
if test "$_SQUID_RES_NSADDR_LIST" = ""; then
3839
AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list,
3840
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3841
#if HAVE_SYS_TYPES_H
3842
#include <sys/types.h>
3844
#if HAVE_NETINET_IN_H
3845
#include <netinet/in.h>
3847
#if HAVE_ARPA_INET_H
3848
#include <arpa/inet.h>
3850
#if HAVE_ARPA_NAMESER_H
3851
#include <arpa/nameser.h>
3856
]], [[_res.ns_list[[0]].addr;]])],[ac_cv_have_res_ns_list="yes"],[ac_cv_have_res_ns_list="no"]))
3857
if test $ac_cv_have_res_ns_list = "yes" ; then
3858
AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3859
AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3863
dnl Squid will usually attempt to translate when packaging or building from VCS
3864
use_translation="yes"
3865
AC_ARG_ENABLE(translation,
3866
AS_HELP_STRING([--disable-translation],[Prevent Squid generating localized error page templates and manuals.
3867
Which is usually tried, but may not be needed.]),
3868
[ if test "$enableval" = "no" ; then
3872
dnl Squid now has .po translation capability, given the right toolkit
3873
if test "$use_translation" = "yes" ; then
3874
AX_WITH_PROG([PO2HTML],[po2html])
3880
dnl Squid now has limited locale handling ...
3883
AC_ARG_ENABLE(auto-locale,
3884
AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
3885
clients request headers.
3886
When disabled Squid requires explicit language configuration.]),
3887
[ if test "$enableval" = "no" ; then
3891
if test "$use_errlocale" = "yes" ; then
3892
AC_MSG_NOTICE([Enabling Multi-Language Support])
3893
AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
3895
AC_MSG_WARN([Disabling Multi-Language Support])
3896
AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
3899
dnl Need the debugging version of malloc if available
3901
if test "$ac_cv_lib_malloc_main" = "yes" ; then
3902
if test -r /usr/lib/debug/malloc.o ; then
3903
XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o"
3905
if test -r /usr/lib/debug/mallocmap.o ; then
3906
XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
3911
if test -z "$XTRA_LIBS"; then
3914
XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"`
3919
dnl Clean up after OSF/1 core dump bug
3933
src/adaptation/Makefile \
3934
src/adaptation/icap/Makefile \
3935
src/adaptation/ecap/Makefile \
3938
src/ident/Makefile \
3944
test-suite/Makefile \
3947
helpers/basic_auth/Makefile \
3948
helpers/basic_auth/LDAP/Makefile \
3949
helpers/basic_auth/MSNT/Makefile \
3950
helpers/basic_auth/NCSA/Makefile \
3951
helpers/basic_auth/PAM/Makefile \
3952
helpers/basic_auth/SMB/Makefile \
3953
helpers/basic_auth/mswin_sspi/Makefile \
3954
helpers/basic_auth/YP/Makefile \
3955
helpers/basic_auth/getpwnam/Makefile \
3956
helpers/basic_auth/multi-domain-NTLM/Makefile \
3957
helpers/basic_auth/SASL/Makefile \
3958
helpers/basic_auth/POP3/Makefile \
3959
helpers/basic_auth/DB/Makefile \
3960
helpers/basic_auth/squid_radius_auth/Makefile \
3961
helpers/digest_auth/Makefile \
3962
helpers/digest_auth/password/Makefile \
3963
helpers/digest_auth/ldap/Makefile \
3964
helpers/digest_auth/eDirectory/Makefile \
3965
helpers/ntlm_auth/Makefile \
3966
helpers/ntlm_auth/fakeauth/Makefile \
3967
helpers/ntlm_auth/no_check/Makefile \
3968
helpers/ntlm_auth/smb_lm/Makefile \
3969
helpers/ntlm_auth/smb_lm/smbval/Makefile \
3970
helpers/ntlm_auth/mswin_sspi/Makefile \
3971
helpers/negotiate_auth/Makefile \
3972
helpers/negotiate_auth/mswin_sspi/Makefile \
3973
helpers/external_acl/Makefile \
3974
helpers/external_acl/ip_user/Makefile \
3975
helpers/external_acl/ldap_group/Makefile \
3976
helpers/external_acl/session/Makefile \
3977
helpers/external_acl/unix_group/Makefile \
3978
helpers/external_acl/wbinfo_group/Makefile \
3979
helpers/external_acl/mswin_ad_group/Makefile \
3980
helpers/external_acl/mswin_lm_group/Makefile \
3984
AC_CONFIG_SUBDIRS(lib/libTrie)
3986
# must configure libltdl subdir unconditionally for "make distcheck" to work
3987
#AC_CONFIG_SUBDIRS(libltdl)