--- /dev/null
+dnl
+dnl AUTHOR: Squid Web Cache team
+dnl
+dnl SQUID Web Proxy Cache http://www.squid-cache.org/
+dnl ----------------------------------------------------------
+dnl Squid is the result of efforts by numerous individuals from
+dnl the Internet community; see the CONTRIBUTORS file for full
+dnl details. Many organizations have provided support for Squid's
+dnl development; see the SPONSORS file for full details. Squid is
+dnl Copyrighted (C) 2001 by the Regents of the University of
+dnl California; see the COPYRIGHT file for full details. Squid
+dnl incorporates software developed and/or copyrighted by other
+dnl sources; see the CREDITS file for full details.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+
+
+dnl checks whether dbopen needs -ldb to be added to libs
+dnl sets ac_cv_dbopen_libdb to either "yes" or "no"
+
+AC_DEFUN([SQUID_CHECK_DBOPEN_NEEDS_LIBDB],[
+ AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
+ SQUID_STATE_SAVE(dbopen_libdb)
+ LIBS="$LIBS -ldb"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#if HAVE_DB_185_H
+#include <db_185.h>
+#elif HAVE_DB_H
+#include <db.h>
+#endif]],
+[[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],
+ [ac_cv_dbopen_libdb="yes"],
+ [ac_cv_dbopen_libdb="no"])
+ SQUID_STATE_ROLLBACK(dbopen_libdb)
+ ])
+])
+
+
+dnl check whether regex works by actually compiling one
+dnl sets squid_cv_regex_works to either yes or no
+
+AC_DEFUN([SQUID_CHECK_REGEX_WORKS],[
+ AC_CACHE_CHECK([if the system-supplied regex lib actually works],squid_cv_regex_works,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_REGEX_H
+#include <regex.h>
+#endif
+]], [[
+regex_t t; regcomp(&t,"",0);]])],
+ [ squid_cv_regex_works=yes ],
+ [ squid_cv_regex_works=no ])
+ ])
+])
dnl Set default LDFLAGS
if test "x$LDFLAGS" = "x" ; then
- LDFLAGS="-g"
+ LDFLAGS="-g"
fi
# Check for GNU cc
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 enabled.
- This flag disables the behavior]),
-[
+ This flag disables the behavior]), [
if test "x${enableval}" = "xno"
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 "s$use_loadable_modules" = "xyes")
+ AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) , [
+ SQUID_YESNO([$enableval],
+ [Unrecognized argument to --disable-loadable-modules: $enableval])
+])
+AM_CONDITIONAL(USE_LOADABLE_MODULES, test "x${enable_loadable_modules:=yes}" = "xyes")
+AC_MSG_RESULT([$enable_loadable_modules])
-if test "x$use_loadable_modules" = "xyes";
+if test "x$enable_loadable_modules" = "xyes";
then
- AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
- AC_ENABLE_SHARED
+ AC_DEFINE(USE_LOADABLE_MODULES, 1, [Support Loadable Modules])
+ AC_ENABLE_SHARED
else
- AC_DISABLE_SHARED
+ AC_DISABLE_SHARED
fi
LT_INIT([dlopen])
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
-if test "x$use_loadable_modules" = "xyes";
+if test "x$enable_loadable_modules" = "xyes";
then
- # Why is this needed? Should not LT_INIT (or LT_LIB_DLLOAD) from libtool do that?
- LIBADD_DL=${lt_cv_dlopen_libs}
- AC_SUBST([LIBADD_DL])
+ # Why is this needed? Should not LT_INIT (or LT_LIB_DLLOAD) from libtool do that?
+ LIBADD_DL=${lt_cv_dlopen_libs}
+ AC_SUBST([LIBADD_DL])
fi
SQUID_CC_GUESS_VARIANT
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
+ 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
+ [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)
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])
+ AC_MSG_FAILURE([GCC $GCCVER causes a coredump on $host.
+ Please use a more recent GCC version])
fi
;;
esac
SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
-SquidInline="yes"
-
+enable_inline="yes"
AC_ARG_ENABLE(optimizations,
AS_HELP_STRING([--disable-optimizations],
[Do not compile Squid with compiler optimizations enabled.
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"
+ enable_inline="no"
fi
])
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 "x$enableval" = "xno" ; then
- SquidInline="no"
-fi
+ methods inlinable by the compiler.]), [
+SQUID_YESNO([$enableval],
+ [Unrecognized argument to --disable-inline: $enableval])
])
-
-if test "x$SquidInline" = "xyes" ; 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_MSG_NOTICE([inlining optimizations enabled: $enable_inline])
+SQUID_DEFINE_BOOL(_USE_INLINE_,$enable_inline,
+ [Include inline methods into header file])
+# to be used by sub-commands
+export enable_inline
AC_ARG_ENABLE(debug-cbdata,
AS_HELP_STRING([--enable-debug-cbdata],
if test "x$squid_opt_use_ecap" = "xyes";
then
dnl eCAP support requires loadable modules, which are enabled by default
- if test "x$use_loadable_modules" != "xyes"
+ if test "x$enable_loadable_modules" != "xyes"
then
AC_MSG_ERROR([eCAP support requires loadable modules. Please do not use --disable-loadable-modules with --enable-ecap.]);
fi
AM_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR(cfgaux)
-SquidInline="yes"
-
+enable_inline=${enable_inine:=yes}
AC_ARG_ENABLE(optimizations,
AC_HELP_STRING([--disable-optimizations],
- [Don't compile Squid with compiler optimizations enabled.
+ [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
+ also enabled --disable-inline]), [
+if test "x$enableval" = "xno" ; 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"
+ enable_inline="no"
fi
])
AC_ARG_ENABLE(inline,
AC_HELP_STRING([--disable-inline],
- [Don't compile trivial methods as inline. Squid
+ [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
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
+ methods inlinable by the compiler.]), [
])
-if test "$SquidInline" = "yes" ; then
- AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
- AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
+if test "$enable_inline" = "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])
+ AC_DEFINE(_SQUID_INLINE_, [] , [Keyword used by squid for inlining methods])
+ AC_DEFINE(_USE_INLINE_, 0, [Include inline methods into header file])
fi