]> err.no Git - varnish/commitdiff
Attempt to detect the availability of RSA's MD5 implementation, and the
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 8 Aug 2006 07:03:35 +0000 (07:03 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 8 Aug 2006 07:03:35 +0000 (07:03 +0000)
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

varnish-cache/bin/varnishd/Makefile.am
varnish-cache/bin/varnishd/hash_classic.c
varnish-cache/configure.ac

index a15bd3053a873df3c6d87eb219d5f600ca670067..0c72bd88cd1119d320df4ee865821b66f3388aed 100644 (file)
@@ -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
index 9b8fc06818609a3339be00b4cd87b2aac3bb52ee..e6c6971c392cd26bd2486a13c52df1d9d090c33c 100644 (file)
 
 #include <cache.h>
 
+#if defined(HASH_CLASSIC_MD5) && !defined(HAVE_MD5)
+/* MD5 is not available */
+#undef HASH_CLASSIC_MD5
+#endif
+
 #ifdef HASH_CLASSIC_MD5
 #include <md5.h>
 #endif
index bfa71b59fbb0ce198d0ad1931ed1d686686445a8..3e8393296d50c967b89be0bb6b432d459247e4cf 100644 (file)
@@ -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