AC_CANONICAL_HOST
dnl Make location configure settings available to the code
-AC_DEFINE_UNQUOTED([DEFAULT_SQUID_CONFIG_DIR], "${sysconfdir}" , [Location of Configuration files] )
-AC_DEFINE_UNQUOTED([DEFAULT_SQUID_DATA_DIR], "${datadir}" , [Location of other data files] )
+dnl Pass squid data directory (icons, errors etc) base location to code files as a compiler define
+CFLAGS="-DDEFAULT_SQUID_DATA_DIR=\\\"$datadir\\\" $CFLAGS"
+CXXFLAGS="-DDEFAULT_SQUID_DATA_DIR=\\\"$datadir\\\" $CXXFLAGS"
+dnl Pass squid.conf directory base location to code files as a compiler define
+CFLAGS="-DDEFAULT_SQUID_CONFIG_DIR=\\\"$sysconfdir\\\" $CFLAGS"
+CXXFLAGS="-DDEFAULT_SQUID_CONFIG_DIR=\\\"$sysconfdir\\\" $CXXFLAGS"
use_loadable_modules=1
AC_MSG_CHECKING(whether to use loadable modules)
use_loadable_modules=yes;
AC_MSG_RESULT([$use_loadable_modules, implicitly])
]
-)
+)
AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
)
AC_SUBST(CACHE_EFFECTIVE_USER)
+DEFAULT_LOG_DIR="$localstatedir/logs"
+AC_ARG_WITH(logdir,
+ [ --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)
+
dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
case "$host" in
mab-next-nextstep3)
AM_CONDITIONAL(ENABLE_PINGER, false)
AC_ARG_ENABLE(icmp,
-[ --enable-icmp Enable ICMP pinging],
+ AC_HELP_STRING([--enable-icmp],[Enable ICMP pinging and Network Measurement]),
[ if test "$enableval" = "yes" ; then
echo "ICMP enabled"
- AC_DEFINE(USE_ICMP,1,
- [ Defined this to use Squid's ICMP features (highly recommended!)
- When USE_ICMP is defined, Squid will send ICMP pings to origin server sites.])
+ AC_DEFINE(USE_ICMP,1,[Define to use Squid's ICMP and Network Measurement features (highly recommended!)])
AM_CONDITIONAL(ENABLE_PINGER, true)
fi
])
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],
+ [ECAP_LIBS="-lecap"],
+ [AC_MSG_FAILURE([
+ eCAP support requires libecap library,
+ but no usable library was found])]
+ )
fi
AM_CONDITIONAL(USE_ECAP, test $use_ecap = yes)
if test $use_ecap = yes;
then
AC_DEFINE(USE_ECAP,1,[Enable eCAP support])
- ECAP_LIBS="eCAP/libeCAP.la"
+ ECAP_LIBS="eCAP/libeCAP.la $ECAP_LIBS"
use_adaptation=yes
else
AC_DEFINE(USE_ECAP,0,[Disable eCAP support])
AC_ARG_ENABLE(cache-digests,
[ --enable-cache-digests Use Cache Digests
- see http://www.squid-cache.org/FAQ/FAQ-16.html],
+ see http://wiki.squid-cache.org/SquidFaq/CacheDigests],
[ if test "$enableval" = "yes" ; then
echo "USE_CACHE_DIGESTS enabled"
AC_DEFINE(USE_CACHE_DIGESTS,1,[Use Cache Digests for locating objects in neighbor caches. This code is still semi-experimental.])
AC_SUBST(AUTH_LINKOBJS)
AC_SUBST(AUTH_OBJS)
+ dnl bundled auth modules, in order to have handy defines for the cppunit testsuite
+ test -n "$AUTH_MODULE_basic" && AC_DEFINE([HAVE_AUTH_MODULE_BASIC],1,[Basic auth module is built])
+ test -n "$AUTH_MODULE_digest" && AC_DEFINE([HAVE_AUTH_MODULE_DIGEST],1,[Digest auth module is built])
+ test -n "$AUTH_MODULE_ntlm" && AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
+ test -n "$AUTH_MODULE_negotiate" && AC_DEFINE([HAVE_AUTH_MODULE_NEGOTIATE],1,[Negotiate auth module is built])
+
dnl Select basic auth scheme helpers to build
if test -n "$AUTH_MODULE_basic"; then
BASIC_AUTH_HELPERS="all"
else
AC_MSG_ERROR(Negotiate Auth helper $helper does not exist)
fi
+ # Kerberos helper has its own configure system
+ if test "$srcdir/helpers/negotiate_auth/$helper/configure" ; then
+ if test $helper = squid_kerb_auth; then
+ AC_CONFIG_SUBDIRS(helpers/negotiate_auth/squid_kerb_auth)
+ else
+ echo "ERROR: configure.in needs to be extended to support $helper!"
+ exit 1
+ fi
+ fi
done
echo "Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS"
fi
dnl Enable IPv6 support
AC_MSG_CHECKING([whether to enable IPv6])
-use_ipng=no
+use_ipng=yes
AC_ARG_ENABLE(ipv6,
-[ --enable-ipv6 Enable ipv6 support],
+ AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
[ AC_MSG_RESULT(yes)
AC_CACHE_CHECK([if PF_INET6 is available], $enableval,
AC_TRY_RUN(
AC_MSG_RESULT(yes)
use_ipng=yes
],
- [ AC_DEFINE(USE_IPV6,0,[0 == Disable support for IPv6])
- AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
- AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
- AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
- AC_MSG_RESULT(no)
+ [ AC_MSG_RESULT(no)
+ use_ipng=no
])
)
],
-[ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6])
- AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations])
- AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
- AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
- AC_MSG_RESULT(no)
+[ AC_MSG_RESULT(no)
+ use_ipng=no
])
if test "$use_ipng" = "yes"; then
+dnl Check for IPv6 Windows Vista option
+dnl Also useful for other OS with hybrid-stack defaults turned OFF
+AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets])
+
dnl Check for Windows XP option
AC_MSG_CHECKING([for IPv6 split-stack requirement])
AC_ARG_WITH(ipv6-split-stack,
- [ --with-ipv6-split-stack Require IPv6 split-stack support. Requires IPv6 Support.],
- [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(yes)],
+ AC_HELP_STRING([--with-ipv6-split-stack],[Require IPv6 split-stack support. Requires IPv6 Support.]),
+ [ AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 1, [Enable support for IPv6 on split-stack implementations])
+ AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets. Requires IPv6 hybrid-stack.])
+ AC_MSG_RESULT(yes)
+ ],
[AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(no)]
)
-dnl Check for IPv6 Windows Vista option
-dnl Also useful for other OS
-AC_MSG_CHECKING([for IPv6 v4-mapping requirement])
-AC_ARG_WITH(ipv4-mapped,
- [ --with-ipv4-mapped Hybrid-Stack OS require Squid to do any v4-mapping. Requires IPv6 Support.],
- [AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 1, [Enable v4-mapping through v6 sockets]) AC_MSG_RESULT(yes)],
- [AC_DEFINE(IPV6_SPECIAL_V4MAPPED, 0, [Enable v4-mapping through v6 sockets]) AC_MSG_RESULT(no)]
-)
-
-dnl Check for IPv6-pure option
+dnl Check for IPv6-localhost option
AC_MSG_CHECKING([for IPv6-Localhost requirement])
AC_ARG_WITH(localhost-ipv6,
- [ --with-localhost-ipv6 Prefer IPv6 localhost address over IPv4. Requires IPv6 Support.
- Treats 127.0.0.1 and ::1 as identical and converts all inputs of to ::1
- This depends on Dual-Stack support in the OS and all applications
- squid contacts via localhost being IPv6 enabled.
- Default: OFF. Treats these two IP as different, squid.conf must
- define both 127.0.0.1 and ::1 for the localhost ACL, etc. ],
+ AC_HELP_STRING([--with-localhost-ipv6], [ WARNING: This is an RFC violation!][
+ Treat 127.0.0.1 and ::1 as identical and convert all inputs of localhost to ::1
+ This depends on IPv6 support and all applications squid contacts via localhost being IPv6 enabled.]),
[AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [Convert IPv4-localhost requests to IPv6. Default: keep seperate.]) AC_MSG_RESULT(yes)],
[AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [Convert IPv4-localhost requests to IPv6. Default: Keep seperate.]) AC_MSG_RESULT(no)]
)
-# end IPv6-only options
+else
+ # NP: semi-silent failure as IPv4-only mode is perfectly usable on this system.
+ echo "WARNING: IPv6 is not available on this system."
+ 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_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.])
+ AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets])
fi
AC_ARG_ENABLE(zph-qos,
fi
])
-dnl Optional CNAME-Recursion by Internal DNS engine
-AC_MSG_CHECKING([whether DNS CNAME recursion wanted])
-AC_ARG_WITH(dns-cname,
- [ --with-dns-cname Enable CNAME-Recursion in Internal DNS stub.],
- [AC_DEFINE(DNS_CNAME, 1, [ 1 == Enable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(yes)],
- [AC_DEFINE(DNS_CNAME, 0, [ 0 == Disable expermental CNAME recursion inside Squid DNS resolver stub]) AC_MSG_RESULT(no)]
-)
-
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, [
if test "$SQUID_MAXFD" -lt 512 ; then
echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"
echo " cache will be very busy. Please see the FAQ page"
- echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors"
+ echo " http://wiki.squid-cache.org/SquidFaq/TroubleShooting"
echo " on how to increase your filedescriptor limit"
sleep 10
fi
dnl Squid now has limited locale handling ...
dnl on error pages
+use_errlocale=yes
AC_ARG_ENABLE(auto-locale,
-[ --enable-auto-locale This enables squid to lookup translated error pages
- based on the clients request headers. Without it squid
- is limited to a single language set in squid.conf],
-[ if test "$enableval" = "yes" ; then
+ AC_HELP_STRING([--disable-auto-locale],
+ [This prevets 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
echo "Enabling Multi-Language Support"
AC_DEFINE(USE_ERR_LOCALES,1,[Use multi-language support on error pages])
- else
+else
echo "Disabling Multi-Language Support"
AC_DEFINE(USE_ERR_LOCALES,0,[Use multi-language support on error pages])
- fi
-])
-
+fi
dnl Need the debugging version of malloc if available
XTRA_OBJS=''
XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
fi
fi
-
AC_SUBST(XTRA_OBJS)
if test -z "$XTRA_LIBS"; then
src/auth/Makefile \
src/adaptation/Makefile \
src/ICAP/Makefile \
+ src/icmp/Makefile \
src/eCAP/Makefile \
contrib/Makefile \
snmplib/Makefile \
helpers/ntlm_auth/mswin_sspi/Makefile \
helpers/negotiate_auth/Makefile \
helpers/negotiate_auth/mswin_sspi/Makefile \
- helpers/negotiate_auth/squid_kerb_auth/Makefile \
helpers/external_acl/Makefile \
helpers/external_acl/ip_user/Makefile \
helpers/external_acl/ldap_group/Makefile \
# must configure libltdl subdir unconditionally for "make distcheck" to work
AC_CONFIG_SUBDIRS(lib/libLtdl)
-
AC_OUTPUT
#define SQUID_UNIT_TEST 1
-#include "testAuth.h"
#include "squid.h"
+#include "testAuth.h"
#include "authenticate.h"
#include "AuthUserRequest.h"
#include "AuthScheme.h"
CPPUNIT_TEST_SUITE_REGISTRATION( testAuth );
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthConfig );
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthUserRequest );
+ #ifdef HAVE_AUTH_MODULE_BASIC
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthBasicUserRequest );
+ #endif
+ #ifdef HAVE_AUTH_MODULE_DIGEST
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthDigestUserRequest );
+ #endif
+ #ifdef HAVE_AUTH_MODULE_NTLM
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthNTLMUserRequest );
+ #endif
+ #ifdef HAVE_AUTH_MODULE_NEGOTIATE
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthNegotiateUserRequest );
+ #endif
/* Instantiate all auth framework types */
void
{
char const * proxy_auths[][2]= { {"basic","Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="},
- {"digest", "Digest username=\"robertdig\", realm=\"Squid proxy-caching web server\", nonce=\"yy8rQXjEWwixXVBj\", uri=\"/images/bg8.gif\", response=\"f75a7d3edd48d93c681c75dc4fb58700\", qop=auth, nc=00000012, cnonce=\"e2216641961e228e\" "},
- {"ntlm", "NTLM "},
- {"negotiate", "Negotiate "}
- };
+ {"digest", "Digest username=\"robertdig\", realm=\"Squid proxy-caching web server\", nonce=\"yy8rQXjEWwixXVBj\", uri=\"/images/bg8.gif\", response=\"f75a7d3edd48d93c681c75dc4fb58700\", qop=auth, nc=00000012, cnonce=\"e2216641961e228e\" "},
+ {"ntlm", "NTLM "},
+ {"negotiate", "Negotiate "}
+ };
for (unsigned count = 0; count < 4 ; count++) {
if (strcasecmp(type, proxy_auths[count][0]) == 0)
AuthScheme *theScheme;
if ((theScheme = AuthScheme::Find(type_str)) == NULL) {
- fatalf("Unknown authentication scheme '%s'.\n", type_str);
+ return NULL;
+ //fatalf("Unknown authentication scheme '%s'.\n", type_str);
}
config.push_back(theScheme->createConfig());
}
params[]={ {"digest", digest_parms, 2},
- {"basic", basic_parms, 2},
- {"ntlm", ntlm_parms, 1},
- {"negotiate", negotiate_parms, 1}
- };
+ {"basic", basic_parms, 2},
+ {"ntlm", ntlm_parms, 1},
+ {"negotiate", negotiate_parms, 1}
+ };
- for (unsigned scheme=0; scheme < 4; scheme++)
- setup_scheme(getConfig(params[scheme].name), params[scheme].params, params[scheme].paramlength);
+ for (unsigned scheme=0; scheme < 4; scheme++) {
+ AuthConfig *schemeConfig;
+ schemeConfig = getConfig(params[scheme].name);
+ if (schemeConfig != NULL)
+ setup_scheme (schemeConfig, params[scheme].params,
+ params[scheme].paramlength);
+ else
+ fprintf(stderr,"Skipping unknown authentication scheme '%s'.\n",
+ params[scheme].name);
+ }
authenticateInit(&config);
}
}
+ #ifdef HAVE_AUTH_MODULE_BASIC
#include "auth/basic/auth_basic.h"
/* AuthBasicUserRequest::AuthBasicUserRequest works
*/
CPPUNIT_ASSERT_EQUAL(0, strcmp("John", temp->username()));
delete temp;
}
+ #endif /* HAVE_AUTH_MODULE_BASIC */
+ #ifdef HAVE_AUTH_MODULE_DIGEST
#include "auth/digest/auth_digest.h"
/* AuthDigestUserRequest::AuthDigestUserRequest works
*/
CPPUNIT_ASSERT_EQUAL(0, strcmp("John", temp->username()));
delete temp;
}
+ #endif /* HAVE_AUTH_MODULE_DIGEST */
+ #ifdef HAVE_AUTH_MODULE_NTLM
#include "auth/ntlm/auth_ntlm.h"
/* AuthNTLMUserRequest::AuthNTLMUserRequest works
*/
CPPUNIT_ASSERT_EQUAL(0, strcmp("John", temp->username()));
delete temp;
}
+ #endif /* HAVE_AUTH_MODULE_NTLM */
+ #ifdef HAVE_AUTH_MODULE_NEGOTIATE
#include "auth/negotiate/auth_negotiate.h"
/* AuthNegotiateUserRequest::AuthNegotiateUserRequest works
*/
CPPUNIT_ASSERT_EQUAL(0, strcmp("John", temp->username()));
delete temp;
}
+
+ #endif /* HAVE_AUTH_MODULE_NEGOTIATE */