OLD | NEW |
---|---|
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright 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. | 15 env.ClearBits('pnacl_generate_pexe') |
jvoung (off chromium)
2012/08/27 21:57:39
Leave the comment about clearing the bit pnacl_gen
Robert Muth (chromium)
2012/08/27 22:38:18
Done.
| |
16 # Clear out the pnacl_generate_pexe bit to allow building this as a | |
17 # library dependency (much like the IRT). | |
18 nacl_gcc_env = env.Clone() | |
19 nacl_gcc_env.ClearBits('pnacl_generate_pexe') | |
20 nacl_gcc_env = nacl_gcc_env.PNaClGetNNaClEnv() | |
21 | 16 |
22 # Generate a 'pnacl_shim.c' | 17 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', | 18 'shim_entry.c', |
38 'shim_ppapi.c', | |
39 ]) | 19 ]) |
40 | 20 |
41 # However, the library is part of the pnacl sdk (use original env). | 21 # However, the library is part of the pnacl sdk (use original env). |
jvoung (off chromium)
2012/08/27 21:57:39
This "however" was referring to swapping of toolch
Robert Muth (chromium)
2012/08/27 22:38:18
Done.
| |
42 env.AddLibraryToSdk(pnacl_irt_shim) | 22 env.AddLibraryToSdk(pnacl_irt_shim) |
43 | 23 |
44 env.AddObjectToSdk(['libpnacl_irt_shim.a']) | 24 env.AddObjectToSdk(['libpnacl_irt_shim.a']) |
OLD | NEW |