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

32 lines
1,002 B
Ruby
Raw Normal View History

require 'mkmf'
begin
require 'libv8'
rescue LoadError
require 'rubygems'
require 'libv8'
end
2012-05-01 14:53:01 -04:00
include Libv8
have_library('objc') if RUBY_PLATFORM =~ /darwin/
#we have to manually prepend the libv8 include path to INCFLAGS
#since find_header() does not actually work as advertized.
#see https://github.com/cowboyd/therubyracer/issues/91
2012-05-01 14:53:01 -04:00
$INCFLAGS.insert 0, "#{libv8_include_flags} "
$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/
2012-05-01 14:53:01 -04:00
$LDFLAGS.insert 0, libv8_objects.join(' ') + " "
$LIBS << ' -lpthread '
CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/
2012-05-03 03:22:10 -04:00
if CONFIG['warnflags']
CONFIG['warnflags'].gsub!('-Wdeclaration-after-statement', '')
CONFIG['warnflags'].gsub!('-Wimplicit-function-declaration', '')
end
2012-05-01 14:53:01 -04:00
create_makefile('init')