parent
17168a87db
commit
7849a07588
|
@ -1,10 +1,7 @@
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
# Copyright (c) 2024 Leah Rowe <leah@libreboot.org>
|
# Copyright (c) 2024 Leah Rowe <leah@libreboot.org>
|
||||||
|
|
||||||
# debian trixie/sid ship with gcc 14 when running "gcc",
|
# fix mismatching gcc/gnat versions on debian trixie/sid
|
||||||
# but (as of December 2024) gnat is gnat-13. we must create
|
|
||||||
# a symlink accordingly.
|
|
||||||
# however, the user may also have gcc 13+14, but only gnat 13
|
|
||||||
check_gnat_path()
|
check_gnat_path()
|
||||||
{
|
{
|
||||||
eval `setvars "" gccver gnatver gccdir`
|
eval `setvars "" gccver gnatver gccdir`
|
||||||
|
@ -21,18 +18,14 @@ check_gnat_path()
|
||||||
[ "$gnatver" = "$gccver" ] && return 0
|
[ "$gnatver" = "$gccver" ] && return 0
|
||||||
|
|
||||||
gccdir="$(dirname "$(command -v gcc)")"
|
gccdir="$(dirname "$(command -v gcc)")"
|
||||||
|
|
||||||
for _gnatbin in "$gccdir/gnat-"*; do
|
for _gnatbin in "$gccdir/gnat-"*; do
|
||||||
[ -f "$_gnatbin" ] || continue
|
[ -f "$_gnatbin" ] || continue
|
||||||
[ "${_gnatbin#"$gccdir/gnat-"}" = "$gccver" ] || continue
|
[ "${_gnatbin#"$gccdir/gnat-"}" = "$gccver" ] || continue
|
||||||
gnatver="${_gnatbin#"$gccdir/gnat-"}"
|
gnatver="${_gnatbin#"$gccdir/gnat-"}"
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
|
||||||
[ "$gnatver" = "$gccver" ] || $err "GCC/GNAT versions do not match."
|
[ "$gnatver" = "$gccver" ] || $err "GCC/GNAT versions do not match."
|
||||||
|
|
||||||
# we already established that the versions match, but if gnat isn't
|
|
||||||
# in path, then we assume it's in e.g. /usr/bin/gnat-14
|
|
||||||
(
|
(
|
||||||
x_ cd xbmkpath
|
x_ cd xbmkpath
|
||||||
for _gnatbin in "$gccdir/gnat"*"-$gccver"; do
|
for _gnatbin in "$gccdir/gnat"*"-$gccver"; do
|
||||||
|
|
Loading…
Reference in New Issue