From be73bed243bdc9df403f668c08e3f3ca59320530 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Fri, 9 Nov 2012 14:50:32 -0700 Subject: [PATCH] tcmode: prefer a matching gcc version for target recipes Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external-sourcery.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index 3514e9a..d15f1b3 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -155,4 +155,16 @@ def populate_toolchain_links(d): require conf/distro/include/csl-versions.inc +def get_gcc_version_prefix(d): + ver = d.getVar('CSL_VER_GCC', True) + if ver: + components = ver.split('.') + if len(components) > 1: + return '.'.join(components[:2]) + else: + return '4.7%' + +# Prefer a matching gcc version +GCCVERSION ?= "${@get_gcc_version_prefix(d)}%" + BUILDCFG_VARS += "CSL_VER_MAIN EXTERNAL_TOOLCHAIN"