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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 print "Unknown mode %s" % mode | 101 print "Unknown mode %s" % mode |
102 return False | 102 return False |
103 for arch in options.arch: | 103 for arch in options.arch: |
104 archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv5te', 'armv5te', 'simmips', | 104 archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv5te', 'armv5te', 'simmips', |
105 'mips', 'simarm64', 'arm64',] | 105 'mips', 'simarm64', 'arm64',] |
106 if not arch in archs: | 106 if not arch in archs: |
107 print "Unknown arch %s" % arch | 107 print "Unknown arch %s" % arch |
108 return False | 108 return False |
109 options.os = [ProcessOsOption(os_name) for os_name in options.os] | 109 options.os = [ProcessOsOption(os_name) for os_name in options.os] |
110 for os_name in options.os: | 110 for os_name in options.os: |
111 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: | 111 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'openbsd', |
| 112 'win32']: |
112 print "Unknown os %s" % os_name | 113 print "Unknown os %s" % os_name |
113 return False | 114 return False |
114 if os_name != HOST_OS: | 115 if os_name != HOST_OS: |
115 if os_name != 'android': | 116 if os_name != 'android': |
116 print "Unsupported target os %s" % os_name | 117 print "Unsupported target os %s" % os_name |
117 return False | 118 return False |
118 if not HOST_OS in ['linux']: | 119 if not HOST_OS in ['linux']: |
119 print ("Cross-compilation to %s is not supported on host os %s." | 120 print ("Cross-compilation to %s is not supported on host os %s." |
120 % (os_name, HOST_OS)) | 121 % (os_name, HOST_OS)) |
121 return False | 122 return False |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 else: | 424 else: |
424 args = [options.devenv + os.sep + options.executable, | 425 args = [options.devenv + os.sep + options.executable, |
425 '/build', | 426 '/build', |
426 config_name, | 427 config_name, |
427 '/project', | 428 '/project', |
428 target, | 429 target, |
429 project_file | 430 project_file |
430 ] | 431 ] |
431 else: | 432 else: |
432 make = 'make' | 433 make = 'make' |
433 if HOST_OS == 'freebsd': | 434 if HOST_OS in ('freebsd', 'openbsd'): |
434 make = 'gmake' | 435 make = 'gmake' |
435 # work around lack of flock | 436 # work around lack of flock |
436 os.environ['LINK'] = '$(CXX)' | 437 os.environ['LINK'] = '$(CXX)' |
437 args = [make, | 438 args = [make, |
438 '-j', | 439 '-j', |
439 options.j, | 440 options.j, |
440 'BUILDTYPE=' + build_config, | 441 'BUILDTYPE=' + build_config, |
441 ] | 442 ] |
442 if target_os != HOST_OS: | 443 if target_os != HOST_OS: |
443 args += ['builddir_name=' + utils.GetBuildDir(HOST_OS)] | 444 args += ['builddir_name=' + utils.GetBuildDir(HOST_OS)] |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 else: | 551 else: |
551 if BuildOneConfig(options, target, target_os, | 552 if BuildOneConfig(options, target, target_os, |
552 mode, arch, cross_build) != 0: | 553 mode, arch, cross_build) != 0: |
553 return 1 | 554 return 1 |
554 | 555 |
555 return 0 | 556 return 0 |
556 | 557 |
557 | 558 |
558 if __name__ == '__main__': | 559 if __name__ == '__main__': |
559 sys.exit(Main()) | 560 sys.exit(Main()) |
OLD | NEW |