[16/20] linux-yocto: export pkgconfig variables to devshell

Message ID 0f6b65320dc8949c11afbdf81cc1980ceca94762.1637703810.git.bruce.ashfield@gmail.com
State Accepted, archived
Commit ea71e50be2de5b7fc81f466ea5cd48c2f1e0ef6b
Headers show
Series [01/20] linux-yocto/5.15: update to v5.15.2 | expand

Commit Message

Bruce Ashfield Nov. 23, 2021, 9:57 p.m. UTC
From: Bruce Ashfield <bruce.ashfield@gmail.com>

Not all of the kernel host/build Makefiles allow pkg-config
to be overriden to pkg-config-native. Exporting these variables
allow us to debug host tool issues with the kernel build.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/recipes-kernel/linux/linux-yocto.inc | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch

diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index 15fc7ff724..a3b2416367 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -61,3 +61,12 @@  KERNEL_FEATURES:append:qemuall=" features/kernel-sample/kernel-sample.scc"
 
 KERNEL_DEBUG_OPTIONS ?= "stack"
 KERNEL_EXTRA_ARGS:append:x86-64 = "${@bb.utils.contains('KERNEL_DEBUG_OPTIONS', 'stack', 'HOST_LIBELF_LIBS="-L${RECIPE_SYSROOT_NATIVE}/usr/lib/pkgconfig/../../../usr/lib/ -lelf"', '', d)}"
+
+do_devshell:prepend() {
+    # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
+    d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig")
+    d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig")
+    d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}")
+    d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1")
+    d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
+}