Provide a function in envsetup.sh to get the host arch directly

It's very simple logic, and running get_build_var to do it is slow
and has side effects (like needing a lunch target, creating an out
directory, etc.)

Test: source envsetup.sh
Change-Id: If260efd21713874fba7c15dbc0fd23442d776f8a
Merged-In: If260efd21713874fba7c15dbc0fd23442d776f8a
This commit is contained in:
Joe Onorato
2024-05-14 13:54:13 -07:00
parent b63973dfc2
commit 32b2aa33c5
2 changed files with 14 additions and 0 deletions

View File

@@ -196,6 +196,19 @@ function get_build_var()
(\cd $T; build/soong/soong_ui.bash --dumpvar-mode $1)
}
# This logic matches envsetup.mk
function get_host_prebuilt_prefix
{
local un=$(uname)
if [[ $un == "Linux" ]] ; then
echo linux-x86
elif [[ $un == "Darwin" ]] ; then
echo darwin-x86
else
echo "Error: Invalid host operating system: $un" 1>&2
fi
}
# check to see if the supplied product is one we can build
function check_product()
{