2016-05-04 16:54:51 +10:00
|
|
|
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/
|
|
|
|
$CPPFLAGS += " -std=c++0x"
|
|
|
|
$CPPFLAGS += " -fpermissive"
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
LIBV8_COMPATIBILITY = '~> 5.0.71.35.0'
|
|
|
|
|
2016-05-06 13:14:37 +10:00
|
|
|
# begin
|
|
|
|
# require 'rubygems'
|
|
|
|
# gem 'libv8', LIBV8_COMPATIBILITY
|
|
|
|
# rescue Gem::LoadError
|
|
|
|
# warn "Warning! Unable to load libv8 #{LIBV8_COMPATIBILITY}."
|
|
|
|
# rescue LoadError
|
|
|
|
# warn "Warning! Could not load rubygems. Please make sure you have libv8 #{LIBV8_COMPATIBILITY} installed."
|
|
|
|
# ensure
|
|
|
|
# require 'libv8'
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# Libv8.configure_makefile
|
|
|
|
|
2016-05-10 08:33:31 +10:00
|
|
|
NODE_PATH = "/home/sam/Source/libv8"
|
|
|
|
#NODE_PATH = "/Users/sam/Source/libv8"
|
|
|
|
#
|
2016-05-08 23:43:49 +10:00
|
|
|
NODE_LIBS = NODE_PATH + "/vendor/v8/out/x64.release"
|
2016-05-10 08:33:31 +10:00
|
|
|
NODE_INCLUDE = NODE_PATH + "/vendor/v8/include"
|
2016-05-06 13:14:37 +10:00
|
|
|
|
|
|
|
$INCFLAGS.insert 0, "-I#{NODE_INCLUDE} -I#{NODE_PATH}/vendor/v8 "
|
|
|
|
$LDFLAGS.insert 0, " #{NODE_LIBS}/libv8_base.a #{NODE_LIBS}/libv8_libbase.a #{NODE_LIBS}/libv8_snapshot.a #{NODE_LIBS}/libv8_libplatform.a "
|
|
|
|
|
2016-05-08 23:43:49 +10:00
|
|
|
# new change to mavrick means we need to link with libstdc++ instead of libc++ (the new default)
|
|
|
|
$LDFLAGS.insert 0, " -stdlib=libstdc++ " if RUBY_PLATFORM =~ /darwin/
|
|
|
|
|
2016-05-06 13:14:37 +10:00
|
|
|
dir_config('v8')
|
|
|
|
find_header('v8.h')
|
|
|
|
have_library('v8')
|
2016-05-04 16:54:51 +10:00
|
|
|
|
|
|
|
# Temp Hack
|
2016-05-06 13:14:37 +10:00
|
|
|
#find_header('v8.h', '/home/sam/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/libv8-5.0.71.35.0/vendor/v8/include')
|
2016-05-04 16:54:51 +10:00
|
|
|
|
2016-05-06 13:14:37 +10:00
|
|
|
#find_header('libplatform/libplatform.h', '/home/sam/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/libv8-5.0.71.35.0/vendor/v8/include')
|
2016-05-04 16:54:51 +10:00
|
|
|
|
|
|
|
create_makefile 'mini_racer_extension'
|