File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,21 @@ module Poller::ZMQ
99 POLLERR = 4
1010
1111 extend ::FFI ::Library
12- lib_name = 'libzmq'
13- lib_dirs = [ '/usr/local/lib' , '/opt/local/lib' , '/usr/lib64' ]
14- lib_dirs = [ *ENV [ 'LIBZMQ_PATH' ] . split ( ':' ) , *lib_dirs ] if ENV [ 'LIBZMQ_PATH' ]
15- lib_paths = lib_dirs . map { |path | "#{ path } /#{ lib_name } .#{ ::FFI ::Platform ::LIBSUFFIX } " }
16- ffi_lib lib_paths + [ lib_name ]
12+ lib_name = 'libzmq'
13+ major_version = '5'
14+ lib_dirs = [ '/usr/local/lib' , '/opt/local/lib' , '/usr/lib64' , '/usr/lib' ]
15+ lib_dirs = [ *ENV [ 'LD_LIBRARY_PATH' ] . split ( ':' ) , *lib_dirs ] if ENV [ 'LD_LIBRARY_PATH' ]
16+ lib_dirs = [ *ENV [ "#{ lib_name . upcase } _PATH" ] . split ( ':' ) , *lib_dirs ] if ENV [ "#{ lib_name . upcase } _PATH" ]
17+ lib_paths = lib_dirs . map do |path |
18+ [
19+ "#{ path } /#{ lib_name } .#{ ::FFI ::Platform ::LIBSUFFIX } " ,
20+ "#{ path } /#{ lib_name } .#{ ::FFI ::Platform ::LIBSUFFIX } .#{ major_version } "
21+ ]
22+ end . flatten
23+
24+ lib_paths . concat [ lib_name , "#{ lib_name } .#{ ::FFI ::Platform ::LIBSUFFIX } .#{ major_version } " ]
25+
26+ ffi_lib lib_paths
1727
1828 # This represents a +zmq_poller_event_t+ as in:
1929 #
You can’t perform that action at this time.
0 commit comments