Changeset 19853 for lang

Show
Ignore:
Timestamp:
09/25/08 00:49:52 (6 years ago)
Author:
tokuhirom
Message:

use java style namespace. spec by pete.

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

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/llv8call/trunk/ext/SConscript

    r19835 r19853  
    11import platform 
    22import os 
     3import os.path 
    34import stat 
     5import shutil 
    46 
    57Import("env") 
     
    1214) 
    1315 
     16def dllfname(name): 
     17    prefix = env["LIBPREFIX"] 
     18    if name[0:len(prefix)] == prefix: 
     19        prefix = '' 
     20    return prefix + name + env["SHLIBSUFFIX"] 
     21 
     22destdir = os.path.join('..', "blib", "org", "coderepos") 
     23if not os.access(destdir, os.R_OK) or not stat.S_ISDIR( os.stat(destdir)[stat.ST_MODE] ): 
     24    os.makedirs( destdir ) 
     25 
    1426for d in os.listdir( os.getcwd() ): 
    15     if stat.S_ISDIR( os.stat(d)[stat.ST_MODE] ): 
    16         print d 
    17         env.SConscript(d + '/SConscript', exports=['env','conf']) 
     27    if stat.S_ISDIR( os.stat(d)[stat.ST_MODE] ) and d[0] != '.': 
     28        print "Build:", d 
     29        env.SConscript(os.path.join(d, 'SConscript'), exports=['env','conf']) 
    1830 
     31        srcfile = os.path.join(d, dllfname(d)) 
     32        dstfile = os.path.join(destdir, dllfname(d)) 
     33        if os.access(srcfile, os.R_OK): 
     34            print "cp %s %s" % (srcfile, dstfile) 
     35            shutil.copyfile(srcfile, dstfile) 
     36 
  • lang/cplusplus/llv8call/trunk/src/dll.cc

    r19833 r19853  
    4949    const char * dir; 
    5050    if (args[0]->IsUndefined()) { 
    51         dir = NULL; 
     51        dir = ""; 
    5252    } else { 
    5353        dir = *str; 
    5454    } 
    55     String::Utf8Value lib(args[1]); 
     55    String::Utf8Value _lib(args[1]); 
     56    std::string lib(dir); 
     57    lib += "/"; lib += *_lib; 
     58 
     59    unsigned int suffix = lib.rfind("."); 
     60    assert(suffix != std::string::npos); 
     61    std::string namepart = lib.substr(suffix+1); 
     62    lib[suffix] = '\0'; 
     63 
     64    unsigned int pos = 0; 
     65    while ((pos = lib.find(".", pos+1)) != std::string::npos) { 
     66        lib.replace(pos, 1, "/"); // this is not a portable? 
     67    } 
    5668    char * libname; 
    57     if ((libname = PR_GetLibraryName(dir, *lib))) { 
     69    if ((libname = PR_GetLibraryName(lib.c_str(), namepart.c_str()))) { 
    5870        Handle<String> result = String::New(libname); 
    5971        PR_FreeLibraryName(libname); 
  • lang/cplusplus/llv8call/trunk/t/020_ext/01_python.js

    r19798 r19853  
    33Test.More.plan({tests:4}); 
    44 
    5 check_lib("python"); 
     5check_lib("org.coderepos.python"); 
    66 
    77Python.Initialize(); 
  • lang/cplusplus/llv8call/trunk/t/020_ext/02_urlfetch.js

    r19520 r19853  
    33Test.More.plan({tests:1}); 
    44 
    5 check_lib("curl"); 
     5check_lib("org.coderepos.curl"); 
    66 
    77var t = urlfetch("http://search.cpan.org/").responseText; 
  • lang/cplusplus/llv8call/trunk/t/020_ext/04_memcached.js

    r19562 r19853  
    33Test.More.plan({tests:14}); 
    44 
    5 check_lib('memcached'); 
     5check_lib('org.coderepos.memcached'); 
    66 
    77if (typeof(Memcached) != "undefined") { 
  • lang/cplusplus/llv8call/trunk/t/020_ext/06_sqlite.js

    r19520 r19853  
    33Test.More.plan({tests:8}); 
    44 
    5 check_lib("sqlite3"); 
     5check_lib("org.coderepos.sqlite3"); 
    66 
    77if (typeof(SQLite3) != "undefined") { 
  • lang/cplusplus/llv8call/trunk/t/util.js

    r19835 r19853  
    1313    }; 
    1414} 
     15 
    1516function check_lib(libname) { 
    16     DLL.SetLibraryPath("ext/" + libname); 
    17     if (File.Access(DLL.GetLibraryName(DLL.GetLibraryPath(), libname), File.ACCESS_EXISTS)) { 
    18         DLL.LoadLibrary(DLL.GetLibraryName(DLL.GetLibraryPath(), libname)); 
     17    DLL.SetLibraryPath("blib/"); 
     18    var path = DLL.GetLibraryName(DLL.GetLibraryPath(), libname); 
     19    if (File.Access(path, File.ACCESS_EXISTS)) { 
     20        DLL.LoadLibrary(path); 
    1921    } else { 
    2022        try {