From: Jan Kiszka <[email protected]>

When cross-compiling, we need to specify the python build dependencies
as :native. Otherwise, the target python packages would be installed,
and they cannot run inside a host-targeted build environment.

Furthermore, ARCH and CROSS_COMPILE now need to be injected into the
build.

Signed-off-by: Jan Kiszka <[email protected]>
---
 recipes-jailhouse/jailhouse/files/debian/control |  2 +-
 recipes-jailhouse/jailhouse/files/debian/rules   | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/recipes-jailhouse/jailhouse/files/debian/control 
b/recipes-jailhouse/jailhouse/files/debian/control
index 4508160..56e36ec 100644
--- a/recipes-jailhouse/jailhouse/files/debian/control
+++ b/recipes-jailhouse/jailhouse/files/debian/control
@@ -3,7 +3,7 @@ Section: misc
 Priority: optional
 Standards-Version: 3.9.6
 Build-Depends: linux-headers-@KERNEL_NAME@, git,
-               dh-python, python-pip, python-setuptools, python-mako
+               dh-python, python-pip:native, python-setuptools, 
python-mako:native
 Maintainer: Jan Kiszka <[email protected]>
 X-Python-Version: >= 2.7
 
diff --git a/recipes-jailhouse/jailhouse/files/debian/rules 
b/recipes-jailhouse/jailhouse/files/debian/rules
index 7329587..55d38a9 100755
--- a/recipes-jailhouse/jailhouse/files/debian/rules
+++ b/recipes-jailhouse/jailhouse/files/debian/rules
@@ -15,5 +15,17 @@ export prefix=/usr
 
 export DEB_BUILD_OPTIONS=parallel=$(shell nproc)
 
+export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
+
+ifeq ($(DEB_HOST_GNU_CPU), arm)
+export ARCH=arm
+endif
+ifeq ($(DEB_HOST_GNU_CPU), aarch64)
+export ARCH=arm64
+endif
+ifneq (,$(findstring 86,$(DEB_HOST_GNU_CPU)))
+export ARCH=x86
+endif
+
 %:
        CFLAGS= LDFLAGS= dh $@ --parallel --with python2
-- 
2.16.4

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to