--- lib/mkmf.rb.orig 2011-10-28 04:43:38 +0000 +++ lib/mkmf.rb 2011-10-28 04:47:05 +0000 @@ -293,16 +293,29 @@ end end -def xsystem command +def xsystem command, outfile="" varpat = /\$\((\w+)\)|\$\{(\w+)\}/ if varpat =~ command vars = Hash.new {|h, k| h[k] = ''; ENV[k]} command = command.dup nil while command.gsub!(varpat) {vars[$1||$2]} end - Logging::open do - puts command.quote - system(command) + if outfile.length != 0 + Logging::open do + puts "#{command}" + end + of = open(outfile, "w") + IO.popen(command) do |rf| + of.print rf.read + end + of.close + return $? == 0 + else + Logging::open do + command = Shellwords.shellwords(command) + puts command.quote.join(' ') + system(*command) + end end end @@ -360,16 +373,10 @@ $have_devel end -def try_do(src, command, &b) - unless have_devel? - raise <