summaryrefslogtreecommitdiffstats
path: root/meta/classes/utils.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/utils.bbclass')
-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 = '
382 else: 382 else:
383 ret = values 383 ret = values
384 return " ".join(ret) 384 return " ".join(ret)
385
386def 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