[RFC,v2,3/4] travis: Merge debian.cross-compile.*.sh
diff mbox series

Message ID 20200204152430.10935-4-pvorel@suse.cz
State Accepted
Headers show
Series
  • TI-RPC: enhancements (pkg-config, travis)
Related show

Commit Message

Petr Vorel Feb. 4, 2020, 3:24 p.m. UTC
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 .travis.yml                            |  6 +++---
 travis/debian.cross-compile.aarch64.sh | 11 -----------
 travis/debian.cross-compile.ppc64le.sh | 11 -----------
 travis/debian.cross-compile.sh         | 22 ++++++++++++++++++++++
 4 files changed, 25 insertions(+), 25 deletions(-)
 delete mode 100755 travis/debian.cross-compile.aarch64.sh
 delete mode 100755 travis/debian.cross-compile.ppc64le.sh
 create mode 100755 travis/debian.cross-compile.sh

Patch
diff mbox series

diff --git a/.travis.yml b/.travis.yml
index 51efa22e3..d777a94c6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,11 +12,11 @@  matrix:
 
         # cross compilation builds
         - os: linux
-          env: DISTRO=debian:stable VARIANT=cross-compile.ppc64le TREE="out"
+          env: DISTRO=debian:stable VARIANT=cross-compile ARCH=ppc64el TREE="out"
           compiler: powerpc64le-linux-gnu-gcc
 
         - os: linux
-          env: DISTRO=debian:stable VARIANT=cross-compile.aarch64 TREE="out"
+          env: DISTRO=debian:stable VARIANT=cross-compile ARCH=arm64 TREE="out"
           compiler: aarch64-linux-gnu-gcc
 
         # musl (native)
@@ -98,4 +98,4 @@  script:
     - INSTALL="${INSTALL%%/*}"
     - if [ ! "$TREE" ]; then TREE="in"; fi
     - case $VARIANT in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
-    - docker run -t ltp /bin/sh -c "cd travis && ./$INSTALL.sh && if [ \"$VARIANT\" ]; then ./$INSTALL.$VARIANT.sh; fi && ../build.sh -o $TREE -t $BUILD -c $CC"
+    - docker run -t ltp /bin/sh -c "cd travis && ./$INSTALL.sh && if [ \"$VARIANT\" ]; then ARCH=\"$ARCH\" ./$INSTALL.$VARIANT.sh; fi && ../build.sh -o $TREE -t $BUILD -c $CC"
diff --git a/travis/debian.cross-compile.aarch64.sh b/travis/debian.cross-compile.aarch64.sh
deleted file mode 100755
index cc1eda5b5..000000000
--- a/travis/debian.cross-compile.aarch64.sh
+++ /dev/null
@@ -1,11 +0,0 @@ 
-#!/bin/sh
-# Copyright (c) 2018-2020 Petr Vorel <pvorel@suse.cz>
-set -e
-
-dpkg --add-architecture arm64
-apt update
-
-apt install -y --no-install-recommends \
-	gcc-aarch64-linux-gnu \
-	libc6-dev-arm64-cross \
-	libtirpc-dev:arm64
diff --git a/travis/debian.cross-compile.ppc64le.sh b/travis/debian.cross-compile.ppc64le.sh
deleted file mode 100755
index 671867d31..000000000
--- a/travis/debian.cross-compile.ppc64le.sh
+++ /dev/null
@@ -1,11 +0,0 @@ 
-#!/bin/sh
-# Copyright (c) 2018-2020 Petr Vorel <pvorel@suse.cz>
-set -e
-
-dpkg --add-architecture ppc64el
-apt update
-
-apt install -y --no-install-recommends \
-	gcc-powerpc64le-linux-gnu \
-	libc6-dev-ppc64el-cross \
-	libtirpc-dev:ppc64el
diff --git a/travis/debian.cross-compile.sh b/travis/debian.cross-compile.sh
new file mode 100755
index 000000000..ea04c8862
--- /dev/null
+++ b/travis/debian.cross-compile.sh
@@ -0,0 +1,22 @@ 
+#!/bin/sh
+# Copyright (c) 2018-2020 Petr Vorel <pvorel@suse.cz>
+set -e
+
+if [ -z "$ARCH" ]; then
+	echo "missing \$ARCH!" >&2
+	exit 1
+fi
+
+case "$ARCH" in
+arm64) gcc_arch="aarch64";;
+ppc64el) gcc_arch="powerpc64le";;
+*) echo "unsupported arch: '$1'!" >&2; exit 1;;
+esac
+
+dpkg --add-architecture $ARCH
+apt update
+
+apt install -y --no-install-recommends \
+	gcc-${gcc_arch}-linux-gnu \
+	libc6-dev-${ARCH}-cross \
+	libtirpc-dev:$ARCH