2009-10-01 22:17:06 -04:00
|
|
|
require 'mkmf'
|
2010-06-02 04:55:54 -04:00
|
|
|
require 'set'
|
2011-05-27 16:32:30 -04:00
|
|
|
begin
|
|
|
|
require 'libv8'
|
|
|
|
rescue LoadError
|
|
|
|
require 'rubygems'
|
|
|
|
require 'libv8'
|
|
|
|
end
|
2009-10-01 22:17:06 -04:00
|
|
|
|
2011-05-27 13:37:02 -04:00
|
|
|
puts "Compiling The Ruby Racer..."
|
2010-01-28 22:37:03 -05:00
|
|
|
|
2011-05-27 13:37:02 -04:00
|
|
|
find_header('v8.h', Libv8.include_path)
|
2010-03-15 01:11:39 -04:00
|
|
|
have_library('pthread')
|
2010-05-09 23:13:22 -04:00
|
|
|
have_library('objc') if RUBY_PLATFORM =~ /darwin/
|
2009-10-08 20:46:59 -04:00
|
|
|
|
2010-01-10 22:14:29 -05:00
|
|
|
$CPPFLAGS += " -Wall" unless $CPPFLAGS.split.include? "-Wall"
|
2010-05-22 20:46:33 -04:00
|
|
|
$CPPFLAGS += " -g" unless $CPPFLAGS.split.include? "-g"
|
|
|
|
$CPPFLAGS += " -rdynamic" unless $CPPFLAGS.split.include? "-rdynamic"
|
2010-01-10 22:14:29 -05:00
|
|
|
|
2011-05-27 13:37:02 -04:00
|
|
|
$DEFLIBPATH.unshift(Libv8.library_path)
|
2010-06-02 06:05:32 -04:00
|
|
|
$LIBS << ' -lv8'
|
2010-06-02 04:55:54 -04:00
|
|
|
|
2010-02-16 16:30:31 -05:00
|
|
|
CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/
|
2010-02-16 00:12:34 -05:00
|
|
|
|
2009-10-08 20:46:59 -04:00
|
|
|
create_makefile('v8')
|