classes: Add recipe class to overrides
PATCH 1/1 classes: Add recipe class to overrides
[This is a tweaked version of one of Khem's patches. The idea here would be to deprecate and ultimately remove the virtclass-native and virtclass-nativesdk overrides]
We have currently no override to detect a recipe being build cross, crosssdk or for target at times we can use virtclass-native and virtclass-nativesdk to override stuff in recipes but we dont have way to modify a variables based on recipe type always.
This patch adds in such an override and in particular makes a target override class available.
With this change now we can say:
EXTRA_OECONF_class-target = "...."
EXTRA_OECONF_class-native = "..."
EXTRA_OECONF_class-nativesdk = "..."
EXTRA_OECONF_class-crosssdk= "..."
Based of an original patch by Khem Raj
---
meta/classes/base.bbclass +1 -0
@@ -1,4 +1,5 @@ BB_DEFAULT_TASK ?= "build" +CLASSOVERRIDE ?= "class-target" inherit patch inherit staging
meta/classes/cross-canadian.bbclass +1 -1
@@ -8,7 +8,7 @@ # SDK packages are built either explicitly by the user, # or indirectly via dependency. No need to be in 'world'. EXCLUDE_FROM_WORLD = "1" - +CLASSOVERRIDE = "class-cross-canadian" STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}:${STAGING_DIR_NATIVE}${bindir_native}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" #
meta/classes/cross.bbclass +1 -0
@@ -4,6 +4,7 @@ inherit relocatable # no need for them to be a direct target of 'world' EXCLUDE_FROM_WORLD = "1" +CLASSOVERRIDE = "class-cross" PACKAGES = "" PACKAGES_DYNAMIC = "" PACKAGES_DYNAMIC_virtclass-native = ""
meta/classes/crosssdk.bbclass +1 -0
@@ -1,5 +1,6 @@ inherit cross +CLASSOVERRIDE = "class-crosssdk" PACKAGE_ARCH = "${SDK_ARCH}" python () { # set TUNE_PKGARCH to SDK_ARCH
meta/classes/native.bbclass +1 -0
@@ -97,6 +97,7 @@ PKG_CONFIG_SYSROOT_DIR = "" # we dont want libc-uclibc or libc-glibc to kick in for native recipes LIBCOVERRIDE = "" +CLASSOVERRIDE = "class-native" PATH =. "${COREBASE}/scripts/native-intercept:"
meta/classes/nativesdk.bbclass +1 -0
@@ -8,6 +8,7 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S # we dont want libc-uclibc or libc-glibc to kick in for nativesdk recipes LIBCOVERRIDE = "" +CLASSOVERRIDE = "class-nativesdk" # # Update PACKAGE_ARCH and PACKAGE_ARCHS
meta/conf/bitbake.conf +2 -1
@@ -637,7 +637,8 @@ AUTO_LIBNAME_PKGS = "${PACKAGES}" # # This works for functions as well, they are really just environment variables. # Default OVERRIDES to make compilation fail fast in case of build system misconfiguration. -OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:forcevariable" +OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable" +CLASSOVERRIDE ?= "class-target" DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}" MACHINEOVERRIDES ?= "${MACHINE}" MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
Quoted 14 lines · Richard Purdie
[This is a tweaked version of one of Khem's patches. The idea here would be to deprecate and ultimately remove the virtclass-native and virtclass-nativesdk overrides]
We have currently no override to detect a recipe being build cross, crosssdk or for target at times we can use virtclass-native and virtclass-nativesdk to override stuff in recipes but we dont have way to modify a variables based on recipe type always.
This patch adds in such an override and in particular makes a target override class available.
With this change now we can say:
Quoted 8 lines
EXTRA_OECONF_class-target = "...."
EXTRA_OECONF_class-native = "..."
EXTRA_OECONF_class-nativesdk = "..."
EXTRA_OECONF_class-crosssdk= "..."Based of an original patch by Khem Raj
Signed-off-by Richard Purdie <[email protected]>
Looks ok to me.
Quoted 92 lines
---
meta/classes/base.bbclass +0
-0@@ -1,4 +1,5 @@BB_DEFAULT_TASK ?= "build"
+CLASSOVERRIDE ?= "class-target"inherit patch
inherit stagingmeta/classes/cross-canadian.bbclass +0
-0@@ -8,7 +8,7 @@ # SDK packages are built either explicitly by the user, # or indirectly via dependency. No need to be in 'world'.EXCLUDE_FROM_WORLD = "1"
meta/classes/cross-canadian.bbclass +1
-1- +CLASSOVERRIDE = "class-cross-canadian"STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}:${STAGING_DIR_NATIVE}${bindir_native}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
#
meta/classes/cross.bbclass +0
-0@@ -4,6 +4,7 @@ inherit relocatable # no need for them to be a direct target of 'world'EXCLUDE_FROM_WORLD = "1"
+CLASSOVERRIDE = "class-cross"
PACKAGES = ""
PACKAGES_DYNAMIC = ""
PACKAGES_DYNAMIC_virtclass-native = ""meta/classes/crosssdk.bbclass +0
-0@@ -1,5 +1,6 @@inherit cross
+CLASSOVERRIDE = "class-crosssdk"
PACKAGE_ARCH = "${SDK_ARCH}"
python () {# set TUNE_PKGARCH to SDK_ARCHmeta/classes/native.bbclass +0
-0@@ -97,6 +97,7 @@ PKG_CONFIG_SYSROOT_DIR = "" # we dont want libc-uclibc or libc-glibc to kick in for native recipesLIBCOVERRIDE = ""
+CLASSOVERRIDE = "class-native"PATH =. "${COREBASE}/scripts/native-intercept:"
meta/classes/nativesdk.bbclass +0
-0@@ -8,6 +8,7 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S # we dont want libc-uclibc or libc-glibc to kick in for nativesdk recipesLIBCOVERRIDE = ""
+CLASSOVERRIDE = "class-nativesdk"#
# UpdatePACKAGE_ARCHandPACKAGE_ARCHSmeta/conf/bitbake.conf +2
-1@@ -637,7 +637,8 @@ AUTO_LIBNAME_PKGS = "${PACKAGES}" # # This works for functions as well, they are really just environment variables. # Default OVERRIDES to make compilation fail fast in case of build system misconfiguration. -OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:forcevariable" +OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable" +CLASSOVERRIDE ?= "class-target"DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}" MACHINEOVERRIDES ?= "${MACHINE}" MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core