Commit 92f5309def05c66e6c5034c10d620d6fbc7a1018

Anthony Green 2019-11-06T10:49:04

Try s390x and sh4 cross builds/tests

diff --git a/.travis.yml b/.travis.yml
index b11dbc9..ba96cf4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,10 @@ matrix:
     - os: osx
       env: HOST=arm-apple-darwin
     - os: linux
+      env: HOST=sh4-linux-gnu MEVAL='export CC="sh4-linux-gnu-gcc-8" && CXX="sh4-linux-gnu-g++-8"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/sh4-linux-gnu
+    - os: linux
+      env: HOST=s390x-linux-gnu MEVAL='export CC="s390x-linux-gnu-gcc-8" && CXX="s390x-linux-gnu-g++-8"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/s390x-linux-gnu
+    - os: linux
       env: HOST=hppa-linux-gnu MEVAL='export CC="hppa-linux-gnu-gcc-5" && CXX="hppa-linux-gnu-g++-5"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/hppa-linux-gnu
     - os: linux
       env: HOST=s390x-linux-gnu MEVAL='export CC="s390x-linux-gnu-gcc-5" && CXX="s390x-linux-gnu-g++-5"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/s390x-linux-gnu
diff --git a/.travis/build-in-container.sh b/.travis/build-in-container.sh
index dc412c2..85624bf 100755
--- a/.travis/build-in-container.sh
+++ b/.travis/build-in-container.sh
@@ -2,7 +2,13 @@
 
 cd /opt
 
-./configure 
+export QEMU_LD_PREFIX=/usr/${HOST}
+
+if ! test "x$HOST" == "x"; then
+    ./configure --host=${HOST} --disable-shared;
+else
+    ./configure
+fi
 make
 make dist
 make check RUNTESTFLAGS="-a $RUNTESTFLAGS"
diff --git a/.travis/build.sh b/.travis/build.sh
index 7baa81f..50cc9a4 100755
--- a/.travis/build.sh
+++ b/.travis/build.sh
@@ -34,6 +34,12 @@ function build_foreign_linux()
     exit $?
 }
 
+function build_cross_linux()
+{
+    docker run --rm -t -i -v `pwd`:/opt --rm -ti -e HOST="${HOST}" LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" $2 bash -c /opt/.travis/build-in-container.sh
+    exit $?
+}
+
 function build_ios()
 {
     which python
@@ -56,6 +62,9 @@ case "$HOST" in
     aarch64-linux-gnu| powerpc64le-unknown-linux-gnu | mips64el-linux-gnu | sparc64-linux-gnu)
         build_cfarm
 	;;
+    sh4-linux-gnu | s390x-linux-gnu )
+	build_cross_linux
+	;;
     *)
 	./autogen.sh
 	build_linux
diff --git a/.travis/install.sh b/.travis/install.sh
index fec9dba..abe5d88 100755
--- a/.travis/install.sh
+++ b/.travis/install.sh
@@ -12,15 +12,12 @@ else
   case $HOST in
       aarch64-linux-gnu | powerpc64le-unknown-linux-gnu | mips64el-linux-gnu | sparc64-linux-gnu)
           ;;	  
-      arm32v7-linux-gnu )
+      arm32v7-linux-gnu | sh4-linux-gnu | s390x-linux-gnu )
 	  sudo apt-get install qemu-user-static
 	  ;;
       hppa-linux-gnu )
 	  sudo apt-get install -y qemu-user-static g++-5-hppa-linux-gnu
 	  ;;
-      s390x-linux-gnu )
-	  sudo apt-get install -y qemu-user-static g++-5-s390x-linux-gnu
-	  ;;
       i386-pc-linux-gnu)
 	  sudo apt-get install gcc-multilib g++-multilib;
 	  ;;