| 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 ) | 671 ) |
| 672 env.Append(SCANNERS=ldscript_scanner) | 672 env.Append(SCANNERS=ldscript_scanner) |
| 673 | 673 |
| 674 # Scons tests can check this version number to decide whether to | 674 # Scons tests can check this version number to decide whether to |
| 675 # enable tests for toolchain bug fixes or new features. See | 675 # enable tests for toolchain bug fixes or new features. See |
| 676 # description in pnacl/build.sh. | 676 # description in pnacl/build.sh. |
| 677 if 'toolchain_feature_version' in SCons.Script.ARGUMENTS: | 677 if 'toolchain_feature_version' in SCons.Script.ARGUMENTS: |
| 678 version = int(SCons.Script.ARGUMENTS['toolchain_feature_version']) | 678 version = int(SCons.Script.ARGUMENTS['toolchain_feature_version']) |
| 679 else: | 679 else: |
| 680 version_file = os.path.join(root, 'FEATURE_VERSION') | 680 version_file = os.path.join(root, 'FEATURE_VERSION') |
| 681 # There is no pnacl_newlib toolchain on ARM, only a pnacl_translator, so |
| 682 # use that if necessary. Otherwise use it if we are doing sandboxed |
| 683 # translation. |
| 684 if not os.path.exists(version_file) or env.Bit('use_sandboxed_translator'): |
| 685 version_file = os.path.join(os.path.dirname(root), 'pnacl_translator', |
| 686 'FEATURE_VERSION') |
| 681 if os.path.exists(version_file): | 687 if os.path.exists(version_file): |
| 682 with open(version_file, 'r') as fh: | 688 with open(version_file, 'r') as fh: |
| 683 version = int(fh.read()) | 689 version = int(fh.read()) |
| 684 else: | 690 else: |
| 685 version = 0 | 691 version = 0 |
| 686 env.Replace(TOOLCHAIN_FEATURE_VERSION=version) | 692 env.Replace(TOOLCHAIN_FEATURE_VERSION=version) |
| OLD | NEW |