OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """NaCl SDK tool SCons.""" | 6 """NaCl SDK tool SCons.""" |
7 | 7 |
8 import __builtin__ | 8 import __builtin__ |
9 import re | 9 import re |
10 import os | 10 import os |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 Some machines have their code built by another machine, they'll therefore | 49 Some machines have their code built by another machine, they'll therefore |
50 run 'true' instead of running the usual build tools. | 50 run 'true' instead of running the usual build tools. |
51 | 51 |
52 Args: | 52 Args: |
53 env: The SCons environment in question. | 53 env: The SCons environment in question. |
54 """ | 54 """ |
55 assert(env.Bit('built_elsewhere')) | 55 assert(env.Bit('built_elsewhere')) |
56 env.Replace(CC='true', CXX='true', LINK='true', AR='true', | 56 env.Replace(CC='true', CXX='true', LINK='true', AR='true', |
57 RANLIB='true', AS='true', ASPP='true', LD='true', | 57 RANLIB='true', AS='true', ASPP='true', LD='true', |
58 STRIP='true') | 58 STRIP='true', PNACLOPT='true', PNACLFINALIZE='true') |
59 | 59 |
60 | 60 |
61 def _SetEnvForNativeSdk(env, sdk_path): | 61 def _SetEnvForNativeSdk(env, sdk_path): |
62 """Initialize environment according to target architecture.""" | 62 """Initialize environment according to target architecture.""" |
63 | 63 |
64 bin_path = os.path.join(sdk_path, 'bin') | 64 bin_path = os.path.join(sdk_path, 'bin') |
65 # NOTE: attempts to eliminate this PATH setting and use | 65 # NOTE: attempts to eliminate this PATH setting and use |
66 # absolute path have been futile | 66 # absolute path have been futile |
67 env.PrependENVPath('PATH', bin_path) | 67 env.PrependENVPath('PATH', bin_path) |
68 | 68 |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 # translation. | 685 # translation. |
686 if not os.path.exists(version_file) or env.Bit('use_sandboxed_translator'): | 686 if not os.path.exists(version_file) or env.Bit('use_sandboxed_translator'): |
687 version_file = os.path.join(os.path.dirname(root), 'pnacl_translator', | 687 version_file = os.path.join(os.path.dirname(root), 'pnacl_translator', |
688 'FEATURE_VERSION') | 688 'FEATURE_VERSION') |
689 if os.path.exists(version_file): | 689 if os.path.exists(version_file): |
690 with open(version_file, 'r') as fh: | 690 with open(version_file, 'r') as fh: |
691 version = int(fh.read()) | 691 version = int(fh.read()) |
692 else: | 692 else: |
693 version = 0 | 693 version = 0 |
694 env.Replace(TOOLCHAIN_FEATURE_VERSION=version) | 694 env.Replace(TOOLCHAIN_FEATURE_VERSION=version) |
OLD | NEW |