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>

Michael J Gruber committed May 9, 2022 at 13:22 UTC 1fbfd96f50971ed7ca4cae4957ffe10f2441d49f
1 file changed +1 -1
detect-compiler
+1 -1
@@ -9,7 +9,7 @@ CC="$*"
9 #
10 # FreeBSD clang version 3.4.1 (tags/RELEASE...)
11 get_version_line() {
12 - $CC -v 2>&1 | grep ' version '
12 + LANG=C LC_ALL=C $CC -v 2>&1 | grep ' version '
13 }
14
15 get_family() {