blob: d6bef6de4333627faa4916974798b57096c4de4e [file] [log] [blame]
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +00001# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# This action takes an archive (.a) file and unpacks it unto object (.o) files.
6# The following input gyp variables are required:
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +00007# unpack_lib_output_dir, the output directory of extracted object file
8# unpack_lib_name, the object file to be extracted.
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +00009# unpack_lib_search_path_list, a list of paths to search for the library.
10# it must be ['-a', 'path_name1', '-a', 'path_name2'...]
11#
12# For example:
13# 'variables': {
14# 'unpack_lib_search_path_list': [
15# '-a', '/a/lib.a',
16# '-a', 'b/lib.a',
17# ],
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +000018# 'unpack_lib_output_dir':'ouput',
19# 'unpack_lib_name':'offsets.o'
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +000020# },
21# 'includes': ['unpack_lib_posix.gypi'],
22#
23# It unpacks the first existing library in 'unpack_lib_search_path_list', and
24# extracts 'offsets.o' to 'output' directory.
25
26{
27 'actions': [
28 {
michaelbai@chromium.org673ec242014-03-04 18:39:48 +000029 'variables' : {
michaelbai@chromium.org4c6c1412014-03-08 05:24:25 +000030 'ar_cmd': [],
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +000031 'conditions': [
michaelbai@chromium.org673ec242014-03-04 18:39:48 +000032 ['android_webview_build==1', {
michaelbai@chromium.org1bb0ad02014-05-16 21:08:48 +000033 'ar_cmd': ['-r', '$(abspath $($(gyp_var_prefix)TARGET_AR))'],
michaelbai@chromium.org673ec242014-03-04 18:39:48 +000034 }],
35 ],
36 },
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +000037 'action_name': 'unpack_lib_posix',
38 'inputs': [
fgalligan@chromium.org2f414b42014-05-24 17:26:04 +000039 'unpack_lib_posix.sh',
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +000040 ],
41 'outputs': [
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +000042 '<(unpack_lib_output_dir)/<(unpack_lib_name)',
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +000043 ],
44 'action': [
45 '<(DEPTH)/third_party/libvpx/unpack_lib_posix.sh',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +000046 '-d', '<(unpack_lib_output_dir)',
47 '-f', '<(unpack_lib_name)',
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +000048 '<@(unpack_lib_search_path_list)',
michaelbai@chromium.org4c9d43b2014-03-09 06:42:07 +000049 '<@(ar_cmd)',
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +000050 ],
tomfinegan@google.com962354e2014-08-13 18:34:31 +000051 'process_outputs_as_sources': 1,
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +000052 },
53 ],
54}