summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-07-17 20:49:48 +0000
committerRichard Purdie <richard@openedhand.com>2008-07-17 20:49:48 +0000
commit767d9ca544c9c5bce686d8924619d9ab2385d8e8 (patch)
treec68c8b6f810d0c72eb82bf894de42e6d39c369dd /meta/classes/base.bbclass
parent45d0dac16ad84f9eb0264dfd662238e3913619d6 (diff)
downloadpoky-767d9ca544c9c5bce686d8924619d9ab2385d8e8.tar.gz
Merge multimachine class into bitbake.conf and create singlemachine.bbclass as a backwards compatibility option
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4858 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass60
1 files changed, 37 insertions, 23 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 17935fe9ad..60a69e24f3 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -997,10 +997,12 @@ def base_after_parse(d):
997 depends = depends + " shasum-native:do_populate_staging" 997 depends = depends + " shasum-native:do_populate_staging"
998 bb.data.setVarFlag('do_fetch', 'depends', depends, d) 998 bb.data.setVarFlag('do_fetch', 'depends', depends, d)
999 999
1000 # 'multimachine' handling
1000 mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) 1001 mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
1001 old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1) 1002 pkg_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
1002 if (old_arch == mach_arch): 1003
1003 # Nothing to do 1004 if (pkg_arch == mach_arch):
1005 # Already machine specific - nothing further to do
1004 return 1006 return
1005 1007
1006 # 1008 #
@@ -1008,26 +1010,38 @@ def base_after_parse(d):
1008 # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0 1010 # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
1009 # 1011 #
1010 override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) 1012 override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
1011 if override == '0': 1013 if override != '0':
1012 return 1014 paths = []
1013 1015 for p in [ "${PF}", "${P}", "${PN}", "files", "" ]:
1014 paths = [] 1016 path = bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d)
1015 for p in [ "${PF}", "${P}", "${PN}", "files", "" ]: 1017 if os.path.isdir(path):
1016 path = bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d) 1018 paths.append(path)
1017 if os.path.isdir(path): 1019 if len(paths) != 0:
1018 paths.append(path) 1020 for s in srcuri.split():
1019 if len(paths) == 0: 1021 if not s.startswith("file://"):
1020 return 1022 continue
1021 1023 local = bb.data.expand(bb.fetch.localpath(s, d), d)
1022 for s in srcuri.split(): 1024 for mp in paths:
1023 if not s.startswith("file://"): 1025 if local.startswith(mp):
1024 continue 1026 #bb.note("overriding PACKAGE_ARCH from %s to %s" % (pkg_arch, mach_arch))
1025 local = bb.data.expand(bb.fetch.localpath(s, d), d) 1027 bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
1026 for mp in paths: 1028 bb.data.setVar('MULTIMACH_ARCH', mach_arch, d)
1027 if local.startswith(mp): 1029 return
1028 #bb.note("overriding PACKAGE_ARCH from %s to %s" % (old_arch, mach_arch)) 1030
1029 bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d) 1031 multiarch = pkg_arch
1030 return 1032
1033 packages = bb.data.getVar('PACKAGES', d, 1).split()
1034 for pkg in packages:
1035 pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1)
1036
1037 # We could look for != PACKAGE_ARCH here but how to choose
1038 # if multiple differences are present?
1039 # Look through PACKAGE_ARCHS for the priority order?
1040 if pkgarch and pkgarch == mach_arch:
1041 multiarch = mach_arch
1042 break
1043
1044 bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
1031 1045
1032python () { 1046python () {
1033 base_after_parse(d) 1047 base_after_parse(d)