summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortduehr <tduehr@gmail.com>2016-01-13 13:04:15 -0600
committertduehr <tduehr@gmail.com>2016-01-13 13:04:15 -0600
commit6d107564a3d46a4f0413ff7e3812ae5e2a95f81d (patch)
tree57ed14d23ceee09ee18c9637dc8dff51fd21216c
parent2b19a7dde1c2b9ea96fcd34c5eda08e59458544a (diff)
downloadffi-6d107564a3d46a4f0413ff7e3812ae5e2a95f81d.tar.gz
search common paths for elcapt
-rw-r--r--.travis.yml2
-rw-r--r--Rakefile2
-rw-r--r--lib/ffi/library.rb15
3 files changed, 17 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 9b38679..ac176d6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,11 +12,13 @@ rvm:
- "2.2"
- "ruby-head"
- "rbx"
+ - "system"
env:
- CC=gcc
- CC=clang
matrix:
allow_failures:
+ - rvm: system
- os: osx
rvm: "2.2"
- os: osx
diff --git a/Rakefile b/Rakefile
index 10839e2..57d87fc 100644
--- a/Rakefile
+++ b/Rakefile
@@ -175,7 +175,7 @@ if USE_RAKE_COMPILER
ext.cross_platform = %w[i386-mingw32 x64-mingw32] # forces the Windows platform instead of the default one
end
- ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0:2.1.5:2.2.1'
+ ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0:2.1.6:2.2.2'
# To reduce the gem file size strip mingw32 dlls before packaging
ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
diff --git a/lib/ffi/library.rb b/lib/ffi/library.rb
index 9849a3a..93d617e 100644
--- a/lib/ffi/library.rb
+++ b/lib/ffi/library.rb
@@ -109,6 +109,7 @@ module FFI
libnames.each do |libname|
begin
+ orig = libname
lib = FFI::DynamicLibrary.open(libname, lib_flags)
break if lib
@@ -121,10 +122,22 @@ module FFI
end
end
+ # TODO better library lookup logic
+ unless libname.start_with?("/")
+ path = ['/usr/lib/','/usr/local/lib/'].find do |pth|
+ File.exist?(pth + libname)
+ end
+ if path
+ libname = path + libname
+ retry
+ end
+ end
+
if ldscript
retry
else
- errors[libname] = ex
+ libr = (orig == libname ? orig : "#{orig} #{libname}")
+ errors[libr] = ex
end
end
end