mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
2fca33f9d0
The functionality will be added (that is, if I don't get bored) one thing at a time with the spec. If you want to test, point the libv8 gem (in Gemfile) to its trunk branch & my changes at stormbreakerbg/libv8 @ trunk. What works currently is getting V8 to initialize, say its version and create a new Isolate.
34 lines
1 KiB
Ruby
34 lines
1 KiB
Ruby
require 'mkmf'
|
|
|
|
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"
|
|
$CPPFLAGS += " -fPIC" unless $CPPFLAGS.split.include? "-rdynamic" or RUBY_PLATFORM =~ /darwin/
|
|
|
|
CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/
|
|
if CONFIG['warnflags']
|
|
CONFIG['warnflags'].gsub!('-Wdeclaration-after-statement', '')
|
|
CONFIG['warnflags'].gsub!('-Wimplicit-function-declaration', '')
|
|
end
|
|
if enable_config('debug')
|
|
$CFLAGS += " -O0 -ggdb3"
|
|
end
|
|
|
|
LIBV8_COMPATIBILITY = '~> 3.31.0'
|
|
|
|
begin
|
|
require 'rubygems'
|
|
gem 'libv8', LIBV8_COMPATIBILITY
|
|
rescue Gem::LoadError
|
|
warn "Warning! Unable to load libv8 #{LIBV8_COMPATIBILITY}."
|
|
rescue LoadError
|
|
warn "Warning! Could not load rubygems. Please make sure you have libv8 #{LIBV8_COMPATIBILITY} installed."
|
|
ensure
|
|
require 'libv8'
|
|
end
|
|
|
|
Libv8.configure_makefile
|
|
|
|
create_makefile('v8/init')
|