Mercurial > hg > graal-compiler
comparison mxtool/mx.py @ 4148:bf5efc22fb3f
Replace downloading of JDK 7 with copying of host JDK 7.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 20 Dec 2011 10:14:52 +0100 |
parents | 55376d8953a6 |
children | cf4de9cc1268 |
comparison
equal
deleted
inserted
replaced
4147:55376d8953a6 | 4148:bf5efc22fb3f |
---|---|
479 | 479 |
480 os.environ['JAVA_HOME'] = opts.java_home | 480 os.environ['JAVA_HOME'] = opts.java_home |
481 os.environ['HOME'] = opts.user_home | 481 os.environ['HOME'] = opts.user_home |
482 | 482 |
483 commandAndArgs = opts.__dict__.pop('commandAndArgs') | 483 commandAndArgs = opts.__dict__.pop('commandAndArgs') |
484 | |
485 for s in suites(): | |
486 mod = s.commands | |
487 if hasattr(mod is not None and mod, 'mx_post_parse_cmd_line'): | |
488 mod.mx_post_parse_cmd_line(opts) | |
489 | |
490 return opts, commandAndArgs | 484 return opts, commandAndArgs |
491 | 485 |
492 def _format_commands(): | 486 def _format_commands(): |
493 msg = '\navailable commands:\n\n' | 487 msg = '\navailable commands:\n\n' |
494 for cmd in sorted(commands.iterkeys()): | 488 for cmd in sorted(commands.iterkeys()): |
583 self.java_args_pfx = sum(map(delAtAndSplit, _opts.java_args_pfx), []) | 577 self.java_args_pfx = sum(map(delAtAndSplit, _opts.java_args_pfx), []) |
584 self.java_args_sfx = sum(map(delAtAndSplit, _opts.java_args_sfx), []) | 578 self.java_args_sfx = sum(map(delAtAndSplit, _opts.java_args_sfx), []) |
585 | 579 |
586 # Prepend the -d64 VM option only if the java command supports it | 580 # Prepend the -d64 VM option only if the java command supports it |
587 try: | 581 try: |
588 subprocess.check_output([self.java, '-d64', '-version'], stderr=subprocess.STDOUT) | 582 output = subprocess.check_output([self.java, '-d64', '-version'], stderr=subprocess.STDOUT) |
589 self.java_args = ['-d64'] + self.java_args | 583 self.java_args = ['-d64'] + self.java_args |
590 except subprocess.CalledProcessError as e: | 584 except subprocess.CalledProcessError as e: |
591 try: | 585 try: |
592 subprocess.check_output([self.java, '-version'], stderr=subprocess.STDOUT) | 586 output = subprocess.check_output([self.java, '-version'], stderr=subprocess.STDOUT) |
593 except subprocess.CalledProcessError as e: | 587 except subprocess.CalledProcessError as e: |
594 print e.output | 588 print e.output |
595 abort(e.returncode) | 589 abort(e.returncode) |
590 | |
591 output = output.split() | |
592 assert output[1] == 'version' | |
593 self.version = output[2].strip('"') | |
596 | 594 |
597 if self.debug: | 595 if self.debug: |
598 self.java_args += ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000'] | 596 self.java_args += ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000'] |
599 | 597 |
600 def format_cmd(self, args): | 598 def format_cmd(self, args): |
1127 cwdMxDir = join(os.getcwd(), 'mx') | 1125 cwdMxDir = join(os.getcwd(), 'mx') |
1128 if exists(cwdMxDir) and isdir(cwdMxDir): | 1126 if exists(cwdMxDir) and isdir(cwdMxDir): |
1129 _loadSuite(os.getcwd(), True) | 1127 _loadSuite(os.getcwd(), True) |
1130 | 1128 |
1131 opts, commandAndArgs = _argParser._parse_cmd_line() | 1129 opts, commandAndArgs = _argParser._parse_cmd_line() |
1130 | |
1132 global _opts, _java | 1131 global _opts, _java |
1133 _opts = opts | 1132 _opts = opts |
1134 _java = JavaConfig(opts) | 1133 _java = JavaConfig(opts) |
1134 | |
1135 for s in suites(): | |
1136 if s.commands is not None and hasattr(s.commands, 'mx_post_parse_cmd_line'): | |
1137 s.commands.mx_post_parse_cmd_line(opts) | |
1135 | 1138 |
1136 if len(commandAndArgs) == 0: | 1139 if len(commandAndArgs) == 0: |
1137 _argParser.print_help() | 1140 _argParser.print_help() |
1138 return | 1141 return |
1139 | 1142 |