diff options
Diffstat (limited to 'meta/classes/multilib_global.bbclass')
-rw-r--r-- | meta/classes/multilib_global.bbclass | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass index 2da66a5e6e..b76fd94162 100644 --- a/meta/classes/multilib_global.bbclass +++ b/meta/classes/multilib_global.bbclass | |||
@@ -8,55 +8,31 @@ python multilib_virtclass_handler_global () { | |||
8 | if bb.data.inherits_class('kernel', e.data) or bb.data.inherits_class('module-base', e.data): | 8 | if bb.data.inherits_class('kernel', e.data) or bb.data.inherits_class('module-base', e.data): |
9 | variants = (e.data.getVar("MULTILIB_VARIANTS", True) or "").split() | 9 | variants = (e.data.getVar("MULTILIB_VARIANTS", True) or "").split() |
10 | 10 | ||
11 | import oe.classextend | ||
12 | clsextends = [] | ||
13 | for variant in variants: | ||
14 | clsextends.append(oe.classextend.ClassExtender(variant, e.data)) | ||
15 | |||
11 | # Process PROVIDES | 16 | # Process PROVIDES |
12 | origprovs = provs = e.data.getVar("PROVIDES", True) or "" | 17 | origprovs = provs = e.data.getVar("PROVIDES", True) or "" |
13 | for variant in variants: | 18 | for clsextend in clsextends: |
14 | provs = provs + " " + multilib_map_variable("PROVIDES", variant, e.data) | 19 | provs = provs + " " + clsextend.map_variable("PROVIDES", setvar=False) |
15 | # Reset to original value so next time around multilib_map_variable works properly | ||
16 | e.data.setVar("PROVIDES", origprovs) | ||
17 | e.data.setVar("PROVIDES", provs) | 20 | e.data.setVar("PROVIDES", provs) |
18 | 21 | ||
19 | # Process RPROVIDES | 22 | # Process RPROVIDES |
20 | origrprovs = rprovs = e.data.getVar("RPROVIDES", True) or "" | 23 | origrprovs = rprovs = e.data.getVar("RPROVIDES", True) or "" |
21 | for variant in variants: | 24 | for clsextend in clsextends: |
22 | rprovs = rprovs + " " + multilib_map_variable("RPROVIDES", variant, e.data) | 25 | rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES", setvar=False) |
23 | # Reset to original value so next time around multilib_map_variable works properly | ||
24 | e.data.setVar("RPROVIDES", origrprovs) | ||
25 | e.data.setVar("RPROVIDES", rprovs) | 26 | e.data.setVar("RPROVIDES", rprovs) |
26 | 27 | ||
27 | # Process RPROVIDES_${PN}... | 28 | # Process RPROVIDES_${PN}... |
28 | for pkg in (e.data.getVar("PACKAGES", True) or "").split(): | 29 | for pkg in (e.data.getVar("PACKAGES", True) or "").split(): |
29 | origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg, True) or "" | 30 | origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg, True) or "" |
30 | for variant in variants: | 31 | for clsextend in clsextends: |
31 | rprovs = rprovs + " " + multilib_map_variable("RPROVIDES_%s" % pkg, variant, e.data) | 32 | rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES_%s" % pkg, setvar=False) |
32 | rprovs = rprovs + " " + variant + "-" + pkg | 33 | rprovs = rprovs + " " + clsextend.extname + "-" + pkg |
33 | # Reset to original value so next time around multilib_map_variable works properly | ||
34 | e.data.setVar("RPROVIDES_%s" % pkg, origrprovs) | ||
35 | e.data.setVar("RPROVIDES_%s" % pkg, rprovs) | 34 | e.data.setVar("RPROVIDES_%s" % pkg, rprovs) |
36 | } | 35 | } |
37 | 36 | ||
38 | addhandler multilib_virtclass_handler_global | 37 | addhandler multilib_virtclass_handler_global |
39 | 38 | ||
40 | def multilib_extend_name(variant, name): | ||
41 | if name.startswith("kernel-module"): | ||
42 | return name | ||
43 | if name.startswith("virtual/"): | ||
44 | subs = name.split("/", 1)[1] | ||
45 | if not subs.startswith(variant): | ||
46 | return "virtual/" + variant + "-" + subs | ||
47 | return name | ||
48 | if not name.startswith(variant): | ||
49 | return variant + "-" + name | ||
50 | return name | ||
51 | |||
52 | def multilib_map_variable(varname, variant, d): | ||
53 | var = d.getVar(varname, True) | ||
54 | if not var: | ||
55 | return "" | ||
56 | var = var.split() | ||
57 | newvar = [] | ||
58 | for v in var: | ||
59 | newvar.append(multilib_extend_name(variant, v)) | ||
60 | newdata = " ".join(newvar) | ||
61 | d.setVar(varname, newdata) | ||
62 | return newdata | ||