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

Side by Side Diff: tools/build.py

Issue 12726011: Enables cross-compilation of the VM for ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months 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
OLDNEW
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
11 import shutil 11 import shutil
12 import subprocess 12 import subprocess
13 import sys 13 import sys
14 import utils 14 import utils
15 15
16 HOST_OS = utils.GuessOS() 16 HOST_OS = utils.GuessOS()
17 HOST_CPUS = utils.GuessCpus() 17 HOST_CPUS = utils.GuessCpus()
18 armcompilerlocation = '/opt/codesourcery/arm-2009q1'
19 SCRIPT_DIR = os.path.dirname(sys.argv[0]) 18 SCRIPT_DIR = os.path.dirname(sys.argv[0])
20 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..')) 19 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
21 THIRD_PARTY_ROOT = os.path.join(DART_ROOT, 'third_party') 20 THIRD_PARTY_ROOT = os.path.join(DART_ROOT, 'third_party')
22 21
22 # To make sure that you have arm cross compilation tools installed run:
23 # $ wget http://src.chromium.org/chrome/trunk/src/build/install-build-deps.sh
24 # $ ./install-build-deps.sh --arm
kustermann 2013/04/15 11:59:22 This doesn't quite work (at least on my machine).
zra 2013/04/15 17:52:58 Was the problem that './linux/install-chromeos-fon
25 DEFAULT_ARM_CROSS_COMPILER_PATH = '/usr'
26
23 def BuildOptions(): 27 def BuildOptions():
24 result = optparse.OptionParser() 28 result = optparse.OptionParser()
25 result.add_option("-m", "--mode", 29 result.add_option("-m", "--mode",
26 help='Build variants (comma-separated).', 30 help='Build variants (comma-separated).',
27 metavar='[all,debug,release]', 31 metavar='[all,debug,release]',
28 default='debug') 32 default='debug')
29 result.add_option("-v", "--verbose", 33 result.add_option("-v", "--verbose",
30 help='Verbose output.', 34 help='Verbose output.',
31 default=False, action="store_true") 35 default=False, action="store_true")
32 result.add_option("-a", "--arch", 36 result.add_option("-a", "--arch",
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return False 104 return False
101 if 'v8' in args: 105 if 'v8' in args:
102 print "The v8 target is not supported for android builds." 106 print "The v8 target is not supported for android builds."
103 return False 107 return False
104 return True 108 return True
105 109
106 110
107 def SetTools(arch, toolchainprefix): 111 def SetTools(arch, toolchainprefix):
108 toolsOverride = None 112 toolsOverride = None
109 if arch == 'arm' and toolchainprefix == None: 113 if arch == 'arm' and toolchainprefix == None:
110 toolchainprefix = armcompilerlocation + "/bin/arm-none-linux-gnueabi" 114 toolchainprefix = DEFAULT_ARM_CROSS_COMPILER_PATH + "/bin/arm-linux-gnueabi"
111 if toolchainprefix: 115 if toolchainprefix:
112 toolsOverride = { 116 toolsOverride = {
113 "CC" : toolchainprefix + "-gcc", 117 "CC.target" : toolchainprefix + "-gcc",
114 "CXX" : toolchainprefix + "-g++", 118 "CXX.target" : toolchainprefix + "-g++",
115 "AR" : toolchainprefix + "-ar", 119 "AR.target" : toolchainprefix + "-ar",
116 "LINK": toolchainprefix + "-g++", 120 "LINK.target": toolchainprefix + "-g++",
117 "NM" : toolchainprefix + "-nm", 121 "NM.target" : toolchainprefix + "-nm",
118 } 122 }
119 return toolsOverride 123 return toolsOverride
120 124
121 125
122 def CheckDirExists(path, docstring): 126 def CheckDirExists(path, docstring):
123 if not os.path.isdir(path): 127 if not os.path.isdir(path):
124 raise Exception('Could not find %s directory %s' 128 raise Exception('Could not find %s directory %s'
125 % (docstring, path)) 129 % (docstring, path))
126 130
127 131
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 process.wait() 430 process.wait()
427 if process.returncode != 0: 431 if process.returncode != 0:
428 print "BUILD FAILED" 432 print "BUILD FAILED"
429 return 1 433 return 1
430 434
431 return 0 435 return 0
432 436
433 437
434 if __name__ == '__main__': 438 if __name__ == '__main__':
435 sys.exit(Main()) 439 sys.exit(Main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698