sera        14/07/14 18:45:53

  Added:                javac.in
  Log:
  Add missing versions for 4.7 and 4.8
  Fix 4.7.3 to be able to build ant-core-1.9 #489266
  Thanks to Andrew John Hughes <gnu_and...@member.fsf.org> for the javac 
wrapper und for providing new API diffs
  Drop 4.5 and 4.6 as they are to old to build current icedtea:7
  Drop ia64 ppc ppc64 on 4.8 as the correspondig gcc is missing those keywords
  
  (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 
3C5CF75A)

Revision  Changes    Path
1.1                  dev-java/gcj-jdk/files/javac.in

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/gcj-jdk/files/javac.in?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/gcj-jdk/files/javac.in?rev=1.1&content-type=text/plain

Index: javac.in
===================================================================
#!/usr/bin/perl -w
use strict;
use constant NO_DUP_ARGS => qw(-source -target -d -encoding);
use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:);

my $ECJ_WARNINGS="-nowarn";

my ( @bcoption, @source15, @target15, @cp );
push @bcoption, '-bootclasspath', '@RT_JAR@:@TOOLS_JAR@'
    unless grep {$_ eq '-bootclasspath'} @ARGV;
push @source15, '-source', '1.5'
    unless grep {$_ eq '-source'} @ARGV;
push @target15, '-target', '1.5'
    unless grep {$_ eq '-target'} @ARGV;  
push @cp, '-cp', '.'
    unless grep {$_ =~ '\-c(p|lasspath)'} @ARGV or $ENV{CLASSPATH};
my @ecj_parms = ($ECJ_WARNINGS, @bcoption, @source15, @target15, @cp);

# Work around ecj's inability to handle duplicate command-line
# options and unknown javac options.
sub gen_ecj_opts
{
    my @new_args = @{$_[0]};

    for my $opt (NO_DUP_ARGS) 
    {
        my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
        if (@indices > 1) {
            shift @indices;    # keep last instance only
            splice @new_args, $_, 2 for @indices;
        }
    }

    for my $opt (STRIP_ARGS) 
    {
        my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
        splice @new_args, $_, 1 for @indices;
    }

    return \@new_args;
}

sub split_vm_args
{
    my @new_args = @{$_[0]};

    my @vm_args = map { substr $_, 2 } grep $_ =~ /^-J/, @new_args;
    my @javac_args = grep $_ !~ /^-J/, @new_args;

    return (\@vm_args, \@javac_args);
}

my ($vm_args, $javac_args) = split_vm_args (gen_ecj_opts( \@ARGV ));
my @CLASSPATH = ('@ECJ_JAR@');
push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"};
$ENV{"CLASSPATH"} = join ':', @CLASSPATH;
exec '@JAVA@', @$vm_args, 'org.eclipse.jdt.internal.compiler.batch.Main', 
@ecj_parms, @$javac_args;




Reply via email to