Sha256: 44aeebbb1f50b909008fac34ed94a0f2f9f2430390baf9aa5f8b55b75671c4aa

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'mkmf'
require 'set'

EXTERNAL = File.expand_path(File.dirname(__FILE__) + "/external")
BUILD = "#{EXTERNAL}/build/v8"

# I set ENV['FAST'] in the rakefile so I can skip building V8 when I rebuild
# Tomato.
puts
if !ENV['FAST'] || !File.exist?(BUILD)
  puts "Now compiling the V8 library..."
  system("cd \"#{EXTERNAL}\" && make") or raise "Error compiling V8!"
  puts "...done."
  puts
else
  puts "Skipping the build of V8 library -- you already have it."
  puts
end

find_header('v8.h', "#{BUILD}/include")
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"

$DEFLIBPATH.unshift(BUILD)
$LIBS << ' -lv8'

CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/

create_makefile('tomato')

# now add a few extra targets
File.open("Makefile", "a") do |makefile|
makefile.print <<EOF

test: all
	@echo Running specs...
	spec -O spec/spec.opts spec

EOF
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tomato-0.0.1.prealpha1 ext/tomato/extconf.rb