[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - bean/com jurt/com
Stephan Bergmann
sbergman at redhat.com
Fri Feb 14 11:25:09 CET 2014
bean/com/sun/star/beans/LocalOfficeConnection.java | 9 +++++++++
jurt/com/sun/star/lib/util/NativeLibraryLoader.java | 11 ++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
New commits:
commit c225c859f11da09ff20b3eb2a9f81ea32b02f6f3
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Feb 13 23:20:28 2014 +0100
More java.lang.System.mapLibraryName dylib vs. jnilib confusion
...like a76261ac9e40eb57e942db2c7aea8b8a5e904ff2
Change-Id: I803dc81344efb5e8021d9ef4146c06ecf82ca63b
(cherry picked from commit 0d396800021684a8c0875e45ed1440011fd7f9b0)
Reviewed-on: https://gerrit.libreoffice.org/8040
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/bean/com/sun/star/beans/LocalOfficeConnection.java b/bean/com/sun/star/beans/LocalOfficeConnection.java
index b742fb3..9bf73b4 100644
--- a/bean/com/sun/star/beans/LocalOfficeConnection.java
+++ b/bean/com/sun/star/beans/LocalOfficeConnection.java
@@ -78,6 +78,15 @@ public class LocalOfficeConnection
// load libofficebean.so/officebean.dll
String aSharedLibName = getProgramPath() + java.io.File.separator +
System.mapLibraryName(OFFICE_LIB_NAME);
+ // At least Oracle's 1.7.0_51 now maps to .dylib rather than .jnilib:
+ if (System.getProperty("os.name").startsWith("Mac")
+ && aSharedLibName.endsWith(".dylib"))
+ {
+ aSharedLibName
+ = aSharedLibName.substring(
+ 0, aSharedLibName.length() - "dylib".length())
+ + "jnilib";
+ }
System.load( aSharedLibName );
}
diff --git a/jurt/com/sun/star/lib/util/NativeLibraryLoader.java b/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
index 9a98cfc..749dcb1 100644
--- a/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -43,7 +43,16 @@ public final class NativeLibraryLoader {
library name is system dependent
*/
public static void loadLibrary(ClassLoader loader, String libname) {
- File path = getResource(loader, System.mapLibraryName(libname));
+ String sysname = System.mapLibraryName(libname);
+ // At least Oracle's 1.7.0_51 now maps to .dylib rather than .jnilib:
+ if (System.getProperty("os.name").startsWith("Mac")
+ && sysname.endsWith(".dylib"))
+ {
+ sysname
+ = sysname.substring(0, sysname.length() - "dylib".length())
+ + "jnilib";
+ }
+ File path = getResource(loader, sysname);
if (path == null) {
// If the library cannot be found as a class loader resource, try
// the global System.loadLibrary as a last resort:
More information about the Libreoffice-commits
mailing list