Author: jsc
Date: Wed Feb 26 07:32:47 2014
New Revision: 1571942

URL: http://svn.apache.org/r1571942
Log:
#124315# insert check for libs with jnilib extension on mac os

Modified:
    openoffice/trunk/main/jurt/com/sun/star/lib/util/NativeLibraryLoader.java

Modified: 
openoffice/trunk/main/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/jurt/com/sun/star/lib/util/NativeLibraryLoader.java?rev=1571942&r1=1571941&r2=1571942&view=diff
==============================================================================
--- openoffice/trunk/main/jurt/com/sun/star/lib/util/NativeLibraryLoader.java 
(original)
+++ openoffice/trunk/main/jurt/com/sun/star/lib/util/NativeLibraryLoader.java 
Wed Feb 26 07:32:47 2014
@@ -48,8 +48,18 @@ public final class NativeLibraryLoader {
         library name is system dependent
      */
     public static void loadLibrary(ClassLoader loader, String libname) {
+        String syslibname = System.mapLibraryName(libname);
+        
         File path = getResource(loader, System.mapLibraryName(libname));
         if (path == null) {
+            // check special jni lib extension on Mac
+            if (syslibname.contains("dylib")) {
+                syslibname = syslibname.replace("dylib", "jnilib");
+            }
+            path = getResource(loader, syslibname);
+        }
+
+        if (path == null) {
             // If the library cannot be found as a class loader resource, try
             // the global System.loadLibrary as a last resort:
             System.loadLibrary(libname);


Reply via email to