Browse code

Makefile.defs: map gcc v10.x to 9.0+ options

- detect properly the 10.x gcc version number, GH #2425

Daniel-Constantin Mierla authored on 05/08/2020 14:38:01
Showing 1 changed files
... ...
@@ -275,7 +275,7 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
275 275
 	RPAREN=)
276 276
 	CC_VER:=$(word 1,$(CC)) $(shell $(CC) - --version 2>/dev/null|head -n 1|\
277 277
 				sed  -e 's/([^$(RPAREN)]*)//g' \
278
-					 -e 's/^.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\
278
+					 -e 's/^.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\
279 279
 					 -e 's/^[^0-9].*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/')
280 280
 #	CC_VER:=$(word 1,$(CC)) $(shell $(CC) - --version|head -n 1|cut -d" " -f 3\
281 281
 #				|sed -e 's/^.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\
... ...
@@ -306,7 +306,9 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
306 306
 					-e 's/8\.[0-9]\..*/8.0+/' \
307 307
 					-e 's/8\.[0-9]$$/8.0+/' \
308 308
 					-e 's/9\.[0-9]\..*/9.0+/' \
309
-					-e 's/9\.[0-9]$$/9.0+/')
309
+					-e 's/9\.[0-9]$$/9.0+/' \
310
+					-e 's/10\.[0-9]\..*/9.0+/' \
311
+					-e 's/10\.[0-9]$$/9.0+/')
310 312
 ifeq (,$(strip $(filter-out 3.0 3.4 4.x 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
311 313
 	# dependencies can be generated on-the-fly while compiling *.c
312 314
 	CC_MKDEP_OPTS=-MMD -MP