Bläddra i källkod

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

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

(cherry picked from commit 79e7738027a40affa4c7f606bf55a3ad0fe31bc4)
Daniel-Constantin Mierla 5 år sedan
förälder
incheckning
92ddff8921
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      src/Makefile.defs

+ 4 - 2
src/Makefile.defs

@@ -274,7 +274,7 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
 	RPAREN=)
 	CC_VER:=$(word 1,$(CC)) $(shell $(CC) - --version 2>/dev/null|head -n 1|\
 				sed  -e 's/([^$(RPAREN)]*)//g' \
-					 -e 's/^.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\
+					 -e 's/^.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\
 					 -e 's/^[^0-9].*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/')
 #	CC_VER:=$(word 1,$(CC)) $(shell $(CC) - --version|head -n 1|cut -d" " -f 3\
 #				|sed -e 's/^.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\
@@ -305,7 +305,9 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
 					-e 's/8\.[0-9]\..*/8.0+/' \
 					-e 's/8\.[0-9]$$/8.0+/' \
 					-e 's/9\.[0-9]\..*/9.0+/' \
-					-e 's/9\.[0-9]$$/9.0+/')
+					-e 's/9\.[0-9]$$/9.0+/' \
+					-e 's/10\.[0-9]\..*/9.0+/' \
+					-e 's/10\.[0-9]$$/9.0+/')
 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))))
 	# dependencies can be generated on-the-fly while compiling *.c
 	CC_MKDEP_OPTS=-MMD -MP