summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-27 16:21:48 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-27 16:21:48 +0100
commitfae195515f5bb1beaff9bc2fde9135ff573facc4 (patch)
treeeae7e93f96d1e4fe0c644d2d453e6370a26416f9 /meta
parent0960f3e0502b7b26a09d4eed599e5f31cd9aeca0 (diff)
downloadpoky-fae195515f5bb1beaff9bc2fde9135ff573facc4.tar.gz
multilib: Add missing files from broken patch merge
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/multilib.bbclass89
-rw-r--r--meta/conf/multilib.conf24
2 files changed, 113 insertions, 0 deletions
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
new file mode 100644
index 0000000000..6e1669fb7f
--- /dev/null
+++ b/meta/classes/multilib.bbclass
@@ -0,0 +1,89 @@
1python multilib_virtclass_handler () {
2 if not isinstance(e, bb.event.RecipePreFinalise):
3 return
4
5 cls = e.data.getVar("BBEXTENDCURR", True)
6 variant = e.data.getVar("BBEXTENDVARIANT", True)
7 if cls != "multilib" or not variant:
8 return
9
10 override = ":virtclass-multilib-" + variant
11
12 e.data.setVar("MLPREFIX", variant + "-")
13 e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
14 e.data.setVar("SHLIBSDIR_virtclass-multilib-" + variant ,e.data.getVar("SHLIBSDIR", False) + "/" + variant)
15 e.data.setVar("TARGET_VENDOR_virtclass-multilib-" + variant, e.data.getVar("TARGET_VENDOR", False) + "ml" + variant)
16 e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
17}
18
19addhandler multilib_virtclass_handler
20
21STAGINGCC_prepend = "${BBEXTENDVARIANT}-"
22
23python __anonymous () {
24 variant = d.getVar("BBEXTENDVARIANT", True)
25
26 def extend_name(name):
27 if name.startswith("virtual/"):
28 subs = name.split("/", 1)[1]
29 if not subs.startswith(variant):
30 return "virtual/" + variant + "-" + subs
31 return name
32 if not name.startswith(variant):
33 return variant + "-" + name
34 return name
35
36 def map_dependencies(varname, d, suffix = ""):
37 if suffix:
38 varname = varname + "_" + suffix
39 deps = d.getVar(varname, True)
40 if not deps:
41 return
42 deps = bb.utils.explode_deps(deps)
43 newdeps = []
44 for dep in deps:
45 if dep.endswith(("-native", "-native-runtime")):
46 newdeps.append(dep)
47 else:
48 newdeps.append(extend_name(dep))
49 d.setVar(varname, " ".join(newdeps))
50
51 def map_variable(varname, d):
52 var = d.getVar(varname, True)
53 if not var:
54 return
55 var = var.split()
56 newvar = []
57 for v in var:
58 newvar.append(extend_name(v))
59 d.setVar(varname, " ".join(newvar))
60
61 pkgs = []
62 pkgrename = {}
63 for pkg in (d.getVar("PACKAGES", True) or "").split():
64 if pkg.startswith(variant):
65 pkgs.append(pkg)
66 continue
67 pkgrename[pkg] = extend_name(pkg)
68 pkgs.append(pkgrename[pkg])
69
70 if pkgrename:
71 d.setVar("PACKAGES", " ".join(pkgs))
72 for pkg in pkgrename:
73 for subs in ["FILES", "RDEPENDS", "RRECOMMENDS", "SUMMARY", "DESCRIPTION", "RSUGGESTS", "RPROVIDES", "RCONFLICTS", "PKG", "ALLOW_EMPTY"]:
74 d.renameVar("%s_%s" % (subs, pkg), "%s_%s" % (subs, pkgrename[pkg]))
75
76 map_dependencies("DEPENDS", d)
77 for pkg in (d.getVar("PACKAGES", True).split() + [""]):
78 map_dependencies("RDEPENDS", d, pkg)
79 map_dependencies("RRECOMMENDS", d, pkg)
80 map_dependencies("RSUGGESTS", d, pkg)
81 map_dependencies("RPROVIDES", d, pkg)
82 map_dependencies("RREPLACES", d, pkg)
83 map_dependencies("RCONFLICTS", d, pkg)
84 map_dependencies("PKG", d, pkg)
85
86 map_variable("PROVIDES", d)
87 map_variable("PACKAGES_DYNAMIC", d)
88 map_variable("PACKAGE_INSTALL", d)
89}
diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf
new file mode 100644
index 0000000000..894b7a51f7
--- /dev/null
+++ b/meta/conf/multilib.conf
@@ -0,0 +1,24 @@
1
2baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or 'lib'}"
3
4MULTILIBS ??= "multilib:lib32"
5BBCLASSEXTEND_append_pn-linux-libc-headers = " ${MULTILIBS}"
6BBCLASSEXTEND_append_pn-eglibc-initial = " ${MULTILIBS}"
7BBCLASSEXTEND_append_pn-eglibc = " ${MULTILIBS}"
8BBCLASSEXTEND_append_pn-libgcc = " ${MULTILIBS}"
9BBCLASSEXTEND_append_pn-gcc-runtime = " ${MULTILIBS}"
10BBCLASSEXTEND_append_pn-libtool-cross = " ${MULTILIBS}"
11BBCLASSEXTEND_append_pn-zlib = " ${MULTILIBS}"
12BBCLASSEXTEND_append_pn-binutils-cross = " ${MULTILIBS}"
13BBCLASSEXTEND_append_pn-gcc-cross-initial = " ${MULTILIBS}"
14BBCLASSEXTEND_append_pn-gcc-cross-intermediate = " ${MULTILIBS}"
15BBCLASSEXTEND_append_pn-gcc-cross = " ${MULTILIBS}"
16BBCLASSEXTEND_append_pn-busybox = " ${MULTILIBS}"
17BBCLASSEXTEND_append_pn-update-rc.d = " ${MULTILIBS}"
18BBCLASSEXTEND_append_pn-util-linux = " ${MULTILIBS}"
19BBCLASSEXTEND_append_pn-gettext = " ${MULTILIBS}"
20BBCLASSEXTEND_append_pn-bash = " ${MULTILIBS}"
21BBCLASSEXTEND_append_pn-ncurses = " ${MULTILIBS}"
22BBCLASSEXTEND_append_pn-expat = " ${MULTILIBS}"
23BBCLASSEXTEND_append_pn-eglibc-locale = " ${MULTILIBS}"
24