trees: correction on check_gnu_path

i intend for this function to work generically,
matching gnat to gcc or gcc to gnat, but there was
a hangover from the previous code where it specifically
assumed we were matching gnat

this bug manifested when i tested with gnat being v13
and gcc being v14 in path, where gcc-13 was also
available in path.

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2024-12-30 17:59:19 +00:00
parent ec2f071666
commit cfb6de94c3
1 changed files with 2 additions and 2 deletions

View File

@ -232,7 +232,7 @@ check_gnu_path()
eval "[ \"\$$_gnuarg\" = \"gnat\" ] && continue"
$err "check_gnu_path: Invalid argument \"$_gnuarg\""
done
command -v $1 1>/dev/null || $err "Host gcc unavailable"
command -v $1 1>/dev/null || $err "Host '$1' unavailable"
eval `setvars "" gccver gccfull gnatver gnatfull gccdir gnatdir`
gnu_setver "$1" "$1" || $err "Command '$1' unavailable."
@ -246,7 +246,7 @@ check_gnu_path()
for _gnubin in "$_gnudir/$2-"*; do
[ -f "$_gnubin" ] || continue
[ "${_gnubin#"$_gnudir/$2-"}" = "$_gnuver" ] || continue
gnatver="${_gnubin#"$_gnudir/$2-"}"; break
_gnuver="${_gnubin#"$_gnudir/$2-"}"; break
done
gnu_setver "$2" "$_gnudir/$2-$_gnuver" || return 1
[ "$gnatfull" = "$gccfull" ] || return 1