diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-09-20 14:16:40 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-09-20 14:24:55 +0300 |
commit | 4b326ea35cb9193dbb530b9445a778d61bf8273d (patch) | |
tree | c4dfb5b4a6e4ea1597787bb2082d32a7873164a8 /javaunohelper | |
parent | e7c9b468f364fd4796f0ff6fc6b76045ad58b26f (diff) |
No need for the juh/juhx dance when DISABLE_DYNLOADING
Change-Id: Ifc2bfb278947344d14b855ebf5527b603e333f15
Diffstat (limited to 'javaunohelper')
-rw-r--r-- | javaunohelper/Library_juh.mk | 11 | ||||
-rw-r--r-- | javaunohelper/Module_javaunohelper.mk | 9 | ||||
-rw-r--r-- | javaunohelper/com/sun/star/comp/helper/Bootstrap.java | 32 |
3 files changed, 50 insertions, 2 deletions
diff --git a/javaunohelper/Library_juh.mk b/javaunohelper/Library_juh.mk index 4783bd982a93..13364691be1a 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 27c53e484bd6..181e10f4efea 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 120217febea3..2087aeca5689 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: |