diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2011-07-29 22:21:58 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-15 15:13:33 +0100 |
commit | 18bba910e04bff75460f408e4557d4bae21ad592 (patch) | |
tree | 6fa1bf589e7e8cb817a8a07cdbadfc8ab87a8ab9 /meta/classes/utils.bbclass | |
parent | 5fc1e6d27f52e2032aa7a8ca20bb90d939d03c77 (diff) | |
download | openembedded-core-18bba910e04bff75460f408e4557d4bae21ad592.tar.gz openembedded-core-18bba910e04bff75460f408e4557d4bae21ad592.tar.bz2 openembedded-core-18bba910e04bff75460f408e4557d4bae21ad592.zip |
utils.bbclass/multilib.class: Added misc supporting functions.
1. Added variable MULTILIB_VARIANTS to store all the instance variants
for multilib extend.
2. Added function all_multilib_tune_values to collect the variable
values for all multilib instance.
3. multilib bbclass handler will save the orignal value of all variables
defined in MULTILIB_SAVE_VARNAME.
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Diffstat (limited to 'meta/classes/utils.bbclass')
-rw-r--r-- | meta/classes/utils.bbclass | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index 8c3a9b87e9..c66c18449a 100644 --- a/meta/classes/utils.bbclass +++ b/meta/classes/utils.bbclass @@ -341,3 +341,32 @@ def base_set_filespath(path, d): for o in overrides.split(":"): filespath.append(os.path.join(p, o)) return ":".join(filespath) + +def extend_variants(d, var, extend, delim=':'): + """Return a string of all bb class extend variants for the given extend""" + variants = [] + whole = d.getVar(var, True) or "" + for ext in whole.split(): + eext = ext.split(delim) + if len(eext) > 1 and eext[0] == extend: + variants.append(eext[1]) + return " ".join(variants) + +def all_multilib_tune_values(d, var, unique=True): + """Return a string of all ${var} in all multilib tune configuration""" + values = [] + value = d.getVar(var, True) or "" + if value != "": + values.append(value) + 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) + value = localdata.getVar(var, True) or "" + if value != "": + values.append(value) + if unique: + values = set(values) + return " ".join(values) |