Index: toolchain_build/command.py |
diff --git a/toolchain_build/command.py b/toolchain_build/command.py |
index c39f28f5c8adb2b3b05c522ce2422e3eae4118c4..bea6fd8d9c12b3c0253e348545bda289ba3f9236 100755 |
--- a/toolchain_build/command.py |
+++ b/toolchain_build/command.py |
@@ -196,7 +196,13 @@ def Command(command, stdout=None, run_cond=None, **kwargs): |
path_dirs = [subst.Substitute(dirname) for dirname |
in check_call_kwargs['path_dirs']] |
del check_call_kwargs['path_dirs'] |
- check_call_kwargs['env'] = PlatformEnvironment(path_dirs) |
+ # Perform substitution on any env overrides. |
+ if 'env' in check_call_kwargs: |
+ check_call_kwargs['env'] = { k: subst.Substitute(v) |
+ for (k, v) in check_call_kwargs['env'].iteritems() } |
+ check_call_kwargs['env'].update(PlatformEnvironment(path_dirs)) |
+ else: |
+ check_call_kwargs['env'] = PlatformEnvironment(path_dirs) |
if isinstance(command, str): |
command = subst.Substitute(command) |