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 os | 9 import os |
10 import platform | 10 import platform |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 host_arch = ARCH_GUESS | 256 host_arch = ARCH_GUESS |
257 cross_build = '' | 257 cross_build = '' |
258 if GetArchFamily(host_arch) != GetArchFamily(arch): | 258 if GetArchFamily(host_arch) != GetArchFamily(arch): |
259 print "GetBuildConf: Cross-build of %s on %s\n" % (arch, host_arch) | 259 print "GetBuildConf: Cross-build of %s on %s\n" % (arch, host_arch) |
260 cross_build = 'X' | 260 cross_build = 'X' |
261 return '%s%s%s' % (GetBuildMode(mode), cross_build, arch.upper()) | 261 return '%s%s%s' % (GetBuildMode(mode), cross_build, arch.upper()) |
262 | 262 |
263 def GetBuildDir(host_os): | 263 def GetBuildDir(host_os): |
264 return BUILD_ROOT[host_os] | 264 return BUILD_ROOT[host_os] |
265 | 265 |
266 def GetBuildRoot(host_os, mode=None, arch=None): | 266 def GetBuildRoot(host_os, mode=None, arch=None, target_os=None): |
267 build_root = GetBuildDir(host_os) | 267 build_root = GetBuildDir(host_os) |
268 if mode: | 268 if mode: |
269 build_root = os.path.join(build_root, GetBuildConf(mode, arch, target_os)) | 269 build_root = os.path.join(build_root, GetBuildConf(mode, arch, target_os)) |
270 return build_root | 270 return build_root |
271 | 271 |
272 def GetBaseDir(): | 272 def GetBaseDir(): |
273 return BASE_DIR | 273 return BASE_DIR |
274 | 274 |
275 def GetShortVersion(): | 275 def GetShortVersion(): |
276 version = ReadVersionFile() | 276 version = ReadVersionFile() |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 os.chdir(self._working_directory) | 590 os.chdir(self._working_directory) |
591 | 591 |
592 def __exit__(self, *_): | 592 def __exit__(self, *_): |
593 print "Enter directory = ", self._old_cwd | 593 print "Enter directory = ", self._old_cwd |
594 os.chdir(self._old_cwd) | 594 os.chdir(self._old_cwd) |
595 | 595 |
596 | 596 |
597 if __name__ == "__main__": | 597 if __name__ == "__main__": |
598 import sys | 598 import sys |
599 Main() | 599 Main() |
OLD | NEW |