[5/5] travis: pass a correct CC/CXX if CROSS_COMPILE is defined
diff mbox series

Message ID 20190626135546.50665-6-roger.pau@citrix.com
State New, archived
Headers show
Series
  • build improvements/fixes after b41666f2c1
Related show

Commit Message

Roger Pau Monné June 26, 2019, 1:55 p.m. UTC
After b41666f2c1 Xen no longer overwrites the names of the build
toolchain utilities required during the build process, and instead
uses the values from the environment.

In that case, if the user wants to define CC or other variables to
point to specific toolchain utilities to use it must also take into
account that such variables must be prefixed with CROSS_COMPILE, since
Xen will no longer do this.

Fixes: b41666f2c1 ('config: don't hardcode toolchain binaries')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Doug Goldstein <cardoe@cardoe.com>
---
 scripts/travis-build | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch
diff mbox series

diff --git a/scripts/travis-build b/scripts/travis-build
index 0cb15a89e4..a264e286b2 100755
--- a/scripts/travis-build
+++ b/scripts/travis-build
@@ -1,6 +1,14 @@ 
 #!/bin/bash -ex
 
+# Set HOST{CC/CXX} in case we are cross building
+export HOSTCC=${CC}
+export HOSTCXX=${CXX}
+# Prefix environment CC/CXX with CROSS_COMPILE if present
+export CC=${CROSS_COMPILE}${CC}
+export CXX=${CROSS_COMPILE}${CXX}
+
 $CC --version
+[[ "${CC}" != "${HOSTCC}" ]] && $HOSTCC --version
 
 # random config or default config
 if [[ "${RANDCONFIG}" == "y" ]]; then