Changeset 30401

Show
Ignore:
Timestamp:
14.03.2016 10:33:13 (4 years ago)
Author:
davidb
Message:

Fix for MacOS 10.11, El Capitan

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmFile.java

    r10737 r30401  
    513513        System.load(libraryFile); 
    514514    } else { 
    515         System.loadLibrary("gdbmjava"); 
     515         
     516        String gsdlos = System.getenv("GSDLOS"); 
     517        if (gsdlos!=null && gsdlos.equals("darwin")) { 
     518        // As of MacOX 10.11 (El Capitan), effectivly supresses DYLD_LIBRARY_PATH (does 
     519        // not propagate it to child processes).  This is a result of changes to their 
     520        // security model, and seems to come into effect for 'untrusted' executables. 
     521        // Greenstone run as a regular user, is 'unstrusted'.  It is possible, with 
     522        // admin rights, to override this, however that is not really a viable solution 
     523        // for our project.  Hence the change here to use Systen.load() with an 
     524        // absolute pathname, rather than rely of System.loadLibrary(). 
     525 
     526        String gsdl3srchome = System.getenv("GSDL3SRCHOME"); 
     527        String full_jni_library = gsdl3srchome + "/lib/jni/libgdbmjava.jnilib"; 
     528        System.load(full_jni_library); 
     529        } 
     530        else { 
     531 
     532        System.loadLibrary("gdbmjava"); 
     533        } 
    516534    } 
    517535    }