diff --git a/ext/v8/extconf.rb b/ext/v8/extconf.rb index 856c122..3eb091f 100755 --- a/ext/v8/extconf.rb +++ b/ext/v8/extconf.rb @@ -1,4 +1,5 @@ require 'mkmf' +require 'set' UPSTREAM = File.expand_path(File.dirname(__FILE__) + "/upstream") BUILD = "#{UPSTREAM}/build/v8" @@ -8,8 +9,7 @@ puts "Compiling V8" system("cd #{UPSTREAM} && make") or raise "Error compiling V8" -dir_config('v8', "#{BUILD}/include", "#{BUILD}") -have_library('v8') or raise "Unable to find libv8 in #{BUILD}, was there an error compiling it?" +find_header('v8.h', "#{BUILD}/include") have_library('pthread') have_library('objc') if RUBY_PLATFORM =~ /darwin/ @@ -17,6 +17,9 @@ $CPPFLAGS += " -Wall" unless $CPPFLAGS.split.include? "-Wall" $CPPFLAGS += " -g" unless $CPPFLAGS.split.include? "-g" $CPPFLAGS += " -rdynamic" unless $CPPFLAGS.split.include? "-rdynamic" +$DEFLIBPATH.unshift(BUILD) +$LIBS << '-lv8' + CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/ create_makefile('v8')