[meta-selinux,09/12] net-tools: fix selinux build

Submitted by Yi Zhao on Aug. 19, 2021, 4:47 a.m. | Patch ID: 180105

Details

Message ID 20210819044708.105282-9-yi.zhao@windriver.com
State New
Headers show

Commit Message

Yi Zhao Aug. 19, 2021, 4:47 a.m.
Simply adding EXTRA_OEMAKE doesn't work for selinux build. We need to
modify config files in do_configure.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 recipes-extended/net-tools/net-tools_selinux.inc | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/recipes-extended/net-tools/net-tools_selinux.inc b/recipes-extended/net-tools/net-tools_selinux.inc
index 1bcf7be..6454205 100644
--- a/recipes-extended/net-tools/net-tools_selinux.inc
+++ b/recipes-extended/net-tools/net-tools_selinux.inc
@@ -1,5 +1,10 @@ 
-inherit selinux
+inherit enable-selinux
 
-DEPENDS += "${LIBSELINUX}"
+PACKAGECONFIG[selinux] = ",,libselinux"
 
-EXTRA_OEMAKE += "${@target_selinux(d, 'HAVE_SELINUX=1', 'HAVE_SELINUX=0')}"
+do_configure:append() {
+    if ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'true', 'false', d)} ; then
+        echo "#define HAVE_SELINUX 1" >> ${S}/config.h
+        echo "HAVE_SELINUX=1" >> ${S}/config.make
+    fi
+}