OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file is meant to be included into an action to provide a rule that strips | 5 # This file is meant to be included into an action to provide a rule that |
6 # native libraries. | 6 # packs ARM relative relocations in native libraries. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'action_name': 'strip_native_libraries', | 10 # 'action_name': 'pack_arm_relocations', |
11 # 'actions': [ | 11 # 'actions': [ |
12 # 'variables': { | 12 # 'variables': { |
13 # 'enable_packing': 'pack relocations if true, otherwise plain file copy' | |
13 # 'ordered_libraries_file': 'file generated by write_ordered_libraries' | 14 # 'ordered_libraries_file': 'file generated by write_ordered_libraries' |
14 # 'input_paths': 'files to be added to the list of inputs' | 15 # 'input_paths': 'files to be added to the list of inputs' |
15 # 'stamp': 'file to touch when the action is complete' | 16 # 'stamp': 'file to touch when the action is complete' |
16 # 'stripped_libraries_dir': 'directory to store stripped libraries', | 17 # 'stripped_libraries_dir': 'directory holding stripped libraries', |
17 # }, | 18 # 'packed_libraries_dir': 'directory holding packed libraries', |
18 # 'includes': [ '../../build/android/strip_native_libraries.gypi' ], | 19 # 'includes': [ '../../build/android/pack_arm_relocations.gypi' ], |
19 # ], | 20 # ], |
20 # }, | 21 # }, |
21 # | 22 # |
22 | 23 |
23 { | 24 { |
24 'message': 'Stripping libraries for <(_target_name)', | |
25 'variables': { | 25 'variables': { |
26 'input_paths': [], | 26 'input_paths': [], |
27 }, | 27 }, |
28 'inputs': [ | 28 'inputs': [ |
29 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 29 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
30 '<(DEPTH)/build/android/gyp/strip_library_for_device.py', | 30 '<(DEPTH)/build/android/gyp/pack_arm_relocations.py', |
31 '<(PRODUCT_DIR)/relocation_packer', | |
31 '<(ordered_libraries_file)', | 32 '<(ordered_libraries_file)', |
32 '>@(input_paths)', | 33 '>@(input_paths)', |
33 ], | 34 ], |
34 'outputs': [ | 35 'outputs': [ |
35 '<(stamp)', | 36 '<(stamp)', |
36 ], | 37 ], |
37 'conditions': [ | 38 'conditions': [ |
39 ['enable_packing == 1', { | |
40 'message': 'Packing ARM relative relocations for <(_target_name)', | |
41 'dependencies': [ | |
42 '<(DEPTH)/tools/relocation_packer/relocation_packer.gyp:relocation_packe r#host', | |
43 ], | |
44 }, { | |
45 'message': 'Copying libraries (no packing) for <(_target_name)', | |
rmcilroy
2014/06/27 11:14:54
nit - (no relocation packing)
simonb (inactive)
2014/06/30 16:23:23
Done.
simonb (inactive)
2014/06/30 16:23:23
Done.
| |
46 }], | |
38 ['component == "shared_library"', { | 47 ['component == "shared_library"', { |
39 # Add a fake output to force the build to always re-run this step. This | 48 # Add a fake output to force the build to always re-run this step. This |
40 # is required because the real inputs are not known at gyp-time and | 49 # is required because the real inputs are not known at gyp-time and |
41 # changing base.so may not trigger changes to dependent libraries. | 50 # changing base.so may not trigger changes to dependent libraries. |
42 'outputs': [ '<(stamp).fake' ] | 51 'outputs': [ '<(stamp).fake' ] |
43 }], | 52 }], |
44 ], | 53 ], |
45 'action': [ | 54 'action': [ |
46 'python', '<(DEPTH)/build/android/gyp/strip_library_for_device.py', | 55 'python', '<(DEPTH)/build/android/gyp/pack_arm_relocations.py', |
47 '--android-strip=<(android_strip)', | 56 '--enable-packing=<(enable_packing)', |
48 '--android-strip-arg=--strip-unneeded', | 57 '--android-pack-relocations=<(PRODUCT_DIR)/relocation_packer', |
58 '--android-objcopy=<(android_objcopy)', | |
49 '--stripped-libraries-dir=<(stripped_libraries_dir)', | 59 '--stripped-libraries-dir=<(stripped_libraries_dir)', |
50 '--libraries-dir=<(SHARED_LIB_DIR)', | 60 '--packed-libraries-dir=<(packed_libraries_dir)', |
51 '--libraries-file=<(ordered_libraries_file)', | 61 '--libraries-file=<(ordered_libraries_file)', |
52 '--stamp=<(stamp)', | 62 '--stamp=<(stamp)', |
53 ], | 63 ], |
54 } | 64 } |
OLD | NEW |