summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
blob: 0b1d6298a9415c626cdc9cc5d81dd697bd6ee3f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From d076de030deb9cafd9b2e82be5d506cebdefad0b Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Mon, 27 Feb 2017 14:43:21 +0200
Subject: [PATCH 1/9] Fix build with musl C library.

Upstream-Status: Pending
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>

---
 configure.ac       | 3 ++-
 rpmio/digest_nss.c | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index c04a2e8d1..c9d9ac16d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,6 +255,7 @@ AC_SEARCH_LIBS(dlopen, [dl])
 # Check for libelf library. Prefer external, otherwise none.
 WITH_LIBELF_LIB=
 AC_CHECK_HEADER([libelf.h])
+AC_CHECK_HEADERS([error.h], [WITH_ERROR_H=yes])
 AC_CHECK_HEADERS([gelf.h], [
 	AC_CHECK_LIB(elf, gelf_getvernaux, [
 	    AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
@@ -263,7 +264,7 @@ AC_CHECK_HEADERS([gelf.h], [
 	])
 ])
 AC_SUBST(WITH_LIBELF_LIB)
-AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
+AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes && test "$WITH_ERROR_H" = yes])
 
 AC_CHECK_HEADERS([dwarf.h], [
   WITH_LIBDWARF=yes
diff --git a/rpmio/digest_nss.c b/rpmio/digest_nss.c
index 992d9acf6..e11920e3e 100644
--- a/rpmio/digest_nss.c
+++ b/rpmio/digest_nss.c
@@ -1,5 +1,6 @@
 #include "system.h"
 
+#include <signal.h>
 #include <pthread.h>
 #include <nss.h>
 #include <sechash.h>
-- 
2.14.2