| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- 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 Import('env') | 6 Import('env') |
| 7 import os | 7 import os |
| 8 | 8 |
| 9 # This library is part of the pnacl x86-64 toolchain only, and is used | 9 # This library is part of the pnacl x86-64 toolchain only, and is used |
| 10 # to match the pnacl ABI to the IRT ABI. It was necessitated by problems | 10 # to match the pnacl ABI to the IRT ABI. It was necessitated by problems |
| 11 # in passing structures by value on x86-64. | 11 # in passing structures by value on x86-64. |
| 12 if not env.Bit('bitcode') or not env.Bit('target_x86_64'): | 12 if not env.Bit('bitcode') or not env.Bit('target_x86_64'): |
| 13 Return() | 13 Return() |
| 14 | 14 |
| 15 # The library must be compiled with nacl-gcc. | |
| 16 # Clear out the pnacl_generate_pexe bit to allow building this as a | 15 # Clear out the pnacl_generate_pexe bit to allow building this as a |
| 17 # library dependency (much like the IRT). | 16 # library dependency (much like the IRT). |
| 18 nacl_gcc_env = env.Clone() | 17 env.ClearBits('pnacl_generate_pexe') |
| 19 nacl_gcc_env.ClearBits('pnacl_generate_pexe') | |
| 20 nacl_gcc_env = nacl_gcc_env.PNaClGetNNaClEnv() | |
| 21 | 18 |
| 22 # Generate a 'pnacl_shim.c' | 19 pnacl_irt_shim = env.ComponentLibrary('pnacl_irt_shim', [ |
| 23 api_glob = env.Glob('${SOURCE_ROOT}/ppapi/api/*.idl') | |
| 24 api_dev_glob = env.Glob('${SOURCE_ROOT}/ppapi/api/dev/*.idl') | |
| 25 generators_glob = env.Glob('${SOURCE_ROOT}/ppapi/generators/*.py') | |
| 26 generated_file_c = nacl_gcc_env.Command( | |
| 27 'pnacl_shim.c', | |
| 28 (api_glob + api_dev_glob + generators_glob), | |
| 29 ('${PYTHON} ' + | |
| 30 '${SOURCE_ROOT}/ppapi/generators/generator.py ' + | |
| 31 '--srcroot=' + os.path.join('${SOURCE_ROOT}', 'ppapi', 'api') + ' ' + | |
| 32 '--wnone --pnacl --pnaclshim=${TARGETS} ' + | |
| 33 ' '.join([idl_file.abspath for idl_file in api_glob + api_dev_glob]))) | |
| 34 | |
| 35 pnacl_irt_shim = nacl_gcc_env.ComponentLibrary('pnacl_irt_shim', [ | |
| 36 generated_file_c, | |
| 37 'shim_entry.c', | 20 'shim_entry.c', |
| 38 'shim_ppapi.c', | |
| 39 ]) | 21 ]) |
| 40 | 22 |
| 41 # However, the library is part of the pnacl sdk (use original env). | 23 # The library is part of the pnacl toolchain |
| 42 env.AddLibraryToSdk(pnacl_irt_shim) | 24 env.AddLibraryToSdk(pnacl_irt_shim) |
| 43 | 25 |
| 44 env.AddObjectToSdk(['libpnacl_irt_shim.a']) | 26 env.AddObjectToSdk(['libpnacl_irt_shim.a']) |
| OLD | NEW |