changeset 2487:f75092cac189

Only build bootstrap classes with source/target 1.6 if the VM doesn't support 1.7 bytecode. 2011-09-30 Andrew John Hughes <ahughes@redhat.com> * Makefile.am: (ICEDTEA_BOOT_PATCHES): Only apply use_target_6_for_bootstrap_classes if 1.7 bytecode is not supported by the VM. Fixes bootstrap with IcedTea7. * acinclude.m4: (IT_BYTECODE7_CHECK): Check if the VM supports 1.7 bytecode. * configure.ac: Call IT_BYTECODE7_CHECK.
author Andrew John Hughes <ahughes@redhat.com>
date Fri, 30 Sep 2011 04:07:32 +0100
parents 05ed8db6b216
children cbaa865cf6f3
files ChangeLog Makefile.am acinclude.m4 configure.ac
diffstat 4 files changed, 50 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Sep 28 23:07:52 2011 +0100
+++ b/ChangeLog	Fri Sep 30 04:07:32 2011 +0100
@@ -1,3 +1,15 @@
+2011-09-30  Andrew John Hughes  <ahughes@redhat.com>
+
+	* Makefile.am:
+	(ICEDTEA_BOOT_PATCHES): Only apply
+	use_target_6_for_bootstrap_classes if 1.7
+	bytecode is not supported by the VM.  Fixes
+	bootstrap with IcedTea7.
+	* acinclude.m4:
+	(IT_BYTECODE7_CHECK): Check if the VM supports
+	1.7 bytecode.
+	* configure.ac: Call IT_BYTECODE7_CHECK.
+
 2011-09-27  Andrew John Hughes  <ahughes@redhat.com>
 
 	* Makefile.am:
--- a/Makefile.am	Wed Sep 28 23:07:52 2011 +0100
+++ b/Makefile.am	Fri Sep 30 04:07:32 2011 +0100
@@ -318,8 +318,7 @@
 	patches/boot/ecj-multicatch.patch \
 	patches/boot/ecj-trywithresources.patch \
 	patches/boot/ecj-autoboxing.patch \
-	patches/boot/xsltproc.patch \
-	patches/boot/use_target_6_for_bootstrap_classes.patch 
+	patches/boot/xsltproc.patch
 
 if CP39408_JAVAH
 ICEDTEA_BOOT_PATCHES += patches/boot/pr39408.patch
@@ -364,6 +363,10 @@
 ICEDTEA_BOOT_PATCHES += patches/boot/jaxws-getdtdtype.patch
 endif
 
+if NO_BYTECODE7
+ICEDTEA_BOOT_PATCHES +=	patches/boot/use_target_6_for_bootstrap_classes.patch 
+endif
+
 ICEDTEA_BOOT_PATCHES += $(DISTRIBUTION_BOOT_PATCHES)
 
 # OpenJDK build environment.
--- a/acinclude.m4	Wed Sep 28 23:07:52 2011 +0100
+++ b/acinclude.m4	Fri Sep 30 04:07:32 2011 +0100
@@ -2146,3 +2146,35 @@
   AC_MSG_RESULT(${ALT_JAMVM_SRC_ZIP})
   AC_SUBST(ALT_JAMVM_SRC_ZIP)
 ])
+
+AC_DEFUN([IT_BYTECODE7_CHECK],[
+AC_CACHE_CHECK([if the VM lacks support for 1.7 bytecode], it_cv_bytecode7, [
+CLASS=Test.java
+BYTECODE=$(echo $CLASS|sed 's#\.java##')
+mkdir tmp.$$
+cd tmp.$$
+cat << \EOF > $CLASS
+[/* [#]line __oline__ "configure" */
+public class Test 
+{
+  public static void main(String[] args)
+  {
+  }
+}]
+EOF
+if $JAVAC -cp . $JAVACFLAGS -source 7 -target 7 $CLASS >&AS_MESSAGE_LOG_FD 2>&1 ; then
+  if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1 ; then
+    it_cv_bytecode7=no;
+  else
+    it_cv_bytecode7=yes;
+  fi
+else
+  it_cv_bytecode7=yes;
+fi
+])
+rm -f $CLASS *.class
+cd ..
+rmdir tmp.$$
+AM_CONDITIONAL([NO_BYTECODE7], test x"${it_cv_bytecode7}" = "xyes")
+AC_PROVIDE([$0])dnl
+])
--- a/configure.ac	Wed Sep 28 23:07:52 2011 +0100
+++ b/configure.ac	Fri Sep 30 04:07:32 2011 +0100
@@ -118,6 +118,7 @@
 IT_CHECK_FOR_CLASS([SUN_AWT_TOOLKIT], [sun.awt.SunToolkit])
 IT_CHECK_ENABLE_WARNINGS
 IT_DIAMOND_CHECK
+IT_BYTECODE7_CHECK
 
 IT_FIND_RHINO_JAR
 IT_WITH_OPENJDK_SRC_ZIP