From c6ffd04e7b8d019d0e5cb17f036132c13b06d31a Mon Sep 17 00:00:00 2001
From: Allan McRae <allan@archlinux.org>
Date: Sat, 20 Apr 2024 11:37:54 +1000
Subject: [PATCH 30/N] libmakepkg: do not unset CHOST with !buildflags

Also ensure CHOST and MAKEFLAGS are exported.

Signed-off-by: Allan McRae <allan@archlinux.org>
---
 scripts/libmakepkg/buildenv.sh.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in
index 830664b..7a0d971 100644
--- a/scripts/libmakepkg/buildenv.sh.in
+++ b/scripts/libmakepkg/buildenv.sh.in
@@ -25,7 +25,7 @@ LIBMAKEPKG_BUILDENV_SH=1
 MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
 
 declare -a buildenv_functions build_options
-buildenv_vars=('CPPFLAGS' 'CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'CHOST')
+buildenv_vars=('CPPFLAGS' 'CFLAGS' 'CXXFLAGS' 'LDFLAGS')
 
 for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do
 	source "$lib"
@@ -42,5 +42,5 @@ prepare_buildenv() {
 	done
 
 	# ensure all necessary build variables are exported
-	export ${buildenv_vars[@]} CC CXX
+	export ${buildenv_vars[@]} CC CXX CHOST MAKEFLAGS
 }
