2009-10-01 22:17:06 -04:00
|
|
|
require 'mkmf'
|
|
|
|
|
2010-01-28 22:37:03 -05:00
|
|
|
puts "Compiling V8"
|
|
|
|
|
|
|
|
arch = ['foo'].pack('p').size == 8 ? 'x64' : 'ia32'
|
|
|
|
|
|
|
|
UPSTREAM_SRC = File.expand_path(File.dirname(__FILE__) + "/upstream")
|
|
|
|
SCONS_SRC = "#{UPSTREAM_SRC}/scons"
|
|
|
|
V8_SRC = "#{UPSTREAM_SRC}/2.0.6"
|
|
|
|
CCSC = "cd #{SCONS_SRC} && python setup.py install --prefix=#{SCONS_SRC}/install"
|
|
|
|
unless File.exists?("#{SCONS_SRC}/install")
|
|
|
|
puts CCSC
|
|
|
|
`#{CCSC}`
|
|
|
|
end
|
|
|
|
unless File.exists?("#{V8_SRC}/libv8.a")
|
|
|
|
CCV8 = "cd #{V8_SRC} && #{SCONS_SRC}/install/bin/scons arch=#{arch}"
|
|
|
|
puts CCV8
|
|
|
|
`#{CCV8}`
|
|
|
|
end
|
|
|
|
|
|
|
|
dir_config('v8', "#{V8_SRC}/include", "#{V8_SRC}")
|
|
|
|
have_library('v8')
|
2009-10-08 20:46:59 -04:00
|
|
|
|
2010-01-10 22:14:29 -05:00
|
|
|
$CPPFLAGS += " -Wall" unless $CPPFLAGS.split.include? "-Wall"
|
|
|
|
|
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
|