[oe-commits] Eric Bénard : handle PACKAGE_ARCH change in an amend. inc
git version control
git at git.openembedded.org
Mon Nov 22 19:37:39 UTC 2010
Module: openembedded.git
Branch: org.openembedded.dev
Commit: 8d1542c4bfd0fe41c2c942938018a2729f0d9bd5
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=8d1542c4bfd0fe41c2c942938018a2729f0d9bd5
Author: Eric Bénard <eric at eukrea.com>
Date: Fri Nov 19 21:29:37 2010 +0100
handle PACKAGE_ARCH change in an amend.inc
* setting PACKAGE_ARCH = "${MACHINE_ARCH}" in an amend.inc actually
leads to a package with the correct machine arch but the
work/stage/stamp dirs are not correct because MULTIMACH_ARCH is not
updated after amend.inc is parsed.
* this patch :
- factorizes the code which compute MULTIMACH_ARCH in base.bbclass
- updates MULTIMACH_ARCH if required by an amend.inc
Signed-off-by: Eric Bénard <eric at eukrea.com>
Acked-by: Chris Larson <chris_larson at mentor.com>
Acked-by: Khem Raj <raj.khem at gmail.com>
Acked-by: Denys Dmytriyenko <denis at denix.org>
---
classes/amend.bbclass | 2 +
classes/base.bbclass | 55 +++++++++++++++++++++++++++---------------------
2 files changed, 33 insertions(+), 24 deletions(-)
diff --git a/classes/amend.bbclass b/classes/amend.bbclass
index a03de64..048a8f3 100644
--- a/classes/amend.bbclass
+++ b/classes/amend.bbclass
@@ -42,4 +42,6 @@ python () {
depends = set()
depends |= set(newdata)
d.setVar("__depends", depends)
+
+ set_multimach_arch(d)
}
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 308498f..7f58b17 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -288,6 +288,36 @@ addtask build
do_build = ""
do_build[func] = "1"
+def set_multimach_arch(d):
+ # 'multimachine' handling
+ mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
+ pkg_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
+
+ #
+ # We always try to scan SRC_URI for urls with machine overrides
+ # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
+ #
+ override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
+ if override != '0' and is_machine_specific(d):
+ bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
+ bb.data.setVar('MULTIMACH_ARCH', mach_arch, d)
+ return
+
+ multiarch = pkg_arch
+
+ packages = bb.data.getVar('PACKAGES', d, 1).split()
+ for pkg in packages:
+ pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1)
+
+ # We could look for != PACKAGE_ARCH here but how to choose
+ # if multiple differences are present?
+ # Look through PACKAGE_ARCHS for the priority order?
+ if pkgarch and pkgarch == mach_arch:
+ multiarch = mach_arch
+ break
+
+ bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
+
python () {
import exceptions
@@ -363,30 +393,7 @@ python () {
# Already machine specific - nothing further to do
return
- #
- # We always try to scan SRC_URI for urls with machine overrides
- # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
- #
- override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
- if override != '0' and is_machine_specific(d):
- bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
- bb.data.setVar('MULTIMACH_ARCH', mach_arch, d)
- return
-
- multiarch = pkg_arch
-
- packages = bb.data.getVar('PACKAGES', d, 1).split()
- for pkg in packages:
- pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1)
-
- # We could look for != PACKAGE_ARCH here but how to choose
- # if multiple differences are present?
- # Look through PACKAGE_ARCHS for the priority order?
- if pkgarch and pkgarch == mach_arch:
- multiarch = mach_arch
- break
-
- bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
+ set_multimach_arch(d)
}
EXPORT_FUNCTIONS do_setscene do_fetch do_unpack do_configure do_compile do_install do_package
More information about the Openembedded-commits
mailing list