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

44 lines
952 B
Ruby
Raw Normal View History

2009-10-01 22:17:06 -04:00
require 'mkmf'
require 'set'
2009-10-01 22:17:06 -04:00
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/
2010-02-16 00:12:34 -05:00
create_makefile('v8')
# now add a few extra targets
File.open("Makefile", "a") do |makefile|
makefile.print <<EOF
test: all
@echo running spec...
2009-10-16 16:32:01 -04:00
spec -O spec/spec.opts spec/therubyracer_spec.rb
docs/cpp:
mkdir -p docs/cpp
docs: all docs/cpp
@echo Generate C++ docs to docs/cpp/html
doxygen Doxyfile
EOF
end