dnl
dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
dnl
-dnl $Id: configure.in,v 1.407 2006/05/03 14:04:44 robertc Exp $
+dnl $Id: configure.in,v 1.408 2006/05/07 10:17:25 serassio Exp $
dnl
dnl
dnl
AC_CONFIG_AUX_DIR(cfgaux)
AM_INIT_AUTOMAKE([tar-ustar])
AM_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.407 $)dnl
+AC_REVISION($Revision: 1.408 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AM_MAINTAINER_MODE
AC_ARG_ENABLE(gnuregex,
[ --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.],
+ 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])
SquidInline="yes"
AC_ARG_ENABLE(optimizations,
[ --disable-optimizations Don't 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],
+ 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
echo "Disabling compiler optimizations (-O flag)"
CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
AC_ARG_ENABLE(inline,
[ --disable-inline Don't 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.],
+ 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
dnl check for netio plugin stuff
dnl Enable poll()
AC_ARG_ENABLE(poll,
-[ --enable-poll Enable poll() support.
+[ --enable-poll Enable poll() support.
--disable-poll Disable poll() support. ],
[
dnl Enable select()
AC_ARG_ENABLE(select,
-[ --enable-select Enable select() support.
+[ --enable-select Enable select() support.
--disable-select Disable select() support. ],
[
dnl Enable kqueue()
AC_ARG_ENABLE(kqueue,
-[ --enable-kqueue Enable kqueue() support.
+[ --enable-kqueue Enable kqueue() support.
--disable-kqueue Disable kqueue() support. ],
[
dnl Enable epoll()
AC_ARG_ENABLE(epoll,
-[ --enable-epoll Enable epoll() support.
- --disable-epoll Disable epoll() support. ],
+[ --enable-epoll Enable epoll() support.
+ --disable-epoll Disable epoll() support. ],
[
case "$enableval" in
])
dnl Enable Large file support
-AC_ARG_ENABLE(large-files,
-[ --enable-large-files Enable support for large files (>2GB). Still
+buildmodel=""
+needlargefiles=
+
+AC_ARG_WITH(large-files,
+[ --with-large-files Enable support for large files (logs etc). Still
experimental.],
-[ if test "$enableval" = "yes" ; then
- echo "Large file support enabled"
- SQUID_CFLAGS="$SQUID_CFLAGS -D_FILE_OFFSET_BITS=64"
- SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_FILE_OFFSET_BITS=64"
+[ if test "$withval" = yes; then
+ needlargefiles=1
fi
])
+dnl UNIX Build environment
+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)
+ echo "--with-build-environment expects a build environment string as used by getconf"
+ exit 1
+ ;;
+ *)
+ buildmodel="$withval"
+ ;;
+ esac
+])
+
+if test $needlargefiles && test -z "$buildmodel"; then
+ for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_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
+ echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64"
+ sleep 1
+ CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS"
+ fi
+fi
+if test -n "$buildmodel" && test "$buildmodel" != "default"; then
+ echo "Using $buildmodel build environment"
+ if test "`getconf _$buildmodel 2>/dev/null || true`" = 1 || test "`getconf $buildmodel 2>/dev/null || true`" ; then
+ : # All fine
+ else
+ echo "ERROR: Build environment $buildmodel not known to getconf."
+ exit 1
+ fi
+ CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS"
+ LIBS="`getconf ${buildmodel}_LIBS` $LIBS"
+ LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
+dnl
+dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but:
+dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc
+dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun
+ case "$host" in
+ *-solaris*)
+ if test "$GCC" = "yes"; then
+ echo "Removing -Xa for gcc on $host"
+ CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
+ fi
+ echo "Removing -Usun for gcc on $host"
+ CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
+ ;;
+ *)
+ ;;
+ esac
+fi
+
AM_CONDITIONAL(MAKE_LEAKFINDER, false)
dnl Enable Leak Finding Functions
AC_ARG_ENABLE(leakfinder,
AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
AC_ARG_ENABLE(mempools,
[ --disable-mempools Disable memPools. Note that this option now 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.],
+ 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.],
[ if test "$enableval" = "no" ; then
echo "memPools disabled"
AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])