Mercurial > hg > release > icedtea6-1.12
changeset 2902:c1c7d4617bea
PR1119: Test explicitly if javax.swing.plaf.basic.BasicDirectoryModel.addPropertyChangeListener is missing (GCC#42003).
2012-09-19 Andrew John Hughes <gnu.andrew@redhat.com>
PR1119: Only add classes to rt-source-files.txt if the class (or one or more of its methods/fields)
are actually missing from the boot JDK
* Makefile.am:
(ICEDTEA_BOOTSTRAP_CLASSES): Only include
javax.swing.plaf.basic.BasicDirectoryModel if
PR42003 is present in the boot JDK.
* NEWS: List PR1119. Correct previous use of
PR1119 which should be PR1121.
* acinclude.m4:
(IT_FIND_JAVAC): Add missing requirement of
IT_CHECK_FOR_JDK.
(IT_FIND_JAVA): Likewise.
(IT_FIND_JAVAH): Likewise.
(IT_FIND_JAR): Likewise.
(IT_FIND_RMIC): Likewise.
(IT_FIND_NATIVE2ASCII): Likewise.
(IT_CHECK_FOR_METHOD): New macro to check
for a method both at build-time and run-time.
* configure.ac: Call IT_CHECK_FOR_METHOD
for javax.swing.plaf.basic.BasicDirectoryModel.addPropertyChangeListener.
author | Andrew John Hughes <ahughes@redhat.com> |
---|---|
date | Wed, 19 Sep 2012 23:24:23 +0100 |
parents | 7fe15479d719 |
children | 36b093404170 |
files | ChangeLog Makefile.am NEWS acinclude.m4 configure.ac |
diffstat | 5 files changed, 103 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Sep 03 20:06:53 2012 +0200 +++ b/ChangeLog Wed Sep 19 23:24:23 2012 +0100 @@ -1,3 +1,26 @@ +2012-09-19 Andrew John Hughes <gnu.andrew@redhat.com> + + PR1119: Only add classes to rt-source-files.txt if the class (or one or more of its methods/fields) + are actually missing from the boot JDK + * Makefile.am: + (ICEDTEA_BOOTSTRAP_CLASSES): Only include + javax.swing.plaf.basic.BasicDirectoryModel if + PR42003 is present in the boot JDK. + * NEWS: List PR1119. Correct previous use of + PR1119 which should be PR1121. + * acinclude.m4: + (IT_FIND_JAVAC): Add missing requirement of + IT_CHECK_FOR_JDK. + (IT_FIND_JAVA): Likewise. + (IT_FIND_JAVAH): Likewise. + (IT_FIND_JAR): Likewise. + (IT_FIND_RMIC): Likewise. + (IT_FIND_NATIVE2ASCII): Likewise. + (IT_CHECK_FOR_METHOD): New macro to check + for a method both at build-time and run-time. + * configure.ac: Call IT_CHECK_FOR_METHOD + for javax.swing.plaf.basic.BasicDirectoryModel.addPropertyChangeListener. + 2012-09-03 Mark Wielaard <mark@klomp.org> * Makefile.am (ICEDTEA_PATCHES): Add missing backslash after
--- a/Makefile.am Mon Sep 03 20:06:53 2012 +0200 +++ b/Makefile.am Wed Sep 19 23:24:23 2012 +0100 @@ -68,7 +68,6 @@ # PR54274 - sun.security.other requires missing X509CRLSelector methods # PR54275 - sun.security.sasl requires missing Sasl.CREDENTIALS field ICEDTEA_BOOTSTRAP_CLASSES = \ - $(SHARE)/javax/swing/plaf/basic/BasicDirectoryModel.java \ $(SHARE)/javax/management/StandardMBean.java \ $(SHARE)/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java \ $(SHARE)/java/security/cert/X509CRLSelector.java \ @@ -76,6 +75,12 @@ $(SHARE)/javax/security/sasl/Sasl.java \ $(SHARE)/javax/security/auth/kerberos/KerberosTicket.java +#PR42003 - Missing javax.swing.plaf.basic.BasicDirectoryModel methods cause OpenJDK build failure +if LACKS_JAVAX_SWING_PLAF_BASIC_BASICDIRECTORYMODEL_ADDPROPERTYCHANGELISTENER +ICEDTEA_BOOTSTRAP_CLASSES += \ + $(SHARE)/javax/swing/plaf/basic/BasicDirectoryModel.java +endif + # Flags MEMORY_LIMIT = -J-Xmx1024m IT_CFLAGS=$(CFLAGS) $(ARCHFLAG)
--- a/NEWS Mon Sep 03 20:06:53 2012 +0200 +++ b/NEWS Wed Sep 19 23:24:23 2012 +0100 @@ -23,7 +23,9 @@ - PR1050: Stream objects not garbage collected - PR1113: Add tapset tests to distribution. - PR1117: IcedTea6 prebuilds far too many classes on bootstrap - - PR1119: Old installs still suffer from GCC PR41686 + - PR1121: Old installs still suffer from GCC PR41686 + - PR1119: Only add classes to rt-source-files.txt if the class (or one or more of its methods/fields) + are actually missing from the boot JDK * JamVM - ARMv6 armhf: Changes for Raspbian (Raspberry Pi) - PPC: Don't use lwsync if it isn't supported
--- a/acinclude.m4 Mon Sep 03 20:06:53 2012 +0200 +++ b/acinclude.m4 Wed Sep 19 23:24:23 2012 +0100 @@ -187,6 +187,7 @@ AC_DEFUN_ONCE([IT_FIND_JAVAC], [ + AC_REQUIRE([IT_CHECK_FOR_JDK]) JAVAC_DEFAULT=${SYSTEM_JDK_DIR}/bin/javac AC_MSG_CHECKING([if a javac binary was specified]) AC_ARG_WITH([javac], @@ -219,6 +220,7 @@ AC_DEFUN_ONCE([IT_FIND_JAVA], [ + AC_REQUIRE([IT_CHECK_FOR_JDK]) JAVA_DEFAULT=${SYSTEM_JDK_DIR}/bin/java AC_MSG_CHECKING([if a java binary was specified]) AC_ARG_WITH([java], @@ -372,6 +374,7 @@ AC_DEFUN([IT_FIND_JAVAH], [ + AC_REQUIRE([IT_CHECK_FOR_JDK]) JAVAH_DEFAULT=${SYSTEM_JDK_DIR}/bin/javah AC_MSG_CHECKING([if a javah binary was specified]) AC_ARG_WITH([javah], @@ -409,6 +412,7 @@ AC_DEFUN([IT_FIND_JAR], [ + AC_REQUIRE([IT_CHECK_FOR_JDK]) JAR_DEFAULT=${SYSTEM_JDK_DIR}/bin/jar AC_MSG_CHECKING([if a jar binary was specified]) AC_ARG_WITH([jar], @@ -479,6 +483,7 @@ AC_DEFUN([IT_FIND_RMIC], [ + AC_REQUIRE([IT_CHECK_FOR_JDK]) RMIC_DEFAULT=${SYSTEM_JDK_DIR}/bin/rmic AC_MSG_CHECKING([if a rmic binary was specified]) AC_ARG_WITH([rmic], @@ -516,6 +521,7 @@ AC_DEFUN([IT_FIND_NATIVE2ASCII], [ + AC_REQUIRE([IT_CHECK_FOR_JDK]) NATIVE2ASCII_DEFAULT=${SYSTEM_JDK_DIR}/bin/native2ascii AC_MSG_CHECKING([if a native2ascii binary was specified]) AC_ARG_WITH([native2ascii], @@ -1770,3 +1776,61 @@ AM_CONDITIONAL([CP40188_JAVAH], test x"${it_cv_cp40188_javah}" = "xyes") AC_PROVIDE([$0])dnl ]) + +dnl Generic macro to check for a Java method +dnl Takes four arguments: the name of the macro, +dnl the name of the class, the method signature +dnl and an example call to the method. The macro name +dnl is usually the name of the class with '.' +dnl replaced by '_' and all letters capitalised. +dnl e.g. IT_CHECK_FOR_METHOD([JAVA_UTIL_REGEX_MATCHER_QUOTEREPLACEMENT],[java.util.regex.Matcher.quoteReplacement],[java.util.rgex.Matcher],["quoteReplacement",String.class],java.util.regex.Matcher.quoteReplacement("Blah")) +AC_DEFUN([IT_CHECK_FOR_METHOD],[ +AC_REQUIRE([IT_CHECK_JAVA_AND_JAVAC_WORK]) +AC_CACHE_CHECK([if $2 is missing], it_cv_$1, [ +CLASS=Test.java +BYTECODE=$(echo $CLASS|sed 's#\.java##') +mkdir tmp.$$ +cd tmp.$$ +cat << \EOF > $CLASS +[/* [#]line __oline__ "configure" */ +import java.lang.reflect.Method; + +public class Test +{ + public static void main(String[] args) + { + Class<?> cl = $3.class; + try + { + Method m = cl.getDeclaredMethod($4); + } + catch (NoSuchMethodException e) + { + System.exit(-1); + } + } + + public void dontRun() + { + $5; + } + +} +] +EOF +if $JAVAC -cp . $JAVACFLAGS -source 5 -target 5 -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then + if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then + it_cv_$1=no; + else + it_cv_$1=yes; + fi +else + it_cv_$1=yes; +fi +]) +rm -f $CLASS *.class +cd .. +rmdir tmp.$$ +AM_CONDITIONAL([LACKS_$1], test x"${it_cv_$1}" = "xyes") +AC_PROVIDE([$0])dnl +])
--- a/configure.ac Mon Sep 03 20:06:53 2012 +0200 +++ b/configure.ac Wed Sep 19 23:24:23 2012 +0100 @@ -57,6 +57,13 @@ IT_DISABLE_LANGTOOLS_TESTS IT_DISABLE_JDK_TESTS +IT_CHECK_FOR_METHOD([JAVAX_SWING_PLAF_BASIC_BASICDIRECTORYMODEL_ADDPROPERTYCHANGELISTENER], + [javax.swing.plaf.basic.BasicDirectoryModel.addPropertyChangeListener], + [javax.swing.plaf.basic.BasicDirectoryModel], + ["addPropertyChangeListener",java.beans.PropertyChangeListener.class], + [javax.swing.plaf.basic.BasicDirectoryModel model = new javax.swing.plaf.basic.BasicDirectoryModel(new javax.swing.JFileChooser()); model.addPropertyChangeListener(model)] +) + # Use xvfb-run if found to run gui tests (check-jdk). AC_CHECK_PROG(XVFB_RUN_CMD, xvfb-run, [xvfb-run -a -e xvfb-errors], []) AC_SUBST(XVFB_RUN_CMD) @@ -142,7 +149,6 @@ AC_SUBST(OPENJDK_BUILD_DIR) IT_CHECK_IF_BOOTSTRAPPING -IT_CHECK_FOR_JDK IT_FIND_JAVA IT_FIND_COMPILER IT_FIND_JAVAH