diff options
author | Andrew John Hughes <[email protected]> | 2010-12-01 23:57:54 +0000 |
---|---|---|
committer | Andrew John Hughes <[email protected]> | 2010-12-01 23:57:54 +0000 |
commit | bbf253ee117643e55adcaec29d6d06d45820bad7 (patch) | |
tree | e4716080a98ce984cd9aec665fc9acad48fb5ab3 /acinclude.m4 | |
parent | 3a5bedeee5bb49232b75163fa7d60a0cbb22f89a (diff) |
Detect unpatched AppletViewerPanel so we fail early on plain OpenJDK.
2010-12-01 Andrew John Hughes <[email protected]>
* acinclude.m4:
(IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE):
New check to ensure sun.applet.AppletViewerPanel
is public (via the patch in IcedTea, applet_hole.patch).
* configure.ac: Invoke the above macro. Don't call
IT_CHECK_FOR_CLASS for the same class (the above macro
handles this too).
* README: Mention this limitation.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 67ae380..2e488f9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -605,3 +605,65 @@ EOF AC_SUBST(JAVADOC_KNOWS_J_OPTIONS) AM_CONDITIONAL([JAVADOC_SUPPORTS_J_OPTIONS], test x"${JAVADOC_KNOWS_J_OPTIONS}" = "xyes") ]) + +dnl Checks that sun.applet.AppletViewerPanel is available +dnl and public (via the patch in IcedTea6, applet_hole.patch) +dnl Can be removed when that is upstream or unneeded +AC_DEFUN([IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE],[ +AC_REQUIRE([IT_FIND_JAVAC]) +AC_REQUIRE([IT_FIND_JAVA]) +AC_CACHE_CHECK([if sun.applet.AppletViewerPanel is available and public], it_cv_applet_hole, [ +CLASS=TestAppletViewer.java +BYTECODE=$(echo $CLASS|sed 's#\.java##') +mkdir -p tmp.$$ +cd tmp.$$ +cat << \EOF > $CLASS +[/* [#]line __oline__ "configure" */ +import java.lang.reflect.Modifier; + +public class TestAppletViewer +{ + public static void main(String[] args) + { + try + { + Class<?> clazz = Class.forName("sun.applet.AppletViewerPanel"); + if (Modifier.isPublic(clazz.getModifiers())) + { + System.err.println("Found public sun.applet.AppletViewerPanel"); + System.exit(0); + } + System.err.println("Found non-public sun.applet.AppletViewerPanel"); + System.exit(2); + } + catch (ClassNotFoundException e) + { + System.err.println("Could not find sun.applet.AppletViewerPanel"); + System.exit(1); + } + } +} +] +EOF +if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then + if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then + it_cv_applet_hole=yes; + else + it_cv_applet_hole=$?; + fi +else + it_cv_applet_hole=3; +fi +]) +rm -f $CLASS *.class +cd .. +rmdir tmp.$$ +if test x"${it_cv_applet_hole}" = "x1"; then + AC_MSG_ERROR([sun.applet.AppletViewerPanel is not available.]) +elif test x"${it_cv_applet_hole}" = "x2"; then + AC_MSG_ERROR([sun.applet.AppletViewerPanel is not public.]) +elif test x"${it_cv_applet_hole}" = "x3"; then + AC_MSG_ERROR([Compilation failed. See config.log.]) +fi +AC_PROVIDE([$0])dnl +]) |