OLD | NEW |
1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 # This file contains a set of utilities functions used by other Python-based | 5 # This file contains a set of utilities functions used by other Python-based |
6 # scripts. | 6 # scripts. |
7 | 7 |
8 import commands | 8 import commands |
9 import contextlib | 9 import contextlib |
10 import datetime | 10 import datetime |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 def GuessArchitecture(): | 69 def GuessArchitecture(): |
70 os_id = platform.machine() | 70 os_id = platform.machine() |
71 if os_id.startswith('armv5te'): | 71 if os_id.startswith('armv5te'): |
72 return 'armv5te' | 72 return 'armv5te' |
73 elif os_id.startswith('armv6'): | 73 elif os_id.startswith('armv6'): |
74 return 'armv6' | 74 return 'armv6' |
75 elif os_id.startswith('arm'): | 75 elif os_id.startswith('arm'): |
76 return 'arm' | 76 return 'arm' |
77 elif os_id.startswith('aarch64'): | 77 elif os_id.startswith('aarch64'): |
78 return 'arm64' | 78 return 'arm64' |
79 elif os_id.startswith('mips'): | |
80 return 'mips' | |
81 elif '64' in os_id: | 79 elif '64' in os_id: |
82 return 'x64' | 80 return 'x64' |
83 elif (not os_id) or (not re.match('(x|i[3-6])86', os_id) is None): | 81 elif (not os_id) or (not re.match('(x|i[3-6])86', os_id) is None): |
84 return 'ia32' | 82 return 'ia32' |
85 elif os_id == 'i86pc': | 83 elif os_id == 'i86pc': |
86 return 'ia32' | 84 return 'ia32' |
87 else: | 85 else: |
88 guess_os = GuessOS() | 86 guess_os = GuessOS() |
89 print "Warning: Guessing architecture %s based on os %s\n"\ | 87 print "Warning: Guessing architecture %s based on os %s\n"\ |
90 % (os_id, guess_os) | 88 % (os_id, guess_os) |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 'macos': os.path.join('xcodebuild'), | 243 'macos': os.path.join('xcodebuild'), |
246 } | 244 } |
247 | 245 |
248 ARCH_FAMILY = { | 246 ARCH_FAMILY = { |
249 'ia32': 'ia32', | 247 'ia32': 'ia32', |
250 'x64': 'ia32', | 248 'x64': 'ia32', |
251 'arm': 'arm', | 249 'arm': 'arm', |
252 'armv6': 'arm', | 250 'armv6': 'arm', |
253 'armv5te': 'arm', | 251 'armv5te': 'arm', |
254 'arm64': 'arm', | 252 'arm64': 'arm', |
255 'mips': 'mips', | |
256 'simarm': 'ia32', | 253 'simarm': 'ia32', |
257 'simarmv6': 'ia32', | 254 'simarmv6': 'ia32', |
258 'simarmv5te': 'ia32', | 255 'simarmv5te': 'ia32', |
259 'simmips': 'ia32', | |
260 'simarm64': 'ia32', | 256 'simarm64': 'ia32', |
261 'simdbc': 'ia32', | 257 'simdbc': 'ia32', |
262 'simdbc64': 'ia32', | 258 'simdbc64': 'ia32', |
263 'armsimdbc': 'arm', | 259 'armsimdbc': 'arm', |
264 'armsimdbc64': 'arm', | 260 'armsimdbc64': 'arm', |
265 } | 261 } |
266 | 262 |
267 ARCH_GUESS = GuessArchitecture() | 263 ARCH_GUESS = GuessArchitecture() |
268 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..')) | 264 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..')) |
269 DART_DIR = os.path.abspath(os.path.join(__file__, '..', '..')) | 265 DART_DIR = os.path.abspath(os.path.join(__file__, '..', '..')) |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 osname, | 609 osname, |
614 'dart-sdk') | 610 'dart-sdk') |
615 | 611 |
616 | 612 |
617 def CheckedInSdkExecutable(): | 613 def CheckedInSdkExecutable(): |
618 name = 'dart' | 614 name = 'dart' |
619 if IsWindows(): | 615 if IsWindows(): |
620 name = 'dart.exe' | 616 name = 'dart.exe' |
621 elif GuessOS() == 'linux': | 617 elif GuessOS() == 'linux': |
622 arch = GuessArchitecture() | 618 arch = GuessArchitecture() |
623 if arch == 'mips': | 619 if arch == 'arm': |
624 name = 'dart-mips' | |
625 elif arch == 'arm': | |
626 name = 'dart-arm' | 620 name = 'dart-arm' |
627 elif arch == 'arm64': | 621 elif arch == 'arm64': |
628 name = 'dart-arm64' | 622 name = 'dart-arm64' |
629 elif arch == 'armv5te': | 623 elif arch == 'armv5te': |
630 # TODO(zra): This binary does not exist, yet. Check one in once we have | 624 # TODO(zra): This binary does not exist, yet. Check one in once we have |
631 # sufficient stability. | 625 # sufficient stability. |
632 name = 'dart-armv5te' | 626 name = 'dart-armv5te' |
633 elif arch == 'armv6': | 627 elif arch == 'armv6': |
634 # TODO(zra): Ditto. | 628 # TODO(zra): Ditto. |
635 name = 'dart-armv6' | 629 name = 'dart-armv6' |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 return contextlib.nested(WindowsCoreDumpEnabler(), | 1037 return contextlib.nested(WindowsCoreDumpEnabler(), |
1044 WindowsCoreDumpArchiver()) | 1038 WindowsCoreDumpArchiver()) |
1045 else: | 1039 else: |
1046 # We don't have support for MacOS yet. | 1040 # We don't have support for MacOS yet. |
1047 assert osname == 'macos' | 1041 assert osname == 'macos' |
1048 return NooptCoreDumpArchiver() | 1042 return NooptCoreDumpArchiver() |
1049 | 1043 |
1050 if __name__ == "__main__": | 1044 if __name__ == "__main__": |
1051 import sys | 1045 import sys |
1052 Main() | 1046 Main() |
OLD | NEW |