tcmode-external-sourcery: CSL_TARGET_SYS may contain a list of triplets

The first mentioned toolchain triplet from the list is selected, if
there is a correspondent compiler found in external toolchain path.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
This commit is contained in:
Vladimir Zapolskiy
2012-07-17 16:52:34 +03:00
parent 42f025afa7
commit f573bdb536

View File

@@ -17,7 +17,16 @@ CSL_TARGET_SYS_i686 ?= "i686-pc-linux-gnu"
CSL_TARGET_SYS_i586 ?= "i686-pc-linux-gnu"
CSL_TARGET_SYS = "${TARGET_SYS}"
TARGET_PREFIX = "${CSL_TARGET_SYS}-"
def csl_target_sys(d):
toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN', True)
for triplet in d.getVar('CSL_TARGET_SYS', True).split():
gcc = os.path.join(toolchain_path, 'bin', triplet + '-gcc')
if os.path.exists(gcc):
return triplet + '-'
return ''
TARGET_PREFIX = "${@csl_target_sys(d)}"
PREFERRED_PROVIDER_linux-libc-headers = "external-sourcery-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-sourcery-toolchain"