Changeset 19936

Show
Ignore:
Timestamp:
09/26/08 09:32:45 (5 years ago)
Author:
tokuhirom
Message:

better library detection

Location:
lang/cplusplus/llv8call/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/llv8call/trunk/src/v8ext.cc

    r19935 r19936  
    9393    HandleScope handle_scope; 
    9494 
     95    String::Utf8Value _lib(args[0]); 
    9596    String::Utf8Value _libpath(args.This()->Get(String::New("LibraryPath"))); 
    9697    char *libpath = *_libpath; 
    9798 
    98     if (_file_exists(libpath)) { 
    99         String::Utf8Value _lib(args[0]); 
    100         return _load_lib(libpath, *_lib); 
    101     } else { 
    102         std::string e("library not found in : "); 
    103         e += *_libpath; 
    104         return ThrowException(String::New(e.c_str())); 
     99    char* p; 
     100    while ((p = strchr(libpath, ':')) > 0) { 
     101        *p = '\0'; 
     102        if (_file_exists(libpath)) { return _load_lib(libpath, *_lib); } 
     103        libpath = p+1; 
    105104    } 
     105    if (_file_exists(libpath)) { return _load_lib(libpath, *_lib); } 
     106 
     107    // not found 
     108    std::string e(*_lib); 
     109    e += "is not found in : "; 
     110    e += *_libpath; 
     111    return ThrowException(String::New(e.c_str())); 
    106112} 
    107113 
  • lang/cplusplus/llv8call/trunk/t/util.js

    r19931 r19936  
    55require("t/Test.Simple/Test/More.js"); 
    66 
    7 v8ext.LibraryPath = "blib/"; 
     7v8ext.LibraryPath = "foo:blib/:bar"; 
    88v8ext.LoadLibrary( "org.coderepos.nspr" ); 
    99