mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
![Charles Lowell](/assets/img/avatar_default.png)
therubyracer now delegates all lookup for its v8 compilation dependencies to the libv8 gem. if you pass the --with-system-v8 flag to the libv8 gem on install, try to configure therubyracer upon compile with the following options. --with-v8-include, --with-v8-lib and --with-v8-dir Otherwise, it will configure therubyracer to use the vendored version of v8.
29 lines
851 B
Ruby
29 lines
851 B
Ruby
require 'mkmf'
|
|
require File.expand_path '../build', __FILE__
|
|
|
|
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
|
|
|
|
begin
|
|
require 'libv8'
|
|
rescue LoadError
|
|
require 'rubygems'
|
|
gem 'libv8'
|
|
require 'libv8'
|
|
end
|
|
Libv8.configure_makefile
|
|
|
|
create_makefile('v8/init')
|