aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-03-22 07:56:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-24 21:44:26 +0000
commit364f625480dca41d2902e209e4bfb675b1a93dce (patch)
treefc0a15f13e32f707e93d2f5019b78dc0dd81607a /meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
parent7c1e53bb802f021f06231243077d0e007a64274c (diff)
downloadopenembedded-core-contrib-364f625480dca41d2902e209e4bfb675b1a93dce.tar.gz
pixz: Fix build on big-endian/musl systems
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch')
-rw-r--r--meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch b/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
new file mode 100644
index 0000000000..12bae28dc7
--- /dev/null
+++ b/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
@@ -0,0 +1,51 @@
+From c84480be8df6966c538d1fb67ccae2f42cc46421 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 07:36:54 +0000
+Subject: [PATCH 1/2] configure: Detect headers before using them
+
+Current logic does not work when system does not have
+sys/endian.h, since it tried to reuse the cached results
+from first try of detecting htole64 in sys/endian.h which is
+'no' and hence the second try to look into endian.h also
+comes out negative.
+
+So we check for header and then run the test for symbols
+and these symbols are not standard and we need to define _GNU_SOURCE
+for it to work, this issue is exposed by systems using musl e.g.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ configure.ac | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4cb56bc..5e23c50 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -69,12 +69,17 @@ AC_FUNC_MALLOC
+ AC_FUNC_REALLOC
+ AC_FUNC_STRTOD
+ AC_CHECK_FUNCS([memchr memmove memset strerror strtol])
+-AC_CHECK_DECLS([htole64, le64toh],
+- [],
++AC_CHECK_HEADER([sys/endian.h],
+ [
+- AC_CHECK_DECLS([htole64, le64toh], [], [], [#include <endian.h>])
++ AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <sys/endian.h>])
+ ],
+- [#include <sys/endian.h>])
++ [], [])
++
++AC_CHECK_HEADER([endian.h],
++ [
++ AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <endian.h>])
++ ],
++ [], [])
+
+ AC_CONFIG_FILES([Makefile
+ src/Makefile
+--
+1.8.3.1
+