mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
![ignisf](/assets/img/avatar_default.png)
Add selection of the proper version of the libv8 gem before requiring it. This commit fixes #231, and fixes #232 which is a duplicate.
25 lines
777 B
Ruby
25 lines
777 B
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
|
|
|
|
require 'rubygems'
|
|
gem 'libv8', '~> 3.15.11'
|
|
require 'libv8'
|
|
|
|
Libv8.configure_makefile
|
|
|
|
create_makefile('v8/init')
|