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/base.bbclass | |
parent | 072a6d352f55bbe481b04db02aa6d9cde7d90057 (diff) | |
download | 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/base.bbclass')
-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 801896a5b9..f254306d3b 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -334,6 +334,38 @@ do_build () { | |||
334 | : | 334 | : |
335 | } | 335 | } |
336 | 336 | ||
337 | def set_packagetriplet(d): | ||
338 | archs = [] | ||
339 | tos = [] | ||
340 | tvs = [] | ||
341 | |||
342 | archs.append(d.getVar("PACKAGE_ARCHS", True).split()) | ||
343 | tos.append(d.getVar("TARGET_OS", True)) | ||
344 | tvs.append(d.getVar("TARGET_VENDOR", True)) | ||
345 | |||
346 | def settriplet(d, varname, archs, tos, tvs): | ||
347 | triplets = [] | ||
348 | for i in range(len(archs)): | ||
349 | for arch in archs[i]: | ||
350 | triplets.append(arch + tvs[i] + "-" + tos[i]) | ||
351 | triplets.reverse() | ||
352 | d.setVar(varname, " ".join(triplets)) | ||
353 | |||
354 | settriplet(d, "PKGTRIPLETS", archs, tos, tvs) | ||
355 | |||
356 | variants = d.getVar("MULTILIB_VARIANTS", True) or "" | ||
357 | for item in variants.split(): | ||
358 | localdata = bb.data.createCopy(d) | ||
359 | overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item | ||
360 | localdata.setVar("OVERRIDES", overrides) | ||
361 | bb.data.update_data(localdata) | ||
362 | |||
363 | archs.append(localdata.getVar("PACKAGE_ARCHS", True).split()) | ||
364 | tos.append(localdata.getVar("TARGET_OS", True)) | ||
365 | tvs.append(localdata.getVar("TARGET_VENDOR", True)) | ||
366 | |||
367 | settriplet(d, "PKGMLTRIPLETS", archs, tos, tvs) | ||
368 | |||
337 | python () { | 369 | python () { |
338 | import exceptions, string, re | 370 | import exceptions, string, re |
339 | 371 | ||
@@ -521,6 +553,8 @@ python () { | |||
521 | if ".zip" in srcuri: | 553 | if ".zip" in srcuri: |
522 | d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot') | 554 | d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot') |
523 | 555 | ||
556 | set_packagetriplet(d) | ||
557 | |||
524 | # 'multimachine' handling | 558 | # 'multimachine' handling |
525 | mach_arch = d.getVar('MACHINE_ARCH', True) | 559 | mach_arch = d.getVar('MACHINE_ARCH', True) |
526 | pkg_arch = d.getVar('PACKAGE_ARCH', True) | 560 | pkg_arch = d.getVar('PACKAGE_ARCH', True) |