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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 result.add_option("-m", "--mode", | 56 result.add_option("-m", "--mode", |
57 help='Build variants (comma-separated).', | 57 help='Build variants (comma-separated).', |
58 metavar='[all,debug,release,product]', | 58 metavar='[all,debug,release,product]', |
59 default='debug') | 59 default='debug') |
60 result.add_option("-v", "--verbose", | 60 result.add_option("-v", "--verbose", |
61 help='Verbose output.', | 61 help='Verbose output.', |
62 default=False, action="store_true") | 62 default=False, action="store_true") |
63 result.add_option("-a", "--arch", | 63 result.add_option("-a", "--arch", |
64 help='Target architectures (comma-separated).', | 64 help='Target architectures (comma-separated).', |
65 metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,' | 65 metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,' |
66 'simmips,mips,simarm64,arm64,simdbc,armsimdbc]', | 66 'simarm64,arm64,simdbc,armsimdbc]', |
67 default=utils.GuessArchitecture()) | 67 default=utils.GuessArchitecture()) |
68 result.add_option("--os", | 68 result.add_option("--os", |
69 help='Target OSs (comma-separated).', | 69 help='Target OSs (comma-separated).', |
70 metavar='[all,host,android]', | 70 metavar='[all,host,android]', |
71 default='host') | 71 default='host') |
72 result.add_option("-t", "--toolchain", | 72 result.add_option("-t", "--toolchain", |
73 help='Cross-compiler toolchain path', | 73 help='Cross-compiler toolchain path', |
74 default=None) | 74 default=None) |
75 result.add_option("-j", | 75 result.add_option("-j", |
76 help='The number of parallel jobs to run.', | 76 help='The number of parallel jobs to run.', |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 if not options.gyp and options.toolchain != None: | 110 if not options.gyp and options.toolchain != None: |
111 print "The --toolchain flag is only supported by the gyp build." | 111 print "The --toolchain flag is only supported by the gyp build." |
112 print "When using the GN build, set the toolchain and sysroot using gn.py." | 112 print "When using the GN build, set the toolchain and sysroot using gn.py." |
113 return False | 113 return False |
114 for mode in options.mode: | 114 for mode in options.mode: |
115 if not mode in ['debug', 'release', 'product']: | 115 if not mode in ['debug', 'release', 'product']: |
116 print "Unknown mode %s" % mode | 116 print "Unknown mode %s" % mode |
117 return False | 117 return False |
118 for arch in options.arch: | 118 for arch in options.arch: |
119 archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv6', 'armv6', | 119 archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv6', 'armv6', |
120 'simarmv5te', 'armv5te', 'simmips', 'mips', 'simarm64', 'arm64', | 120 'simarmv5te', 'armv5te', 'simarm64', 'arm64', |
121 'simdbc', 'simdbc64', 'armsimdbc', 'armsimdbc64'] | 121 'simdbc', 'simdbc64', 'armsimdbc', 'armsimdbc64'] |
122 if not arch in archs: | 122 if not arch in archs: |
123 print "Unknown arch %s" % arch | 123 print "Unknown arch %s" % arch |
124 return False | 124 return False |
125 options.os = [ProcessOsOption(os_name) for os_name in options.os] | 125 options.os = [ProcessOsOption(os_name) for os_name in options.os] |
126 for os_name in options.os: | 126 for os_name in options.os: |
127 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: | 127 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: |
128 print "Unknown os %s" % os_name | 128 print "Unknown os %s" % os_name |
129 return False | 129 return False |
130 if os_name != HOST_OS: | 130 if os_name != HOST_OS: |
131 if os_name != 'android': | 131 if os_name != 'android': |
132 print "Unsupported target os %s" % os_name | 132 print "Unsupported target os %s" % os_name |
133 return False | 133 return False |
134 if not HOST_OS in ['linux', 'macos']: | 134 if not HOST_OS in ['linux', 'macos']: |
135 print ("Cross-compilation to %s is not supported on host os %s." | 135 print ("Cross-compilation to %s is not supported on host os %s." |
136 % (os_name, HOST_OS)) | 136 % (os_name, HOST_OS)) |
137 return False | 137 return False |
138 if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips', | 138 if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', |
139 'simdbc', 'simdbc64']: | 139 'simdbc', 'simdbc64']: |
140 print ("Cross-compilation to %s is not supported for architecture %s." | 140 print ("Cross-compilation to %s is not supported for architecture %s." |
141 % (os_name, arch)) | 141 % (os_name, arch)) |
142 return False | 142 return False |
143 # We have not yet tweaked the v8 dart build to work with the Android | 143 # We have not yet tweaked the v8 dart build to work with the Android |
144 # NDK/SDK, so don't try to build it. | 144 # NDK/SDK, so don't try to build it. |
145 if not args: | 145 if not args: |
146 print "For android builds you must specify a target, such as 'runtime'." | 146 print "For android builds you must specify a target, such as 'runtime'." |
147 return False | 147 return False |
148 return True | 148 return True |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 for arch in options.arch: | 616 for arch in options.arch: |
617 if BuildOneConfig(options, target, target_os, | 617 if BuildOneConfig(options, target, target_os, |
618 mode, arch) != 0: | 618 mode, arch) != 0: |
619 return 1 | 619 return 1 |
620 | 620 |
621 return 0 | 621 return 0 |
622 | 622 |
623 | 623 |
624 if __name__ == '__main__': | 624 if __name__ == '__main__': |
625 sys.exit(Main()) | 625 sys.exit(Main()) |
OLD | NEW |