[Reproducible-commits] [dpkg] 22/40: build: Use system libmd if available

Jérémy Bobbio lunar at moszumanska.debian.org
Sat May 30 09:52:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit d54b2f1ce614d51b6c9d25e9bb6e94557564db5e
Author: Guillem Jover <guillem at debian.org>
Date:   Fri May 29 20:37:09 2015 +0200

    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.
---
 configure.ac           |  1 +
 debian/changelog       |  1 +
 lib/compat/Makefile.am |  3 ++-
 lib/dpkg/Makefile.am   |  4 +++-
 lib/dpkg/libdpkg.pc.in |  2 +-
 m4/dpkg-libs.m4        | 16 +++++++++++++++-
 6 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6905074..4559fd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,7 @@ DPKG_CODE_COVERAGE
 AC_SYS_LARGEFILE
 
 # Checks for libraries.
+DPKG_LIB_MD
 DPKG_LIB_ZLIB
 DPKG_LIB_BZ2
 DPKG_LIB_LZMA
diff --git a/debian/changelog b/debian/changelog
index cd62e26..6bd2162 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,7 @@ dpkg (1.18.1) UNRELEASED; urgency=low
     DEB_BUILD_OPTIONS. Regression introduced in dpkg 1.14.15.
   * Honor Pre-Depends, Conflicts and Breaks for packages in unpacked and
     half states. Thanks to Ian Jackson <iwj at ubuntu.com>. Closes: #377860
+  * Fix build failure on FreeBSD by actually using libmd if available.
   * Perl modules:
     - Add missing strict and warnings pragmas for submodules.
     - Use non-destructive substitutions inside map.
diff --git a/lib/compat/Makefile.am b/lib/compat/Makefile.am
index fa20fe4..981dc81 100644
--- a/lib/compat/Makefile.am
+++ b/lib/compat/Makefile.am
@@ -32,8 +32,9 @@ libcompat_la_SOURCES = \
 	compat.h \
 	gettext.h
 
-# FIXME: unconditionally include these for now.
+if !HAVE_LIBMD_MD5
 libcompat_la_SOURCES += md5.c md5.h
+endif
 
 if !HAVE_GETOPT
 libcompat_la_SOURCES += getopt.c getopt.h
diff --git a/lib/dpkg/Makefile.am b/lib/dpkg/Makefile.am
index 987a306..ad3b971 100644
--- a/lib/dpkg/Makefile.am
+++ b/lib/dpkg/Makefile.am
@@ -23,10 +23,12 @@ pkgconfig_DATA = libdpkg.pc
 
 lib_LTLIBRARIES = libdpkg.la
 
+libdpkg_la_LDFLAGS =
 if HAVE_LINKER_VERSION_SCRIPT
-libdpkg_la_LDFLAGS = \
+libdpkg_la_LDFLAGS += \
 	-Wl,--version-script=$(srcdir)/libdpkg.map
 endif
+libdpkg_la_LDFLAGS += $(MD_LIBS)
 libdpkg_la_LIBADD = \
 	../compat/libcompat.la
 if BUILD_SHARED
diff --git a/lib/dpkg/libdpkg.pc.in b/lib/dpkg/libdpkg.pc.in
index d0b099f..3adc2fd 100644
--- a/lib/dpkg/libdpkg.pc.in
+++ b/lib/dpkg/libdpkg.pc.in
@@ -7,5 +7,5 @@ Name: libdpkg
 Description: Debian package management system library
 Version: @VERSION@
 Libs: -L${libdir} -ldpkg
-Libs.private: @ZLIB_LIBS@ @LIBLZMA_LIBS@ @BZ2_LIBS@
+Libs.private: @MD_LIBS@ @ZLIB_LIBS@ @LIBLZMA_LIBS@ @BZ2_LIBS@
 Cflags: -I${includedir}
diff --git a/m4/dpkg-libs.m4 b/m4/dpkg-libs.m4
index 5c45b0f..15c6f8f 100644
--- a/m4/dpkg-libs.m4
+++ b/m4/dpkg-libs.m4
@@ -1,6 +1,20 @@
 # Copyright © 2004 Scott James Remnant <scott at netsplit.com>
 # Copyright © 2007 Nicolas François <nicolas.francois at centraliens.net>
-# Copyright © 2006, 2009 Guillem Jover <guillem at debian.org>
+# Copyright © 2006, 2009-2012, 2014-2015 Guillem Jover <guillem at 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)
 # -------------------------------------------------

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list