1 # Copyright (c) 2013 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.
7 '../native_client/build/untrusted.gypi',
10 # We need to override the variables in untrusted.gypi outside of a
11 # target_condition block because the target_condition block in
12 # untrusted gypi is fully evaluated and interpolated before any of the
13 # target_condition blocks in this file are expanded. This means that any
14 # variables overriden inside a target_condition block in this file will not
15 # affect the values in untrusted.gypi.
19 'nacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/newlib',
20 'nacl_glibc_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/glibc',
21 'nacl_pnacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/pnacl',
22 'nacl_pnacl_newlib_nonsfi_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/nonsfi',
23 'target_conditions': [
25 # These variables are used for nexe building and for library building.
26 'out_newlib32%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_32.nexe',
27 'out_newlib64%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_64.nexe',
28 'out_newlib_arm%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_arm.nexe',
29 'out_newlib_mips%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_mips32.nexe',
30 'nmf_newlib%': '>(nacl_newlib_out_dir)/>(nexe_target).nmf',
31 'out_glibc32%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_32.nexe',
32 'out_glibc64%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_64.nexe',
33 'out_glibc_arm%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_arm.nexe',
34 'nmf_glibc%': '>(nacl_glibc_out_dir)/>(nexe_target).nmf',
35 'out_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target)_newlib_pnacl.pexe',
36 'nmf_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target).nmf',
37 'out_pnacl_newlib_x86_32_nonsfi_nexe': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target)_pnacl_newlib_x32_nonsfi.nexe',
42 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
43 '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
44 '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
46 'target_conditions': [
47 ['test_files!=[] and build_newlib==1', {
50 'destination': '>(nacl_newlib_out_dir)',
57 ['test_files!=[] and "<(target_arch)"!="arm" and "<(target_arch)"!="mipsel" and disable_glibc==0 and build_glibc==1', {
60 'destination': '>(nacl_glibc_out_dir)',
67 # Nonsfi pnacl copy is covered below. Currently, these are exclusive.
68 ['test_files!=[] and build_pnacl_newlib==1 and disable_pnacl==0 and enable_x86_32_nonsfi==0', {
71 'destination': '>(nacl_pnacl_newlib_out_dir)',
78 ['test_files!=[] and build_pnacl_newlib==1 and enable_x86_32_nonsfi==1', {
81 'destination': '>(nacl_pnacl_newlib_nonsfi_out_dir)',
90 # Patch over the fact that untrusted.gypi doesn't define these in all
107 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
108 'create_nmf_args_portable%': [],
110 'target_conditions': [
111 ['generate_nmf==1 and build_newlib==1', {
114 'action_name': 'Generate NEWLIB NMF',
115 'inputs': ['>(create_nmf)'],
116 'outputs': ['>(nmf_newlib)'],
120 '--output=>(nmf_newlib)',
121 '>@(create_nmf_args_portable)',
123 'target_conditions': [
124 ['enable_x86_64==1', {
125 'inputs': ['>(out_newlib64)'],
126 'action': ['>(out_newlib64)'],
128 ['enable_x86_32==1', {
129 'inputs': ['>(out_newlib32)'],
130 'action': ['>(out_newlib32)'],
133 'inputs': ['>(out_newlib_arm)'],
134 'action': ['>(out_newlib_arm)'],
137 'inputs': ['>(out_newlib_mips)'],
138 'action': ['>(out_newlib_mips)'],
144 ['"<(target_arch)"!="arm" and "<(target_arch)"!="mipsel" and generate_nmf==1 and disable_glibc==0 and build_glibc==1', {
146 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
147 # doesn't work on Windows.
148 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
149 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
150 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
154 'action_name': 'Generate GLIBC NMF and copy libs',
155 'inputs': ['>(create_nmf)'],
156 # NOTE: There is no explicit dependency for the lib32
157 # and lib64 directories created in the PRODUCT_DIR.
158 # They are created as a side-effect of NMF creation.
159 'outputs': ['>(nmf_glibc)'],
163 '--objdump=>(nacl_objdump)',
164 '--output=>(nmf_glibc)',
165 '--path-prefix=>(nexe_target)_libs',
166 '--stage-dependencies=<(nacl_glibc_out_dir)',
167 '>@(create_nmf_args_portable)',
169 'target_conditions': [
170 ['enable_x86_64==1', {
171 'inputs': ['>(out_glibc64)'],
174 '--library-path=>(libdir_glibc64)',
175 '--library-path=>(tc_lib_dir_glibc64)',
178 ['enable_x86_32==1', {
179 'inputs': ['>(out_glibc32)'],
182 '--library-path=>(libdir_glibc32)',
183 '--library-path=>(tc_lib_dir_glibc32)',
186 # TODO(ncbray) handle arm case. We don't have ARM glibc yet.
191 ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0', {
194 'action_name': 'Generate PNACL NEWLIB NMF',
195 # NOTE: create_nmf must be first, it is the script python
197 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib)'],
198 'outputs': ['>(nmf_pnacl_newlib)'],
202 '--output=>(nmf_pnacl_newlib)',
203 '>(out_pnacl_newlib)',
204 '>@(create_nmf_args_portable)',