mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-18 14:12:44 +02:00
mk: reduce indentation in check_cross_compiler()
we only call it in one place. the resulting code is still quite clear. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -211,7 +211,9 @@ handle_defconfig()
|
|||||||
if [ "$mode" = "distclean" ] || [ "$mode" = "crossgcc-clean" ]; then
|
if [ "$mode" = "distclean" ] || [ "$mode" = "crossgcc-clean" ]; then
|
||||||
[ -d "$srcdir" ] || return 0
|
[ -d "$srcdir" ] || return 0
|
||||||
fi
|
fi
|
||||||
[ -z "$mode" ] && $dry check_cross_compiler
|
[ -z "$mode" ] && for _xarch in $xarch; do
|
||||||
|
$dry check_cross_compiler "$_xarch"
|
||||||
|
done; :
|
||||||
|
|
||||||
for y in "$target_dir/config"/*; do
|
for y in "$target_dir/config"/*; do
|
||||||
[ "$_f" = "-d" ] || [ -f "$y" ] || continue
|
[ "$_f" = "-d" ] || [ -f "$y" ] || continue
|
||||||
@@ -295,29 +297,28 @@ check_project_hashes()
|
|||||||
check_cross_compiler()
|
check_cross_compiler()
|
||||||
{
|
{
|
||||||
xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
|
xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
|
||||||
for _xarch in $xarch; do
|
|
||||||
cbdir="src/coreboot/$tree"
|
|
||||||
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
|
|
||||||
[ -n "$xtree" ] && cbdir="src/coreboot/$xtree"
|
|
||||||
|
|
||||||
x_ ./mk -f coreboot "${cbdir#src/coreboot/}"
|
cbdir="src/coreboot/$tree"
|
||||||
|
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
|
||||||
|
[ -n "$xtree" ] && cbdir="src/coreboot/$xtree"
|
||||||
|
|
||||||
export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH"
|
x_ ./mk -f coreboot "${cbdir#src/coreboot/}"
|
||||||
export CROSS_COMPILE="${xarch% *}-"
|
|
||||||
[ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
|
|
||||||
|
|
||||||
xfix="${_xarch%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
|
export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH"
|
||||||
|
export CROSS_COMPILE="${xarch% *}-"
|
||||||
|
[ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
|
||||||
|
|
||||||
# match gnat-X to gcc
|
xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
|
||||||
check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
|
|
||||||
|
|
||||||
# sometimes buildgcc fails for like no reason. try twice.
|
# match gnat-X to gcc
|
||||||
make -C "$cbdir" crossgcc-$xfix $xgccargs || \
|
check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
|
||||||
x_ make -C "$cbdir" crossgcc-$xfix $xgccargs
|
|
||||||
|
|
||||||
# we only want to mess with hostcc to build xgcc
|
# sometimes buildgcc fails for like no reason. try twice.
|
||||||
rm -f "$XBMK_CACHE/gnupath/"* || $err "Can't clear gnupath/"; :
|
make -C "$cbdir" crossgcc-$xfix $xgccargs || \
|
||||||
done; :
|
x_ make -C "$cbdir" crossgcc-$xfix $xgccargs
|
||||||
|
|
||||||
|
# we only want to mess with hostcc to build xgcc
|
||||||
|
rm -f "$XBMK_CACHE/gnupath/"* || $err "Can't clear gnupath/"; :
|
||||||
}
|
}
|
||||||
|
|
||||||
# fix mismatching gcc/gnat versions on debian trixie/sid. as of december 2024,
|
# fix mismatching gcc/gnat versions on debian trixie/sid. as of december 2024,
|
||||||
|
|||||||
Reference in New Issue
Block a user