From: des Date: Tue, 8 Aug 2006 07:03:35 +0000 (+0000) Subject: Attempt to detect the availability of RSA's MD5 implementation, and the X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c83bddf2363a0f6b7ebbc4e13774f80d38ee27b;p=varnish Attempt to detect the availability of RSA's MD5 implementation, and the need to link against libmd to get it. Attempt to detect the need for linking against librt to get clock_gettime(). git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@759 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/Makefile.am b/varnish-cache/bin/varnishd/Makefile.am index a15bd305..0c72bd88 100644 --- a/varnish-cache/bin/varnishd/Makefile.am +++ b/varnish-cache/bin/varnishd/Makefile.am @@ -58,5 +58,11 @@ varnishd_LDADD = \ $(top_builddir)/lib/libcompat/libcompat.a \ $(top_builddir)/lib/libvarnish/libvarnish.la \ $(top_builddir)/lib/libvcl/libvcl.la \ - -lpthread \ - -lmd + -lpthread + +if NEED_LIBMD +varnishd_LDADD += -lmd +endif +if NEED_LIBRT +varnishd_LDADD += -lrt +endif diff --git a/varnish-cache/bin/varnishd/hash_classic.c b/varnish-cache/bin/varnishd/hash_classic.c index 9b8fc068..e6c6971c 100644 --- a/varnish-cache/bin/varnishd/hash_classic.c +++ b/varnish-cache/bin/varnishd/hash_classic.c @@ -13,6 +13,11 @@ #include +#if defined(HASH_CLASSIC_MD5) && !defined(HAVE_MD5) +/* MD5 is not available */ +#undef HASH_CLASSIC_MD5 +#endif + #ifdef HASH_CLASSIC_MD5 #include #endif diff --git a/varnish-cache/configure.ac b/varnish-cache/configure.ac index bfa71b59..3e839329 100644 --- a/varnish-cache/configure.ac +++ b/varnish-cache/configure.ac @@ -81,6 +81,16 @@ AC_CHECK_DECL([SO_ACCEPTFILER], , [sys/types.h, sys/socket.h]) +# On some systems, clock_gettime is in librt rather than libc +AC_CHECK_LIB(rt, clock_gettime, need_librt=yes) +AM_CONDITIONAL(NEED_LIBRT, test x$need_librt = xyes) + +AC_CHECK_HEADERS([md5.h]) +if test x$ac_cv_header_md5_h = xyes ; then + AC_CHECK_LIB(md, MD5Init, need_libmd=yes) +fi +AM_CONDITIONAL(NEED_LIBMD, test x$need_libmd = xyes) + AC_CONFIG_FILES([ Makefile bin/Makefile