From 72f2e77d8a2430b37227ced682d86a427cccd452 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 30 Jan 2016 20:37:07 +0000 Subject: nss-myhostname: Fix build on musl provide needed data types if nss.h is not available Signed-off-by: Khem Raj --- ...tname-Check-for-nss.h-presense-before-use.patch | 53 ++++++++++++++++++++++ .../nss-myhostname/nss-myhostname_0.3.bb | 4 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch (limited to 'meta/recipes-support/nss-myhostname') 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 @@ +From d1345871b992f9a055c968963967e728da1a7ffb Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Jan 2016 20:29:06 +0000 +Subject: [PATCH] nss-myhostname: Check for nss.h presense before use + +We do not have nss.h on musl e.g. and configury is already checking for +nss.h presence, use this to define needed data structures if nss.h is +missing on a given libc implementation on a platform + +include stdint.h for uint32_h definition + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + nss-myhostname.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/nss-myhostname.c b/nss-myhostname.c +index 293166c..6f287f5 100644 +--- a/nss-myhostname.c ++++ b/nss-myhostname.c +@@ -21,7 +21,27 @@ + ***/ + + #include ++#include ++#ifdef HAVE_NSS_H + #include ++#else ++enum nss_status { ++ NSS_STATUS_TRYAGAIN = -2, ++ NSS_STATUS_UNAVAIL, ++ NSS_STATUS_NOTFOUND, ++ NSS_STATUS_SUCCESS, ++ NSS_STATUS_RETURN ++}; ++/* Data structure used for the 'gethostbyname4_r' function. */ ++struct gaih_addrtuple ++ { ++ struct gaih_addrtuple *next; ++ char *name; ++ int family; ++ uint32_t addr[4]; ++ uint32_t scopeid; ++ }; ++#endif + #include + #include + #include +-- +2.7.0 + 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/" LICENSE = "LGPLv2.1" LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1" -SRC_URI = "http://0pointer.de/lennart/projects/nss-myhostname/nss-myhostname-${PV}.tar.gz" +SRC_URI = "http://0pointer.de/lennart/projects/nss-myhostname/nss-myhostname-${PV}.tar.gz \ + file://0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch \ + " SRC_URI[md5sum] = "d4ab9ac36c053ab8fb836db1cbd4a48f" SRC_URI[sha256sum] = "2ba744ea8d578d1c57c85884e94a3042ee17843a5294434d3a7f6c4d67e7caf2" -- cgit 1.2.3-korg