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