From 61a78231a1d6da47073f9c309d6075d9bb3f11cb Mon Sep 17 00:00:00 2001 From: Felix Yan <felixonmars@archlinux.org> Date: Sun, 25 Feb 2024 19:04:05 +0000 Subject: [PATCH] m4: Correctly detect GCC version When calling as `cc`, GCC does not outputs lowercased "gcc" at least in 13.2.1 version here. ``` $ cc --version cc (GCC) 13.2.1 20230801 ... ``` This fails the check and outputs the confusing message: `configure: $CC is not gcc; assuming it's a reasonably new C compiler` This patch makes it check for upper-cased "GCC" too so that it works correctly: ``` checking version of gcc... 13.2.1 ``` --- m4/fp_gcc_version.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/fp_gcc_version.m4 b/m4/fp_gcc_version.m4 index df581a69f4e4..c1a7f8c5b748 100644 --- a/m4/fp_gcc_version.m4 +++ b/m4/fp_gcc_version.m4 @@ -8,7 +8,7 @@ AC_DEFUN([FP_GCC_VERSION], [ AC_MSG_ERROR([C compiler is required]) fi - if $CC --version | grep -q gcc; then + if $CC --version | grep -qi gcc; then AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version], [ # Be sure only to look at the first occurrence of the "version " string; -- GitLab