diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-01-30 20:37:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-04 23:39:02 +0000 |
commit | 3473962f04946b61eb50e65ed7fa3143259b35ea (patch) | |
tree | bc106fa9e2b58d3afe2a3680d654797ff2429863 /meta/recipes-support | |
parent | 42e37d7d5101f0a82a55d54276c9f2b619696e8c (diff) | |
download | poky-3473962f04946b61eb50e65ed7fa3143259b35ea.tar.gz |
nss-myhostname: Fix build on musl
provide needed data types if nss.h is not available
(From OE-Core rev: 72f2e77d8a2430b37227ced682d86a427cccd452)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r-- | meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch | 53 | ||||
-rw-r--r-- | meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb | 4 |
2 files changed, 56 insertions, 1 deletions
diff --git a/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch b/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch new file mode 100644 index 0000000000..82f25743af --- /dev/null +++ b/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From d1345871b992f9a055c968963967e728da1a7ffb Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 30 Jan 2016 20:29:06 +0000 | ||
4 | Subject: [PATCH] nss-myhostname: Check for nss.h presense before use | ||
5 | |||
6 | We do not have nss.h on musl e.g. and configury is already checking for | ||
7 | nss.h presence, use this to define needed data structures if nss.h is | ||
8 | missing on a given libc implementation on a platform | ||
9 | |||
10 | include stdint.h for uint32_h definition | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | Upstream-Status: Pending | ||
15 | |||
16 | nss-myhostname.c | 20 ++++++++++++++++++++ | ||
17 | 1 file changed, 20 insertions(+) | ||
18 | |||
19 | diff --git a/nss-myhostname.c b/nss-myhostname.c | ||
20 | index 293166c..6f287f5 100644 | ||
21 | --- a/nss-myhostname.c | ||
22 | +++ b/nss-myhostname.c | ||
23 | @@ -21,7 +21,27 @@ | ||
24 | ***/ | ||
25 | |||
26 | #include <limits.h> | ||
27 | +#include <stdint.h> | ||
28 | +#ifdef HAVE_NSS_H | ||
29 | #include <nss.h> | ||
30 | +#else | ||
31 | +enum nss_status { | ||
32 | + NSS_STATUS_TRYAGAIN = -2, | ||
33 | + NSS_STATUS_UNAVAIL, | ||
34 | + NSS_STATUS_NOTFOUND, | ||
35 | + NSS_STATUS_SUCCESS, | ||
36 | + NSS_STATUS_RETURN | ||
37 | +}; | ||
38 | +/* Data structure used for the 'gethostbyname4_r' function. */ | ||
39 | +struct gaih_addrtuple | ||
40 | + { | ||
41 | + struct gaih_addrtuple *next; | ||
42 | + char *name; | ||
43 | + int family; | ||
44 | + uint32_t addr[4]; | ||
45 | + uint32_t scopeid; | ||
46 | + }; | ||
47 | +#endif | ||
48 | #include <sys/types.h> | ||
49 | #include <netdb.h> | ||
50 | #include <errno.h> | ||
51 | -- | ||
52 | 2.7.0 | ||
53 | |||
diff --git a/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb b/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb index bbce9e9af0..de5b7cf598 100644 --- a/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb +++ b/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb | |||
@@ -6,7 +6,9 @@ HOMEPAGE = "http://0pointer.de/lennart/projects/nss-myhostname/" | |||
6 | LICENSE = "LGPLv2.1" | 6 | LICENSE = "LGPLv2.1" |
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1" | 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1" |
8 | 8 | ||
9 | SRC_URI = "http://0pointer.de/lennart/projects/nss-myhostname/nss-myhostname-${PV}.tar.gz" | 9 | SRC_URI = "http://0pointer.de/lennart/projects/nss-myhostname/nss-myhostname-${PV}.tar.gz \ |
10 | file://0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch \ | ||
11 | " | ||
10 | 12 | ||
11 | SRC_URI[md5sum] = "d4ab9ac36c053ab8fb836db1cbd4a48f" | 13 | SRC_URI[md5sum] = "d4ab9ac36c053ab8fb836db1cbd4a48f" |
12 | SRC_URI[sha256sum] = "2ba744ea8d578d1c57c85884e94a3042ee17843a5294434d3a7f6c4d67e7caf2" | 14 | SRC_URI[sha256sum] = "2ba744ea8d578d1c57c85884e94a3042ee17843a5294434d3a7f6c4d67e7caf2" |