2016-05-04 16:54:51 +10:00
|
|
|
require 'mkmf'
|
2016-05-13 23:02:11 +03:00
|
|
|
require 'libv8'
|
2016-05-04 16:54:51 +10:00
|
|
|
|
|
|
|
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/
|
|
|
|
$CPPFLAGS += " -std=c++0x"
|
|
|
|
$CPPFLAGS += " -fpermissive"
|
|
|
|
|
2016-05-14 18:59:50 +10:00
|
|
|
$LDFLAGS.insert 0, " -stdlib=libstdc++ " if RUBY_PLATFORM =~ /darwin/
|
|
|
|
|
2016-05-14 17:00:40 +10:00
|
|
|
if ENV['CXX']
|
|
|
|
puts "SETTING CXX"
|
|
|
|
CONFIG['CXX'] = ENV['CXX']
|
|
|
|
end
|
|
|
|
|
2016-05-04 16:54:51 +10:00
|
|
|
CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/
|
|
|
|
if CONFIG['warnflags']
|
|
|
|
CONFIG['warnflags'].gsub!('-Wdeclaration-after-statement', '')
|
|
|
|
CONFIG['warnflags'].gsub!('-Wimplicit-function-declaration', '')
|
|
|
|
end
|
2016-05-10 14:14:08 +10:00
|
|
|
|
2016-05-04 16:54:51 +10:00
|
|
|
if enable_config('debug')
|
2016-05-10 14:14:08 +10:00
|
|
|
CONFIG['debugflags'] << ' -ggdb3 -O0'
|
2016-05-04 16:54:51 +10:00
|
|
|
end
|
|
|
|
|
2016-05-13 23:02:11 +03:00
|
|
|
Libv8.configure_makefile
|
2016-05-04 16:54:51 +10:00
|
|
|
|
|
|
|
create_makefile 'mini_racer_extension'
|