Skip to content

Commit

Permalink
Check for libs by prepending lib too. Fixes rubinius#663
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Feb 15, 2011
1 parent 5d6746a commit 49e20f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kernel/platform/library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ def initialize(name, flags=nil)
@handle = DynamicLibrary.open_library @name, flags
end

# Try with suffixes and a prefix
unless @handle
FFI::LIB_SUFFIXES.detect do |suffix|
@name = "lib#{name}.#{suffix}"
@handle = DynamicLibrary.open_library @name, flags
end
end

unless @handle
orig_error = orig_error.split("\n").first
# API Compat. LoadError is wrong here.
Expand Down

0 comments on commit 49e20f5

Please sign in to comment.