[Libreoffice-commits] .: javaunohelper/com javaunohelper/Library_juh.mk javaunohelper/Module_javaunohelper.mk

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 04:26:10 PDT 2012


 javaunohelper/Library_juh.mk                          |   11 ++++++
 javaunohelper/Module_javaunohelper.mk                 |    9 ++++-
 javaunohelper/com/sun/star/comp/helper/Bootstrap.java |   32 +++++++++++++++++-
 3 files changed, 50 insertions(+), 2 deletions(-)

New commits:
commit 4b326ea35cb9193dbb530b9445a778d61bf8273d
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu Sep 20 14:16:40 2012 +0300

    No need for the juh/juhx dance when DISABLE_DYNLOADING
    
    Change-Id: Ifc2bfb278947344d14b855ebf5527b603e333f15

diff --git a/javaunohelper/Library_juh.mk b/javaunohelper/Library_juh.mk
index 4783bd9..1336469 100644
--- a/javaunohelper/Library_juh.mk
+++ b/javaunohelper/Library_juh.mk
@@ -36,8 +36,19 @@ $(eval $(call gb_Library_use_libraries,juh,\
     $(gb_STDLIBS) \
 ))
 
+ifneq ($(DISABLE_DYNLOADING),TRUE)
 $(eval $(call gb_Library_add_exception_objects,juh,\
     javaunohelper/source/preload \
 ))
+else
+# In the DISABLE_DYNLOADING case the juh library is a static archive that gets
+# linked into the single .so, so we can put directly into it the code that in
+# normal cases goes into the juhx library
+$(eval $(call gb_Library_add_exception_objects,juh,\
+    javaunohelper/source/bootstrap \
+    javaunohelper/source/javaunohelper \
+    javaunohelper/source/vm \
+))
+endif
 
 # vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/javaunohelper/Module_javaunohelper.mk b/javaunohelper/Module_javaunohelper.mk
index 27c53e4..181e10f 100644
--- a/javaunohelper/Module_javaunohelper.mk
+++ b/javaunohelper/Module_javaunohelper.mk
@@ -28,12 +28,19 @@
 $(eval $(call gb_Module_Module,javaunohelper))
 
 ifneq ($(SOLAR_JAVA),)
+
 $(eval $(call gb_Module_add_targets,javaunohelper,\
     Library_juh \
-    Library_juhx \
     Jar_juh \
     Zip_juh \
 ))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+$(eval $(call gb_Module_add_targets,javaunohelper,\
+    Library_juhx \
+))
+endif
+
 endif
 
 # vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
index 120217f..2087aec 100644
--- a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
+++ b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
@@ -1,3 +1,5 @@
+// -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
 /*
  * This file is part of the LibreOffice project.
  *
@@ -191,7 +193,33 @@ public class Bootstrap {
 
         if (! m_loaded_juh)
         {
-            NativeLibraryLoader.loadLibrary( Bootstrap.class.getClassLoader(), "juh" );
+            if (System.getProperty("java.vendor") == "The Android Project")
+            {
+                // Find out if we are configured with DISABLE_DYNLOADING or
+                // not. Try to load the lo-bootstrap shared library which
+                // won't exist in the DISABLE_DYNLOADING case. (And which will
+                // be already loaded otherwise, so nothing unexpected happens
+                // that case.) Yeah, this would be simpler if I just could be
+                // bothered to keep a separate branch for DISABLE_DYNLOADING
+                // on Android, merging in master periodically, until I know
+                // for sure whether it is what I want, or not.
+
+                boolean disable_dynloading = false;
+                try {
+                    System.loadLibrary( "lo-bootstrap" );
+                } catch ( UnsatisfiedLinkError e ) {
+                    disable_dynloading = true;
+                }
+
+                if (!disable_dynloading)
+                    {
+                        NativeLibraryLoader.loadLibrary( Bootstrap.class.getClassLoader(), "juh" );
+                    }
+            }
+            else
+            {
+                NativeLibraryLoader.loadLibrary( Bootstrap.class.getClassLoader(), "juh" );
+            }
             m_loaded_juh = true;
         }
         return UnoRuntime.queryInterface(
@@ -318,3 +346,5 @@ public class Bootstrap {
         }.start();
     }
 }
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list