summaryrefslogtreecommitdiff
path: root/m4/dpkg-libs.m4
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-05-29 20:37:09 +0200
committerGuillem Jover <guillem@debian.org>2015-05-30 02:57:59 +0200
commitd54b2f1ce614d51b6c9d25e9bb6e94557564db5e (patch)
tree72be6325f0d7eea60b8dcb2a98192e1bf7c5e82e /m4/dpkg-libs.m4
parent07655bd782222b94b84dce2a4200a3a2c04c4d69 (diff)
downloaddpkg-d54b2f1ce614d51b6c9d25e9bb6e94557564db5e.tar.gz
build: Use system libmd if available
This fixes a build failure on at least FreeBSD, and possibly other BSD systems, where the md5.h header provided by libmd maps the md5 functions to namespaced ones, and then there is a mismatch between the always included functions from libcompat and from libmd.
Diffstat (limited to 'm4/dpkg-libs.m4')
-rw-r--r--m4/dpkg-libs.m416
1 files changed, 15 insertions, 1 deletions
diff --git a/m4/dpkg-libs.m4 b/m4/dpkg-libs.m4
index 5c45b0f0b..15c6f8f55 100644
--- a/m4/dpkg-libs.m4
+++ b/m4/dpkg-libs.m4
@@ -1,6 +1,20 @@
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
# Copyright © 2007 Nicolas François <nicolas.francois@centraliens.net>
-# Copyright © 2006, 2009 Guillem Jover <guillem@debian.org>
+# Copyright © 2006, 2009-2012, 2014-2015 Guillem Jover <guillem@debian.org>
+
+# DPKG_LIB_MD
+# -----------
+# Check for the message digest library.
+AC_DEFUN([DPKG_LIB_MD], [
+ AC_ARG_VAR([MD_LIBS], [linker flags for md library])
+ AC_CHECK_HEADERS([md5.h], [
+ AC_CHECK_LIB([md], [MD5Init], [have_libmd=yes], [
+ AC_MSG_FAILURE([md5 digest not found in libmd])
+ ])
+ ])
+ AS_IF([test "x$have_libmd" = "xyes"], [MD_LIBS="-lmd"])
+ AM_CONDITIONAL([HAVE_LIBMD_MD5], [test "x$ac_cv_lib_md_MD5Init" = "xyes"])
+])# DPKG_LIB_MD
# DPKG_WITH_COMPRESS_LIB(NAME, HEADER, FUNC, LINK)
# -------------------------------------------------