Upstream version 9.37.195.0
[platform/framework/web/crosswalk.git] / src / native_client / build / untrusted.gypi
1 # Copyright (c) 2011 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 {
6   'variables': {
7     'variables': {
8       # Enable -Werror by default, but put it in a variable so it can
9       # be optionally disabled.
10       'werror%': '-Werror',
11       # 1 to use goma.
12       'use_goma%': 0,
13     },
14     # Default C compiler defines.
15     'nacl_default_defines': [
16       '__linux__',
17       '__STDC_LIMIT_MACROS=1',
18       '__STDC_FORMAT_MACROS=1',
19       '_GNU_SOURCE=1',
20       '_BSD_SOURCE=1',
21       '_POSIX_C_SOURCE=199506',
22       '_XOPEN_SOURCE=600',
23       'DYNAMIC_ANNOTATIONS_ENABLED=1',
24       'DYNAMIC_ANNOTATIONS_PREFIX=NACL_',
25     ],
26     'nacl_default_compile_flags': [
27       #'-std=gnu99',  Added by build_nexe
28       '-O2',
29       '-g',
30       '-Wall',
31       '-fdiagnostics-show-option',
32       '<(werror)',
33     ],
34     # The flag gomadir is one of the flag to enable goma on build_nexe.py.
35     # It should be set only if use_goma is true.
36     'conditions': [
37       ['use_goma==0', {
38         'gomadir%': '',
39       }],
40       ['OS=="android"', {
41         'TOOLCHAIN_OS': 'linux',
42       }, {
43         'TOOLCHAIN_OS': '<(OS)',
44       }],
45     ],
46   },
47   'conditions': [
48     ['target_arch=="ia32" or target_arch=="x64"', {
49       # Common defaults for all x86 nacl-gcc targets
50       'target_defaults': {
51         'defines': [],
52         'sources': [],
53         'compile_flags': [],
54         'link_flags': [],
55         'include_dirs': [],
56         'variables': {
57           'nexe_target': '',
58           'nlib_target': '',
59           'nso_target': '',
60           'build_newlib': 0,
61           'build_glibc': 0,
62           'build_irt': 0,
63           'disable_glibc%': 0,
64           'disable_bionic%': 1,
65           'extra_args': [],
66           'enable_x86_32': 1,
67           'enable_x86_64': 1,
68           'enable_arm': 0,
69           'enable_mips': 0,
70           'enable_x86_32_nonsfi': 0,
71           'nacl_glibc_tc_root': '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_glibc',
72           'nacl_newlib_tc_root': '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib',
73           'tc_lib_dir_newlib32': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32',
74           'tc_lib_dir_newlib64': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64',
75           'tc_lib_dir_glibc32': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
76           'tc_lib_dir_glibc64': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
77           'tc_lib_dir_irt32': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/lib32',
78           'tc_lib_dir_irt64': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/lib64',
79           'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include',
80           'tc_include_dir_glibc': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/include',
81           'extra_deps': [],
82           'extra_deps_newlib64': [],
83           'extra_deps_newlib32': [],
84           'extra_deps_glibc64': [],
85           'extra_deps_glibc32': [],
86           'include_dirs': ['<(DEPTH)'],
87           'defines': [
88             '<@(nacl_default_defines)',
89             'NACL_BUILD_ARCH=x86',
90           ],
91           'sources': [],
92           'link_flags': [],
93           'get_sources': [
94             'scan_sources',
95             # This is needed to open the .c filenames, which are given
96             # relative to the .gyp file.
97             '-I.',
98             # This is needed to open the .h filenames, which are given
99             # relative to the native_client directory's parent.
100             '-I<(DEPTH)',
101           ],
102         },
103       },
104     }],
105     ['target_arch=="arm"', {
106       # Common defaults for all ARM nacl-gcc targets
107       'target_defaults': {
108         'defines': [],
109         'sources': [],
110         'compile_flags': [],
111         'link_flags': [],
112         'include_dirs': [],
113         'variables': {
114           'nexe_target': '',
115           'nlib_target': '',
116           'nso_target': '',
117           'build_bionic': 0,
118           'build_newlib': 0,
119           'build_glibc': 0,
120           'build_irt': 0,
121           'disable_glibc%': 1,
122           'disable_bionic%': 1,
123           'extra_args': [],
124           'enable_x86_32': 0,
125           'enable_x86_64': 0,
126           'enable_arm': 1,
127           'enable_mips': 0,
128           'enable_x86_32_nonsfi': 0,
129           'extra_deps': [],
130           'extra_deps_newlib_arm': [],
131           'extra_deps_bionic_arm': [],
132           'native_sources': [],
133           'nacl_glibc_tc_root': '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_arm_glibc',
134           'nacl_newlib_tc_root': '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_arm_newlib',
135           'tc_lib_dir_bionic_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_bionic/libarm',
136           'tc_lib_dir_newlib_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm',
137           'tc_lib_dir_irt_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/libarm',
138           'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include',
139           'tc_include_dir_bionic': '<(SHARED_INTERMEDIATE_DIR)/tc_bionic/include',
140           'include_dirs': ['<(DEPTH)'],
141           'defines': [
142             '<@(nacl_default_defines)',
143             'NACL_BUILD_ARCH=arm',
144            ],
145            'sources': [],
146            'link_flags': [],
147            'get_sources': [
148              'scan_sources',
149              # This is needed to open the .c filenames, which are given
150              # relative to the .gyp file.
151              '-I.',
152              # This is needed to open the .h filenames, which are given
153              # relative to the native_client directory's parent.
154              '-I<(DEPTH)',
155            ],
156          },
157        },
158     }],
159     ['target_arch=="mipsel"', {
160       # Common defaults for all mips pnacl-clang targets
161       'target_defaults': {
162         'defines': [],
163         'sources': [],
164         'compile_flags': [],
165         'link_flags': [],
166         'include_dirs': [],
167         'variables': {
168           'nexe_target': '',
169           'nlib_target': '',
170           'nso_target': '',
171           'build_newlib': 0,
172           'build_glibc': 0,
173           'build_irt': 0,
174           'disable_glibc%': 1,
175           'disable_bionic%': 1,
176           'extra_args': [],
177           'enable_x86_32': 0,
178           'enable_x86_64': 0,
179           'enable_arm': 0,
180           'enable_mips': 1,
181           'enable_x86_32_nonsfi': 0,
182           'extra_deps': [],
183           'extra_deps_newlib_mips': [],
184           'native_sources': [],
185           'nacl_glibc_tc_root': '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_mips_glibc',
186           'nacl_newlib_tc_root': '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_mips_newlib',
187           'tc_lib_dir_newlib_mips': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libmips',
188           'tc_lib_dir_irt_mips': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/libmips',
189           'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include',
190           'include_dirs': ['<(DEPTH)'],
191           'defines': [
192             '<@(nacl_default_defines)',
193             'NACL_BUILD_ARCH=mips',
194            ],
195            'sources': [],
196            'link_flags': [],
197            'get_sources': [
198              'scan_sources',
199              # This is needed to open the .c filenames, which are given
200              # relative to the .gyp file.
201              '-I.',
202              # This is needed to open the .h filenames, which are given
203              # relative to the native_client directory's parent.
204              '-I<(DEPTH)',
205            ],
206          },
207        },
208     }],
209     ['target_arch=="ia32" or target_arch=="x64"', {
210       'target_defaults': {
211         # x86-64 newlib nexe action
212         'target_conditions': [
213            ['nexe_target!="" and build_newlib!=0 and enable_x86_64!=0', {
214              'variables': {
215                 'tool_name': 'newlib',
216                 'out_newlib64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe',
217                 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
218              },
219              'actions': [
220                {
221                  'action_name': 'build newlib x86-64 nexe',
222                  'variables': {
223                    'source_list_newlib64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
224                  },
225                  'msvs_cygwin_shell': 0,
226                  'description': 'building >(out_newlib64)',
227                  'inputs': [
228                     '<(DEPTH)/native_client/build/build_nexe.py',
229                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
230                     '>@(extra_deps)',
231                     '>@(extra_deps_newlib64)',
232                     '^(source_list_newlib64)',
233                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib/stamp.prep',
234                  ],
235                  'outputs': ['>(out_newlib64)'],
236                  'action': [
237                    'python',
238                    '<(DEPTH)/native_client/build/build_nexe.py',
239                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
240                    '>@(extra_args)',
241                    '--arch', 'x86-64',
242                    '--build', 'newlib_nexe',
243                    '--root', '<(DEPTH)',
244                    '--name', '>(out_newlib64)',
245                    '--objdir', '>(objdir_newlib64)',
246                    '--config-name', '<(CONFIGURATION_NAME)',
247                    '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
248                    '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
249                    '--gomadir', '<(gomadir)',
250                    '--defines=^(defines) >(_defines)',
251                    '--link_flags=-B>(tc_lib_dir_newlib64) ^(link_flags) >(_link_flags)',
252                    '--source-list=^(source_list_newlib64)',
253                  ],
254                },
255              ],
256            }],
257            # x86-64 newlib library action
258            ['nlib_target!="" and build_newlib!=0 and enable_x86_64!=0', {
259              'variables': {
260                 'tool_name': 'newlib',
261                 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
262                 'out_newlib64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
263              },
264              'actions': [
265                {
266                  'action_name': 'build newlib x86-64 nlib',
267                  'variables': {
268                    'source_list_newlib64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
269                  },
270                  'msvs_cygwin_shell': 0,
271                  'description': 'building >(out_newlib64)',
272                  'inputs': [
273                     '<(DEPTH)/native_client/build/build_nexe.py',
274                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
275                     '>@(extra_deps)',
276                     '>@(extra_deps_newlib64)',
277                     '^(source_list_newlib64)',
278                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib/stamp.prep',
279                  ],
280                  'outputs': ['>(out_newlib64)'],
281                  'action': [
282                    'python',
283                    '<(DEPTH)/native_client/build/build_nexe.py',
284                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
285                    '>@(extra_args)',
286                    '--arch', 'x86-64',
287                    '--build', 'newlib_nlib',
288                    '--root', '<(DEPTH)',
289                    '--name', '>(out_newlib64)',
290                    '--objdir', '>(objdir_newlib64)',
291                    '--config-name', '<(CONFIGURATION_NAME)',
292                    '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
293                    '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
294                    '--gomadir', '<(gomadir)',
295                    '--defines=^(defines) >(_defines)',
296                    '--link_flags=-B>(tc_lib_dir_newlib64) ^(link_flags) >(_link_flags)',
297                    '--source-list=^(source_list_newlib64)',
298                  ],
299                },
300              ],
301            }],
302            # x86-64 IRT nexe action
303            ['nexe_target!="" and build_irt!=0 and enable_x86_64!=0', {
304              'variables': {
305                 'tool_name': 'irt',
306                 'out_newlib64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe',
307                 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
308              },
309              'actions': [
310                {
311                  'action_name': 'build IRT x86-64 nexe',
312                  'variables': {
313                    'source_list_newlib64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
314                  },
315                  'msvs_cygwin_shell': 0,
316                  'description': 'building >(out_newlib64)',
317                  'inputs': [
318                     '<(DEPTH)/native_client/build/build_nexe.py',
319                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
320                     '>@(extra_deps)',
321                     '>@(extra_deps_newlib64)',
322                     '^(source_list_newlib64)',
323                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib/stamp.prep',
324                     '<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
325                  ],
326                  'outputs': ['>(out_newlib64)'],
327                  'action': [
328                    'python',
329                    '<(DEPTH)/native_client/build/build_nexe.py',
330                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
331                    '>@(extra_args)',
332                    '--arch', 'x86-64',
333                    '--build', 'newlib_nexe_pnacl',
334                    '--root', '<(DEPTH)',
335                    '--name', '>(out_newlib64)',
336                    '--objdir', '>(objdir_newlib64)',
337                    '--config-name', '<(CONFIGURATION_NAME)',
338                    '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
339                    '--compile_flags=--target=x86_64-unknown-nacl -stdlib=libstdc++ ^(compile_flags) >(_compile_flags) -gline-tables-only ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
340                    '--gomadir', '<(gomadir)',
341                    '--defines=^(defines) >(_defines)',
342                    '--link_flags=--target=x86_64-unknown-nacl -stdlib=libstdc++ -arch x86-64 --pnacl-allow-translate --pnacl-allow-native -B>(tc_lib_dir_irt64) ^(pnacl_irt_link_flags) ^(link_flags) >(_link_flags)',
343                    '--source-list=^(source_list_newlib64)',
344                    '--tls-edit=<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
345                    '--irt-layout',
346                  ],
347                },
348              ],
349            }],
350            # x86-64 IRT library action
351            ['nlib_target!="" and build_irt!=0 and enable_x86_64!=0', {
352              'variables': {
353                 'tool_name': 'irt',
354                 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
355                 'out_newlib64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
356              },
357              'actions': [
358                {
359                  'action_name': 'build irt x86-64 nlib',
360                  'variables': {
361                    'source_list_newlib64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
362                  },
363                  'msvs_cygwin_shell': 0,
364                  'description': 'building >(out_newlib64)',
365                  'inputs': [
366                     '<(DEPTH)/native_client/build/build_nexe.py',
367                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
368                     '>@(extra_deps)',
369                     '>@(extra_deps_newlib64)',
370                     '^(source_list_newlib64)',
371                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib/stamp.prep',
372                  ],
373                  'outputs': ['>(out_newlib64)'],
374                  'action': [
375                    'python',
376                    '<(DEPTH)/native_client/build/build_nexe.py',
377                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
378                    '>@(extra_args)',
379                    '--arch', 'x86-64',
380                    '--build', 'newlib_nlib_pnacl',
381                    '--root', '<(DEPTH)',
382                    '--name', '>(out_newlib64)',
383                    '--objdir', '>(objdir_newlib64)',
384                    '--config-name', '<(CONFIGURATION_NAME)',
385                    '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
386                    '--compile_flags=--target=x86_64-unknown-nacl -stdlib=libstdc++ ^(compile_flags) >(_compile_flags) -gline-tables-only ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
387                    '--gomadir', '<(gomadir)',
388                    '--defines=^(defines) >(_defines)',
389                    '--link_flags=--target=x86_64-unknown-nacl -stdlib=libstdc++ -B>(tc_lib_dir_irt64) ^(pnacl_irt_link_flags) ^(link_flags) >(_link_flags)',
390                    '--source-list=^(source_list_newlib64)',
391                  ],
392                },
393              ],
394            }],
395            # x86-32 newlib nexe action
396            ['nexe_target!="" and build_newlib!=0 and enable_x86_32!=0', {
397              'variables': {
398                 'tool_name': 'newlib',
399                 'out_newlib32%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x32.nexe',
400                 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
401              },
402              'actions': [
403                {
404                  'action_name': 'build newlib x86-32 nexe',
405                  'variables': {
406                    'source_list_newlib32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
407                  },
408                  'msvs_cygwin_shell': 0,
409                  'description': 'building >(out_newlib32)',
410                  'inputs': [
411                     '<(DEPTH)/native_client/build/build_nexe.py',
412                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
413                     '>@(extra_deps)',
414                     '>@(extra_deps_newlib32)',
415                     '^(source_list_newlib32)',
416                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib/stamp.prep',
417                  ],
418                  'outputs': ['>(out_newlib32)'],
419                  'action': [
420                    'python',
421                    '<(DEPTH)/native_client/build/build_nexe.py',
422                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
423                    '>@(extra_args)',
424                    '--arch', 'x86-32',
425                    '--build', 'newlib_nexe',
426                    '--root', '<(DEPTH)',
427                    '--name', '>(out_newlib32)',
428                    '--objdir', '>(objdir_newlib32)',
429                    '--config-name', '<(CONFIGURATION_NAME)',
430                    '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
431                    '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
432                    '--gomadir', '<(gomadir)',
433                    '--defines=^(defines) >(_defines)',
434                    '--link_flags=-m32 -B>(tc_lib_dir_newlib32) ^(link_flags) >(_link_flags)',
435                    '--source-list=^(source_list_newlib32)',
436                  ],
437                },
438              ],
439            }],
440            # x86-32 newlib library action
441            ['nlib_target!="" and build_newlib!=0 and enable_x86_32!=0', {
442              'variables': {
443                 'tool_name': 'newlib',
444                 'out_newlib32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
445                 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
446              },
447              'actions': [
448                {
449                  'action_name': 'build newlib x86-32 nlib',
450                  'variables': {
451                    'source_list_newlib32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
452                  },
453                  'msvs_cygwin_shell': 0,
454                  'description': 'building >(out_newlib32)',
455                  'inputs': [
456                     '<(DEPTH)/native_client/build/build_nexe.py',
457                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
458                     '>@(extra_deps)',
459                     '>@(extra_deps_newlib32)',
460                     '^(source_list_newlib32)',
461                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib/stamp.prep',
462                  ],
463                  'outputs': ['>(out_newlib32)'],
464                  'action': [
465                    'python',
466                    '<(DEPTH)/native_client/build/build_nexe.py',
467                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
468                    '>@(extra_args)',
469                    '--arch', 'x86-32',
470                    '--build', 'newlib_nlib',
471                    '--root', '<(DEPTH)',
472                    '--name', '>(out_newlib32)',
473                    '--objdir', '>(objdir_newlib32)',
474                    '--config-name', '<(CONFIGURATION_NAME)',
475                    '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
476                    '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
477                    '--gomadir', '<(gomadir)',
478                    '--defines=^(defines) >(_defines)',
479                    '--link_flags=-m32 -B>(tc_lib_dir_newlib32) ^(link_flags) >(_link_flags)',
480                    '--source-list=^(source_list_newlib32)',
481                  ],
482                },
483              ],
484            }],
485            # x86-32 IRT nexe build
486            ['nexe_target!="" and build_irt!=0 and enable_x86_32!=0', {
487              'variables': {
488                 'tool_name': 'irt',
489                 'out_newlib32%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x32.nexe',
490                 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
491              },
492              'actions': [
493                {
494                  'action_name': 'build IRT x86-32 nexe',
495                  'variables': {
496                    'source_list_newlib32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
497                  },
498                  'msvs_cygwin_shell': 0,
499                  'description': 'building >(out_newlib32)',
500                  'inputs': [
501                     '<(DEPTH)/native_client/build/build_nexe.py',
502                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
503                     '>@(extra_deps)',
504                     '>@(extra_deps_newlib32)',
505                     '^(source_list_newlib32)',
506                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib/stamp.prep',
507                     '<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
508                  ],
509                  'outputs': ['>(out_newlib32)'],
510                  'action': [
511                    'python',
512                    '<(DEPTH)/native_client/build/build_nexe.py',
513                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
514                    '>@(extra_args)',
515                    '--arch', 'x86-32',
516                    '--build', 'newlib_nexe',
517                    '--root', '<(DEPTH)',
518                    '--name', '>(out_newlib32)',
519                    '--objdir', '>(objdir_newlib32)',
520                    '--config-name', '<(CONFIGURATION_NAME)',
521                    '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
522                    '--compile_flags=-m32 ^(gcc_irt_compile_flags) ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
523                    '--gomadir', '<(gomadir)',
524                    '--defines=^(defines) >(_defines)',
525                    '--link_flags=-m32 -B>(tc_lib_dir_irt32) ^(gcc_irt_link_flags) ^(link_flags) >(_link_flags)',
526                    '--source-list=^(source_list_newlib32)',
527                    '--tls-edit=<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
528                    '--irt-layout',
529                  ],
530                },
531              ],
532            }],
533            # x86-32 IRT library build
534            ['nlib_target!="" and build_irt!=0 and enable_x86_32!=0', {
535              'variables': {
536                 'tool_name': 'irt',
537                 'out_newlib32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
538                 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
539              },
540              'actions': [
541                {
542                  'action_name': 'build IRT x86-32 nlib',
543                  'variables': {
544                    'source_list_newlib32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
545                  },
546                  'msvs_cygwin_shell': 0,
547                  'description': 'building >(out_newlib32)',
548                  'inputs': [
549                     '<(DEPTH)/native_client/build/build_nexe.py',
550                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
551                     '>@(extra_deps)',
552                     '>@(extra_deps_newlib32)',
553                     '^(source_list_newlib32)',
554                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_newlib/stamp.prep',
555                  ],
556                  'outputs': ['>(out_newlib32)'],
557                  'action': [
558                    'python',
559                    '<(DEPTH)/native_client/build/build_nexe.py',
560                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
561                    '>@(extra_args)',
562                    '--arch', 'x86-32',
563                    '--build', 'newlib_nlib',
564                    '--root', '<(DEPTH)',
565                    '--name', '>(out_newlib32)',
566                    '--objdir', '>(objdir_newlib32)',
567                    '--config-name', '<(CONFIGURATION_NAME)',
568                    '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
569                    '--compile_flags=-m32 ^(gcc_irt_compile_flags) ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
570                    '--gomadir', '<(gomadir)',
571                    '--defines=^(defines) >(_defines)',
572                    '--link_flags=-m32 -B>(tc_lib_dir_irt32) ^(gcc_irt_link_flags) ^(link_flags) >(_link_flags)',
573                    '--source-list=^(source_list_newlib32)',
574                  ],
575                },
576              ],
577            }],
578         ],
579       },
580     }], # end x86 gcc nexe/nlib actions
581     ['target_arch=="arm"', {
582       'target_defaults': {
583         'target_conditions': [
584           # arm newlib nexe action
585           ['nexe_target!="" and build_newlib!=0', {
586             'variables': {
587                'tool_name': 'newlib',
588                'out_newlib_arm%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_arm.nexe',
589                'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
590             },
591             'actions': [
592               {
593                 'action_name': 'build newlib arm nexe',
594                 'variables': {
595                   'source_list_newlib_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
596                 },
597                 'msvs_cygwin_shell': 0,
598                 'description': 'building >(out_newlib_arm)',
599                 'inputs': [
600                    '<(DEPTH)/native_client/build/build_nexe.py',
601                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
602                    '>@(extra_deps)',
603                    '>@(extra_deps_newlib_arm)',
604                    '^(source_list_newlib_arm)',
605                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_arm_newlib/stamp.prep',
606                 ],
607                 'outputs': ['>(out_newlib_arm)'],
608                 'action': [
609                   'python',
610                   '<(DEPTH)/native_client/build/build_nexe.py',
611                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
612                   '>@(extra_args)',
613                   '--arch', 'arm',
614                   '--build', 'newlib_nexe',
615                   '--root', '<(DEPTH)',
616                   '--name', '>(out_newlib_arm)',
617                   '--objdir', '>(objdir_newlib_arm)',
618                   '--config-name', '<(CONFIGURATION_NAME)',
619                   '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
620                   '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
621                   '--gomadir', '<(gomadir)',
622                   '--defines=^(defines) >(_defines)',
623                   '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link_flags)',
624                   '--source-list=^(source_list_newlib_arm)',
625                 ],
626               },
627             ],
628           }],
629           # arm newlib library action
630           ['nlib_target!="" and build_newlib!=0', {
631             'variables': {
632               'tool_name': 'newlib',
633               'out_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
634               'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
635             },
636             'actions': [
637               {
638                 'action_name': 'build newlib arm nlib',
639                  'variables': {
640                    'source_list_newlib_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
641                  },
642                 'msvs_cygwin_shell': 0,
643                 'description': 'building >(out_newlib_arm)',
644                 'inputs': [
645                    '<(DEPTH)/native_client/build/build_nexe.py',
646                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
647                    '>@(extra_deps)',
648                    '>@(extra_deps_newlib_arm)',
649                    '^(source_list_newlib_arm)',
650                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_arm_newlib/stamp.prep',
651                 ],
652                 'outputs': ['>(out_newlib_arm)'],
653                 'action': [
654                   'python',
655                   '<(DEPTH)/native_client/build/build_nexe.py',
656                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
657                   '>@(extra_args)',
658                   '--arch', 'arm',
659                   '--build', 'newlib_nlib',
660                   '--root', '<(DEPTH)',
661                   '--name', '>(out_newlib_arm)',
662                   '--objdir', '>(objdir_newlib_arm)',
663                   '--config-name', '<(CONFIGURATION_NAME)',
664                   '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
665                   '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
666                   '--gomadir', '<(gomadir)',
667                   '--defines=^(defines) >(_defines)',
668                   '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link_flags)',
669                   '--source-list=^(source_list_newlib_arm)',
670                 ],
671               },
672             ],
673           }],
674           ['nlib_target!="" and build_bionic!=0 and disable_bionic==0', {
675             'variables': {
676               'tool_name': 'bionic',
677               'out_bionic_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
678               'objdir_bionic_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
679             },
680             'actions': [
681               {
682                 'action_name': 'build bionic arm nlib',
683                  'variables': {
684                    'source_list_bionic_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
685                  },
686                 'msvs_cygwin_shell': 0,
687                 'description': 'building >(out_bionic_arm)',
688                 'inputs': [
689                    '<(DEPTH)/native_client/build/build_nexe.py',
690                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
691                    '>@(extra_deps)',
692                    '>@(extra_deps_bionic_arm)',
693                    '^(source_list_bionic_arm)',
694                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86_nacl_arm/nacl_arm_bionic',
695                 ],
696                 'outputs': ['>(out_bionic_arm)'],
697                 'action': [
698                   'python',
699                   '<(DEPTH)/native_client/build/build_nexe.py',
700                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
701                   '>@(extra_args)',
702                   '--arch', 'arm',
703                   '--build', 'bionic_nlib',
704                   '--root', '<(DEPTH)',
705                   '--name', '>(out_bionic_arm)',
706                   '--objdir', '>(objdir_bionic_arm)',
707                   '--config-name', '<(CONFIGURATION_NAME)',
708                   '--include-dirs=>(tc_include_dir_bionic) ^(include_dirs) >(_include_dirs)',
709                   '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
710                   '--gomadir', '<(gomadir)',
711                   '--defines=^(defines) >(_defines)',
712                   '--link_flags=-B>(tc_lib_dir_bionic_arm) ^(link_flags) >(_link_flags)',
713                   '--source-list=^(source_list_bionic_arm)',
714                 ],
715               },
716             ],
717           }],
718           # arm irt nexe action
719           ['nexe_target!="" and build_irt!=0', {
720             'variables': {
721                'tool_name': 'irt',
722                'out_newlib_arm%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_arm.nexe',
723                'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
724             },
725             'actions': [
726               {
727                 'action_name': 'build IRT arm nexe',
728                 'variables': {
729                   'source_list_newlib_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
730                 },
731                 'msvs_cygwin_shell': 0,
732                 'description': 'building >(out_newlib_arm)',
733                 'inputs': [
734                    '<(DEPTH)/native_client/build/build_nexe.py',
735                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
736                    '>@(extra_deps)',
737                    '>@(extra_deps_newlib_arm)',
738                    '^(source_list_newlib_arm)',
739                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_arm_newlib/stamp.prep',
740                    '<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
741                 ],
742                 'outputs': ['>(out_newlib_arm)'],
743                 'action': [
744                   'python',
745                   '<(DEPTH)/native_client/build/build_nexe.py',
746                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
747                   '>@(extra_args)',
748                   '--arch', 'arm',
749                   '--build', 'newlib_nexe',
750                   '--root', '<(DEPTH)',
751                   '--name', '>(out_newlib_arm)',
752                   '--objdir', '>(objdir_newlib_arm)',
753                   '--config-name', '<(CONFIGURATION_NAME)',
754                   '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
755                   '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_irt_compile_flags) ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
756                   '--gomadir', '<(gomadir)',
757                   '--defines=^(defines) >(_defines)',
758                   '--link_flags=-B>(tc_lib_dir_irt_arm) ^(gcc_irt_link_flags) ^(link_flags) >(_link_flags)',
759                   '--source-list=^(source_list_newlib_arm)',
760                   '--tls-edit=<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
761                    '--irt-layout',
762                 ],
763               },
764             ],
765           }],
766           # arm IRT library action
767           ['nlib_target!="" and build_irt!=0', {
768             'variables': {
769               'tool_name': 'irt',
770               'out_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
771               'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
772             },
773             'actions': [
774               {
775                 'action_name': 'build IRT arm nlib',
776                 'variables': {
777                   'source_list_newlib_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
778                 },
779                 'msvs_cygwin_shell': 0,
780                 'description': 'building >(out_newlib_arm)',
781                 'inputs': [
782                    '<(DEPTH)/native_client/build/build_nexe.py',
783                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
784                    '>@(extra_deps)',
785                    '>@(extra_deps_newlib_arm)',
786                    '^(source_list_newlib_arm)',
787                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_arm_newlib/stamp.prep',
788                 ],
789                 'outputs': ['>(out_newlib_arm)'],
790                 'action': [
791                   'python',
792                   '<(DEPTH)/native_client/build/build_nexe.py',
793                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
794                   '>@(extra_args)',
795                   '--arch', 'arm',
796                   '--build', 'newlib_nlib',
797                   '--root', '<(DEPTH)',
798                   '--name', '>(out_newlib_arm)',
799                   '--objdir', '>(objdir_newlib_arm)',
800                   '--config-name', '<(CONFIGURATION_NAME)',
801                   '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
802                   '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_irt_compile_flags) ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
803                   '--gomadir', '<(gomadir)',
804                   '--defines=^(defines) >(_defines)',
805                   '--link_flags=-B>(tc_lib_dir_irt_arm) ^(gcc_irt_link_flags) ^(link_flags) >(_link_flags)',
806                   '--source-list=^(source_list_newlib_arm)',
807                 ],
808               },
809             ],
810           }],
811         ], # end target_conditions for arm newlib (nexe/nlib)
812       },
813     }], # end target_arch = arm
814     ['target_arch=="mipsel"', {
815       'target_defaults': {
816         'target_conditions': [
817           # mips newlib nexe action
818           ['nexe_target!="" and build_newlib!=0', {
819             'variables': {
820                'tool_name': 'newlib',
821                'out_newlib_mips%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_mips32.nexe',
822                'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_target_name)',
823             },
824             'actions': [
825               {
826                 'action_name': 'build newlib mips nexe',
827                 'variables': {
828                   'source_list_newlib_mips%': '^|(<(tool_name)-mips.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
829                 },
830                 'msvs_cygwin_shell': 0,
831                 'description': 'building >(out_newlib_mips)',
832                 'inputs': [
833                    '<(DEPTH)/native_client/build/build_nexe.py',
834                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
835                    '>@(extra_deps)',
836                    '>@(extra_deps_newlib_mips)',
837                    '^(source_list_newlib_mips)',
838                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep',
839                 ],
840                 'outputs': ['>(out_newlib_mips)'],
841                 'action': [
842                   'python',
843                   '<(DEPTH)/native_client/build/build_nexe.py',
844                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
845                   '>@(extra_args)',
846                   '--arch', 'mips',
847                   '--build', 'newlib_nexe',
848                   '--root', '<(DEPTH)',
849                   '--name', '>(out_newlib_mips)',
850                   '--objdir', '>(objdir_newlib_mips)',
851                   '--config-name', '<(CONFIGURATION_NAME)',
852                   '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
853                   '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
854                   '--gomadir', '<(gomadir)',
855                   '--defines=^(defines) >(_defines)',
856                   '--link_flags=-arch mips -B>(tc_lib_dir_newlib_mips) ^(link_flags) >(_link_flags)',
857                   '--source-list=^(source_list_newlib_mips)',
858                 ],
859               },
860             ],
861           }],
862           # mips newlib library action
863           ['nlib_target!="" and build_newlib!=0', {
864             'variables': {
865               'tool_name': 'newlib',
866               'out_newlib_mips%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libmips/>(nlib_target)',
867               'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_target_name)',
868             },
869             'actions': [
870               {
871                 'action_name': 'build newlib mips nlib',
872                 'variables': {
873                   'source_list_newlib_mips%': '^|(<(tool_name)-mips.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
874                 },
875                 'msvs_cygwin_shell': 0,
876                 'description': 'building >(out_newlib_mips)',
877                 'inputs': [
878                    '<(DEPTH)/native_client/build/build_nexe.py',
879                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
880                    '>@(extra_deps)',
881                    '>@(extra_deps_newlib_mips)',
882                    '^(source_list_newlib_mips)',
883                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep',
884                 ],
885                 'outputs': ['>(out_newlib_mips)'],
886                 'action': [
887                   'python',
888                   '<(DEPTH)/native_client/build/build_nexe.py',
889                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
890                   '>@(extra_args)',
891                   '--arch', 'mips',
892                   '--build', 'newlib_nlib',
893                   '--root', '<(DEPTH)',
894                   '--name', '>(out_newlib_mips)',
895                   '--objdir', '>(objdir_newlib_mips)',
896                   '--config-name', '<(CONFIGURATION_NAME)',
897                   '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
898                   '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
899                   '--gomadir', '<(gomadir)',
900                   '--defines=^(defines) >(_defines)',
901                   '--link_flags=-B>(tc_lib_dir_newlib_mips) ^(link_flags) >(_link_flags)',
902                   '--source-list=^(source_list_newlib_mips)',
903                 ],
904               },
905             ],
906           }],
907           # mips irt nexe action
908           ['nexe_target!="" and build_irt!=0', {
909             'variables': {
910                'tool_name': 'irt',
911                'out_newlib_mips%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_mips32.nexe',
912                'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_target_name)',
913             },
914             'actions': [
915               {
916                 'action_name': 'build IRT mips nexe',
917                 'variables': {
918                   'source_list_newlib_mips%': '^|(<(tool_name)-mips.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
919                 },
920                 'msvs_cygwin_shell': 0,
921                 'description': 'building >(out_newlib_mips)',
922                 'inputs': [
923                    '<(DEPTH)/native_client/build/build_nexe.py',
924                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
925                    '>@(extra_deps)',
926                    '>@(extra_deps_newlib_mips)',
927                    '^(source_list_newlib_mips)',
928                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep',
929                    '<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
930                 ],
931                 'outputs': ['>(out_newlib_mips)'],
932                 'action': [
933                   'python',
934                   '<(DEPTH)/native_client/build/build_nexe.py',
935                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
936                   '>@(extra_args)',
937                   '--arch', 'mips',
938                   '--build', 'newlib_nexe',
939                   '--root', '<(DEPTH)',
940                   '--name', '>(out_newlib_mips)',
941                   '--objdir', '>(objdir_newlib_mips)',
942                   '--config-name', '<(CONFIGURATION_NAME)',
943                   '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
944                   '--compile_flags=-stdlib=libstdc++ ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
945                   '--gomadir', '<(gomadir)',
946                   '--defines=^(defines) >(_defines)',
947                   '--link_flags=-arch mips -stdlib=libstdc++ --pnacl-allow-translate --pnacl-allow-native -Wt,-mtls-use-call --pnacl-disable-abi-check -B>(tc_lib_dir_irt_mips) ^(pnacl_irt_link_flags) ^(link_flags) >(_link_flags)',
948                   '--source-list=^(source_list_newlib_mips)',
949                   '--tls-edit=<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
950                    '--irt-layout',
951                 ],
952               },
953             ],
954           }],
955           # mips IRT library action
956           ['nlib_target!="" and build_irt!=0', {
957             'variables': {
958               'tool_name': 'irt',
959               'out_newlib_mips%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libmips/>(nlib_target)',
960               'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_target_name)',
961             },
962             'actions': [
963               {
964                 'action_name': 'build IRT mips nlib',
965                 'variables': {
966                   'source_list_newlib_mips%': '^|(<(tool_name)-mips.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
967                 },
968                 'msvs_cygwin_shell': 0,
969                 'description': 'building >(out_newlib_mips)',
970                 'inputs': [
971                    '<(DEPTH)/native_client/build/build_nexe.py',
972                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
973                    '>@(extra_deps)',
974                    '>@(extra_deps_newlib_mips)',
975                    '^(source_list_newlib_mips)',
976                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep',
977                 ],
978                 'outputs': ['>(out_newlib_mips)'],
979                 'action': [
980                   'python',
981                   '<(DEPTH)/native_client/build/build_nexe.py',
982                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
983                   '>@(extra_args)',
984                   '--arch', 'mips',
985                   '--build', 'newlib_nlib',
986                   '--root', '<(DEPTH)',
987                   '--name', '>(out_newlib_mips)',
988                   '--objdir', '>(objdir_newlib_mips)',
989                   '--config-name', '<(CONFIGURATION_NAME)',
990                   '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
991                   '--compile_flags=-stdlib=libstdc++ ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
992                   '--gomadir', '<(gomadir)',
993                   '--defines=^(defines) >(_defines)',
994                   '--link_flags=-stdlib=libstdc++ -B>(tc_lib_dir_irt_mips) ^(pnacl_irt_link_flags) ^(link_flags) >(_link_flags)',
995                   '--source-list=^(source_list_newlib_mips)',
996                 ],
997               },
998             ],
999           }],
1000         ], # end target_conditions for mips newlib
1001       },
1002     }], # end target_arch = mips
1003     ['target_arch=="ia32" or target_arch=="x64"', {
1004       'target_defaults': {
1005         # x86-64 glibc nexe action
1006         'target_conditions': [
1007            ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
1008              'variables': {
1009                 'tool_name': 'glibc',
1010                 'out_glibc64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe',
1011                 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
1012              },
1013              'actions': [
1014                {
1015                  'action_name': 'build glibc x86-64 nexe',
1016                  'variables': {
1017                    'source_list_glibc64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1018                  },
1019                  'msvs_cygwin_shell': 0,
1020                  'description': 'building >(out_glibc64)',
1021                  'inputs': [
1022                     '<(DEPTH)/native_client/build/build_nexe.py',
1023                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1024                     '>@(extra_deps)',
1025                     '>@(extra_deps_glibc64)',
1026                     '^(source_list_glibc64)',
1027                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_glibc/stamp.prep',
1028                  ],
1029                  'outputs': ['>(out_glibc64)'],
1030                  'action': [
1031                    'python',
1032                    '<(DEPTH)/native_client/build/build_nexe.py',
1033                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1034                    '>@(extra_args)',
1035                    '--arch', 'x86-64',
1036                    '--build', 'glibc_nexe',
1037                    '--root', '<(DEPTH)',
1038                    '--name', '>(out_glibc64)',
1039                    '--objdir', '>(objdir_glibc64)',
1040                    '--config-name', '<(CONFIGURATION_NAME)',
1041                    '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1042                    '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1043                    '--gomadir', '<(gomadir)',
1044                    '--defines=^(defines) >(_defines)',
1045                    '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
1046                    '--source-list=^(source_list_glibc64)',
1047                  ],
1048                },
1049              ],
1050            }],
1051            # x86-32 glibc nexe action
1052            ['nexe_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
1053              'variables': {
1054                 'tool_name': 'glibc',
1055                 'out_glibc32%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x32.nexe',
1056                 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
1057              },
1058              'actions': [
1059                {
1060                  'action_name': 'build glibc x86-32 nexe',
1061                  'variables': {
1062                    'source_list_glibc32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1063                  },
1064                  'msvs_cygwin_shell': 0,
1065                  'description': 'building >(out_glibc32)',
1066                  'inputs': [
1067                     '<(DEPTH)/native_client/build/build_nexe.py',
1068                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1069                     '>@(extra_deps)',
1070                     '>@(extra_deps_glibc32)',
1071                     '^(source_list_glibc32)',
1072                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_glibc/stamp.prep',
1073                  ],
1074                  'outputs': ['>(out_glibc32)'],
1075                  'action': [
1076                    'python',
1077                    '<(DEPTH)/native_client/build/build_nexe.py',
1078                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1079                    '>@(extra_args)',
1080                    '--arch', 'x86-32',
1081                    '--build', 'glibc_nexe',
1082                    '--root', '<(DEPTH)',
1083                    '--name', '>(out_glibc32)',
1084                    '--objdir', '>(objdir_glibc32)',
1085                    '--config-name', '<(CONFIGURATION_NAME)',
1086                    '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1087                    '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1088                    '--gomadir', '<(gomadir)',
1089                    '--defines=^(defines) >(_defines)',
1090                    '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
1091                    '--source-list=^(source_list_glibc32)',
1092                  ],
1093                },
1094              ],
1095            }],
1096            # x86-64 glibc static library action
1097            ['nlib_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
1098              'variables': {
1099                 'tool_name': 'glibc',
1100                 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
1101                 'out_glibc64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
1102              },
1103              'actions': [
1104                {
1105                  'action_name': 'build glibc x86-64 nlib',
1106                  'variables': {
1107                    'source_list_glibc64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1108                  },
1109                  'msvs_cygwin_shell': 0,
1110                  'description': 'building >(out_glibc64)',
1111                  'inputs': [
1112                     '<(DEPTH)/native_client/build/build_nexe.py',
1113                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1114                     '>@(extra_deps)',
1115                     '>@(extra_deps_glibc64)',
1116                     '^(source_list_glibc64)',
1117                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_glibc/stamp.prep',
1118                  ],
1119                  'outputs': ['>(out_glibc64)'],
1120                  'action': [
1121                    'python',
1122                    '<(DEPTH)/native_client/build/build_nexe.py',
1123                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1124                    '>@(extra_args)',
1125                    '--arch', 'x86-64',
1126                    '--build', 'glibc_nlib',
1127                    '--root', '<(DEPTH)',
1128                    '--name', '>(out_glibc64)',
1129                    '--objdir', '>(objdir_glibc64)',
1130                    '--config-name', '<(CONFIGURATION_NAME)',
1131                    '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1132                    '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1133                    '--gomadir', '<(gomadir)',
1134                    '--defines=^(defines) >(_defines)',
1135                    '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
1136                    '--source-list=^(source_list_glibc64)',
1137                  ],
1138                },
1139              ],
1140            }],
1141            # x86-32 glibc static library action
1142            ['nlib_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
1143              'variables': {
1144                 'tool_name': 'glibc',
1145                 'out_glibc32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
1146                 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
1147              },
1148              'actions': [
1149                {
1150                  'action_name': 'build glibc x86-32 nlib',
1151                  'variables': {
1152                    'source_list_glibc32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1153                  },
1154                  'msvs_cygwin_shell': 0,
1155                  'description': 'building >(out_glibc32)',
1156                  'inputs': [
1157                     '<(DEPTH)/native_client/build/build_nexe.py',
1158                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1159                     '>@(extra_deps)',
1160                     '>@(extra_deps_glibc32)',
1161                     '^(source_list_glibc32)',
1162                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_glibc/stamp.prep',
1163                  ],
1164                  'outputs': ['>(out_glibc32)'],
1165                  'action': [
1166                    'python',
1167                    '<(DEPTH)/native_client/build/build_nexe.py',
1168                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1169                    '>@(extra_args)',
1170                    '--arch', 'x86-32',
1171                    '--build', 'glibc_nlib',
1172                    '--root', '<(DEPTH)',
1173                    '--name', '>(out_glibc32)',
1174                    '--objdir', '>(objdir_glibc32)',
1175                    '--config-name', '<(CONFIGURATION_NAME)',
1176                    '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1177                    '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1178                    '--gomadir', '<(gomadir)',
1179                    '--defines=^(defines) >(_defines)',
1180                    '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
1181                    '--source-list=^(source_list_glibc32)',
1182                  ],
1183                },
1184              ],
1185            }],
1186            # x86-64 glibc shared library action
1187            ['nso_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
1188              'variables': {
1189                 'tool_name': 'glibc',
1190                 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64-so/>(_target_name)',
1191                 'out_glibc64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nso_target)',
1192              },
1193              'actions': [
1194                {
1195                  'action_name': 'build glibc x86-64 nso',
1196                  'variables': {
1197                    'source_list_glibc64%': '^|(<(tool_name)-x86-64-so.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1198                  },
1199                  'msvs_cygwin_shell': 0,
1200                  'description': 'building >(out_glibc64)',
1201                  'inputs': [
1202                     '<(DEPTH)/native_client/build/build_nexe.py',
1203                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1204                     '>@(extra_deps)',
1205                     '>@(extra_deps_glibc64)',
1206                     '^(source_list_glibc64)',
1207                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_glibc/stamp.prep',
1208                  ],
1209                  'outputs': ['>(out_glibc64)'],
1210                  'action': [
1211                    'python',
1212                    '<(DEPTH)/native_client/build/build_nexe.py',
1213                    '>@(extra_args)',
1214                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1215                    '--arch', 'x86-64',
1216                    '--build', 'glibc_nso',
1217                    '--root', '<(DEPTH)',
1218                    '--name', '>(out_glibc64)',
1219                    '--objdir', '>(objdir_glibc64)',
1220                    '--config-name', '<(CONFIGURATION_NAME)',
1221                    '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1222                    '--compile_flags=-m64 -fPIC ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1223                    '--gomadir', '<(gomadir)',
1224                    '--defines=^(defines) >(_defines)',
1225                    '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
1226                    '--source-list=^(source_list_glibc64)',
1227                  ],
1228                },
1229              ],
1230            }],
1231            # x86-32 glibc shared library action
1232            ['nso_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
1233              'variables': {
1234                 'tool_name': 'glibc',
1235                 'out_glibc32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nso_target)',
1236                 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32-so/>(_target_name)',
1237              },
1238              'actions': [
1239                {
1240                  'action_name': 'build glibc x86-32 nso',
1241                  'variables': {
1242                    'source_list_glibc32%': '^|(<(tool_name)-x86-32-so.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1243                  },
1244                  'msvs_cygwin_shell': 0,
1245                  'description': 'building >(out_glibc32)',
1246                  'inputs': [
1247                     '<(DEPTH)/native_client/build/build_nexe.py',
1248                     '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1249                     '>@(extra_deps)',
1250                     '>@(extra_deps_glibc32)',
1251                     '^(source_list_glibc32)',
1252                     '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/nacl_x86_glibc/stamp.prep',
1253                  ],
1254                  'outputs': ['>(out_glibc32)'],
1255                  'action': [
1256                    'python',
1257                    '<(DEPTH)/native_client/build/build_nexe.py',
1258                    '>@(extra_args)',
1259                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1260                    '--arch', 'x86-32',
1261                    '--build', 'glibc_nso',
1262                    '--root', '<(DEPTH)',
1263                    '--name', '>(out_glibc32)',
1264                    '--objdir', '>(objdir_glibc32)',
1265                    '--config-name', '<(CONFIGURATION_NAME)',
1266                    '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1267                    '--compile_flags=-m32 -fPIC ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1268                    '--gomadir', '<(gomadir)',
1269                    '--defines=^(defines) >(_defines)',
1270                    '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
1271                    '--source-list=^(source_list_glibc32)',
1272                  ],
1273                },
1274              ],
1275            }],
1276         ], # end target_conditions for glibc (nexe/nlib/nso, x86-32/64)
1277       },
1278     }], # end target_arch == ia32 or x64
1279   ],
1280   'target_defaults': {
1281     'gcc_compile_flags': [],
1282     'pnacl_compile_flags': [],
1283     'variables': {
1284       'disable_pnacl%': 0,
1285       'build_pnacl_newlib': 0,
1286       'pnacl_native_biased': 0,
1287       'nexe_target': '',
1288       'nlib_target': '',
1289       'extra_deps_pnacl_newlib': [],
1290       'tc_lib_dir_pnacl_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib',
1291       'tc_lib_dir_pnacl_translate' :'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate',
1292       'tc_include_dir_pnacl_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/include',
1293       'compile_flags': [
1294         '<@(nacl_default_compile_flags)',
1295       ],
1296       'gcc_compile_flags': [
1297         '-fomit-frame-pointer',
1298         # A debugger should be able to unwind IRT call frames. As the IRT is
1299         # compiled with high level of optimizations and without debug info,
1300         # compiler is requested to generate unwind tables explicitly. This
1301         # is the default behavior on x86-64 and when compiling C++ with
1302         # exceptions enabled, the change is for the benefit of x86-32 C.
1303         # These are only required for the IRT but are here for all
1304         # nacl-gcc-compiled binaries because the IRT depends on other libs
1305         '-fasynchronous-unwind-tables',
1306       ],
1307       'pnacl_compile_flags': [
1308         '-Wno-extra-semi',
1309         '-Wno-unused-private-field',
1310         '-Wno-char-subscripts',
1311         '-Wno-unused-function',
1312       ],
1313       # IRT compile/link flags to make the binary smaller.
1314       # Omitted from non-IRT libraries to keep the libraries themselves small.
1315       'gcc_irt_compile_flags': [
1316         '-ffunction-sections',
1317         '-fdata-sections',
1318       ],
1319       'gcc_irt_link_flags': [
1320         '-Wl,--gc-sections',
1321       ],
1322       'pnacl_irt_link_flags': [
1323         '-Wt,-ffunction-sections',
1324         '-Wt,-fdata-sections',
1325         '-Wn,--gc-sections',
1326       ],
1327     },
1328     'target_conditions': [
1329       # pnacl actions for building pexes and translating them
1330       ['nexe_target!="" and disable_pnacl==0 and build_pnacl_newlib!=0 '
1331        'and pnacl_native_biased==0', {
1332          'variables': {
1333            'out_pnacl_newlib_x86_32_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_x32.nexe',
1334            'out_pnacl_newlib_x86_64_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_x64.nexe',
1335            'out_pnacl_newlib_arm_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_arm.nexe',
1336            'out_pnacl_newlib_mips_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_mips32.nexe',
1337            'out_pnacl_newlib_x86_32_nonsfi_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_x32_nonsfi.nexe',
1338            'tool_name': 'pnacl_newlib',
1339            'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib',
1340            'out_pnacl_newlib%': '<(PRODUCT_DIR)/>(nexe_target)_newlib.pexe',
1341            'objdir_pnacl_newlib%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1342            'link_flags': [
1343              '-O3',
1344            ],
1345            'translate_flags': [],
1346          },
1347          'actions': [
1348            {
1349              'action_name': 'build newlib pexe',
1350              'variables': {
1351                'source_list_pnacl_newlib%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1352              },
1353              'msvs_cygwin_shell': 0,
1354              'description': 'building >(out_pnacl_newlib)',
1355              'inputs': [
1356                '<(DEPTH)/native_client/build/build_nexe.py',
1357                '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1358                '>@(extra_deps)',
1359                '>@(extra_deps_pnacl_newlib)',
1360                '^(source_list_pnacl_newlib)',
1361                '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep',
1362              ],
1363              'outputs': ['>(out_pnacl_newlib)'],
1364              'action': [
1365                'python',
1366                '<(DEPTH)/native_client/build/build_nexe.py',
1367                '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1368                '>@(extra_args)',
1369                '--arch', 'pnacl',
1370                '--build', 'newlib_pexe',
1371                '--root', '<(DEPTH)',
1372                '--name', '>(out_pnacl_newlib)',
1373                '--objdir', '>(objdir_pnacl_newlib)',
1374                '--config-name', '<(CONFIGURATION_NAME)',
1375                '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1376                '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1377                '--gomadir', '<(gomadir)',
1378                '--defines=^(defines) >(_defines)',
1379                '--link_flags=-B<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib ^(link_flags) >(_link_flags)',
1380                '--source-list=^(source_list_pnacl_newlib)',
1381              ],
1382            }],
1383          'target_conditions': [
1384            [ 'enable_x86_32!=0', {
1385              'actions': [{
1386                'action_name': 'translate newlib pexe to x86-32 nexe',
1387                'msvs_cygwin_shell': 0,
1388                'description': 'translating >(out_pnacl_newlib_x86_32_nexe)',
1389                'inputs': [
1390                  # Having this in the input somehow causes devenv warnings
1391                  # when building pnacl browser tests.
1392                  # '<(DEPTH)/native_client/build/build_nexe.py',
1393                  '>(out_pnacl_newlib)',
1394                ],
1395                'outputs': [ '>(out_pnacl_newlib_x86_32_nexe)' ],
1396                'action' : [
1397                  'python',
1398                  '<(DEPTH)/native_client/build/build_nexe.py',
1399                  '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1400                  '--arch', 'x86-32',
1401                  '--build', 'newlib_translate',
1402                  '--root', '<(DEPTH)',
1403                  '--name', '>(out_pnacl_newlib_x86_32_nexe)',
1404                  '--config-name', '<(CONFIGURATION_NAME)',
1405                  '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-x86-32',
1406                  '>(out_pnacl_newlib)',
1407                ],
1408              }],
1409            }],
1410            [ 'enable_x86_32_nonsfi!=0', {
1411              'actions': [{
1412                'action_name': 'translate newlib pexe to x86-32-nonsfi nexe',
1413                'msvs_cygwin_shell': 0,
1414                'description': 'translating >(out_pnacl_newlib_x86_32_nonsfi_nexe)',
1415                'inputs': [
1416                  # Having this in the input somehow causes devenv warnings
1417                  # when building pnacl browser tests.
1418                  # '<(DEPTH)/native_client/build/build_nexe.py',
1419                  '>(out_pnacl_newlib)',
1420                ],
1421                'outputs': [ '>(out_pnacl_newlib_x86_32_nonsfi_nexe)' ],
1422                'action' : [
1423                  'python',
1424                  '<(DEPTH)/native_client/build/build_nexe.py',
1425                  '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1426                  '--arch', 'x86-32-nonsfi',
1427                  '--build', 'newlib_translate',
1428                  '--root', '<(DEPTH)',
1429                  '--name', '>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
1430                  '--config-name', '<(CONFIGURATION_NAME)',
1431                  '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-x86-32-nonsfi',
1432                  '>(out_pnacl_newlib)',
1433                ],
1434              }],
1435            }],
1436            [ 'enable_x86_64!=0', {
1437              'actions': [{
1438                'action_name': 'translate newlib pexe to x86-64 nexe',
1439                'msvs_cygwin_shell': 0,
1440                'description': 'translating >(out_pnacl_newlib_x86_64_nexe)',
1441                'inputs': [
1442                  # Having this in the input somehow causes devenv warnings
1443                  # when building pnacl browser tests.
1444                  # '<(DEPTH)/native_client/build/build_nexe.py',
1445                  '>(out_pnacl_newlib)',
1446                ],
1447                'outputs': [ '>(out_pnacl_newlib_x86_64_nexe)' ],
1448                'action' : [
1449                  'python',
1450                  '<(DEPTH)/native_client/build/build_nexe.py',
1451                  '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1452                  '--arch', 'x86-64',
1453                  '--build', 'newlib_translate',
1454                  '--root', '<(DEPTH)',
1455                  '--name', '>(out_pnacl_newlib_x86_64_nexe)',
1456                  '--config-name', '<(CONFIGURATION_NAME)',
1457                  '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-x86-64',
1458                  '>(out_pnacl_newlib)',
1459                ],
1460              }],
1461            }],
1462            [ 'enable_arm!=0', {
1463              'actions': [{
1464                'action_name': 'translate newlib pexe to ARM nexe',
1465                'msvs_cygwin_shell': 0,
1466                'description': 'translating >(out_pnacl_newlib_arm_nexe)',
1467                'inputs': [
1468                  # Having this in the input somehow causes devenv warnings
1469                  # when building pnacl browser tests.
1470                  # '<(DEPTH)/native_client/build/build_nexe.py',
1471                  '>(out_pnacl_newlib)',
1472                ],
1473                'outputs': [ '>(out_pnacl_newlib_arm_nexe)' ],
1474                'action' : [
1475                  'python',
1476                  '<(DEPTH)/native_client/build/build_nexe.py',
1477                  '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1478                  '--arch', 'arm',
1479                  '--build', 'newlib_translate',
1480                  '--root', '<(DEPTH)',
1481                  '--name', '>(out_pnacl_newlib_arm_nexe)',
1482                  '--config-name', '<(CONFIGURATION_NAME)',
1483                  '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-arm',
1484                  '>(out_pnacl_newlib)',
1485                ],
1486              }],
1487            }],
1488            [ 'enable_mips!=0', {
1489              'actions': [{
1490                'action_name': 'translate newlib pexe to MIPS nexe',
1491                'msvs_cygwin_shell': 0,
1492                'description': 'translating >(out_pnacl_newlib_mips_nexe)',
1493                'inputs': [
1494                  # Having this in the input somehow causes devenv warnings
1495                  # when building pnacl browser tests.
1496                  # '<(DEPTH)/native_client/build/build_nexe.py',
1497                  '>(out_pnacl_newlib)',
1498                ],
1499                'outputs': [ '>(out_pnacl_newlib_mips_nexe)' ],
1500                'action' : [
1501                  'python',
1502                  '<(DEPTH)/native_client/build/build_nexe.py',
1503                  '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1504                  '--arch', 'mips',
1505                  '--build', 'newlib_translate',
1506                  '--root', '<(DEPTH)',
1507                  '--name', '>(out_pnacl_newlib_mips_nexe)',
1508                  '--config-name', '<(CONFIGURATION_NAME)',
1509                  '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-mips32',
1510                  '>(out_pnacl_newlib)',
1511                ],
1512              }],
1513            }],
1514          ],
1515        }],  # end pnacl actions for building pexes and translating to nexes
1516       # pnacl action for building portable bitcode libraries
1517       ['nlib_target!="" and disable_pnacl==0 and build_pnacl_newlib!=0'
1518        'and pnacl_native_biased==0', {
1519          'variables': {
1520            'tool_name': 'pnacl_newlib',
1521            'objdir_pnacl_newlib%': '>(INTERMEDIATE_DIR)/<(tool_name)-pnacl/>(_target_name)',
1522            'out_pnacl_newlib%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib/>(nlib_target)',
1523          },
1524          'actions': [
1525            {
1526              'action_name': 'build newlib plib',
1527              'variables': {
1528                'source_list_pnacl_newlib%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1529              },
1530              'msvs_cygwin_shell': 0,
1531              'description': 'building >(out_pnacl_newlib)',
1532              'inputs': [
1533                '<(DEPTH)/native_client/build/build_nexe.py',
1534                '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1535                '>@(extra_deps)',
1536                '>@(extra_deps_pnacl_newlib)',
1537                '^(source_list_pnacl_newlib)',
1538                '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep',
1539              ],
1540              'outputs': ['>(out_pnacl_newlib)'],
1541              'action': [
1542                'python',
1543                '<(DEPTH)/native_client/build/build_nexe.py',
1544                '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1545                '>@(extra_args)',
1546                '--arch', 'pnacl',
1547                '--build', 'newlib_plib',
1548                '--root', '<(DEPTH)',
1549                '--name', '>(out_pnacl_newlib)',
1550                '--objdir', '>(objdir_pnacl_newlib)',
1551                '--config-name', '<(CONFIGURATION_NAME)',
1552                '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1553                '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1554                '--gomadir', '<(gomadir)',
1555                '--defines=^(defines) >(_defines)',
1556                '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1557                '--source-list=^(source_list_pnacl_newlib)',
1558              ],
1559            },
1560          ],
1561        }], # end pnacl actions for bitcode libraries
1562     ], # end target conditions for pnacl pexe/plib
1563     # pnacl actions for building ABI-biased native libraries
1564     'conditions': [
1565       # ARM
1566       ['target_arch=="arm"', {
1567         'target_conditions': [
1568           ['disable_pnacl==0 and pnacl_native_biased==1 and nlib_target!="" and build_pnacl_newlib!=0', {
1569             'variables': {
1570                'tool_name': 'pnacl_newlib_arm',
1571                'out_pnacl_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
1572                'objdir_pnacl_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1573              },
1574             'actions': [
1575               {
1576                 'action_name': 'build newlib arm nlib (via pnacl)',
1577                 'variables': {
1578                   'source_list_pnacl_newlib_arm%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1579                 },
1580                 'msvs_cygwin_shell': 0,
1581                 'description': 'building >(out_pnacl_newlib_arm)',
1582                 'inputs': [
1583                   '<(DEPTH)/native_client/build/build_nexe.py',
1584                   '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1585                   '>@(extra_deps)',
1586                   '>@(extra_deps_pnacl_newlib)',
1587                   '^(source_list_pnacl_newlib_arm)',
1588                   '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep'
1589                 ],
1590                 'outputs': ['>(out_pnacl_newlib_arm)'],
1591                 'action': [
1592                   'python',
1593                   '<(DEPTH)/native_client/build/build_nexe.py',
1594                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1595                   '>@(extra_args)',
1596                   '--arch', 'arm',
1597                   '--build', 'newlib_nlib_pnacl',
1598                   '--root', '<(DEPTH)',
1599                   '--name', '>(out_pnacl_newlib_arm)',
1600                   '--objdir', '>(objdir_pnacl_newlib_arm)',
1601                   '--config-name', '<(CONFIGURATION_NAME)',
1602                   '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1603                   '--compile_flags=--target=armv7-unknown-nacl-gnueabi -mfloat-abi=hard --pnacl-allow-translate -arch arm ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1604                   '--gomadir', '<(gomadir)',
1605                   '--defines=^(defines) >(_defines)',
1606                   '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1607                   '--source-list=^(source_list_pnacl_newlib_arm)',
1608                 ],
1609               },
1610             ],
1611           }],
1612         ],
1613       }], # end ARM
1614       # ia32 or x64 (want to build both for Windows)
1615       ['target_arch=="ia32" or target_arch=="x64"', {
1616         'target_conditions': [
1617           # x64
1618           ['enable_x86_64!=0 and disable_pnacl==0 and pnacl_native_biased==1 '
1619            'and nlib_target!="" and build_pnacl_newlib!=0', {
1620              'variables': {
1621                'tool_name': 'pnacl_newlib_x86_64',
1622                'out_pnacl_newlib_x86_64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib-x86-64/>(nlib_target)',
1623                'objdir_pnacl_newlib_x86_64%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1624              },
1625              'actions': [
1626                {
1627                  'action_name': 'build newlib x86-64 nlib (via pnacl)',
1628                  'variables': {
1629                    'source_list_pnacl_newlib_x86_64%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1630                  },
1631                  'msvs_cygwin_shell': 0,
1632                  'description': 'building >(out_pnacl_newlib_x86_64)',
1633                  'inputs': [
1634                    '<(DEPTH)/native_client/build/build_nexe.py',
1635                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1636                    '>@(extra_deps)',
1637                    '>@(extra_deps_pnacl_newlib)',
1638                    '^(source_list_pnacl_newlib_x86_64)',
1639                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep'
1640                  ],
1641                  'outputs': ['>(out_pnacl_newlib_x86_64)'],
1642                  'action': [
1643                    'python',
1644                    '<(DEPTH)/native_client/build/build_nexe.py',
1645                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1646                    '>@(extra_args)',
1647                    '--arch', 'x86-64',
1648                    '--build', 'newlib_nlib_pnacl',
1649                    '--root', '<(DEPTH)',
1650                    '--name', '>(out_pnacl_newlib_x86_64)',
1651                    '--objdir', '>(objdir_pnacl_newlib_x86_64)',
1652                    '--config-name', '<(CONFIGURATION_NAME)',
1653                    '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1654                    '--compile_flags=--target=x86_64-unknown-nacl --pnacl-allow-translate -arch x86-64 ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1655                    '--gomadir', '<(gomadir)',
1656                    '--defines=^(defines) >(_defines)',
1657                    '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1658                    '--source-list=^(source_list_pnacl_newlib_x86_64)',
1659                  ],
1660                },
1661              ],
1662            }], # end x64
1663           # ia32
1664           ['enable_x86_32!=0 and disable_pnacl==0 and pnacl_native_biased==1 '
1665            'and nlib_target!="" and build_pnacl_newlib!=0', {
1666              'variables': {
1667                'tool_name': 'pnacl_newlib_x86_32',
1668                'out_pnacl_newlib_x86_32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib-x86-32/>(nlib_target)',
1669                'objdir_pnacl_newlib_x86_32%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1670              },
1671              'actions': [
1672                {
1673                  'action_name': 'build newlib x86-32 nlib (via pnacl)',
1674                  'variables': {
1675                    'source_list_pnacl_newlib_x86_32%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1676                  },
1677                  'msvs_cygwin_shell': 0,
1678                  'description': 'building >(out_pnacl_newlib_x86_32)',
1679                  'inputs': [
1680                    '<(DEPTH)/native_client/build/build_nexe.py',
1681                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1682                    '>@(extra_deps)',
1683                    '>@(extra_deps_pnacl_newlib)',
1684                    '^(source_list_pnacl_newlib_x86_32)',
1685                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep'
1686                  ],
1687                  'outputs': ['>(out_pnacl_newlib_x86_32)'],
1688                  'action': [
1689                    'python',
1690                    '<(DEPTH)/native_client/build/build_nexe.py',
1691                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1692                    '>@(extra_args)',
1693                    '--arch', 'x86-32',
1694                    '--build', 'newlib_nlib_pnacl',
1695                    '--root', '<(DEPTH)',
1696                    '--name', '>(out_pnacl_newlib_x86_32)',
1697                    '--objdir', '>(objdir_pnacl_newlib_x86_32)',
1698                    '--config-name', '<(CONFIGURATION_NAME)',
1699                    '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1700                    '--compile_flags=--target=i686-unknown-nacl --pnacl-allow-translate -arch x86-32 ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1701                    '--gomadir', '<(gomadir)',
1702                    '--defines=^(defines) >(_defines)',
1703                    '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1704                    '--source-list=^(source_list_pnacl_newlib_x86_32)',
1705                  ],
1706                },
1707              ],
1708            }], # end ia32
1709           # Non-SFI mode for ia32.
1710           ['enable_x86_32_nonsfi!=0 and disable_pnacl==0 and '
1711            'pnacl_native_biased==1 and nlib_target!="" and '
1712            'build_pnacl_newlib!=0', {
1713              'variables': {
1714                'tool_name': 'pnacl_newlib_x86_32',
1715                # TODO(hidehiko): replace with (tc_lib_dir_pnacl_translate)/
1716                # lib-x86-32-nonsfi/>(nlib_target) to be more consistent with
1717                # similar configs.
1718                'out_pnacl_newlib_x86_32_nonsfi%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib-x86-32-nonsfi/>(nlib_target)',
1719                'objdir_pnacl_newlib_x86_32_nonsfi%': '>(INTERMEDIATE_DIR)/<(tool_name)-nonsfi/>(_target_name)',
1720              },
1721              'actions': [
1722                {
1723                  'action_name': 'build newlib x86-32-nonsfi nlib (via pnacl)',
1724                  'variables': {
1725                    'source_list_pnacl_newlib_x86_32_nonsfi%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1726                  },
1727                  'msvs_cygwin_shell': 0,
1728                  'description': 'building >(out_pnacl_newlib_x86_32_nonsfi)',
1729                  'inputs': [
1730                    '<(DEPTH)/native_client/build/build_nexe.py',
1731                    '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1732                    '>@(extra_deps)',
1733                    '>@(extra_deps_pnacl_newlib)',
1734                    '^(source_list_pnacl_newlib_x86_32_nonsfi)',
1735                    '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep'
1736                  ],
1737                  'outputs': ['>(out_pnacl_newlib_x86_32_nonsfi)'],
1738                  'action': [
1739                    'python',
1740                    '<(DEPTH)/native_client/build/build_nexe.py',
1741                    '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1742                    '>@(extra_args)',
1743                    '--arch', 'x86-32-nonsfi',
1744                    '--build', 'newlib_nlib_pnacl',
1745                    '--root', '<(DEPTH)',
1746                    '--name', '>(out_pnacl_newlib_x86_32_nonsfi)',
1747                    '--objdir', '>(objdir_pnacl_newlib_x86_32_nonsfi)',
1748                    '--config-name', '<(CONFIGURATION_NAME)',
1749                    '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1750                    '--compile_flags=--target=i686-unknown-nacl --pnacl-allow-native --pnacl-allow-translate -arch x86-32-nonsfi ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1751                    '--gomadir', '<(gomadir)',
1752                    '--defines=^(defines) >(_defines)',
1753                    '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1754                    '--source-list=^(source_list_pnacl_newlib_x86_32_nonsfi)',
1755                  ],
1756                },
1757              ],
1758            }], # end ia32 Non-SFI mode.
1759         ], # end ia32 or x64
1760       }],
1761       # MIPS
1762       # The shim is not biased since the IRT itself is not biased.
1763       ['target_arch=="mipsel"', {
1764         'target_conditions': [
1765           ['disable_pnacl==0 and pnacl_native_biased==1 and nlib_target!="" and build_pnacl_newlib!=0', {
1766             'variables': {
1767                'tool_name': 'pnacl_newlib_mips',
1768                'out_pnacl_newlib_mips%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libmips/>(nlib_target)',
1769                'objdir_pnacl_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1770              },
1771             'actions': [
1772               {
1773                 'action_name': 'build newlib mips nlib (via pnacl)',
1774                 'variables': {
1775                   'source_list_pnacl_newlib_mips%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1776                 },
1777                 'msvs_cygwin_shell': 0,
1778                 'description': 'building >(out_pnacl_newlib_mips)',
1779                 'inputs': [
1780                   '<(DEPTH)/native_client/build/build_nexe.py',
1781                   '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1782                   '>@(extra_deps)',
1783                   '>@(extra_deps_pnacl_newlib)',
1784                   '^(source_list_pnacl_newlib_mips)',
1785                   '<(SHARED_INTERMEDIATE_DIR)/sdk/<(TOOLCHAIN_OS)_x86/pnacl_newlib/stamp.prep'
1786                 ],
1787                 'outputs': ['>(out_pnacl_newlib_mips)'],
1788                 'action': [
1789                   'python',
1790                   '<(DEPTH)/native_client/build/build_nexe.py',
1791                   '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/',
1792                   '>@(extra_args)',
1793                   '--arch', 'mips',
1794                   '--build', 'newlib_nlib_pnacl',
1795                   '--root', '<(DEPTH)',
1796                   '--name', '>(out_pnacl_newlib_mips)',
1797                   '--objdir', '>(objdir_pnacl_newlib_mips)',
1798                   '--config-name', '<(CONFIGURATION_NAME)',
1799                   '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1800                   '--compile_flags=--pnacl-allow-translate -arch mips ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1801                   '--gomadir', '<(gomadir)',
1802                   '--defines=^(defines) >(_defines)',
1803                   '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1804                   '--source-list=^(source_list_pnacl_newlib_mips)',
1805                 ],
1806               },
1807             ],
1808           }],
1809         ],
1810       }], # end MIPS
1811       # end pnacl actions for building ABI-biased native libraries
1812     ], # end conditions for pnacl biased nlib
1813   },
1814 }