summaryrefslogtreecommitdiffstats
path: root/meta/classes
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
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')
-rw-r--r--meta/classes/base.bbclass60
-rw-r--r--meta/classes/multimachine.bbclass30
-rw-r--r--meta/classes/singlemachine.bbclass15
3 files changed, 52 insertions, 53 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)
diff --git a/meta/classes/multimachine.bbclass b/meta/classes/multimachine.bbclass
deleted file mode 100644
index 945d22bfe0..0000000000
--- a/meta/classes/multimachine.bbclass
+++ /dev/null
@@ -1,30 +0,0 @@
1STAMP = "${TMPDIR}/stamps/${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}/${PF}"
2WORKDIR = "${TMPDIR}/work/${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}/${PF}"
3STAGING_KERNEL_DIR = "${STAGING_DIR}/${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}/kernel"
4PKGDATA_DIR = "${STAGING_DIR}/pkgdata/${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
5
6# Find any machine specific sub packages and if present, mark the
7# whole package as machine specific for multimachine purposes.
8
9
10def multi_machine_after_parse(d):
11 import bb
12 packages = bb.data.getVar('PACKAGES', d, 1).split()
13 macharch = bb.data.getVar('MACHINE_ARCH', d, 1)
14 multiarch = bb.data.getVar('PACKAGE_ARCH', d, 1)
15
16 for pkg in packages:
17 pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1)
18
19 # We could look for != PACKAGE_ARCH here but how to choose
20 # if multiple differences are present?
21 # Look through PACKAGE_ARCHS for the priority order?
22 if pkgarch and pkgarch == macharch:
23 multiarch = macharch
24
25 bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
26
27
28python __anonymous () {
29 multi_machine_after_parse(d)
30}
diff --git a/meta/classes/singlemachine.bbclass b/meta/classes/singlemachine.bbclass
new file mode 100644
index 0000000000..c685ce397a
--- /dev/null
+++ b/meta/classes/singlemachine.bbclass
@@ -0,0 +1,15 @@
1#
2# Emulates the old mode of OE operation where only one machine can be targetted.
3#
4
5MULTIMACH_TARGET_SYS = "${TARGET_SYS}"
6MULTIMACH_HOST_SYS = "${HOST_SYS}"
7
8STAMP = "${TMPDIR}/stamps/${PF}"
9WORKDIR = "${TMPDIR}/work/${PF}"
10STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_SYS}"
11STAGING_DIR_TARGET = "${STAGING_DIR}/${TARGET_SYS}"
12PKGDATA_DIR = "${STAGING_DIR}/pkgdata"
13STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/kernel"
14
15