require "rake/tasklib"
require "rake/clean"
require "yaml"
-require "tempfile"
require "fileutils"
module Rake
protected
def can_exec_binary?(bin)
fork do
- tf = Tempfile.open("configuretask")
- STDOUT.reopen(tf)
- STDERR.reopen(tf)
+ STDOUT.reopen("/dev/null")
+ STDERR.reopen("/dev/null")
begin
exec(bin)
rescue SystemCallError
- exit 0xb00bface
+ exit 255
end
end
Process.wait
- $?.exitstatus != 0xb00bface
+ $?.exitstatus != 255
end
end
def initialize(name, opts = {})
super
- @command = "pkg-config --silence-errors"
+ @command = "pkg-config"
end
protected
def lookup_flags(f)
f = :modversion if f == :version
- tmp = `#{@command} --#{f} #{@name}`.strip.tr("\n", "/")
+ tmp = `#{@command} --silence-errors --#{f} #{@name}`.
+ strip.tr("\n", "/")
$?.exitstatus.zero? ? tmp : nil
end
end