[Libreoffice-commits] .: config_host.mk.in configure.in RepositoryExternal.mk scp2/source scripting/Jar_ScriptProviderForBeanShell.mk scripting/Jar_ScriptProviderForJavaScript.mk

Tomáš Chvátal tchvatal at kemper.freedesktop.org
Sun May 6 03:53:08 PDT 2012


 RepositoryExternal.mk                        |   14 +++++++++++
 config_host.mk.in                            |    2 +
 configure.in                                 |   34 ++++++++++++++++++++++++++-
 scp2/source/extensions/makefile.mk           |    4 +++
 scripting/Jar_ScriptProviderForBeanShell.mk  |    9 ++-----
 scripting/Jar_ScriptProviderForJavaScript.mk |    9 +++++--
 6 files changed, 63 insertions(+), 9 deletions(-)

New commits:
commit 32af02b32f1ab7f2683749e6c949470847175da0
Author: Tomas Chvatal <tchvatal at suse.cz>
Date:   Sun May 6 12:49:33 2012 +0200

    Allow usage of system rhino wrt fdo#42977
    
    It is done the same way the beanshell is handled.
    Currently it can't be enabled by default as internal version has
    patched-in debug interface.
    We can choose two paths, rewrite the code to the new rhino debug
    interface or just strip the current one out.
    
    Change-Id: I48af18c635816db8269f13a649b62e9c454ee1e6

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 09ea15c..bb5b16f 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1338,4 +1338,18 @@ endef
 endif # SYSTEM_BSH
 
 
+ifeq ($(SYSTEM_RHINO),YES)
+
+define gb_JavaClassSet__use_rhino
+$(call gb_JavaClassSet_use_system_jar,$(1),$(RHINO_JAR))
+endef
+
+else # !SYSTEM_RHINO
+
+define gb_JavaClassSet__use_rhino
+$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/js.jar)
+endef
+
+endif # SYSTEM_RHINO
+
 # vim: set noet sw=4 ts=4:
diff --git a/config_host.mk.in b/config_host.mk.in
index 4d0d5cf..65affa9 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -414,6 +414,7 @@ export PYTHON_LIBS=@PYTHON_LIBS@
 export RANLIB=@RANLIB@
 export REDLAND_CFLAGS=@REDLAND_CFLAGS@
 export REDLAND_LIBS=@REDLAND_LIBS@
+export RHINO_JAR=@RHINO_JAR@
 export RPM=@RPM@
 export SAC_JAR=@SAC_JAR@
 export SAL_ENABLE_FILE_LOCKING=1
@@ -514,6 +515,7 @@ export SYSTEM_POPPLER=@SYSTEM_POPPLER@
 export SYSTEM_POSTGRESQL=@SYSTEM_POSTGRESQL@
 export SYSTEM_PYTHON=@SYSTEM_PYTHON@
 export SYSTEM_REDLAND=@SYSTEM_REDLAND@
+export SYSTEM_RHINO=@SYSTEM_RHINO@
 export SYSTEM_SAMPLEICC=@SYSTEM_SAMPLEICC@
 export SYSTEM_SANE_HEADER=@SYSTEM_SANE_HEADER@
 export SYSTEM_SAXON=@SYSTEM_SAXON@
diff --git a/configure.in b/configure.in
index 209efe6..43a6544 100644
--- a/configure.in
+++ b/configure.in
@@ -1266,6 +1266,19 @@ AC_ARG_WITH(beanshell-jar,
         [Specify path to jarfile manually.]),
     BSH_JAR=$withval)
 
+AC_ARG_WITH(system-rhino,
+    AS_HELP_STRING([--with-system-rhino],
+        [Use rhino already on system.]),,)
+#    [with_system_rhino="$with_system_jars"])
+# Above is not used as we have different debug interface
+# patched into internal rhino. This code needs to be fixed
+# before we can enable it by default.
+
+AC_ARG_WITH(rhino-jar,
+    AS_HELP_STRING([--with-rhino-jar=JARFILE],
+        [Specify path to jarfile manually.]),
+    RHINO_JAR=$withval)
+
 AC_ARG_WITH(commons-codec-jar,
     AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
         [Specify path to jarfile manually.]),
@@ -9195,13 +9208,32 @@ AC_MSG_CHECKING([whether to build extension for support of scripts in JavaScript
 if test "x$enable_ext_scripting_javascript" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
    AC_MSG_RESULT([yes])
    ENABLE_SCRIPTING_JAVASCRIPT=YES
-   BUILD_TYPE="$BUILD_TYPE RHINO"
+
+   dnl ===================================================================
+   dnl Check for system rhino
+   dnl ===================================================================
+   AC_MSG_CHECKING([which rhino to use])
+   if test "$with_system_rhino" = "yes"; then
+       AC_MSG_RESULT([external])
+       SYSTEM_RHINO=YES
+       if test -z $RHINO_JAR; then
+           RHINO_JAR=/usr/share/java/js.jar
+       fi
+       AC_CHECK_FILE($RHINO_JAR, [],
+                  [AC_MSG_ERROR(js.jar not found.)], [])
+   else
+       AC_MSG_RESULT([internal])
+       SYSTEM_RHINO=NO
+       BUILD_TYPE="$BUILD_TYPE RHINO"
+   fi
 else
    AC_MSG_RESULT([no])
    ENABLE_SCRIPTING_JAVASCRIPT=NO
    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_JAVASCRIPT"
 fi
 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
+AC_SUBST(SYSTEM_RHINO)
+AC_SUBST(RHINO_JAR)
 
 dnl Scripting provider for Python extension?
 dnl We always provide this unless we have disabled Python completely
diff --git a/scp2/source/extensions/makefile.mk b/scp2/source/extensions/makefile.mk
index 77828ca..b8ee210 100644
--- a/scp2/source/extensions/makefile.mk
+++ b/scp2/source/extensions/makefile.mk
@@ -41,6 +41,10 @@ TARGETTYPE=CUI
 SCPDEFS+=-DSYSTEM_BSH -DBSH_JAR=\""file://$(BSH_JAR)"\"
 .ENDIF
 
+.IF "$(SYSTEM_RHINO)" == "YES"
+SCPDEFS+=-DSYSTEM_RHINO -DRHINO_JAR=\""file://$(RHINO_JAR)"\"
+.ENDIF
+
 SCP_PRODUCT_TYPE=osl
 PARFILES= \
         module_extensions.par                        \
diff --git a/scripting/Jar_ScriptProviderForBeanShell.mk b/scripting/Jar_ScriptProviderForBeanShell.mk
index 7ef9af6..dc6f4dc 100644
--- a/scripting/Jar_ScriptProviderForBeanShell.mk
+++ b/scripting/Jar_ScriptProviderForBeanShell.mk
@@ -42,13 +42,10 @@ $(eval $(call gb_Jar_use_externals,ScriptProviderForBeanShell,\
 
 $(eval $(call gb_Jar_set_manifest,ScriptProviderForBeanShell,$(SRCDIR)/scripting/java/com/sun/star/script/framework/provider/beanshell/MANIFEST.MF))
 
-ifeq ($(SYSTEM_BSH),YES)
 $(eval $(call gb_Jar_set_jarclasspath,ScriptProviderForBeanShell, \
-    ScriptFramework.jar $(call gb_Helper_make_url,$(BSH_JAR))))
-else
-$(eval $(call gb_Jar_set_jarclasspath,ScriptProviderForBeanShell, \
-    ScriptFramework.jar bsh.jar))
-endif
+	ScriptFramework.jar \
+	$(if $(filter-out YES,$(SYSTEM_BSH)),bsh.jar) \
+))
 
 $(eval $(call gb_Jar_set_componentfile,ScriptProviderForBeanShell,scripting/java/ScriptProviderForBeanShell,OOO))
 
diff --git a/scripting/Jar_ScriptProviderForJavaScript.mk b/scripting/Jar_ScriptProviderForJavaScript.mk
index 99ee7c3..16c2cf4 100644
--- a/scripting/Jar_ScriptProviderForJavaScript.mk
+++ b/scripting/Jar_ScriptProviderForJavaScript.mk
@@ -34,13 +34,18 @@ $(eval $(call gb_Jar_use_jars,ScriptProviderForJavaScript,\
 	$(OUTDIR)/bin/ridl.jar \
 	$(OUTDIR)/bin/unoil.jar \
 	$(OUTDIR)/bin/ScriptFramework.jar \
-	$(OUTDIR)/bin/js.jar \
+))
+
+$(eval $(call gb_Jar_use_externals,ScriptProviderForJavaScript,\
+	rhino \
 ))
 
 $(eval $(call gb_Jar_set_manifest,ScriptProviderForJavaScript,$(SRCDIR)/scripting/java/com/sun/star/script/framework/provider/javascript/MANIFEST.MF))
 
 $(eval $(call gb_Jar_set_jarclasspath,ScriptProviderForJavaScript, \
-    ScriptFramework.jar js.jar))
+	ScriptFramework.jar \
+	$(if $(filter-out YES,$(SYSTEM_RHINO)),js.jar) \
+))
 
 $(eval $(call gb_Jar_set_componentfile,ScriptProviderForJavaScript,scripting/java/ScriptProviderForJavaScript,OOO))
 


More information about the Libreoffice-commits mailing list