dnl Configuration input file for Squid
dnl
-dnl $Id: configure.in,v 1.483 2007/11/07 10:20:46 amosjeffries Exp $
+dnl $Id: configure.in,v 1.484 2007/11/11 02:26:58 amosjeffries Exp $
dnl
dnl
dnl
AC_CONFIG_AUX_DIR(cfgaux)
AC_CONFIG_SRCDIR([src/main.cc])
AM_INIT_AUTOMAKE([tar-ustar])
-AC_REVISION($Revision: 1.483 $)dnl
+AC_REVISION($Revision: 1.484 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AM_MAINTAINER_MODE
fi
AM_CONDITIONAL(ENABLE_HTCP, [test x$USE_HTCP = xtrue])
+dnl SSL is not enabled by default.
AM_CONDITIONAL(ENABLE_SSL, false)
+dnl Default is to use OpenSSL when available
AC_ARG_ENABLE(ssl,
[ --enable-ssl Enable ssl gatewaying support using OpenSSL],
[ if test "$enableval" != "no"; then
fi
])
-AM_CONDITIONAL(NEED_OWN_MD5, true)
-
+dnl User may specify OpenSSL is needed from a non-standard location
AC_ARG_WITH(openssl,
[ --with-openssl[=prefix]
Compile with the OpenSSL libraries. The path to
USE_OPENSSL=1
esac
])
-
if test -n "$USE_OPENSSL"; then
echo "Using OpenSSL MD5 implementation"
AC_DEFINE(USE_OPENSSL,1,[Define this to make use of the OpenSSL libraries for MD5 calculation rather than Squid's own MD5 implementation or if building with SSL encryption (USE_SSL)])
- AM_CONDITIONAL(NEED_OWN_MD5, false)
if test -z "$SSLLIB"; then
SSLLIB="-lcrypto" # for MD5 routines
fi
fi
AC_SUBST(SSLLIB)
+
AC_ARG_ENABLE(forw-via-db,
[ --enable-forw-via-db Enable Forw/Via database],
[ if test "$enableval" = "yes" ; then
sys/ioctl.h \
sys/param.h \
sys/prctl.h \
+ sys/md5.h \
sys/msg.h \
sys/resource.h \
sys/select.h\
dnl Check for libcrypt
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"])
+AC_CHECK_LIB(crypt, crypt, [CRYPTLIB=" -lcrypt "])
+
+dnl Solaris10 provides MD5 natively through libmd5
+AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB+=" -lmd5 "])
+
AC_SUBST(CRYPTLIB)
dnl Check for libdl, used by auth_modules/PAM
#ifndef SQUID_MD5_H
#define SQUID_MD5_H
-#if USE_OPENSSL
-
/*
* If Squid is compiled with OpenSSL then we use the MD5 routines
* from there via some wrapper macros, and the rest of this file is ignored..
*/
+#define USE_SQUID_MD5 0
-#if HAVE_OPENSSL_MD5_H
+#if USE_OPENSSL && HAVE_OPENSSL_MD5_H
#include <openssl/md5.h>
-#else
-#error Cannot find OpenSSL headers
-#endif
/* Hack to adopt Squid to the OpenSSL syntax */
#define MD5_DIGEST_CHARS MD5_DIGEST_LENGTH
#define MD5Update MD5_Update
#define MD5Final MD5_Final
-#else /* USE_OPENSSL */
+#elif USE_OPENSSL && !HAVE_OPENSSL_MD5_H
+#error Cannot find OpenSSL MD5 headers
+
+#elif HAVE_SYS_MD5_H
+/*
+ * Solaris 10 provides MD5 as part of the system.
+ */
+#include <sys/md5.h>
+
+/*
+ * They also define MD5_CTX with different field names
+ * fortunately we do not access it directly in the squid code.
+ */
+
+/* Hack to adopt Squid to the OpenSSL syntax */
+#define MD5_DIGEST_CHARS MD5_DIGEST_LENGTH
+
+#else /* NEED_OWN_MD5 */
+
+ /* Turn on internal MD5 code */
+#undef USE_SQUID_MD5
+#define USE_SQUID_MD5 1
/*
* This is the header file for the MD5 message-digest algorithm.
*/
#include "config.h"
-/* MS VisualStudio Projects are monolithic, so we need the following
+#include "md5.h"
+
+/*
+ * Now that we have several alternatives the MD5 files are
+ * passed in by default. But a header-selection decides whether
+ * this provided version is to be built.
+ * TODO: may obsolete the MSV #if below.
+ */
+#if USE_SQUID_MD5
+
+/* MS VisualStudio Projects are monolithic, so we need USE_SSL
* #if to exclude the MD5 code from compile process when we are
* building the SSL support.
*/
#if !USE_SSL
+
#if HAVE_STRING_H
#include <string.h> /* for memcpy() */
#endif
#include <netinet/in.h> /* for ntohl() */
#endif
-#include "md5.h"
-
#ifdef WORDS_BIGENDIAN
void byteSwap(uint32_t *, unsigned);
buf[3] += d;
}
-#endif
-#endif
+#endif /* !ASM_MD5 */
+#endif /* !USE_SSL */
+#endif /* !USE_SQUID_MD5 */