detect-compiler: make detection independent of locale

`detect-compiler` has accumulated a few compiler dependent workarounds
lately for the more and more ubiquitious gcc12. This is intended to make
CI set-ups work across tool-chain updates, but also help those
developers who build with `DEVELOPER=1`.

Alas, `detect-compiler` uses the locale dependent output of `$(CC) -v`
to parse for the version string, which fails unless it literally
contains ` version`.

Use `LANG=C $(CC) -v` instead to grep for stable output.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael J Gruber 2022-05-09 13:22:02 +02:00 коммит произвёл Junio C Hamano
Родитель d516b2db0a
Коммит 1fbfd96f50
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -9,7 +9,7 @@ CC="$*"
#
# FreeBSD clang version 3.4.1 (tags/RELEASE...)
get_version_line() {
$CC -v 2>&1 | grep ' version '
LANG=C LC_ALL=C $CC -v 2>&1 | grep ' version '
}
get_family() {