changeset in /hg/icedtea6: Add javax.script rhino (javascript) s...

Mark Wielaard mark at klomp.org
Mon Jun 23 02:29:09 PDT 2008


changeset 997b7df73930 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=997b7df73930
description:
	Add javax.script rhino (javascript) support.

	2008-06-22  Mark Wielaard  <mark at klomp.org>

	       * patches/icedtea-rhino.patch: New patch.
	       * Makefile.am: Add RHINO_JAR to environment variable lists.
	       (ICEDTEA_PATHCES): Add patches/icedtea-rhino.patch.
	       * Makefile.in: Regenerated.
	       * acinclude.m4 (FIND_RHINO_JAR): New.
	       * configure.ac: Use FIND_RHINO_JAR.
	       * configure: Regenerated.

diffstat:

7 files changed, 252 insertions(+), 9 deletions(-)
ChangeLog                   |   10 ++
Makefile.am                 |    7 +-
Makefile.in                 |   15 ++--
acinclude.m4                |   32 +++++++++
configure                   |   47 +++++++++++++
configure.ac                |    1 
patches/icedtea-rhino.patch |  149 +++++++++++++++++++++++++++++++++++++++++++

diffs (385 lines):

diff -r 4999cbdbc405 -r 997b7df73930 ChangeLog
--- a/ChangeLog	Fri Jun 20 11:08:28 2008 -0400
+++ b/ChangeLog	Mon Jun 23 11:28:37 2008 +0200
@@ -1,3 +1,13 @@ 2008-06-20  Gary Benson  <gbenson at redhat
+2008-06-22  Mark Wielaard  <mark at klomp.org>
+
+	* patches/icedtea-rhino.patch: New patch.
+	* Makefile.am: Add RHINO_JAR to environment variable lists.
+	(ICEDTEA_PATHCES): Add patches/icedtea-rhino.patch.
+	* Makefile.in: Regenerated.
+	* acinclude.m4 (FIND_RHINO_JAR): New.
+	* configure.ac: Use FIND_RHINO_JAR.
+	* configure: Regenerated.
+
 2008-06-20  Gary Benson  <gbenson at redhat.com>
 
 	* patches/icedtea-zero-build.patch: Correctly set CPU.
diff -r 4999cbdbc405 -r 997b7df73930 Makefile.am
--- a/Makefile.am	Fri Jun 20 11:08:28 2008 -0400
+++ b/Makefile.am	Mon Jun 23 11:28:37 2008 +0200
@@ -107,7 +107,8 @@ ICEDTEA_ENV = \
 	"FT2_LIB=$(FREETYPE2_LIBS)" \
 	"ALT_PARALLEL_COMPILE_JOBS=$(PARALLEL_JOBS)" \
 	"HOTSPOT_BUILD_JOBS=$(PARALLEL_JOBS)" \
-	"JAVAC="
+	"JAVAC=" \
+	"RHINO_JAR=$(RHINO_JAR)"
 
 if WITH_CACAO
 ICEDTEA_ENV += \
@@ -172,7 +173,8 @@ ICEDTEA_ENV_ECJ = \
 	"FT2_LIB=$(FREETYPE2_LIBS)" \
 	"ALT_PARALLEL_COMPILE_JOBS=$(PARALLEL_JOBS)" \
 	"HOTSPOT_BUILD_JOBS=$(PARALLEL_JOBS)" \
-	"JAVAC="
+	"JAVAC=" \
+	"RHINO_JAR=$(RHINO_JAR)"
 
 if WITH_CACAO
 ICEDTEA_ENV_ECJ += \
@@ -331,6 +333,7 @@ ICEDTEA_PATCHES = \
 	patches/icedtea-jscheme.patch \
 	patches/icedtea-dnd-updatecursor.patch \
 	patches/icedtea-component.patch \
+	patches/icedtea-rhino.patch \
 	$(GCC_PATCH) \
 	$(DISTRIBUTION_PATCHES)
 
diff -r 4999cbdbc405 -r 997b7df73930 Makefile.in
--- a/Makefile.in	Fri Jun 20 11:08:28 2008 -0400
+++ b/Makefile.in	Mon Jun 23 11:28:37 2008 +0200
@@ -166,6 +166,7 @@ PATCH = @PATCH@
 PATCH = @PATCH@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
+RHINO_JAR = @RHINO_JAR@
 RMIC = @RMIC@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -316,8 +317,9 @@ ICEDTEA_ENV = "ALT_JDK_IMPORT_PATH=$(ICE
 	"FREETYPE2_HEADERS=$(FREETYPE2_CFLAGS)" \
 	"FT2_LIB=$(FREETYPE2_LIBS)" \
 	"ALT_PARALLEL_COMPILE_JOBS=$(PARALLEL_JOBS)" \
-	"HOTSPOT_BUILD_JOBS=$(PARALLEL_JOBS)" "JAVAC=" $(am__append_1) \
-	$(am__append_2) $(am__append_3)
+	"HOTSPOT_BUILD_JOBS=$(PARALLEL_JOBS)" "JAVAC=" \
+	"RHINO_JAR=$(RHINO_JAR)" $(am__append_1) $(am__append_2) \
+	$(am__append_3)
 
 # OpenJDK ecj build environment.
 ICEDTEA_BUILD_DIR_ECJ = \
@@ -357,8 +359,9 @@ ICEDTEA_ENV_ECJ = "ALT_JDK_IMPORT_PATH=$
 	"FREETYPE2_HEADERS=$(FREETYPE2_CFLAGS)" \
 	"FT2_LIB=$(FREETYPE2_LIBS)" \
 	"ALT_PARALLEL_COMPILE_JOBS=$(PARALLEL_JOBS)" \
-	"HOTSPOT_BUILD_JOBS=$(PARALLEL_JOBS)" "JAVAC=" $(am__append_4) \
-	$(am__append_5) $(am__append_6)
+	"HOTSPOT_BUILD_JOBS=$(PARALLEL_JOBS)" "JAVAC=" \
+	"RHINO_JAR=$(RHINO_JAR)" $(am__append_4) $(am__append_5) \
+	$(am__append_6)
 
 # OpenJDK Source Preparation Targets
 # ==================================
@@ -433,8 +436,8 @@ ICEDTEA_PATCHES = $(ZERO_PATCHES_COND) \
 	patches/icedtea-override-redirect-metacity.patch \
 	patches/icedtea-no-bcopy.patch patches/icedtea-jscheme.patch \
 	patches/icedtea-dnd-updatecursor.patch \
-	patches/icedtea-component.patch $(GCC_PATCH) \
-	$(DISTRIBUTION_PATCHES) $(am__append_7)
+	patches/icedtea-component.patch patches/icedtea-rhino.patch \
+	$(GCC_PATCH) $(DISTRIBUTION_PATCHES) $(am__append_7)
 
 # Patch OpenJDK for plug replacements and ecj.
 ICEDTEA_ECJ_PATCH = $(srcdir)/patches/icedtea-ecj.patch
diff -r 4999cbdbc405 -r 997b7df73930 acinclude.m4
--- a/acinclude.m4	Fri Jun 20 11:08:28 2008 -0400
+++ b/acinclude.m4	Mon Jun 23 11:28:37 2008 +0200
@@ -501,6 +501,38 @@ AC_DEFUN([FIND_XERCES2_JAR],
   AC_SUBST(XERCES2_JAR)
 ])
 
+AC_DEFUN([FIND_RHINO_JAR],
+[
+  AC_ARG_WITH([rhino-jar],
+              [AS_HELP_STRING(--with-rhino-jar,specify location of the rhino jar)],
+  [
+    if test -f "${withval}"; then
+      AC_MSG_CHECKING(rhino jar)
+      RHINO_JAR="${withval}"
+      AC_MSG_RESULT(${withval})
+    fi
+  ],
+  [
+    RHINO_JAR=
+  ])
+  if test -z "${RHINO_JAR}"; then
+    AC_MSG_CHECKING(for rhino jar)
+    if test -e "/usr/share/java/rhino.jar"; then
+      RHINO_JAR=/usr/share/java/rhino.jar
+      AC_MSG_RESULT(${RHINO_JAR})
+    elif test -e "/usr/share/java/js.jar"; then
+      RHINO_JAR=/usr/share/java/js.jar
+      AC_MSG_RESULT(${RHINO_JAR})
+    else
+      AC_MSG_RESULT(no)
+    fi
+  fi
+  if test -z "${RHINO_JAR}"; then
+    AC_MSG_ERROR("A rhino jar was not found.")
+  fi
+  AC_SUBST(RHINO_JAR)
+])
+
 AC_DEFUN([ENABLE_OPTIMIZATIONS],
 [
   AC_MSG_CHECKING(whether to disable optimizations)
diff -r 4999cbdbc405 -r 997b7df73930 configure
--- a/configure	Fri Jun 20 11:08:28 2008 -0400
+++ b/configure	Mon Jun 23 11:28:37 2008 +0200
@@ -748,6 +748,7 @@ XALAN2_JAR
 XALAN2_JAR
 XALAN2_SERIALIZER_JAR
 XERCES2_JAR
+RHINO_JAR
 USE_ALT_OPENJDK_SRC_ZIP_TRUE
 USE_ALT_OPENJDK_SRC_ZIP_FALSE
 ALT_OPENJDK_SRC_ZIP
@@ -1456,6 +1457,7 @@ Optional Packages:
   --with-xalan2-serializer-jar
                           specify location of the xalan2-serializer jar
   --with-xerces2-jar      specify location of the xerces2 jar
+  --with-rhino-jar        specify location of the rhino jar
   --with-openjdk-src-zip  specify the location of the openjdk source zip
   --with-openjdk-src-dir  specify the location of the openjdk sources
   --with-cacao            use CACAO as VM
@@ -7865,6 +7867,48 @@ echo "${ECHO_T}no" >&6; }
   if test -z "${XERCES2_JAR}"; then
     { { echo "$as_me:$LINENO: error: \"A xerces2 jar was not found.\"" >&5
 echo "$as_me: error: \"A xerces2 jar was not found.\"" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+
+
+
+
+# Check whether --with-rhino-jar was given.
+if test "${with_rhino_jar+set}" = set; then
+  withval=$with_rhino_jar;
+    if test -f "${withval}"; then
+      { echo "$as_me:$LINENO: checking rhino jar" >&5
+echo $ECHO_N "checking rhino jar... $ECHO_C" >&6; }
+      RHINO_JAR="${withval}"
+      { echo "$as_me:$LINENO: result: ${withval}" >&5
+echo "${ECHO_T}${withval}" >&6; }
+    fi
+
+else
+
+    RHINO_JAR=
+
+fi
+
+  if test -z "${RHINO_JAR}"; then
+    { echo "$as_me:$LINENO: checking for rhino jar" >&5
+echo $ECHO_N "checking for rhino jar... $ECHO_C" >&6; }
+    if test -e "/usr/share/java/rhino.jar"; then
+      RHINO_JAR=/usr/share/java/rhino.jar
+      { echo "$as_me:$LINENO: result: ${RHINO_JAR}" >&5
+echo "${ECHO_T}${RHINO_JAR}" >&6; }
+    elif test -e "/usr/share/java/js.jar"; then
+      RHINO_JAR=/usr/share/java/js.jar
+      { echo "$as_me:$LINENO: result: ${RHINO_JAR}" >&5
+echo "${ECHO_T}${RHINO_JAR}" >&6; }
+    else
+      { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    fi
+  fi
+  if test -z "${RHINO_JAR}"; then
+    { { echo "$as_me:$LINENO: error: \"A rhino jar was not found.\"" >&5
+echo "$as_me: error: \"A rhino jar was not found.\"" >&2;}
    { (exit 1); exit 1; }; }
   fi
 
@@ -13001,6 +13045,7 @@ XALAN2_JAR!$XALAN2_JAR$ac_delim
 XALAN2_JAR!$XALAN2_JAR$ac_delim
 XALAN2_SERIALIZER_JAR!$XALAN2_SERIALIZER_JAR$ac_delim
 XERCES2_JAR!$XERCES2_JAR$ac_delim
+RHINO_JAR!$RHINO_JAR$ac_delim
 USE_ALT_OPENJDK_SRC_ZIP_TRUE!$USE_ALT_OPENJDK_SRC_ZIP_TRUE$ac_delim
 USE_ALT_OPENJDK_SRC_ZIP_FALSE!$USE_ALT_OPENJDK_SRC_ZIP_FALSE$ac_delim
 ALT_OPENJDK_SRC_ZIP!$ALT_OPENJDK_SRC_ZIP$ac_delim
@@ -13057,7 +13102,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff -r 4999cbdbc405 -r 997b7df73930 configure.ac
--- a/configure.ac	Fri Jun 20 11:08:28 2008 -0400
+++ b/configure.ac	Mon Jun 23 11:28:37 2008 +0200
@@ -197,6 +197,7 @@ else
   FIND_XALAN2_JAR
   FIND_XALAN2_SERIALIZER_JAR
   FIND_XERCES2_JAR
+  FIND_RHINO_JAR
   AC_CONFIG_FILES([javac], [chmod +x javac])
   AC_CONFIG_FILES([javap], [chmod +x javap])
 fi
diff -r 4999cbdbc405 -r 997b7df73930 patches/icedtea-rhino.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-rhino.patch	Mon Jun 23 11:28:37 2008 +0200
@@ -0,0 +1,149 @@
+--- openjdk.orig/jdk/make/com/sun/Makefile	2008-06-22 18:53:03.000000000 +0200
++++ openjdk/jdk/make/com/sun/Makefile	2008-06-22 18:56:41.000000000 +0200
+@@ -31,15 +31,8 @@
+ PRODUCT = sun
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+-ifndef OPENJDK
+-  ORG_EXISTS := $(call DirExists,$(CLOSED_SRC)/share/classes/sun/org,,)
+-  ifneq ("$(ORG_EXISTS)", "") 
+-    SCRIPT_SUBDIR = script
+-  endif
+-endif
+-
+ # Omit mirror since it's built with the apt tool.
+-SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \
++SUBDIRS = script image security crypto/provider jndi jmx \
+     java inputmethods org xml rowset net/httpserver net/ssl demo \
+     tools jarsigner
+ 
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2008-06-22 19:02:39.000000000 +0200
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ import com.sun.script.util.*;
+ import javax.script.*;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ import java.lang.reflect.Method;
+ import java.io.*;
+ import java.util.*;
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2008-06-22 19:02:49.000000000 +0200
+@@ -25,7 +25,7 @@
+ 
+ package com.sun.script.javascript;
+ 
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ import java.util.*;
+ 
+ /**
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2008-06-22 19:03:00.000000000 +0200
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ 
+ import java.util.*;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ 
+ /**
+  * This class prevents script access to certain sensitive classes.
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2008-06-22 19:03:10.000000000 +0200
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ import javax.script.*;
+ import java.util.*;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ import com.sun.script.util.*;
+ 
+ /**
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2008-06-22 19:03:25.000000000 +0200
+@@ -25,7 +25,7 @@
+ 
+ package com.sun.script.javascript;
+ import javax.script.*;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ 
+ /**
+  * Represents compiled JavaScript code.
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2008-06-22 19:03:35.000000000 +0200
+@@ -25,7 +25,7 @@
+ 
+ package com.sun.script.javascript;
+ 
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ import javax.script.*;
+ 
+ /**
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2008-06-22 19:03:48.000000000 +0200
+@@ -27,7 +27,7 @@
+ 
+ import java.lang.reflect.*;
+ import static sun.security.util.SecurityConstants.*;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ 
+ /**
+  * This wrap factory is used for security reasons. JSR 223 script
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2008-06-22 19:05:17.000000000 +0200
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ 
+ import javax.script.Invocable;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ 
+ /**
+  * This class implements Rhino-like JavaAdapter to help implement a Java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2008-06-22 18:52:46.000000000 +0200
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2008-06-22 19:05:31.000000000 +0200
+@@ -24,7 +24,7 @@
+  */
+ 
+ package com.sun.script.javascript;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ import javax.script.*;
+ import java.util.*;
+ 
+--- openjdk.orig/jdk/make/com/sun/script/Makefile	2008-06-22 18:53:02.000000000 +0200
++++ openjdk/jdk/make/com/sun/script/Makefile	2008-06-22 21:12:35.000000000 +0200
+@@ -31,6 +31,8 @@
+ 
+ AUTO_FILES_JAVA_DIRS = com/sun/script
+ 
++OTHER_JAVACFLAGS = -classpath $(RHINO_JAR)
++
+ #
+ # Files that need to be copied
+ #
+--- openjdk.orig/jdk/make/common/Release.gmk	2008-06-22 18:53:02.000000000 +0200
++++ openjdk/jdk/make/common/Release.gmk	2008-06-23 00:14:02.000000000 +0200
+@@ -772,6 +772,7 @@
+ 	$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
+ 	$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
+ 	$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
++	$(LN) -sf $(RHINO_JAR) $(JRE_IMAGE_DIR)/lib/rhino.jar
+ 	@# Generate meta-index to make boot and extension class loaders lazier
+ 	$(CD) $(JRE_IMAGE_DIR)/lib && \
+ 	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
+--- openjdk/hotspot/src/share/vm/runtime/os.cpp.orig	2008-06-23 00:17:03.000000000 +0200
++++ openjdk/hotspot/src/share/vm/runtime/os.cpp	2008-06-22 22:34:33.000000000 +0200
+@@ -949,6 +949,7 @@
+ 	"%/lib/jsse.jar:"
+ 	"%/lib/jce.jar:"
+         "%/lib/charsets.jar:"
++        "%/lib/rhino.jar:"
+ 	"%/classes";
+     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
+     if (sysclasspath == NULL) return false;



More information about the distro-pkg-dev mailing list