/hg/icedtea6: Complete work on PR1119 by making javax.security.s...

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Fri Jan 25 07:17:30 PST 2013


changeset 14c3c86148a4 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=14c3c86148a4
author: Andrew John Hughes <gnu.andrew at redhat.com>
date: Fri Jan 25 15:16:55 2013 +0000

	Complete work on PR1119 by making javax.security.sasl.Sasl conditional and working with empty ICEDTEA_BOOTSTRAP_CLASSES.

	2013-01-25  Andrew John Hughes  <gnu.andrew at 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):  Initialise to
		empty.  Make the inclusion of
		javax.security.sasl.Sasl dependent on the
		CREDENTIALS field being missing.
		* acinclude.m4:
		(IT_CHECK_FOR_STATIC_FIELD): New method to
		check for a static field.
		* configure.ac: Invoke IT_CHECK_FOR_STATIC_FIELD
		for javax.security.sasl.Sasl.CREDENTIALS.

	2012-08-16  Andrew John Hughes  <gnu_andrew at member.fsf.org>

		* Makefile.am:
		(rt-class-files.stamp): Add test of contents of
		ICEDTEA_BOOTSTRAP_CLASSES.  Note; need to use grep as
		field contains whitespace.
		(rt.stamp): Likewise.

	2010-09-14  Andrew John Hughes  <ahughes at redhat.com>

		* Makefile.am,
		(rt-source-files.txt): Remove any existing
		version prior to generation to avoid duplication
		of source files.


diffstat:

 ChangeLog    |  31 +++++++++++++++++++++++++++++++
 Makefile.am  |  28 +++++++++++++++++++---------
 acinclude.m4 |  56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac |   3 +++
 4 files changed, 109 insertions(+), 9 deletions(-)

diffs (181 lines):

diff -r 5c83d26b2437 -r 14c3c86148a4 ChangeLog
--- a/ChangeLog	Wed Jan 23 20:58:41 2013 +0000
+++ b/ChangeLog	Fri Jan 25 15:16:55 2013 +0000
@@ -1,3 +1,34 @@
+2013-01-25  Andrew John Hughes  <gnu.andrew at 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):  Initialise to
+	empty.  Make the inclusion of
+	javax.security.sasl.Sasl dependent on the
+	CREDENTIALS field being missing.
+	* acinclude.m4:
+	(IT_CHECK_FOR_STATIC_FIELD): New method to
+	check for a static field.
+	* configure.ac: Invoke IT_CHECK_FOR_STATIC_FIELD
+	for javax.security.sasl.Sasl.CREDENTIALS.
+
+2012-08-16  Andrew John Hughes  <gnu_andrew at member.fsf.org>
+
+	* Makefile.am:
+	(rt-class-files.stamp): Add test of contents of
+	ICEDTEA_BOOTSTRAP_CLASSES.  Note; need to use grep as
+	field contains whitespace.
+	(rt.stamp): Likewise.
+
+2010-09-14  Andrew John Hughes  <ahughes at redhat.com>
+
+	* Makefile.am,
+	(rt-source-files.txt): Remove any existing
+	version prior to generation to avoid duplication
+	of source files.
+
 2013-01-23  Andrew John Hughes  <gnu.andrew at redhat.com>
 
 	CA172, PR1266: Add ARM hardfloat support to CACAO.
diff -r 5c83d26b2437 -r 14c3c86148a4 Makefile.am
--- a/Makefile.am	Wed Jan 23 20:58:41 2013 +0000
+++ b/Makefile.am	Fri Jan 25 15:16:55 2013 +0000
@@ -63,9 +63,7 @@
 
 # Sources used from OpenJDK.
 
-# PR54275 - sun.security.sasl requires missing Sasl.CREDENTIALS field
-ICEDTEA_BOOTSTRAP_CLASSES = \
-	$(SHARE)/javax/security/sasl/Sasl.java
+ICEDTEA_BOOTSTRAP_CLASSES =
 
 #PR42003 - Missing javax.swing.plaf.basic.BasicDirectoryModel methods cause OpenJDK build failure 
 if LACKS_JAVAX_SWING_PLAF_BASIC_BASICDIRECTORYMODEL_ADDPROPERTYCHANGELISTENER
@@ -123,6 +121,12 @@
 	$(SHARE)/javax/security/auth/kerberos/KerberosTicket.java
 endif
 
+# PR54275 - sun.security.sasl requires missing Sasl.CREDENTIALS field
+if LACKS_JAVAX_SECURITY_SASL_SASL_CREDENTIALS
+ICEDTEA_BOOTSTRAP_CLASSES += \
+	$(SHARE)/javax/security/sasl/Sasl.java
+endif
+
 # Flags
 MEMORY_LIMIT = -J-Xmx1024m
 IT_CFLAGS=$(CFLAGS) $(ARCHFLAG)
@@ -2555,18 +2559,22 @@
 
 # rt.jar additional class files.
 rt-source-files.txt: $(OPENJDK_ECJ_TREE)
+	rm -f $@
 	for files in $(ICEDTEA_BOOTSTRAP_CLASSES) ; \
 	do \
 	  echo $$files >> $@ ; \
 	done
+	touch $@
 
 stamps/rt-class-files.stamp: $(INITIAL_BOOTSTRAP_LINK_STAMP) rt-source-files.txt
 if BOOTSTRAPPING
 	mkdir -p lib/rt
-	$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) -d lib/rt \
-          -sourcepath $(SOURCEPATH_DIRS) -bootclasspath \'\' \
-          -classpath $(SYSTEM_JDK_DIR)/jre/lib/rt.jar \
-	  @rt-source-files.txt ;
+	if echo $(ICEDTEA_BOOTSTRAP_CLASSES) | grep '\S' &> /dev/null ; then \
+	  $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) -d lib/rt \
+            -classpath $(SYSTEM_JDK_DIR)/jre/lib/rt.jar \
+            -sourcepath $(SOURCEPATH_DIRS) \
+	    -bootclasspath \'\' @rt-source-files.txt ; \
+	fi
 endif
 	mkdir -p stamps
 	touch stamps/rt-class-files.stamp
@@ -2586,8 +2594,10 @@
 stamps/rt.stamp: stamps/rt-class-files.stamp
 	mkdir -p stamps
 if BOOTSTRAPPING
-	$(BOOT_DIR)/bin/jar uf $(RUNTIME) -C lib/rt com -C lib/rt java \
-	  -C lib/rt javax -C lib/rt sun 
+	if echo $(ICEDTEA_BOOTSTRAP_CLASSES) | grep '\S' &> /dev/null ; then \
+	  $(BOOT_DIR)/bin/jar uf $(RUNTIME) -C lib/rt com -C lib/rt java \
+	    -C lib/rt javax -C lib/rt sun ; \
+	fi 
 endif
 	touch stamps/rt.stamp
 
diff -r 5c83d26b2437 -r 14c3c86148a4 acinclude.m4
--- a/acinclude.m4	Wed Jan 23 20:58:41 2013 +0000
+++ b/acinclude.m4	Fri Jan 25 15:16:55 2013 +0000
@@ -1938,3 +1938,59 @@
 AM_CONDITIONAL([LACKS_$1], test x"${it_cv_$1}" = "xyes")
 AC_PROVIDE([$0])dnl
 ])
+
+dnl Generic macro to check for a Java field
+dnl Takes five arguments: the name of the macro,
+dnl the name of the field and the name of the class.
+dnl The macro name is usually the name of the class
+dnl with '.' replaced by '_' and all letters
+dnl capitalised.
+dnl e.g. IT_CHECK_FOR_FIELD([JAVAX_SECURITY_SASL_SASL_CREDENTIALS],
+dnl [CREDENTIALS], [javax.security.sasl.Sasl])
+AC_DEFUN([IT_CHECK_FOR_STATIC_FIELD],[
+AC_REQUIRE([IT_CHECK_JAVA_AND_JAVAC_WORK])
+AC_CACHE_CHECK([if $3.$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.Field;
+
+public class Test
+{
+  public static void main(String[] args)
+  {
+    Class<?> cl = $3.class;
+    try
+      {
+        Field f = cl.getDeclaredField("$2");
+	System.err.println("Field found: " + f);
+	System.err.println("Field value: " + $3.$2);
+      }
+    catch (NoSuchFieldException e)
+      {
+        System.exit(-1);
+      }
+  }
+
+}
+]
+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
+])
diff -r 5c83d26b2437 -r 14c3c86148a4 configure.ac
--- a/configure.ac	Wed Jan 23 20:58:41 2013 +0000
+++ b/configure.ac	Fri Jan 25 15:16:55 2013 +0000
@@ -116,6 +116,9 @@
   [new javax.security.auth.kerberos.KerberosTicket(null,null,null,null,0,null,null,null,null,null,null).getSessionKeyType()]
 )
 
+# PR54275 - sun.security.sasl requires missing Sasl.CREDENTIALS field
+IT_CHECK_FOR_STATIC_FIELD([JAVAX_SECURITY_SASL_SASL_CREDENTIALS],[CREDENTIALS],[javax.security.sasl.Sasl])
+
 # 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)



More information about the distro-pkg-dev mailing list