Makefile.defs: map gcc v10.x to 9.0+ options
authorDaniel-Constantin Mierla <miconda@gmail.com>
Wed, 5 Aug 2020 14:38:01 +0000 (16:38 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Wed, 5 Aug 2020 14:38:01 +0000 (16:38 +0200)
- detect properly the 10.x gcc version number, GH #2425

src/Makefile.defs

index d65a1e2..44fb9d6 100644 (file)
@@ -275,7 +275,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/'\
@@ -306,7 +306,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