1
1

Make the Java wrapper compiler behave like the other wrapper compilers

(specifically, with regards to the --showme flag and return code).

This commit was SVN r29270.
Этот коммит содержится в:
Jeff Squyres
2013-09-26 22:48:51 +00:00
родитель e139f4427a
Коммит c065839d1f

Просмотреть файл

@ -3,7 +3,7 @@
# WARNING: DO NOT EDIT THE mpijava.pl FILE AS IT IS GENERATED! # WARNING: DO NOT EDIT THE mpijava.pl FILE AS IT IS GENERATED!
# MAKE ALL CHANGES IN mpijava.pl.in # MAKE ALL CHANGES IN mpijava.pl.in
# Copyright (c) 2011 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
use strict; use strict;
@ -31,6 +31,7 @@ my $my_arg;
# Cannot use the usual GetOpts library as the user might # Cannot use the usual GetOpts library as the user might
# be passing -options to the Java compiler! So have to # be passing -options to the Java compiler! So have to
# parse the options ourselves to look for help and showme # parse the options ourselves to look for help and showme
my @save_args;
foreach $my_arg (@ARGV) { foreach $my_arg (@ARGV) {
if ($my_arg eq "-h" || if ($my_arg eq "-h" ||
$my_arg eq "--h" || $my_arg eq "--h" ||
@ -38,17 +39,15 @@ foreach $my_arg (@ARGV) {
$my_arg eq "--help") { $my_arg eq "--help") {
print "Options: print "Options:
--showme Show the wrapper compiler command without executing it --showme Show the wrapper compiler command without executing it
--verbose Show the wrapper compiler command *and* execute it
--help | -h This help list\n"; --help | -h This help list\n";
exit; exit(0);
} elsif ($my_arg eq "-showme" || } elsif ($my_arg eq "--showme") {
$my_arg eq "--showme") {
$showme_arg = 1; $showme_arg = 1;
shift(@ARGV); } elsif ($my_arg eq "--verbose") {
} elsif ($my_arg eq "-verbose" ||
$my_arg eq "-v" ||
$my_arg eq "--verbose") {
$verbose = 1; $verbose = 1;
shift(@ARGV); } else {
push(@save_args, $my_arg);
} }
} }
@ -61,7 +60,7 @@ my $where;
my $where2; my $where2;
my $cp_found = 0; my $cp_found = 0;
my $my_cp; my $my_cp;
foreach $my_arg (@ARGV) { foreach $my_arg (@save_args) {
if (1 == $cp_found) { if (1 == $cp_found) {
$where = index($my_arg, "mpi.jar"); $where = index($my_arg, "mpi.jar");
if ($where < 0) { if ($where < 0) {
@ -145,6 +144,5 @@ if ($showme_arg) {
print "$my_compiler @arguments\n"; print "$my_compiler @arguments\n";
} }
$returnCode = system $my_compiler, @arguments; $returnCode = system $my_compiler, @arguments;
$returnCode = $returnCode > 0 ? 1:0;
} }
exit $returnCode; exit $returnCode;