Skip to content
Snippets Groups Projects
Commit e44c887f authored by Peter A. Jonsson's avatar Peter A. Jonsson
Browse files

Fix version detection for recent gcc

GCC 7 in Ubuntu 18 and GCC 9 in Ubuntu 20
only emits the major version when called
with -dumpversion which causes GCC_MINOR_VERSION
to become empty. GCC also has a -dumpfullversion
that will emit the entire version on GCC 7
and later, but msp430-gcc will fail with
an error message because there are no input
files.

Adding both parameters makes both msp430-gcc
and GCC 7/9 on Ubuntu provide the full version
so use that in the GCC version detection.
parent 37e3b357
Branches
No related tags found
No related merge requests found
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
# GCC specific definitions and actions # GCC specific definitions and actions
# #
GCC_MAJOR_VERSION := $(shell $(CC) -dumpversion | cut -d "." -f 1) GCC_VERSION := $(shell $(CC) -dumpfullversion -dumpversion)
GCC_MINOR_VERSION := $(shell $(CC) -dumpversion | cut -d "." -f 2) GCC_MAJOR_VERSION := $(word 1,$(subst ., ,$(GCC_VERSION)))
GCC_MINOR_VERSION := $(word 2,$(subst ., ,$(GCC_VERSION)))
# Warn if using version 6.3.x of arm-none-eabi-gcc # Warn if using version 6.3.x of arm-none-eabi-gcc
ifeq ("$(CC)","arm-none-eabi-gcc") ifeq ("$(CC)","arm-none-eabi-gcc")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment