[icedtea-web] RFC: Fix for PR779: IcedTea-Web plug-in hardcodes jpi-version to 1.6.0
Deepak Bhole
dbhole at redhat.com
Tue Aug 30 11:28:13 PDT 2011
* Deepak Bhole <dbhole at redhat.com> [2011-08-30 13:40]:
> * Deepak Bhole <dbhole at redhat.com> [2011-08-30 13:37]:
> > Hi,
> >
> > Attached patch fixes PR779:
> > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=779
> >
> > It makes the jpi-version dynamic rather than static.
> >
> > Okay for HEAD and 1.1?
> >
>
Doh. Missed updating x-java-applet and x-java-bean.
New patch attached. It does it slightly differently so that it can be
extended for 1.8 and up too.
Cheers,
Deepak
-------------- next part --------------
diff -r 7afd916031fa Makefile.am
--- a/Makefile.am Mon Aug 29 17:02:36 2011 -0400
+++ b/Makefile.am Tue Aug 30 14:27:19 2011 -0400
@@ -210,6 +210,7 @@
mkdir -p $(PLUGIN_DIR) && \
cd $(PLUGIN_DIR) && \
$(CXX) $(CXXFLAGS) \
+ -DJDK_VERSION="$(JDK_VERSION)" \
-DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
-DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \
-DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \
diff -r 7afd916031fa NEWS
--- a/NEWS Mon Aug 29 17:02:36 2011 -0400
+++ b/NEWS Tue Aug 30 14:27:19 2011 -0400
@@ -17,6 +17,7 @@
* Plugin
- PR749: sun.applet.PluginStreamHandler#handleMessage(String) really slow
- RH718693: MindTerm SSH Applet doesn't work
+ - PR779: IcedTea-Web plug-in hardcodes jpi-version to 1.6.0
Common
- PR768: Signed applets/Web Start apps don't work with OpenJDK7 and up
- PR771: IcedTea-Web certificate verification code does not use the right API
diff -r 7afd916031fa acinclude.m4
--- a/acinclude.m4 Mon Aug 29 17:02:36 2011 -0400
+++ b/acinclude.m4 Tue Aug 30 14:27:19 2011 -0400
@@ -90,6 +90,17 @@
AC_SUBST(SYSTEM_JRE_DIR)
])
+AC_DEFUN_ONCE([IT_SET_JDK_VERSION],
+[
+ AC_REQUIRE([FIND_JAVAC])
+ AC_MSG_CHECKING([version of java compiler])
+
+ JDK_VERSION=`$JAVAC -version 2>&1 | cut -d" " -f2 | cut -c3-3`
+
+ AC_MSG_RESULT(${JDK_VERSION})
+ AC_SUBST(JDK_VERSION)
+])
+
AC_DEFUN_ONCE([FIND_JAVAC],
[
AC_REQUIRE([IT_CHECK_FOR_JDK])
diff -r 7afd916031fa configure.ac
--- a/configure.ac Mon Aug 29 17:02:36 2011 -0400
+++ b/configure.ac Tue Aug 30 14:27:19 2011 -0400
@@ -36,6 +36,7 @@
AC_CONFIG_FILES([javac], [chmod +x javac])
IT_SET_VERSION
+IT_SET_JDK_VERSION
IT_CHECK_XULRUNNER_VERSION
AC_CHECK_LIB(z, main,, [AC_MSG_ERROR("zlib not found - try installing zlib-devel")])
diff -r 7afd916031fa plugin/icedteanp/IcedTeaNPPlugin.cc
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc Mon Aug 29 17:02:36 2011 -0400
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Tue Aug 30 14:27:19 2011 -0400
@@ -90,6 +90,18 @@
#define PLUGIN_FULL_NAME PLUGIN_NAME " (using " PLUGIN_VERSION ")"
#define PLUGIN_DESC "The <a href=\"" PACKAGE_URL "\">" PLUGIN_NAME "</a> executes Java applets."
+#if JDK_VERSION > 6
+#define X_JAVA_APPLET_17 "application/x-java-applet;version=1.7:class,jar:IcedTea;"
+#define X_JAVA_BEAN_17 "application/x-java-bean;version=1.7:class,jar:IcedTea;"
+#define X_JAVA_APPLET_JPI "application/x-java-applet;jpi-version=1.7.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;"
+#define X_JAVA_BEAN_JPI "application/x-java-bean;jpi-version=1.7.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;"
+#else
+#define X_JAVA_APPLET_17 ""
+#define X_JAVA_BEAN_17 ""
+#define X_JAVA_APPLET_JPI "application/x-java-applet;jpi-version=1.6.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;"
+#define X_JAVA_BEAN_JPI "application/x-java-bean;jpi-version=1.6.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;"
+#endif
+
#define PLUGIN_MIME_DESC \
"application/x-java-vm:class,jar:IcedTea;" \
"application/x-java-applet:class,jar:IcedTea;" \
@@ -107,7 +119,8 @@
"application/x-java-applet;version=1.4.2:class,jar:IcedTea;" \
"application/x-java-applet;version=1.5:class,jar:IcedTea;" \
"application/x-java-applet;version=1.6:class,jar:IcedTea;" \
- "application/x-java-applet;jpi-version=1.6.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;" \
+ X_JAVA_APPLET_17 \
+ X_JAVA_APPLET_JPI \
"application/x-java-bean:class,jar:IcedTea;" \
"application/x-java-bean;version=1.1:class,jar:IcedTea;" \
"application/x-java-bean;version=1.1.1:class,jar:IcedTea;" \
@@ -123,7 +136,8 @@
"application/x-java-bean;version=1.4.2:class,jar:IcedTea;" \
"application/x-java-bean;version=1.5:class,jar:IcedTea;" \
"application/x-java-bean;version=1.6:class,jar:IcedTea;" \
- "application/x-java-bean;jpi-version=1.6.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;" \
+ X_JAVA_BEAN_17 \
+ X_JAVA_BEAN_JPI \
"application/x-java-vm-npruntime::IcedTea;"
#define PLUGIN_URL NS_INLINE_PLUGIN_CONTRACTID_PREFIX NS_JVM_MIME_TYPE
More information about the distro-pkg-dev
mailing list