summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-03 14:44:59 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-03 14:44:59 +0000
commit3b63aee19353db475bde05c2be2c4a371b618a1e (patch)
treee514dda79e504a8039e3db1de21a06076f551b41 /ext/extmk.rb
parent6343e30c147dc00e34e9d45ea3f74f94873b9709 (diff)
* ext/extmk.rb (extmake): suppresses outputs from extconf.rb.
(extmake) warns a failure in extconf.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 3aa8154..5665a96 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -45,6 +45,10 @@ def sysquote(x)
@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 @@ def extract_makefile(makefile, keep = true)
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 @@ def extmake(target)
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 @@ def extmake(target)
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)