| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 CC=GetEnvOrDummy('CC'), | 287 CC=GetEnvOrDummy('CC'), |
| 288 CXX=GetEnvOrDummy('CXX'), | 288 CXX=GetEnvOrDummy('CXX'), |
| 289 AR=GetEnvOrDummy('AR'), | 289 AR=GetEnvOrDummy('AR'), |
| 290 # NOTE: use g++ for linking so we can handle c AND c++ | 290 # NOTE: use g++ for linking so we can handle c AND c++ |
| 291 LINK=GetEnvOrDummy('LINK'), | 291 LINK=GetEnvOrDummy('LINK'), |
| 292 RANLIB=GetEnvOrDummy('RANLIB'), | 292 RANLIB=GetEnvOrDummy('RANLIB'), |
| 293 ) | 293 ) |
| 294 | 294 |
| 295 def PNaClForceNative(env): | 295 def PNaClForceNative(env): |
| 296 assert(env.Bit('bitcode')) | 296 assert(env.Bit('bitcode')) |
| 297 env.Replace(OBJSUFFIX='.o') | 297 env.Replace(OBJSUFFIX='.o', |
| 298 env.Replace(SHLIBSUFFIX='.so') | 298 SHLIBSUFFIX='.so') |
| 299 env.Append(CCFLAGS=['-arch', '${TARGET_FULLARCH}', | 299 env.Append(ASFLAGS=['-arch', '${TARGET_FULLARCH}'], |
| 300 '--pnacl-allow-translate']) | 300 CCFLAGS=['-arch', '${TARGET_FULLARCH}', '--pnacl-allow-translate'], |
| 301 env.Append(LINKFLAGS=['--pnacl-allow-native']) | 301 LINKFLAGS=['--pnacl-allow-native']) |
| 302 env['SHLINK'] = '${LINK}' | 302 env['SHLINK'] = '${LINK}' |
| 303 | 303 |
| 304 # Get an environment for nacl-gcc when in PNaCl mode. | 304 # Get an environment for nacl-gcc when in PNaCl mode. |
| 305 def PNaClGetNNaClEnv(env): | 305 def PNaClGetNNaClEnv(env): |
| 306 assert(env.Bit('bitcode')) | 306 assert(env.Bit('bitcode')) |
| 307 assert(not env.Bit('target_arm')) | 307 assert(not env.Bit('target_arm')) |
| 308 | 308 |
| 309 # This is kind of a hack. We clone the environment, | 309 # This is kind of a hack. We clone the environment, |
| 310 # clear the bitcode bit, and then reload naclsdk.py | 310 # clear the bitcode bit, and then reload naclsdk.py |
| 311 native_env = env.Clone() | 311 native_env = env.Clone() |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 # if bitcode=1 use pnacl toolchain | 416 # if bitcode=1 use pnacl toolchain |
| 417 if env.Bit('bitcode'): | 417 if env.Bit('bitcode'): |
| 418 _SetEnvForPnacl(env, root) | 418 _SetEnvForPnacl(env, root) |
| 419 elif env.Bit('target_x86'): | 419 elif env.Bit('target_x86'): |
| 420 _SetEnvForX86Sdk(env, root) | 420 _SetEnvForX86Sdk(env, root) |
| 421 else: | 421 else: |
| 422 print "ERROR: unknown TARGET_ARCHITECTURE: ", env['TARGET_ARCHITECTURE'] | 422 print "ERROR: unknown TARGET_ARCHITECTURE: ", env['TARGET_ARCHITECTURE'] |
| 423 assert 0 | 423 assert 0 |
| 424 | 424 |
| 425 env.Prepend(LIBPATH='${NACL_SDK_LIB}') | 425 env.Prepend(LIBPATH='${NACL_SDK_LIB}') |
| OLD | NEW |