]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes: Add recipe class to overrides
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 11 Feb 2012 02:58:28 +0000 (18:58 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Apr 2012 13:43:33 +0000 (14:43 +0100)
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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/base.bbclass
meta/classes/cross-canadian.bbclass
meta/classes/cross.bbclass
meta/classes/crosssdk.bbclass
meta/classes/native.bbclass
meta/classes/nativesdk.bbclass
meta/conf/bitbake.conf

index 02e1ff5b74dd8f04d5500a26d1e8d7cd6e8550ae..a984eae5bc45c0973727d6cf0f0cab2321890132 100644 (file)
@@ -1,4 +1,5 @@
 BB_DEFAULT_TASK ?= "build"
+CLASSOVERRIDE ?= "class-target"
 
 inherit patch
 inherit staging
index bbf8f161fdcf33d34bab3f42c593c17b7ca87eaa..ed53118a2f22ab90eaa235ff21c0104cb75c822d 100644 (file)
@@ -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}"
 
 #
index 8da30483f4a3871c3937830a6baf5659e2537e61..e998307236a402f6881acb40f215252c77057b39 100644 (file)
@@ -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 = ""
index 67df236b2c3e490d87a56a5aed2c93b6ab6b3649..93aba7022e9415d73464928213e6bc6772ef059b 100644 (file)
@@ -1,5 +1,6 @@
 inherit cross
 
+CLASSOVERRIDE = "class-crosssdk"
 PACKAGE_ARCH = "${SDK_ARCH}"
 python () {
        # set TUNE_PKGARCH to SDK_ARCH
index ffab971cbb436f62848eacebfd5911241e1bea47..bca48d46373871fd7a58dc39bdd070deccb86ad1 100644 (file)
@@ -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:"
 
index 9e20834575813f5a0d692311727b9760393a0120..a58fce20407a4c24eaaef16b3c4fcb29e63fa20c 100644 (file)
@@ -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
index 91fe070718e830dc6b6d2f0c5ee7216bdcee2bc6..9f4e4d4449de32b4865bfdd4872f6df2060b6e79 100644 (file)
@@ -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"