| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """Recipes for PNaCl target libs.""" | 6 """Recipes for PNaCl target libs.""" |
| 7 | 7 |
| 8 import fnmatch | 8 import fnmatch |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 | 320 |
| 321 def TargetLibBuildType(is_canonical): | 321 def TargetLibBuildType(is_canonical): |
| 322 return 'build' if is_canonical else 'build_noncanonical' | 322 return 'build' if is_canonical else 'build_noncanonical' |
| 323 | 323 |
| 324 def TargetLibs(bias_arch, is_canonical): | 324 def TargetLibs(bias_arch, is_canonical): |
| 325 def T(component_name): | 325 def T(component_name): |
| 326 return GSDJoin(component_name, bias_arch) | 326 return GSDJoin(component_name, bias_arch) |
| 327 target_triple = TripleFromArch(bias_arch) | 327 target_triple = TripleFromArch(bias_arch) |
| 328 newlib_triple = target_triple if not IsBCArch(bias_arch) else 'le32-nacl' | 328 newlib_triple = target_triple if not IsBCArch(bias_arch) else 'le32-nacl' |
| 329 newlib_cpp_flags = ' -DPNACL_BITCODE' if IsBCArch(bias_arch) else '' |
| 329 clang_libdir = os.path.join( | 330 clang_libdir = os.path.join( |
| 330 '%(output)s', 'lib', 'clang', CLANG_VER, 'lib', target_triple) | 331 '%(output)s', 'lib', 'clang', CLANG_VER, 'lib', target_triple) |
| 331 libc_libdir = os.path.join('%(output)s', MultilibLibDir(bias_arch)) | 332 libc_libdir = os.path.join('%(output)s', MultilibLibDir(bias_arch)) |
| 332 libs = { | 333 libs = { |
| 333 T('newlib'): { | 334 T('newlib'): { |
| 334 'type': TargetLibBuildType(is_canonical), | 335 'type': TargetLibBuildType(is_canonical), |
| 335 'dependencies': [ 'newlib_src', 'target_lib_compiler'], | 336 'dependencies': [ 'newlib_src', 'target_lib_compiler'], |
| 336 'commands' : [ | 337 'commands' : [ |
| 337 command.SkipForIncrementalCommand( | 338 command.SkipForIncrementalCommand( |
| 338 ['sh', '%(newlib_src)s/configure'] + | 339 ['sh', '%(newlib_src)s/configure'] + |
| 339 TargetTools(bias_arch) + | 340 TargetTools(bias_arch) + |
| 340 ['CFLAGS_FOR_TARGET=' + TargetLibCflags(bias_arch), | 341 ['CFLAGS_FOR_TARGET=' + |
| 342 TargetLibCflags(bias_arch) + |
| 343 newlib_cpp_flags, |
| 341 '--prefix=', | 344 '--prefix=', |
| 342 '--disable-newlib-supplied-syscalls', | 345 '--disable-newlib-supplied-syscalls', |
| 343 '--disable-texinfo', | 346 '--disable-texinfo', |
| 344 '--disable-libgloss', | 347 '--disable-libgloss', |
| 345 '--enable-newlib-iconv', | 348 '--enable-newlib-iconv', |
| 346 '--enable-newlib-iconv-from-encodings=' + | 349 '--enable-newlib-iconv-from-encodings=' + |
| 347 'UTF-8,UTF-16LE,UCS-4LE,UTF-16,UCS-4', | 350 'UTF-8,UTF-16LE,UCS-4LE,UTF-16,UCS-4', |
| 348 '--enable-newlib-iconv-to-encodings=' + | 351 '--enable-newlib-iconv-to-encodings=' + |
| 349 'UTF-8,UTF-16LE,UCS-4LE,UTF-16,UCS-4', | 352 'UTF-8,UTF-16LE,UCS-4LE,UTF-16,UCS-4', |
| 350 '--enable-newlib-io-long-long', | 353 '--enable-newlib-io-long-long', |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 'includedir=' +os.path.join('%(output)s', | 777 'includedir=' +os.path.join('%(output)s', |
| 775 TripleFromArch(MultilibArch(arch)), | 778 TripleFromArch(MultilibArch(arch)), |
| 776 'include'), | 779 'include'), |
| 777 'libdir=' + os.path.join('%(output)s', MultilibLibDir(arch)), | 780 'libdir=' + os.path.join('%(output)s', MultilibLibDir(arch)), |
| 778 'install'] + scons_flags, | 781 'install'] + scons_flags, |
| 779 cwd=NACL_DIR), | 782 cwd=NACL_DIR), |
| 780 ], | 783 ], |
| 781 } | 784 } |
| 782 } | 785 } |
| 783 return libs | 786 return libs |
| OLD | NEW |