1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
require 'rubygems'
require 'rbconfig'
require 'spec'
if RUBY_PLATFORM =~/java/
libdir = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib"))
$:.reject! { |p| p == libdir }
else
$:.unshift File.join(File.dirname(__FILE__), "..", "..", "lib"),
File.join(File.dirname(__FILE__), "..", "..", "build", "#{Config::CONFIG['host_cpu''arch']}", "ffi_c", RUBY_VERSION)
end
puts "loadpath=#{$:.join(':')}"
require "ffi"
module TestLibrary
PATH = "build/libtest.#{FFI::Platform::LIBSUFFIX}"
end
module LibTest
extend FFI::Library
ffi_lib TestLibrary::PATH
end
|