mk: tidy up check_cross_compiler
only initialise variables at the point they're needed. Signed-off-by: Leah Rowe <leah@libreboot.org>25.04_branch
parent
45513d56be
commit
e6d3b5763d
6
mk
6
mk
|
@ -295,7 +295,6 @@ check_project_hashes()
|
||||||
check_cross_compiler()
|
check_cross_compiler()
|
||||||
{
|
{
|
||||||
remkdir "$XBMK_CACHE/gnupath"
|
remkdir "$XBMK_CACHE/gnupath"
|
||||||
xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
|
|
||||||
|
|
||||||
cbdir="src/coreboot/$tree"
|
cbdir="src/coreboot/$tree"
|
||||||
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
|
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
|
||||||
|
@ -307,12 +306,11 @@ check_cross_compiler()
|
||||||
export CROSS_COMPILE="${xarch% *}-"
|
export CROSS_COMPILE="${xarch% *}-"
|
||||||
[ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
|
[ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
|
||||||
|
|
||||||
xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
|
|
||||||
|
|
||||||
# match gnat-X to gcc
|
# match gnat-X to gcc
|
||||||
check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
|
check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
|
||||||
|
|
||||||
# sometimes buildgcc fails for like no reason. try twice.
|
xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
|
||||||
|
xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
|
||||||
make -C "$cbdir" crossgcc-$xfix $xgccargs || \
|
make -C "$cbdir" crossgcc-$xfix $xgccargs || \
|
||||||
x_ make -C "$cbdir" crossgcc-$xfix $xgccargs
|
x_ make -C "$cbdir" crossgcc-$xfix $xgccargs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue