Merge remote-tracking branch 'origin/master' into ovn3
[cascardo/ovs.git] / .travis / build.sh
index 3570992..942265a 100755 (executable)
@@ -4,6 +4,7 @@ set -o errexit
 
 KERNELSRC=""
 CFLAGS="-Werror"
+SPARSE_FLAGS=""
 EXTRA_OPTS=""
 
 function install_kernel()
@@ -66,15 +67,15 @@ fi
 
 if [ "$DPDK" ]; then
     if [ -z "$DPDK_VER" ]; then
-           DPDK_VER="1.7.1"
+           DPDK_VER="1.8.0"
     fi
     install_dpdk $DPDK_VER
-    # Disregard bad function cassts until DPDK is fixed
+    # Disregard bad function casts until DPDK is fixed
     CFLAGS="$CFLAGS -Wno-error=bad-function-cast -Wno-error=cast-align"
     EXTRA_OPTS+="--with-dpdk=./dpdk-$DPDK_VER/build"
 elif [ $CC != "clang" ]; then
     # DPDK headers currently trigger sparse errors
-    CFLAGS="$CFLAGS -Wsparse-error"
+    SPARSE_FLAGS="$SPARSE_FLAGS -Wsparse-error"
 fi
 
 configure_ovs $EXTRA_OPTS $*
@@ -86,8 +87,11 @@ fi
 
 if [ $CC = "clang" ]; then
     make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
+elif [[ $BUILD_ENV =~ "-m32" ]]; then
+    # Disable sparse for 32bit builds on 64bit machine
+    make CFLAGS="$CFLAGS $BUILD_ENV"
 else
-    make CFLAGS="$CFLAGS" C=1
+    make CFLAGS="$CFLAGS $BUILD_ENV $SPARSE_FLAGS" C=1
 fi
 
 if [ $TESTSUITE ] && [ $CC != "clang" ]; then