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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 def _SetEnvForPnacl(env, root): | 234 def _SetEnvForPnacl(env, root): |
235 # All the PNaCl tools require Python to be in the PATH. | 235 # All the PNaCl tools require Python to be in the PATH. |
236 # On the Windows bots, however, Python is not installed system-wide. | 236 # On the Windows bots, however, Python is not installed system-wide. |
237 # It must be pulled from ../third_party/python_26. | 237 # It must be pulled from ../third_party/python_26. |
238 python_dir = os.path.join('..', 'third_party', 'python_26') | 238 python_dir = os.path.join('..', 'third_party', 'python_26') |
239 env.AppendENVPath('PATH', python_dir) | 239 env.AppendENVPath('PATH', python_dir) |
240 | 240 |
241 arch = env['TARGET_FULLARCH'] | 241 arch = env['TARGET_FULLARCH'] |
242 assert arch in ['arm', 'arm-thumb2', 'mips32', 'x86-32', 'x86-64'] | 242 assert arch in ['arm', 'arm-thumb2', 'mips32', 'x86-32', 'x86-64'] |
243 | 243 |
| 244 if env.Bit('pnacl_unsandboxed'): |
| 245 arch = 'linux-%s' % arch |
244 arch_flag = ' -arch %s' % arch | 246 arch_flag = ' -arch %s' % arch |
245 if env.Bit('pnacl_generate_pexe'): | 247 if env.Bit('pnacl_generate_pexe'): |
246 ld_arch_flag = '' | 248 ld_arch_flag = '' |
247 else: | 249 else: |
248 ld_arch_flag = arch_flag | 250 ld_arch_flag = arch_flag |
249 | 251 |
250 if env.Bit('nacl_glibc'): | 252 if env.Bit('nacl_glibc'): |
251 subroot = root + '/glibc' | 253 subroot = root + '/glibc' |
252 else: | 254 else: |
253 subroot = root | 255 subroot = root |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 # Dependency files it produces are to be found in ${LIBPATH}. | 788 # Dependency files it produces are to be found in ${LIBPATH}. |
787 # It is applied recursively to those dependencies in case | 789 # It is applied recursively to those dependencies in case |
788 # some of them are linker scripts too. | 790 # some of them are linker scripts too. |
789 ldscript_scanner = SCons.Scanner.Base( | 791 ldscript_scanner = SCons.Scanner.Base( |
790 function=ScanLinkerScript, | 792 function=ScanLinkerScript, |
791 skeys=['.a', '.so', '.pso'], | 793 skeys=['.a', '.so', '.pso'], |
792 path_function=SCons.Scanner.FindPathDirs('LIBPATH'), | 794 path_function=SCons.Scanner.FindPathDirs('LIBPATH'), |
793 recursive=True | 795 recursive=True |
794 ) | 796 ) |
795 env.Append(SCANNERS=ldscript_scanner) | 797 env.Append(SCANNERS=ldscript_scanner) |
OLD | NEW |