From ace63e94e346637b116a0365b89fbfd2ff1a393b Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Mon, 22 Nov 2021 23:22:55 -0500 Subject: kernel: export native PKGCONFIG variables In a similar manner to cml1.bbclass, we export the pkg-config variables to allow a direct call to pkg-config access to the native sysroot versus the target sysroot. The kernel doesn't use pkg-config for target configuration, and has many explicit calls to pkg-config, without the possibility of easy override to pkg-config-native. The calls to pkg-config could be made cross friendly via replacement with make variables, but until that effort is undertaken upstream, we need a bridge approach. In particular, this is required for dtschema validation, which is a requirement in kernel 5.16+ (From OE-Core rev: 9172d61c57e23682c3d2c25701cbd53c84d01a27) Signed-off-by: Bruce Ashfield Signed-off-by: Richard Purdie --- meta/classes/kernel.bbclass | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index e0b752de19..2d219cb5e5 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -326,6 +326,13 @@ KERNEL_DEBUG_TIMESTAMPS ??= "0" kernel_do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE + + # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native) + export PKG_CONFIG_DIR="${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_DIR:${STAGING_DATADIR_NATIVE}/pkgconfig" + export PKG_CONFIG_LIBDIR="$PKG_CONFIG_DIR" + export PKG_CONFIG_SYSROOT_DIR="" + if [ "${KERNEL_DEBUG_TIMESTAMPS}" != "1" ]; then # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not # be set.... -- cgit v1.2.3-54-g00ecf