[arch][arm] in order to be backwards compatible, continue to try to use TOOLCHAIN_PREFIX

If ARCH_arm_TOOLCHAIN_PREFIX isn't already set, try to use whatever is
in TOOLCHAIN_PREFIX first, before trying to use the path. This is for
compatibility with the top level makefile which currently still only
passes TOOLCHAIN_PREFIX along to the submakefiles.

Change-Id: Ib883c9c9de220df5191ee001b18c4a9eff3192c2
This commit is contained in:
Travis Geiselbrecht
2015-06-16 18:36:20 -07:00
parent de66cda97b
commit b8870a3c43

View File

@@ -3,14 +3,26 @@ ARCH_arm_TOOLCHAIN_INCLUDED := 1
# try to find the toolchain
ifndef ARCH_arm_TOOLCHAIN_PREFIX
# if TOOLCHAIN_PREFIX is not empty, try to use it first
ifneq ($(TOOLCHAIN_PREFIX),)
ARCH_arm_TOOLCHAIN_PREFIX := $(TOOLCHAIN_PREFIX)
FOUNDTOOL=$(shell which $(ARCH_arm_TOOLCHAIN_PREFIX)gcc)
endif
# try a series of common arm toolchain prefixes in the path
ifeq ($(FOUNDTOOL),)
ARCH_arm_TOOLCHAIN_PREFIX := arm-eabi-
FOUNDTOOL=$(shell which $(ARCH_arm_TOOLCHAIN_PREFIX)gcc)
endif
ifeq ($(FOUNDTOOL),)
ARCH_arm_TOOLCHAIN_PREFIX := arm-elf-
FOUNDTOOL=$(shell which $(ARCH_arm_TOOLCHAIN_PREFIX)gcc)
endif
ifeq ($(FOUNDTOOL),)
ARCH_arm_TOOLCHAIN_PREFIX := arm-none-eabi-
FOUNDTOOL=$(shell which $(ARCH_arm_TOOLCHAIN_PREFIX)gcc)
endif
ifeq ($(FOUNDTOOL),)
ARCH_arm_TOOLCHAIN_PREFIX := arm-linux-gnueabi-
FOUNDTOOL=$(shell which $(ARCH_arm_TOOLCHAIN_PREFIX)gcc)
@@ -28,14 +40,13 @@ FOUNDTOOL=$(shell which $(ARCH_arm_TOOLCHAIN_PREFIX)gcc)
ifneq (,$(findstring arm-linux-gnueabi-,$(FOUNDTOOL)))
ARCH_arm_COMPILEFLAGS += -fno-stack-protector
endif
endif # arm-linux-gnueabi-
endif # ARCH_arm_TOOLCHAIN_PREFIX
endif
endif
endif
ifeq ($(FOUNDTOOL),)
$(error cannot find toolchain, please set ARCH_arm_TOOLCHAIN_PREFIX or add it to your path)
endif
endif
ifeq ($(ARM_CPU),cortex-m3)