Signed-off-by: Alejandro Hernandez Samaniego <[email protected]>
---
 meta/recipes-core/newlib/libgloss_git.bb | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/newlib/libgloss_git.bb 
b/meta/recipes-core/newlib/libgloss_git.bb
index 92bb81050b..0739651eed 100644
--- a/meta/recipes-core/newlib/libgloss_git.bb
+++ b/meta/recipes-core/newlib/libgloss_git.bb
@@ -23,9 +23,18 @@ do_install:append() {
 
         # Remove original directory
         rmdir -p --ignore-fail-on-non-empty ${D}${prefix}/${TARGET_SYS}/lib
-        # Remove empty include dir
-        rmdir ${D}/${prefix}/${TARGET_SYS}/include
-        rmdir ${D}/${prefix}/${TARGET_SYS}/
+
+        # RiscV machines install header files into 
${D}/${prefix}/${TARGET_SYS}/include/machine
+        # move their contents into ${includedir}
+        if [ "$(ls -A ${D}/${prefix}/${TARGET_SYS}/include/machine 
2>/dev/null)" ]; then
+              mkdir ${D}/${includedir}
+              mv ${D}/${prefix}/${TARGET_SYS}/include/machine/* 
${D}/${includedir}
+              rmdir -p --ignore-fail-on-non-empty 
${D}${prefix}/${TARGET_SYS}/include/machine
+        fi
+        if [ -d "${D}/${prefix}/${TARGET_SYS}/include" ]; then
+            rmdir -p --ignore-fail-on-non-empty 
${D}${prefix}/${TARGET_SYS}/include
+        fi
+
 
 }
 
-- 
2.53.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#232889): 
https://lists.openembedded.org/g/openembedded-core/message/232889
Mute This Topic: https://lists.openembedded.org/mt/118260755/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to