summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--meta/classes/base.bbclass60
-rw-r--r--meta/classes/multimachine.bbclass30
-rw-r--r--meta/classes/singlemachine.bbclass15
-rw-r--r--meta/conf/bitbake.conf11
-rw-r--r--meta/conf/distro/poky.conf2
5 files changed, 60 insertions, 58 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
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index ad85dc3861..cee68ef9fc 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -91,6 +91,9 @@ PACKAGE_ARCH = "${BASE_PACKAGE_ARCH}"
91MACHINE_ARCH = "${@[bb.data.getVar('HOST_ARCH', d, 1), bb.data.getVar('MACHINE', d, 1)][bool(bb.data.getVar('MACHINE', d, 1))]}" 91MACHINE_ARCH = "${@[bb.data.getVar('HOST_ARCH', d, 1), bb.data.getVar('MACHINE', d, 1)][bool(bb.data.getVar('MACHINE', d, 1))]}"
92PACKAGE_ARCHS = "all any noarch ${TARGET_ARCH} ${PACKAGE_EXTRA_ARCHS} ${MACHINE}" 92PACKAGE_ARCHS = "all any noarch ${TARGET_ARCH} ${PACKAGE_EXTRA_ARCHS} ${MACHINE}"
93 93
94MULTIMACH_TARGET_SYS = "${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
95MULTIMACH_HOST_SYS = "${MULTIMACH_ARCH}${HOST_VENDOR}-${HOST_OS}"
96
94# select proper CPU to get binary locales generated 97# select proper CPU to get binary locales generated
95QEMU_OPTIONS = "" 98QEMU_OPTIONS = ""
96QEMU_OPTIONS_iwmmxt = "-cpu pxa270-c5" 99QEMU_OPTIONS_iwmmxt = "-cpu pxa270-c5"
@@ -218,8 +221,8 @@ SVNDIR = "${DL_DIR}/svn"
218GITDIR = "${DL_DIR}/git" 221GITDIR = "${DL_DIR}/git"
219BZRDIR = "${DL_DIR}/bzr" 222BZRDIR = "${DL_DIR}/bzr"
220 223
221STAMP = "${TMPDIR}/stamps/${PF}" 224STAMP = "${TMPDIR}/stamps/${MULTIMACH_TARGET_SYS}/${PF}"
222WORKDIR = "${TMPDIR}/work/${PF}" 225WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PF}"
223T = "${WORKDIR}/temp" 226T = "${WORKDIR}/temp"
224D = "${WORKDIR}/image" 227D = "${WORKDIR}/image"
225S = "${WORKDIR}/${P}" 228S = "${WORKDIR}/${P}"
@@ -254,7 +257,7 @@ DEPLOY_DIR_DEB = "${DEPLOY_DIR}/deb"
254DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images" 257DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images"
255DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools" 258DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools"
256 259
257PKGDATA_DIR = "${STAGING_DIR}/pkgdata" 260PKGDATA_DIR = "${STAGING_DIR}/pkgdata/${MULTIMACH_TARGET_SYS}"
258 261
259SDK_NAME = "${DISTRO}/${TARGET_ARCH}" 262SDK_NAME = "${DISTRO}/${TARGET_ARCH}"
260SDK_PREFIX = "/usr/local/${SDK_NAME}" 263SDK_PREFIX = "/usr/local/${SDK_NAME}"
@@ -264,7 +267,7 @@ SDK_PREFIX = "/usr/local/${SDK_NAME}"
264################################################################## 267##################################################################
265 268
266OLDEST_KERNEL = "2.4.0" 269OLDEST_KERNEL = "2.4.0"
267STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/kernel" 270STAGING_KERNEL_DIR = "${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/kernel"
268 271
269################################################################## 272##################################################################
270# Specific image creation and rootfs population info. 273# Specific image creation and rootfs population info.
diff --git a/meta/conf/distro/poky.conf b/meta/conf/distro/poky.conf
index ba51d1e19d..2a6927371b 100644
--- a/meta/conf/distro/poky.conf
+++ b/meta/conf/distro/poky.conf
@@ -9,7 +9,7 @@ MAINTAINER = "OpenedHand <poky@openedhand.com>"
9 9
10PACKAGE_CLASSES ?= "package_ipk" 10PACKAGE_CLASSES ?= "package_ipk"
11INHERIT_INSANE ?= "insane" 11INHERIT_INSANE ?= "insane"
12INHERIT += "${PACKAGE_CLASSES} debian multimachine poky devshell ${INHERIT_INSANE}" 12INHERIT += "${PACKAGE_CLASSES} debian poky devshell ${INHERIT_INSANE}"
13# For some reason, this doesn't work 13# For some reason, this doesn't work
14# TARGET_OS ?= "linux" 14# TARGET_OS ?= "linux"
15# TARGET_VENDOR ?= "-poky" 15# TARGET_VENDOR ?= "-poky"