| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 def _SetEnvForPnacl(env, root): | 161 def _SetEnvForPnacl(env, root): |
| 162 # All the PNaCl tools require Python to be in the PATH. | 162 # All the PNaCl tools require Python to be in the PATH. |
| 163 arch = env['TARGET_FULLARCH'] | 163 arch = env['TARGET_FULLARCH'] |
| 164 assert arch in ['arm', 'mips32', 'x86-32', 'x86-64'] | 164 assert arch in ['arm', 'mips32', 'x86-32', 'x86-64'] |
| 165 | 165 |
| 166 if env.Bit('pnacl_unsandboxed'): | 166 if env.Bit('pnacl_unsandboxed'): |
| 167 if env.Bit('host_linux'): | 167 if env.Bit('host_linux'): |
| 168 arch = '%s-linux' % arch | 168 arch = '%s-linux' % arch |
| 169 elif env.Bit('host_mac'): | 169 elif env.Bit('host_mac'): |
| 170 arch = '%s-mac' % arch | 170 arch = '%s-mac' % arch |
| 171 if env.Bit('nonsfi_nacl'): |
| 172 arch += '-nonsfi' |
| 171 arch_flag = ' -arch %s' % arch | 173 arch_flag = ' -arch %s' % arch |
| 172 if env.Bit('pnacl_generate_pexe'): | 174 if env.Bit('pnacl_generate_pexe'): |
| 173 ld_arch_flag = '' | 175 ld_arch_flag = '' |
| 174 else: | 176 else: |
| 175 ld_arch_flag = arch_flag | 177 ld_arch_flag = arch_flag |
| 176 | 178 |
| 177 if env.Bit('nacl_glibc'): | 179 if env.Bit('nacl_glibc'): |
| 178 subroot = root + '/glibc' | 180 subroot = root + '/glibc' |
| 179 else: | 181 else: |
| 180 subroot = root | 182 subroot = root |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 if 'toolchain_feature_version' in SCons.Script.ARGUMENTS: | 703 if 'toolchain_feature_version' in SCons.Script.ARGUMENTS: |
| 702 version = int(SCons.Script.ARGUMENTS['toolchain_feature_version']) | 704 version = int(SCons.Script.ARGUMENTS['toolchain_feature_version']) |
| 703 else: | 705 else: |
| 704 version_file = os.path.join(root, 'FEATURE_VERSION') | 706 version_file = os.path.join(root, 'FEATURE_VERSION') |
| 705 if os.path.exists(version_file): | 707 if os.path.exists(version_file): |
| 706 with open(version_file, 'r') as fh: | 708 with open(version_file, 'r') as fh: |
| 707 version = int(fh.read()) | 709 version = int(fh.read()) |
| 708 else: | 710 else: |
| 709 version = 0 | 711 version = 0 |
| 710 env.Replace(TOOLCHAIN_FEATURE_VERSION=version) | 712 env.Replace(TOOLCHAIN_FEATURE_VERSION=version) |
| OLD | NEW |