diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-26 17:22:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-28 10:16:03 +0100 |
commit | 153da9400002a75bf4003f0c8779e9099e0185bc (patch) | |
tree | b61be04727a7af3c379d80bc19ab89849de9fabe /meta | |
parent | de4fffe5581301ed5b3f6611f3a0c749b0945c0e (diff) | |
download | poky-153da9400002a75bf4003f0c8779e9099e0185bc.tar.gz |
utils: Add all_multilib_tune_list function
Its useful to be able to query a list of variables to obtain the values
in each multilib context. This adds such a function which works even
if called in the non-default recipe context.
(From OE-Core rev: 4202a09dece07c0d3f654c2b1ae504a031b4ee90)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/utils.bbclass | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index 3c2a14fa42..800b56578c 100644 --- a/meta/classes/utils.bbclass +++ b/meta/classes/utils.bbclass | |||
@@ -382,3 +382,40 @@ def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' | |||
382 | else: | 382 | else: |
383 | ret = values | 383 | ret = values |
384 | return " ".join(ret) | 384 | return " ".join(ret) |
385 | |||
386 | def all_multilib_tune_list(vars, d): | ||
387 | """ | ||
388 | Return a list of ${VAR} for each variable VAR in vars from each | ||
389 | multilib tune configuration. | ||
390 | Is safe to be called from a multilib recipe/context as it can | ||
391 | figure out the original tune and remove the multilib overrides. | ||
392 | """ | ||
393 | values = {} | ||
394 | for v in vars: | ||
395 | values[v] = [] | ||
396 | |||
397 | localdata = bb.data.createCopy(d) | ||
398 | overrides = localdata.getVar("OVERRIDES", False).split(":") | ||
399 | newoverrides = [] | ||
400 | for o in overrides: | ||
401 | if not o.startswith("virtclass-multilib-"): | ||
402 | newoverrides.append(o) | ||
403 | localdata.setVar("OVERRIDES", ":".join(newoverrides)) | ||
404 | localdata.setVar("MLPREFIX", "") | ||
405 | origdefault = localdata.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL", True) | ||
406 | if origdefault: | ||
407 | localdata.setVar("DEFAULTTUNE", origdefault) | ||
408 | bb.data.update_data(localdata) | ||
409 | values['ml'] = [''] | ||
410 | for v in vars: | ||
411 | values[v].append(localdata.getVar(v, True)) | ||
412 | variants = d.getVar("MULTILIB_VARIANTS", True) or "" | ||
413 | for item in variants.split(): | ||
414 | localdata = bb.data.createCopy(d) | ||
415 | overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item | ||
416 | localdata.setVar("OVERRIDES", overrides) | ||
417 | localdata.setVar("MLPREFIX", item + "-") | ||
418 | bb.data.update_data(localdata) | ||
419 | values[v].append(localdata.getVar(v, True)) | ||
420 | values['ml'].append(item) | ||
421 | return values | ||