diff options
-rw-r--r-- | meta/classes/base.bbclass | 60 | ||||
-rw-r--r-- | meta/classes/multimachine.bbclass | 30 | ||||
-rw-r--r-- | meta/classes/singlemachine.bbclass | 15 | ||||
-rw-r--r-- | meta/conf/bitbake.conf | 11 | ||||
-rw-r--r-- | meta/conf/distro/poky.conf | 2 |
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 | ||
1032 | python () { | 1046 | python () { |
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 @@ | |||
1 | STAMP = "${TMPDIR}/stamps/${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}/${PF}" | ||
2 | WORKDIR = "${TMPDIR}/work/${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}/${PF}" | ||
3 | STAGING_KERNEL_DIR = "${STAGING_DIR}/${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}/kernel" | ||
4 | PKGDATA_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 | |||
10 | def 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 | |||
28 | python __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 | |||
5 | MULTIMACH_TARGET_SYS = "${TARGET_SYS}" | ||
6 | MULTIMACH_HOST_SYS = "${HOST_SYS}" | ||
7 | |||
8 | STAMP = "${TMPDIR}/stamps/${PF}" | ||
9 | WORKDIR = "${TMPDIR}/work/${PF}" | ||
10 | STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_SYS}" | ||
11 | STAGING_DIR_TARGET = "${STAGING_DIR}/${TARGET_SYS}" | ||
12 | PKGDATA_DIR = "${STAGING_DIR}/pkgdata" | ||
13 | STAGING_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}" | |||
91 | MACHINE_ARCH = "${@[bb.data.getVar('HOST_ARCH', d, 1), bb.data.getVar('MACHINE', d, 1)][bool(bb.data.getVar('MACHINE', d, 1))]}" | 91 | MACHINE_ARCH = "${@[bb.data.getVar('HOST_ARCH', d, 1), bb.data.getVar('MACHINE', d, 1)][bool(bb.data.getVar('MACHINE', d, 1))]}" |
92 | PACKAGE_ARCHS = "all any noarch ${TARGET_ARCH} ${PACKAGE_EXTRA_ARCHS} ${MACHINE}" | 92 | PACKAGE_ARCHS = "all any noarch ${TARGET_ARCH} ${PACKAGE_EXTRA_ARCHS} ${MACHINE}" |
93 | 93 | ||
94 | MULTIMACH_TARGET_SYS = "${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}" | ||
95 | MULTIMACH_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 |
95 | QEMU_OPTIONS = "" | 98 | QEMU_OPTIONS = "" |
96 | QEMU_OPTIONS_iwmmxt = "-cpu pxa270-c5" | 99 | QEMU_OPTIONS_iwmmxt = "-cpu pxa270-c5" |
@@ -218,8 +221,8 @@ SVNDIR = "${DL_DIR}/svn" | |||
218 | GITDIR = "${DL_DIR}/git" | 221 | GITDIR = "${DL_DIR}/git" |
219 | BZRDIR = "${DL_DIR}/bzr" | 222 | BZRDIR = "${DL_DIR}/bzr" |
220 | 223 | ||
221 | STAMP = "${TMPDIR}/stamps/${PF}" | 224 | STAMP = "${TMPDIR}/stamps/${MULTIMACH_TARGET_SYS}/${PF}" |
222 | WORKDIR = "${TMPDIR}/work/${PF}" | 225 | WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PF}" |
223 | T = "${WORKDIR}/temp" | 226 | T = "${WORKDIR}/temp" |
224 | D = "${WORKDIR}/image" | 227 | D = "${WORKDIR}/image" |
225 | S = "${WORKDIR}/${P}" | 228 | S = "${WORKDIR}/${P}" |
@@ -254,7 +257,7 @@ DEPLOY_DIR_DEB = "${DEPLOY_DIR}/deb" | |||
254 | DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images" | 257 | DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images" |
255 | DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools" | 258 | DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools" |
256 | 259 | ||
257 | PKGDATA_DIR = "${STAGING_DIR}/pkgdata" | 260 | PKGDATA_DIR = "${STAGING_DIR}/pkgdata/${MULTIMACH_TARGET_SYS}" |
258 | 261 | ||
259 | SDK_NAME = "${DISTRO}/${TARGET_ARCH}" | 262 | SDK_NAME = "${DISTRO}/${TARGET_ARCH}" |
260 | SDK_PREFIX = "/usr/local/${SDK_NAME}" | 263 | SDK_PREFIX = "/usr/local/${SDK_NAME}" |
@@ -264,7 +267,7 @@ SDK_PREFIX = "/usr/local/${SDK_NAME}" | |||
264 | ################################################################## | 267 | ################################################################## |
265 | 268 | ||
266 | OLDEST_KERNEL = "2.4.0" | 269 | OLDEST_KERNEL = "2.4.0" |
267 | STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/kernel" | 270 | STAGING_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 | ||
10 | PACKAGE_CLASSES ?= "package_ipk" | 10 | PACKAGE_CLASSES ?= "package_ipk" |
11 | INHERIT_INSANE ?= "insane" | 11 | INHERIT_INSANE ?= "insane" |
12 | INHERIT += "${PACKAGE_CLASSES} debian multimachine poky devshell ${INHERIT_INSANE}" | 12 | INHERIT += "${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" |