| OLD | NEW |
| 1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
| 2 # Copyright 2009, Google Inc. | 2 # Copyright 2009, Google Inc. |
| 3 # All rights reserved. | 3 # All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 # where to find/put nacl generic extra sdk libraries | 164 # where to find/put nacl generic extra sdk libraries |
| 165 NACL_SDK_LIB='%s/%s/%s' % (sdk_path, arch, libsuffix), | 165 NACL_SDK_LIB='%s/%s/%s' % (sdk_path, arch, libsuffix), |
| 166 # Replace the normal unix tools with the NaCl ones. | 166 # Replace the normal unix tools with the NaCl ones. |
| 167 CC=os.path.join(bin_path, '%s-gcc' % arch), | 167 CC=os.path.join(bin_path, '%s-gcc' % arch), |
| 168 CXX=os.path.join(bin_path, '%s-g++' % arch), | 168 CXX=os.path.join(bin_path, '%s-g++' % arch), |
| 169 AR=os.path.join(bin_path, '%s-ar' % arch), | 169 AR=os.path.join(bin_path, '%s-ar' % arch), |
| 170 AS=os.path.join(bin_path, '%s-as' % arch), | 170 AS=os.path.join(bin_path, '%s-as' % arch), |
| 171 GDB=os.path.join(bin_path, 'nacl-gdb'), | 171 GDB=os.path.join(bin_path, 'nacl-gdb'), |
| 172 # NOTE: use g++ for linking so we can handle C AND C++. | 172 # NOTE: use g++ for linking so we can handle C AND C++. |
| 173 LINK=os.path.join(bin_path, '%s-g++' % arch), | 173 LINK=os.path.join(bin_path, '%s-g++' % arch), |
| 174 # Grrr... and sometimes we really need ld. |
| 175 LD=os.path.join(bin_path, '%s-ld' % arch), |
| 174 RANLIB=os.path.join(bin_path, '%s-ranlib' % arch), | 176 RANLIB=os.path.join(bin_path, '%s-ranlib' % arch), |
| 175 CFLAGS = ['-std=gnu99'], | 177 CFLAGS = ['-std=gnu99'], |
| 176 CCFLAGS=['-O3', | 178 CCFLAGS=['-O3', |
| 177 '-Werror', | 179 '-Werror', |
| 178 '-Wall', | 180 '-Wall', |
| 179 '-Wswitch-enum', | 181 '-Wswitch-enum', |
| 180 '-g', | 182 '-g', |
| 181 '-fno-builtin', | 183 '-fno-builtin', |
| 182 '-fno-stack-protector', | 184 '-fno-stack-protector', |
| 183 '-fdiagnostics-show-option', | 185 '-fdiagnostics-show-option', |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 # Replace the normal unix tools with the PNaCl ones. | 224 # Replace the normal unix tools with the PNaCl ones. |
| 223 CC=pnacl_sdk_cc + pnacl_sdk_cc_flags, | 225 CC=pnacl_sdk_cc + pnacl_sdk_cc_flags, |
| 224 CXX=pnacl_sdk_cxx + pnacl_sdk_cxx_flags, | 226 CXX=pnacl_sdk_cxx + pnacl_sdk_cxx_flags, |
| 225 | 227 |
| 226 # NOTE: only in bitcode compilation scenarios where | 228 # NOTE: only in bitcode compilation scenarios where |
| 227 # CC compiles to bitcode and | 229 # CC compiles to bitcode and |
| 228 # CC_NATIVE compiles to native code | 230 # CC_NATIVE compiles to native code |
| 229 # (CC_NATIVE had to handle both .c and .S files) | 231 # (CC_NATIVE had to handle both .c and .S files) |
| 230 CC_NATIVE=pnacl_sdk_cc + pnacl_sdk_cc_native_flags, | 232 CC_NATIVE=pnacl_sdk_cc + pnacl_sdk_cc_native_flags, |
| 231 LINK=pnacl_sdk_ld + pnacl_sdk_ld_flags, | 233 LINK=pnacl_sdk_ld + pnacl_sdk_ld_flags, |
| 234 # Grrr... and sometimes we need raw assembly and the real ld. |
| 235 LD=(pnacl_sdk_root + '/arm-none-linux-gnueabi/bin/' + |
| 236 'arm-none-linux-gnueabi-ld'), |
| 232 AR=pnacl_sdk_ar, | 237 AR=pnacl_sdk_ar, |
| 233 RANLIB=pnacl_sdk_ranlib, | 238 RANLIB=pnacl_sdk_ranlib, |
| 234 DISASS=pnacl_sdk_disass, | 239 DISASS=pnacl_sdk_disass, |
| 235 ) | 240 ) |
| 236 | 241 |
| 237 | 242 |
| 238 def _SetEnvForSdkManually(env): | 243 def _SetEnvForSdkManually(env): |
| 239 def GetEnvOrDummy(v): | 244 def GetEnvOrDummy(v): |
| 240 return os.getenv('NACL_SDK_' + v, 'MISSING_SDK_' + v) | 245 return os.getenv('NACL_SDK_' + v, 'MISSING_SDK_' + v) |
| 241 | 246 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 # if bitcode=1 use pnacl toolchain | 339 # if bitcode=1 use pnacl toolchain |
| 335 if SCons.Script.ARGUMENTS.get('bitcode'): | 340 if SCons.Script.ARGUMENTS.get('bitcode'): |
| 336 _SetEnvForPnacl(env, env['TARGET_FULLARCH']) | 341 _SetEnvForPnacl(env, env['TARGET_FULLARCH']) |
| 337 elif env['TARGET_ARCHITECTURE'] == 'x86': | 342 elif env['TARGET_ARCHITECTURE'] == 'x86': |
| 338 _SetEnvForX86Sdk(env, root) | 343 _SetEnvForX86Sdk(env, root) |
| 339 else: | 344 else: |
| 340 print "ERROR: unknown TARGET_ARCHITECTURE: ", env['TARGET_ARCHITECTURE'] | 345 print "ERROR: unknown TARGET_ARCHITECTURE: ", env['TARGET_ARCHITECTURE'] |
| 341 assert 0 | 346 assert 0 |
| 342 | 347 |
| 343 env.Prepend(LIBPATH='${NACL_SDK_LIB}') | 348 env.Prepend(LIBPATH='${NACL_SDK_LIB}') |
| OLD | NEW |