diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-15 10:03:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-16 23:08:19 +0000 |
commit | db2255dc0bb57d37464de6b4552ee80a7d5c1368 (patch) | |
tree | 76bcc11dbd0cdf3e6b7a82e8695403b402b8574a | |
parent | 0e35e33b37be9204a36eacbc3565cec26d1c6745 (diff) | |
download | poky-db2255dc0bb57d37464de6b4552ee80a7d5c1368.tar.gz |
cross-canadian/meta-environment: Allow modification of TARGET_OS to be optional
There are some cases we want the manipulation cross-canadian performance
on TARGET_OS, there are also cases like meta-environment where we do not
want this manipulation.
We did try and use immediate expansion to avoid this problem and it
works in the non multilib case. If we have a multilib that used an
extension, like for example:
require conf/multilib.conf
MULTILIBS = "multilib:lib32 multilib:lib64"
DEFAULTTUNE = "mips32r2"
DEFAULTTUNE_virtclass-multilib-lib32 = "mips64-n32"
DEFAULTTUNE_virtclass-multilib-lib64 = "mips64"
then the n32 extension case will be misconfigured.
It turns out saving an unexpanded variable is hard. The best I could
come up with was:
SAVEDTOS := "${@d.getVar('TARGET_OS', False).replace("{", "*")}"
and then
localdata.setVar("TARGET_OS", d.getVar("SAVEDOS", False).replace('*','{'))
which is rather evil, I'd challenge someone to come up with a nicer way
of making it work though!
Rather than the above madness, we modify cross-canadian to make the
problamtic code conditional.
This fixes the original issue (where a linux-gnuspe target was seeing
'linux') of
http://cgit.openembedded.org/openembedded-core/commit/?id=0038634ee6e2b6035c023a2702547f20f67c103a
but also fixes the multilib one.
(From OE-Core rev: 85ff3d6491c54aa712ed238c561742cda4f4ba07)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/cross-canadian.bbclass | 4 | ||||
-rw-r--r-- | meta/recipes-core/meta/meta-environment.bb | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass index fec6438c60..a8565e91e3 100644 --- a/meta/classes/cross-canadian.bbclass +++ b/meta/classes/cross-canadian.bbclass | |||
@@ -16,6 +16,7 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S | |||
16 | # | 16 | # |
17 | PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" | 17 | PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" |
18 | CANADIANEXTRAOS = "" | 18 | CANADIANEXTRAOS = "" |
19 | MODIFYTOS ??= "1" | ||
19 | python () { | 20 | python () { |
20 | archs = d.getVar('PACKAGE_ARCHS', True).split() | 21 | archs = d.getVar('PACKAGE_ARCHS', True).split() |
21 | sdkarchs = [] | 22 | sdkarchs = [] |
@@ -23,6 +24,9 @@ python () { | |||
23 | sdkarchs.append(arch + '-${SDKPKGSUFFIX}') | 24 | sdkarchs.append(arch + '-${SDKPKGSUFFIX}') |
24 | d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs)) | 25 | d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs)) |
25 | 26 | ||
27 | # Allow the following code segment to be disabled, e.g. meta-environment | ||
28 | if d.getVar("MODIFYTOS", True) != "1": | ||
29 | return | ||
26 | # PowerPC can build "linux" and "linux-gnuspe" | 30 | # PowerPC can build "linux" and "linux-gnuspe" |
27 | tarch = d.getVar("TARGET_ARCH", True) | 31 | tarch = d.getVar("TARGET_ARCH", True) |
28 | if tarch == "powerpc": | 32 | if tarch == "powerpc": |
diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb index b3737bb5cf..5d72e38e91 100644 --- a/meta/recipes-core/meta/meta-environment.bb +++ b/meta/recipes-core/meta/meta-environment.bb | |||
@@ -6,9 +6,9 @@ PR = "r8" | |||
6 | 6 | ||
7 | EXCLUDE_FROM_WORLD = "1" | 7 | EXCLUDE_FROM_WORLD = "1" |
8 | 8 | ||
9 | ORIGOS := "${TARGET_OS}" | 9 | MODIFYTOS = "0" |
10 | 10 | ||
11 | REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${ORIGOS}" | 11 | REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" |
12 | 12 | ||
13 | inherit toolchain-scripts | 13 | inherit toolchain-scripts |
14 | TOOLCHAIN_NEED_CONFIGSITE_CACHE += "zlib" | 14 | TOOLCHAIN_NEED_CONFIGSITE_CACHE += "zlib" |
@@ -30,7 +30,6 @@ python do_generate_content() { | |||
30 | 30 | ||
31 | # make sure we only use the SDKTARGETSYSROOT value from 'd' | 31 | # make sure we only use the SDKTARGETSYSROOT value from 'd' |
32 | localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT', True)) | 32 | localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT', True)) |
33 | localdata.setVar('TARGET_OS', d.getVar('ORIGOS', True)) | ||
34 | localdata.setVar('libdir', d.getVar('target_libdir', False)) | 33 | localdata.setVar('libdir', d.getVar('target_libdir', False)) |
35 | 34 | ||
36 | # Process DEFAULTTUNE | 35 | # Process DEFAULTTUNE |