]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel: export native PKGCONFIG variables
authorBruce Ashfield <bruce.ashfield@gmail.com>
Tue, 23 Nov 2021 04:22:55 +0000 (23:22 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 26 Nov 2021 16:58:29 +0000 (16:58 +0000)
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+

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
meta/classes/kernel.bbclass

index e0b752de197b8fab81b7d67a45f7a5712f0e7d36..2d219cb5e5cb0e698b47e77a94008011a1b454c9 100644 (file)
@@ -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....