Ports: Make sure HOST_* variables are set correctly for nested builds

When building a port as a dependency for another port the HOST_*
variables were previously initialized with values referring to the
SerenityOS toolchain.

Fixes #9168.
This commit is contained in:
Gunnar Beutner 2021-08-13 20:51:04 +02:00 committed by Andreas Kling
parent a1518e870d
commit 6eee60de41
Notes: sideshowbarker 2024-07-18 07:01:05 +09:00

View File

@ -4,14 +4,16 @@ set -eu
SCRIPT="$(dirname "${0}")"
export SERENITY_ARCH="${SERENITY_ARCH:-i686}"
HOST_CC="${CC:=cc}"
HOST_CXX="${CXX:=c++}"
HOST_AR="${AR:=ar}"
HOST_RANLIB="${RANLIB:=ranlib}"
HOST_PATH="${PATH:=}"
HOST_PKG_CONFIG_DIR="${PKG_CONFIG_DIR:=}"
HOST_PKG_CONFIG_SYSROOT_DIR="${PKG_CONFIG_SYSROOT_DIR:=}"
HOST_PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:=}"
if [ -z "${HOST_CC:=}" ]; then
export HOST_CC="${CC:=cc}"
export HOST_CXX="${CXX:=c++}"
export HOST_AR="${AR:=ar}"
export HOST_RANLIB="${RANLIB:=ranlib}"
export HOST_PATH="${PATH:=}"
export HOST_PKG_CONFIG_DIR="${PKG_CONFIG_DIR:=}"
export HOST_PKG_CONFIG_SYSROOT_DIR="${PKG_CONFIG_SYSROOT_DIR:=}"
export HOST_PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:=}"
fi
DESTDIR="/"