OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
7 # See native_client/Sconstruct for more details. | 7 # See native_client/Sconstruct for more details. |
8 # Expected address for beginning of data in for the IRT. | 8 # Expected address for beginning of data in for the IRT. |
9 'NACL_IRT_DATA_START': '0x3ef00000', | 9 'NACL_IRT_DATA_START': '0x3ef00000', |
10 # Expected address for beginning of code in for the IRT. | 10 # Expected address for beginning of code in for the IRT. |
11 'NACL_IRT_TEXT_START': '0x0fc00000', | 11 'NACL_IRT_TEXT_START': '0x0fc00000', |
| 12 # Default C compiler defines. |
| 13 'default_defines': [ |
| 14 '-D__linux__', |
| 15 '-D__STDC_LIMIT_MACROS=1', |
| 16 '-D__STDC_FORMAT_MACROS=1', |
| 17 '-D_GNU_SOURCE=1', |
| 18 '-D_BSD_SOURCE=1', |
| 19 '-D_POSIX_C_SOURCE=199506', |
| 20 '-D_XOPEN_SOURCE=600', |
| 21 '-DDYNAMIC_ANNOTATIONS_ENABLED=1', |
| 22 '-DDYNAMIC_ANNOTATIONS_PREFIX=NACL_', |
| 23 ], |
| 24 'default_compile_flags': [ |
| 25 #'-std=gnu99', Added by build_nexe |
| 26 '-O3', |
| 27 ], |
12 }, | 28 }, |
13 'conditions': [ | 29 'conditions': [ |
14 # NOTE: we do not support untrusted gyp build on arm yet. | |
15 ['target_arch!="arm"', { | 30 ['target_arch!="arm"', { |
16 'target_defaults': { | 31 'target_defaults': { |
17 'conditions': [ | 32 'conditions': [ |
18 ['OS=="win"', { | 33 ['OS=="win"', { |
19 'variables': { | 34 'variables': { |
20 'python_exe': 'call <(DEPTH)/native_client/tools/win_py.cmd', | 35 'python_exe': 'call <(DEPTH)/native_client/tools/win_py.cmd', |
21 }, | 36 }, |
22 }, { | 37 }, { |
23 'variables': { | 38 'variables': { |
24 'python_exe': 'python', | 39 'python_exe': 'python', |
25 }, | 40 }, |
26 }], | 41 }], |
27 ], | 42 ], |
28 'variables': { | 43 'variables': { |
29 'nexe_target': '', | 44 'nexe_target': '', |
30 'nlib_target': '', | 45 'nlib_target': '', |
31 'build_newlib': 0, | 46 'build_newlib': 0, |
32 'build_glibc': 0, | 47 'build_glibc': 0, |
33 'disable_glibc%': 1, | 48 'disable_glibc%': 1, |
34 'extra_args': [], | 49 'extra_args': [], |
35 'enable_x86_32': 1, | 50 'enable_x86_32': 1, |
36 'enable_x86_64': 1, | 51 'enable_x86_64': 1, |
37 'extra_deps64': [], | 52 'extra_deps64': [], |
38 'extra_deps32': [], | 53 'extra_deps32': [], |
39 'lib_dirs': [], | 54 'lib_dirs': [], |
40 'include_dirs': ['<(DEPTH)','<(DEPTH)/ppapi'], | 55 'include_dirs': ['<(DEPTH)','<(DEPTH)/ppapi'], |
41 'defines': [ | 56 'defines': [ |
| 57 '<@(default_defines)', |
42 '-DNACL_BUILD_ARCH=x86', | 58 '-DNACL_BUILD_ARCH=x86', |
43 '-D__linux__', | |
44 '-D__STDC_LIMIT_MACROS=1', | |
45 '-D__STDC_FORMAT_MACROS=1', | |
46 '-D_GNU_SOURCE=1', | |
47 '-D_BSD_SOURCE=1', | |
48 '-D_POSIX_C_SOURCE=199506', | |
49 '-D_XOPEN_SOURCE=600', | |
50 '-DDYNAMIC_ANNOTATIONS_ENABLED=1', | |
51 '-DDYNAMIC_ANNOTATIONS_PREFIX=NACL_', | |
52 ], | 59 ], |
53 'compile_flags': [ | 60 'compile_flags': [ |
54 #'-std=gnu99', Added by build_nexe | 61 '<@(default_compile_flags)', |
55 '-O3', | |
56 '-fomit-frame-pointer', | 62 '-fomit-frame-pointer', |
57 '-mtls-use-call' | 63 '-mtls-use-call' |
58 ], | 64 ], |
59 'link_flags': [], | 65 'link_flags': [], |
60 'get_sources': [ | 66 'get_sources': [ |
61 '>(python_exe)', '<(DEPTH)/native_client/build/scan_sources.py', | 67 '>(python_exe)', '<(DEPTH)/native_client/build/scan_sources.py', |
62 # This is needed to open the .c filenames, which are given | 68 # This is needed to open the .c filenames, which are given |
63 # relative to the .gyp file. | 69 # relative to the .gyp file. |
64 '-I.', | 70 '-I.', |
65 # This is needed to open the .h filenames, which are given | 71 # This is needed to open the .h filenames, which are given |
66 # relative to the native_client directory's parent. | 72 # relative to the native_client directory's parent. |
67 '-I<(DEPTH)', | 73 '-I<(DEPTH)', |
68 ], | 74 ], |
69 }, | 75 }, |
70 }, | 76 }, |
| 77 }, { |
| 78 # ARM case |
| 79 'target_defaults': { |
| 80 'variables': { |
| 81 'python_exe': 'python', |
| 82 'nexe_target': '', |
| 83 'nlib_target': '', |
| 84 'build_newlib': 0, |
| 85 'build_glibc': 0, |
| 86 'disable_glibc%': 1, |
| 87 'extra_args': [], |
| 88 'enable_arm': 1, |
| 89 'extra_deps_arm': [], |
| 90 'lib_dirs': [], |
| 91 'include_dirs': ['<(DEPTH)','<(DEPTH)/ppapi'], |
| 92 'defines': [ |
| 93 '<@(default_defines)', |
| 94 '-DNACL_BUILD_ARCH=arm', |
| 95 ], |
| 96 'compile_flags': [ |
| 97 '<@(default_compile_flags)', |
| 98 ], |
| 99 'link_flags': [], |
| 100 'get_sources': [ |
| 101 '>(python_exe)', '<(DEPTH)/native_client/build/scan_sources.py', |
| 102 # This is needed to open the .c filenames, which are given |
| 103 # relative to the .gyp file. |
| 104 '-I.', |
| 105 # This is needed to open the .h filenames, which are given |
| 106 # relative to the native_client directory's parent. |
| 107 '-I<(DEPTH)', |
| 108 ], |
| 109 }, |
| 110 }, |
71 }], | 111 }], |
72 ['target_arch=="x64" or OS=="win"', { | 112 ['target_arch=="x64" or OS=="win"', { |
73 'target_defaults': { | 113 'target_defaults': { |
74 'target_conditions': [ | 114 'target_conditions': [ |
75 ['nexe_target!="" and build_newlib!=0 and enable_x86_64!=0', { | 115 ['nexe_target!="" and build_newlib!=0 and enable_x86_64!=0', { |
76 'variables': { | 116 'variables': { |
77 'tool_name': 'newlib', | 117 'tool_name': 'newlib', |
78 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib', | 118 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib', |
79 'out64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe', | 119 'out64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe', |
80 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-x86-64/>(_target_na
me)', | 120 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-x86-64/>(_target_na
me)', |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 'action': [ | 222 'action': [ |
183 '>(python_exe)', | 223 '>(python_exe)', |
184 '<(DEPTH)/native_client/build/build_nexe.py', | 224 '<(DEPTH)/native_client/build/build_nexe.py', |
185 '>@(extra_args)', | 225 '>@(extra_args)', |
186 '--arch', 'x86-32', | 226 '--arch', 'x86-32', |
187 '--build', 'newlib_nexe', | 227 '--build', 'newlib_nexe', |
188 '--root', '<(DEPTH)', | 228 '--root', '<(DEPTH)', |
189 '--name', '>(out32)', | 229 '--name', '>(out32)', |
190 '--objdir', '>(objdir)', | 230 '--objdir', '>(objdir)', |
191 '--include-dirs', '>(inst_dir)/include >(include_dirs) >(incl
ude_dirs)', | 231 '--include-dirs', '>(inst_dir)/include >(include_dirs) >(incl
ude_dirs)', |
192 '--lib-dirs', '>(lib_dirs) ', | 232 '--lib-dirs', '>(lib_dirs)', |
193 '--compile_flags', '-m32 >@(compile_flags)', | 233 '--compile_flags', '-m32 >@(compile_flags)', |
194 '>@(defines)', '-DNACL_BUILD_SUBARCH=32', | 234 '>@(defines)', '-DNACL_BUILD_SUBARCH=32', |
195 '--link_flags', '-m32 -B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/
lib32 >(link_flags)', | 235 '--link_flags', '-m32 -B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/
lib32 >(link_flags)', |
196 '>@(sources)', | 236 '>@(sources)', |
197 ], | 237 ], |
198 }, | 238 }, |
199 ], | 239 ], |
200 }], | 240 }], |
201 ], | 241 ], |
202 }, | 242 }, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 '>@(defines)', '-DNACL_BUILD_SUBARCH=32', | 278 '>@(defines)', '-DNACL_BUILD_SUBARCH=32', |
239 '--link_flags', '-m32 -B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/
lib32 >(link_flags)', | 279 '--link_flags', '-m32 -B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/
lib32 >(link_flags)', |
240 '>@(sources)', | 280 '>@(sources)', |
241 ], | 281 ], |
242 }, | 282 }, |
243 ], | 283 ], |
244 }], | 284 }], |
245 ], | 285 ], |
246 }, | 286 }, |
247 }], | 287 }], |
| 288 ['target_arch=="arm"', { |
| 289 'target_defaults': { |
| 290 'target_conditions': [ |
| 291 ['nexe_target!="" and build_newlib!=0', { |
| 292 'variables': { |
| 293 'tool_name': 'newlib', |
| 294 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib', |
| 295 'out_arm%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_arm.nexe', |
| 296 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-arm/>(_target_name)', |
| 297 }, |
| 298 'actions': [ |
| 299 { |
| 300 'action_name': 'build newlib arm nexe', |
| 301 'msvs_cygwin_shell': 0, |
| 302 'description': 'building >(out_arm)', |
| 303 'inputs': [ |
| 304 '<(DEPTH)/native_client/build/build_nexe.py', |
| 305 '<(DEPTH)/ppapi/ppapi_cpp.gypi', |
| 306 '>!@(>(get_sources) >(sources))', |
| 307 '>@(extra_deps_arm)', |
| 308 ], |
| 309 'outputs': ['>(out_arm)'], |
| 310 'action': [ |
| 311 '>(python_exe)', |
| 312 '<(DEPTH)/native_client/build/build_nexe.py', |
| 313 '>@(extra_args)', |
| 314 '--arch', 'arm', |
| 315 '--build', 'newlib_nexe', |
| 316 '--root', '<(DEPTH)', |
| 317 '--name', '>(out_arm)', |
| 318 '--objdir', '>(objdir)', |
| 319 '--include-dirs', '>(inst_dir)/include >(include_dirs) >(inclu
de_dirs)', |
| 320 '--lib-dirs', '>(lib_dirs) ', |
| 321 '--compile_flags', '>@(compile_flags)', |
| 322 '>@(defines)', '-DNACL_BUILD_SUBARCH=32', |
| 323 '--link_flags', '-B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32
>(link_flags)', |
| 324 '>@(sources)', |
| 325 ], |
| 326 }, |
| 327 ], |
| 328 }], |
| 329 ], |
| 330 }, |
| 331 }], |
| 332 ['target_arch=="arm"', { |
| 333 'target_defaults': { |
| 334 'target_conditions': [ |
| 335 ['nlib_target!="" and build_newlib!=0', { |
| 336 'variables': { |
| 337 'tool_name': 'newlib', |
| 338 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib', |
| 339 'out_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(n
lib_target)', |
| 340 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-arm/>(_target_name)', |
| 341 }, |
| 342 'actions': [ |
| 343 { |
| 344 'action_name': 'build newlib arm nlib', |
| 345 'msvs_cygwin_shell': 0, |
| 346 'description': 'building >(out_arm)', |
| 347 'inputs': [ |
| 348 '<(DEPTH)/native_client/build/build_nexe.py', |
| 349 '<(DEPTH)/ppapi/ppapi_cpp.gypi', |
| 350 '>!@(>(get_sources) >(sources))', |
| 351 '>@(extra_deps_arm)', |
| 352 ], |
| 353 'outputs': ['>(out_arm)'], |
| 354 'action': [ |
| 355 '>(python_exe)', |
| 356 '<(DEPTH)/native_client/build/build_nexe.py', |
| 357 '>@(extra_args)', |
| 358 '--arch', 'arm', |
| 359 '--build', 'newlib_nlib', |
| 360 '--root', '<(DEPTH)', |
| 361 '--name', '>(out_arm)', |
| 362 '--objdir', '>(objdir)', |
| 363 '--include-dirs', '>(inst_dir)/include >(include_dirs) >(inclu
de_dirs)', |
| 364 '--lib-dirs', '>(lib_dirs) ', |
| 365 '--compile_flags', '>@(compile_flags)', |
| 366 '>@(defines)', '-DNACL_BUILD_SUBARCH=32', |
| 367 '--link_flags', '-B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm
>(link_flags)', |
| 368 '>@(sources)', |
| 369 ], |
| 370 }, |
| 371 ], |
| 372 }], |
| 373 ], |
| 374 }, |
| 375 }], |
248 ['target_arch=="x64" or OS=="win"', { | 376 ['target_arch=="x64" or OS=="win"', { |
249 'target_defaults': { | 377 'target_defaults': { |
250 'target_conditions': [ | 378 'target_conditions': [ |
251 ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable
_glibc==0', { | 379 ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable
_glibc==0', { |
252 'variables': { | 380 'variables': { |
253 'tool_name': 'glibc', | 381 'tool_name': 'glibc', |
254 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc', | 382 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc', |
255 'out64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe', | 383 'out64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe', |
256 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-x86-64/>(_target_na
me)', | 384 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-x86-64/>(_target_na
me)', |
257 }, | 385 }, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 '>@(sources)', | 544 '>@(sources)', |
417 ], | 545 ], |
418 }, | 546 }, |
419 ], | 547 ], |
420 }], | 548 }], |
421 ], | 549 ], |
422 }, | 550 }, |
423 }], | 551 }], |
424 ], | 552 ], |
425 } | 553 } |
OLD | NEW |