summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2011-07-29 22:21:58 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-15 15:26:17 +0100
commit375cf1561c0c9356a629495256423b44ddced9b6 (patch)
tree9de44c4b9515654d168d4ea0610a34aa528dc0ec /meta/classes
parent92ad22dc08dd5e615a242425a1d089c4892f5a43 (diff)
downloadpoky-375cf1561c0c9356a629495256423b44ddced9b6.tar.gz
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. (From OE-Core rev: 18bba910e04bff75460f408e4557d4bae21ad592) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/multilib.bbclass7
-rw-r--r--meta/classes/utils.bbclass29
2 files changed, 35 insertions, 1 deletions
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 6e1669fb7f..571b7be961 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -6,7 +6,12 @@ python multilib_virtclass_handler () {
6 variant = e.data.getVar("BBEXTENDVARIANT", True) 6 variant = e.data.getVar("BBEXTENDVARIANT", True)
7 if cls != "multilib" or not variant: 7 if cls != "multilib" or not variant:
8 return 8 return
9 9 save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME", True) or ""
10 for name in save_var_name.split():
11 val=e.data.getVar(name, True)
12 if val:
13 e.data.setVar(name + "_MULTILIB_ORIGINAL", val)
14
10 override = ":virtclass-multilib-" + variant 15 override = ":virtclass-multilib-" + variant
11 16
12 e.data.setVar("MLPREFIX", variant + "-") 17 e.data.setVar("MLPREFIX", variant + "-")
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):
341 for o in overrides.split(":"): 341 for o in overrides.split(":"):
342 filespath.append(os.path.join(p, o)) 342 filespath.append(os.path.join(p, o))
343 return ":".join(filespath) 343 return ":".join(filespath)
344
345def extend_variants(d, var, extend, delim=':'):
346 """Return a string of all bb class extend variants for the given extend"""
347 variants = []
348 whole = d.getVar(var, True) or ""
349 for ext in whole.split():
350 eext = ext.split(delim)
351 if len(eext) > 1 and eext[0] == extend:
352 variants.append(eext[1])
353 return " ".join(variants)
354
355def all_multilib_tune_values(d, var, unique=True):
356 """Return a string of all ${var} in all multilib tune configuration"""
357 values = []
358 value = d.getVar(var, True) or ""
359 if value != "":
360 values.append(value)
361 variants = d.getVar("MULTILIB_VARIANTS", True) or ""
362 for item in variants.split():
363 localdata = bb.data.createCopy(d)
364 overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
365 localdata.setVar("OVERRIDES", overrides)
366 bb.data.update_data(localdata)
367 value = localdata.getVar(var, True) or ""
368 if value != "":
369 values.append(value)
370 if unique:
371 values = set(values)
372 return " ".join(values)