Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
searching a bunch of places before giving up
  • Loading branch information
tenderlove committed Aug 3, 2008
1 parent ee1e129 commit c0b60d4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/earworm_lib.rb
@@ -1,7 +1,21 @@
require 'dl/import' require 'dl/import'
module EarwormLib # :nodoc: module EarwormLib # :nodoc:
extend DL::Importable extend DL::Importable
dlload('/opt/local/lib/libofa.dylib') loaded = false
libs = %w{ libofa.dylib libofa.so libofa.so.0 }
dirs = %w{ /opt/local/lib /usr/local/lib }
libs += libs.map { |lib| dirs.map { |dir| File.join(dir, lib) } }.flatten
libs.each do |so|
begin
dlload(so)
loaded = true
break
rescue
next
end
end
raise "Please install libofa" unless loaded

extern "void ofa_get_version(int *, int *, int *)" extern "void ofa_get_version(int *, int *, int *)"
extern "const char * ofa_create_print(const char *, int, long, int, int)" extern "const char * ofa_create_print(const char *, int, long, int, int)"
end end

0 comments on commit c0b60d4

Please sign in to comment.