| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 CC=GetEnvOrDummy('CC'), | 270 CC=GetEnvOrDummy('CC'), |
| 271 CXX=GetEnvOrDummy('CXX'), | 271 CXX=GetEnvOrDummy('CXX'), |
| 272 AR=GetEnvOrDummy('AR'), | 272 AR=GetEnvOrDummy('AR'), |
| 273 # NOTE: use g++ for linking so we can handle c AND c++ | 273 # NOTE: use g++ for linking so we can handle c AND c++ |
| 274 LINK=GetEnvOrDummy('LINK'), | 274 LINK=GetEnvOrDummy('LINK'), |
| 275 RANLIB=GetEnvOrDummy('RANLIB'), | 275 RANLIB=GetEnvOrDummy('RANLIB'), |
| 276 ) | 276 ) |
| 277 | 277 |
| 278 def PNaClForceNative(env): | 278 def PNaClForceNative(env): |
| 279 assert(env.Bit('bitcode')) | 279 assert(env.Bit('bitcode')) |
| 280 env.Replace(OBJSUFFIX='.o') | 280 env.Replace(OBJSUFFIX='.o', |
| 281 env.Replace(SHLIBSUFFIX='.so') | 281 SHLIBSUFFIX='.so') |
| 282 env.Append(CCFLAGS=['-arch', '${TARGET_FULLARCH}', | 282 env.Append(ASFLAGS=['-arch', '${TARGET_FULLARCH}'], |
| 283 '--pnacl-allow-translate']) | 283 CCFLAGS=['-arch', '${TARGET_FULLARCH}', '--pnacl-allow-translate'], |
| 284 env.Append(LINKFLAGS=['--pnacl-allow-native']) | 284 LINKFLAGS=['--pnacl-allow-native']) |
| 285 | 285 |
| 286 # Get an environment for nacl-gcc when in PNaCl mode. | 286 # Get an environment for nacl-gcc when in PNaCl mode. |
| 287 def PNaClGetNNaClEnv(env): | 287 def PNaClGetNNaClEnv(env): |
| 288 assert(env.Bit('bitcode')) | 288 assert(env.Bit('bitcode')) |
| 289 assert(not env.Bit('target_arm')) | 289 assert(not env.Bit('target_arm')) |
| 290 | 290 |
| 291 # This is kind of a hack. We clone the environment, | 291 # This is kind of a hack. We clone the environment, |
| 292 # clear the bitcode bit, and then reload naclsdk.py | 292 # clear the bitcode bit, and then reload naclsdk.py |
| 293 native_env = env.Clone() | 293 native_env = env.Clone() |
| 294 native_env.ClearBits('bitcode') | 294 native_env.ClearBits('bitcode') |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 # if bitcode=1 use pnacl toolchain | 398 # if bitcode=1 use pnacl toolchain |
| 399 if env.Bit('bitcode'): | 399 if env.Bit('bitcode'): |
| 400 _SetEnvForPnacl(env, root) | 400 _SetEnvForPnacl(env, root) |
| 401 elif env.Bit('target_x86'): | 401 elif env.Bit('target_x86'): |
| 402 _SetEnvForX86Sdk(env, root) | 402 _SetEnvForX86Sdk(env, root) |
| 403 else: | 403 else: |
| 404 print "ERROR: unknown TARGET_ARCHITECTURE: ", env['TARGET_ARCHITECTURE'] | 404 print "ERROR: unknown TARGET_ARCHITECTURE: ", env['TARGET_ARCHITECTURE'] |
| 405 assert 0 | 405 assert 0 |
| 406 | 406 |
| 407 env.Prepend(LIBPATH='${NACL_SDK_LIB}') | 407 env.Prepend(LIBPATH='${NACL_SDK_LIB}') |
| OLD | NEW |