| 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,simarmv5te,armv5te,simmips,mips' | 58 metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,' |
| 59 ',simarm64,arm64,]', | 59 'simmips,mips,simarm64,arm64,]', |
| 60 default=utils.GuessArchitecture()) | 60 default=utils.GuessArchitecture()) |
| 61 result.add_option("--os", | 61 result.add_option("--os", |
| 62 help='Target OSs (comma-separated).', | 62 help='Target OSs (comma-separated).', |
| 63 metavar='[all,host,android]', | 63 metavar='[all,host,android]', |
| 64 default='host') | 64 default='host') |
| 65 result.add_option("-t", "--toolchain", | 65 result.add_option("-t", "--toolchain", |
| 66 help='Cross-compiler toolchain path', | 66 help='Cross-compiler toolchain path', |
| 67 default=None) | 67 default=None) |
| 68 result.add_option("-j", | 68 result.add_option("-j", |
| 69 help='The number of parallel jobs to run.', | 69 help='The number of parallel jobs to run.', |
| (...skipping 24 matching lines...) Expand all Loading... |
| 94 if options.os == 'all': | 94 if options.os == 'all': |
| 95 options.os = 'host,android' | 95 options.os = 'host,android' |
| 96 options.mode = options.mode.split(',') | 96 options.mode = options.mode.split(',') |
| 97 options.arch = options.arch.split(',') | 97 options.arch = options.arch.split(',') |
| 98 options.os = options.os.split(',') | 98 options.os = options.os.split(',') |
| 99 for mode in options.mode: | 99 for mode in options.mode: |
| 100 if not mode in ['debug', 'release']: | 100 if not mode in ['debug', 'release']: |
| 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', 'simarmv6', 'armv6', |
| 105 'mips', 'simarm64', 'arm64',] | 105 'simarmv5te', 'armv5te', 'simmips', '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', 'win32']: |
| 112 print "Unknown os %s" % os_name | 112 print "Unknown os %s" % os_name |
| 113 return False | 113 return False |
| 114 if os_name != HOST_OS: | 114 if os_name != HOST_OS: |
| 115 if os_name != 'android': | 115 if os_name != 'android': |
| 116 print "Unsupported target os %s" % os_name | 116 print "Unsupported target os %s" % os_name |
| 117 return False | 117 return False |
| 118 if not HOST_OS in ['linux']: | 118 if not HOST_OS in ['linux']: |
| 119 print ("Cross-compilation to %s is not supported on host os %s." | 119 print ("Cross-compilation to %s is not supported on host os %s." |
| 120 % (os_name, HOST_OS)) | 120 % (os_name, HOST_OS)) |
| 121 return False | 121 return False |
| 122 if not arch in ['ia32', 'arm', 'armv5te', 'arm64', 'mips']: | 122 if not arch in ['ia32', 'arm', 'armv6', 'armv5te', 'arm64', 'mips']: |
| 123 print ("Cross-compilation to %s is not supported for architecture %s." | 123 print ("Cross-compilation to %s is not supported for architecture %s." |
| 124 % (os_name, arch)) | 124 % (os_name, arch)) |
| 125 return False | 125 return False |
| 126 # We have not yet tweaked the v8 dart build to work with the Android | 126 # We have not yet tweaked the v8 dart build to work with the Android |
| 127 # NDK/SDK, so don't try to build it. | 127 # NDK/SDK, so don't try to build it. |
| 128 if not args: | 128 if not args: |
| 129 print "For android builds you must specify a target, such as 'runtime'." | 129 print "For android builds you must specify a target, such as 'runtime'." |
| 130 return False | 130 return False |
| 131 return True | 131 return True |
| 132 | 132 |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 else: | 552 else: |
| 553 if BuildOneConfig(options, target, target_os, | 553 if BuildOneConfig(options, target, target_os, |
| 554 mode, arch, cross_build) != 0: | 554 mode, arch, cross_build) != 0: |
| 555 return 1 | 555 return 1 |
| 556 | 556 |
| 557 return 0 | 557 return 0 |
| 558 | 558 |
| 559 | 559 |
| 560 if __name__ == '__main__': | 560 if __name__ == '__main__': |
| 561 sys.exit(Main()) | 561 sys.exit(Main()) |
| OLD | NEW |