ruby-changes:20341
From: yugui <ko1@a...>
Date: Sun, 3 Jul 2011 23:45:10 +0900 (JST)
Subject: [ruby-changes:20341] yugui:r32389 (trunk): * ext/extmk.rb (extmake): suppresses outputs from extconf.rb.
yugui 2011-07-03 23:44:59 +0900 (Sun, 03 Jul 2011) New Revision: 32389 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32389 Log: * ext/extmk.rb (extmake): suppresses outputs from extconf.rb. (extmake) warns a failure in extconf.rb. Modified files: trunk/ChangeLog trunk/ext/extmk.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 32388) +++ ChangeLog (revision 32389) @@ -1,3 +1,8 @@ +Sun Jul 3 23:43:56 2011 Yuki Sonoda (Yugui) <yugui@y...> + + * ext/extmk.rb (extmake): suppresses outputs from extconf.rb. + (extmake) warns a failure in extconf.rb. + Sun Jul 3 13:44:51 2011 Nobuyoshi Nakada <nobu@r...> * array.c (ary_reject_bang): should not remove elements which are Index: ext/extmk.rb =================================================================== --- ext/extmk.rb (revision 32388) +++ ext/extmk.rb (revision 32389) @@ -45,6 +45,10 @@ @quote ? x.quote : x end +def verbose? + $mflags.defined?("Q") != "@" +end + def extract_makefile(makefile, keep = true) m = File.read(makefile) if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1]) @@ -64,7 +68,7 @@ config = CONFIG.dup install_dirs(target_prefix).each {|var, val| config[var] = val} FileUtils.rm_f(installrb.values.collect {|f| RbConfig.expand(f, config)}, - :verbose => $mflags.defined?("Q") != "@") + :verbose => verbose?) end end return false @@ -161,7 +165,16 @@ Logging::logfile 'mkmf.log' rm_f makefile if conf - load $0 = conf + unless verbose? + stdout, $stdout = $stdout, File.open(File::NULL, "a") + else + stdout = $stdout + end + begin + load $0 = conf + ensure + $stdout = stdout + end else create_makefile(target) end @@ -181,6 +194,7 @@ open(makefile, "w") do |f| f.print(*dummy_makefile(CONFIG["srcdir"])) end + print "Failed to configure #{target}. It will not be installed.\n" return true end args = sysquote($mflags) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/