22
23
dnl Check for GNU cc
30
dnl Make the squid top srcdir available to sub-packages as --with-squid=PATH
31
new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir"
32
ac_configure_args="$new_configure_args"
34
squid_disable_werror="no"
35
AC_ARG_ENABLE(strict-error-checking,
36
AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
37
with all possible static compiler error-checks enbled.
38
This flag disables the behavior]),
40
if test "${enableval}" = "no"
42
squid_disable_werror="yes"
46
use_loadable_modules=1
47
AC_MSG_CHECKING(whether to use loadable modules)
48
AC_ARG_ENABLE(loadable-modules,
49
AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) ,
51
case "${enableval}" in
52
yes) use_loadable_modules=yes ;;
53
no) use_loadable_modules=no ;;
54
*) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;;
56
AC_MSG_RESULT([$use_loadable_modules, explicitly])
59
use_loadable_modules=yes;
60
AC_MSG_RESULT([$use_loadable_modules, implicitly])
64
AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
66
if test $use_loadable_modules = yes;
68
AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
75
if test $use_loadable_modules = yes;
77
dnl Linux LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined
78
dnl But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile
79
top_build_prefix=${ac_top_build_prefix}
80
AC_SUBST(top_build_prefix)
82
AC_LIBLTDL_CONVENIENCE
87
# Do we need these unconditionally for "make distcheck" to work?
91
if test $use_loadable_modules = yes;
93
# Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that?
94
LIBADD_DL=${lt_cv_dlopen_libs}
35
102
REGEXLIB='' # -lregex
36
LIBREGEX='' # libregex.a
103
# LIBREGEX='' # libregex.a
38
105
dnl find out the exe extension for this platform. If it's not empty, use it for CGI's as well.
338
420
AC_ARG_WITH(aufs-threads,
339
[ --with-aufs-threads=N_THREADS
340
Tune the number of worker threads for the aufs object
421
AS_HELP_STRING([--with-aufs-threads=N_THREADS],[Tune the number of worker threads for the aufs object store.]),
342
422
[ case $withval in
344
424
aufs_io_threads=$withval
347
echo "ERROR: Invalid --with-aufs-threads argument"
427
AC_MSG_ERROR(--with-aufs-threads expects a numeric argument)
352
431
if test "$aufs_io_threads"; then
353
echo "With $aufs_io_threads aufs threads"
432
AC_MSG_NOTICE([With $aufs_io_threads aufs threads])
354
433
AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$aufs_io_threads,
355
434
[Defines how many threads aufs uses for I/O])
358
AC_ARG_WITH(pthreads,
359
[ --with-pthreads Use POSIX Threads])
360
if test "$with_pthreads" = "yes"; then
365
[ --with-aio Use POSIX AIO])
366
if test "$with_aio" = "yes"; then
371
[ --with-dl Use dynamic linking])
438
AS_HELP_STRING([--with-dl],[Use dynamic linking]))
372
439
if test "$with_dl" = "yes"; then
440
AC_MSG_NOTICE([With dl])
443
AC_ARG_ENABLE(disk-io,
444
AS_HELP_STRING([--enable-disk-io="list of modules"],[Build support for the list of disk I/O modules.
445
Set without a value or omitted, all available modules will be built.
446
See src/DiskIO for a list of available modules, or
447
Programmers Guide section on DiskIO
448
for details on how to build your custom disk module]),
451
for dir in $srcdir/src/DiskIO/*; do
452
module="`basename $dir`"
453
if test -d "$dir" && test "$module" != CVS; then
454
AC_MSG_NOTICE([Autodetected $module DiskIO module])
455
MAYBE_DISK_MODULES="$MAYBE_DISK_MODULES $module"
458
AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
461
AC_DEFINE(USE_DISKIO,0,[DiskIO modules are expected to be available.])
464
MAYBE_DISK_MODULES=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
465
AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
469
[ if test -z "$MAYBE_DISK_MODULES"; then
470
AC_MSG_NOTICE([Enabling all available DiskIO modules (default)...])
471
for dir in $srcdir/src/DiskIO/*; do
472
module="`basename $dir`"
473
if test -d "$dir" && test "$module" != CVS; then
474
AC_MSG_NOTICE([Autodetected $module DiskIO module])
475
MAYBE_DISK_MODULES="$MAYBE_DISK_MODULES $module"
478
AC_DEFINE(USE_DISKIO,1,[DiskIO modules are expected to be available.])
481
dnl Some autoconf.h defines we might enable later...
487
dnl Setup the module paths etc.
489
FOUND_DISKIO_BLOCKING=
490
FOUND_DISKIO_DISKDAEMON=
491
FOUND_DISKIO_DISKTHREADS=
496
for module in $MAYBE_DISK_MODULES none; do
497
if test "$module" = "none"; then
500
if ! test -d $srcdir/src/DiskIO/$module; then
501
AC_MSG_ERROR(disk-io $module does not exist)
505
if test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
506
AC_MSG_ERROR([DiskIO DiskDaemon module listed twice.])
508
FOUND_DISKIO_DISKDAEMON="yes"
509
AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module])
510
DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
511
DISK_MODULES="$DISK_MODULES DiskDaemon"
512
DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
513
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
516
if test "$FOUND_DISKIO_DISKTHREADS" = "yes" ; then
517
AC_MSG_ERROR([DiskIO DiskThreads module listed twice.])
519
FOUND_DISKIO_DISKTHREADS="yes"
520
use_diskthreads="yes"
522
SAVE_SQUID_CFLAGS="$SQUID_CFLAGS"
523
SAVE_SQUID_CXXFLAGS="$SQUID_CXXFLAGS"
524
AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads]))
525
if test "$with_pthreads" != "no"; then
526
dnl TODO: this needs to be extended to handle more systems and better
527
dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
528
dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
532
AC_MSG_NOTICE([Windows threads support automatically enabled])
534
i386-unknown-freebsd*)
535
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
536
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
537
if test "$GCC" = "yes" ; then
538
if test -z "$PRESET_LDFLAGS"; then
539
LDFLAGS="$LDFLAGS -pthread"
544
if test "$GCC" = "yes" ; then
545
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
546
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads"
547
AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
548
[ AC_MSG_NOTICE(pthread library required but cannot be found.)
552
dnl test for -lpthread first. libc version is a stub apparently on Solaris.
553
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread"
554
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread"
555
AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
556
[ SQUID_CFLAGS="$SAVE_SQUID_CFLAGS -D_REENTRANT -lpthread -mt"
557
SQUID_CXXFLAGS="$SAVE_SQUID_CXXFLAGS -D_REENTRANT -lpthread -mt"
558
AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
559
[ AC_MSG_NOTICE(pthread library required but cannot be found.)
566
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
567
SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
568
AC_CHECK_LIB(pthread, main,[LIBPTHREADS="-lpthread"],
569
[ AC_MSG_NOTICE(pthread library required but cannot be found.)
575
AC_MSG_NOTICE([Native pthreads support manually disabled.])
578
if test "$use_diskthreads" = "yes" ; then
579
AC_DEFINE(USE_DISKIO_DISKTHREADS, 1, [Whether pthreads support is needed. Automatic])
580
AC_MSG_NOTICE([Enabling DiskThreads DiskIO module])
581
DISK_LIBS="$DISK_LIBS libDiskThreads.a"
582
DISK_OS_LIBS="$DISK_OS_LIBS $LIBPTHREADS"
583
DISK_MODULES="$DISK_MODULES DiskThreads"
584
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
586
AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic])
587
AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.])
588
SQUID_CFLAGS="$SAVE_SQUID_CFLAGS"
589
SQUID_CXXFLAGS="$SAVE_SQUID_CXXFLAGS"
594
if test "$FOUND_DISKIO_AIO" = "yes" ; then
595
AC_MSG_ERROR([DiskIO AIO module listed twice.])
597
FOUND_DISKIO_AIO="yes"
598
dnl Check for POSIX AIO availability
601
AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect]))
602
if test "$with_aio" != "no"; then
604
AC_CHECK_HEADERS(aio.h,[have_aio_header=yes])
605
dnl On some systems POSIX AIO functions are in librt
606
dnl On some systems POSIX AIO functions are in libaio
607
AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[]))
608
dnl Enable AIO if the library and headers are found
609
if test "$AIOLIB" != "" && test "$have_aio_header" = "yes"; then
610
AC_MSG_NOTICE([Native POSIX AIO support detected.])
613
dnl Windows does things differently. We provide wrappers.
614
dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO
618
AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.])
621
AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.])
627
AC_MSG_NOTICE([POSIX AIO support manually disabled.])
630
dnl Use the POSIX AIO pieces if we actually need them.
631
if test "$use_aio" = "yes" ; then
632
AC_DEFINE(USE_DISKIO_AIO, 1, [Whether POSIX AIO support is needed. Automatic])
633
DISK_MODULES="$DISK_MODULES AIO"
634
DISK_LIBS="$DISK_LIBS libAIO.a"
635
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
639
AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support])
642
AC_MSG_NOTICE([Enabling AIO DiskIO module])
643
DISK_OS_LIBS="$DISK_OS_LIBS $AIOLIB"
647
AC_DEFINE(USE_DISKIO_AIO, 0, [Whether POSIX AIO support is needed. Automatic])
648
AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.])
653
if test "$FOUND_DISKIO_BLOCKING" = "yes" ; then
654
AC_MSG_ERROR([DiskIO Blocking module listed twice.])
656
FOUND_DISKIO_BLOCKING="yes"
657
AC_MSG_NOTICE([Enabling Blocking DiskIO module])
658
DISK_LIBS="$DISK_LIBS libBlocking.a"
659
DISK_MODULES="$DISK_MODULES Blocking"
660
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
664
AC_MSG_NOTICE([Enabling $module DiskIO module])
665
DISK_LIBS="$DISK_LIBS lib${module}.a"
666
DISK_MODULES="$DISK_MODULES ${module}"
667
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
671
AC_MSG_NOTICE([IO Modules built: $DISK_MODULES])
672
AC_SUBST(DISK_MODULES)
674
AC_SUBST(DISK_PROGRAMS)
675
AC_SUBST(DISK_LINKOBJS)
676
AC_SUBST(DISK_OS_LIBS)
677
AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
678
AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
681
dnl Check what Storage formats are wanted.
682
dnl This version will error out with a message saying why if a required DiskIO is missing.
376
683
AC_ARG_ENABLE(storeio,
377
[ --enable-storeio=\"list of modules\"
378
Build support for the list of store I/O modules.
379
The default is only to build the "ufs" module.
380
See src/fs for a list of available modules, or
381
Programmers Guide section <not yet written>
382
for details on how to build your custom store module],
684
AS_HELP_STRING([--enable-storeio="list of modules"],[Build support for the list of store I/O modules.
685
The default is only to build the "ufs" module.
686
See src/fs for a list of available modules, or
687
Programmers Guide section <not yet written>
688
for details on how to build your custom store module]),
383
689
[ case $enableval in
385
691
for dir in $srcdir/src/fs/*; do
403
709
if test -n "$STORE_MODULES"; then
404
for module in $STORE_MODULES; do
405
if test -d $srcdir/src/fs/$module; then
710
dnl ensure that all modules a) exist and b) only include once.
711
STORE_MODULES_FULL=$STORE_MODULES
713
for module in $STORE_MODULES_FULL; do
714
have_mod=`echo "$STORE_MODULES" | grep "$module"`
715
if test "$have_mod" != ""; then
716
AC_MSG_NOTICE([Removing duplicate $module from storeio])
717
elif test -d $srcdir/src/fs/$module; then
718
STORE_MODULES="$STORE_MODULES $module"
408
echo "ERROR: storeio $module does not exists"
720
AC_MSG_ERROR(storeio $module does not exist)
412
echo "Store modules built: $STORE_MODULES"
414
for module in $STORE_MODULES; do
415
STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o"
723
AC_MSG_NOTICE([Store modules built: $STORE_MODULES])
418
dnl remove all but diskd - its the only module that needs to recurse
419
dnl into the sub directory
427
725
for fs in $STORE_MODULES none; do
728
if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
729
AC_MSG_ERROR([Storage diskd module requires DiskIO modules: Blocking or DiskDaemon])
432
NEED_DISKDAEMON="true"
734
if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKTHREADS" = "yes" ; then
735
AC_MSG_ERROR([Storage diskd module requires DiskIO modules: Blocking or DiskThreads])
437
NEED_DISKTHREADS="true"
740
if ! test "$FOUND_DISKIO_AIO" = "yes"; then
741
AC_MSG_ERROR([COSS requires POSIX AIO which is not available.])
442
744
dnl Automake om MinGW needs explicit exe extension
443
745
dnl for STORE_TESTS substition
445
747
STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT"
448
STORE_TESTS="$STORE_TESTS tests/testNull$EXEEXT"
452
751
STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
457
dnl We have 'fake' modules - aufs and diskd - legacy.
458
for fs in $STORE_MODULES; do
463
STORE_OBJS="$STORE_OBJS fs/lib${fs}.a"
464
STORE_LIBS="$STORE_LIBS lib${fs}.a"
469
755
if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
470
echo "adding UFS, as it contains core logic for diskd and aufs"
471
STORE_OBJS="$STORE_OBJS fs/libufs.a"
472
STORE_LIBS="$STORE_LIBS libufs.a"
756
AC_MSG_NOTICE([Adding UFS, as it contains core logic for diskd and aufs])
473
757
STORE_MODULES="$STORE_MODULES ufs"
474
STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o"
476
759
dnl Automake om MinGW needs explicit exe extension
477
760
dnl for STORE_TESTS substition
479
762
STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
484
AC_SUBST(STORE_LINKOBJS)
765
AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
766
AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
767
AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
768
AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build")
771
dnl got final STORE_MODULES, build library lists
772
dnl This list will not be needed when each fs library has its own Makefile
774
dnl File system libraries to link executables with.
775
dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
777
for fs in $STORE_MODULES; do
778
STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
779
STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
780
HAVE_FS_TYPE=HAVE_FS_`echo $fs | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
781
AC_DEFINE_UNQUOTED($HAVE_FS_TYPE, 1)
784
AC_SUBST(STORE_LIBS_TO_BUILD)
785
AC_SUBST(STORE_LIBS_TO_ADD)
485
786
AC_SUBST(STORE_TESTS)
487
AC_ARG_ENABLE(disk-io,
488
[ --enable-disk-io=\"list of modules\"
489
Build support for the list of disk I/O modules.
490
The default is only to build the "Blocking" module.
491
See src/DiskIO for a list of available modules, or
492
Programmers Guide section <not yet written>
493
for details on how to build your custom disk module],
496
for dir in $srcdir/src/DiskIO/*; do
497
module="`basename $dir`"
498
if test -d "$dir" && test "$module" != CVS; then
499
DISK_MODULES="$DISK_MODULES $module"
506
DISK_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
510
[ if test -z "$DISK_MODULES"; then
511
DISK_MODULES="Blocking"
514
if test -n "$DISK_MODULES"; then
515
for module in $DISK_MODULES; do
516
if test -d $srcdir/src/DiskIO/$module; then
519
echo "ERROR: disk-io $module does not exists"
523
DISK_LIBS="lib`echo $DISK_MODULES|sed -e 's% %.a lib%g'`.a"
525
for module in $DISK_MODULES; do
526
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o"
529
for fs in $DISK_MODULES none; do
532
DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
533
FOUND_DISKDAEMON="true"
536
FOUND_DISKTHREADS="true"
542
FOUND_BLOCKING="true"
546
if test -z "$FOUND_BLOCKING" && test -n "$NEED_BLOCKING"; then
547
echo "adding Blocking, as it is used by an active, legacy Store Module"
548
DISK_LIBS="$DISK_LIBS libBlocking.a"
549
DISK_MODULES="$DISK_MODULES Blocking"
550
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o"
553
if test -z "$FOUND_DISKDAEMON" && test -n "$NEED_DISKDAEMON"; then
554
echo "adding DiskDaemon, as it is used by an active, legacy Store Module"
555
DISK_LIBS="$DISK_LIBS libDiskDaemon.a"
556
DISK_MODULES="$DISK_MODULES DiskDaemon"
557
DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd"
558
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o"
561
if test -z "$FOUND_DISKTHREADS" && test -n "$NEED_DISKTHREADS"; then
562
echo "adding DiskThreads, as it is used by an active, legacy Store Module"
563
DISK_LIBS="$DISK_LIBS libDiskThreads.a"
564
DISK_MODULES="$DISK_MODULES DiskThreads"
565
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o"
568
if test -z "$FOUND_AIO" && test -n "$NEED_AIO"; then
569
echo "adding AIO, as it is used by an active, legacy Store Module"
570
DISK_LIBS="$DISK_LIBS libAIO.a"
571
DISK_MODULES="$DISK_MODULES AIO"
572
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o"
574
echo "IO Modules built: $DISK_MODULES"
577
dnl we know what is being built. now add dependencies.
578
for fs in $DISK_MODULES none; do
581
if test -z "$with_pthreads"; then
585
echo "DiskThreads IO Module used, Windows threads support automatically enabled"
588
echo "DiskThreads IO Module used, pthreads support automatically enabled"
595
if test -z "$with_aio"; then
599
echo "Aio IO Module used, Windows overlapped I/O support automatically enabled"
602
echo "Aio IO Module used, aio support automatically enabled"
612
AC_SUBST(DISK_PROGRAMS)
613
AC_SUBST(DISK_LINKOBJS)
614
AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1])
615
AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1])
789
dnl At lest one removal policy is always needed.
790
dnl 'lru' removal policy is currently hard-coded by name for tests
791
dnl so we must set it as default.
617
793
AC_ARG_ENABLE(removal-policies,
618
[ --enable-removal-policies=\"list of policies\"
619
Build support for the list of removal policies.
620
The default is only to build the "lru" module.
621
See src/repl for a list of available modules, or
622
Programmers Guide section 9.9 for details on how
623
to build your custom policy],
794
AS_HELP_STRING([--enable-removal-policies="list of policies"],[Build support for the list of removal policies.
795
The default is only to build the "lru" module.
796
See src/repl for a list of available modules, or
797
Programmers Guide section 9.9 for details on how
798
to build your custom policy]),
624
799
[ case $enableval in
626
801
for dir in $srcdir/src/repl/*; do
627
802
module="`basename $dir`"
628
if test -d "$dir" && test "$module" != CVS; then
803
if test -d "$dir" && test "$module" != CVS && test "$module" != "lru"; then
629
804
REPL_POLICIES="$REPL_POLICIES $module"
661
831
AM_CONDITIONAL(ENABLE_PINGER, false)
662
832
AC_ARG_ENABLE(icmp,
663
[ --enable-icmp Enable ICMP pinging],
833
AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
664
834
[ if test "$enableval" = "yes" ; then
666
AC_DEFINE(USE_ICMP,1,
667
[If you want to use Squid's ICMP features (highly recommended!) then
668
define this. When USE_ICMP is defined, Squid will send ICMP pings
669
to origin server sites. This information is used in numerous ways:
670
- Sent in ICP replies so neighbor caches know how close
671
you are to the source.
672
- For finding the closest instance of a URN.
673
- With the 'test_reachability' option. Squid will return
674
ICP_OP_MISS_NOFETCH for sites which it cannot ping.])
835
AC_MSG_NOTICE([ICMP enabled])
836
AC_DEFINE(USE_ICMP,1,[Define to use Squid's ICMP and Network Measurement features (highly recommended!)])
675
837
AM_CONDITIONAL(ENABLE_PINGER, true)
679
841
AM_CONDITIONAL(USE_DELAY_POOLS, false)
680
842
AC_ARG_ENABLE(delay-pools,
681
[ --enable-delay-pools Enable delay pools to limit bandwidth usage],
843
AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]),
682
844
[ if test "$enableval" = "yes" ; then
683
echo "Delay pools enabled"
845
AC_MSG_NOTICE([Delay pools enabled])
684
846
AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".])
685
847
AM_CONDITIONAL(USE_DELAY_POOLS, true,)
689
AM_CONDITIONAL(USE_ESI, false)
851
dnl disable generic/common adaptation support by default
690
855
AC_ARG_ENABLE(esi,
691
AC_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat. Enabling ESI will cause squid to follow the Edge Acceleration Specification (www.esi.org). This causes squid to IGNORE client Cache-Control headers. DO NOT use this in a squid configured as a web proxy, ONLY use it in a squid configured for webserver acceleration.]),
856
AS_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Benefits from expat or libxml2.
857
Enabling ESI will cause squid reverse proxies to be capable of the
858
Edge Acceleration Specification (www.esi.org).]),
692
859
use_esi=$enableval, use_esi=no)
693
864
if test "$use_esi" = "yes" ; then
865
AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.])
694
866
AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
695
AM_CONDITIONAL(USE_ESI, true)
696
XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
868
AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect]))
869
if test "$with_expat" != "no" ; then
870
AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
871
AC_CHECK_HEADERS([expat.h])
872
AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
873
if test "$with_expat" = "yes" && test "$HAVE_LIBEXPAT" != "1" ; then
874
AC_MSG_ERROR([Required library expat is not able to be found.])
878
AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
879
if test "$with_libxml2" != "no" ; then
880
AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1])
881
dnl Find the main header and include path...
882
AC_CHECK_HEADERS([libxml/parser.h], [], [
883
SAVED_CPPFLAGS="$CPPFLAGS"
884
CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
885
unset ac_cv_header_libxml_parser_h
886
AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include=yes], [])
887
CPPFLAGS="$SAVED_CPPFLAGS"
889
if test "x$ac_cv_libxml2_include" = "xyes"; then
890
SQUID_CXXFLAGS="-I/usr/include/libxml2 $SQUID_CXXFLAGS"
891
CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
893
dnl Now that we know where to look find the other headers...
894
AC_CHECK_HEADERS(libxml/HTMLparser.h libxml/HTMLtree.h)
895
AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
896
if test "$with_libxml2" = "yes" && test "$HAVE_LIBXML2" != "1" ; then
897
AC_MSG_ERROR([Required library libxml2 is not able to be found.])
698
AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
902
AC_MSG_NOTICE([Disabling ESI processor and Surrogate header support.])
904
AM_CONDITIONAL(USE_ESI, test "$use_esi" = "yes")
905
AM_CONDITIONAL(HAVE_LIBEXPAT, test $HAVE_LIBEXPAT = 1)
907
AM_CONDITIONAL(HAVE_LIBXML2, test $HAVE_LIBXML2 = 1)
701
910
AM_CONDITIONAL(USE_ICAP_CLIENT, false)
702
911
AC_ARG_ENABLE(icap-client,
703
AC_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
912
AS_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]),
704
913
use_icap_client=$enableval, use_icap_client=no)
705
914
if test "$use_icap_client" = "yes" ; then
706
915
AC_DEFINE(ICAP_CLIENT,1,[Enable ICAP client features in Squid])
707
916
AM_CONDITIONAL(USE_ICAP_CLIENT, true)
708
ICAP_LIBS="ICAP/libicap.a"
917
ICAP_LIBS="icap/libicap.la"
710
920
AC_DEFINE(ICAP_CLIENT,0,[Enable ICAP client features in Squid])
713
923
AC_SUBST(ICAP_LIBS)
926
AC_MSG_CHECKING(whether to support eCAP)
928
AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]),
930
case "${enableval}" in
933
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;;
935
AC_MSG_RESULT([$use_ecap, explicitly])
939
AC_MSG_RESULT([$use_ecap, implicitly])
943
dnl Perform configuration consistency checks for eCAP
945
if test $use_ecap = yes;
947
dnl eCAP support requires loadable modules, which are enabled by default
948
if test "$use_loadable_modules" != "yes"
950
AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
953
dnl eCAP support requires libecap
954
AC_CHECK_LIB([ecap], [main],
956
[AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])]
960
AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
961
if test $use_ecap = yes;
963
AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
964
ECAP_LIBS="ecap/libecap.la $ECAP_LIBS"
967
AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
970
dnl convenience library
976
dnl enable adaptation if requested by specific adaptation mechanisms
977
AM_CONDITIONAL(USE_ADAPTATION, test $use_adaptation = yes)
978
if test $use_adaptation = yes
980
AC_DEFINE(USE_ADAPTATION,1,[common adaptation support])
981
ADAPTATION_LIBS="adaptation/libadaptation.la"
983
AC_DEFINE(USE_ADAPTATION,0,[common adaptation support])
986
AC_SUBST(ADAPTATION_LIBS)
715
989
dnl This is a developer only option. Developers know how to set defines
717
991
dnl AC_ARG_ENABLE(mem-gen-trace,
718
992
dnl [ --enable-mem-gen-trace Do trace of memory stuff],
719
993
dnl [ if test "$enableval" = "yes" ; then
720
dnl echo "Memory trace (to file) enabled"
994
dnl AC_MSG_NOTICE([Memory trace (to file) enabled])
721
995
dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free])
725
999
AC_ARG_ENABLE(useragent-log,
726
[ --enable-useragent-log Enable logging of User-Agent header],
1000
AS_HELP_STRING([--enable-useragent-log],[Enable logging of User-Agent header]),
727
1001
[ if test "$enableval" = "yes" ; then
728
echo "User-Agent logging enabled"
1002
AC_MSG_NOTICE([User-Agent logging enabled])
729
1003
AC_DEFINE(USE_USERAGENT_LOG,1,[If you want to log User-Agent request header values, define this.
730
1004
By default, they are written to useragent.log in the Squid log
924
1194
AC_ARG_ENABLE(forw-via-db,
925
[ --enable-forw-via-db Enable Forw/Via database],
1195
AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]),
926
1196
[ if test "$enableval" = "yes" ; then
927
echo "FORW-VIA enabled"
1197
AC_MSG_NOTICE([FORW-VIA enabled])
928
1198
AC_DEFINE(FORW_VIA_DB,1,[Enable Forw/Via database])
932
1202
AC_ARG_ENABLE(cache-digests,
933
[ --enable-cache-digests Use Cache Digests
934
see http://wiki.squid-cache.org/SquidFaq/CacheDigests],
1203
AS_HELP_STRING([--enable-cache-digests],[Use Cache Digests.
1204
See http://wiki.squid-cache.org/SquidFaq/CacheDigests]),
935
1205
[ if test "$enableval" = "yes" ; then
936
echo "USE_CACHE_DIGESTS enabled"
1206
AC_MSG_NOTICE([Cache Disgests enabled])
937
1207
AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
941
dnl Select Default Error language
942
AC_ARG_ENABLE(default-err-language,
943
[ --enable-default-err-language=lang
944
Select default language for Error pages (see
947
if test -d $srcdir/errors/$enableval; then
948
ERR_DEFAULT_LANGUAGE=$enableval
950
echo "ERROR! Unknown language $enableval, see errors/ directory"
953
],[ERR_DEFAULT_LANGUAGE="templates"])
954
AC_SUBST(ERR_DEFAULT_LANGUAGE)
956
dnl Select languages to be installed
957
AC_ARG_ENABLE(err-languages,
958
[ --enable-err-languages=\"lang1 lang2..\"
959
Select languages to be installed. (All will be
960
installed by default) ],
962
for l in $enableval; do
963
if test -d $srcdir/errors/$l; then :; else
964
echo "ERROR! Unknown language $$l, see errors/"
968
ERR_LANGUAGES=$enableval
971
for l in $srcdir/errors/*; do
972
if test -f $l/ERR_ACCESS_DENIED; then
973
ERR_LANGUAGES="$ERR_LANGUAGES `basename $l`"
977
AC_SUBST(ERR_LANGUAGES)
979
1211
dnl Size of COSS memory buffer
980
1212
AC_ARG_WITH(coss-membuf-size,
981
[ --with-coss-membuf-size COSS membuf size (default 1048576 bytes) ],
982
[ if test "$with_coss_membuf_size"; then
983
echo "Setting COSS membuf size to $with_coss_membuf_size bytes"
1213
AS_HELP_STRING([--with-coss-membuf-size=size],[COSS membuf size (default 1048576 bytes)]),
1214
[ if test -n "$withval" -a "x$withval" != "xno" ; then
1215
AC_MSG_NOTICE([Setting COSS membuf size to $with_coss_membuf_size bytes])
984
1216
AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $with_coss_membuf_size,[Define if you want to set the COSS membuf size])
1027
1257
dnl kqueue support is still experiemntal and unstable. Not enabled by default.
1028
1258
disable_kqueue=true
1029
1259
AC_ARG_ENABLE(kqueue,
1030
[ --enable-kqueue Enable kqueue() support (experimental).],
1260
AS_HELP_STRING([--enable-kqueue],[Enable kqueue(2) support (experimental).]),
1033
1262
case "$enableval" in
1035
echo "Forcing kqueue() to be enabled"
1264
AC_MSG_WARN([Forcing kqueue() to be enabled])
1036
1265
SELECT_TYPE="kqueue"
1266
AC_CHECK_HEADERS([sys/event.h],[],
1267
[ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ])
1039
echo "Forcing kqueue() to be disabled"
1270
AC_MSG_WARN([Forcing kqueue() to be disabled])
1040
1271
disable_kqueue=true
1274
AC_CHECK_HEADERS([sys/event.h])
1045
1279
dnl Enable epoll()
1047
1282
AC_ARG_ENABLE(epoll,
1048
[ --disable-epoll Disable Linux epoll() support.],
1283
AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]),
1051
1285
case "$enableval" in
1053
echo "Forcing epoll() to be enabled"
1287
AC_MSG_WARN([Forcing epoll() to be enabled])
1054
1288
SELECT_TYPE="epoll"
1057
echo "Forcing epoll() to be disabled"
1292
AC_MSG_WARN([Forcing epoll() to be disabled])
1058
1293
disable_epoll=true
1297
dnl auto-detect and verify epoll header and library present and working
1298
if test -z "$disable_epoll"; then
1300
# Check for libepoll
1302
AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
1303
AC_SUBST(EPOLL_LIBS)
1305
dnl on some systems it is provided by libc
1306
dnl not to worry, the working test below will catch them
1307
dnl and we don't want to force additional libraries
1310
# Check for epoll_ctl, may need -lepoll
1312
LIBS="$LIBS $EPOLL_LIBS"
1313
AC_CHECK_FUNCS(epoll_ctl)
1316
dnl epoll requires sys/epoll.h
1317
AC_CHECK_HEADERS([sys/epoll.h])
1319
dnl Verify that epoll really works
1320
if test $ac_cv_func_epoll_ctl = yes; then
1321
AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
1322
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1323
#include <sys/epoll.h>
1326
int main(int argc, char **argv)
1328
int fd = epoll_create(256);
1330
perror("epoll_create:");
1335
]])],[ac_cv_epoll_works=yes],[ac_cv_epoll_works=no],[]))
1338
if test "$force_epoll" = "yes" && test "$ac_cv_epoll_works" = "no" ; then
1339
AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.])
1064
1343
dnl Disable HTTP violations
1065
1344
http_violations=1
1066
1345
AC_ARG_ENABLE(http-violations,
1067
[ --disable-http-violations
1068
This allows you to remove code which is known to
1069
violate the HTTP protocol specification.],
1346
AS_HELP_STRING([--disable-http-violations],[This allows you to remove code which is known to
1347
violate the HTTP protocol specification.]),
1070
1348
[ if test "$enableval" = "no" ; then
1071
echo "Disabling HTTP Violations"
1349
AC_MSG_NOTICE([Disabling HTTP Violations])
1072
1350
http_violations=0
1264
1537
AM_CONDITIONAL(MAKE_LEAKFINDER, false)
1265
1538
dnl Enable Leak Finding Functions
1266
1539
AC_ARG_ENABLE(leakfinder,
1267
[ --enable-leakfinder
1268
Enable Leak Finding code. Enabling this alone
1269
does nothing; you also have to modify the source
1270
code to use the leak finding functions. Probably
1271
Useful for hackers only.],
1540
AS_HELP_STRING([--enable-leakfinder],[Enable Leak Finding code. Enabling this alone
1541
does nothing; you also have to modify the source
1542
code to use the leak finding functions. Probably
1543
Useful for hackers only.]),
1272
1544
[ if test "$enableval" = "yes" ; then
1273
echo "Leak-Finding enabled"
1545
AC_MSG_NOTICE([Leak-Finding enabled])
1274
1546
AC_DEFINE(USE_LEAKFINDER,1,[Enable code for assisting in finding memory leaks. Hacker stuff only.])
1275
1547
USE_LEAKFINDER="yes"
1276
1548
AM_CONDITIONAL(MAKE_LEAKFINDER, true)
1553
AC_ARG_ENABLE(follow-x-forwarded-for,
1554
AS_HELP_STRING([--enable-follow-x-forwarded-for],[Enable support for following the X-Forwarded-For
1555
HTTP header to try to find the IP address of the
1556
original or indirect client when a request has
1557
been forwarded through other proxies.]),
1558
[ if test "$enableval" = "yes" ; then
1559
AC_MSG_NOTICE([follow X-Forwarded-For enabled])
1563
if test $follow_xff = 1; then
1564
AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 1, [Enable following X-Forwarded-For headers])
1566
AC_DEFINE(FOLLOW_X_FORWARDED_FOR, 0)
1281
1570
AC_ARG_ENABLE(ident-lookups,
1282
[ --disable-ident-lookups
1283
This allows you to remove code that performs
1284
Ident (RFC 931) lookups.],
1571
AS_HELP_STRING([--disable-ident-lookups],[This allows you to remove code that performs Ident (RFC 931) lookups.]),
1285
1572
[ if test "$enableval" = "no" ; then
1286
echo "Disabling Ident Lookups"
1573
AC_MSG_NOTICE([Disabling Ident Lookups])
1290
1577
if test $use_ident = 1; then
1291
1578
AC_DEFINE(USE_IDENT, 1,[Compile in support for Ident (RFC 931) lookups? Enabled by default.])
1292
AM_CONDITIONAL(ENABLE_IDENT, true)
1294
1580
AC_DEFINE(USE_IDENT, 0)
1295
AM_CONDITIONAL(ENABLE_IDENT, false)
1298
1583
AM_CONDITIONAL(USE_DNSSERVER, false)
1300
1585
AC_ARG_ENABLE(internal-dns,
1301
[ --disable-internal-dns This prevents Squid from directly sending and
1302
receiving DNS messages, and instead enables the
1303
old external 'dnsserver' processes.],
1586
AS_HELP_STRING([--disable-internal-dns],[Prevents Squid from directly sending and receiving DNS messages,
1587
and instead enables the old external 'dnsserver' processes.]),
1304
1588
[ if test "$enableval" = "no" ; then
1305
echo "Disabling Internal DNS queries"
1589
AC_MSG_WARN([Disabling Internal DNS queries])
1306
1590
use_dnsserver="yes"
1567
1840
if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
1570
echo "ERROR: digest auth helper $helper does not exists"
1843
AC_MSG_ERROR(digest auth helper $helper does not exist)
1574
echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS"
1846
AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
1576
1848
AC_SUBST(DIGEST_AUTH_HELPERS)
1578
if `echo "$NEGOTIATE_AUTH_HELPERS" | $EGREP "squid_kerb_auth|all" >/dev/null`; then
1579
AC_CHECK_PROG(ac_krb5_config,krb5-config,yes,no)
1580
if test "x$ac_krb5_config" = "xyes" ; then
1581
ac_heimdal=`krb5-config --version 2>/dev/null | grep -i heimdal`
1582
ac_solaris=`krb5-config --version 2>/dev/null | grep -i solaris`
1583
if test "x$ac_heimdal" != "x" ; then
1584
AC_DEFINE(HAVE_HEIMDAL_KERBEROS,1,[Define to 1 if you have Heimdal Kerberos])
1586
AC_DEFINE(HAVE_MIT_KERBEROS,1,[Define to 1 if you have MIT Kerberos])
1588
if test "x$ac_solaris" != "x" ; then
1589
KRB5INCS="-I/usr/include/gssapi"
1590
KRB5LIBS="-L/usr/lib -R/usr/lib -lgss -lresolv -lsocket -lnsl"
1592
KRB5INCS=`krb5-config --cflags gssapi 2>/dev/null`
1593
KRB5LIBS=`krb5-config --libs gssapi 2>/dev/null`
1595
AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h gssapi/gssapi_generic.h)
1597
old_CPPFLAGS=$CPPFLAGS
1598
CPPFLAGS="$CPPFLAGS $KRB5INCS"
1600
LIBS="$LIBS $KRB5LIBS"
1601
AC_CACHE_CHECK([for SPNEGO support],ac_cv_have_spnego,[
1603
#ifdef HAVE_HEIMDAL_KERBEROS
1604
#ifdef HAVE_GSSAPI_GSSAPI_H
1605
#include <gssapi/gssapi.h>
1606
#elif defined(HAVE_GSSAPI_H)
1610
#ifdef HAVE_GSSAPI_GSSAPI_H
1611
#include <gssapi/gssapi.h>
1612
#elif defined(HAVE_GSSAPI_H)
1615
#ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
1616
#include <gssapi/gssapi_krb5.h>
1618
#ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
1619
#include <gssapi/gssapi_generic.h>
1623
int main(int argc, char *argv[]) {
1624
OM_uint32 major_status,minor_status;
1625
gss_OID_set gss_mech_set;
1628
static gss_OID_desc _gss_mech_spnego = {6, (void *)"\x2b\x06\x01\x05\x05\x02"};
1629
gss_OID gss_mech_spnego = &_gss_mech_spnego;
1631
major_status = gss_indicate_mechs( &minor_status, &gss_mech_set);
1633
for (i=0;i<gss_mech_set->count;i++) {
1634
if (!memcmp(gss_mech_set->elements[i].elements,gss_mech_spnego->elements,gss_mech_set->elements[i].length)) {
1641
ac_cv_have_spnego=yes,
1642
ac_cv_have_spnego=no)])
1644
CPPFLAGS=$old_CPPFLAGS
1645
if test x"$ac_cv_have_spnego" = x"yes"; then
1646
AC_DEFINE(HAVE_SPNEGO,1, [Define to 1 if you have SPNEGO support])
1651
AM_CONDITIONAL(HAVE_SPNEGO, test x"$ac_cv_have_spnego" = x"yes" )
1653
1850
dnl Enable "NTLM fail open"
1654
1851
AC_ARG_ENABLE(ntlm-fail-open,
1655
[ --enable-ntlm-fail-open Enable NTLM fail open, where a helper that fails one of the
1656
Authentication steps can allow squid to still authenticate
1852
AS_HELP_STRING([--enable-ntlm-fail-open],[Enable NTLM fail open, where a helper that fails one of the
1853
Authentication steps can allow squid to still authenticate
1658
1855
[ if test "$enableval" = "yes" ; then
1659
1856
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.])
1801
1998
AM_CONDITIONAL(ENABLE_XPROF_STATS, false)
1802
1999
dnl Enable USE_XPROF_STATS
1803
2000
AC_ARG_ENABLE(cpu-profiling,
1804
[ --enable-cpu-profiling
1805
This option allows you to see which internal functions
1806
in Squid are consuming how much CPU. Compiles in probes
1807
that measure time spent in probed functions. Needs
1808
source modifications to add new probes. This is meant
1809
for developers to assist in performance optimisations
1810
of Squid internal functions.
1811
If you are not developer and not interested in the stats
1812
you shouldn't enable this, as overhead added, although
1813
small, is still overhead. See lib/Profiler.c for more.
2001
AS_HELP_STRING([--enable-cpu-profiling],[Enable instrumentation to try and understand how CPU power
2002
is spent by squid, by enabling specific probes in selected
2003
functions. New probes can only be added by modifying the source code.
2004
It is meant to help developers in optimizing performance
2005
of Squid internal functions.
2006
If you are not developer you shouldn't enable this,
2007
as it slows squid down somewhat. See lib/Profiler.c for more details.]),
1815
2008
[ if test "$enableval" = "yes" ; then
1816
echo "Enabling cpu-profiling"
2009
AC_MSG_NOTICE([Enabling cpu-profiling])
1817
2010
AC_DEFINE(USE_XPROF_STATS, 1,[Define to enable CPU profiling within Squid])
1818
2011
AM_CONDITIONAL(ENABLE_XPROF_STATS, true)
1822
2015
dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup
1823
AC_ARG_ENABLE(x_accelerator_vary,
1824
[ --enable-x-accelerator-vary
1825
Enable support for the X-Accelerator-Vary
1826
HTTP header. Can be used to indicate
1827
variance within an accelerator setup.
1828
Typically used together with other code
1829
that adds custom HTTP headers to the requests.],
2016
AC_ARG_ENABLE(x-accelerator-vary,
2017
AS_HELP_STRING([--enable-x-accelerator-vary],[Enable support for the X-Accelerator-Vary
2018
HTTP header. Can be used to indicate
2019
variance within an accelerator setup.
2020
Typically used together with other code
2021
that adds custom HTTP headers to the requests.]),
1830
2022
[ if test "$enableval" = "yes" ; then
1831
echo "Enabling support for X-Accelerator-Vary"
2023
AC_MSG_NOTICE([Enabling support for X-Accelerator-Vary])
1832
2024
AC_DEFINE(X_ACCELERATOR_VARY, 1, [Enable support for the X-Accelerator-Vary HTTP header])
2028
AC_ARG_ENABLE(zph-qos,
2029
AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]),
2030
[ if test "$enableval" = "yes" ; then
2031
AC_MSG_NOTICE([ZPH QOS enabled])
2032
AC_DEFINE(USE_ZPH_QOS,1,
2033
[ Define this to use Squid's ZPH (Zero Penalty Hit) QOS features.
2034
When enabled, Squid will alter TOS field of HIT responses for better QOS on intermediate routing/shaping devices.])
2038
dnl --with-maxfd present for compatibility with Squid-2.
2039
dnl undocumented in ./configure --help to encourage using the Squid-3 directive.
2044
squid_filedescriptors_num=$withval
2047
AC_MSG_ERROR(--with-maxfd expects a numeric argument)
1836
2051
AC_ARG_WITH(filedescriptors,
1837
[ --with-filedescriptors=NUMBER
1838
Force squid to support NUMBER filedescriptors],
1839
[ squid_filedescriptors_num=$withval ])
2052
AS_HELP_STRING([--with-filedescriptors=NUMBER],[Force squid to support NUMBER filedescriptors]),
2056
squid_filedescriptors_num=$withval
2059
AC_MSG_ERROR(--with-filedescriptors expects a numeric argument)
1841
2064
AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false)
1842
2065
if $CPPUNITCONFIG --help >/dev/null; then
1843
echo "using system installed cppunit"
2066
AC_MSG_NOTICE([using system installed cppunit])
1844
2067
SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`"
1845
2068
SQUID_CPPUNIT_LA=''
1846
2069
SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`"
1848
echo "cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail."
2071
AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.])
1849
2072
SQUID_CPPUNIT_LA=''
1850
2073
SQUID_CPPUNIT_LIBS=''
1851
2074
SQUID_CPPUNIT_INC=''
1854
2077
AC_ARG_WITH(cppunit-basedir,
1855
[ --with-cppunit-basedir=/path/to/cppunit-base
1856
Path where the cppunit headers are libraries are found
2078
AS_HELP_STRING([--with-cppunit-basedir=PATH],[Path where the cppunit headers are libraries are found
2079
for unit testing.]),
1859
2080
[ if test -f $withval/include/cppunit/TestCase.h; then
1860
echo "Using cppunit includes from $withval"
2081
AC_MSG_NOTICE([Using cppunit includes from $withval])
1861
2082
SQUID_CPPUNIT_INC="-I${withval}/include"
1863
echo "ERROR: Cannot find cppunit at $withval"
2084
AC_MSG_ERROR(Cannot find cppunit at $withval)
1866
2086
if test -f $withval/lib/libcppunit.la; then
1867
echo "Using cppunit lib from $withval"
2087
AC_MSG_NOTICE([Using cppunit lib from $withval])
1868
2088
SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la"
1869
2089
SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)'
1871
echo "ERROR: Cannot find cppunit at $withval"
2091
AC_MSG_ERROR(Cannot find cppunit at $withval)
1875
2094
AC_SUBST(SQUID_CPPUNIT_LIBS)
2285
2511
#include <stddef.h>
2514
dnl Check for libcap header (assume its not broken unless
2516
AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],[disable usage of Linux capabilities library to control privileges]),
2517
[ if test "x$withval" = "xyes" ; then
2518
AC_MSG_RESULT(libcap forced enabled)
2521
AC_MSG_RESULT(libcap forced disabled)
2525
if test "x$use_libcap" != "xno"; then
2526
# cap_clear_flag is the most recent libcap function we require
2527
AC_CHECK_LIB(cap, cap_clear_flag)
2528
if test "x$ac_cv_lib_cap_cap_clear_flag" = xyes; then
2531
if test "x$use_libcap" = "xyes"; then
2532
AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
2538
if test "x$use_libcap" = "xyes"; then
2539
AC_DEFINE(USE_LIBCAP, 1, [use libcap to set capabilities required for TPROXY])
2540
dnl Check for libcap headader breakage.
2541
AC_CHECK_HEADERS(sys/capability.h)
2542
AC_CACHE_CHECK([for operational libcap2 headers], squid_cv_sys_capability_works,
2543
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2546
#include <sys/capability.h>
2550
]])],[squid_cv_sys_capability_works=yes],[squid_cv_sys_capability_works=no])
2552
if test x$squid_cv_sys_capability_works != xyes; then
2553
AC_DEFINE([LIBCAP_BROKEN],1,[if libcap2 headers are broken and clashing with glibc])
2288
2558
AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
2289
2559
#include <sys/ipc.h>
2290
2560
#include <sys/msg.h>])
2292
2562
dnl Check for needed libraries
2293
AC_CHECK_LIB(nsl, main)
2294
AC_CHECK_LIB(socket, main)
2563
AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
2564
AC_SEARCH_LIBS([res_init],[resolv])
2565
AC_SEARCH_LIBS([bind],[socket])
2566
AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
2567
AC_SEARCH_LIBS([strlcpy], [bsd])
2568
AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
2295
2569
dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2296
2570
case "$host_os" in
2373
AC_CHECK_LIB(bsd, main)
2374
2638
AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
2375
AC_CHECK_LIB(bind, gethostbyname)
2376
if test $ac_cv_lib_bind_gethostbyname = "no" ; then
2379
echo "skipping libresolv checks for $host"
2382
AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
2383
AC_CHECK_LIB(resolv, main)
2387
2639
case "$host_os" in
2389
echo "Use MSVCRT for math functions."
2641
AC_MSG_NOTICE([Use MSVCRT for math functions.])
2392
AC_CHECK_LIB(m, main)
2644
dnl rint() is only used in old C code for now.
2646
AC_SEARCH_LIBS([rint],[m])
2651
dnl Enable IPv6 support
2652
AC_MSG_CHECKING([whether to enable IPv6])
2655
AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
2656
[ case $enableval in
2664
AC_MSG_RESULT($use_ipng)
2666
if test "$use_ipng" != "no"; then
2668
dnl Solaris 10/11 requires -lsocket
2671
LIBS="$LIBS -lsocket"
2676
AC_CACHE_CHECK([if PF_INET6 is available], squid_cv_pf_inet6,
2677
AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* PF_INET6 available check */
2678
# include <sys/types.h>
2679
# include <sys/socket.h>
2680
int main(int argc, char **argv) {
2681
if (socket(PF_INET6, SOCK_STREAM, 0) < 0)
2686
]])],[squid_cv_pf_inet6="yes" ; SAVED_LIBS="$LIBS"],[squid_cv_pf_inet6="no"],[])
2691
# NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
2692
# unless --enable-ipv6 is explicitly used. in which case it's a hard fail.
2693
if test "x$use_ipng" = "xyes" && test "x$squid_cv_pf_inet6" = "xno"; then
2694
AC_MSG_ERROR([IPv6 cannot be built on this system. Basic kernel definitions are missing.])
2695
elif test "x$use_ipng" = "xauto" && test "x$squid_cv_pf_inet6" = "xno"; then
2696
AC_MSG_WARN([IPv6 cannot be built on this system. Basic kernel definitions are missing.])
2699
if test "$use_ipng" != "no" && test "$squid_cv_pf_inet6" = "yes" ; then
2700
AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ])
2701
SET_IPV6_SETTINGS=""
2704
dnl Check for forced split-stack mode
2705
AC_MSG_CHECKING([for IPv6 split-stack requirement])
2706
AC_ARG_WITH(ipv6-split-stack,
2707
AS_HELP_STRING([--with-ipv6-split-stack],[Force-Enable experimental split-stack support for Windows XP and *BSD. Requires IPv6.]),
2709
AC_MSG_RESULT(yes)],
2710
[ AC_MSG_RESULT(no) ])
2712
dnl Check for IPv6 v4-mapping availability
2713
dnl Useful for other OS with hybrid-stack defaults turned OFF
2714
dnl But only usable if it actually works...
2715
if test "$use_v4mapped" = "yes" ; then
2716
AC_MSG_CHECKING([for IPv6 v4-mapping ability])
2717
AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* IPPROTO_V4MAPPED is usable check */
2718
# include <sys/types.h>
2719
# include <sys/socket.h>
2720
# include <netinet/in.h>
2721
#if HAVE_NETINET_IN6_H
2722
# include <netinet/in6.h>
2724
int main(int argc, char **argv) {
2725
int s = socket(PF_INET6, SOCK_STREAM, 0);
2727
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &tos, sizeof(int)) < 0)
2732
]])],[ AC_MSG_RESULT(yes)
2734
AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
2735
],[ AC_MSG_RESULT(no)
2736
AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets])
2741
dnl if we can't defer v4-mapping to the OS we are forced to split-stack the FD table.
2742
AC_MSG_CHECKING([for IPv6 stack type/mode])
2743
if test "$use_v4mapped" = "yes"; then
2744
AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2745
AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations])
2746
AC_MSG_RESULT(mapping hybrid)
2748
AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
2749
AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
2750
AC_MSG_RESULT(split-stack or BSD non-mapping dual-stack)
2753
dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len
2754
AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6],
2755
ac_cv_have_sin6_len_in_struct_sai, [
2756
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2757
#include <sys/types.h>
2758
#include <sys/socket.h>
2759
#include <netinet/in.h>
2760
]], [[ 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"
2763
if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then
2764
AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2766
AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No])
2770
# IPv6 is not available, but is not explicitly required. Auto-Disable.
2771
AC_DEFINE(USE_IPV6,0,[Enable support for IPv6])
2772
AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
2773
AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
2774
SET_IPV6_SETTINGS="\#IPv6 Not Available: "
2776
AC_SUBST(SET_IPV6_SETTINGS)
2778
dnl Check whether this OS defines ss_len as a member of sockaddr_storage
2779
AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
2780
ac_cv_have_ss_len_in_struct_ss, [
2781
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2782
#include <sys/types.h>
2783
#include <sys/socket.h>
2784
#include <netinet/in.h>
2785
]], [[ 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"
2788
if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
2789
AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2791
AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No])
2794
dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len
2795
AC_CACHE_CHECK([for sin_len field in struct sockaddr_in],
2796
ac_cv_have_sin_len_in_struct_sai, [
2797
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2798
#include <sys/types.h>
2799
#include <sys/socket.h>
2800
#include <netinet/in.h>
2801
]], [[ 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"
2804
if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then
2805
AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2807
AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No])
2396
2810
dnl Check for libcrypt
2397
2811
dnl Some of our helpers use crypt(3) which may be in libc, or in
2398
2812
dnl libcrypt (eg FreeBSD)
2399
2813
AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
2401
2814
dnl Solaris10 provides MD5 natively through libmd5
2402
2815
AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"])
2404
2816
AC_SUBST(CRYPTLIB)
2406
2818
dnl Check for libdl, used by auth_modules/PAM
2939
3287
AC_DEFINE(LINUX_NETFILTER, 0)
2941
3289
AC_MSG_RESULT($LINUX_NETFILTER)
2943
3291
if test "$LINUX_NETFILTER" = "no" ; then
2944
echo "WARNING: Cannot find necessary Linux kernel (Netfilter) header files"
2945
echo " Linux Transparent Proxy support WILL NOT be enabled"
3292
AC_MSG_WARN([Cannot find necessary Linux kernel (Netfilter) header files])
3293
AC_MSG_WARN([Linux Transparent and Intercepting Proxy support WILL NOT be enabled])
3295
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3298
dnl Netfilter TPROXY depends on libcap but the NAT parts can still work.
3299
if test "$LINUX_NETFILTER" = "yes" && test "$use_libcap" != "yes" ; then
3300
AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY])
3301
AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3302
AC_MSG_WARN([Reduced support to Interception Proxy])
3304
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
2949
dnl Linux Netfilter/TPROXY support requires some specific header files
2950
dnl Shamelessly copied from shamelessly copied from above
2951
if test "$LINUX_TPROXY" ; then
2952
AC_MSG_CHECKING(if TPROXY header files are installed)
3308
dnl Linux Netfilter/TPROXYv2 support requires some specific header files
3309
dnl Shamelessly copied from above
3310
if test "$LINUX_TPROXY2"; then
3311
if test "$use_libcap" = "yes"; then
3312
AC_MSG_CHECKING(if TPROXYv2 header files are installed)
2953
3313
# hold on to your hats...
2954
3314
if test "$ac_cv_header_linux_netfilter_ipv4_ip_tproxy_h" = "yes" && test "$LINUX_NETFILTER" = "yes"; then
2956
AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.])
3316
AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
2959
AC_DEFINE(LINUX_TPROXY, 0, [Enable real Transparent Proxy support for Netfilter TPROXY.])
2961
AC_MSG_RESULT($LINUX_TPROXY)
2963
if test "$LINUX_TPROXY" = "no" && test "$LINUX_NETFILTER" = "yes"; then
2964
echo "WARNING: Cannot find TPROXY headers, you need to install the"
2965
echo "tproxy package from:"
2966
echo " - lynx http://www.balabit.com/downloads/tproxy/"
3319
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3321
AC_MSG_RESULT($LINUX_TPROXY2)
3322
if test "$LINUX_TPROXY2" = "no" && test "$LINUX_NETFILTER" = "yes"; then
3323
AC_MSG_WARN([Cannot find TPROXY v2 headers, you need to patch the kernel with ])
3324
AC_MSG_WARN([tproxy package from:])
3325
AC_MSG_WARN([ - lynx http://www.balabit.com/downloads/files/tproxy/])
3326
AC_MSG_WARN([Or select the '--enable-linux-netfilter' option instead for Netfilter support.])
3330
AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY v2])
3331
AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled])
3333
AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
3338
AC_ARG_ENABLE(gnuregex,
3339
AS_HELP_STRING([--enable-gnuregex],[Compile GNUregex. Unless you have reason to use
3340
this option, you should not enable it.
3341
This library file is usually only required on Windows and
3342
very old Unix boxes which do not have their own regex
3343
library built in.]),
3344
[USE_GNUREGEX=$enableval])
2970
3345
if test -z "$USE_GNUREGEX" ; then
2971
3346
case "$host" in
2972
3347
*-sun-solaris2.[[0-4]])
3155
3525
#if HAVE_WINSOCK2_H
3156
3526
#include <winsock2.h>
3528
int main(int argc, char **argv)
3161
int fd,val=0,len=sizeof(int);
3162
3532
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3533
int len=sizeof(int);
3163
3534
WSADATA wsaData;
3164
3535
WSAStartup(2, &wsaData);
3537
socklen_t len=sizeof(socklen_t);
3166
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3167
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3539
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3168
3540
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3541
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3544
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3171
if (val<=0) exit(1);
3546
if (val<=0) return 1;
3172
3547
fp = fopen("conftestval", "w");
3173
3548
fprintf (fp, "%d\n", val);
3177
SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`,
3178
SQUID_DETECT_UDP_SO_SNDBUF=16384,
3179
SQUID_DETECT_UDP_SO_SNDBUF=16384)
3551
]])],[SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_SNDBUF=16384],[SQUID_DETECT_UDP_SO_SNDBUF=16384])
3180
3552
AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF)
3181
3553
AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size])
3183
3555
dnl Not cached since people are likely to tune this
3184
3556
AC_MSG_CHECKING(Default UDP receive buffer size)
3557
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3186
3558
#include <stdlib.h>
3187
3559
#include <stdio.h>
3188
3560
#include <sys/types.h>
3198
3570
#if HAVE_WINSOCK2_H
3199
3571
#include <winsock2.h>
3573
int main(int argc, char **argv)
3204
int fd,val=0,len=sizeof(int);
3205
3577
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3578
int len=sizeof(int);
3206
3579
WSADATA wsaData;
3207
3580
WSAStartup(2, &wsaData);
3582
socklen_t len=sizeof(socklen_t);
3209
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
3210
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3584
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
3211
3585
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3586
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3589
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3214
if (val <= 0) exit(1);
3591
if (val <= 0) return 1;
3215
3592
fp = fopen("conftestval", "w");
3216
3593
fprintf (fp, "%d\n", val);
3220
SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`,
3221
SQUID_DETECT_UDP_SO_RCVBUF=16384,
3222
SQUID_DETECT_UDP_SO_RCVBUF=16384)
3596
]])],[SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_RCVBUF=16384],[SQUID_DETECT_UDP_SO_RCVBUF=16384])
3223
3597
AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF)
3224
3598
AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size])
3226
3600
dnl Not cached since people are likely to tune this
3227
3601
AC_MSG_CHECKING(Default TCP send buffer size)
3602
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3229
3603
#include <stdlib.h>
3230
3604
#include <stdio.h>
3231
3605
#include <sys/types.h>
3241
3615
#if HAVE_WINSOCK2_H
3242
3616
#include <winsock2.h>
3618
int main(int argc, char **argv)
3247
int fd,val=0,len=sizeof(int);
3248
3622
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3623
int len=sizeof(int);
3249
3624
WSADATA wsaData;
3250
3625
WSAStartup(2, &wsaData);
3627
socklen_t len=sizeof(socklen_t);
3252
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3253
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3629
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3254
3630
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3631
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
3634
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1;
3257
if (val <= 0) exit(1);
3636
if (val <= 0) return 1;
3258
3637
fp = fopen("conftestval", "w");
3259
3638
fprintf (fp, "%d\n", val);
3263
SQUID_TCP_SO_SNDBUF=`cat conftestval`,
3264
SQUID_TCP_SO_SNDBUF=16384,
3265
SQUID_TCP_SO_SNDBUF=16384)
3641
]])],[SQUID_TCP_SO_SNDBUF=`cat conftestval`],[SQUID_TCP_SO_SNDBUF=16384],[SQUID_TCP_SO_SNDBUF=16384])
3266
3642
AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF)
3267
3643
if test $SQUID_TCP_SO_SNDBUF -gt 32768; then
3268
echo "Limiting send buffer size to 32K"
3644
AC_MSG_NOTICE([Limiting send buffer size to 32K])
3269
3645
SQUID_TCP_SO_SNDBUF=32768
3271
3647
AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size])
3273
3649
dnl Not cached since people are likely to tune this
3274
3650
AC_MSG_CHECKING(Default TCP receive buffer size)
3651
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3276
3652
#include <stdlib.h>
3277
3653
#include <stdio.h>
3278
3654
#include <sys/types.h>
3288
3664
#if HAVE_WINSOCK2_H
3289
3665
#include <winsock2.h>
3667
int main(int argc, char **argv)
3294
int fd,val=0,len=sizeof(int);
3295
3671
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3672
int len=sizeof(int);
3296
3673
WSADATA wsaData;
3297
3674
WSAStartup(2, &wsaData);
3676
socklen_t len=sizeof(socklen_t);
3299
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3300
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3678
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
3301
3679
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3680
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
3683
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1;
3304
if (val <= 0) exit(1);
3685
if (val <= 0) return 1;
3305
3686
fp = fopen("conftestval", "w");
3306
3687
fprintf (fp, "%d\n", val);
3310
SQUID_TCP_SO_RCVBUF=`cat conftestval`,
3311
SQUID_TCP_SO_RCVBUF=16384,
3312
SQUID_TCP_SO_RCVBUF=16384)
3690
]])],[SQUID_TCP_SO_RCVBUF=`cat conftestval`],[SQUID_TCP_SO_RCVBUF=16384],[SQUID_TCP_SO_RCVBUF=16384])
3313
3691
AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF)
3314
3692
if test $SQUID_TCP_SO_RCVBUF -gt 65535; then
3315
echo "Limiting receive buffer size to 64K"
3693
AC_MSG_NOTICE([Limiting receive buffer size to 64K])
3316
3694
SQUID_TCP_SO_RCVBUF=65535
3318
3696
AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size])
3319
3697
AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist,
3320
AC_TRY_COMPILE([#include <stdio.h>],[char *s = sys_errlist;],
3321
ac_cv_needs_sys_errlist="no",
3322
ac_cv_needs_sys_errlist="yes")
3698
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"])
3324
3700
if test "$ac_cv_needs_sys_errlist" = "yes" ; then
3325
3701
AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
3328
3704
dnl Not cached since people are likely to change this
3329
3705
AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
3330
AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
3332
AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],
3335
AC_MSG_CHECKING(if inet_ntoa() actually works)
3339
#include <sys/types.h>
3340
#include <netinet/in.h>
3341
#include <arpa/inet.h>
3346
in.s_addr = inet_addr("1.2.3.4");
3347
fp = fopen("conftestval", "w");
3348
fprintf (fp, "%s\n", inet_ntoa(in));
3352
INET_NTOA_RESULT=`cat conftestval`,
3353
INET_NTOA_RESULT="broken",
3354
INET_NTOA_RESULT="broken")
3355
if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then
3356
AC_MSG_RESULT("yes")
3361
echo "Using Win32 resolver instead."
3364
echo "Will use our own inet_ntoa()."
3365
AC_LIBOBJ(inet_ntoa)
3366
# echo "WARNING: This looks bad, and probably prevents Squid from working."
3367
# echo " If you're on IRIX and using GCC 2.8, you probably need"
3368
# echo " to use the IRIX C compiler instead."
3706
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
3707
AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],[AC_MSG_RESULT(no)])
3374
3709
if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
3375
3710
AC_MSG_CHECKING(for working statvfs() interface)
3711
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3377
3712
#include <stdlib.h>
3378
3713
#include <stdio.h>
3379
3714
#include <sys/types.h>
3380
3715
#include <sys/statvfs.h>
3383
3717
struct statvfs sfs;
3384
3718
sfs.f_blocks = sfs.f_bfree = sfs.f_frsize =
3385
3719
sfs.f_files = sfs.f_ffree = 0;
3386
3720
statvfs("/tmp", &sfs);
3388
ac_cv_func_statvfs=yes,
3389
ac_cv_func_statvfs=no)
3721
]])],[ac_cv_func_statvfs=yes],[ac_cv_func_statvfs=no])
3390
3722
AC_MSG_RESULT($ac_cv_func_statvfs)
3391
3723
if test "$ac_cv_func_statvfs" = "yes" ; then
3392
3724
AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!])
3728
dnl Detect what resolver fields we have available to use...
3729
AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list,
3730
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3731
#if HAVE_SYS_TYPES_H
3732
#include <sys/types.h>
3734
#if HAVE_NETINET_IN_H
3735
#include <netinet/in.h>
3737
#if HAVE_ARPA_INET_H
3738
#include <arpa/inet.h>
3740
#if HAVE_ARPA_NAMESER_H
3741
#include <arpa/nameser.h>
3746
]], [[_res_ext.nsaddr_list[[0]].s_addr;]])],[ac_cv_have_res_ext_nsaddr_list="yes"],[ac_cv_have_res_ext_nsaddr_list="no"]))
3747
if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then
3748
AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member])
3749
AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext])
3752
if test "$_SQUID_RES_NSADDR6_LIST" = ""; then
3753
AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs,
3754
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3755
#if HAVE_SYS_TYPES_H
3756
#include <sys/types.h>
3758
#if HAVE_NETINET_IN_H
3759
#include <netinet/in.h>
3761
#if HAVE_ARPA_INET_H
3762
#include <arpa/inet.h>
3764
#if HAVE_ARPA_NAMESER_H
3765
#include <arpa/nameser.h>
3770
]], [[_res._u._ext.nsaddrs[[0]]->sin6_addr;]])],[ac_cv_have_res_ext_nsaddrs="yes"],[ac_cv_have_res_ext_nsaddrs="no"]))
3771
if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then
3772
AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member])
3773
AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res])
3396
3777
AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list,
3778
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3398
3779
#if HAVE_SYS_TYPES_H
3399
3780
#include <sys/types.h>
3436
3815
#if HAVE_RESOLV_H
3437
3816
#include <resolv.h>
3440
[_res.ns_list[[0]].addr;],
3441
ac_cv_have_res_ns_list="yes",
3442
ac_cv_have_res_ns_list="no"))
3818
]], [[_res.ns_list[[0]].addr;]])],[ac_cv_have_res_ns_list="yes"],[ac_cv_have_res_ns_list="no"]))
3443
3819
if test $ac_cv_have_res_ns_list = "yes" ; then
3444
AC_DEFINE(HAVE_RES_NS_LIST,1,[If _res structure has ns_list member])
3820
AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member])
3821
AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res])
3825
dnl Squid will usually attempt to translate when packaging or building from VCS
3826
use_translation="yes"
3827
AC_ARG_ENABLE(translation,
3828
AS_HELP_STRING([--disable-translation],[Prevent Squid generating localized error page templates and manuals.
3829
Which is usually tried, but may not be needed.]),
3830
[ if test "$enableval" = "no" ; then
3834
dnl Squid now has .po translation capability, given the right toolkit
3835
if test "$use_translation" = "yes" ; then
3836
AX_WITH_PROG([PO2HTML],[po2html])
3842
dnl Squid now has limited locale handling ...
3845
AC_ARG_ENABLE(auto-locale,
3846
AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the
3847
clients request headers.
3848
When disabled Squid requires explicit language configuration.]),
3849
[ if test "$enableval" = "no" ; then
3853
if test "$use_errlocale" = "yes" ; then
3854
AC_MSG_NOTICE([Enabling Multi-Language Support])
3855
AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
3857
AC_MSG_WARN([Disabling Multi-Language Support])
3858
AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
3448
3861
dnl Need the debugging version of malloc if available