r759 - in trunk/varnish-cache: . bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Tue Aug 8 09:03:36 CEST 2006


Author: des
Date: 2006-08-08 09:03:35 +0200 (Tue, 08 Aug 2006)
New Revision: 759

Modified:
   trunk/varnish-cache/bin/varnishd/Makefile.am
   trunk/varnish-cache/bin/varnishd/hash_classic.c
   trunk/varnish-cache/configure.ac
Log:
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().

Modified: trunk/varnish-cache/bin/varnishd/Makefile.am
===================================================================
--- trunk/varnish-cache/bin/varnishd/Makefile.am	2006-08-08 07:01:28 UTC (rev 758)
+++ trunk/varnish-cache/bin/varnishd/Makefile.am	2006-08-08 07:03:35 UTC (rev 759)
@@ -58,5 +58,11 @@
 	$(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

Modified: trunk/varnish-cache/bin/varnishd/hash_classic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_classic.c	2006-08-08 07:01:28 UTC (rev 758)
+++ trunk/varnish-cache/bin/varnishd/hash_classic.c	2006-08-08 07:03:35 UTC (rev 759)
@@ -13,6 +13,11 @@
 
 #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

Modified: trunk/varnish-cache/configure.ac
===================================================================
--- trunk/varnish-cache/configure.ac	2006-08-08 07:01:28 UTC (rev 758)
+++ trunk/varnish-cache/configure.ac	2006-08-08 07:03:35 UTC (rev 759)
@@ -81,6 +81,16 @@
 	,
 	[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




More information about the varnish-commit mailing list