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 if not os.path.exists(version_file): | |
jvoung (off chromium)
2014/06/18 18:54:11
Leave a comment about why you check the fallback?
| |
682 version_file = os.path.join(os.path.dirname(root), 'pnacl_translator', | |
683 'FEATURE_VERSION') | |
681 if os.path.exists(version_file): | 684 if os.path.exists(version_file): |
682 with open(version_file, 'r') as fh: | 685 with open(version_file, 'r') as fh: |
683 version = int(fh.read()) | 686 version = int(fh.read()) |
684 else: | 687 else: |
685 version = 0 | 688 version = 0 |
686 env.Replace(TOOLCHAIN_FEATURE_VERSION=version) | 689 env.Replace(TOOLCHAIN_FEATURE_VERSION=version) |
OLD | NEW |