comparison mx/commands.py @ 4631:b1b78a46b907

Merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 17 Feb 2012 14:47:57 +0100
parents ef0ff914c10f ee87cfe2f8f9
children 5b0a2334437d
comparison
equal deleted inserted replaced
4630:ef0ff914c10f 4631:b1b78a46b907
268 failed.append(test) 268 failed.append(test)
269 269
270 if len(failed) != 0: 270 if len(failed) != 0:
271 mx.abort('Scala DaCapo failures: ' + str(failed)) 271 mx.abort('Scala DaCapo failures: ' + str(failed))
272 272
273 def _vmLibDirInJdk(jdk):
274 """
275 Get the directory within a JDK where jvm.cfg file and the server
276 and client subdirectories are located.
277 """
278 if platform.system() == 'Darwin':
279 return join(jdk, 'jre', 'lib')
280 return join(jdk, 'jre', 'lib', 'amd64')
281
273 def _jdk(build='product', create=False): 282 def _jdk(build='product', create=False):
274 """ 283 """
275 Get the JDK into which Graal is installed, creating it first if necessary. 284 Get the JDK into which Graal is installed, creating it first if necessary.
276 """ 285 """
277 jdk = join(_graal_home, 'jdk' + mx.java().version, build) 286 jdk = join(_graal_home, 'jdk' + mx.java().version, build)
290 mx.abort('Host JDK directory is missing: ' + src) 299 mx.abort('Host JDK directory is missing: ' + src)
291 shutil.copytree(src, dst) 300 shutil.copytree(src, dst)
292 301
293 # Make a copy of the default VM so that this JDK can be 302 # Make a copy of the default VM so that this JDK can be
294 # reliably used as the bootstrap for a HotSpot build. 303 # reliably used as the bootstrap for a HotSpot build.
295 jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg') 304 jvmCfg = join(_vmLibDirInJdk(jdk), 'jvm.cfg')
296 if not exists(jvmCfg): 305 if not exists(jvmCfg):
297 mx.abort(jvmCfg + ' does not exist') 306 mx.abort(jvmCfg + ' does not exist')
298 307
299 lines = [] 308 lines = []
300 defaultVM = None 309 defaultVM = None
307 defaultVM = parts[0][1:] 316 defaultVM = parts[0][1:]
308 lines.append('-' + defaultVM + '0 KNOWN\n') 317 lines.append('-' + defaultVM + '0 KNOWN\n')
309 lines.append(line) 318 lines.append(line)
310 319
311 assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg 320 assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg
312 shutil.copytree(join(jdk, 'jre', 'lib', 'amd64', defaultVM), join(jdk, 'jre', 'lib', 'amd64', defaultVM + '0')) 321 shutil.copytree(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), defaultVM + '0'))
313 322
314 with open(jvmCfg, 'w') as f: 323 with open(jvmCfg, 'w') as f:
315 for line in lines: 324 for line in lines:
316 f.write(line) 325 f.write(line)
317 326
388 buildSuffix = 'graal' 397 buildSuffix = 'graal'
389 398
390 for build in builds: 399 for build in builds:
391 jdk = _jdk(build, create=True) 400 jdk = _jdk(build, create=True)
392 401
393 vmDir = join(jdk, 'jre', 'lib', 'amd64', vm) 402 vmDir = join(_vmLibDirInJdk(jdk), vm)
394 if not exists(vmDir): 403 if not exists(vmDir):
395 mx.log('Creating VM directory in JDK7: ' + vmDir) 404 mx.log('Creating VM directory in JDK7: ' + vmDir)
396 os.makedirs(vmDir) 405 os.makedirs(vmDir)
397 406
398 def filterXusage(line): 407 def filterXusage(line):
432 env.pop('LD_LIBRARY_PATH', None) 441 env.pop('LD_LIBRARY_PATH', None)
433 env.pop('CLASSPATH', None) 442 env.pop('CLASSPATH', None)
434 443
435 mx.run([mx.gmake_cmd(), build + buildSuffix], cwd=join(_graal_home, 'make'), err=filterXusage) 444 mx.run([mx.gmake_cmd(), build + buildSuffix], cwd=join(_graal_home, 'make'), err=filterXusage)
436 445
437 jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg') 446 jvmCfg = join(_vmLibDirInJdk(jdk), 'jvm.cfg')
438 found = False 447 found = False
439 if not exists(jvmCfg): 448 if not exists(jvmCfg):
440 mx.abort(jvmCfg + ' does not exist') 449 mx.abort(jvmCfg + ' does not exist')
441 450
442 prefix = '-' + vm 451 prefix = '-' + vm
795 flavor = 'intel' 804 flavor = 'intel'
796 if 'att' in args: 805 if 'att' in args:
797 flavor = 'att' 806 flavor = 'att'
798 build = _vmbuild if _vmSourcesAvailable else 'product' 807 build = _vmbuild if _vmSourcesAvailable else 'product'
799 lib = mx.lib_suffix('hsdis-amd64') 808 lib = mx.lib_suffix('hsdis-amd64')
800 path = join(_jdk(build), 'jre', 'lib', 'amd64', lib) 809 path = join(_vmLibDirInJdk(_jdk(build)), lib)
801 mx.download(path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavor + "/" + lib]) 810 mx.download(path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavor + "/" + lib])
802 811
803 def mx_init(): 812 def mx_init():
804 _vmbuild = 'product' 813 _vmbuild = 'product'
805 commands = { 814 commands = {