2009-10-01 22:17:06 -04:00
|
|
|
require 'mkmf'
|
2010-06-02 04:55:54 -04:00
|
|
|
require 'set'
|
2009-10-01 22:17:06 -04:00
|
|
|
|
2010-02-16 15:40:05 -05:00
|
|
|
UPSTREAM = File.expand_path(File.dirname(__FILE__) + "/upstream")
|
|
|
|
BUILD = "#{UPSTREAM}/build/v8"
|
2010-01-28 22:37:03 -05:00
|
|
|
|
|
|
|
|
2010-02-16 15:40:05 -05:00
|
|
|
puts "Compiling V8"
|
|
|
|
|
|
|
|
system("cd #{UPSTREAM} && make") or raise "Error compiling V8"
|
2010-01-28 22:37:03 -05:00
|
|
|
|
2010-06-02 04:55:54 -04:00
|
|
|
find_header('v8.h', "#{BUILD}/include")
|
2010-03-15 01:11:39 -04:00
|
|
|
have_library('pthread')
|
2010-05-09 23:13:22 -04:00
|
|
|
have_library('objc') if RUBY_PLATFORM =~ /darwin/
|
2009-10-08 20:46:59 -04:00
|
|
|
|
2010-01-10 22:14:29 -05:00
|
|
|
$CPPFLAGS += " -Wall" unless $CPPFLAGS.split.include? "-Wall"
|
2010-05-22 20:46:33 -04:00
|
|
|
$CPPFLAGS += " -g" unless $CPPFLAGS.split.include? "-g"
|
|
|
|
$CPPFLAGS += " -rdynamic" unless $CPPFLAGS.split.include? "-rdynamic"
|
2010-01-10 22:14:29 -05:00
|
|
|
|
2010-06-02 04:55:54 -04:00
|
|
|
$DEFLIBPATH.unshift(BUILD)
|
|
|
|
$LIBS << '-lv8'
|
|
|
|
|
2010-02-16 16:30:31 -05:00
|
|
|
CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/
|
2010-02-16 00:12:34 -05:00
|
|
|
|
2009-10-08 20:46:59 -04:00
|
|
|
create_makefile('v8')
|
2009-10-15 23:23:53 -04:00
|
|
|
|
|
|
|
# now add a few extra targets
|
|
|
|
File.open("Makefile", "a") do |makefile|
|
|
|
|
makefile.print <<EOF
|
|
|
|
|
|
|
|
test: all
|
2009-10-15 23:45:53 -04:00
|
|
|
@echo running spec...
|
2009-10-16 16:32:01 -04:00
|
|
|
spec -O spec/spec.opts spec/therubyracer_spec.rb
|
2009-10-17 23:45:02 -04:00
|
|
|
|
|
|
|
docs/cpp:
|
|
|
|
mkdir -p docs/cpp
|
|
|
|
|
|
|
|
docs: all docs/cpp
|
|
|
|
@echo Generate C++ docs to docs/cpp/html
|
|
|
|
doxygen Doxyfile
|
|
|
|
|
2009-10-15 23:23:53 -04:00
|
|
|
EOF
|
|
|
|
end
|