Procházet zdrojové kódy

build: Do not enable compression libraries if the headers are not usable

Guillem Jover před 9 roky
rodič
revize
a166517a6d
2 změnil soubory, kde provedl 16 přidání a 16 odebrání
  1. 2 0
      debian/changelog
  2. 14 16
      m4/dpkg-libs.m4

+ 2 - 0
debian/changelog

@@ -5,6 +5,8 @@ dpkg (1.18.14) UNRELEASED; urgency=medium
     - Do not fail tests on missing fakeroot, just skip them.
   * Build system:
     - Fix inversion logic in libmd configure check when requested explicitly.
+    - Do not consider the compressor libraries available in configure if the
+      headers are not usable.
 
   [ Updated man pages translations ]
   * German (Helge Kreutzmann).

+ 14 - 16
m4/dpkg-libs.m4

@@ -38,25 +38,23 @@ AC_DEFUN([DPKG_WITH_COMPRESS_LIB], [
   have_lib$1="no"
   AS_IF([test "x$with_lib$1" != "xno"], [
     AC_CHECK_LIB([$1], [$3], [
-      AC_DEFINE([WITH_LIB]AS_TR_CPP($1), 1,
-        [Define to 1 to use $1 library rather than console tool])
-      AS_IF([test "x$with_lib$1" = "xstatic"], [
-        dpkg_$1_libs="-Wl,-Bstatic -l$1 -Wl,-Bdynamic"
-      ], [
-        dpkg_$1_libs="-l$1"
+      AC_CHECK_HEADER([$2], [
+        have_lib$1="yes"
       ])
-      AS_TR_CPP($1)_LIBS="${AS_TR_CPP($1)_LIBS:+$AS_TR_CPP($1)_LIBS }$dpkg_$1_libs"
+    ])
 
-      AC_CHECK_HEADER([$2], [], [
-        AS_IF([test "x$with_lib$1" != "xcheck"], [
-          AC_MSG_FAILURE([lib$1 header not found])
+    AS_IF([test "x$with_lib$1" = "xyes"], [
+      AS_IF([test "x$have_lib$1" = "xyes"], [
+        AC_DEFINE([WITH_LIB]AS_TR_CPP($1), 1,
+          [Define to 1 to use $1 library rather than console tool])
+        AS_IF([test "x$with_lib$1" = "xstatic"], [
+          dpkg_$1_libs="-Wl,-Bstatic -l$1 -Wl,-Bdynamic"
+        ], [
+          dpkg_$1_libs="-l$1"
         ])
-      ])
-
-      have_lib$1="yes"
-    ], [
-      AS_IF([test "x$with_lib$1" != "xcheck"], [
-        AC_MSG_FAILURE([$1 library not found])
+        AS_TR_CPP($1)_LIBS="${AS_TR_CPP($1)_LIBS:+$AS_TR_CPP($1)_LIBS }$dpkg_$1_libs"
+      ], [
+        AC_MSG_FAILURE([lib$1 library or header not found])
       ])
     ])
   ])