Changeset 20783 for lang

Show
Ignore:
Timestamp:
10/05/08 16:29:09 (5 years ago)
Author:
tokuhirom
Message:

r27052@skinny: tokuhirom | 2008-10-05 14:29:13 +0900
scons++ python++

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

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/llv8call/trunk/Sconstruct

    r20778 r20783  
    5050 
    5151env.Append( 
    52     CCFLAGS=['-DUSING_V8_SHARED'], 
     52    CCFLAGS=[ 
     53        '-DUSING_V8_SHARED', 
     54        ["-D"+x+'''='"'''+env.subst(env[x])+""""'""" for x in ['SHLIBSUFFIX', 'SHLIBPREFIX']], 
     55        '''-DDIRSEP='"''' + os.sep + """"'""" 
     56    ], 
    5357    CPPPATH=[os.getcwd() + '/vendor/v8/include/', os.getcwd() + '/v8ext/', '/opt/local/include/'], 
    5458    LIBPATH=[os.getcwd() + '/vendor/v8/', '/opt/local/lib/'], 
  • lang/cplusplus/llv8call/trunk/v8ext/v8ext.cc

    r20781 r20783  
    5151using namespace v8; 
    5252 
    53 #ifdef _WIN32 
    54 #  define DIRECTORY_SEPARATOR "\\" 
    55 #  define DLL_PREFIX "" 
    56 #  define DLL_SUFFIX ".dll" 
    57 #elif defined(__APPLE__) 
    58 #  define DIRECTORY_SEPARATOR "/" 
    59 #  define DLL_PREFIX "lib" 
    60 #  define DLL_SUFFIX ".dylib" 
    61 #else 
    62 #  define DIRECTORY_SEPARATOR "/" 
    63 #  define DLL_PREFIX "lib" 
    64 #  define DLL_SUFFIX ".so" 
    65 #endif 
    66  
    6753static inline Handle<Object> _find_or_create_target(Handle<Object> &target, const char *name) { 
    6854    Handle<String> key = String::New(name); 
     
    9985static inline void mmmm(const char *libpath, const char*libname, std::string & dirbuf, std::string & basenamebuf) { 
    10086    dirbuf  = libpath; 
    101     dirbuf += DIRECTORY_SEPARATOR; 
     87    dirbuf += DIRSEP; 
    10288    dirbuf += libname; 
    10389 
     
    10995    unsigned int pos = 0; 
    11096    while ((pos = dirbuf.find(".", pos+1)) != std::string::npos) { 
    111         dirbuf.replace(pos, 1, DIRECTORY_SEPARATOR); 
     97        dirbuf.replace(pos, 1, DIRSEP); 
    11298    } 
    11399} 
     
    118104    mmmm(libpath, libname, dir, basename); 
    119105 
    120     std::string npath(dir + DIRECTORY_SEPARATOR); 
    121     if (basename.find(DLL_PREFIX) != 0) { 
    122         npath += DLL_PREFIX; 
    123     } 
    124     npath += basename + DLL_SUFFIX; 
     106    std::string npath(dir + DIRSEP); 
     107    if (basename.find(SHLIBPREFIX) != 0) { 
     108        npath += SHLIBPREFIX; 
     109    } 
     110    npath += basename + SHLIBSUFFIX; 
    125111    char * buf = new char [npath.length()+1]; 
    126112    strcpy(buf, npath.c_str()); 
     
    183169    std::string path; 
    184170    path  = dir.c_str(); 
    185     path += DIRECTORY_SEPARATOR; 
     171    path += DIRSEP; 
    186172    path += basename.c_str(); 
    187173    path += ".js";