From 62651fe6a8fa54854bd65820cd41b9a8fc32bb8d Mon Sep 17 00:00:00 2001
From: Zbigniew Bodek <zbigniew.bodek@huawei.com>
Date: Thu, 7 Jan 2021 14:22:53 +0000
Subject: [PATCH] Fix incorrect API detection for different Linux flavors

Some Linux builds may have different TARGET_OS, such as
linux-musl or linux-gnueabi.
Fix matching all of those variants into one - "linux".

Signed-off-by: Zbigniew Bodek <zbigniew.bodek@huawei.com>
---
 meta-ohos-foundation/recipes-samgr/samgr/samgr_git.bb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta-ohos-foundation/recipes-samgr/samgr/samgr_git.bb b/meta-ohos-foundation/recipes-samgr/samgr/samgr_git.bb
index a9c8b60f..76f94019 100644
--- a/meta-ohos-foundation/recipes-samgr/samgr/samgr_git.bb
+++ b/meta-ohos-foundation/recipes-samgr/samgr/samgr_git.bb
@@ -20,6 +20,10 @@ LDFLAGS_SAMGR = "${LDFLAGS} -lsec -pthread -L${B} -Wl,-soname,lib${PN}.so.${PVMA
 
 def get_target_adapter(d):
     targetOs = d.getVar('TARGET_OS', True)
+    # generalize targetOs variable for all Linux build variants
+    if "linux" in targetOs:
+        targetOs = "linux"
+
     if targetOs == "linux" or targetOs == "liteos_a":
         targetAdapter = "posix"
     elif targetOs == "liteos_m":
-- 
GitLab