OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Pack ARM relative relocations in a library (or copy unchanged). | 7 """Pack ARM relative relocations in a library (or copy unchanged). |
8 | 8 |
9 If --enable-packing and --configuration-name=='Release', invoke the | 9 If --enable-packing and --configuration-name=='Release', invoke the |
10 relocation_packer tool to pack the .rel.dyn or .rela.dyn section in the given | 10 relocation_packer tool to pack the .rel.dyn or .rela.dyn section in the given |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 default='', | 82 default='', |
83 help='Names of any libraries explicitly not packed') | 83 help='Names of any libraries explicitly not packed') |
84 parser.add_option('--android-pack-relocations', | 84 parser.add_option('--android-pack-relocations', |
85 help='Path to the ARM relocations packer binary') | 85 help='Path to the ARM relocations packer binary') |
86 parser.add_option('--android-objcopy', | 86 parser.add_option('--android-objcopy', |
87 help='Path to the toolchain\'s objcopy binary') | 87 help='Path to the toolchain\'s objcopy binary') |
88 parser.add_option('--stripped-libraries-dir', | 88 parser.add_option('--stripped-libraries-dir', |
89 help='Directory for stripped libraries') | 89 help='Directory for stripped libraries') |
90 parser.add_option('--packed-libraries-dir', | 90 parser.add_option('--packed-libraries-dir', |
91 help='Directory for packed libraries') | 91 help='Directory for packed libraries') |
92 parser.add_option('--libraries', | 92 parser.add_option('--libraries', action='append', |
93 help='List of libraries') | 93 help='List of libraries') |
94 parser.add_option('--stamp', help='Path to touch on success') | 94 parser.add_option('--stamp', help='Path to touch on success') |
95 | 95 |
96 options, _ = parser.parse_args(args) | 96 options, _ = parser.parse_args(args) |
97 enable_packing = (options.enable_packing == '1' and | 97 enable_packing = (options.enable_packing == '1' and |
98 options.configuration_name == 'Release') | 98 options.configuration_name == 'Release') |
99 has_relocations_with_addends = (options.has_relocations_with_addends == '1') | 99 has_relocations_with_addends = (options.has_relocations_with_addends == '1') |
100 exclude_packing_set = set(shlex.split(options.exclude_packing_list)) | 100 exclude_packing_set = set(shlex.split(options.exclude_packing_list)) |
101 | 101 |
102 libraries = build_utils.ParseGypList(options.libraries) | 102 libraries = [] |
| 103 for libs_arg in options.libraries: |
| 104 libraries += build_utils.ParseGypList(libs_arg) |
103 | 105 |
104 if options.clear_dir: | 106 if options.clear_dir: |
105 build_utils.DeleteDirectory(options.packed_libraries_dir) | 107 build_utils.DeleteDirectory(options.packed_libraries_dir) |
106 | 108 |
107 build_utils.MakeDirectory(options.packed_libraries_dir) | 109 build_utils.MakeDirectory(options.packed_libraries_dir) |
108 | 110 |
109 for library in libraries: | 111 for library in libraries: |
110 library_path = os.path.join(options.stripped_libraries_dir, library) | 112 library_path = os.path.join(options.stripped_libraries_dir, library) |
111 output_path = os.path.join( | 113 output_path = os.path.join( |
112 options.packed_libraries_dir, os.path.basename(library)) | 114 options.packed_libraries_dir, os.path.basename(library)) |
(...skipping 13 matching lines...) Expand all Loading... |
126 libraries + build_utils.GetPythonDependencies()) | 128 libraries + build_utils.GetPythonDependencies()) |
127 | 129 |
128 if options.stamp: | 130 if options.stamp: |
129 build_utils.Touch(options.stamp) | 131 build_utils.Touch(options.stamp) |
130 | 132 |
131 return 0 | 133 return 0 |
132 | 134 |
133 | 135 |
134 if __name__ == '__main__': | 136 if __name__ == '__main__': |
135 sys.exit(main(sys.argv[1:])) | 137 sys.exit(main(sys.argv[1:])) |
OLD | NEW |