]> git.ipfire.org Git - thirdparty/git.git/commitdiff
detect-compiler: make detection independent of locale
authorMichael J Gruber <git@grubix.eu>
Mon, 9 May 2022 11:22:02 +0000 (13:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 May 2022 15:52:26 +0000 (08:52 -0700)
`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>
detect-compiler

index 11d60da5b72512332185c703658cee6d14f551bc..50087f567062c4ff858bd6cae83fb3c59a0e4038 100755 (executable)
@@ -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() {