1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/ext/v8/extconf.rb
2010-08-01 09:48:25 -05:00

25 lines
657 B
Ruby
Executable file

require 'mkmf'
require 'set'
UPSTREAM = File.expand_path(File.dirname(__FILE__) + "/upstream")
BUILD = "#{UPSTREAM}/build/v8"
puts "Compiling V8"
system("cd #{UPSTREAM} && make") or raise "Error compiling V8"
find_header('v8.h', "#{BUILD}/include")
have_library('pthread')
have_library('objc') if RUBY_PLATFORM =~ /darwin/
$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')