comparison mx/commands.py @ 4146:4eb5b2469b6f

Fixed 'build' command.
author Doug Simon <doug.simon@oracle.com>
date Mon, 19 Dec 2011 21:48:32 +0100
parents 9aee7df31417
children 55376d8953a6
comparison
equal deleted inserted replaced
4145:9aee7df31417 4146:4eb5b2469b6f
178 def build(args): 178 def build(args):
179 """builds the GraalVM binary and compiles the Graal classes 179 """builds the GraalVM binary and compiles the Graal classes
180 180
181 The optional argument specifies what type of VM to build.""" 181 The optional argument specifies what type of VM to build."""
182 182
183 mx.build([]) 183 build = 'product'
184 if len(args) != 0 and not args[len(args) - 1].startswith('-'):
185 build = args.pop()
186
187 # Call mx.build to compile the Java sources
188 mx.build(args)
184 189
185 def fix_jvm_cfg(jdk): 190 def fix_jvm_cfg(jdk):
186 jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg') 191 jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg')
187 found = False 192 found = False
188 if not exists(jvmCfg): 193 if not exists(jvmCfg):
196 if not found: 201 if not found:
197 mx.log('Appending "-graal KNOWN" to ' + jvmCfg) 202 mx.log('Appending "-graal KNOWN" to ' + jvmCfg)
198 with open(jvmCfg, 'a') as f: 203 with open(jvmCfg, 'a') as f:
199 f.write('-graal KNOWN\n') 204 f.write('-graal KNOWN\n')
200 205
201 build = 'product' if len(args) == 0 else args[0] 206
202 jdk7 = _jdk7(build, True) 207 jdk7 = _jdk7(build, True)
203 if build == 'debug': 208 if build == 'debug':
204 build = 'jvmg' 209 build = 'jvmg'
205 210
206 fix_jvm_cfg(jdk7) 211 fix_jvm_cfg(jdk7)