OLD | NEW |
1 # Copyright 2014 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 GYP file defines untrusted (NaCl) targets. All targets in this | 5 # This GYP file defines untrusted (NaCl) targets. All targets in this |
6 # file should be conditionally depended upon via 'disable_nacl!=1' to avoid | 6 # file should be conditionally depended upon via 'disable_nacl!=1' to avoid |
7 # requiring NaCl sources for building. | 7 # requiring NaCl sources for building. |
8 | 8 |
9 { | 9 { |
10 'includes': [ | 10 'includes': [ |
11 '../native_client/build/untrusted.gypi', | 11 '../build/common_untrusted.gypi', |
12 'ppapi_sources.gypi', | 12 'ppapi_sources.gypi', |
13 ], | 13 ], |
14 'targets': [ | 14 'targets': [ |
15 { | 15 { |
16 'target_name': 'ppapi_cpp_lib', | 16 'target_name': 'ppapi_cpp_lib', |
17 'type': 'none', | 17 'type': 'none', |
18 'variables': { | 18 'variables': { |
19 'nlib_target': 'libppapi_cpp.a', | 19 'nlib_target': 'libppapi_cpp.a', |
20 'nso_target': 'libppapi_cpp.so', | 20 'nso_target': 'libppapi_cpp.so', |
21 'build_glibc': 1, | 21 'build_glibc': 1, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 '-lppapi', | 93 '-lppapi', |
94 '-pthread', | 94 '-pthread', |
95 ], | 95 ], |
96 'link_flags!': [ | 96 'link_flags!': [ |
97 '-O3', | 97 '-O3', |
98 ], | 98 ], |
99 'translate_flags': [ | 99 'translate_flags': [ |
100 '-O0', | 100 '-O0', |
101 ], | 101 ], |
102 'conditions': [ | 102 'conditions': [ |
103 ['target_arch=="ia32" or target_arch=="x64"', { | 103 ['target_arch=="ia32"', { |
104 'extra_deps_newlib64': [ | |
105 '>(tc_lib_dir_newlib64)/libppapi_cpp.a', | |
106 '>(tc_lib_dir_newlib64)/libppapi.a', | |
107 ], | |
108 'extra_deps_newlib32': [ | 104 'extra_deps_newlib32': [ |
109 '>(tc_lib_dir_newlib32)/libppapi_cpp.a', | 105 '>(tc_lib_dir_newlib32)/libppapi_cpp.a', |
110 '>(tc_lib_dir_newlib32)/libppapi.a', | 106 '>(tc_lib_dir_newlib32)/libppapi.a', |
111 ], | 107 ], |
112 'extra_deps_glibc64': [ | |
113 '>(tc_lib_dir_glibc64)/libppapi_cpp.so', | |
114 '>(tc_lib_dir_glibc64)/libppapi.so', | |
115 ], | |
116 'extra_deps_glibc32': [ | 108 'extra_deps_glibc32': [ |
117 '>(tc_lib_dir_glibc32)/libppapi_cpp.so', | 109 '>(tc_lib_dir_glibc32)/libppapi_cpp.so', |
118 '>(tc_lib_dir_glibc32)/libppapi.so', | 110 '>(tc_lib_dir_glibc32)/libppapi.so', |
119 ], | 111 ], |
120 }], | 112 }], |
| 113 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', { |
| 114 'extra_deps_newlib64': [ |
| 115 '>(tc_lib_dir_newlib64)/libppapi_cpp.a', |
| 116 '>(tc_lib_dir_newlib64)/libppapi.a', |
| 117 ], |
| 118 'extra_deps_glibc64': [ |
| 119 '>(tc_lib_dir_glibc64)/libppapi_cpp.so', |
| 120 '>(tc_lib_dir_glibc64)/libppapi.so', |
| 121 ], |
| 122 }], |
121 ['target_arch=="arm"', { | 123 ['target_arch=="arm"', { |
122 'extra_deps_arm': [ | 124 'extra_deps_arm': [ |
123 '>(tc_lib_dir_newlib_arm)/libppapi_cpp.a', | 125 '>(tc_lib_dir_newlib_arm)/libppapi_cpp.a', |
124 '>(tc_lib_dir_newlib_arm)/libppapi.a', | 126 '>(tc_lib_dir_newlib_arm)/libppapi.a', |
125 ], | 127 ], |
126 }], | 128 }], |
127 ], | 129 ], |
128 'extra_deps_pnacl_newlib': [ | 130 'extra_deps_pnacl_newlib': [ |
129 '>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a', | 131 '>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a', |
130 '>(tc_lib_dir_pnacl_newlib)/libppapi.a', | 132 '>(tc_lib_dir_pnacl_newlib)/libppapi.a', |
131 ], | 133 ], |
132 'sources': [ | 134 'sources': [ |
133 '<@(test_common_source_files)', | 135 '<@(test_common_source_files)', |
134 '<@(test_nacl_source_files)', | 136 '<@(test_nacl_source_files)', |
135 ], | 137 ], |
136 'extra_args': [ | 138 'extra_args': [ |
137 '--strip-all', | 139 '--strip-all', |
138 ], | 140 ], |
139 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py', | 141 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py', |
140 'create_nonsfi_test_nmf': 'tests/create_nonsfi_test_nmf.py', | 142 'create_nonsfi_test_nmf': 'tests/create_nonsfi_test_nmf.py', |
141 }, | 143 }, |
142 'conditions': [ | 144 'conditions': [ |
143 ['target_arch!="arm" and target_arch!="mipsel" and disable_glibc==0', { | 145 ['(target_arch=="ia32" or target_arch=="x64") and disable_glibc==0', { |
144 'variables': { | 146 'variables': { |
145 'build_glibc': 1, | 147 'build_glibc': 1, |
146 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which | 148 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which |
147 # doesn't work on Windows. | 149 # doesn't work on Windows. |
148 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib', | 150 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib', |
149 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32', | 151 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32', |
150 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump', | 152 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump', |
151 'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf', | 153 'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf', |
152 }, | 154 }, |
153 'actions': [ | 155 'actions': [ |
154 { | 156 { |
155 'action_name': 'Generate GLIBC NMF and copy libs', | 157 'action_name': 'Generate GLIBC NMF and copy libs', |
156 # NOTE: create_nmf must be first, it is the script python executes | 158 # NOTE: create_nmf must be first, it is the script python executes |
157 # below. | 159 # below. |
158 'inputs': ['>(create_nmf)', '>(out_glibc64)', '>(out_glibc32)'], | 160 'inputs': ['>(create_nmf)'], |
159 # NOTE: There is no explicit dependency for the lib32 | 161 # NOTE: There is no explicit dependency for the lib32 |
160 # and lib64 directories created in the PRODUCT_DIR. | 162 # and lib64 directories created in the PRODUCT_DIR. |
161 # They are created as a side-effect of NMF creation. | 163 # They are created as a side-effect of NMF creation. |
162 'outputs': ['>(nmf_glibc)'], | 164 'outputs': ['>(nmf_glibc)'], |
163 'action': [ | 165 'action': [ |
164 'python', | 166 'python', |
165 '>@(_inputs)', | 167 '>@(_inputs)', |
166 '--objdump=>(nacl_objdump)', | 168 '--objdump=>(nacl_objdump)', |
167 '--library-path=>(libdir_glibc64)', | |
168 '--library-path=>(libdir_glibc32)', | |
169 '--library-path=>(tc_lib_dir_glibc32)', | |
170 '--library-path=>(tc_lib_dir_glibc64)', | |
171 '--output=>(nmf_glibc)', | 169 '--output=>(nmf_glibc)', |
172 '--stage-dependencies=<(PRODUCT_DIR)', | 170 '--stage-dependencies=<(PRODUCT_DIR)', |
173 ], | 171 ], |
| 172 'conditions': [ |
| 173 ['target_arch=="ia32"', { |
| 174 'action': [ |
| 175 '--library-path=>(libdir_glibc32)', |
| 176 '--library-path=>(tc_lib_dir_glibc32)', |
| 177 ], |
| 178 'inputs': ['>(out_glibc32)'], |
| 179 }], |
| 180 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', { |
| 181 'action': [ |
| 182 '--library-path=>(libdir_glibc64)', |
| 183 '--library-path=>(tc_lib_dir_glibc64)', |
| 184 ], |
| 185 'inputs': ['>(out_glibc64)'], |
| 186 }], |
| 187 ], |
174 }, | 188 }, |
175 ], | 189 ], |
176 }], | 190 }], |
177 # Test PNaCl pre-translated code (pre-translated to save bot time). | 191 # Test PNaCl pre-translated code (pre-translated to save bot time). |
178 # We only care about testing that code generation is correct, | 192 # We only care about testing that code generation is correct, |
179 # and in-browser translation is tested elsewhere. | 193 # and in-browser translation is tested elsewhere. |
180 # NOTE: native_client/build/untrusted.gypi dictates that | 194 # NOTE: native_client/build/untrusted.gypi dictates that |
181 # PNaCl only generate x86-32 and x86-64 on x86 platforms, | 195 # PNaCl only generate x86-32 and x86-64 on x86 platforms, |
182 # ARM on ARM platforms, or MIPS on MIPS platforms, not all | 196 # ARM on ARM platforms, or MIPS on MIPS platforms, not all |
183 # versions always. | 197 # versions always. |
184 # The same goes for the PNaCl shims. So, we have two variations here. | 198 # The same goes for the PNaCl shims. So, we have two variations here. |
185 ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64")', { | 199 ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64")', { |
186 'variables': { | 200 'variables': { |
187 'build_pnacl_newlib': 1, | 201 'build_pnacl_newlib': 1, |
188 'translate_pexe_with_build': 1, | 202 'translate_pexe_with_build': 1, |
189 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf', | 203 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf', |
190 }, | 204 }, |
191 # Shim is a dependency for the nexe because we pre-translate. | 205 # Shim is a dependency for the nexe because we pre-translate. |
192 'dependencies': [ | 206 'dependencies': [ |
193 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt
_shim.gyp:aot', | 207 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt
_shim.gyp:aot', |
194 ], | 208 ], |
195 'actions': [ | 209 'actions': [ |
196 { | 210 { |
197 'action_name': 'Generate PNACL NEWLIB NMF', | 211 'action_name': 'Generate PNACL NEWLIB NMF', |
198 # NOTE: create_nmf must be first, it is the script python executes | 212 # NOTE: create_nmf must be first, it is the script python executes |
199 # below. | 213 # below. |
200 'inputs': [ | 214 'inputs': [ |
201 '>(create_nmf)', | 215 '>(create_nmf)', |
202 '>(out_pnacl_newlib_x86_32_nexe)', | |
203 '>(out_pnacl_newlib_x86_64_nexe)' | |
204 ], | 216 ], |
205 'outputs': ['>(nmf_pnacl)'], | 217 'outputs': ['>(nmf_pnacl)'], |
206 'action': [ | 218 'action': [ |
207 'python', | 219 'python', |
208 '>@(_inputs)', | 220 '>@(_inputs)', |
209 '--output=>(nmf_pnacl)', | 221 '--output=>(nmf_pnacl)', |
210 ], | 222 ], |
| 223 'conditions': [ |
| 224 ['target_arch=="ia32"', { |
| 225 'inputs': [ |
| 226 '>(out_pnacl_newlib_x86_32_nexe)', |
| 227 ], |
| 228 }], |
| 229 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', { |
| 230 'inputs': [ |
| 231 '>(out_pnacl_newlib_x86_64_nexe)', |
| 232 ], |
| 233 }], |
| 234 ], |
211 }, | 235 }, |
212 ], | 236 ], |
213 }], | 237 }], |
214 ['disable_pnacl==0 and target_arch=="ia32" and OS=="linux"', { | 238 ['disable_pnacl==0 and target_arch=="ia32" and OS=="linux"', { |
215 # In addition to above configuration, build x86-32-nonsfi .nexe file | 239 # In addition to above configuration, build x86-32-nonsfi .nexe file |
216 # by translating from .pexe binary, for non-SFI mode PPAPI testing. | 240 # by translating from .pexe binary, for non-SFI mode PPAPI testing. |
217 'variables': { | 241 'variables': { |
218 'enable_x86_32_nonsfi': 1, | 242 'enable_x86_32_nonsfi': 1, |
219 'translate_pexe_with_build': 1, | 243 'translate_pexe_with_build': 1, |
220 'nmf_nonsfi%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_nonsfi.nmf', | 244 'nmf_nonsfi%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_nonsfi.nmf', |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 '>@(_inputs)', | 306 '>@(_inputs)', |
283 '--output=>(nmf_pnacl)', | 307 '--output=>(nmf_pnacl)', |
284 ], | 308 ], |
285 }, | 309 }, |
286 ], | 310 ], |
287 }], | 311 }], |
288 ], | 312 ], |
289 }, | 313 }, |
290 ], | 314 ], |
291 } | 315 } |
OLD | NEW |