summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-extended/xen/xen-arch.inc18
-rw-r--r--recipes-extended/xen/xen.inc8
2 files changed, 23 insertions, 3 deletions
diff --git a/recipes-extended/xen/xen-arch.inc b/recipes-extended/xen/xen-arch.inc
new file mode 100644
index 00000000..bcf9f54b
--- /dev/null
+++ b/recipes-extended/xen/xen-arch.inc
@@ -0,0 +1,18 @@
1
2valid_xen_archs = " \
3 x86_64 x86_32 \
4 arm32 arm64 \
5 "
6
7def map_xen_arch(a, d):
8 import re
9 valid_archs = d.getVar('valid_xen_archs').split()
10
11 if re.match("i.86", a): return "x86_32"
12 elif re.match("x86.64", a): return "x86_64"
13 elif re.match("arm.*", a): return "arm32"
14 elif re.match("aarch64.*", a): return "arm64"
15 elif a in valid_archs: return a
16 else:
17 bb.error("cannot map '%s' to a xen architecture" % a)
18
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index ed902b27..9ab83518 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -10,6 +10,8 @@ COMPATIBLE_HOST = '(x86_64.*).*-linux'
10 10
11inherit autotools-brokensep gettext setuptools update-rc.d 11inherit autotools-brokensep gettext setuptools update-rc.d
12 12
13require xen-arch.inc
14
13PACKAGECONFIG ??= " \ 15PACKAGECONFIG ??= " \
14 sdl \ 16 sdl \
15 " 17 "
@@ -618,9 +620,9 @@ export HOST_SYS
618export STAGING_INCDIR 620export STAGING_INCDIR
619export STAGING_LIBDIR 621export STAGING_LIBDIR
620 622
621# specify xen hypervisor to target x86_64 (x86_32 not supported) 623# specify xen hypervisor to build/target
622export XEN_TARGET_ARCH="x86_64" 624export XEN_TARGET_ARCH = "${@map_xen_arch(d.getVar('TARGET_ARCH', True), d)}"
623export XEN_COMPILE_ARCH="x86_64" 625export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH', True), d)}"
624 626
625# hardcoded as Linux, as the only compatible hosts are Linux. 627# hardcoded as Linux, as the only compatible hosts are Linux.
626export XEN_OS = "Linux" 628export XEN_OS = "Linux"