[Buildroot] [git commit branch/2020.02.x] toolchain: adjust version check to allow for single numbers

Peter Korsgaard peter at korsgaard.com
Mon Jul 13 07:05:01 UTC 2020


commit: https://git.buildroot.net/buildroot/commit/?id=3270eade9354889e6c1a626e026b9cac4d71c092
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2020.02.x

A gcc compiler, which was configured with
--with-gcc-major-version-only, will only return a single
number. (debian does this for example).

A simple modification allows the check to work with both
single numbers (eg. '9') and full versions (eg. '9.2.1').

Signed-off-by: Norbert Lange <nolange79 at gmail.com>
Reviewed-by: Romain Naour <romain.naour at gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
(cherry picked from commit 5303e72a80e44c265473706a2d4f3acb5010814f)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 toolchain/helpers.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 44d0c83d1e..17bc159f3e 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -184,7 +184,7 @@ check_gcc_version = \
 		exit 0 ; \
 	fi; \
 	real_version=`$(1) -dumpversion` ; \
-	if [[ ! "$${real_version}" =~ ^$${expected_version}\. ]] ; then \
+	if [[ ! "$${real_version}." =~ ^$${expected_version}\. ]] ; then \
 		printf "Incorrect selection of gcc version: expected %s.x, got %s\n" \
 			"$${expected_version}" "$${real_version}" ; \
 		exit 1 ; \


More information about the buildroot mailing list