File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,21 @@ def self.available?
2121 end
2222
2323 begin
24- lib_name = 'libczmq'
25- lib_dirs = [ '/usr/local/lib' , '/opt/local/lib' , '/usr/lib64' ]
26- env_name = "#{ lib_name . upcase } _PATH"
27- lib_dirs = [ *ENV [ env_name ] . split ( ':' ) , *lib_dirs ] if ENV [ env_name ]
28- lib_paths = lib_dirs . map { |path | "#{ path } /#{ lib_name } .#{ ::FFI ::Platform ::LIBSUFFIX } " }
29- ffi_lib lib_paths + [ lib_name ]
24+ lib_name = 'libczmq'
25+ major_version = '4'
26+ lib_dirs = [ '/usr/local/lib' , '/opt/local/lib' , '/usr/lib64' , '/usr/lib' ]
27+ lib_dirs = [ *ENV [ 'LD_LIBRARY_PATH' ] . split ( ':' ) , *lib_dirs ] if ENV [ 'LD_LIBRARY_PATH' ]
28+ lib_dirs = [ *ENV [ "#{ lib_name . upcase } _PATH" ] . split ( ':' ) , *lib_dirs ] if ENV [ "#{ lib_name . upcase } _PATH" ]
29+ lib_paths = lib_dirs . map do |path |
30+ [
31+ "#{ path } /#{ lib_name } .#{ ::FFI ::Platform ::LIBSUFFIX } " ,
32+ "#{ path } /#{ lib_name } .#{ ::FFI ::Platform ::LIBSUFFIX } .#{ major_version } "
33+ ]
34+ end . flatten
35+
36+ lib_paths . concat [ lib_name , "#{ lib_name } .#{ ::FFI ::Platform ::LIBSUFFIX } .#{ major_version } " ]
37+
38+ ffi_lib lib_paths
3039 @available = true
3140 rescue LoadError
3241 warn ""
You can’t perform that action at this time.
0 commit comments