Mercurial > hg > release > icedtea6-1.12
view javac.in @ 3013:410b4993d8df
Avoid referring to the bootstrap runtime library when compiling the JDK, so as to avoid version conflicts.
2013-07-09 Andrew John Hughes <gnu.andrew@redhat.com>
* Makefile.am:
(ICEDTEA_ECJ_PATCHES): Add new patch.
* patches/ecj/jcp-importsources.patch:
Include imported JAXP sources in sourcepath
when building org.jcp code.
2013-07-09 Omair Majid <omajid@redhat.com>
* patches/ecj/needs-6.patch: Build additional code
using -source 6.
2013-05-15 Andrew John Hughes <gnu.andrew@member.fsf.org>
* Makefile.am:
(ICEDTEA_BOOTSTRAP_CLASSES): Add java.sql.SQLException
if any of the constructors are missing.
* javac.in: Handle -Xbootclasspath/p, -Xbootclasspath
and -Xbootclasspath/a by prepending, setting or appending
its value to the bootclasspath option used to ecj,
respectively.
* configure.ac: Test for the java.sql.SQLException
constructors.
* patches/ecj/icedtea.patch:
Drop addition of ICEDTEA_RT in common/Rules.gmk in JDK
altogether.
* patches/ecj/needs-6.patch:
Add java.awt Makefile.
author | Andrew John Hughes <gnu.andrew@redhat.com> |
---|---|
date | Wed, 10 Jul 2013 14:25:35 +0100 |
parents | cea49ba2afcd |
children |
line wrap: on
line source
#!/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 $JAVAC_WARNINGS="-nowarn"; my @bcoption; my @bcoptionsp = grep {$_ =~ '^-Xbootclasspath/p:' } @ARGV; my @bcoptions = grep {$_ =~ '^-Xbootclasspath:' } @ARGV; my @bcoptionsa = grep {$_ =~ '^-Xbootclasspath/a:' } @ARGV; my $bcp = $bcoptionsp[0]; my $bc = $bcoptions[0]; my $bca = $bcoptionsa[0]; my $systembc = glob '@abs_top_builddir@/bootstrap/jdk1.6.0/jre/lib/rt.jar'; if ($bcp) { $bcp =~ s/^[^:]*://; $systembc = join ":", $bcp, $systembc; } if ($bc) { $bc =~ s/^[^:]*://; $systembc = $bc; } if ($bca) { $bca =~ s/^[^:]*://; $systembc = join ":", $systembc, $bca; } push @bcoption, '-bootclasspath', $systembc unless grep {$_ eq '-bootclasspath'} @ARGV; my @ecj_parms = ($ECJ_WARNINGS, @bcoption); my @javac_parms = ($JAVAC_WARNINGS, '-Xprefer:source', '-XDignore.symbol.file=true'); # 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); } if ( -e "@abs_top_builddir@/native-ecj" ) { my $ecj_args = gen_ecj_opts( \@ARGV ); exec '@abs_top_builddir@/native-ecj', @ecj_parms, @$ecj_args ; } elsif ( -e "@JAVAC@" ) { if ("@USING_ECJ@" eq "yes") { my $ecj_args = gen_ecj_opts( \@ARGV ); exec '@JAVAC@', @ecj_parms, @$ecj_args ; } else { exec '@JAVAC@', @javac_parms, @ARGV ; } } elsif ( -e "@ECJ_JAR@" ) { 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; } else { print STDERR "No Java compiler to run"; exit -1; }