Class: LibSqreen::Location::Vendor

Inherits:
LibSqreen::Location show all
Defined in:
ext/libsqreen/location.rb

Defined Under Namespace

Classes: ArchiveNotFound, HeaderNotFound

Instance Method Summary collapse

Methods inherited from LibSqreen::Location

load!

Instance Method Details

#configure(context = MkmfContext.new) ⇒ Object



39
40
41
42
# File 'ext/libsqreen/location.rb', line 39

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

#install!Object



34
35
36
37
# File 'ext/libsqreen/location.rb', line 34

def install!
  verify!
  super
end

#verify!Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'ext/libsqreen/location.rb', line 44

def verify!
  include_paths = LibSqreen::Paths.include_paths
  header_files  = LibSqreen::Paths.header_files
  object_paths  = LibSqreen::Paths.object_paths

  header_files.each do |h|
    unless include_paths.detect { |p| Pathname(p).join(h).exist? }
      fail HeaderNotFound, "Unable to locate '#{h}' in the libsqreen header paths: #{include_paths.inspect}"
    end
  end
  object_paths.each do |p|
    fail(ArchiveNotFound, p) unless File.exist?(p)
  end
end