OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 import optparse | 8 import optparse |
9 import os | 9 import os |
10 import re | 10 import re |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 metavar=HOST_CPUS, | 70 metavar=HOST_CPUS, |
71 default=str(HOST_CPUS)) | 71 default=str(HOST_CPUS)) |
72 (vs_directory, vs_executable) = utils.GuessVisualStudioPath() | 72 (vs_directory, vs_executable) = utils.GuessVisualStudioPath() |
73 result.add_option("--devenv", | 73 result.add_option("--devenv", |
74 help='Path containing devenv.com on Windows', | 74 help='Path containing devenv.com on Windows', |
75 default=vs_directory) | 75 default=vs_directory) |
76 result.add_option("--executable", | 76 result.add_option("--executable", |
77 help='Name of the devenv.com/msbuild executable on Windows (varies for ' | 77 help='Name of the devenv.com/msbuild executable on Windows (varies for ' |
78 'different versions of Visual Studio)', | 78 'different versions of Visual Studio)', |
79 default=vs_executable) | 79 default=vs_executable) |
80 result.add_option("--use-bootstrap-for-observatory", | |
81 help='Use a stripped down Dart binary built on the host machine ' | |
82 'for building Observatory. Necessary on Linux machines which have ' | |
83 'libc incompatibilities with the prebuilt Dart binaries.', | |
84 default=False, action="store_true") | |
85 return result | 80 return result |
86 | 81 |
87 | 82 |
88 def ProcessOsOption(os_name): | 83 def ProcessOsOption(os_name): |
89 if os_name == 'host': | 84 if os_name == 'host': |
90 return HOST_OS | 85 return HOST_OS |
91 return os_name | 86 return os_name |
92 | 87 |
93 | 88 |
94 def ProcessOptions(options, args): | 89 def ProcessOptions(options, args): |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 if command: | 379 if command: |
385 # Ignore return code, if this command fails, it doesn't matter. | 380 # Ignore return code, if this command fails, it doesn't matter. |
386 os.system(command) | 381 os.system(command) |
387 | 382 |
388 | 383 |
389 filter_xcodebuild_output = False | 384 filter_xcodebuild_output = False |
390 def BuildOneConfig(options, target, target_os, mode, arch, override_tools): | 385 def BuildOneConfig(options, target, target_os, mode, arch, override_tools): |
391 global filter_xcodebuild_output | 386 global filter_xcodebuild_output |
392 start_time = time.time() | 387 start_time = time.time() |
393 os.environ['DART_BUILD_MODE'] = mode | 388 os.environ['DART_BUILD_MODE'] = mode |
394 if options.use_bootstrap_for_observatory != False: | |
395 os.environ['DART_USE_BOOTSTRAP_BIN'] = '1' | |
396 build_config = utils.GetBuildConf(mode, arch, target_os) | 389 build_config = utils.GetBuildConf(mode, arch, target_os) |
397 if HOST_OS == 'macos': | 390 if HOST_OS == 'macos': |
398 filter_xcodebuild_output = True | 391 filter_xcodebuild_output = True |
399 project_file = 'dart.xcodeproj' | 392 project_file = 'dart.xcodeproj' |
400 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): | 393 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): |
401 project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName() | 394 project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName() |
402 args = ['xcodebuild', | 395 args = ['xcodebuild', |
403 '-project', | 396 '-project', |
404 project_file, | 397 project_file, |
405 '-target', | 398 '-target', |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 else: | 550 else: |
558 if BuildOneConfig(options, target, target_os, | 551 if BuildOneConfig(options, target, target_os, |
559 mode, arch, cross_build) != 0: | 552 mode, arch, cross_build) != 0: |
560 return 1 | 553 return 1 |
561 | 554 |
562 return 0 | 555 return 0 |
563 | 556 |
564 | 557 |
565 if __name__ == '__main__': | 558 if __name__ == '__main__': |
566 sys.exit(Main()) | 559 sys.exit(Main()) |
OLD | NEW |