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 26 matching lines...) Expand all Loading... |
37 result = optparse.OptionParser() | 37 result = optparse.OptionParser() |
38 result.add_option("-m", "--mode", | 38 result.add_option("-m", "--mode", |
39 help='Build variants (comma-separated).', | 39 help='Build variants (comma-separated).', |
40 metavar='[all,debug,release]', | 40 metavar='[all,debug,release]', |
41 default='debug') | 41 default='debug') |
42 result.add_option("-v", "--verbose", | 42 result.add_option("-v", "--verbose", |
43 help='Verbose output.', | 43 help='Verbose output.', |
44 default=False, action="store_true") | 44 default=False, action="store_true") |
45 result.add_option("-a", "--arch", | 45 result.add_option("-a", "--arch", |
46 help='Target architectures (comma-separated).', | 46 help='Target architectures (comma-separated).', |
47 metavar='[all,ia32,x64,simarm,arm,simmips,mips]', | 47 metavar='[all,ia32,x64,simarm,arm,simmips,mips,simarm64]', |
48 default=utils.GuessArchitecture()) | 48 default=utils.GuessArchitecture()) |
49 result.add_option("--os", | 49 result.add_option("--os", |
50 help='Target OSs (comma-separated).', | 50 help='Target OSs (comma-separated).', |
51 metavar='[all,host,android]', | 51 metavar='[all,host,android]', |
52 default='host') | 52 default='host') |
53 result.add_option("-t", "--toolchain", | 53 result.add_option("-t", "--toolchain", |
54 help='Cross-compiler toolchain path', | 54 help='Cross-compiler toolchain path', |
55 default=None) | 55 default=None) |
56 result.add_option("-j", | 56 result.add_option("-j", |
57 help='The number of parallel jobs to run.', | 57 help='The number of parallel jobs to run.', |
(...skipping 11 matching lines...) Expand all Loading... |
69 | 69 |
70 | 70 |
71 def ProcessOsOption(os): | 71 def ProcessOsOption(os): |
72 if os == 'host': | 72 if os == 'host': |
73 return HOST_OS | 73 return HOST_OS |
74 return os | 74 return os |
75 | 75 |
76 | 76 |
77 def ProcessOptions(options, args): | 77 def ProcessOptions(options, args): |
78 if options.arch == 'all': | 78 if options.arch == 'all': |
79 options.arch = 'ia32,x64,simarm,simmips' | 79 options.arch = 'ia32,x64,simarm,simmips,simarm64' |
80 if options.mode == 'all': | 80 if options.mode == 'all': |
81 options.mode = 'release,debug' | 81 options.mode = 'release,debug' |
82 if options.os == 'all': | 82 if options.os == 'all': |
83 options.os = 'host,android' | 83 options.os = 'host,android' |
84 options.mode = options.mode.split(',') | 84 options.mode = options.mode.split(',') |
85 options.arch = options.arch.split(',') | 85 options.arch = options.arch.split(',') |
86 options.os = options.os.split(',') | 86 options.os = options.os.split(',') |
87 for mode in options.mode: | 87 for mode in options.mode: |
88 if not mode in ['debug', 'release']: | 88 if not mode in ['debug', 'release']: |
89 print "Unknown mode %s" % mode | 89 print "Unknown mode %s" % mode |
90 return False | 90 return False |
91 for arch in options.arch: | 91 for arch in options.arch: |
92 if not arch in ['ia32', 'x64', 'simarm', 'arm', 'simmips', 'mips']: | 92 archs = ['ia32', 'x64', 'simarm', 'arm', 'simmips', 'mips', 'simarm64'] |
| 93 if not arch in archs: |
93 print "Unknown arch %s" % arch | 94 print "Unknown arch %s" % arch |
94 return False | 95 return False |
95 options.os = [ProcessOsOption(os) for os in options.os] | 96 options.os = [ProcessOsOption(os) for os in options.os] |
96 for os in options.os: | 97 for os in options.os: |
97 if not os in ['android', 'freebsd', 'linux', 'macos', 'win32']: | 98 if not os in ['android', 'freebsd', 'linux', 'macos', 'win32']: |
98 print "Unknown os %s" % os | 99 print "Unknown os %s" % os |
99 return False | 100 return False |
100 if os != HOST_OS: | 101 if os != HOST_OS: |
101 if os != 'android': | 102 if os != 'android': |
102 print "Unsupported target os %s" % os | 103 print "Unsupported target os %s" % os |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 process.wait() | 406 process.wait() |
406 if process.returncode != 0: | 407 if process.returncode != 0: |
407 print "BUILD FAILED" | 408 print "BUILD FAILED" |
408 return 1 | 409 return 1 |
409 | 410 |
410 return 0 | 411 return 0 |
411 | 412 |
412 | 413 |
413 if __name__ == '__main__': | 414 if __name__ == '__main__': |
414 sys.exit(Main()) | 415 sys.exit(Main()) |
OLD | NEW |