diff options
author | Tom Rini <trini@konsulko.com> | 2019-12-12 08:18:59 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-12-12 08:18:59 -0500 |
commit | 553cb06887825314e74a9bdac337467c77d1db88 (patch) | |
tree | 0c73f29d194d17a52ed7a4480f68b13f162147ca /tools/buildman/toolchain.py | |
parent | f39abbbc531eb7b246d83dbb765e65afcc0989f8 (diff) | |
parent | b4f98b3b16ec513f7fa6b97ec49792a5e99ec165 (diff) |
Merge tag 'dm-next-13dec19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm into next
buildman improvements including toolchain environment feature
sandbox unicode support in serial
Diffstat (limited to 'tools/buildman/toolchain.py')
-rw-r--r-- | tools/buildman/toolchain.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index cc26e2ede5..4f39bfd0ce 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -18,6 +18,8 @@ import tools (PRIORITY_FULL_PREFIX, PRIORITY_PREFIX_GCC, PRIORITY_PREFIX_GCC_PATH, PRIORITY_CALC) = list(range(4)) +(VAR_CROSS_COMPILE, VAR_PATH, VAR_ARCH, VAR_MAKE_ARGS) = range(4) + # Simple class to collect links from a page class MyHTMLParser(HTMLParser): def __init__(self, arch): @@ -145,6 +147,30 @@ class Toolchain: return value + def GetEnvArgs(self, which): + """Get an environment variable/args value based on the the toolchain + + Args: + which: VAR_... value to get + + Returns: + Value of that environment variable or arguments + """ + wrapper = self.GetWrapper() + if which == VAR_CROSS_COMPILE: + return wrapper + os.path.join(self.path, self.cross) + elif which == VAR_PATH: + return self.path + elif which == VAR_ARCH: + return self.arch + elif which == VAR_MAKE_ARGS: + args = self.MakeArgs() + if args: + return ' '.join(args) + return '' + else: + raise ValueError('Unknown arg to GetEnvArgs (%d)' % which) + def MakeEnvironment(self, full_path): """Returns an environment for using the toolchain. @@ -435,9 +461,10 @@ class Toolchains: self._make_flags['target'] = board.target arg_str = self.ResolveReferences(self._make_flags, self._make_flags.get(board.target, '')) - args = arg_str.split(' ') + args = re.findall("(?:\".*?\"|\S)+", arg_str) i = 0 while i < len(args): + args[i] = args[i].replace('"', '') if not args[i]: del args[i] else: |