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:26:17 +0100 |
commit | 375cf1561c0c9356a629495256423b44ddced9b6 (patch) | |
tree | 9de44c4b9515654d168d4ea0610a34aa528dc0ec /meta | |
parent | 92ad22dc08dd5e615a242425a1d089c4892f5a43 (diff) | |
download | poky-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')
-rw-r--r-- | meta/classes/multilib.bbclass | 7 | ||||
-rw-r--r-- | meta/classes/utils.bbclass | 29 | ||||
-rw-r--r-- | meta/conf/bitbake.conf | 1 | ||||
-rw-r--r-- | meta/conf/multilib.conf | 3 |
4 files changed, 39 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 | |||
345 | def 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 | |||
355 | def 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) | ||
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 7bb68b8dc5..b30951648d 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -749,3 +749,4 @@ BB_HASHTASK_WHITELIST ?= "(.*-cross$|.*-native$|.*-cross-initial$|.*-cross-inter | |||
749 | BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM USER FILESPATH USERNAME STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE" | 749 | BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM USER FILESPATH USERNAME STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE" |
750 | 750 | ||
751 | MLPREFIX ??= "" | 751 | MLPREFIX ??= "" |
752 | MULTILIB_VARIANTS ??= "" | ||
diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf index f2a2002355..36793d247e 100644 --- a/meta/conf/multilib.conf +++ b/meta/conf/multilib.conf | |||
@@ -1,6 +1,9 @@ | |||
1 | 1 | ||
2 | baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or 'lib'}" | 2 | baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or 'lib'}" |
3 | 3 | ||
4 | MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}" | ||
5 | MULTILIB_SAVE_VARNAME = "DEFAULTTUNE" | ||
6 | |||
4 | MULTILIBS ??= "multilib:lib32" | 7 | MULTILIBS ??= "multilib:lib32" |
5 | 8 | ||
6 | BBCLASSEXTEND_append_pn-acl = " ${MULTILIBS}" | 9 | BBCLASSEXTEND_append_pn-acl = " ${MULTILIBS}" |