Patchwork [MULTILIB_SUBTASK4,3/5] multilib/package.bbclass: Set PACKAGE_ARCH for multilib.

login
register
mail settings
Submitter Lianhao Lu
Date July 5, 2011, 10:51 a.m.
Message ID <7415b32b2334a2e0f98c1a2f8d2df838f2954122.1309862610.git.lianhao.lu@intel.com>
Download mbox | patch
Permalink /patch/6971/
State New, archived
Headers show

Comments

Lianhao Lu - July 5, 2011, 10:51 a.m.
Set PACKAGE_ARCH in case of multilib.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/classes/multilib.bbclass |   10 ++--------
 meta/classes/package.bbclass  |   11 +++++++++++
 2 files changed, 13 insertions(+), 8 deletions(-)

Patch

diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 17edc37..66d2df9 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -21,16 +21,10 @@  python multilib_virtclass_handler () {
         e.data.delVarFlags("libdir_virtclass-multilib-" + variant)
         e.data.setVar("target_libdir", libdir)
 
-        tarch = e.data.getVar("TARGET_ARCH", True)
-        parch = e.data.getVar("PACKAGE_ARCH", True)
-        baseparch = e.data.getVar("BASE_PACKAGE_ARCH", True)
-        if parch == tarch:
-            e.data.setVar("PACKAGE_ARCH", "${TARGET_ARCH}")
-        if baseparch == tarch:
-            e.data.setVar("BASE_PACKAGE_ARCH", "${TARGET_ARCH}")
-
     bb.data.setVar("PN", variant + "-" + bb.data.getVar("PN", e.data, False), e.data)
     bb.data.setVar("SHLIBSDIR_virtclass-multilib-" + variant ,bb.data.getVar("SHLIBSDIR",e.data,False) + "/" + variant, e.data)
+    bb.data.setVar("PACKAGE_ARCH", "${BASE_PACKAGE_ARCH}" , e.data);
+    bb.data.setVar("BASE_PACKAGE_ARCH_virtclass-multilib-" + variant, "ml" + variant, e.data);
     bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", e.data, False) + override, e.data)
 }
 
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 8f91c95..2ad2cf2 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -166,6 +166,17 @@  python () {
         bb.data.setVarFlag('do_package', 'deptask', " ".join(deps), d)
     else:
         d.setVar("PACKAGERDEPTASK", "")
+
+    multilib_archs = []
+    multilibs= d.getVar('MULTILIBS', True) or ""
+    if multilibs:
+        for ext in multilibs.split():
+            eext = ext.split(':')
+            if len(eext) > 1:
+                if eext[0] == 'multilib':
+                    multilib_archs.append('ml' + eext[1])
+
+    d.setVar("MULTILIB_ARCHS", ' '.join(multilib_archs))
 }
 
 def splitfile(file, debugfile, debugsrcdir, d):