summaryrefslogtreecommitdiff
path: root/Ports/.port_include.sh
diff options
context:
space:
mode:
authorGunnar Beutner <gunnar@beutner.name>2021-08-13 20:51:04 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-13 21:29:48 +0200
commit6eee60de41b51856e80230196abd69357f1cec21 (patch)
treec71ebd020d7eeb892b37bca0c7c21f11a5945379 /Ports/.port_include.sh
parenta1518e870d84652bd525de38f8a3d9d38a46f8f6 (diff)
downloadserenity-6eee60de41b51856e80230196abd69357f1cec21.zip
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.
Diffstat (limited to 'Ports/.port_include.sh')
-rwxr-xr-xPorts/.port_include.sh18
1 files 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="/"