Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Side by Side Diff: tools/utils.py

Issue 9004001: Fix build so we can make a Windows SDK! (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/create_sdk.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, 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 os 9 import os
10 import platform 10 import platform
(...skipping 25 matching lines...) Expand all
36 36
37 # Try to guess the host architecture. 37 # Try to guess the host architecture.
38 def GuessArchitecture(): 38 def GuessArchitecture():
39 id = platform.machine() 39 id = platform.machine()
40 if id.startswith('arm'): 40 if id.startswith('arm'):
41 return 'arm' 41 return 'arm'
42 elif (not id) or (not re.match('(x|i[3-6])86', id) is None): 42 elif (not id) or (not re.match('(x|i[3-6])86', id) is None):
43 return 'ia32' 43 return 'ia32'
44 elif id == 'i86pc': 44 elif id == 'i86pc':
45 return 'ia32' 45 return 'ia32'
46 elif '64' in id:
47 return 'x64'
46 else: 48 else:
47 return None 49 return None
48 50
49 51
50 # Try to guess the number of cpus on this machine. 52 # Try to guess the number of cpus on this machine.
51 def GuessCpus(): 53 def GuessCpus():
52 if os.path.exists("/proc/cpuinfo"): 54 if os.path.exists("/proc/cpuinfo"):
53 return int(commands.getoutput("grep -E '^processor' /proc/cpuinfo | wc -l")) 55 return int(commands.getoutput("grep -E '^processor' /proc/cpuinfo | wc -l"))
54 if os.path.exists("/usr/bin/hostinfo"): 56 if os.path.exists("/usr/bin/hostinfo"):
55 return int(commands.getoutput('/usr/bin/hostinfo | grep "processors are logi cally available." | awk "{ print \$1 }"')) 57 return int(commands.getoutput('/usr/bin/hostinfo | grep "processors are logi cally available." | awk "{ print \$1 }"'))
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 def __init__(self, value): 257 def __init__(self, value):
256 self.value = value 258 self.value = value
257 259
258 def __str__(self): 260 def __str__(self):
259 return repr(self.value) 261 return repr(self.value)
260 262
261 263
262 if __name__ == "__main__": 264 if __name__ == "__main__":
263 import sys 265 import sys
264 Main(sys.argv) 266 Main(sys.argv)
OLDNEW
« no previous file with comments | « tools/create_sdk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698