From 6eee60de41b51856e80230196abd69357f1cec21 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 13 Aug 2021 20:51:04 +0200 Subject: [PATCH] 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. --- Ports/.port_include.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index bae6d29620..79a0f6b6c3 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -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="/"