diff mbox series

[API-NEXT,v1,7/19] travis: move cross-compilation into build matrix

Message ID 1505422809-5632-8-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/19] travis: fix powerpc test name | expand

Commit Message

Github ODP bot Sept. 14, 2017, 8:59 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


As both native and cross-compilation now use the same script it is
possible to move cross-compilation setup back to build matrix. Proper
cross-compiler is selected based on actual compiler (gcc/clang) and
cross-target.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 179 (muvarov:api-next)
 ** https://github.com/Linaro/odp/pull/179
 ** Patch: https://github.com/Linaro/odp/pull/179.patch
 ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1
 ** Merge commit sha: ada61f5ba5f940d03a95893940c21028d4c75d19
 **/
 .travis.yml | 58 +++++++++++++++++++++-------------------------------------
 1 file changed, 21 insertions(+), 37 deletions(-)
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index ac8a4c3ad..43141f9f1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -67,6 +67,10 @@  env:
         - CONF="--enable-schedule-sp"
         - CONF="--enable-schedule-iquery"
         - CONF="--enable-dpdk-zero-copy"
+        - CROSS_ARCH="arm64"
+        - CROSS_ARCH="armhf" CFLAGS="-march=armv7-a"
+        - CROSS_ARCH="powerpc"
+        - CROSS_ARCH="i386"
 
 before_install:
 
@@ -94,10 +98,19 @@  before_install:
           fi
         - if [ "${CC#clang}" != "${CC}" ] ;
           then
+                if [ -n "$CROSS_ARCH" ] ;
+                then
+                        export CC="${CC} --target=$CROSS_GNU_TYPE" ;
+                fi ;
                 export CXX="${CC/clang/clang++}";
           elif [ "$CROSS_ARCH" = "i386" ] ;
           then
+                export CC="gcc -m32" ;
                 export CXX="g++ -m32" ;
+          elif [ -n "$CROSS_ARCH" ] ;
+          then
+                export CC="$CROSS_GNU_TYPE"-gcc ;
+                export CXX="$CROSS_GNU_TYPE"-g++ ;
           fi
         - if test ! -L /usr/lib/ccache/${CC%% *} ; then sudo ln -s -t /usr/lib/ccache/ `which ${CC%% *}` ; fi
         - ccache -s
@@ -128,15 +141,17 @@  install:
         - sudo mkdir -p /mnt/huge
         - sudo mount -t hugetlbfs nodev /mnt/huge
 
-        - sudo apt-get -qq update
-        - sudo apt-get install linux-headers-`uname -r`
-        - sudo pip install coverage
+        - if [ -z "$CROSS_ARCH" ] ;
+          then
+                sudo apt-get -qq update ;
+                sudo apt-get install linux-headers-`uname -r` ;
+          fi
         - gem install asciidoctor
 
 #	DPDK pktio. Note that cache must be purged if dpdk version changes.
         - TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
         - |
-          if [ ! -f "dpdk/${TARGET}/lib/libdpdk.a" ]; then
+          if [ -z "$CROSS_ARCH" -a ! -f "dpdk/${TARGET}/lib/libdpdk.a" ]; then
             git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v17.02 http://dpdk.org/git/dpdk dpdk
             pushd dpdk
             git log --oneline --decorate
@@ -151,7 +166,7 @@  install:
 
 #	Netmap pktio
         - |
-          if [ ! -f "netmap/LINUX/netmap.ko" ]; then
+          if [ -z "$CROSS_ARCH" -a ! -f "netmap/LINUX/netmap.ko" ]; then
             git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v11.2 https://github.com/luigirizzo/netmap.git
             pushd netmap/LINUX
             ./configure
@@ -193,41 +208,10 @@  script:
 jobs:
         include:
                 - stage: test
-                  compiler: aarch64-linux-gnu-gcc
-                  env: TEST="aarch64-linux-gnu" CROSS_ARCH="arm64"
-                  install: gem install asciidoctor
-                - stage: test
-                  compiler: "\"clang-3.8 --target=aarch64-linux-gnu\""
-                  env: TEST="clang-3.8 aarch64-linux-gnu" CROSS_ARCH="arm64"
-                  install: gem install asciidoctor
-                - stage: test
-                  compiler: arm-linux-gnueabihf-gcc
-                  env: TEST="arm-linux-gnueabihf" CROSS_ARCH="armhf"
-                  install: gem install asciidoctor
-                - stage: test
-                  compiler: "\"clang-3.8 --target=arm-linux-gnueabihf\""
-                  env: TEST="clang-3.8 arm-linux-gnueabihf" CROSS_ARCH="armhf" CFLAGS="-march=armv7-a"
-                  install: gem install asciidoctor
-                - stage: test
-                  compiler: powerpc-linux-gnu-gcc
-                  env: TEST="powerpc-linux-gnueabi" CROSS_ARCH="powerpc"
-                  install: gem install asciidoctor
-                - stage: test
-                  compiler: "\"clang-3.8 --target=powerpc-linux-gnu\""
-                  env: TEST="clang-3.8 powerpc-linux-gnu" CROSS_ARCH="powerpc"
-                  install: gem install asciidoctor
-                - stage: test
-                  compiler: "\"gcc -m32\""
-                  env: TEST="i686-linux-gnueabi" CROSS_ARCH="i386"
-                  install: gem install asciidoctor
-                - stage: test
-                  compiler: "\"clang-3.8 -m32\""
-                  env: TEST="clang-3.8 i686-linux-gnu" CROSS_ARCH="i386"
-                  install: gem install asciidoctor
-                - stage: test
                   env: TEST=coverage
                   compiler: gcc
                   script:
+                          - sudo pip install coverage
                           - ./bootstrap
                           - ./configure --prefix=$HOME/odp-install
                             --enable-user-guides