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 datetime | 9 import datetime |
10 import json | 10 import json |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 def GuessArchitecture(): | 51 def GuessArchitecture(): |
52 os_id = platform.machine() | 52 os_id = platform.machine() |
53 if os_id.startswith('armv5te'): | 53 if os_id.startswith('armv5te'): |
54 return 'armv5te' | 54 return 'armv5te' |
55 elif os_id.startswith('arm'): | 55 elif os_id.startswith('arm'): |
56 return 'arm' | 56 return 'arm' |
57 elif os_id.startswith('aarch64'): | 57 elif os_id.startswith('aarch64'): |
58 return 'arm64' | 58 return 'arm64' |
59 elif os_id.startswith('mips'): | 59 elif os_id.startswith('mips'): |
60 return 'mips' | 60 return 'mips' |
| 61 elif '64' in os_id: |
| 62 return 'x64' |
61 elif (not os_id) or (not re.match('(x|i[3-6])86', os_id) is None): | 63 elif (not os_id) or (not re.match('(x|i[3-6])86', os_id) is None): |
62 return 'ia32' | 64 return 'ia32' |
63 elif os_id == 'i86pc': | 65 elif os_id == 'i86pc': |
64 return 'ia32' | 66 return 'ia32' |
65 elif '64' in os_id: | |
66 return 'x64' | |
67 else: | 67 else: |
68 guess_os = GuessOS() | 68 guess_os = GuessOS() |
69 print "Warning: Guessing architecture %s based on os %s\n"\ | 69 print "Warning: Guessing architecture %s based on os %s\n"\ |
70 % (os_id, guess_os) | 70 % (os_id, guess_os) |
71 if guess_os == 'win32': | 71 if guess_os == 'win32': |
72 return 'ia32' | 72 return 'ia32' |
73 return None | 73 return None |
74 | 74 |
75 | 75 |
76 # Try to guess the number of cpus on this machine. | 76 # Try to guess the number of cpus on this machine. |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 os.chdir(self._working_directory) | 663 os.chdir(self._working_directory) |
664 | 664 |
665 def __exit__(self, *_): | 665 def __exit__(self, *_): |
666 print "Enter directory = ", self._old_cwd | 666 print "Enter directory = ", self._old_cwd |
667 os.chdir(self._old_cwd) | 667 os.chdir(self._old_cwd) |
668 | 668 |
669 | 669 |
670 if __name__ == "__main__": | 670 if __name__ == "__main__": |
671 import sys | 671 import sys |
672 Main() | 672 Main() |
OLD | NEW |