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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 result = optparse.OptionParser(usage=usage) | 48 result = optparse.OptionParser(usage=usage) |
49 result.add_option("-m", "--mode", | 49 result.add_option("-m", "--mode", |
50 help='Build variants (comma-separated).', | 50 help='Build variants (comma-separated).', |
51 metavar='[all,debug,release]', | 51 metavar='[all,debug,release]', |
52 default='debug') | 52 default='debug') |
53 result.add_option("-v", "--verbose", | 53 result.add_option("-v", "--verbose", |
54 help='Verbose output.', | 54 help='Verbose output.', |
55 default=False, action="store_true") | 55 default=False, action="store_true") |
56 result.add_option("-a", "--arch", | 56 result.add_option("-a", "--arch", |
57 help='Target architectures (comma-separated).', | 57 help='Target architectures (comma-separated).', |
58 metavar='[all,ia32,x64,simarm,arm,simmips,mips,simarm64,arm64,]', | 58 metavar='[all,ia32,x64,simarm,arm,armv5,simmips,mips,simarm64,arm64,]', |
59 default=utils.GuessArchitecture()) | 59 default=utils.GuessArchitecture()) |
60 result.add_option("--os", | 60 result.add_option("--os", |
61 help='Target OSs (comma-separated).', | 61 help='Target OSs (comma-separated).', |
62 metavar='[all,host,android]', | 62 metavar='[all,host,android]', |
63 default='host') | 63 default='host') |
64 result.add_option("-t", "--toolchain", | 64 result.add_option("-t", "--toolchain", |
65 help='Cross-compiler toolchain path', | 65 help='Cross-compiler toolchain path', |
66 default=None) | 66 default=None) |
67 result.add_option("-j", | 67 result.add_option("-j", |
68 help='The number of parallel jobs to run.', | 68 help='The number of parallel jobs to run.', |
(...skipping 29 matching lines...) Expand all Loading... |
98 if options.os == 'all': | 98 if options.os == 'all': |
99 options.os = 'host,android' | 99 options.os = 'host,android' |
100 options.mode = options.mode.split(',') | 100 options.mode = options.mode.split(',') |
101 options.arch = options.arch.split(',') | 101 options.arch = options.arch.split(',') |
102 options.os = options.os.split(',') | 102 options.os = options.os.split(',') |
103 for mode in options.mode: | 103 for mode in options.mode: |
104 if not mode in ['debug', 'release']: | 104 if not mode in ['debug', 'release']: |
105 print "Unknown mode %s" % mode | 105 print "Unknown mode %s" % mode |
106 return False | 106 return False |
107 for arch in options.arch: | 107 for arch in options.arch: |
108 archs = ['ia32', 'x64', 'simarm', 'arm', 'simmips', 'mips', | 108 archs = ['ia32', 'x64', 'simarm', 'arm', 'armv5', 'simmips', 'mips', |
109 'simarm64', 'arm64',] | 109 'simarm64', 'arm64',] |
110 if not arch in archs: | 110 if not arch in archs: |
111 print "Unknown arch %s" % arch | 111 print "Unknown arch %s" % arch |
112 return False | 112 return False |
113 options.os = [ProcessOsOption(os_name) for os_name in options.os] | 113 options.os = [ProcessOsOption(os_name) for os_name in options.os] |
114 for os_name in options.os: | 114 for os_name in options.os: |
115 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: | 115 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: |
116 print "Unknown os %s" % os_name | 116 print "Unknown os %s" % os_name |
117 return False | 117 return False |
118 if os_name != HOST_OS: | 118 if os_name != HOST_OS: |
119 if os_name != 'android': | 119 if os_name != 'android': |
120 print "Unsupported target os %s" % os_name | 120 print "Unsupported target os %s" % os_name |
121 return False | 121 return False |
122 if not HOST_OS in ['linux']: | 122 if not HOST_OS in ['linux']: |
123 print ("Cross-compilation to %s is not supported on host os %s." | 123 print ("Cross-compilation to %s is not supported on host os %s." |
124 % (os_name, HOST_OS)) | 124 % (os_name, HOST_OS)) |
125 return False | 125 return False |
126 if not arch in ['ia32', 'arm', 'arm64', 'mips']: | 126 if not arch in ['ia32', 'arm', 'armv5', 'arm64', 'mips']: |
127 print ("Cross-compilation to %s is not supported for architecture %s." | 127 print ("Cross-compilation to %s is not supported for architecture %s." |
128 % (os_name, arch)) | 128 % (os_name, arch)) |
129 return False | 129 return False |
130 # We have not yet tweaked the v8 dart build to work with the Android | 130 # We have not yet tweaked the v8 dart build to work with the Android |
131 # NDK/SDK, so don't try to build it. | 131 # NDK/SDK, so don't try to build it. |
132 if not args: | 132 if not args: |
133 print "For android builds you must specify a target, such as 'runtime'." | 133 print "For android builds you must specify a target, such as 'runtime'." |
134 return False | 134 return False |
135 return True | 135 return True |
136 | 136 |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 else: | 555 else: |
556 if BuildOneConfig(options, target, target_os, | 556 if BuildOneConfig(options, target, target_os, |
557 mode, arch, cross_build) != 0: | 557 mode, arch, cross_build) != 0: |
558 return 1 | 558 return 1 |
559 | 559 |
560 return 0 | 560 return 0 |
561 | 561 |
562 | 562 |
563 if __name__ == '__main__': | 563 if __name__ == '__main__': |
564 sys.exit(Main()) | 564 sys.exit(Main()) |
OLD | NEW |