summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-26 17:22:24 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-27 13:13:10 +0100
commit4202a09dece07c0d3f654c2b1ae504a031b4ee90 (patch)
treed3661d2494348cf77194b93793ada9c3ed3f083a /meta/classes
parentbc5d1fdea674e842e4b0c45b38782930ec133051 (diff)
downloadopenembedded-core-4202a09dece07c0d3f654c2b1ae504a031b4ee90.tar.gz
openembedded-core-4202a09dece07c0d3f654c2b1ae504a031b4ee90.tar.bz2
openembedded-core-4202a09dece07c0d3f654c2b1ae504a031b4ee90.zip
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/utils.bbclass37
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 = '
else:
ret = values
return " ".join(ret)
+
+def all_multilib_tune_list(vars, d):
+ """
+ Return a list of ${VAR} for each variable VAR in vars from each
+ multilib tune configuration.
+ Is safe to be called from a multilib recipe/context as it can
+ figure out the original tune and remove the multilib overrides.
+ """
+ values = {}
+ for v in vars:
+ values[v] = []
+
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False).split(":")
+ newoverrides = []
+ for o in overrides:
+ if not o.startswith("virtclass-multilib-"):
+ newoverrides.append(o)
+ localdata.setVar("OVERRIDES", ":".join(newoverrides))
+ localdata.setVar("MLPREFIX", "")
+ origdefault = localdata.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL", True)
+ if origdefault:
+ localdata.setVar("DEFAULTTUNE", origdefault)
+ bb.data.update_data(localdata)
+ values['ml'] = ['']
+ for v in vars:
+ values[v].append(localdata.getVar(v, True))
+ 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)
+ localdata.setVar("MLPREFIX", item + "-")
+ bb.data.update_data(localdata)
+ values[v].append(localdata.getVar(v, True))
+ values['ml'].append(item)
+ return values