Class: Libv8::Location::Vendor

Inherits:
Libv8::Location show all
Defined in:
ext/libv8/location.rb

Defined Under Namespace

Classes: ArchiveNotFound, HeaderNotFound

Instance Method Summary collapse

Methods inherited from Libv8::Location

load!

Instance Method Details

#configure(context = MkmfContext.new) ⇒ Object



29
30
31
32
# File 'ext/libv8/location.rb', line 29

def configure(context = MkmfContext.new)
  context.incflags.insert 0, Libv8::Paths.include_paths.map{|p| "-I#{p}"}.join(" ")  + " "
  context.ldflags.insert 0, Libv8::Paths.object_paths.join(" ") + " "
end

#install!Object



21
22
23
24
25
26
27
28
# File 'ext/libv8/location.rb', line 21

def install!
  require File.expand_path '../builder', __FILE__
  builder = Libv8::Builder.new
  exit_status = builder.build_libv8!
  super if exit_status == 0
  verify_installation!
  return exit_status
end

#verify_installation!Object



34
35
36
37
38
39
40
41
42
# File 'ext/libv8/location.rb', line 34

def verify_installation!
  include_paths = Libv8::Paths.include_paths
  unless include_paths.detect { |p| Pathname(p).join('include/v8.h').exist? }
    fail HeaderNotFound, "Unable to locate 'include/v8.h' in the libv8 header paths: #{include_paths.inspect}"
  end
  Libv8::Paths.object_paths.each do |p|
    fail ArchiveNotFound, p unless File.exist? p
  end
end