Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (46 sloc) 888 Bytes
function cross_compile_prepare()
{
local arch key value path
case $1 in
aarch64)
arch=arm64
;;
*)
arch=$1
;;
esac
if test -f "$HOME/.cross-compile"; then
while read key value; do
key="${key%:}"
if test "$key" = "path"; then
eval "value=$value"
if test -n "$path"; then
path="$path:$value"
else
path="$value"
fi
elif test "$key" = "$arch"; then
if test -n "$CROSS_COMPILE"; then
saved_CROSS_COMPILE="$CROSS_COMPILE"
fi
ARCH=$arch; CROSS_COMPILE="$value"
export ARCH CROSS_COMPILE
fi
done < "$HOME/.cross-compile"
fi
if test -n "$path"; then
saved_PATH="$PATH"
PATH="$path:$PATH"
fi
}
function cross_compile_cleanup()
{
if test -n "$saved_CROSS_COMPILE"; then
CROSS_COMPILE="$saved_CROSS_COMPILE"
else
unset CROSS_COMPILE
fi
if test -n "$saved_PATH"; then
PATH="$saved_PATH"
fi
}