view javac.in @ 2676:fef0a957b4af default tip

PR3679: Use the internal copy of the SunEC library rather than statically linking against NSS 2019-01-08 Andrew John Hughes <gnu_andrew@member.fsf.org> PR3679: Use the internal copy of the SunEC library rather than statically linking against NSS * patches/disable-intree-ec.patch: Removed. * patches/nss-config.patch: Removed. * patches/nss-not-enabled-config.patch: Removed. * patches/nss-not-enabled-config-with-sunec.patch: Renamed to patches/pkcs11-nss-not-enabled-config.patch. * patches/nss-config-with-sunec.patch: Renamed to patches/pkcs11-nss-config.patch. * INSTALL: Remove --enable-sunec option. Update documentation to match current situation with SunEC. * Makefile.am: (ICEDTEA_PATCHES): Remove disable-intree-ec.patch. Remove PKCS11 config patches without the SunEC provider. Rename remaining two to make it clear they are for the PKCS11 provider. (ICEDTEA_CONFIGURE): Remove use of system-nss option which no longer exists, following PR3679. (ICEDTEA_ENV): Remove NSS_LIBS and NSS_CFLAGS. (check-ecc): Argument passed to the test should now be "yes". * NEWS: Updated. * acinclude.m4: (IT_ENABLE_SUNEC): Removed. * configure.ac: Replace IT_ENABLE_SUNEC call with IT_LOCATE_NSS. * fsg.sh.in: Remove unused source code and use new PR3679 patch instead of old PR2126 patch which only alters Java code. * patches/pr3679.patch: Renamed from patches/pr2126.patch, updated to OpenJDK 9 paths and extended to patch native code. * patches/rh1022017.patch: Updated to OpenJDK 9 paths. * remove-intree-libraries.sh.in: Drop conditional removal of SunEC code.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Fri, 11 Jan 2019 03:04:42 +0000
parents e40064fec5cb
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_1 => qw(-Werror -implicit:none);
use constant STRIP_ARGS_2 => qw(-Xmaxwarns);

my ($ECJ_WARNINGS, $JAVAC_WARNINGS);

if ("@ENABLE_WARNINGS@" eq "yes")
{
    $ECJ_WARNINGS="-warn:-deprecation,serial,unused,warningToken";
    $JAVAC_WARNINGS="-Xlint:unchecked,cast,divzero,empty,finally,overrides";
}
else
{
    $ECJ_WARNINGS="-nowarn";
    $JAVAC_WARNINGS="-nowarn";
}

my @bcoption;
push @bcoption, '-bootclasspath', glob '@abs_top_builddir@/bootstrap/jdk1.7.0/jre/lib/rt.jar'
    unless grep {$_ eq '-bootclasspath'} @ARGV;
my @ecj_parms = ($ECJ_WARNINGS, @bcoption);
my @javac_parms = ($JAVAC_WARNINGS, '-Xprefer:source',
		   '-XDignore.symbol.file=true', '-J-Xmx1024m');

# 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_1) 
    {
	my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
	splice @new_args, $_, 1 for @indices;
    }

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

    return @new_args;
}

if ( -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 ;
    }
}
else
{
    my @ecj_args = gen_ecj_opts( \@ARGV );
    my @CLASSPATH = ('@ECJ_JAR@');
    push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"};
    $ENV{"CLASSPATH"} = join ':', @CLASSPATH;
    exec '@JAVA@', 'org.eclipse.jdt.internal.compiler.batch.Main', @ecj_parms, @ecj_args;
}