OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Entry point for both build and try bots. | 6 """Entry point for both build and try bots. |
7 | 7 |
8 This script is invoked from XXX, usually without arguments | 8 This script is invoked from XXX, usually without arguments |
9 to package an SDK. It automatically determines whether | 9 to package an SDK. It automatically determines whether |
10 this SDK is for mac, win, linux. | 10 this SDK is for mac, win, linux. |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 452 |
453 | 453 |
454 def GypNinjaBuild_PPAPI(arch, rel_out_dir): | 454 def GypNinjaBuild_PPAPI(arch, rel_out_dir): |
455 gyp_py = os.path.join(SRC_DIR, 'build', 'gyp_chromium') | 455 gyp_py = os.path.join(SRC_DIR, 'build', 'gyp_chromium') |
456 out_dir = MakeNinjaRelPath(rel_out_dir) | 456 out_dir = MakeNinjaRelPath(rel_out_dir) |
457 gyp_file = os.path.join(SRC_DIR, 'ppapi', 'native_client', | 457 gyp_file = os.path.join(SRC_DIR, 'ppapi', 'native_client', |
458 'native_client.gyp') | 458 'native_client.gyp') |
459 GypNinjaBuild(arch, gyp_py, gyp_file, 'ppapi_lib', out_dir) | 459 GypNinjaBuild(arch, gyp_py, gyp_file, 'ppapi_lib', out_dir) |
460 | 460 |
461 | 461 |
462 def GypNinjaBuild_Pnacl(rel_out_dir, target_arch): | 462 def GypNinjaBuild_Pnacl(arch, rel_out_dir): |
463 # TODO(binji): This will build the pnacl_irt_shim twice; once as part of the | 463 # TODO(binji): This will build the pnacl_irt_shim twice; once as part of the |
464 # Chromium build, and once here. When we move more of the SDK build process | 464 # Chromium build, and once here. When we move more of the SDK build process |
465 # to gyp, we can remove this. | 465 # to gyp, we can remove this. |
466 gyp_py = os.path.join(SRC_DIR, 'build', 'gyp_chromium') | 466 gyp_py = os.path.join(SRC_DIR, 'build', 'gyp_chromium') |
467 | 467 |
468 out_dir = MakeNinjaRelPath(rel_out_dir) | 468 out_dir = MakeNinjaRelPath(rel_out_dir) |
469 gyp_file = os.path.join(SRC_DIR, 'ppapi', 'native_client', 'src', | 469 gyp_file = os.path.join(SRC_DIR, 'ppapi', 'native_client', 'src', |
470 'untrusted', 'pnacl_irt_shim', 'pnacl_irt_shim.gyp') | 470 'untrusted', 'pnacl_irt_shim', 'pnacl_irt_shim.gyp') |
471 targets = ['aot'] | 471 GypNinjaBuild(arch, gyp_py, gyp_file, 'aot', out_dir) |
472 GypNinjaBuild(target_arch, gyp_py, gyp_file, targets, out_dir) | |
473 | 472 |
474 | 473 |
475 def GypNinjaBuild(arch, gyp_py_script, gyp_file, targets, out_dir): | 474 def GypNinjaBuild(arch, gyp_py_script, gyp_file, targets, out_dir): |
476 gyp_env = dict(os.environ) | 475 gyp_env = dict(os.environ) |
477 gyp_env['GYP_GENERATORS'] = 'ninja' | 476 gyp_defines = [] |
478 gyp_defines = ['nacl_allow_thin_archives=0', 'use_nacl_clang=1'] | |
479 if options.mac_sdk: | 477 if options.mac_sdk: |
480 gyp_defines.append('mac_sdk=%s' % options.mac_sdk) | 478 gyp_defines.append('mac_sdk=%s' % options.mac_sdk) |
481 | 479 |
482 if arch is not None: | 480 if arch is not None: |
483 gyp_defines.append('target_arch=%s' % arch) | 481 gyp_defines.append('target_arch=%s' % arch) |
484 if arch == 'arm': | 482 if arch == 'arm': |
485 gyp_env['GYP_CROSSCOMPILE'] = '1' | 483 gyp_env['GYP_CROSSCOMPILE'] = '1' |
486 if options.no_arm_trusted: | 484 if options.no_arm_trusted: |
487 gyp_defines.append('disable_cross_trusted=1') | 485 gyp_defines.append('disable_cross_trusted=1') |
488 | 486 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 GypNinjaBuild_PPAPI('x64', GYPBUILD_DIR + '-x64') | 526 GypNinjaBuild_PPAPI('x64', GYPBUILD_DIR + '-x64') |
529 | 527 |
530 if 'arm_glibc' in toolchains or 'pnacl' in toolchains: | 528 if 'arm_glibc' in toolchains or 'pnacl' in toolchains: |
531 GypNinjaBuild_PPAPI('arm', GYPBUILD_DIR + '-arm') | 529 GypNinjaBuild_PPAPI('arm', GYPBUILD_DIR + '-arm') |
532 | 530 |
533 if 'pnacl' in toolchains: | 531 if 'pnacl' in toolchains: |
534 # NOTE: For ia32, gyp builds both x86-32 and x86-64 by default. | 532 # NOTE: For ia32, gyp builds both x86-32 and x86-64 by default. |
535 for arch in ('ia32', 'arm'): | 533 for arch in ('ia32', 'arm'): |
536 # Fill in the latest native pnacl shim library from the chrome build. | 534 # Fill in the latest native pnacl shim library from the chrome build. |
537 build_dir = GYPBUILD_DIR + '-pnacl-' + arch | 535 build_dir = GYPBUILD_DIR + '-pnacl-' + arch |
538 GypNinjaBuild_Pnacl(build_dir, arch) | 536 GypNinjaBuild_Pnacl(arch, build_dir) |
539 | 537 |
540 GypNinjaInstall(pepperdir, toolchains) | 538 GypNinjaInstall(pepperdir, toolchains) |
541 | 539 |
542 for toolchain in toolchains: | 540 for toolchain in toolchains: |
543 if toolchain not in ('host', 'clang-newlib'): | 541 if toolchain not in ('host', 'clang-newlib'): |
544 InstallNaClHeaders(GetToolchainNaClInclude(pepperdir, toolchain), | 542 InstallNaClHeaders(GetToolchainNaClInclude(pepperdir, toolchain), |
545 toolchain) | 543 toolchain) |
546 | 544 |
547 | 545 |
548 if 'pnacl' in toolchains: | 546 if 'pnacl' in toolchains: |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 BuildStepArchivePNaClComponent(chrome_revision) | 952 BuildStepArchivePNaClComponent(chrome_revision) |
955 | 953 |
956 return 0 | 954 return 0 |
957 | 955 |
958 | 956 |
959 if __name__ == '__main__': | 957 if __name__ == '__main__': |
960 try: | 958 try: |
961 sys.exit(main(sys.argv[1:])) | 959 sys.exit(main(sys.argv[1:])) |
962 except KeyboardInterrupt: | 960 except KeyboardInterrupt: |
963 buildbot_common.ErrorExit('build_sdk: interrupted') | 961 buildbot_common.ErrorExit('build_sdk: interrupted') |
OLD | NEW |