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 'target_conditions': [
24 # These variables are used for nexe building and for library building.
25 'out_newlib32%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_32.nexe',
26 'out_newlib64%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_64.nexe',
27 'out_newlib_arm%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_arm.nexe',
28 'nmf_newlib%': '>(nacl_newlib_out_dir)/>(nexe_target).nmf',
29 'out_glibc32%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_32.nexe',
30 'out_glibc64%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_64.nexe',
31 'out_glibc_arm%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_arm.nexe',
32 'nmf_glibc%': '>(nacl_glibc_out_dir)/>(nexe_target).nmf',
33 'out_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target)_newlib_pnacl.pexe',
34 'nmf_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target).nmf',
39 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
40 '<(DEPTH)/ppapi/ppapi_untrusted.gyp:ppapi_cpp_lib',
41 '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
43 'target_conditions': [
44 ['test_files!=[] and build_newlib==1', {
47 'destination': '>(nacl_newlib_out_dir)',
54 ['test_files!=[] and "<(target_arch)"!="arm" and disable_glibc==0 and build_glibc==1', {
57 'destination': '>(nacl_glibc_out_dir)',
64 ['test_files!=[] and build_pnacl_newlib==1 and disable_pnacl==0', {
67 'destination': '>(nacl_pnacl_newlib_out_dir)',
76 # Patch over the fact that untrusted.gypi doesn't define these in all
93 'target_conditions': [
94 ['generate_nmf==1 and build_newlib==1', {
97 'action_name': 'Generate NEWLIB NMF',
98 # Unlike glibc, nexes are not actually inputs - only the names matter.
99 # We don't have the nexes as inputs because the ARM nexe may not
100 # exist. However, VS 2010 seems to blackhole this entire target if
101 # there are no inputs to this action. To work around this we add a
104 'outputs': ['>(nmf_newlib)'],
107 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
109 '--output=>(nmf_newlib)',
111 'target_conditions': [
112 ['enable_x86_64==1', {
113 'inputs': ['>(out_newlib64)'],
115 ['enable_x86_32==1', {
116 'inputs': ['>(out_newlib32)'],
119 'inputs': ['>(out_newlib_arm)'],
125 ['"<(target_arch)"!="arm" and generate_nmf==1 and disable_glibc==0 and build_glibc==1', {
127 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
128 # doesn't work on Windows.
129 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
130 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
131 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
135 'action_name': 'Generate GLIBC NMF and copy libs',
137 # NOTE: There is no explicit dependency for the lib32
138 # and lib64 directories created in the PRODUCT_DIR.
139 # They are created as a side-effect of NMF creation.
140 'outputs': ['>(nmf_glibc)'],
143 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
145 '--objdump=>(nacl_objdump)',
146 '--output=>(nmf_glibc)',
147 '--path-prefix=>(nexe_target)_libs',
148 '--stage-dependencies=<(nacl_glibc_out_dir)',
150 'target_conditions': [
151 ['enable_x86_64==1', {
152 'inputs': ['>(out_glibc64)'],
154 '--library-path=>(libdir_glibc64)',
155 '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
158 ['enable_x86_32==1', {
159 'inputs': ['>(out_glibc32)'],
161 '--library-path=>(libdir_glibc32)',
162 '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
165 # TODO(ncbray) handle arm case. We don't have ARM glibc yet.
170 ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0', {
173 'action_name': 'Generate PNACL NEWLIB NMF',
174 'inputs': ['>(out_pnacl_newlib)'],
175 'outputs': ['>(nmf_pnacl_newlib)'],
178 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
180 '--output=>(nmf_pnacl_newlib)',