OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium 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 import os | 8 import os |
9 | 9 |
10 # Support files for pnacl browser tests (as an unpacked chrome extension). | 10 # Support files for pnacl browser tests (as an unpacked chrome extension). |
11 if not env.Bit('bitcode'): | 11 if not env.Bit('bitcode'): |
12 Return() | 12 Return() |
13 | 13 |
14 # Override the IRT shim with the latest one built in scons-out. | 14 # Override the IRT shim with the latest one built in scons-out. |
15 # Otherwise, there may be a mismatch between the latest pepper headers | 15 # It is the version that matches the current version of PPAPI. |
16 # and the IRT shim that we built in the toolchain tarball. | |
17 # | 16 # |
18 # We pick exactly that file for now, because the other files in | 17 # We pick exactly that file for now, because the other files in |
19 # ${LIB_DIR} are bitcode and we don't want to pollute the CRX with those. | 18 # ${LIB_DIR} are bitcode and we don't want to pollute the CRX with those. |
20 arch = env['TARGET_FULLARCH'] | 19 arch = env['TARGET_FULLARCH'] |
21 lib_override = '' | 20 lib_override = ('--lib_override=%s,${LIB_DIR}/libpnacl_irt_shim.a ' % arch) |
22 lib_dep = [] | 21 lib_dep = [env.File('${LIB_DIR}/libpnacl_irt_shim.a')] |
23 if arch == 'x86-64': | |
24 lib_override = ('--lib_override=%s,${LIB_DIR}/libpnacl_irt_shim.a ' % arch) | |
25 lib_dep = [env.File('${LIB_DIR}/libpnacl_irt_shim.a')] | |
26 | 22 |
27 output_dir = env.GetPnaclExtensionRootNode().abspath | 23 output_dir = env.GetPnaclExtensionRootNode().abspath |
28 | 24 |
29 generated_crx = env.Command( | 25 generated_crx = env.Command( |
30 # Output (a directory with a bunch of files, like manifest.json) | 26 # Output (a directory with a bunch of files, like manifest.json) |
31 env.GetPnaclExtensionNode(), | 27 env.GetPnaclExtensionNode(), |
32 # Inputs -- just the command and any scons files. We don't model | 28 # Inputs -- just the command and any scons files. We don't model |
33 # deps to files in the toolchain dir, since that doesn't seem to work. | 29 # deps to files in the toolchain dir, since that doesn't seem to work. |
34 ['${SOURCE_ROOT}/native_client/pnacl/' + | 30 ['${SOURCE_ROOT}/native_client/pnacl/' + |
35 'pnacl_packaging/pnacl_component_crx_gen.py'] + lib_dep, | 31 'pnacl_packaging/pnacl_component_crx_gen.py'] + lib_dep, |
36 # Command. | 32 # Command. |
37 ('${PYTHON} ${SOURCES[0]} ' + | 33 ('${PYTHON} ${SOURCES[0]} ' + |
38 '--dest=' + output_dir + ' ' + | 34 '--dest=' + output_dir + ' ' + |
39 # Override the libraries from the tarball with those in scons-out/x/lib | 35 # Override the libraries from the tarball with those in scons-out/x/lib |
40 lib_override + | 36 lib_override + |
41 # Build only the unpacked extension, not zipped up files, etc. | 37 # Build only the unpacked extension, not zipped up files, etc. |
42 '-u ' + | 38 '-u ' + |
43 env.GetPnaclExtensionDummyVersion())) | 39 env.GetPnaclExtensionDummyVersion())) |
44 | 40 |
45 # NOTE: Toolchain directory dependencies don't seem to work in SCons, so we | 41 # NOTE: Toolchain directory dependencies don't seem to work in SCons, so we |
46 # end up setting this to 'AlwaysBuild'. | 42 # end up setting this to 'AlwaysBuild'. |
47 env.AlwaysBuild(generated_crx) | 43 env.AlwaysBuild(generated_crx) |
48 | 44 |
49 env.Alias('pnacl_support_extension', generated_crx) | 45 env.Alias('pnacl_support_extension', generated_crx) |
OLD | NEW |