functions.sh: set host compiler when cross-compiling

We chose to use kernel style HOST* instead of the gcc's
*_FOR_HOST.
This commit is contained in:
Timo Teräs 2017-02-24 10:19:47 +02:00
parent 32dbf36f0e
commit 9be173c677
1 changed files with 7 additions and 0 deletions

View File

@ -133,6 +133,13 @@ readconfig() {
# setup cross-compiler
if [ -z "$CROSS_COMPILE" ]; then
export CROSS_COMPILE="${CHOST}-"
export HOSTCC="$CC"
export HOSTCXX="$CXX"
export HOSTLD="$LD"
export HOSTCPPFLAGS="$CPPFLAGS"
export HOSTCXXFLAGS="$CXXFLAGS"
export HOSTCFLAGS="$CFLAGS"
export HOSTLDFLAGS="$LDFLAGS"
export CC=${CROSS_COMPILE}gcc
export CXX=${CROSS_COMPILE}g++
export LD=${CROSS_COMPILE}ld