| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 if env.Bit('nacl_pic'): | 246 if env.Bit('nacl_pic'): |
| 247 pnacl_cc_flags += ' -fPIC' | 247 pnacl_cc_flags += ' -fPIC' |
| 248 pnacl_cxx_flags += ' -fPIC' | 248 pnacl_cxx_flags += ' -fPIC' |
| 249 # NOTE: this is a special hack for the pnacl backend which | 249 # NOTE: this is a special hack for the pnacl backend which |
| 250 # does more than linking | 250 # does more than linking |
| 251 pnacl_ld_flags += ' -fPIC' | 251 pnacl_ld_flags += ' -fPIC' |
| 252 | 252 |
| 253 if env.Bit('use_sandboxed_translator'): | 253 if env.Bit('use_sandboxed_translator'): |
| 254 pnacl_ld_flags += ' --pnacl-sb' | 254 pnacl_ld_flags += ' --pnacl-sb' |
| 255 if env.Bit('sandboxed_translator_dynamic'): | 255 if env.Bit('sandboxed_translator_is_dynamic'): |
| 256 pnacl_ld_flags += ' --pnacl-sb-dynamic' | 256 pnacl_ld_flags += ' --pnacl-sb-dynamic' |
| 257 | 257 |
| 258 # TODO(pdox): Remove PNaCl's dependency on the gcc toolchain here. | 258 # TODO(pdox): Remove PNaCl's dependency on the gcc toolchain here. |
| 259 platform = NACL_CANONICAL_PLATFORM_MAP[env['PLATFORM']] | 259 platform = NACL_CANONICAL_PLATFORM_MAP[env['PLATFORM']] |
| 260 nnacl_root = os.path.join(env['MAIN_DIR'], 'toolchain', '%s_x86' % platform) | 260 nnacl_root = os.path.join(env['MAIN_DIR'], 'toolchain', '%s_x86' % platform) |
| 261 | 261 |
| 262 # NACL_SDK_LIB is prepended to LIBPATH in generate() | 262 # NACL_SDK_LIB is prepended to LIBPATH in generate() |
| 263 env.Prepend(LIBPATH=pnacl_lib) | 263 env.Prepend(LIBPATH=pnacl_lib) |
| 264 | 264 |
| 265 env.Replace(# Replace header and lib paths. | 265 env.Replace(# Replace header and lib paths. |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 # Dependency files it produces are to be found in ${LIBPATH}. | 492 # Dependency files it produces are to be found in ${LIBPATH}. |
| 493 # It is applied recursively to those dependencies in case | 493 # It is applied recursively to those dependencies in case |
| 494 # some of them are linker scripts too. | 494 # some of them are linker scripts too. |
| 495 ldscript_scanner = SCons.Scanner.Base( | 495 ldscript_scanner = SCons.Scanner.Base( |
| 496 function=ScanLinkerScript, | 496 function=ScanLinkerScript, |
| 497 skeys=['.a', '.so'], | 497 skeys=['.a', '.so'], |
| 498 path_function=SCons.Scanner.FindPathDirs('LIBPATH'), | 498 path_function=SCons.Scanner.FindPathDirs('LIBPATH'), |
| 499 recursive=True | 499 recursive=True |
| 500 ) | 500 ) |
| 501 env.Append(SCANNERS=ldscript_scanner) | 501 env.Append(SCANNERS=ldscript_scanner) |
| OLD | NEW |