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
ignisf 4cdc844534 Make the build process honor v8 compatibility
Add selection of the proper version of the libv8 gem before
requiring it. This commit fixes #231, and fixes #232 which
is a duplicate.
2013-01-12 20:12:43 +02:00

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