Changeset 30402


Ignore:
Timestamp:
03/14/16 10:34:17 (5 years ago)
Author:
davidb
Message:

Fix for MacOS 10.11, El Capitan

Location:
main/trunk/greenstone2/common-src/indexers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/mg/java/org/greenstone/mg/MGRetrieveWrapper.java

    r20298 r30402  
    3737   
    3838    static {
    39         System.loadLibrary ("mgretrievejni");
     39
     40    String gsdlos = System.getenv("GSDLOS");
     41    if (gsdlos!=null && gsdlos.equals("darwin")) {
     42        // As of MacOX 10.11 (El Capitan), effectivly supresses DYLD_LIBRARY_PATH (does
     43        // not propagate it to child processes).  This is a result of changes to their
     44        // security model, and seems to come into effect for 'untrusted' executables.
     45        // Greenstone run as a regular user, is 'unstrusted'.  It is possible, with
     46        // admin rights, to override this, however that is not really a viable solution
     47        // for our project.  Hence the change here to use Systen.load() with an
     48        // absolute pathname, rather than rely of System.loadLibrary().
     49
     50        String gsdl3srchome = System.getenv("GSDL3SRCHOME");
     51        String full_jni_library = gsdl3srchome + "/lib/jni/libmgretrievejni.jnilib";
     52        System.load(full_jni_library);
     53    }
     54    else {
     55        System.loadLibrary ("mgretrievejni");
     56    }
    4057        initIDs ();
    4158    }
  • main/trunk/greenstone2/common-src/indexers/mg/java/org/greenstone/mg/MGSearchWrapper.java

    r20298 r30402  
    3838
    3939    static {
    40     System.loadLibrary("mgsearchjni");
     40
     41    String gsdlos = System.getenv("GSDLOS");
     42    if (gsdlos!=null && gsdlos.equals("darwin")) {
     43        // As of MacOX 10.11 (El Capitan), effectivly supresses DYLD_LIBRARY_PATH (does
     44        // not propagate it to child processes).  This is a result of changes to their
     45        // security model, and seems to come into effect for 'untrusted' executables.
     46        // Greenstone run as a regular user, is 'unstrusted'.  It is possible, with
     47        // admin rights, to override this, however that is not really a viable solution
     48        // for our project.  Hence the change here to use Systen.load() with an
     49        // absolute pathname, rather than rely of System.loadLibrary().
     50
     51        String gsdl3srchome = System.getenv("GSDL3SRCHOME");
     52        String full_jni_library = gsdl3srchome + "/lib/jni/libmgsearchjni.jnilib";
     53        System.load(full_jni_library);
     54    }
     55    else {
     56        System.loadLibrary("lib/jni/libmgsearchjni.jnilib");
     57    }
     58
    4159    initIDs();
    4260    }
  • main/trunk/greenstone2/common-src/indexers/mgpp/java/org/greenstone/mgpp/MGPPRetrieveWrapper.java

    r16583 r30402  
    3131 
    3232    static {
    33     System.loadLibrary("mgppretrievejni");
     33    String gsdlos = System.getenv("GSDLOS");
     34    if (gsdlos!=null && gsdlos.equals("darwin")) {
     35        // As of MacOX 10.11 (El Capitan), effectivly supresses DYLD_LIBRARY_PATH (does
     36        // not propagate it to child processes).  This is a result of changes to their
     37        // security model, and seems to come into effect for 'untrusted' executables.
     38        // Greenstone run as a regular user, is 'unstrusted'.  It is possible, with
     39        // admin rights, to override this, however that is not really a viable solution
     40        // for our project.  Hence the change here to use Systen.load() with an
     41        // absolute pathname, rather than rely of System.loadLibrary().
     42
     43        String gsdl3srchome = System.getenv("GSDL3SRCHOME");
     44        String full_jni_library = gsdl3srchome + "/lib/jni/libmgppretrievejni.jnilib";
     45        System.load(full_jni_library);
     46    }
     47    else {
     48        System.loadLibrary("mgppretrievejni");
     49    }
    3450    }
    3551   
  • main/trunk/greenstone2/common-src/indexers/mgpp/java/org/greenstone/mgpp/MGPPSearchWrapper.java

    r29409 r30402  
    4141
    4242    static {
    43     System.loadLibrary("mgppsearchjni");
     43    String gsdlos = System.getenv("GSDLOS");
     44    if (gsdlos!=null && gsdlos.equals("darwin")) {
     45        // As of MacOX 10.11 (El Capitan), effectivly supresses DYLD_LIBRARY_PATH (does
     46        // not propagate it to child processes).  This is a result of changes to their
     47        // security model, and seems to come into effect for 'untrusted' executables.
     48        // Greenstone run as a regular user, is 'unstrusted'.  It is possible, with
     49        // admin rights, to override this, however that is not really a viable solution
     50        // for our project.  Hence the change here to use Systen.load() with an
     51        // absolute pathname, rather than rely of System.loadLibrary().
     52
     53        String gsdl3srchome = System.getenv("GSDL3SRCHOME");
     54        String full_jni_library = gsdl3srchome + "/lib/jni/libmgppsearchjni.jnilib";
     55        System.load(full_jni_library);
     56    }
     57    else {
     58        System.loadLibrary("mgppsearchjni");
     59    }
     60
    4461    initIDs();
    4562    }
Note: See TracChangeset for help on using the changeset viewer.