diff mbox series

[oe,meta-oe,16/17] lm_sensors: Fix build on musl

Message ID 20170718031013.44536-16-raj.khem@gmail.com
State New
Headers show
Series [oe,meta-networking,01/17] igmpproxy: Include missing sys/tupes.h and define _GNU_SOURCE | expand

Commit Message

Khem Raj July 18, 2017, 3:10 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...-limit-sys-io.h-header-include-to-just-gl.patch | 88 ++++++++++++++++++++++
 .../recipes-support/lm_sensors/lmsensors_3.4.0.bb  |  6 ++
 2 files changed, 94 insertions(+)
 create mode 100644 meta-oe/recipes-support/lm_sensors/lmsensors/0001-prog-Do-not-limit-sys-io.h-header-include-to-just-gl.patch

-- 
2.13.3

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/lm_sensors/lmsensors/0001-prog-Do-not-limit-sys-io.h-header-include-to-just-gl.patch b/meta-oe/recipes-support/lm_sensors/lmsensors/0001-prog-Do-not-limit-sys-io.h-header-include-to-just-gl.patch
new file mode 100644
index 000000000..fb3878dc3
--- /dev/null
+++ b/meta-oe/recipes-support/lm_sensors/lmsensors/0001-prog-Do-not-limit-sys-io.h-header-include-to-just-gl.patch
@@ -0,0 +1,88 @@ 
+From 727524453f115ddc05109e9bbb3d0e60a7db9185 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Jul 2017 15:05:50 -0700
+Subject: [PATCH] prog: Do not limit sys/io.h header include to just glibc
+
+musl provides it too.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ prog/dump/isadump.c | 6 ------
+ prog/dump/isaset.c  | 6 ------
+ prog/dump/superio.c | 5 -----
+ prog/dump/util.c    | 5 -----
+ 4 files changed, 22 deletions(-)
+
+diff --git a/prog/dump/isadump.c b/prog/dump/isadump.c
+index e0e6f00..8794537 100644
+--- a/prog/dump/isadump.c
++++ b/prog/dump/isadump.c
+@@ -36,13 +36,7 @@
+ #include "util.h"
+ #include "superio.h"
+ 
+-
+-/* To keep glibc2 happy */
+-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+ #include <sys/io.h>
+-#else
+-#include <asm/io.h>
+-#endif
+ 
+ #ifdef __powerpc__
+ unsigned long isa_io_base = 0; /* XXX for now */
+diff --git a/prog/dump/isaset.c b/prog/dump/isaset.c
+index e743755..85a4f64 100644
+--- a/prog/dump/isaset.c
++++ b/prog/dump/isaset.c
+@@ -32,13 +32,7 @@
+ #include <string.h>
+ #include "util.h"
+ 
+-
+-/* To keep glibc2 happy */
+-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+ #include <sys/io.h>
+-#else
+-#include <asm/io.h>
+-#endif
+ 
+ #ifdef __powerpc__
+ unsigned long isa_io_base = 0; /* XXX for now */
+diff --git a/prog/dump/superio.c b/prog/dump/superio.c
+index 64ef27b..906fe55 100644
+--- a/prog/dump/superio.c
++++ b/prog/dump/superio.c
+@@ -20,12 +20,7 @@
+ */
+ 
+ #include <stdlib.h>
+-
+-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+ #include <sys/io.h>
+-#else
+-#include <asm/io.h>
+-#endif
+ 
+ #include "superio.h"
+ 
+diff --git a/prog/dump/util.c b/prog/dump/util.c
+index 874c1b9..197fa64 100644
+--- a/prog/dump/util.c
++++ b/prog/dump/util.c
+@@ -11,12 +11,7 @@
+ #include <stdio.h>
+ #include "util.h"
+ 
+-/* To keep glibc2 happy */
+-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+ #include <sys/io.h>
+-#else
+-#include <asm/io.h>
+-#endif
+ 
+ /* Return 1 if we should continue, 0 if we should abort */
+ int user_ack(int def)
+-- 
+2.13.3
+
diff --git a/meta-oe/recipes-support/lm_sensors/lmsensors_3.4.0.bb b/meta-oe/recipes-support/lm_sensors/lmsensors_3.4.0.bb
index dbc05a898..454a69f40 100644
--- a/meta-oe/recipes-support/lm_sensors/lmsensors_3.4.0.bb
+++ b/meta-oe/recipes-support/lm_sensors/lmsensors_3.4.0.bb
@@ -11,6 +11,7 @@  SRC_URI = "https://github.com/groeck/lm-sensors/archive/V3-4-0.tar.gz \
            file://fancontrol.init \
            file://sensord.init \
            file://0001-lmsensors-sensors-detect-print-a-special-message-whe.patch \
+           file://0001-prog-Do-not-limit-sys-io.h-header-include-to-just-gl.patch \
 "
 SRC_URI[md5sum] = "1e9f117cbfa11be1955adc96df71eadb"
 SRC_URI[sha256sum] = "e334c1c2b06f7290e3e66bdae330a5d36054701ffd47a5dde7a06f9a7402cb4e"
@@ -37,6 +38,11 @@  EXTRA_OEMAKE = 'EXLDFLAGS="${LDFLAGS}" \
         CC="${CC}" AR="${AR}"'
 
 do_compile() {
+    sed -i -e 's:^# \(PROG_EXTRA\):\1:' ${S}/Makefile
+    # Respect LDFLAGS
+    sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' ${S}/Makefile
+    sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \
+                ${S}/lib/Module.mk
     oe_runmake user PROG_EXTRA="sensors sensord"
 }