build system: trim crosstool-ng commit ID when checking version

Since 2.11.0, git does not default to 7 characters for short commit IDs,
instead automatically estimating the number of characters based on
repository size [1]. If the toolchain was compiled on a computer with
new version of git installed, commit ID will contain 8 characters, and
the check for the toolchain version will fail. As a workaround, trim the
commit ID to 7 characters when checking the version.

[1] e6c587c733
pull/783/merge
Ivan Grokhotkov 2017-09-12 18:50:33 +08:00
rodzic 61e3a5bd16
commit 82fb2768aa
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -489,11 +489,11 @@ list-components:
# the part after the brackets is extracted into TOOLCHAIN_GCC_VER. # the part after the brackets is extracted into TOOLCHAIN_GCC_VER.
ifdef CONFIG_TOOLPREFIX ifdef CONFIG_TOOLPREFIX
ifndef MAKE_RESTARTS ifndef MAKE_RESTARTS
TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(([^)]*).*|\1|gp') TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|.*crosstool-ng-([0-9]+).([0-9]+).([0-9]+)-([0-9]+)-g([0-9a-f]{7}).*|\1.\2.\3-\4-g\5|gp')
TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(.*\)\ (.*)|\1|gp') TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(.*\)\ (.*)|\1|gp')
# Officially supported version(s) # Officially supported version(s)
SUPPORTED_TOOLCHAIN_COMMIT_DESC := crosstool-NG crosstool-ng-1.22.0-70-gfa0bad1b SUPPORTED_TOOLCHAIN_COMMIT_DESC := 1.22.0-70-gfa0bad1
SUPPORTED_TOOLCHAIN_GCC_VERSIONS := 5.2.0 SUPPORTED_TOOLCHAIN_GCC_VERSIONS := 5.2.0
ifdef TOOLCHAIN_COMMIT_DESC ifdef TOOLCHAIN_COMMIT_DESC