1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
require 'mkmf'
fail = false
def create_dummy_makefile
File.open("Makefile", 'w') do |f|
f.puts "all:"
f.puts "install:"
end
end
have_func('rb_wait_for_single_fd')
case RUBY_PLATFORM
when /bsd/i, /darwin/i
unless have_header('sys/event.h')
puts
puts "Missing 'sys/event.h' header"
fail = true
end
if fail
puts
puts "Events handler could not be compiled (see above error). Your god installation will not support event conditions."
create_dummy_makefile
else
create_makefile 'kqueue_handler_ext'
end
when /linux/i
unless have_header('linux/netlink.h')
puts
puts "Missing 'linux/netlink.h' header(s)"
puts "You may need to install a header package for your system"
fail = true
end
unless have_header('linux/connector.h') && have_header('linux/cn_proc.h')
puts
puts "Missing 'linux/connector.h', or 'linux/cn_proc.h' header(s)"
puts "These are only available in Linux kernel 2.6.15 and later (run `uname -a` to find yours)"
puts "You may need to install a header package for your system"
fail = true
end
if fail
puts
puts "Events handler could not be compiled (see above error). Your god installation will not support event conditions."
create_dummy_makefile
else
create_makefile 'netlink_handler_ext'
end
else
puts
puts "Unsupported platform '#{RUBY_PLATFORM}'. Supported platforms are BSD, DARWIN, and LINUX."
puts "Your god installation will not support event conditions."
create_dummy_makefile
end
|