1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/ext/v8/extconf.rb
Charles Lowell fa2787ab4e Add dependency back on libv8
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.
2013-01-04 16:54:53 -06:00

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')