summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes-recipe/kernel.bbclass12
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index a76aaee5ba..db4461e551 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -239,6 +239,8 @@ KERNEL_EXTRA_ARGS ?= ""
239EXTRA_OEMAKE += ' CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" STRIP="${KERNEL_STRIP}"' 239EXTRA_OEMAKE += ' CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" STRIP="${KERNEL_STRIP}"'
240EXTRA_OEMAKE += ' HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"' 240EXTRA_OEMAKE += ' HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"'
241EXTRA_OEMAKE += ' HOSTCXX="${BUILD_CXX}" HOSTCXXFLAGS="${BUILD_CXXFLAGS}"' 241EXTRA_OEMAKE += ' HOSTCXX="${BUILD_CXX}" HOSTCXXFLAGS="${BUILD_CXXFLAGS}"'
242# Only for newer kernels (5.19+), native pkg-config variables are set for older kernels when building kernel and modules
243EXTRA_OEMAKE += ' HOSTPKG_CONFIG="pkg-config-native"'
242 244
243KERNEL_ALT_IMAGETYPE ??= "" 245KERNEL_ALT_IMAGETYPE ??= ""
244 246
@@ -356,9 +358,6 @@ kernel_do_compile() {
356 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_DIR" 358 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_DIR"
357 export PKG_CONFIG_SYSROOT_DIR="" 359 export PKG_CONFIG_SYSROOT_DIR=""
358 360
359 # for newer kernels (5.19+) there's a dedicated variable
360 export HOSTPKG_CONFIG="pkg-config-native"
361
362 if [ "${KERNEL_DEBUG_TIMESTAMPS}" != "1" ]; then 361 if [ "${KERNEL_DEBUG_TIMESTAMPS}" != "1" ]; then
363 # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not 362 # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not
364 # be set.... 363 # be set....
@@ -408,6 +407,13 @@ addtask transform_kernel after do_compile before do_install
408 407
409do_compile_kernelmodules() { 408do_compile_kernelmodules() {
410 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE 409 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
410
411 # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
412 export PKG_CONFIG_DIR="${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig"
413 export PKG_CONFIG_PATH="$PKG_CONFIG_DIR:${STAGING_DATADIR_NATIVE}/pkgconfig"
414 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_DIR"
415 export PKG_CONFIG_SYSROOT_DIR=""
416
411 if [ "${KERNEL_DEBUG_TIMESTAMPS}" != "1" ]; then 417 if [ "${KERNEL_DEBUG_TIMESTAMPS}" != "1" ]; then
412 # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not 418 # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not
413 # be set.... 419 # be set....