tcmode: filter out default cs intall paths from PATH

The toolchain installer can end up modifying the user's PATH via their
dotfiles, but if the ia32 sourcery g++ toolchain is always in the user's path,
things can fail to build, as the ia32 toolchain provides non-prefixed binaries
(e.g. 'gcc', 'ld').

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
This commit is contained in:
Christopher Larson
2012-10-24 08:27:42 -07:00
parent 639415b491
commit 2845e07df7

View File

@@ -99,6 +99,14 @@ python toolchain_metadata_setup () {
l.finalize()
oe_import(l)
# Remove already-added toolchain install paths from the PATH, as they can
# break the build (in particular, the ia32 toolchain, as it provdes
# non-prefixed binaries).
install_prefix_default = bb.data.expand('${HOME}/CodeSourcery/', l)
path = d.getVar('PATH', True).split(':')
path = filter(lambda p: not p.startswith(install_prefix_default), path)
d.setVar('PATH', ':'.join(path))
external_toolchain = l.getVar('EXTERNAL_TOOLCHAIN', True)
if not external_toolchain or external_toolchain == 'UNDEFINED':
bb.fatal("Error: EXTERNAL_TOOLCHAIN must be set to the path to your sourcery toolchain")