summaryrefslogtreecommitdiffstats
path: root/meta/classes/multilib_global.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/multilib_global.bbclass')
-rw-r--r--meta/classes/multilib_global.bbclass47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
new file mode 100644
index 0000000..3315ba9
--- /dev/null
+++ b/meta/classes/multilib_global.bbclass
@@ -0,0 +1,47 @@
1python multilib_virtclass_handler_global () {
2 if not e.data:
3 return
4
5 if isinstance(e, bb.event.RecipePreFinalise):
6 for v in e.data.getVar("MULTILIB_VARIANTS", True).split():
7 if e.data.getVar("TARGET_VENDOR_virtclass-multilib-" + v, False) is None:
8 e.data.setVar("TARGET_VENDOR_virtclass-multilib-" + v, e.data.getVar("TARGET_VENDOR", False) + "ml" + v)
9
10 variant = e.data.getVar("BBEXTENDVARIANT", True)
11
12 if isinstance(e, bb.event.RecipeParsed) and not variant:
13 if bb.data.inherits_class('kernel', e.data) or \
14 bb.data.inherits_class('module-base', e.data) or \
15 (bb.data.inherits_class('allarch', e.data) and\
16 not bb.data.inherits_class('packagegroup', e.data)):
17 variants = (e.data.getVar("MULTILIB_VARIANTS", True) or "").split()
18
19 import oe.classextend
20 clsextends = []
21 for variant in variants:
22 clsextends.append(oe.classextend.ClassExtender(variant, e.data))
23
24 # Process PROVIDES
25 origprovs = provs = e.data.getVar("PROVIDES", True) or ""
26 for clsextend in clsextends:
27 provs = provs + " " + clsextend.map_variable("PROVIDES", setvar=False)
28 e.data.setVar("PROVIDES", provs)
29
30 # Process RPROVIDES
31 origrprovs = rprovs = e.data.getVar("RPROVIDES", True) or ""
32 for clsextend in clsextends:
33 rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES", setvar=False)
34 e.data.setVar("RPROVIDES", rprovs)
35
36 # Process RPROVIDES_${PN}...
37 for pkg in (e.data.getVar("PACKAGES", True) or "").split():
38 origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg, True) or ""
39 for clsextend in clsextends:
40 rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES_%s" % pkg, setvar=False)
41 rprovs = rprovs + " " + clsextend.extname + "-" + pkg
42 e.data.setVar("RPROVIDES_%s" % pkg, rprovs)
43}
44
45addhandler multilib_virtclass_handler_global
46multilib_virtclass_handler_global[eventmask] = "bb.event.RecipePreFinalise bb.event.RecipeParsed"
47