Changeset 19321

Show
Ignore:
Timestamp:
09/15/08 10:31:26 (5 years ago)
Author:
tokuhirom
Message:

urlfetch is ext libs

Location:
lang/cplusplus/fcgi-v8/trunk
Files:
4 modified
1 moved

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/fcgi-v8/trunk/Sconstruct

    r19319 r19321  
    88  "util.cc", 
    99  "core.cc", 
    10   "urlfetch.cc", 
    1110  "file.cc", 
    1211  "dir.cc", 
     
    2928OS_GUESS = GuessOS() 
    3029 
    31 libs=['v8', 'pthread', 'curl'] 
     30libs=['v8', 'pthread'] 
    3231 
    3332if OS_GUESS == 'win32': 
  • lang/cplusplus/fcgi-v8/trunk/ext/Sconstruct

    r19319 r19321  
    33env = Environment() 
    44conf = Configure(env) 
    5 include = ['../../v8/include/'] 
     5 
     6env.Append( 
     7    CPPPATH = ['../../v8/include/'], 
     8    LIBPATH = ['../../v8/'], 
     9); 
    610 
    711if conf.CheckLib('memcached'): 
     
    1014        ['libmemcached.cc'], 
    1115        LIBS=['v8', 'memcached'], 
    12         CPPPATH=include, 
    13         LIBPATH=['../../v8/'], 
    1416    ) 
    1517 
     18if conf.CheckLib('curl'): 
     19    env.SharedLibrary( 
     20        "curl", 
     21        ['curl.cc'], 
     22        LIBS=['v8', 'curl', 'iconv'], 
     23    ) 
     24 
  • lang/cplusplus/fcgi-v8/trunk/ext/curl.cc

    r19067 r19321  
    66#include <iconv.h> 
    77#include <errno.h> 
    8 #include "v8-util.h" 
    98 
    109#ifdef _WIN32 
     
    215214} 
    216215 
    217 void setup_curl(v8::Handle<v8::ObjectTemplate> target) { 
    218     target->Set(v8::String::New("urlfetch"), v8::FunctionTemplate::New(UrlFetch)); 
    219 } 
    220  
     216extern "C" 
     217void init_lib(v8::Handle<v8::Object> target) { 
     218    target->Set(v8::String::New("urlfetch"), v8::FunctionTemplate::New(UrlFetch)->GetFunction()); 
     219} 
     220 
  • lang/cplusplus/fcgi-v8/trunk/src/llv8call.cc

    r19281 r19321  
    8585    setup_core(global); 
    8686    setup_io(global); 
    87     setup_curl(global); 
    8887    setup_sqlite3(global); 
    8988#ifdef ENABLE_MEMCACHED 
  • lang/cplusplus/fcgi-v8/trunk/t/02_urlfetch.js

    r19071 r19321  
    22 
    33Test.More.plan({tests:1}); 
     4 
     5if (!File.isFile("ext/libcurl.dylib")) { 
     6    try { 
     7        Test.More.skipRest("this test requires memcached"); 
     8    } catch(e) { 
     9    } 
     10} else { 
     11    load_dll("ext/libcurl.dylib"); 
     12} 
     13 
    414var t = urlfetch("http://search.cpan.org/").responseText; 
    515Test.More.like(t, /Perl6/i);