| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 pnacl_translate = binprefix + 'translate' + binext | 286 pnacl_translate = binprefix + 'translate' + binext |
| 287 | 287 |
| 288 pnacl_cc = binprefix + 'clang' + binext | 288 pnacl_cc = binprefix + 'clang' + binext |
| 289 pnacl_cxx = binprefix + 'clang++' + binext | 289 pnacl_cxx = binprefix + 'clang++' + binext |
| 290 | 290 |
| 291 pnacl_ld = binprefix + 'ld' + binext | 291 pnacl_ld = binprefix + 'ld' + binext |
| 292 pnacl_nativeld = binprefix + 'nativeld' + binext | 292 pnacl_nativeld = binprefix + 'nativeld' + binext |
| 293 pnacl_disass = binprefix + 'dis' + binext | 293 pnacl_disass = binprefix + 'dis' + binext |
| 294 pnacl_finalize = binprefix + 'finalize' + binext | 294 pnacl_finalize = binprefix + 'finalize' + binext |
| 295 pnacl_strip = binprefix + 'strip' + binext | 295 pnacl_strip = binprefix + 'strip' + binext |
| 296 pnacl_nmf = binprefix + 'nmf' + binext | |
| 297 pnacl_link_and_translate = os.path.join(subroot, | 296 pnacl_link_and_translate = os.path.join(subroot, |
| 298 'bin', | 297 'bin', |
| 299 'wrapper-link-and-translate') + binext | 298 'wrapper-link-and-translate') + binext |
| 300 | 299 |
| 301 # NOTE: XXX_flags start with space for easy concatenation | 300 # NOTE: XXX_flags start with space for easy concatenation |
| 302 # The flags generated here get baked into the commands (CC, CXX, LINK) | 301 # The flags generated here get baked into the commands (CC, CXX, LINK) |
| 303 # instead of CFLAGS etc to keep them from getting blown away by some | 302 # instead of CFLAGS etc to keep them from getting blown away by some |
| 304 # tests. Don't add flags here unless they always need to be preserved. | 303 # tests. Don't add flags here unless they always need to be preserved. |
| 305 pnacl_cxx_flags = '' | 304 pnacl_cxx_flags = '' |
| 306 pnacl_cc_flags = ' -std=gnu99' | 305 pnacl_cc_flags = ' -std=gnu99' |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 # with shared libraries except use them with the toolchain. | 343 # with shared libraries except use them with the toolchain. |
| 345 SHLINK=pnacl_cxx + ld_arch_flag + pnacl_ld_flags, | 344 SHLINK=pnacl_cxx + ld_arch_flag + pnacl_ld_flags, |
| 346 LD=pnacl_ld, | 345 LD=pnacl_ld, |
| 347 NATIVELD=pnacl_nativeld, | 346 NATIVELD=pnacl_nativeld, |
| 348 AR=pnacl_ar, | 347 AR=pnacl_ar, |
| 349 AS=pnacl_as + ld_arch_flag, | 348 AS=pnacl_as + ld_arch_flag, |
| 350 RANLIB=pnacl_ranlib, | 349 RANLIB=pnacl_ranlib, |
| 351 DISASS=pnacl_disass, | 350 DISASS=pnacl_disass, |
| 352 OBJDUMP=pnacl_disass, | 351 OBJDUMP=pnacl_disass, |
| 353 STRIP=pnacl_strip, | 352 STRIP=pnacl_strip, |
| 354 GENNMF=pnacl_nmf, | |
| 355 TRANSLATE=pnacl_translate + arch_flag + pnacl_translate_flags, | 353 TRANSLATE=pnacl_translate + arch_flag + pnacl_translate_flags, |
| 356 PNACLFINALIZE=pnacl_finalize, | 354 PNACLFINALIZE=pnacl_finalize, |
| 357 ) | 355 ) |
| 358 | 356 |
| 359 if env.Bit('pnacl_shared_newlib'): | 357 if env.Bit('pnacl_shared_newlib'): |
| 360 def shlibemitter(target, source, env): | 358 def shlibemitter(target, source, env): |
| 361 """when building a .so also notify scons that we care about | 359 """when building a .so also notify scons that we care about |
| 362 the .pso which gets generated as a side-effect and which should | 360 the .pso which gets generated as a side-effect and which should |
| 363 also be installed. | 361 also be installed. |
| 364 This is a not very well documented scons API. | 362 This is a not very well documented scons API. |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 # Dependency files it produces are to be found in ${LIBPATH}. | 807 # Dependency files it produces are to be found in ${LIBPATH}. |
| 810 # It is applied recursively to those dependencies in case | 808 # It is applied recursively to those dependencies in case |
| 811 # some of them are linker scripts too. | 809 # some of them are linker scripts too. |
| 812 ldscript_scanner = SCons.Scanner.Base( | 810 ldscript_scanner = SCons.Scanner.Base( |
| 813 function=ScanLinkerScript, | 811 function=ScanLinkerScript, |
| 814 skeys=['.a', '.so', '.pso'], | 812 skeys=['.a', '.so', '.pso'], |
| 815 path_function=SCons.Scanner.FindPathDirs('LIBPATH'), | 813 path_function=SCons.Scanner.FindPathDirs('LIBPATH'), |
| 816 recursive=True | 814 recursive=True |
| 817 ) | 815 ) |
| 818 env.Append(SCANNERS=ldscript_scanner) | 816 env.Append(SCANNERS=ldscript_scanner) |
| OLD | NEW |