* base.bbclass: Add PKGTRIPLETS and PKGMLTRIPLETS variables
@ 2012-10-19 14:46 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-10-19 14:46 UTC (permalink / raw)
To: openembedded-core
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index f8efbf9..860f390 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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-10-19 15:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 14:46 base.bbclass: Add PKGTRIPLETS and PKGMLTRIPLETS variables Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox