diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-10-18 23:06:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-10-22 09:47:46 +0100 |
commit | 0c2c3b7656301af20ff88eea61840e05a5bc4f69 (patch) | |
tree | e1588df7630cba55f3b95a59cf2c85d6a32fbc6d /meta/classes | |
parent | 072a6d352f55bbe481b04db02aa6d9cde7d90057 (diff) | |
download | ast2050-yocto-poky-0c2c3b7656301af20ff88eea61840e05a5bc4f69.zip ast2050-yocto-poky-0c2c3b7656301af20ff88eea61840e05a5bc4f69.tar.gz |
base.bbclass: Add PKGTRIPLETS and PKGMLTRIPLETS variables
These variables correspond to the PACKAGE_ARCH list combined with the TARGET_VENDOR
and TARGET_OS values. These can be used to traverse the pkgdata structure.
Setting these once in base.bbclass stops pkgdata needing to recalculate the values
and is also useful for the reworked shlibs code in a patch that will follow this.
(From OE-Core rev: f91322edc8b9f2a5906f3908bde2508ae97f2816)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/base.bbclass | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 801896a..f254306 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -334,6 +334,38 @@ do_build () { : } +def set_packagetriplet(d): + archs = [] + tos = [] + tvs = [] + + archs.append(d.getVar("PACKAGE_ARCHS", True).split()) + tos.append(d.getVar("TARGET_OS", True)) + tvs.append(d.getVar("TARGET_VENDOR", True)) + + def settriplet(d, varname, archs, tos, tvs): + triplets = [] + for i in range(len(archs)): + for arch in archs[i]: + triplets.append(arch + tvs[i] + "-" + tos[i]) + triplets.reverse() + d.setVar(varname, " ".join(triplets)) + + settriplet(d, "PKGTRIPLETS", archs, tos, tvs) + + variants = d.getVar("MULTILIB_VARIANTS", True) or "" + for item in variants.split(): + localdata = bb.data.createCopy(d) + overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item + localdata.setVar("OVERRIDES", overrides) + bb.data.update_data(localdata) + + archs.append(localdata.getVar("PACKAGE_ARCHS", True).split()) + tos.append(localdata.getVar("TARGET_OS", True)) + tvs.append(localdata.getVar("TARGET_VENDOR", True)) + + settriplet(d, "PKGMLTRIPLETS", archs, tos, tvs) + python () { import exceptions, string, re @@ -521,6 +553,8 @@ python () { if ".zip" in srcuri: d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot') + set_packagetriplet(d) + # 'multimachine' handling mach_arch = d.getVar('MACHINE_ARCH', True) pkg_arch = d.getVar('PACKAGE_ARCH', True) |