xen: Add Build and Target architecture mapping

* Setup the XEN_TARGET_ARCH and XEN_COMPILE_ARCH based on the running
  environments TARGET_ARCH and BUILD_ARCH

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
This commit is contained in:
Nathan Rossi 2015-01-05 17:40:41 +10:00 committed by Bruce Ashfield
parent 6a145bce3a
commit 2daf821145
2 changed files with 23 additions and 3 deletions

View File

@ -0,0 +1,18 @@
valid_xen_archs = " \
x86_64 x86_32 \
arm32 arm64 \
"
def map_xen_arch(a, d):
import re
valid_archs = d.getVar('valid_xen_archs').split()
if re.match("i.86", a): return "x86_32"
elif re.match("x86.64", a): return "x86_64"
elif re.match("arm.*", a): return "arm32"
elif re.match("aarch64.*", a): return "arm64"
elif a in valid_archs: return a
else:
bb.error("cannot map '%s' to a xen architecture" % a)

View File

@ -10,6 +10,8 @@ COMPATIBLE_HOST = '(x86_64.*).*-linux'
inherit autotools-brokensep gettext setuptools update-rc.d
require xen-arch.inc
PACKAGECONFIG ??= " \
sdl \
"
@ -618,9 +620,9 @@ export HOST_SYS
export STAGING_INCDIR
export STAGING_LIBDIR
# specify xen hypervisor to target x86_64 (x86_32 not supported)
export XEN_TARGET_ARCH="x86_64"
export XEN_COMPILE_ARCH="x86_64"
# specify xen hypervisor to build/target
export XEN_TARGET_ARCH = "${@map_xen_arch(d.getVar('TARGET_ARCH', True), d)}"
export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH', True), d)}"
# hardcoded as Linux, as the only compatible hosts are Linux.
export XEN_OS = "Linux"