dnl dnl $Id$ dnl dnl dnl AC_INIT([Squid Web Proxy],[3.HEAD-BZR],[http://www.squid-cache.org/bugs/],[squid]) AC_PREREQ(2.61) AC_CONFIG_HEADERS([include/autoconf.h]) AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE([tar-ustar nostdinc]) AC_REVISION($Revision$)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE m4_include([acinclude/squid-util.m4]) m4_include([acinclude/compiler-flags.m4]) m4_include([acinclude/os-deps.m4]) m4_include([acinclude/krb5.m4]) m4_include([acinclude/pam.m4]) PRESET_CFLAGS="$CFLAGS" PRESET_LDFLAGS="$LDFLAGS" dnl Set default LDFLAGS if test -z "$LDFLAGS"; then LDFLAGS="-g" fi # Check for GNU cc AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX AC_LANG([C++]) AC_CANONICAL_HOST AC_MSG_CHECKING([simplified host os]) squid_host_os=`echo $host_os|sed 's/[0-9].*//;s/-.*//g'` squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"` AC_MSG_RESULT($squid_host_os (version $squid_host_os_version)) # on windows squid_host_os is either mingw or cygwin, version is 32 # test for programs AC_PROG_RANLIB AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_EGREP AC_PATH_PROG(SH, sh, /bin/sh) AC_PATH_PROG(FALSE, false, /usr/bin/false) AC_PATH_PROG(TRUE, true, /usr/bin/true) AC_PATH_PROG(MV, mv, $FALSE) AC_PATH_PROG(MKDIR, mkdir, $FALSE) AC_PATH_PROG(LN, ln, cp) AC_PATH_PROG(CHMOD, chmod, $FALSE) AC_PATH_PROG(TR, tr, $FALSE) AC_PATH_PROG(RM, rm, $FALSE) AC_PATH_PROG(CPPUNITCONFIG, cppunit-config, false) dnl Libtool 2.2.6 requires: rm -f RM="$RM -f" AC_PATH_PROG(PERL, perl, none) if test "$ac_cv_path_PERL" = "none"; then AC_MSG_FAILURE([Perl is required to compile Squid. Please install Perl and then re-run configure ]) fi AC_PATH_PROG(POD2MAN, pod2man, $FALSE) dnl set $(AR) AC_PATH_PROG(AR, ar, $FALSE) AR_R="$AR r" AC_SUBST(AR_R) squid_opt_enable_werror="yes" # default AC_ARG_ENABLE(strict-error-checking, AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled with all possible static compiler error-checks enbled. This flag disables the behavior]), [ if test "${enableval}" = "no" then squid_opt_enable_werror="no" fi ]) use_loadable_modules=1 AC_MSG_CHECKING(whether to use loadable modules) AC_ARG_ENABLE(loadable-modules, AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [ case "${enableval}" in yes) use_loadable_modules=yes ;; no) use_loadable_modules=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --disable-loadable-modules) ;; esac AC_MSG_RESULT([$use_loadable_modules, explicitly]) ], [ use_loadable_modules=yes; AC_MSG_RESULT([$use_loadable_modules, implicitly]) ]) AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes) if test $use_loadable_modules = yes; then AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules]) AC_ENABLE_SHARED else AC_DISABLE_SHARED fi AC_LIBTOOL_DLOPEN if test $use_loadable_modules = yes; then dnl Linux LTDL v3-v7 macros assume the autoconf 2.62 variable top_build_prefix is defined dnl But from autoconf 2.64 its called ac_top_build_prefix and not automatically added to the Makefile top_build_prefix=${ac_top_build_prefix} AC_SUBST(top_build_prefix) AC_LIBLTDL_CONVENIENCE fi dnl LibTool environment is now prepared for setup. Check that it is usable and initialize. AC_PROG_LIBTOOL AC_LTDL_DLLIB # Do we need these unconditionally for "make distcheck" to work? AC_SUBST(INCLTDL) AC_SUBST(LIBLTDL) if test $use_loadable_modules = yes; then # Why is this needed? Should not AC_LIBTOOL_DLOPEN from libtool do that? LIBADD_DL=${lt_cv_dlopen_libs} AC_SUBST([LIBADD_DL]) fi SQUID_CC_GUESS_VARIANT SQUID_CC_GUESS_OPTIONS REGEXLIB='' # -lregex # LIBREGEX='' # libregex.a dnl find out the exe extension for this platform. dnl If it is not empty, use it for CGI as well. AC_EXEEXT AC_OBJEXT if test -z "$EXEEXT"; then CGIEXT=".cgi" else # automake automatically adds .exe when installing binaries CGIEXT="" fi AC_SUBST(CGIEXT) AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, [test "$squid_host_os" = "mingw" -o "$squid_host_os" = "cygwin"]) AM_CONDITIONAL(USE_IPC_WIN32,[test "$squid_host_os" = "mingw"]) if test $squid_host_os = "mingw"; then AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none) CFLAGS="$CFLAGS -mthreads" CXXFLAGS="$CXXFLAGS -mthreads" if test "$ac_cv_path_WIN32_PSAPI" = "none"; then AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform]) AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.]) else AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems]) LIBS="$LIBS -lpsapi" fi MINGW_LIBS="-lmingwex" AC_SUBST(MINGW_LIBS) fi if test -z "$CACHE_HTTP_PORT"; then CACHE_HTTP_PORT="3128" fi if test -z "$CACHE_ICP_PORT"; then CACHE_ICP_PORT="3130" fi dnl Substitutions AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT, [What default TCP port to use for HTTP listening?]) AC_SUBST(CACHE_HTTP_PORT) AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT, [What default UDP port to use for ICP listening?]) AC_SUBST(CACHE_ICP_PORT) AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure]) AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid]) CACHE_EFFECTIVE_USER="nobody" AC_ARG_WITH(default-user, AS_HELP_STRING([--with-default-user=USER],[System user account for squid permissions. Default: nobody]), [ CACHE_EFFECTIVE_USER="$withval" ] ) AC_SUBST(CACHE_EFFECTIVE_USER) DEFAULT_LOG_DIR="$localstatedir/logs" AC_ARG_WITH(logdir, AS_HELP_STRING([--with-logdir=PATH],[Default location for squid logs. default: $DEFAULT_LOG_DIR]), [ case $withval in yes|no) AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH ) ;; *) DEFAULT_LOG_DIR="$withval" ;; esac ] ) AC_SUBST(DEFAULT_LOG_DIR) DEFAULT_PIDFILE="$localstatedir/run/squid.pid" AC_ARG_WITH(pidfile, AS_HELP_STRING([--with-pidfile=PATH], [Default location for squid PID file. default: PREFIX/var/run/squid.pid]), [case $withval in yes|no) AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH ) ;; *) DEFAULT_PIDFILE="$withval" ;; esac ]) AC_SUBST(DEFAULT_PIDFILE) if test "$GCC" = "yes"; then GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'` GCCVER2=`echo $GCCVER | awk '{print $1 * 100}'` case "$host" in i386-*-freebsd*) if test $GCCVER2 -lt 300 ; then AC_MSG_FAILURE([GCC $GCCVER causes a coredump on $host. Try a more recent GCC version]) fi ;; esac unset GCCVER unset GCCVER2 fi dnl Set Default CFLAGS if test -z "$PRESET_CFLAGS"; then if test "$GCC" = "yes"; then case "$host" in *-sun-sunos*) # sunos has too many warnings for this to be useful # motorola too ;; *m88k*) # Motorola cc/ld does not like -02 but is ok on -O CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]/-O/'` ;; *) CFLAGS="$squid_cv_cc_option_wall $CFLAGS" ;; esac else case "$host" in *mips-sgi-irix6.*) # suggested by Rafael Seidl CFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \ -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \ -Wl,-woff,85,-woff,84,-woff,134 \ -nostdinc -I/usr/include -D_BSD_SIGNALS $CFLAGS" CXXFLAGS="$squid_cv_cc_option_optimize -OPT:Olimit=0:space=OFF \ -woff 1009,1014,1110,1116,1183,1185,1188,1204,1230,1233,1355 \ -Wl,-woff,85,-woff,84,-woff,134 \ -nostdinc -I/usr/include -D_BSD_SIGNALS $CXXFLAGS" ;; alpha-dec-osf4.*) # Mogul says DEC compilers take both -g and -O2 CFLAGS=`echo $CFLAGS | sed -e 's/-g/-g3/'` CFLAGS="$squid_cv_cc_option_optimize $CFLAGS" ;; *) ;; esac fi fi dnl set squid required flags if test "$GCC" = "yes"; then dnl Guido Serassio (serassio@squid-cache.org) 20070811 dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with dnl -Werror -Wmissing-prototypes -Wmissing-declarations dnl TODO: check if the problem will be present in any other newer MinGW release. case "$host_os" in mingw|mingw32) SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments" ;; *) SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments" ;; esac SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments" else SQUID_CFLAGS= SQUID_CXXFLAGS= fi if test "$squid_opt_enable_werror" = "no" then SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror" SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_option_werror" fi AC_SUBST(SQUID_CFLAGS) AC_SUBST(SQUID_CXXFLAGS) SQUID_CXX_CHECK_ARG_FHUGEOBJECTS if test "$squid_cv_cxx_arg_fhugeobjects" = "yes"; then SQUID_CXXFLAGS="$SQUID_CXXFLAGS -fhuge-objects" fi # squid_cv_cc_arg_pipe is set by SQUID_CC_GUESS_OPTIONS SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe" SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe" SquidInline="yes" AC_ARG_ENABLE(optimizations, AS_HELP_STRING([--disable-optimizations], [Do not compile Squid with compiler optimizations enabled. Optimization is good for production builds, but not good for debugging. During development, use --disable-optimizations to reduce compilation times and allow easier debugging. This option implicitly also enabled --disable-inline]), [ if test "$enableval" = "no" ; then AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)]) CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`" SquidInline="no" fi ]) AH_TEMPLATE(_USE_INLINE_,[Include inline methods into header file]) AC_ARG_ENABLE(inline, AS_HELP_STRING([--disable-inline], [Do not compile trivial methods as inline. Squid is coded with much of the code able to be inlined. Inlining is good for production builds, but not good for development. During development, use --disable-inline to reduce compilation times and allow incremental builds to be quick. For production builds, or load tests, use --enable-inline to have squid make all trivial methods inlinable by the compiler.]), [ if test "$enableval" = "no" ; then SquidInline="no" fi ]) if test "$SquidInline" = "yes" ; then AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods]) AC_DEFINE(_USE_INLINE_, 1 , [Include inline methods into header file]) else AC_MSG_NOTICE([Inlining optimization disabled]) AC_DEFINE(_SQUID_INLINE_,[], [Keyword used by squid for inlining methods]) fi AC_ARG_ENABLE(debug-cbdata, AS_HELP_STRING([--enable-debug-cbdata], [Provide some debug information in cbdata]), [ if test "$enableval" = "yes" ; then AC_MSG_NOTICE([cbdata debugging enabled]) AC_DEFINE(CBDATA_DEBUG,1, [Enable support for cbdata debug information]) fi ]) dnl Nasty hack to get autoconf 2.64 on Linux to run. dnl all other uses of RUN_IFELSE are wrapped inside CACHE_CHECK which breaks on 2.64 AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(int argc, char **argv) { return 0; } ]])],[],[],[]) dnl This is a developer only option.. developers know how to set defines dnl dnl AC_ARG_ENABLE(xmalloc-debug, dnl [ --enable-xmalloc-debug Do some simple malloc debugging], dnl [ if test "$enableval" = "yes" ; then dnl AC_MSG_NOTICE([malloc debugging enabled]) dnl AC_DEFINE(XMALLOC_DEBUG,1,[Define to do simple malloc debugging]) dnl fi dnl ]) dnl This is a developer only option.. developers know how to set defines dnl dnl AC_ARG_ENABLE(xmalloc-debug-trace, dnl [ --enable-xmalloc-debug-trace dnl Detailed trace of memory allocations], dnl [ if test "$enableval" = "yes" ; then dnl AC_MSG_NOTICE([malloc debug trace enabled]) dnl AC_DEFINE(XMALLOC_TRACE,1,[Define to have a detailed trace of memory allocations]) dnl AC_DEFINE(XMALLOC_DEBUG,1) dnl fi dnl ]) AH_TEMPLATE(XMALLOC_STATISTICS,[Define to have malloc statistics]) AC_ARG_ENABLE(xmalloc-statistics, AS_HELP_STRING([--enable-xmalloc-statistics], [Show malloc statistics in status page]), [ if test "$enableval" = "yes" ; then AC_MSG_NOTICE([malloc statistics enabled]) AC_DEFINE(XMALLOC_STATISTICS,1) fi ]) squid_opt_aufs_threads="" AC_ARG_WITH(aufs-threads, AS_HELP_STRING([--with-aufs-threads=N_THREADS], [Tune the number of worker threads for the aufs object store.]), [ case $withval in [[0-9]]*) squid_opt_aufs_threads=$withval ;; *) AC_MSG_ERROR(--with-aufs-threads expects a numeric argument) ;; esac ]) if test -n "$squid_opt_aufs_threads"; then AC_MSG_NOTICE([With $squid_opt_aufs_threads aufs threads]) AC_DEFINE_UNQUOTED(AUFS_IO_THREADS,$squid_opt_aufs_threads, [Defines how many threads aufs uses for I/O]) fi AC_ARG_WITH(dl, AS_HELP_STRING([--with-dl],[Use dynamic linking])) if test "$with_dl" = "yes"; then AC_MSG_NOTICE([With dl]) fi AC_MSG_CHECKING([for DiskIO modules to be enabled]) squid_disk_module_candidates="" squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules) AC_ARG_ENABLE(disk-io, AS_HELP_STRING([--enable-disk-io="list of modules"], [Build support for the list of disk I/O modules. Set without a value or omitted, all available modules will be built. See src/DiskIO for a list of available modules, or Programmers Guide section on DiskIO for details on how to build your custom disk module]), [ case $enableval in yes) ${TRUE} #do nothing, "auto" is ok ;; no) squid_opt_enable_diskio="no" ;; *) squid_opt_enable_diskio="yes" squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` " SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates]) ;; esac ]) # if requested to autodetect, find out what we have if test $squid_opt_enable_diskio = "auto"; then squid_opt_enable_diskio="yes" SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates]) fi AC_MSG_RESULT([${squid_disk_module_candidates:-none}]) SQUID_CHECK_EXISTING_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates]) SQUID_DEFINE_BOOL([USE_DISKIO],$squid_opt_enable_diskio, [DiskIO modules are expected to be available.]) dnl Some autoconf.h defines we might enable later... AC_ARG_WITH(pthreads,AS_HELP_STRING([--without-pthreads],[Disable POSIX Threads])) AC_ARG_WITH(aio, AS_HELP_STRING([--without-aio],[Do not use POSIX AIO. Default: auto-detect])) AH_TEMPLATE(USE_DISKIO_AIO, [Whether POSIX AIO support is needed. Automatic]) AH_TEMPLATE(USE_DISKIO_DISKTHREADS, [Whether pthreads support is needed. Automatic]) USE_AIOPS_WIN32=0 squid_opt_use_aio= squid_opt_use_diskthreads= AIOLIB= dnl Setup the module paths etc. DISK_LIBS= DISK_OS_LIBS= DISK_MODULES= DISK_LINKOBJS= for module in $squid_disk_module_candidates none; do # maybe not needed if test "$module" = "none"; then continue fi if ! test -d $srcdir/src/DiskIO/$module; then AC_MSG_ERROR(disk-io $module does not exist) fi case "$module" in DiskDaemon) AC_MSG_NOTICE([Enabling DiskDaemon DiskIO module]) DISK_LIBS="$DISK_LIBS libDiskDaemon.a" DISK_MODULES="$DISK_MODULES DiskDaemon" DISK_PROGRAMS="$DISK_PROGRAMS DiskIO/DiskDaemon/diskd" DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o" ;; DiskThreads) squid_opt_use_diskthreads="yes" LIBPTHREADS= SQUID_STATE_SAVE([diskthreads_state],[SQUID_CFLAGS SQUID_CXXFLAGS]) if test "$with_pthreads" != "no"; then dnl TODO: this needs to be extended to handle more systems and better dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html case "$squid_host_os" in mingw) USE_AIOPS_WIN32=1 AC_MSG_NOTICE([Windows threads support automatically enabled]) ;; freebsd) SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" if test "$GCC" = "yes" -a -z "$PRESET_LDFLAGS" ; then LDFLAGS="$LDFLAGS -pthread" fi ;; solaris) if test "$GCC" = "yes" ; then SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads" SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -pthreads" AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [ AC_MSG_NOTICE(pthread library required but cannot be found.) squid_opt_use_diskthreads="no" ]) else dnl test for -lpthread first. libc version is a stub apparently on Solaris. SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -lpthread" SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT -lpthread" AC_SEARCH_LIBS([pthread_create],[pthread thread],[ LIBPTHREADS="" #in LIBS ],[ AC_MSG_NOTICE(pthread library required but cannot be found.) squid_opt_use_diskthreads="no" ]) fi ;; *) SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT" SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT" AC_CHECK_LIB(pthread, pthread_create ,[LIBPTHREADS="-lpthread"], [ AC_MSG_NOTICE(pthread library required but cannot be found.) squid_opt_use_diskthreads="no" ]) ;; esac else AC_MSG_NOTICE([Native pthreads support manually disabled.]) squid_opt_use_diskthreads="no" fi if test "$squid_opt_use_diskthreads" = "yes" ; then AC_DEFINE(USE_DISKIO_DISKTHREADS, 1, [Whether pthreads support is needed. Automatic]) AC_MSG_NOTICE([Enabling DiskThreads DiskIO module]) DISK_LIBS="$DISK_LIBS libDiskThreads.a" DISK_OS_LIBS="$DISK_OS_LIBS $LIBPTHREADS" DISK_MODULES="$DISK_MODULES DiskThreads" DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/DiskThreads/DiskThreadsDiskIOModule.o" else AC_DEFINE(USE_DISKIO_DISKTHREADS, 0, [Whether pthreads support is needed. Automatic]) AC_MSG_NOTICE([Native pthreads support disabled. DiskThreads module automaticaly disabled.]) SQUID_STATE_ROLLBACK([diskthreads_state]) fi ;; AIO) dnl Check for POSIX AIO availability squid_opt_use_aio="yes" AIOLIB= if test "$with_aio" != "no"; then have_aio_header=no AC_CHECK_HEADERS(aio.h,[have_aio_header=yes]) dnl On some systems POSIX AIO functions are in librt dnl On some systems POSIX AIO functions are in libaio AC_CHECK_LIB(rt,aio_read,[AIOLIB="-lrt"],AC_CHECK_LIB(aio,aio_read,[AIOLIB="-laio"],[])) dnl Enable AIO if the library and headers are found if test "$AIOLIB" != "" && test "$have_aio_header" = "yes"; then AC_MSG_NOTICE([Native POSIX AIO support detected.]) squid_opt_use_aio="yes" else dnl Windows does things differently. We provide wrappers. dnl TODO: Windows really needs its own DiskIO module or its Overlaped IO case "$host_os" in mingw|mingw32) squid_opt_use_aio="yes" AC_MSG_NOTICE([Windows being built. Maybe-enable POSIX AIO.]) ;; *) AC_MSG_NOTICE([Native POSIX AIO support not detected. AIO automatically disabled.]) squid_opt_use_aio="no" ;; esac fi else AC_MSG_NOTICE([POSIX AIO support manually disabled.]) squid_opt_use_aio="no" fi dnl Use the POSIX AIO pieces if we actually need them. if test "$squid_opt_use_aio" = "yes" ; then AC_DEFINE(USE_DISKIO_AIO, 1, [Whether POSIX AIO support is needed. Automatic]) DISK_MODULES="$DISK_MODULES AIO" DISK_LIBS="$DISK_LIBS libAIO.a" DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/AIO/AIODiskIOModule.o" case "$host_os" in mingw|mingw32) USE_AIO_WIN32=1 AC_MSG_NOTICE([Replacing AIO DiskIO module with: Windows overlapped I/O support]) ;; *) AC_MSG_NOTICE([Enabling AIO DiskIO module]) DISK_OS_LIBS="$DISK_OS_LIBS $AIOLIB" ;; esac else AC_DEFINE(USE_DISKIO_AIO, 0, [Whether POSIX AIO support is needed. Automatic]) AC_MSG_NOTICE([AIO DiskIO Module disabled. Missing POSIX AIO support.]) fi ;; Blocking) AC_MSG_NOTICE([Enabling Blocking DiskIO module]) DISK_LIBS="$DISK_LIBS libBlocking.a" DISK_MODULES="$DISK_MODULES Blocking" DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/Blocking/BlockingDiskIOModule.o" ;; *) AC_MSG_NOTICE([Enabling $module DiskIO module]) DISK_LIBS="$DISK_LIBS lib${module}.a" DISK_MODULES="$DISK_MODULES ${module}" DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/${module}/${module}DiskIOModule.o" ;; esac done AC_MSG_NOTICE([IO Modules built: $DISK_MODULES]) AC_SUBST(DISK_MODULES) AC_SUBST(DISK_LIBS) AC_SUBST(DISK_PROGRAMS) AC_SUBST(DISK_LINKOBJS) AC_SUBST(DISK_OS_LIBS) AM_CONDITIONAL([USE_AIOPS_WIN32], [test "$USE_AIOPS_WIN32" = 1]) AM_CONDITIONAL([USE_AIO_WIN32], [test "$USE_AIO_WIN32" = 1]) dnl Check what Storage formats are wanted. dnl This version will error out with a message saying why if a required DiskIO is missing. squid_opt_enable_storeio=auto AC_ARG_ENABLE([storeio], AS_HELP_STRING([--enable-storeio="list of modules"], [Build support for the list of store I/O modules. The default is only to build the "ufs" module. See src/fs for a list of available modules, or Programmers Guide section for details on how to build your custom store module]), [ case $enableval in yes) squid_opt_enable_storeio=auto ;; no) squid_opt_enable_storeio=no ;; *) squid_opt_enable_storeio=yes squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" # ufs is really always needed as it has low-level routines # if it is a dupe it will be cleaned-up later squid_storeio_module_candidates="$squid_storeio_module_candidates ufs" ;; esac ]) if test "$squid_opt_enable_storeio" = "auto"; then squid_opt_enable_storeio=yes AC_MSG_CHECKING([for available StoreIO modules]) SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates]) # disable coss squid_storeio_module_candidates=`echo $squid_storeio_module_candidates|sed 's/coss//'` AC_MSG_RESULT([$squid_storeio_module_candidates]) fi SQUID_CLEANUP_MODULES_LIST([squid_storeio_module_candidates]) SQUID_CHECK_EXISTING_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates]) AC_MSG_NOTICE([Store modules built: $squid_storeio_module_candidates]) for fs in $squid_storeio_module_candidates none; do case "$fs" in diskd) if test "$squid_disk_module_candidates_Blocking" != "yes" -a \ "$squid_disk_module_candidates_DiskDaemon" != "yes" ; then AC_MSG_ERROR([Storage diskd module requires DiskIO module: Blocking or DiskDaemon]) fi ;; aufs) if test "$squid_disk_module_candidates_Blocking" != "yes" -a \ "$squid_disk_module_candidates_DiskThreads" != "yes" ; then AC_MSG_ERROR([Storage module aufs requires DiskIO module: Blocking or DiskThreads]) fi ;; coss) AC_MSG_WARN([COSS Support is not stable yet in Squid-3. Please do not use.]) if ! test "$squid_disk_module_candidates_AIO" = "yes"; then AC_MSG_ERROR([COSS requires POSIX AIO which is not available.]) fi dnl dnl Automake om MinGW needs explicit exe extension dnl for STORE_TESTS substition dnl STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT" ;; ufs) STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT" esac done dnl hack: need to define those even if not used in the build system to dnl make sure that global FS objects are linked to the squid binary. AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build") AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build") AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build") AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build") dnl got final squid_storeio_module_candidates, build library lists dnl This list will not be needed when each fs library has its own Makefile STORE_LIBS_TO_BUILD= dnl File system libraries to link executables with. dnl These are the same as STORE_LIBS_TO_BUILD, but with a path STORE_LIBS_TO_ADD= for fs in $squid_storeio_module_candidates; do STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la" STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la" SQUID_TOUPPER_VAR_CONTENTS([fs]) AC_DEFINE_UNQUOTED(HAVE_FS_${fs}, 1) done AC_SUBST(STORE_LIBS_TO_BUILD) AC_SUBST(STORE_LIBS_TO_ADD) AC_SUBST(STORE_TESTS) dnl At lest one removal policy is always needed. dnl 'lru' removal policy is currently hard-coded by name for tests dnl so we must set it as default. REPL_POLICIES="lru" AC_ARG_ENABLE(removal-policies, AS_HELP_STRING([--enable-removal-policies="list of policies"], [Build support for the list of removal policies. The default is only to build the "lru" module. See src/repl for a list of available modules, or Programmers Guide section 9.9 for details on how to build your custom policy]), [ case $enableval in yes) SQUID_LOOK_FOR_MODULES([$srcdir/src/repl],[REPL_POLICIES]) ;; no) ;; *) REPL_POLICIES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;; esac ]) if test -n "$REPL_POLICIES"; then SQUID_CHECK_EXISTING_MODULES([$srcdir/src/repl],[REPL_POLICIES]) AC_MSG_NOTICE([Removal policies to build: $REPL_POLICIES]) REPL_OBJS="repl/lib`echo $REPL_POLICIES|sed -e 's% %.a repl/lib%g'`.a" REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`" fi AC_SUBST(REPL_POLICIES) AC_SUBST(REPL_OBJS) AC_SUBST(REPL_LIBS) AM_CONDITIONAL(ENABLE_PINGER, false) AC_ARG_ENABLE(icmp, AS_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]), [ if test "$enableval" = "yes" ; then AC_MSG_NOTICE([ICMP enabled]) AC_DEFINE(USE_ICMP,1,[Define to use Squid ICMP and Network Measurement features (highly recommended!)]) AM_CONDITIONAL(ENABLE_PINGER, true) fi ]) AM_CONDITIONAL(USE_DELAY_POOLS, false) AC_ARG_ENABLE(delay-pools, AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]), [ if test "$enableval" = "yes" ; then AC_MSG_NOTICE([Delay pools enabled]) AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".]) AM_CONDITIONAL(USE_DELAY_POOLS, true,) fi ]) dnl disable generic/common adaptation support by default squid_opt_use_adaptation=no squid_opt_use_esi=yes AH_TEMPLATE([USE_SQUID_ESI], [Define to enable the ESI processor and Surrogate header support]) AC_ARG_ENABLE(esi, AS_HELP_STRING([--enable-esi], [Enable ESI for accelerators. Benefits from expat or libxml2. Enabling ESI will cause squid reverse proxies to be capable of the Edge Acceleration Specification (www.esi.org).]), [squid_opt_use_esi=$enableval], [squid_opt_use_esi=no]) HAVE_LIBEXPAT=0 EXPATLIB= HAVE_LIBXML2=0 XMLLIB= if test "$squid_opt_use_esi" = "yes" ; then AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.]) AC_DEFINE(USE_SQUID_ESI,1, [Compile the ESI processor and Surrogate header support]) else AC_MSG_NOTICE([Disabling ESI processor]) fi # ESI support libraries: expat AC_ARG_WITH(expat, AS_HELP_STRING([--without-expat],[Do not use expat for ESI. Default: auto-detect])) if test "$squid_opt_use_esi" = "yes" -a "$with_expat" != "no" ; then AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1]) AC_CHECK_HEADERS([expat.h]) AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library]) if test "$with_expat" = "yes" && test "$HAVE_LIBEXPAT" != "1" ; then AC_MSG_ERROR([Required library expat is not able to be found.]) fi fi AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect])) if test "$squid_opt_use_esi" = "yes" -a "$with_libxml2" != "no" ; then AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1]) dnl Find the main header and include path... AC_CHECK_HEADERS([libxml/parser.h], [], [ SAVED_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS" unset ac_cv_header_libxml_parser_h AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include=yes], []) CPPFLAGS="$SAVED_CPPFLAGS" ]) if test "x$ac_cv_libxml2_include" = "xyes"; then SQUID_CXXFLAGS="-I/usr/include/libxml2 $SQUID_CXXFLAGS" CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS" fi dnl Now that we know where to look find the other headers... AC_CHECK_HEADERS(libxml/HTMLparser.h libxml/HTMLtree.h) AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library]) if test "$with_libxml2" = "yes" && test "$HAVE_LIBXML2" != "1" ; then AC_MSG_ERROR([Required library libxml2 is not able to be found.]) fi fi AM_CONDITIONAL(USE_ESI, test "$squid_opt_use_esi" = "yes") AM_CONDITIONAL(HAVE_LIBEXPAT, test $HAVE_LIBEXPAT = 1) AC_SUBST(EXPATLIB) AM_CONDITIONAL(HAVE_LIBXML2, test $HAVE_LIBXML2 = 1) AC_SUBST(XMLLIB) # icap argument handling AC_ARG_ENABLE(icap-client, AS_HELP_STRING([--enable-icap-client],[Enable the ICAP client.]), [squid_opt_use_icap_client=$enableval], [squid_opt_use_icap_client=no]) SQUID_DEFINE_BOOL([ICAP_CLIENT],$squid_opt_use_icap_client, [Enable ICAP client features in Squid]) AM_CONDITIONAL(USE_ICAP_CLIENT, [test "$squid_opt_use_icap_client" = "yes" ]) if test "$squid_opt_use_icap_client" = "yes" ; then ICAP_LIBS="icap/libicap.la" squid_opt_use_adaptation=yes else ICAP_LIBS="" fi AC_SUBST(ICAP_LIBS) squid_opt_use_ecap=1 AC_MSG_CHECKING(whether to support eCAP) AC_ARG_ENABLE(ecap, AS_HELP_STRING([--enable-ecap],[support loadable content adaptation modules]), [ case "${enableval}" in yes|no) squid_opt_use_ecap=$enableval ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecap) ;; esac AC_MSG_RESULT([$squid_opt_use_ecap, explicitly]) ], [ squid_opt_use_ecap=no; AC_MSG_RESULT([$squid_opt_use_ecap, implicitly]) ] ) dnl Perform configuration consistency checks for eCAP ECAPLIB="" if test $squid_opt_use_ecap = yes; then dnl eCAP support requires loadable modules, which are enabled by default if test "$use_loadable_modules" != "yes" then AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]); fi dnl eCAP support requires libecap AC_CHECK_LIB([ecap], [main], [ECAPLIB="-lecap"], [AC_MSG_FAILURE([eCAP support requires libecap library, but no usable library was found])] ) fi AM_CONDITIONAL(USE_ECAP, test $squid_opt_use_ecap = yes) if test $squid_opt_use_ecap = yes; then AC_DEFINE(USE_ECAP,1,[Enable eCAP support]) ECAP_LIBS="ecap/libecap.la $ECAP_LIBS" squid_opt_use_adaptation=yes else AC_DEFINE(USE_ECAP,0,[Disable eCAP support]) ECAP_LIBS="" fi dnl convenience library AC_SUBST(ECAP_LIBS) dnl -lecap if needed AC_SUBST(ECAPLIB) dnl enable adaptation if requested by specific adaptation mechanisms AM_CONDITIONAL(USE_ADAPTATION, test $squid_opt_use_adaptation = yes) if test $squid_opt_use_adaptation = yes then AC_DEFINE(USE_ADAPTATION,1,[common adaptation support]) ADAPTATION_LIBS="adaptation/libadaptation.la" else AC_DEFINE(USE_ADAPTATION,0,[common adaptation support]) ADAPTATION_LIBS="" fi AC_SUBST(ADAPTATION_LIBS) dnl This is a developer only option. Developers know how to set defines dnl dnl AC_ARG_ENABLE(mem-gen-trace, dnl [ --enable-mem-gen-trace Do trace of memory stuff], dnl [ if test "$enableval" = "yes" ; then dnl AC_MSG_NOTICE([Memory trace (to file) enabled]) dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free]) dnl fi dnl ]) AC_ARG_ENABLE(useragent-log, AS_HELP_STRING([--enable-useragent-log], [Enable logging of User-Agent header]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-useragent-log: $enableval]) enable_useragent_log=$enableval ]) SQUID_DEFINE_BOOL(USE_USERAGENT_LOG,${enable_useragent_log:=no}, [If you want to log User-Agent request header values, define this.]) AC_MSG_NOTICE([User-Agent logging enabled: $enable_useragent_log]) AC_ARG_ENABLE(referer-log, AS_HELP_STRING([--enable-referer-log],[Enable logging of Referer header]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-referer-log: $enableval]) ]) SQUID_DEFINE_BOOL(USE_REFERER_LOG,${enable_referer_log:=no}, [If you want to log Referer request header values, define this. By default, they are written to referer.log in the Squid logdir. This feature is deprecated in favour of custom log formats]) AC_MSG_NOTICE([Referer logging enabled: $enable_referer_log]) AC_ARG_ENABLE(wccp, AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [ SQUID_YESNO([$enableval],[unrecognized argument to --disable-wccp: $enableval]) ]) SQUID_DEFINE_BOOL(USE_WCCP, ${enable_wccp:=yes}, [Define to enable WCCP]) AC_MSG_NOTICE([Web Cache Coordination Protocol enabled: $enable_wccp]) AC_ARG_ENABLE(wccpv2, AS_HELP_STRING([--disable-wccpv2], [Disable Web Cache Coordination V2 Protocol]), [ SQUID_YESNO([$enableval], [unrecognized argument to --disable-wccpv2: $enableval]) ]) SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes}, [Define to enable WCCP V2]) AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2]) AC_ARG_ENABLE(kill-parent-hack, AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-kill-parent-hack: $enableval]) ]) SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no}, [A dangerous feature which causes Squid to kill its parent process (presumably the RunCache script) upon receipt of SIGTERM or SIGINT. Deprecated, Use with caution.]) AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack]) AC_ARG_ENABLE(snmp, AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [ SQUID_YESNO([$enableval], [unrecognized argument to --disable-snmp: $enableval]) ]) SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes}, [Define to enable SNMP monitoring of Squid]) AM_CONDITIONAL(USE_SNMP, [test "$enable_snmp" = "yes"]) if test "$enable_snmp" = "yes"; then SNMPLIB='../snmplib/libsnmp.a' makesnmplib=snmplib fi AC_MSG_NOTICE([SNMP support enabled: $enable_snmp]) AC_SUBST(SNMPLIB) AC_SUBST(makesnmplib) AC_ARG_ENABLE(cachemgr-hostname, AS_HELP_STRING([--enable-cachemgr-hostname=hostname], [Make cachemgr.cgi default to this host. If unspecified, uses the name of the build-host]), [ case $enableval in yes) AC_DEFINE(CACHEMGR_HOSTNAME,[getfullhostname()], [If you are upset that the cachemgr.cgi form comes up with the hostname field blank, then define this to getfullhostname()]) AC_MSG_NOTICE([Cachemgr default hostname == host where cachemgr runs]) ;; no) : # Nothing to do.. ;; *) AC_DEFINE_UNQUOTED(CACHEMGR_HOSTNAME,"${enableval}") AC_MSG_NOTICE([Cachemgr default hostname set to ${enableval}]) ;; esac ]) AC_ARG_ENABLE(eui, AS_HELP_STRING([--disable-eui], [Enable use of ARP / MAC/ EUI (ether address)]), [ SQUID_YESNO([$enableval],[--disable-eui expects no arguments]) ]) if test ${enable_eui:=yes} = "yes" ; then case "$squid_host_os" in linux|solaris|freebsd|openbsd|netbsd) ${TRUE} ;; cygwin|mingw) EUILIB="-liphlpapi" ;; *) AC_MSG_WARN([EUI support probably will not work on host $host.]) ;; esac AC_CHECK_HEADERS( \ Iphlpapi.h \ net/if.h \ net/if_arp.h \ net/if_dl.h \ net/route.h \ netinet/if_ether.h \ sys/sockio.h \ sys/sysctl.h \ sys/ioctl.h \ ) fi AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui]) SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui, [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.]) AM_CONDITIONAL(USE_SQUID_EUI, [test "$enable_eui" = "yes" ]) AC_ARG_ENABLE(htcp, AS_HELP_STRING([--disable-htcp],[Disable HTCP protocol support]), [ SQUID_YESNO([$enableval], [unrecognized argument to --disable-htcp: $enableval]) ]) SQUID_DEFINE_BOOL([USE_HTCP],${enable_htcp:=yes}, [Define this to include code for the Hypertext Cache Protocol (HTCP)]) AM_CONDITIONAL(ENABLE_HTCP, [test "$enable_htcp" = "yes"]) AC_MSG_NOTICE([HTCP support enabled: $enable_htcp]) # SSL is not enabled by default. # Default is to use OpenSSL when available AC_ARG_ENABLE(ssl, AS_HELP_STRING([--enable-ssl], [Enable ssl gatewaying support using OpenSSL]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-ssl: $enableval]) ]) # USE_OPENSSL is AC_DEFINED later # default for ssl is set here if test ${enable_ssl:=no} = "yes" ; then if test "$squid_host_os" = "mingw" ; then SSLLIB='-lssleay32 -leay32 -lgdi32' else SSLLIB='-lssl -lcrypto' fi if test -z "$with_openssl"; then with_openssl=yes fi if test -z "$with_openssl"; then with_openssl=yes fi fi AM_CONDITIONAL(ENABLE_SSL,[ test $enable_ssl = "yes" ]) AC_MSG_NOTICE([SSL gatewaying support enabled: $enable_ssl]) dnl User may specify OpenSSL is needed from a non-standard location AC_ARG_WITH(openssl, AS_HELP_STRING([--with-openssl=PATH], [Compile with the OpenSSL libraries. The path to the OpenSSL development libraries and headers installation can be specified if outside of the system standard directories]), [ case "$with_openssl" in yes|no) : # Nothing special to do here ;; *) if test ! -d $withval ; then AC_MSG_ERROR([--with-openssl path does not point to a directory]) fi SSLLIBDIR="$with_openssl/lib" CPPFLAGS="-I$with_openssl/include $CPPFLAGS" with_openssl=yes esac ]) SQUID_DEFINE_BOOL(USE_SSL,$enable_ssl, [Define this to include code for SSL gatewaying support]) AC_MSG_NOTICE([Using OpenSSL MD5 implementation: ${with_openssl:=no}]) SQUID_DEFINE_BOOL(USE_OPENSSL,${with_openssl}, [Define this to make use of the OpenSSL libraries for MD5 calculation rather than Squid-supplied MD5 implementation or if building with SSL encryption]) if test "$enable_ssl" = "yes"; then if test -z "$SSLLIB"; then SSLLIB="-lcrypto" # for MD5 routines fi # This is a workaround for RedHat 9 brain damage.. if test -d /usr/kerberos/include && test -z "$SSLLIBDIR" && test -f /usr/include/openssl/kssl.h; then AC_MSG_NOTICE([OpenSSL depends on Kerberos]) SSLLIBDIR="/usr/kerberos/lib" CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" fi fi if test -n "$SSLLIBDIR"; then SSLLIB="-L$SSLLIBDIR $SSLLIB" fi AC_SUBST(SSLLIB) AC_ARG_ENABLE(forw-via-db, AS_HELP_STRING([--enable-forw-via-db],[Enable Forw/Via database]), [ SQUID_YESNO([$enableval],[unrecognized argument to --enable-forw-via-db: $enableval]) ]) SQUID_DEFINE_BOOL(USE_FORW_VIA_DB,${enable_forw_via_db:=no}, [Enable Forw/Via database]) AC_MSG_NOTICE([Forw/Via database enabled: $enable_forw_via_db]) AC_ARG_ENABLE(cache-digests, AS_HELP_STRING([--enable-cache-digests], [Use Cache Digests. See http://wiki.squid-cache.org/SquidFaq/CacheDigests]), [ SQUID_YESNO($enableval, [unrecognized argument to --enable-cache-digests: $enableval]) ]) SQUID_DEFINE_BOOL(USE_CACHE_DIGESTS,${enable_cache_digests:=no}, [Use Cache Digests for locating objects in neighbor caches.]) AC_MSG_NOTICE([Cache Digests enabled: $enable_cache_digests]) dnl Size of COSS memory buffer squid_opt_coss_membuf_size=1048576 AC_ARG_WITH(coss-membuf-size, AS_HELP_STRING([--with-coss-membuf-size=size], [COSS membuf size (default $squid_opt_coss_membuf_size bytes)]), [ case $withval in [[0-9]]*) squid_opt_coss_membuf_size=$withval ;; *) AC_MSG_ERROR([--with-coss-membuf-size expects a numeric argument]) ;; esac ]) AC_MSG_NOTICE([Setting COSS membuf size to $squid_opt_coss_membuf_size bytes]) AC_DEFINE_UNQUOTED(COSS_MEMBUF_SZ, $squid_opt_coss_membuf_size, [Default COSS membuf size]) ################################ # check for netio plugin stuff # ################################ dnl order of these options handling is relevant in case the user dnl supplies more than one --enable option. Options handled later dnl override those handled earlier for io loop method manual override AC_ARG_ENABLE(select, AS_HELP_STRING([--disable-select],[Disable select(2) support.]), [ SQUID_YESNO($enableval,[--disable-select takes no extra argument]) test $enableval = "yes" && squid_opt_io_loop_engine="select" ]) AC_MSG_NOTICE([enabling select syscall for net I/O: ${enable_select:=auto}]) AC_ARG_ENABLE(poll, AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]), [ SQUID_YESNO($enableval,[--disable-poll takes no extra argument]) test $enableval = "yes" && squid_opt_io_loop_engine="poll" ]) AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}]) # kqueue support is still experiemntal and unstable. Not enabled by default. AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue], [Enable kqueue(2) support (experimental).]), [ SQUID_YESNO($enableval,[--enable-kqueue takes no extra argument]) ]) if test ${enable_kqueue:=no} = "yes" ; then AC_CHECK_HEADERS([sys/event.h],[], [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ]) squid_opt_io_loop_engine="kqueue" fi AC_MSG_NOTICE([enabling kqueue for net I/O: $enable_kqueue]) dnl Enable epoll() AC_ARG_ENABLE(epoll, AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]), [ SQUID_YESNO($enableval,[--disable-epoll takes no extra argument]) test $enableval = "yes" && squid_opt_io_loop_engine="epoll" ]) AC_MSG_NOTICE([enabling epoll syscall for net I/O: ${enable_epoll:=auto}]) # auto-detect and verify epoll header and library present and working # logic mapping and loop method selection are performed later if test "$enable_epoll" != "no" ; then # check if libs are needed to support epoll # note: this code block seems quite generic. Could it be extracted # into a squid specific configure function? SQUID_STATE_SAVE(squid_epoll_state) AC_SEARCH_LIBS(epoll_ctl,[epoll]) if test "$ac_cv_search_epoll_ctl" = "no" ; then enable_epoll=no #disable. Needed code not found elif test "$ac_cv_search_epoll_ctl" = "none required" ; then EPOLL_LIBS="" else EPOLL_LIBS=$ac_cv_search_epoll_ctl fi AC_SUBST(EPOLL_LIBS) SQUID_STATE_ROLLBACK(squid_epoll_state) #de-pollute LIBS # epoll requires sys/epoll.h AC_CHECK_HEADERS([sys/epoll.h]) dnl Verify that epoll really works if test "x$ac_cv_search_epoll_ctl" != 'xno' ; then SQUID_CHECK_EPOLL fi if test "$enable_epoll" = "yes" -a "$squid_cv_epoll_works" = "no" ; then AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.]) fi fi AC_ARG_ENABLE(http-violations, AS_HELP_STRING([--disable-http-violations], [This allows you to remove code which is known to violate the HTTP protocol specification.]), [ SQUID_YESNO([$enableval], [unrecognized argument to --disable-http-violations: $enableval]) ]) SQUID_DEFINE_BOOL(HTTP_VIOLATIONS, ${enable_http_violations:=yes}, [Define to enable code which volates the HTTP standard specification]) AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations]) # IPFW Transparent Proxy AC_ARG_ENABLE(ipfw-transparent, AS_HELP_STRING([--enable-ipfw-transparent], [Enable Transparent Proxy support for systems using FreeBSD IPFW-style firewalling.]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-ipfw-transparent: $enableval]) ]) SQUID_DEFINE_BOOL(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no}, [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.]) AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent]) # IP-Filter Transparent Proxy AC_ARG_ENABLE(ipf-transparent, AS_HELP_STRING([--enable-ipf-transparent], [Enable Transparent Proxy support using IPFilter-style firewalling]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-ipf-transparent: $enableval]) ]) #will be AC_DEFINEd later, after checking for appropriate infrastructure #IPF currently broken. Default-disabled for now. AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=no}]) dnl Enable PF Transparent Proxy AC_ARG_ENABLE(pf-transparent, AS_HELP_STRING([--enable-pf-transparent], [Enable Transparent Proxy support for systems using PF network address redirection.]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-pf-transparent: $enableval]) ]) #will be AC_DEFINEd later, after checking for appropriate infrastructure AC_MSG_NOTICE([PF-based transparent proxying requested: ${enable_pf_transparent:=auto}]) # Linux Netfilter Transparent Proxy AC_ARG_ENABLE(linux-netfilter, AS_HELP_STRING([--enable-linux-netfilter], [Enable Transparent Proxy support for Linux (Netfilter)]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-linux-netfilter: $enableval]) ]) AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}]) #will be AC_DEFINEd later, after checking for appropriate infrastructure dnl Enable Large file support buildmodel="" squid_opt_enable_large_files=no AC_ARG_WITH(large-files, AS_HELP_STRING([--with-large-files],[Enable support for large files (logs etc).]), [ if test "x$withval" = "xyes"; then squid_opt_enable_large_files=yes fi ]) dnl UNIX Build environment dnl AS_HELP_STRING is not suited here because it cannot to specify newlines AC_ARG_WITH(build-environment, [ --with-build-environment=model The build environment to use. Normally one of POSIX_V6_ILP32_OFF32 32 bits POSIX_V6_ILP32_OFFBIG 32 bits with large file support POSIX_V6_LP64_OFF64 64 bits POSIX_V6_LPBIG_OFFBIG large pointers and files XBS5_ILP32_OFF32 32 bits (legacy) XBS5_ILP32_OFFBIG 32 bits with large file support (legacy) XBS5_LP64_OFF64 64 bits (legacy) XBS5_LPBIG_OFFBIG large pointers and files (legacy) default The default for your OS], [ case "$withval" in yes|no) AC_MSG_FAILURE([--with-build-environment expects a build environment string as used by getconf]) ;; *) buildmodel="$withval" ;; esac ]) if test "$squid_opt_enable_large_files" = "yes" -a -z "$buildmodel"; then 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 if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then buildmodel=$model break fi done if test -z "$buildmodel"; then AC_MSG_WARN([No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64]) fi fi case "$buildmodel" in default|"") if test "$squid_opt_enable_large_files" = "yes" ; then AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64]) CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS" CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS" fi ;; *) AC_MSG_NOTICE([Using $buildmodel build environment]) if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then : # All fine else AC_MSG_ERROR(Build environment $buildmodel not known to getconf.) fi CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS" CXXFLAGS="`getconf ${buildmodel}_CFLAGS` $CXXFLAGS" LIBS="`getconf ${buildmodel}_LIBS` $LIBS" LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS" if "$squid_host_os" = "solaris" ; then # On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and # for LDFLAGS -xarch=generic64, but: # "-Xa" is supported only by Sun cc, so we need to remove it when using gcc # For gcc "-xarch=generic64" must be replaced with "-m64" # The 'sun' define is needed by ipfilter includes, so we must remove "-Usun" if test "$GCC" = "yes"; then AC_MSG_NOTICE([Removing -Xa for gcc/g++ on $host]) CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`" CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Xa//'`" AC_MSG_NOTICE([Replacing -xarch=generic64 with -m64 for gcc/g++ on $host]) CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`" CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-xarch=generic64/-m64/'`" LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`" fi AC_MSG_NOTICE([Removing -Usun on $host]) CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`" CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Usun//'`" fi esac dnl Enable Leak Finding Functions squid_opt_enable_leakfinder=no AC_ARG_ENABLE(leakfinder, AS_HELP_STRING([--enable-leakfinder], [Enable Leak Finding code. Enabling this alone does nothing; you also have to modify the source code to use the leak finding functions. Probably Useful for hackers only.]), [ SQUID_YESNO([$enableval],[unrecognized argument to --enable-leakfinder: $enableval]) squid_opt_enable_leakfinder=$enableval ]) AC_MSG_NOTICE([Leak Finder enabled: $squid_opt_enable_leakfinder]) SQUID_DEFINE_BOOL(USE_LEAKFINDER,$squid_opt_enable_leakfinder, [Enable code for assisting in finding memory leaks. Not for the faint of heart]) AM_CONDITIONAL(MAKE_LEAKFINDER, [test "$squid_opt_enable_leakfinder" = "yes"]) squid_opt_follow_xff="yes" AC_ARG_ENABLE(follow-x-forwarded-for, AS_HELP_STRING([--enable-follow-x-forwarded-for],[Enable support for following the X-Forwarded-For HTTP header to try to find the IP address of the original or indirect client when a request has been forwarded through other proxies.]), [ SQUID_YESNO([$enableval],[unrecognized argument to --enable-follow-x-forwarded-for: $enableval]) squid_opt_follow_xff=$enableval ]) AC_MSG_NOTICE([Support for X-Forwarded-For enabled: $squid_opt_follow_xff]) SQUID_DEFINE_BOOL([FOLLOW_X_FORWARDED_FOR],$squid_opt_follow_xff, [Enable following X-Forwarded-For headers]) squid_opt_use_ident="yes" AC_ARG_ENABLE(ident-lookups, AS_HELP_STRING([--disable-ident-lookups], [Remove code that supports performing Ident (RFC 931) lookups.]), [ SQUID_YESNO([$enableval],[unrecognized argument to --disable-ident-lookups: $enableval]) squid_opt_use_ident=$enableval ]) AC_MSG_NOTICE([Support for Ident lookups enabled: $squid_opt_use_ident]) SQUID_DEFINE_BOOL(USE_IDENT,$squid_opt_use_ident,[Support for Ident (RFC 931) lookups]) squid_opt_use_dnsserver="no" AH_TEMPLATE(USE_DNSSERVERS, [Use dnsserver processes instead of the internal DNS protocol support]) AC_ARG_ENABLE(internal-dns, AS_HELP_STRING([--disable-internal-dns], [Prevents Squid from directly sending and receiving DNS messages, and instead enables the old external 'dnsserver' processes.]), [ if test "$enableval" = "no" ; then AC_MSG_WARN([Disabling Internal DNS queries]) squid_opt_use_dnsserver="yes" AC_DEFINE(USE_DNSSERVERS,1) else AC_DEFINE(USE_DNSSERVERS,0) fi ]) AM_CONDITIONAL([USE_DNSSERVER],[test "$squid_opt_use_dnsserver" = "yes" ]) dnl Select Default hosts file location AC_ARG_ENABLE(default-hostsfile, AS_HELP_STRING([--enable-default-hostsfile=path],[Select default location for hosts file. See hosts_file directive in squid.conf for details]), [ if test "$enableval" != "none" -a "$enableval" != "no" ; then if test -f $enableval; then OPT_DEFAULT_HOSTS=$enableval else AC_MSG_WARN([Unable to find $enableval]) fi else OPT_DEFAULT_HOSTS="none" fi AC_MSG_NOTICE([Default hosts file set to: $enableval]) ],[OPT_DEFAULT_HOSTS="/etc/hosts"]) AC_SUBST(OPT_DEFAULT_HOSTS) # Select auth schemes modules to build AC_ARG_ENABLE(auth, AS_HELP_STRING([--enable-auth], [Build global support for authentication. The list of schemes and helpers to be enabled is defined elsewhere]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-auth: $enableval]) ]) AC_MSG_NOTICE([Authentication support enabled: ${enable_auth:=yes}]) SQUID_DEFINE_BOOL([USE_AUTH],$enable_auth, [Enable support for authentication]) AUTH_MODULES="" AC_ARG_ENABLE(auth-basic, AS_HELP_STRING([--enable-auth-basic="list of helpers"], [Enable the basic authentication scheme, and build the specified helpers. Not providing an explicit list of helpers will attempt build of all possible helpers. Default is to do so. To disable the basic authentication scheme, use --disable-auth-basic. To enable but build no helpers, specify "none". To see available helpers, see the helpers/basic_auth directory. ]),[ #nothing to do really ]) #not specified. Inherit global if test "x$enable_auth_basic" = "x"; then enable_auth_basic=$enable_auth fi #conflicts with global if test "$enable_auth_basic" != "no" -a "$enable_auth" = "no" ; then AC_MSG_ERROR([Basic auth requested but auth disabled]) fi #define list of modules to build if test "$enable_auth_basic" = "yes" ; then SQUID_LOOK_FOR_MODULES([$srcdir/helpers/basic_auth],[enable_auth_basic]) fi #handle the "none" special case if test "x$enable_auth_basic" = "xnone" ; then enable_auth_basic="" fi BASIC_AUTH_HELPERS="" #enable_auth_basic contains either "no" or the list of modules to be built enable_auth_basic="`echo $enable_auth_basic| sed -e 's/,/ /g;s/ */ /g'`" if test "$enable_auth_basic" != "no" ; then AUTH_MODULES="$AUTH_MODULES basic" AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built]) for helper in $enable_auth_basic do dir="$srcdir/helpers/basic_auth/$helper" if test -f $dir/config.test && sh $dir/config.test "$@"; then BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS $helper" # special case if test "$helper" = "SASL" ; then squid_require_sasl=yes fi elif test -d $srcdir/helpers/basic_auth/$helper ; then AC_MSG_NOTICE([Basic auth helper $helper ... found but cannot be built]) fi done fi AC_MSG_NOTICE([Basic auth helpers to be built: $BASIC_AUTH_HELPERS]) AC_SUBST(BASIC_AUTH_HELPERS) AC_ARG_ENABLE(auth-ntlm, AS_HELP_STRING([--enable-auth-ntlm="list of helpers"], [Enable the NTLM authentication scheme, and build the specified helpers. Not providing an explicit list of helpers will attempt build of all possible helpers. Default is to do so. To disable the NTLM authentication scheme, use --disable-auth-ntlm. To enable but build no helpers, specify "none". To see available helpers, see the helpers/ntlm_auth directory. ]),[ ]) if test "x$enable_auth_ntlm" = "x"; then enable_auth_ntlm=$enable_auth fi #conflicts with global if test "x$enable_auth_ntlm" != "xno" -a "x$enable_auth" = "xno" ; then AC_MSG_ERROR([NTLM auth requested but auth disabled]) fi #define list of modules to build if test "x$enable_auth_ntlm" = "xyes" ; then SQUID_LOOK_FOR_MODULES([$srcdir/helpers/ntlm_auth],[enable_auth_ntlm]) fi #handle the "none" special case if test "x$enable_auth_ntlm" = "xnone" ; then enable_auth_ntlm="" fi NTLM_AUTH_HELPERS="" enable_auth_ntlm="`echo $enable_auth_ntlm| sed -e 's/,/ /g;s/ */ /g'`" if test "$enable_auth_ntlm" != "no" ; then AUTH_MODULES="$AUTH_MODULES ntlm" AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built]) for helper in $enable_auth_ntlm ; do dir="$srcdir/helpers/ntlm_auth/$helper" if test -f $dir/config.test && sh $dir/config.test "$@"; then NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper" elif test -d $srcdir/helpers/ntlm_auth/$helper ; then AC_MSG_NOTICE([NTLM auth helper $helper ... found but cannot be built]) fi done fi AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS]) AC_SUBST(NTLM_AUTH_HELPERS) AC_ARG_ENABLE(auth-negotiate, AS_HELP_STRING([--enable-auth-negotiate="list of helpers"], [Enable the Negotiate authentication scheme, and build the specified helpers. Not providing an explicit list of helpers will attempt build of all possible helpers. Default is to do so. To disable the Negotiate authentication scheme, use --disable-auth-negotiate. To enable but build no helpers, specify "none". To see available helpers, see the helpers/negotiate_auth directory. ]),[ #nothing to do, really ]) if test "x$enable_auth_negotiate" = "x"; then enable_auth_negotiate=$enable_auth fi #conflicts with global if test "x$enable_auth_negotiate" != "xno" -a "x$enable_auth" = "xno" ; then AC_MSG_ERROR([Negotiate auth requested but auth disabled]) fi #define list of modules to build if test "x$enable_auth_negotiate" = "xyes" ; then SQUID_LOOK_FOR_MODULES([$srcdir/helpers/negotiate_auth],[enable_auth_negotiate]) fi #handle the "none" special case if test "x$enable_auth_negotiate" = "xnone" ; then enable_auth_negotiate="" fi NEGOTIATE_AUTH_HELPERS="" enable_auth_negotiate="`echo $enable_auth_negotiate| sed -e 's/,/ /g;s/ */ /g'`" if test "$enable_auth_negotiate" != "no" ; then AUTH_MODULES="$AUTH_MODULES negotiate" AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built]) for helper in $enable_auth_negotiate ; do dir="$srcdir/helpers/negotiate_auth/$helper" if test -f $dir/config.test && sh $dir/config.test "$@"; then NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper" elif test -d $srcdir/helpers/negotiate_auth/$helper ; then AC_MSG_NOTICE([Negotiate auth helper $helper ... found but cannot be built]) fi done fi AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS]) AC_SUBST(NEGOTIATE_AUTH_HELPERS) AC_ARG_ENABLE(auth-digest, AS_HELP_STRING([--enable-auth-digest="list of helpers"], [Enable the Digest authentication scheme, and build the specified helpers. Not providing an explicit list of helpers will attempt build of all possible helpers. Default is to do so. To disable the Digest authentication scheme, use --disable-auth-digest. To enable but build no helpers, specify "none". To see available helpers, see the helpers/digest_auth directory. ]),[ #nothing to do, really ]) if test "x$enable_auth_digest" = "x"; then enable_auth_digest=$enable_auth fi #conflicts with global if test "x$enable_auth_digest" != "xno" -a "x$enable_auth" = "xno" ; then AC_MSG_ERROR([Digest auth requested but auth disabled]) fi #define list of modules to build if test "x$enable_auth_digest" = "xyes" ; then SQUID_LOOK_FOR_MODULES([$srcdir/helpers/digest_auth],[enable_auth_digest]) fi #handle the "none" special case if test "x$enable_auth_digest" = "xnone" ; then enable_auth_digest="" fi DIGEST_AUTH_HELPERS="" enable_auth_digest="`echo $enable_auth_digest| sed -e 's/,/ /g;s/ */ /g'`" if test "$enable_auth_digest" != "no" ; then AUTH_MODULES="$AUTH_MODULES digest" AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built]) for helper in $enable_auth_digest ; do dir="$srcdir/helpers/digest_auth/$helper" if test -f $dir/config.test && sh $dir/config.test "$@"; then DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper" elif test -d $srcdir/helpers/digest_auth/$helper ; then AC_MSG_NOTICE([Digest auth helper $helper ... found but cannot be built]) fi done fi AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS]) AC_SUBST(DIGEST_AUTH_HELPERS) dnl Authentication libraries to build dnl This list will not be needed when each auth library has its own Makefile dnl this is to be placed AFTER each auth module's handler AUTH_LIBS_TO_BUILD= for module in $AUTH_MODULES; do AUTH_LIBS_TO_BUILD="$AUTH_LIBS_TO_BUILD lib${module}.la" done AC_SUBST(AUTH_MODULES) AC_SUBST(AUTH_LIBS_TO_BUILD) dnl Select logging daemon helpers to build squid_opt_logdaemon_helpers="auto" AC_ARG_ENABLE(log-daemon-helpers, AS_HELP_STRING([--enable-log-daemon-helpers="list of helpers"], [This option selects which logging daemon helpers to build and install as part of the normal build process For a list of available helpers see the helpers/log_daemon directory.]),[ case "$enableval" in yes) : ;; no) squid_opt_logdaemon_helpers="" ;; *) squid_opt_logdaemon_helpers="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;; esac ]) if test "$squid_opt_logdaemon_helpers" = "auto" ; then squid_opt_logdaemon_helpers="" SQUID_LOOK_FOR_MODULES([$srcdir/helpers/log_daemon],[squid_opt_logdaemon_helpers]) fi for helper in $squid_opt_logdaemon_helpers ; do dir="$srcdir/helpers/log_daemon/$helper" if test -f $dir/config.test && sh $dir/config.test "$@"; then LOG_DAEMON_HELPERS="$LOG_DAEMON_HELPERS $helper" elif test -d $srcdir/helpers/log_daemon/$helper ; then AC_MSG_NOTICE([Log daemon helper $helper ... found but cannot be built]) fi done AC_MSG_NOTICE([Log daemon helpers built: $LOG_DAEMON_HELPERS]) AC_SUBST(LOG_DAEMON_HELPERS) dnl dnl Check Kerberos/GSSAPI/SPNEGO dnl SQUID_STATE_SAVE([krbsave]) AC_ARG_WITH(krb5-config, [ --with-krb5-config=PATH specify path to krb5-config @<:@default=detect@:>@], [ case "$withval" in yes) unset krb5confpath ;; no) krb5confpath=no ;; *) krb5confpath=$withval ;; esac ]) if test x"$krb5confpath" != xno; then if test x"$krb5confpath" != x; then if ! test -x "$krb5confpath"; then AC_MSG_WARN([krb5-config '$krb5confpath' not executable, ignoring]) AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no) krb5confpath=krb5-config fi krb5_config_path=`dirname $krb5confpath` AC_CHECK_PROG(ac_krb5_config, krb5-config, yes, no, $krb5_config_path) else AC_CHECK_PROG(ac_krb5_config,krb5-config,yes,no) krb5confpath=krb5-config fi fi if test "$ac_krb5_config" = "yes" ; then ac_heimdal="`$krb5confpath --version 2>/dev/null | grep -i heimdal`" ac_solaris="`$krb5confpath --version 2>/dev/null | grep -i solaris`" if test "x$ac_heimdal" != "x" ; then AC_DEFINE(HAVE_HEIMDAL_KERBEROS,1,[Define to 1 if you have Heimdal Kerberos]) else AC_DEFINE(HAVE_MIT_KERBEROS,1,[Define to 1 if you have MIT Kerberos]) fi if test "$ac_solaris" != "" ; then KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`" KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`" KRB5INCS="-I/usr/include/gssapi $KRB5INCS" KRB5LIBS="-L/usr/lib -R/usr/lib -lgss -lresolv -lsocket -lnsl $KRB5LIBS" else KRB5INCS="`$krb5confpath --cflags krb5 2>/dev/null`" KRB5LIBS="`$krb5confpath --libs krb5 2>/dev/null`" KRB5INCS="`$krb5confpath --cflags gssapi 2>/dev/null` $KRB5INCS" KRB5LIBS="`$krb5confpath --libs gssapi 2>/dev/null` $KRB5LIBS" fi CPPFLAGS="$CPPFLAGS $KRB5INCS" LIBS="$LIBS $KRB5LIBS" AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_krb5.h) if test "x$ac_heimdal" == "x" ; then AC_CHECK_HEADERS(gssapi/gssapi_generic.h) AC_CHECK_HEADERS(profile.h) fi AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h) SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H if test x"$squid_cv_broken_krb5_h" = x"yes"; then AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if krb5.h is broken for C++]) fi ac_com_error_message=no if test "x$ac_cv_header_com_err_h" == "xyes" ; then AC_EGREP_HEADER(error_message,com_err.h,ac_com_error_message=yes) elif test "x$ac_cv_header_et_com_err_h" == "xyes" ; then AC_EGREP_HEADER(error_message,et/com_err.h,ac_com_error_message=yes) fi SQUID_CHECK_MAX_SKEW_IN_KRB5_CONTEXT if test x"$squid_cv_max_skew_context" = x"yes"; then AC_DEFINE(HAVE_MAX_SKEW_IN_KRB5_CONTEXT, 1, [Define to 1 if max_skew in struct krb5_context]) fi if test `echo $KRB5LIBS | grep -c com_err` -ne 0 -a "x$ac_com_error_message" == "xyes" ; then AC_CHECK_LIB(com_err,error_message, AC_DEFINE(HAVE_ERROR_MESSAGE,1, [Define to 1 if you have error_message]),) elif test "x$ac_com_error_message" == "xyes" ; then AC_CHECK_LIB(krb5,error_message, AC_DEFINE(HAVE_ERROR_MESSAGE,1, [Define to 1 if you have error_message]),) fi AC_CHECK_LIB(krb5,krb5_get_err_text, AC_DEFINE(HAVE_KRB5_GET_ERR_TEXT,1, [Define to 1 if you have krb5_get_err_text]),) AC_CHECK_LIB(krb5,krb5_get_error_message, AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE,1, [Define to 1 if you have krb5_get_error_message]),) AC_CHECK_LIB(krb5,krb5_kt_free_entry, AC_DEFINE(HAVE_KRB5_KT_FREE_ENTRY,1, [Define to 1 if you have krb5_kt_free_entry]),) AC_CHECK_LIB(krb5,krb5_get_init_creds_keytab, AC_DEFINE(HAVE_GET_INIT_CREDS_KEYTAB,1, [Define to 1 if you have krb5_get_init_creds_keytab]),) AC_CHECK_LIB(krb5,krb5_get_max_time_skew, AC_DEFINE(HAVE_KRB5_GET_MAX_TIME_SKEW,1, [Define to 1 if you have krb5_get_max_time_skew]),) AC_CHECK_LIB(krb5,krb5_get_profile, AC_DEFINE(HAVE_KRB5_GET_PROFILE,1, [Define to 1 if you have krb5_get_profile]),) AC_CHECK_LIB(krb5,profile_get_integer, AC_DEFINE(HAVE_PROFILE_GET_INTEGER,1, [Define to 1 if you have profile_get_integer]),) AC_CHECK_LIB(krb5,profile_release, AC_DEFINE(HAVE_PROFILE_RELEASE,1, [Define to 1 if you have profile_release]),) SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE if test "$squid_cv_memory_cache" = "yes" ; then AC_DEFINE(HAVE_KRB5_MEMORY_CACHE,1, [Define to 1 if you have MEMORY: cache support]) fi SQUID_CHECK_WORKING_GSSAPI if test "$squid_cv_working_gssapi" = "yes" ; then AC_DEFINE(HAVE_GSSAPI, 1, [GSSAPI support]) fi SQUID_CHECK_SPNEGO_SUPPORT if test "$squid_cv_have_spnego" = "yes" ; then AC_DEFINE(HAVE_SPNEGO,1, [Define to 1 if you have SPNEGO support]) fi SQUID_CHECK_WORKING_KRB5 if test "$squid_cv_working_krb5" = "yes" ; then AC_DEFINE(HAVE_KRB5, 1, [KRB5 support]) fi AC_SUBST(KRB5INCS) AC_SUBST(KRB5LIBS) fi SQUID_STATE_ROLLBACK([krbsave]) AM_CONDITIONAL(HAVE_SPNEGO, test x"$squid_cv_have_spnego" = x"yes" ) dnl Enable "NTLM fail open" AC_ARG_ENABLE(ntlm-fail-open, AS_HELP_STRING([--enable-ntlm-fail-open], [Enable NTLM fail open, where a helper that fails one of the Authentication steps can allow squid to still authenticate the user. This has security implications, and is deprecated]), [ SQUID_YESNO([$enableval],[--enable-ntlm-fail-open takes no argument]) ]) SQUID_DEFINE_BOOL(NTLM_FAIL_OPEN,${enable_ntlm_fail_open:=no}, [Define if NTLM is allowed to fail gracefully when a helper has problems.]) AC_MSG_NOTICE([ntlm-fail-open enabled: $enable_ntlm_fail_open]) AC_ARG_ENABLE(external-acl-helpers, AS_HELP_STRING([--enable-external-acl-helpers="list of helpers"], [Enable external_acl helpers support and thelpers themselves. Default is to build all buildable helpers and enable support. To disable support, use --disable-external-acl-helpers. To build no helpers, specify "none". To see available helpers, see the helpers/external_acl directory]), [ #nothing to do, really ]) if test "x${enable_external_acl_helpers:=yes}" = "xyes" ;then SQUID_LOOK_FOR_MODULES([$srcdir/helpers/external_acl], [enable_external_acl_helpers]) fi if test "x$enable_external_acl_helpers" = "xnone" ; then enable_external_acl_helpers="" fi EXTERNAL_ACL_HELPERS="" enable_external_acl_helpers="`echo $enable_external_acl_helpers| sed -e 's/,/ /g;s/ */ /g'`" if test "x$enable_external_acl_helpers" != "xno" ; then for helper in $enable_external_acl_helpers ; do dir="$srcdir/helpers/external_acl/$helper" if test -f $dir/config.test && sh $dir/config.test "$@"; then EXTERNAL_ACL_HELPERS="$EXTERNAL_ACL_HELPERS $helper" else AC_MSG_NOTICE([external acl helper $helper ... found but cannot be built]) fi done fi AC_MSG_NOTICE([External acl helpers built: $EXTERNAL_ACL_HELPERS]) AC_SUBST(EXTERNAL_ACL_HELPERS) dnl Select url_rewrite helpers to build URL_REWRITE_HELPERS=all AC_ARG_ENABLE(url-rewrite-helpers, AC_HELP_STRING([--enable-url-rewrite-helpers="list of helpers"], [This option selects which url_rewrite helpers to build and install as part of the normal build process. For a list of available helpers see the helpers/url_rewrite directory.]), [ case "$enableval" in yes) URL_REWRITE_HELPERS=all ;; no) URL_REWRITE_HELPERS="" ;; *) URL_REWRITE_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" ;; esac ]) if test "$URL_REWRITE_HELPERS" = "all" ; then URL_REWRITE_HELPERS="" for dir in $srcdir/helpers/url_rewrite/*; do helper="`basename $dir`" if test -f $dir/config.test && sh $dir/config.test "$@"; then URL_REWRITE_HELPERS="$URL_REWRITE_HELPERS $helper" elif test -d $srcdir/helpers/url_rewrite/$helper ; then AC_MSG_NOTICE([URL re-write helper $helper ... found but cannot be built]) fi done fi if test -n "$URL_REWRITE_HELPERS"; then for helper in $URL_REWRITE_HELPERS; do if test -f $srcdir/helpers/url_rewrite/$helper/Makefile.in; then : else AC_MSG_ERROR(url_rewrite helper $helper does not exist) fi done AC_MSG_NOTICE([url_rewrite helpers built: $URL_REWRITE_HELPERS]) fi AC_SUBST(URL_REWRITE_HELPERS) AC_ARG_WITH(valgrind-debug, AS_HELP_STRING([--with-valgrind-debug], [Include debug instrumentation for use with valgrind]), [ case $withval in yes) valgrind=1 ;; no) valgrind= ;; *) CPPFLAGS="$CPPFLAGS -I${enableval}/include" valgrind=1 ;; esac if test $valgrind; then AC_CHECK_HEADERS(valgrind/memcheck.h, [ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support]) AC_MSG_NOTICE([Valgrind debug support enabled]) ], [ AC_MSG_WARN([Valgrind header not found. Valgrind support disabled.]) ] ) fi ]) dnl Disable "memPools" code #AC_ARG_ENABLE(chunkedmempools, # AS_HELP_STRING([--enable-chunkedmempools], # [Enable experimental chunked memPools. Note that this option # simply sets the default behaviour. Specific classes can override this # at runtime, and only lib/MemPool.c needs to be altered # to change the squid-wide default for all classes.]), [ #SQUID_YESNO([$enableval], # [--enable-chunkedmempools option takes no arguments]) #]) SQUID_DEFINE_BOOL(USE_CHUNKEDMEMPOOLS,${enable_chunkedmempools:=no}, [Enable chunked Memory Pools support (experimental)]) #AC_MSG_NOTICE([Chunked MemPools enabled: $enable_chunkedmempools]) dnl Enable WIN32 Service compile mode AC_ARG_ENABLE(win32-service, AS_HELP_STRING([--enable-win32-service], [Compile Squid as a WIN32 Service. Works only on MS-Windows platforms]), [ if test "$enableval" = "yes" ; then AC_MSG_NOTICE([Enabling WIN32 run service mode]) AC_DEFINE(USE_WIN32_SERVICE,1, [Define Windows NT & Windows 2000 run service mode]) fi ]) # Check for Cyrus SASL if test "$squid_require_sasl" = "yes"; then AC_CHECK_HEADERS(sasl/sasl.h sasl.h) AC_CHECK_LIB(sasl2,sasl_errstring,[LIBSASL="-lsasl2"],[ AC_CHECK_LIB(sasl,sasl_errstring,[LIBSASL="-lsasl"], [ AC_MSG_ERROR(Neither SASL nor SASL2 found) ]) ]) AC_SUBST(LIBSASL) fi # Disable "unlinkd" code AC_ARG_ENABLE(unlinkd, AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [ SQUID_YESNO([$enableval], [unrecognized argument to --disable-unlinkd: $enableval]) ]) SQUID_DEFINE_BOOL([USE_UNLINKD],${enable_unlinkd:=yes}, [Enable useage of unlinkd]) AM_CONDITIONAL(ENABLE_UNLINKD,test "$enable_unlinkd" = "yes") AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd]) # Enable backtraces on fatal errors AC_ARG_ENABLE(stacktraces, AS_HELP_STRING([--enable-stacktraces], [Enable automatic call backtrace on fatal errors]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-stacktraces: $enableval]) ]) SQUID_DEFINE_BOOL([PRINT_STACK_TRACE],${enable_stacktraces:=no}, [Print stack traces on fatal errors]) AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces]) # CPU Profiling options handling AC_ARG_ENABLE(cpu-profiling, AS_HELP_STRING([--enable-cpu-profiling], [Enable instrumentation to try and understand how CPU power is spent by squid, by enabling specific probes in selected functions. New probes can only be added by modifying the source code. It is meant to help developers in optimizing performance of Squid internal functions. If you are not developer you should not enable this, as it slows squid down somewhat. See lib/Profiler.c for more details.]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-cpu-profiling: $enableval]) ]) SQUID_DEFINE_BOOL([USE_XPROF_STATS],${enable_cpu_profiling:=no}, [Define to enable CPU profiling within Squid]) AM_CONDITIONAL(ENABLE_XPROF_STATS, test $enable_cpu_profiling = "yes") AC_MSG_NOTICE([CPU profiling enabled: $enable_cpu_profiling]) # Enable X-Accelerator-Vary for Vary support within an accelerator setup AC_ARG_ENABLE(x-accelerator-vary, AS_HELP_STRING([--enable-x-accelerator-vary], [Enable support for the X-Accelerator-Vary HTTP header. Can be used to indicate variance within an accelerator setup. Typically used together with other code that adds custom HTTP headers to the requests.]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-x-accelerator-vary: $enableval]) ]) SQUID_DEFINE_BOOL([X_ACCELERATOR_VARY],${enable_x_accelerator_vary:=no}, [Enable support for the X-Accelerator-Vary HTTP header]) AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary]) AC_ARG_ENABLE(zph-qos, AS_HELP_STRING([--enable-zph-qos],[Enable ZPH QOS support]), [ SQUID_YESNO([$enableval], [unrecognized argument to --enable-zph-qos: $enableval]) ]) SQUID_DEFINE_BOOL([USE_ZPH_QOS],${enable_zph_qos:=no}, [Enable Zero Penalty Hit QOS. When set, Squid will alter the TOS field of HIT responses to help policing network traffic]) AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos]) dnl --with-maxfd present for compatibility with Squid-2. dnl undocumented in ./configure --help to encourage using the Squid-3 directive. AC_ARG_WITH(maxfd,, [ case ${withval} in [[0-9]]*) squid_filedescriptors_num=$withval ;; *) AC_MSG_ERROR(--with-maxfd expects a numeric argument) ;; esac ]) AC_ARG_WITH(filedescriptors, AS_HELP_STRING([--with-filedescriptors=NUMBER],[Force squid to support NUMBER filedescriptors]), [ case ${withval} in [[0-9]]*) squid_filedescriptors_num=$withval ;; *) AC_MSG_ERROR(--with-filedescriptors expects a numeric argument) ;; esac ]) if $CPPUNITCONFIG --help >/dev/null; then squid_cv_cppunit_version="`$CPPUNITCONFIG --version`" AC_MSG_NOTICE([using system installed cppunit version $squid_cv_cppunit_version]) unset squid_cv_cppunit_version SQUID_CPPUNIT_LIBS="`$CPPUNITCONFIG --libs`" SQUID_CPPUNIT_LA='' SQUID_CPPUNIT_INC="`$CPPUNITCONFIG --cflags`" else AC_MSG_WARN([cppunit does not appear to be installed. squid does not require this, but code testing with 'make check' will fail.]) SQUID_CPPUNIT_LA='' SQUID_CPPUNIT_LIBS='' SQUID_CPPUNIT_INC='' fi AC_ARG_WITH(cppunit-basedir, AS_HELP_STRING([--with-cppunit-basedir=PATH],[Path where the cppunit headers are libraries are found for unit testing.]), [ if test -f $withval/include/cppunit/TestCase.h; then AC_MSG_NOTICE([Using cppunit includes from $withval]) SQUID_CPPUNIT_INC="-I${withval}/include" else AC_MSG_ERROR(Cannot find cppunit at $withval) fi if test -f $withval/lib/libcppunit.la; then AC_MSG_NOTICE([Using cppunit lib from $withval]) SQUID_CPPUNIT_LA="${withval}/lib/libcppunit.la" SQUID_CPPUNIT_LIBS='$(SQUID_CPPUNIT_LA)' else AC_MSG_ERROR(Cannot find cppunit at $withval) fi ]) AC_SUBST(SQUID_CPPUNIT_LIBS) AC_SUBST(SQUID_CPPUNIT_LA) AC_SUBST(SQUID_CPPUNIT_INC) # Force some compilers to use ANSI features # case "$host" in alpha-dec-osf*) if test "$ac_cv_prog_CC" = "cc" ; then AC_MSG_NOTICE([adding '-std1' to cc args for $host]) CC="cc -std1"; ac_cv_prog_CC="$CC" fi ;; *-hp-hpux*) if test "$ac_cv_prog_CC" = "cc" ; then AC_MSG_NOTICE([adding '-Ae' to cc args for $host]) CC="cc -Ae"; ac_cv_prog_CC="$CC" fi ;; esac dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE) case "$host" in *-hp-hpux*) AC_MSG_NOTICE([Disabling ranlib for HP-UX...]) RANLIB=":" ;; esac dnl Check for headers AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS( \ arpa/inet.h \ arpa/nameser.h \ assert.h \ bstring.h \ cassert \ crypt.h \ cstring \ ctype.h \ errno.h \ execinfo.h \ fcntl.h \ fnmatch.h \ getopt.h \ glob.h \ gnumalloc.h \ grp.h \ iosfwd \ iomanip \ iostream \ ip_compat.h \ ip_fil_compat.h \ ip_fil.h \ ip_nat.h \ ipl.h \ libc.h \ limits.h \ linux/posix_types.h \ linux/types.h \ machine/byte_swap.h \ malloc.h \ map \ math.h \ memory.h \ mount.h \ netdb.h \ netinet/in.h \ netinet/in_systm.h \ netinet/ip_fil_compat.h \ openssl/err.h \ openssl/md5.h \ openssl/ssl.h \ openssl/x509v3.h \ netinet/tcp.h \ openssl/engine.h \ ostream \ paths.h \ poll.h \ pwd.h \ shadow.h \ regex.h \ sched.h \ security/pam_appl.h \ signal.h \ sstream \ stdarg.h \ stddef.h \ stdexcept \ stdio.h \ stdlib.h \ string \ string.h \ strings.h \ sys/bitypes.h \ sys/bswap.h \ sys/endian.h \ sys/file.h \ sys/ioctl.h \ sys/param.h \ sys/prctl.h \ sys/md5.h \ sys/msg.h \ sys/resource.h \ sys/select.h\ sys/socket.h \ sys/stat.h \ sys/statvfs.h \ syscall.h \ sys/syscall.h \ sys/time.h \ sys/types.h \ sys/un.h \ sys/vfs.h \ sys/wait.h \ syslog.h \ time.h \ unistd.h \ utime.h \ varargs.h \ byteswap.h \ glib.h \ stdint.h \ inttypes.h \ grp.h \ db.h \ db_185.h ) CHECK_STRUCT_PAM_CONV AC_CHECK_HEADERS( linux/netfilter_ipv4.h ,,, SQUID_DEFAULT_INCLUDES #if HAVE_LIMITS_H #include #endif /* Netfilter ip(6)tables v1.4.0 has broken headers */ #if HAVE_NETINET_IN_H #include #endif ) dnl *BSD dont include the depenencies for all their net/ and netinet/ files dnl We must include a few basic type headers for them to work. AC_CHECK_HEADERS( \ net/if.h \ netinet/if_ether.h\ netinet/icmp6.h \ netinet/in.h \ netinet/ip.h \ netinet/ip6.h \ netinet/ip_compat.h\ netinet/ip_fil_compat.h\ netinet/ip_fil.h\ netinet/ip_icmp.h \ netinet/ipl.h \ netinet/ip_nat.h\ net/pf/pfvar.h \ net/pfvar.h \ sys/mount.h\ resolv.h \ ,,, SQUID_BSDNET_INCLUDES) AC_C_CONST AC_C_BIGENDIAN AC_STRUCT_TM AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[ #if TM_IN_SYS_TIME #if HAVE_SYS_TIME_H #include #endif #elif HAVE_TIME_H #include #endif ]) AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_MALLOC_H #include #endif]) AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_MALLOC_H #include #endif]) dnl Override rusage() detect on MinGW because is emulated in source code case "$host_os" in mingw|mingw32) AC_DEFINE(HAVE_STRUCT_RUSAGE) ac_cv_func_getrusage='yes' AC_MSG_NOTICE([Using own rusage on Windows.]) ;; *) AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[ #if HAVE_SYS_TIME_H #include #endif #if HAVE_SYS_RESOURCE_H #include #endif]) ;; esac AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[ #if HAVE_SYS_TYPES_H #include #endif #include #include #include #if defined (__linux__) || defined (__CYGWIN__) #define ip_hl ihl #endif #ifndef __linux__ #ifndef __CYGWIN__ #define iphdr ip #endif #endif]) dnl Check for typedefs AC_CHECK_SIZEOF(void *) dnl 8 bit integers - int8_t dnl if this is defined we trust it to be 8 bits AC_CHECK_TYPE(int8_t,[ AC_CHECK_SIZEOF(int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_INT8_T,1,[int8_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #1 AC_CHECK_TYPE(char,[ AC_CHECK_SIZEOF(char,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_CHAR,1,[char is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl unsigned 8 bit ints - u_int8_t dnl if this is defined we trust it to be 8 bits AC_CHECK_TYPE(u_int8_t,[ AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #1 dnl if this is defined we trust it to be 8 bits AC_CHECK_TYPE(uint8_t,[ AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl 16 bit integers - int16_t dnl if this is defined we trust it to be 16 bits AC_CHECK_TYPE(int16_t,[ AC_CHECK_SIZEOF(int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_INT16_T,1,[int16_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #1 AC_CHECK_TYPE(short,[ AC_CHECK_SIZEOF(short,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_SHORT,1,[short is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #2 AC_CHECK_TYPE(int,[ AC_CHECK_SIZEOF(int,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_INT,1,[int is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl unsigned 16 bit ints - u_int16_t dnl if this is defined we trust it to be 16 bits AC_CHECK_TYPE(u_int16_t,[ AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #1 dnl if this is defined we trust it to be 16 bits AC_CHECK_TYPE(uint16_t,[ AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl 32 bit signed int - int32_t dnl if this is defined we trust it to be 32 bits AC_CHECK_TYPE(int32_t,[ AC_CHECK_SIZEOF(int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_INT32_T,1,[int32_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #1 AC_CHECK_TYPE(long,[ AC_CHECK_SIZEOF(long,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_LONG,1,[long is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl 32 bit unsigned int - u_int32_t dnl if this is defined we trust it to be 32 bits AC_CHECK_TYPE(u_int32_t,[ AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #1 dnl if this is defined we trust it to be 32 bits AC_CHECK_TYPE(uint32_t,[ AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl 64 bit signed - int64_t dnl if this is defind we trust it to be 64 bits AC_CHECK_TYPE(int64_t,[ AC_CHECK_SIZEOF(int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_INT64_T,1,[int64_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #1 dnl if this is defind we trust it to be 64 bits AC_CHECK_TYPE(__int64,[ AC_CHECK_SIZEOF(__int64,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE___INT64,1,[__int64 is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #2 AC_CHECK_TYPE(long long,[ AC_CHECK_SIZEOF(long long,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_LONG_LONG,1,[long long is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl 64 bit unsigned - u_int64_t dnl if this is defind we trust it to be 64 bits AC_CHECK_TYPE(u_int64_t,[ AC_CHECK_SIZEOF(u_int64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl fallback #1 dnl if this is defind we trust it to be 64 bits AC_CHECK_TYPE(uint64_t,[ AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_UINT64_T,1,[uint64_t is defined in system headers]) ],,SQUID_DEFAULT_INCLUDES) dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files dnl that is incompatible with the updated Solaris header files. dnl For this reason, we must check if pad128_t and upad128_t are defined. AC_CHECK_TYPE(pad128_t, AC_DEFINE(HAVE_PAD128_T,1,[pad128_t is defined in system headers]), ,SQUID_DEFAULT_INCLUDES) AC_CHECK_TYPE(upad128_t, AC_DEFINE(HAVE_UPAD128_T,1,[upad128_t is defined in system headers]), ,SQUID_DEFAULT_INCLUDES) AC_CHECK_TYPE(pid_t, AC_DEFINE(HAVE_PID_T,1,[pid_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_SIZE_T,1,[size_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES) AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T,1,[ssize_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) AC_CHECK_TYPE(off_t,[ AC_CHECK_SIZEOF(off_t,,SQUID_DEFAULT_SIZEOF_INCLUDES) AC_DEFINE(HAVE_OFF_T,1,[off_t is defined by the system headers])],,SQUID_DEFAULT_INCLUDES) AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) AC_CHECK_TYPE(fd_mask, AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES) dnl Check for special functions AC_FUNC_ALLOCA AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[ #include #include #if STDC_HEADERS #include #include #endif]) dnl Check for libcap header (assume its not broken unless use_libcap=auto AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],[disable usage of Linux capabilities library to control privileges]), [ if test "x$withval" = "xyes" ; then AC_MSG_RESULT(libcap forced enabled) use_libcap=yes else AC_MSG_RESULT(libcap forced disabled) use_libcap=no fi ]) if test "x$use_libcap" != "xno"; then # cap_clear_flag is the most recent libcap function we require AC_CHECK_LIB(cap, cap_clear_flag) if test "x$ac_cv_lib_cap_cap_clear_flag" = xyes; then use_libcap=yes else if test "x$use_libcap" = "xyes"; then AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later]) fi use_libcap=no fi fi if test "x$use_libcap" = "xyes"; then AC_DEFINE(USE_LIBCAP, 1, [use libcap to set capabilities required for TPROXY]) dnl Check for libcap headader breakage. AC_CHECK_HEADERS(sys/capability.h) AC_CACHE_CHECK([for operational libcap2 headers], squid_cv_sys_capability_works, AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ capget(NULL, NULL); capset(NULL, NULL); ]])],[squid_cv_sys_capability_works=yes],[squid_cv_sys_capability_works=no]) ) if test x$squid_cv_sys_capability_works != xyes; then AC_DEFINE([LIBCAP_BROKEN],1,[if libcap2 headers are broken and clashing with glibc]) fi fi AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include #include #include ]) dnl Check for needed libraries AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind]) AC_SEARCH_LIBS([res_init],[resolv]) AC_SEARCH_LIBS([bind],[socket]) AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack]) AC_SEARCH_LIBS([strlcpy], [bsd]) AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus]) dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API case "$host_os" in mingw|mingw32) AC_MSG_CHECKING(for winsock) save_LIBS="$LIBS" for curlib in ws2_32 wsock32; do LIBS="$LIBS -l$curlib" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ socket(0,0,0); select(0,NULL,NULL,NULL,NULL); closesocket(0); gethostname(NULL,0); ]])],[have_winsock=yes],[have_winsock=no]) if test $have_winsock = yes; then ac_cv_func_select='yes' if test $curlib = ws2_32; then have_winsock=winsock2 fi break fi LIBS="$save_LIBS" done AC_MSG_RESULT($have_winsock) if test $have_winsock = winsock2; then AC_CHECK_HEADERS(winsock2.h) else AC_CHECK_HEADERS(winsock.h) fi ;; esac dnl Ripped from the Samba sources AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include #include ]], [[ struct sockaddr_un sunaddr; sunaddr.sun_family = AF_UNIX; ]])],[squid_cv_unixsocket=yes],[squid_cv_unixsocket=no])]) if test x"$squid_cv_unixsocket" = x"yes"; then AC_DEFINE(HAVE_UNIXSOCKET,1,[Do we have unix sockets? (required for the winbind ntlm helper]) fi dnl end rip AC_CHECK_LIB(gnumalloc, main) if test "$ac_cv_lib_gnumalloc_main" = "yes"; then AC_MSG_NOTICE([Disabling extended malloc functions when using gnumalloc]) ac_cv_func_mallinfo=no ac_cv_func_mallocblksize=no ac_cv_func_mallopt=no else case "$host" in *-sun-solaris*) AC_MSG_NOTICE([skipping libmalloc check for $host]) ;; i386-*-freebsd*) AC_MSG_NOTICE([skipping libmalloc check for $host]) ;; *) AC_CHECK_LIB(malloc, main) ;; esac fi AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"]) case "$host_os" in mingw|mingw32) AC_MSG_NOTICE([Use MSVCRT for math functions.]) ;; *) dnl rint() is only used in old C code for now. AC_LANG_PUSH([C]) AC_SEARCH_LIBS([rint],[m]) AC_LANG_POP([C]) ;; esac dnl Enable IPv6 support AC_MSG_CHECKING([whether to enable IPv6]) use_ipng=auto AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), [ case $enableval in yes|no) use_ipng=$enableval ;; *) ;; esac ]) AC_MSG_RESULT($use_ipng) if test "$use_ipng" != "no"; then SAVED_LIBS="$LIBS" dnl Solaris 10/11 requires -lsocket case "$host" in *-solaris*) LIBS="$LIBS -lsocket" ;; *) ;; esac AC_CACHE_CHECK([if PF_INET6 is available], squid_cv_pf_inet6, AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* PF_INET6 available check */ # include # include int main(int argc, char **argv) { if (socket(PF_INET6, SOCK_STREAM, 0) < 0) return 1; else return 0; } ]])],[squid_cv_pf_inet6="yes" ; SAVED_LIBS="$LIBS"],[squid_cv_pf_inet6="no"],[]) ) LIBS="$SAVED_LIBS" fi # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system. # unless --enable-ipv6 is explicitly used. in which case it's a hard fail. if test "x$use_ipng" = "xyes" && test "x$squid_cv_pf_inet6" = "xno"; then AC_MSG_ERROR([IPv6 cannot be built on this system. Basic kernel definitions are missing.]) elif test "x$use_ipng" = "xauto" && test "x$squid_cv_pf_inet6" = "xno"; then AC_MSG_WARN([IPv6 cannot be built on this system. Basic kernel definitions are missing.]) fi if test "$use_ipng" != "no" && test "$squid_cv_pf_inet6" = "yes" ; then AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ]) SET_IPV6_SETTINGS="" use_v4mapped=yes dnl Check for forced split-stack mode AC_MSG_CHECKING([for IPv6 split-stack requirement]) AC_ARG_WITH(ipv6-split-stack, AS_HELP_STRING([--with-ipv6-split-stack],[Force-Enable experimental split-stack support for Windows XP and *BSD. Requires IPv6.]), [ use_v4mapped="no" AC_MSG_RESULT(yes)], [ AC_MSG_RESULT(no) ]) dnl Check for IPv6 v4-mapping availability dnl Useful for other OS with hybrid-stack defaults turned OFF dnl But only usable if it actually works... if test "$use_v4mapped" = "yes" ; then AC_MSG_CHECKING([for IPv6 v4-mapping ability]) AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* IPPROTO_V4MAPPED is usable check */ # include # include # include #if HAVE_NETINET_IN6_H # include #endif int main(int argc, char **argv) { int s = socket(PF_INET6, SOCK_STREAM, 0); int tos = 0; if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &tos, sizeof(int)) < 0) return 1; else return 0; } ]])],[ AC_MSG_RESULT(yes) use_v4mapped=yes AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets]) ],[ AC_MSG_RESULT(no) AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets]) use_v4mapped=no ],[]) fi dnl if we can't defer v4-mapping to the OS we are forced to split-stack dnl the FD table. AC_MSG_CHECKING([for IPv6 stack type/mode]) if test "$use_v4mapped" = "yes"; then AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.]) AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(mapping hybrid) else AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.]) AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(split-stack or BSD non-mapping dual-stack) fi dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6], ac_cv_have_sin6_len_in_struct_sai, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ 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" ]) ]) if test "x$ac_cv_have_sin6_len_in_struct_sai" = "xyes" ; then AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 1, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No]) else AC_DEFINE(HAVE_SIN6_LEN_IN_SAI, 0, [Does struct sockaddr_in6 have sin6_len? 1: Yes, 0: No]) fi else # IPv6 is not available, but is not explicitly required. Auto-Disable. AC_DEFINE(USE_IPV6,0,[Enable support for IPv6]) AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations]) AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets]) SET_IPV6_SETTINGS="\#IPv6 Not Available: " fi AC_SUBST(SET_IPV6_SETTINGS) dnl Check whether this OS defines ss_len as a member of sockaddr_storage AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage], ac_cv_have_ss_len_in_struct_ss, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ 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" ]) ]) if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No]) else AC_DEFINE(HAVE_SS_LEN_IN_SS, 0, [Does struct sockaddr_storage have ss_len? 1: Yes, 0: No]) fi dnl Check whether this OS defines sin_len as a member of sockaddr_in as a backup to ss_len AC_CACHE_CHECK([for sin_len field in struct sockaddr_in], ac_cv_have_sin_len_in_struct_sai, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ 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" ]) ]) if test "x$ac_cv_have_sin_len_in_struct_sai" = "xyes" ; then AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 1, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No]) else AC_DEFINE(HAVE_SIN_LEN_IN_SAI, 0, [Does struct sockaddr_in have sin_len? 1: Yes, 0: No]) fi dnl Check for libcrypt CRYPTLIB= dnl Some of our helpers use crypt(3) which may be in libc, or in dnl libcrypt (eg FreeBSD) AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) dnl Solaris10 provides MD5 natively through libmd5 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"]) AC_SUBST(CRYPTLIB) # check for crypt, may require -lcrypt SAVED_LIBS="$LIBS" LIBS="$LIBS $CRYPTLIB" AC_CHECK_FUNCS(crypt) LIBS="$SAVED_LIBS" dnl Check for libdl, used by auth_modules/PAM if test "$with_dl" = "yes"; then AC_CHECK_LIB(dl, dlopen) fi dnl -lintl is needed on SCO version 3.2v4.2 for strftime() dnl Robert Side dnl Mon, 18 Jan 1999 17:48:00 GMT case "$host" in *-pc-sco3.2*) AC_CHECK_LIB(intl, strftime) ;; esac dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked dnl only with Windows LDAP libraries using -lwldap32 case "$host_os" in mingw|mingw32) LDAPLIB="-lwldap32" LBERLIB="" ;; *) LDAPLIB="-lldap" dnl LDAP helpers need to know if -llber is needed or not AC_CHECK_LIB(lber, main, [LBERLIB="-llber"]) ;; esac AC_SUBST(LDAPLIB) AC_SUBST(LBERLIB) dnl Check for libdb dnl this is not fully functional if db.h is for a differend db version DBLIB= dnl check that dbopen is actually defined in the header dnl FIXME: in case of failure undef db-related includes etc. AC_CHECK_DECL(dbopen,,,[ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_LIMITS_H #include #endif #if HAVE_DB_185_H #include #elif HAVE_DB_H #include #endif]) dnl 1.85 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [ SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_LIMITS_H #include #endif #if HAVE_DB_185_H #include #elif HAVE_DB_H #include #endif]], [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],[ac_cv_dbopen_libdb="yes"],[ac_cv_dbopen_libdb="no"]) LIBS="$SAVED_LIBS" ]) if test $ac_cv_dbopen_libdb = yes; then LIB_DB="-ldb" fi AC_SUBST(LIB_DB) dnl System-specific library modifications dnl case "$host" in i386-*-solaris2.*) if test "$GCC" = "yes"; then AC_MSG_NOTICE([Removing -O for gcc on $host]) CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" fi ;; *-sgi-irix*) AC_MSG_NOTICE([Removing -lsocket for IRIX...]) LIBS=`echo $LIBS | sed -e s/-lsocket//` AC_MSG_NOTICE([Removing -lnsl for IRIX...]) LIBS=`echo $LIBS | sed -e s/-lnsl//` ac_cv_lib_nsl_main=no AC_MSG_NOTICE([Removing -lbsd for IRIX...]) LIBS=`echo $LIBS | sed -e s/-lbsd//` ;; dnl From: c0032033@ws.rz.tu-bs.de (Joerg Schumacher) dnl Date: Thu, 17 Oct 1996 04:09:30 +0200 dnl Please change your configure script. AIX doesn't need -lbsd. *-ibm-aix*) AC_MSG_NOTICE([Removing -lbsd for AIX...]) LIBS=`echo $LIBS | sed -e s/-lbsd//` ;; *m88k*) SQUID_CFLAGS="$SQUID_CFLAGS -D_SQUID_MOTOROLA_" SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_SQUID_MOTOROLA_" AC_DEFINE(GETTIMEOFDAY_NO_TZP,1,[If gettimeofday is known to take only one argument]) ;; [*-*-solaris2.[0-4]]) AC_DEFINE(GETTIMEOFDAY_NO_TZP,1) ;; [*-sony-newsos[56]*]) AC_DEFINE(GETTIMEOFDAY_NO_TZP,1) ;; esac # Remove optimization for GCC 2.95.[123] # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically become NULL if test "$GCC" = "yes"; then GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'` case "$GCCVER" in [2.95.[123]]) AC_MSG_NOTICE([Removing -O for gcc on $host with GCC $GCCVER]) CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`" ;; esac fi # Recommended by Balint Nagy Endre case "$host" in *-univel-sysv4.2MP) if test `uname -v` = "2.03"; then AC_MSG_NOTICE([disabling mallinfo for $host]) ac_cv_func_mallinfo=no fi ;; esac dnl This has to be before AC_CHECK_FUNCS # Disable poll() on certain platforms. Override by setting ac_cv_func_poll # when running configure. if test -z "$ac_cv_func_poll"; then case "$host" in [alpha-dec-osf3.*]) # John Kay (jkay@nlanr.net) 19970818 AC_MSG_NOTICE([disabling poll for $host...]) ac_cv_func_poll='no' ;; [*-hp-hpux*.*]) # Duane Wessels AC_MSG_NOTICE([disabling poll for $host...]) ac_cv_func_poll='no' ;; [*-linux-*]) # Henrik Nordstrom (hno@squid-cache.org) 19980817 # poll is problematic on Linux. We disable it # by default until Linux gets it right. rev=`uname -r | awk -F. '{printf "%03d%03d",$1,$2}'` if test $rev -lt 002002; then AC_MSG_NOTICE([disabling poll for $host < 2.2...]) ac_cv_func_poll='no' fi ;; [powerpc-ibm-aix4.1.*]) # Mike Laster (mlaster@metavillage.com) 19981021 AC_MSG_NOTICE([disabling poll for $host...]) ac_cv_func_poll='no' ;; [*-pc-sco3.2*]) # Robert Side # Mon, 18 Jan 1999 17:48:00 GMT AC_MSG_NOTICE([disabling poll for $host...]) ac_cv_func_poll='no' ;; esac fi dnl Override statfs() detect on MinGW becasue is emulated in source code case "$host_os" in mingw|mingw32) ac_cv_func_statfs='yes' ;; esac dnl Check for library functions AC_CHECK_FUNCS(\ backtrace_symbols_fd \ bcopy \ bswap_16 \ bswap_32 \ bswap16 \ bswap32 \ fchmod \ getdtablesize \ getpagesize \ getpass \ getrlimit \ getrusage \ getspnam \ gettimeofday \ glob \ htobe16 \ htole16 \ kqueue\ lrand48 \ mallinfo \ mallocblksize \ mallopt \ memcpy \ memmove \ memset \ mkstemp \ mktime \ mstats \ poll \ prctl \ pthread_attr_setschedparam \ pthread_attr_setscope \ pthread_setschedparam \ pthread_sigmask \ putenv \ random \ regcomp \ regexec \ regfree \ res_init \ __res_init \ rint \ sbrk \ select \ seteuid \ setgroups \ setpgrp \ setrlimit \ setsid \ sigaction \ snprintf \ socketpair \ srand48 \ srandom \ statfs \ sysconf \ syslog \ timegm \ vsnprintf \ ) dnl ... and some we provide local replacements for AC_REPLACE_FUNCS(\ drand48 \ eui64_aton \ inet_ntop \ inet_pton \ initgroups \ getaddrinfo \ getnameinfo \ strerror \ strsep \ strtoll \ tempnam \ ) # Magic which checks whether we are forcing a type of comm loop we # are actually going to (ab)use. # Mostly ripped from squid-commloops, thanks to adrian and benno if test -n "$squid_opt_io_loop_engine"; then AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine]) elif test "$enable_epoll" != "no" && test "$squid_cv_epoll_works" = "yes" ; then squid_opt_io_loop_engine="epoll" elif test "$enable_kqueue" != "no" && test "$ac_cv_func_kqueue" = "yes" ; then squid_opt_io_loop_engine="kqueue" elif test "$enable_poll" != "no" && test "$ac_cv_func_poll" = "yes" ; then squid_opt_io_loop_engine="poll" elif test "$enable_select" != "no" && test "$ac_cv_func_select" = "yes" ; then squid_opt_io_loop_engine="select" if test "$squid_host_os" = "mingw" ; then squid_opt_io_loop_engine="select_win32" fi else AC_MSG_WARN([Eep! Cannot find poll, kqueue, epoll, or select!]) AC_MSG_WARN([Will try select and hope for the best.]) squid_opt_io_loop_engine="select" fi AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.]) AM_CONDITIONAL([USE_POLL], [test $squid_opt_io_loop_engine = poll]) AM_CONDITIONAL([USE_EPOLL], [test $squid_opt_io_loop_engine = epoll]) AM_CONDITIONAL([USE_SELECT], [test $squid_opt_io_loop_engine = select]) AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $squid_opt_io_loop_engine = select_simple]) AM_CONDITIONAL([USE_SELECT_WIN32], [test $squid_opt_io_loop_engine = select_win32]) AM_CONDITIONAL([USE_KQUEUE], [test $squid_opt_io_loop_engine = kqueue]) AM_CONDITIONAL([USE_DEVPOLL], [test $squid_opt_io_loop_engine = devpoll]) case $squid_opt_io_loop_engine in epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;; poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;; kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;; select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;; select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;; esac AC_CACHE_CHECK(if setresuid is actually implemented, ac_cv_func_setresuid, AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main(int argc, char **argv) { if(setresuid(-1,-1,-1)) { perror("setresuid:"); return 1; } return 0; } ]])],[ac_cv_func_setresuid="yes"],[ac_cv_func_setresuid="no"],[]) ) if test "$ac_cv_func_setresuid" = "yes" ; then AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Knowing that setresuid() exists is not enough, because RedHat 5.0 declares setresuid() but does not implement it.]) fi SQUID_CHECK_FUNC_STRNSTR SQUID_CHECK_FUNC_VACOPY SQUID_CHECK_FUNC___VACOPY dnl IP-Filter support requires ipf header files. These aren't dnl installed by default, so we need to check for them if test "$enable_ipf_transparent" != "no" ; then AC_MSG_CHECKING(for availability of IP-Filter header files) # hold on to your hats... if test "$ac_cv_header_ip_compat_h" = "yes" || test "$ac_cv_header_ip_fil_compat_h" = "yes" || test "$ac_cv_header_netinet_ip_compat_h" = "yes" || test "$ac_cv_header_netinet_ip_fil_compat_h" = "yes" ; then have_ipfilter_compat_header="yes" fi if test "$have_ipfilter_compat_header" = "yes" && test "$ac_cv_header_ip_fil_h" = "yes" && test "$ac_cv_header_ip_nat_h" = "yes" ; then enable_ipf_transparent="yes" elif test "$have_ipfilter_compat_header" = "yes" && test "$ac_cv_header_netinet_ip_fil_h" = "yes" && test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then enable_ipf_transparent="yes" else enable_ipf_transparent="no" fi AC_MSG_RESULT($IPF_TRANSPARENT) fi AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent]) SQUID_DEFINE_BOOL([IPF_TRANSPARENT],$enable_ipf_transparent, [Enable support for IPF-style transparent proxying]) if test "$enable_ipf_transparent" = "yes" -a "$squid_host_os" = "solaris" ; then dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the dnl Solaris minor version (8, 9, 10, ...) solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'` CFLAGS="-DSOLARIS2=$solrev $CFLAGS" CXXFLAGS="-DSOLARIS2=$solrev $CXXFLAGS" fi dnl PF support requires a header file. if test "$enable_pf_transparent" != "no" ; then if test "$ac_cv_header_net_pfvar_h" = "yes" -o \ "$ac_cv_header_net_pf_pfvar_h" = "yes"; then if test "$enable_pf_transparent" = "auto" ; then enable_pf_transparent="yes" fi else if test "$enable_pf_transparent" = "yes" ; then AC_MSG_ERROR([PF-based transparent proxy requested but needed header not found]) fi enable_pf_transparent="no" fi fi SQUID_DEFINE_BOOL([PF_TRANSPARENT],$enable_pf_transparent, [Enable support for PF-style transparent proxying]) if test "$enable_linux_netfilter" != "no" ; then if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then if test "$enable_linux_netfilter" = "auto" ; then enable_linux_netfilter=yes fi else if test "$enable_linux_netfilter" = "auto" ; then enable_linux_netfilter=no else AC_MSG_ERROR([Linux Netfilter support requested but needed headers not found]) fi fi fi SQUID_DEFINE_BOOL([LINUX_NETFILTER],$enable_linux_netfilter, [Enable support for Transparent Proxy on Linux via Netfilter]) dnl Netfilter TPROXY depends on libcap but the NAT parts can still work. AC_MSG_NOTICE([Support for Netfilter-based interception proxy requested: $enable_linux_netfilter]) if test "$enable_linux_netfilter" = "yes" && test "$use_libcap" != "yes" ; then AC_MSG_WARN([Missing needed capabilities (libcap or libcap2) for TPROXY]) AC_MSG_WARN([Linux Transparent Proxy support WILL NOT be enabled]) AC_MSG_WARN([Reduced support to Interception Proxy]) # AC_DEFINEd later fi AC_ARG_ENABLE(gnuregex, AS_HELP_STRING([--enable-gnuregex], [Compile GNUregex. Unless you have reason to use this option, you should not enable it. This library file is usually only required on Windows and very old Unix boxes which do not have their own regex library built in.]), [USE_GNUREGEX=$enableval]) if test -z "$USE_GNUREGEX" ; then case "$host" in *-sun-solaris2.[[0-4]]) USE_GNUREGEX="yes" ;; *-next-nextstep*) USE_GNUREGEX="yes" ;; esac fi AC_MSG_CHECKING(if GNUregex needs to be compiled) if test -z "$USE_GNUREGEX"; then if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then USE_GNUREGEX="yes" else AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[regex_t t; regcomp(&t,"",0);]])],[USE_GNUREGEX="no"],[USE_GNUREGEX="yes"]) fi fi AC_MSG_RESULT($USE_GNUREGEX) if test "$USE_GNUREGEX" = "yes"; then # override system regex with ours. Not good. But what was asked for. REGEXLIB="" AC_DEFINE(USE_GNUREGEX,1,[Define if we should use GNU regex]) fi AC_SUBST(REGEXLIB) #AC_SUBST(LIBREGEX) dnl Not cached since people are likely to tune this AC_MSG_CHECKING(Default FD_SETSIZE value) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #if HAVE_STDIO_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_STDLIB_H #include #endif #if HAVE_SYS_TIME_H #include #endif #if HAVE_SYS_SELECT_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_WINSOCK_H #include #endif #if HAVE_WINSOCK2_H #include #endif int main(int argc, char **argv) { FILE *fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", FD_SETSIZE); return 0; } ]])],[DEFAULT_FD_SETSIZE=`cat conftestval`],[DEFAULT_FD_SETSIZE=256],[DEFAULT_FD_SETSIZE=256]) AC_MSG_RESULT($DEFAULT_FD_SETSIZE) AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE, [Default FD_SETSIZE value]) dnl Not cached since people are likely to tune this AC_MSG_CHECKING(Maximum number of filedescriptors we can open) dnl damn! FreeBSD pthreads break dup2(). TLDFLAGS="$LDFLAGS" if test -n "$squid_filedescriptors_num" ; then SQUID_MAXFD=$squid_filedescriptors_num AC_MSG_RESULT($SQUID_MAXFD (user-forced)) else case $host in i386-unknown-freebsd*) if echo "$LDFLAGS" | grep -q pthread; then LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"` fi esac AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include #include /* needed on FreeBSD */ #include #include int main(int argc, char **argv) { FILE *fp; int i,j; #if defined(__CYGWIN32__) || defined (__CYGWIN__) /* getrlimit and sysconf returns bogous values on cygwin32. * Number of fds is virtually unlimited in cygwin (sys/param.h) * __CYGWIN32__ is deprecated. */ i = NOFILE; #else #if HAVE_SETRLIMIT struct rlimit rl; #if defined(RLIMIT_NOFILE) if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { perror("getrlimit: RLIMIT_NOFILE"); } else { #if defined(__APPLE__) /* asking for more than OPEN_MAX fails on Leopard */ rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max); #else rl.rlim_cur = rl.rlim_max; /* set it to the max */ #endif if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { perror("setrlimit: RLIMIT_NOFILE"); } } #elif defined(RLIMIT_OFILE) if (getrlimit(RLIMIT_OFILE, &rl) < 0) { perror("getrlimit: RLIMIT_OFILE"); } else { rl.rlim_cur = rl.rlim_max; /* set it to the max */ if (setrlimit(RLIMIT_OFILE, &rl) < 0) { perror("setrlimit: RLIMIT_OFILE"); } } #endif /* RLIMIT_NOFILE */ #endif /* HAVE_SETRLIMIT */ /* by starting at 2^14, we will never get higher than 2^15 for SQUID_MAXFD */ i = j = 1<<14; while (j) { j >>= 1; if (dup2(0, i) < 0) { i -= j; } else { close(i); i += j; } } i++; #endif /* IF !DEF CYGWIN */ fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", i & ~0x3F); return 0; } ]])],[SQUID_MAXFD=`cat conftestval`],[SQUID_MAXFD=256],[SQUID_MAXFD=256]) dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs case "$host_os" in mingw|mingw32) SQUID_MAXFD="2048" ;; esac AC_MSG_RESULT($SQUID_MAXFD) fi AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD,[Maximum number of open filedescriptors]) if test "$SQUID_MAXFD" -lt 512 ; then AC_MSG_WARN([$SQUID_MAXFD may not be enough filedescriptors if your]) AC_MSG_WARN([cache will be very busy. Please see the FAQ page]) AC_MSG_WARN([http://wiki.squid-cache.org/SquidFaq/TroubleShooting]) AC_MSG_WARN([on how to increase your filedescriptor limit]) fi LDFLAGS="$TLDFLAGS" if test `expr $SQUID_MAXFD % 64` != 0; then AC_MSG_WARN([$SQUID_MAXFD is not an multiple of 64. This may cause issues on certain platforms.]) fi dnl Not cached since people are likely to tune this AC_MSG_CHECKING(Default UDP send buffer size) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include #if HAVE_SYS_SOCKET_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_WINSOCK_H #include #endif #if HAVE_WINSOCK2_H #include #endif int main(int argc, char **argv) { FILE *fp; int fd,val=0; #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) int len=sizeof(int); WSADATA wsaData; WSAStartup(2, &wsaData); #else socklen_t len=sizeof(socklen_t); #endif if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1; #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1; WSACleanup(); #else if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1; #endif if (val<=0) return 1; fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); return 0; } ]])],[SQUID_DETECT_UDP_SO_SNDBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_SNDBUF=16384],[SQUID_DETECT_UDP_SO_SNDBUF=16384]) AC_MSG_RESULT($SQUID_DETECT_UDP_SO_SNDBUF) AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_SNDBUF, $SQUID_DETECT_UDP_SO_SNDBUF,[UDP send buffer size]) dnl Not cached since people are likely to tune this AC_MSG_CHECKING(Default UDP receive buffer size) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include #if HAVE_SYS_SOCKET_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_WINSOCK_H #include #endif #if HAVE_WINSOCK2_H #include #endif int main(int argc, char **argv) { FILE *fp; int fd,val=0; #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) int len=sizeof(int); WSADATA wsaData; WSAStartup(2, &wsaData); #else socklen_t len=sizeof(socklen_t); #endif if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1; #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1; WSACleanup(); #else if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1; #endif if (val <= 0) return 1; fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); return 0; } ]])],[SQUID_DETECT_UDP_SO_RCVBUF=`cat conftestval`],[SQUID_DETECT_UDP_SO_RCVBUF=16384],[SQUID_DETECT_UDP_SO_RCVBUF=16384]) AC_MSG_RESULT($SQUID_DETECT_UDP_SO_RCVBUF) AC_DEFINE_UNQUOTED(SQUID_DETECT_UDP_SO_RCVBUF, $SQUID_DETECT_UDP_SO_RCVBUF,[UDP receive buffer size]) dnl Not cached since people are likely to tune this AC_MSG_CHECKING(Default TCP send buffer size) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include #if HAVE_SYS_SOCKET_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_WINSOCK_H #include #endif #if HAVE_WINSOCK2_H #include #endif int main(int argc, char **argv) { FILE *fp; int fd,val=0; #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) int len=sizeof(int); WSADATA wsaData; WSAStartup(2, &wsaData); #else socklen_t len=sizeof(socklen_t); #endif if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1; #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1; WSACleanup(); #else if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) return 1; #endif if (val <= 0) return 1; fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); return 0; } ]])],[SQUID_TCP_SO_SNDBUF=`cat conftestval`],[SQUID_TCP_SO_SNDBUF=16384],[SQUID_TCP_SO_SNDBUF=16384]) AC_MSG_RESULT($SQUID_TCP_SO_SNDBUF) if test $SQUID_TCP_SO_SNDBUF -gt 32768; then AC_MSG_NOTICE([Limiting send buffer size to 32K]) SQUID_TCP_SO_SNDBUF=32768 fi AC_DEFINE_UNQUOTED(SQUID_TCP_SO_SNDBUF, $SQUID_TCP_SO_SNDBUF,[TCP send buffer size]) dnl Not cached since people are likely to tune this AC_MSG_CHECKING(Default TCP receive buffer size) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include #if HAVE_SYS_SOCKET_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_WINSOCK_H #include #endif #if HAVE_WINSOCK2_H #include #endif int main(int argc, char **argv) { FILE *fp; int fd,val=0; #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) int len=sizeof(int); WSADATA wsaData; WSAStartup(2, &wsaData); #else socklen_t len=sizeof(socklen_t); #endif if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1; #if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1; WSACleanup(); #else if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) return 1; #endif if (val <= 0) return 1; fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); return 0; } ]])],[SQUID_TCP_SO_RCVBUF=`cat conftestval`],[SQUID_TCP_SO_RCVBUF=16384],[SQUID_TCP_SO_RCVBUF=16384]) AC_MSG_RESULT($SQUID_TCP_SO_RCVBUF) if test $SQUID_TCP_SO_RCVBUF -gt 65535; then AC_MSG_NOTICE([Limiting receive buffer size to 64K]) SQUID_TCP_SO_RCVBUF=65535 fi AC_DEFINE_UNQUOTED(SQUID_TCP_SO_RCVBUF, $SQUID_TCP_SO_RCVBUF,[TCP receive buffer size]) AC_CACHE_CHECK(if sys_errlist is already defined, ac_cv_needs_sys_errlist, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char *s = sys_errlist;]])],[ac_cv_needs_sys_errlist="no"],[ac_cv_needs_sys_errlist="yes"]) ) if test "$ac_cv_needs_sys_errlist" = "yes" ; then AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external]) fi dnl Hurd does not supply MAXPATHLEN. we may need to define it outselves. dnl Other system define it in system headers AC_CHECK_HEADERS([sys/param.h]) AC_MSG_CHECKING(for MAXPATHLEN) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],[[int i = MAXPATHLEN;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) AC_DEFINE(MAXPATHLEN,256,[If MAXPATHLEN has not been defined])]) dnl Not cached since people are likely to change this AC_MSG_CHECKING(for libresolv _dns_ttl_ hack) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes) AC_DEFINE(LIBRESOLV_DNS_TTL_HACK,1,[If libresolv.a has been hacked to export _dns_ttl_])],[AC_MSG_RESULT(no)]) if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then AC_MSG_CHECKING(for working statvfs() interface) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include ]], [[ struct statvfs sfs; sfs.f_blocks = sfs.f_bfree = sfs.f_frsize = sfs.f_files = sfs.f_ffree = 0; statvfs("/tmp", &sfs); ]])],[ac_cv_func_statvfs=yes],[ac_cv_func_statvfs=no]) AC_MSG_RESULT($ac_cv_func_statvfs) if test "$ac_cv_func_statvfs" = "yes" ; then AC_DEFINE(HAVE_STATVFS,1,[If your system has statvfs(), and if it actually works!]) fi fi dnl Detect what resolver fields we have available to use... AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif #if HAVE_ARPA_NAMESER_H #include #endif #if HAVE_RESOLV_H #include #endif ]], [[_res_ext.nsaddr_list[[0]].s_addr;]])],[ac_cv_have_res_ext_nsaddr_list="yes"],[ac_cv_have_res_ext_nsaddr_list="no"])) if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then AC_DEFINE(_SQUID_RES_NSADDR6_LARRAY,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member]) AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext]) fi if test "$_SQUID_RES_NSADDR6_LIST" = ""; then AC_CACHE_CHECK(for _res._u._ext.nsaddrs, ac_cv_have_res_ext_nsaddrs, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif #if HAVE_ARPA_NAMESER_H #include #endif #if HAVE_RESOLV_H #include #endif ]], [[_res._u._ext.nsaddrs[[0]]->sin6_addr;]])],[ac_cv_have_res_ext_nsaddrs="yes"],[ac_cv_have_res_ext_nsaddrs="no"])) if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then AC_DEFINE(_SQUID_RES_NSADDR6_LPTR,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member]) AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res]) fi fi AC_CACHE_CHECK(for _res.nsaddr_list, ac_cv_have_res_nsaddr_list, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif #if HAVE_ARPA_NAMESER_H #include #endif #if HAVE_RESOLV_H #include #endif ]], [[_res.nsaddr_list[[0]];]])],[ac_cv_have_res_nsaddr_list="yes"],[ac_cv_have_res_nsaddr_list="no"])) if test $ac_cv_have_res_nsaddr_list = "yes" ; then AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.nsaddr_list,[If _res structure has nsaddr_list member]) AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res]) fi if test "$_SQUID_RES_NSADDR_LIST" = ""; then AC_CACHE_CHECK(for _res.ns_list, ac_cv_have_res_ns_list, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif #if HAVE_ARPA_NAMESER_H #include #endif #if HAVE_RESOLV_H #include #endif ]], [[_res.ns_list[[0]].addr;]])],[ac_cv_have_res_ns_list="yes"],[ac_cv_have_res_ns_list="no"])) if test $ac_cv_have_res_ns_list = "yes" ; then AC_DEFINE(_SQUID_RES_NSADDR_LIST,_res.ns_list,[If _res structure has ns_list member]) AC_DEFINE(_SQUID_RES_NSADDR_COUNT,_res.nscount,[Nameserver counter for IPv4 _res]) fi fi dnl Squid will usually attempt to translate when packaging or building from VCS use_translation="yes" AC_ARG_ENABLE(translation, AS_HELP_STRING([--disable-translation],[Prevent Squid generating localized error page templates and manuals. Which is usually tried, but may not be needed.]), [ if test "$enableval" = "no" ; then use_translation=no fi ]) dnl Squid now has .po translation capability, given the right toolkit if test "$use_translation" = "yes" ; then AX_WITH_PROG([PO2HTML],[po2html]) else PO2HTML="off" fi AC_SUBST(PO2HTML) dnl Squid now has limited locale handling ... dnl on error pages use_errlocale=yes AC_ARG_ENABLE(auto-locale, AS_HELP_STRING([--disable-auto-locale],[This prevents Squid providing localized error pages based on the clients request headers. When disabled Squid requires explicit language configuration.]), [ if test "$enableval" = "no" ; then use_errlocale=no fi ]) if test "$use_errlocale" = "yes" ; then AC_MSG_NOTICE([Enabling Multi-Language Support]) AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages]) else AC_MSG_WARN([Disabling Multi-Language Support]) AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages]) fi dnl Need the debugging version of malloc if available XTRA_OBJS='' if test "$ac_cv_lib_malloc_main" = "yes" ; then if test -r /usr/lib/debug/malloc.o ; then XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o" fi if test -r /usr/lib/debug/mallocmap.o ; then XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o" fi fi AC_SUBST(XTRA_OBJS) if test -z "$XTRA_LIBS"; then XTRA_LIBS="$LIBS" dnl minor cleanup XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"` LIBS='' fi AC_SUBST(XTRA_LIBS) dnl Clean up after OSF/1 core dump bug rm -f core AC_CONFIG_FILES([\ Makefile \ compat/Makefile \ lib/Makefile \ scripts/Makefile \ src/Makefile \ src/base/Makefile \ src/acl/Makefile \ src/fs/Makefile \ src/repl/Makefile \ src/auth/Makefile \ src/adaptation/Makefile \ src/adaptation/icap/Makefile \ src/adaptation/ecap/Makefile \ src/comm/Makefile \ src/esi/Makefile \ src/eui/Makefile \ src/icmp/Makefile \ src/ident/Makefile \ src/ip/Makefile \ src/log/Makefile \ contrib/Makefile \ snmplib/Makefile \ icons/Makefile \ errors/Makefile \ test-suite/Makefile \ doc/Makefile \ doc/manuals/Makefile \ helpers/Makefile \ helpers/basic_auth/Makefile \ helpers/basic_auth/DB/Makefile \ helpers/basic_auth/getpwnam/Makefile \ helpers/basic_auth/LDAP/Makefile \ helpers/basic_auth/MSNT/Makefile \ helpers/basic_auth/MSNT-multi-domain/Makefile \ helpers/basic_auth/NCSA/Makefile \ helpers/basic_auth/NIS/Makefile \ helpers/basic_auth/PAM/Makefile \ helpers/basic_auth/POP3/Makefile \ helpers/basic_auth/RADIUS/Makefile \ helpers/basic_auth/SASL/Makefile \ helpers/basic_auth/SMB/Makefile \ helpers/basic_auth/SSPI/Makefile \ helpers/digest_auth/Makefile \ helpers/digest_auth/eDirectory/Makefile \ helpers/digest_auth/file/Makefile \ helpers/digest_auth/ldap/Makefile \ helpers/ntlm_auth/Makefile \ helpers/ntlm_auth/fake/Makefile \ helpers/ntlm_auth/smb_lm/Makefile \ helpers/ntlm_auth/smb_lm/smbval/Makefile \ helpers/ntlm_auth/mswin_sspi/Makefile \ helpers/negotiate_auth/Makefile \ helpers/negotiate_auth/kerberos/Makefile \ helpers/negotiate_auth/mswin_sspi/Makefile \ helpers/external_acl/Makefile \ helpers/external_acl/ip_user/Makefile \ helpers/external_acl/ldap_group/Makefile \ helpers/external_acl/session/Makefile \ helpers/external_acl/unix_group/Makefile \ helpers/external_acl/wbinfo_group/Makefile \ helpers/external_acl/mswin_ad_group/Makefile \ helpers/external_acl/mswin_lm_group/Makefile \ helpers/log_daemon/Makefile \ helpers/log_daemon/file/Makefile \ helpers/url_rewrite/Makefile \ helpers/url_rewrite/fake/Makefile \ tools/Makefile ]) AC_CONFIG_SUBDIRS(lib/libTrie) # must configure libltdl subdir unconditionally for "make distcheck" to work AC_CONFIG_SUBDIRS(libltdl) AC_OUTPUT