extmk.rb: failed messages at the end

* ext/extmk.rb: output failed configurations at the end, not to be
  scrolled out.
  TODO: show the message at the end of the whole build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-05-12 11:19:43 +00:00
Родитель 6ff3a8e3bb
Коммит 2b7c721499
1 изменённых файлов: 17 добавлений и 9 удалений

Просмотреть файл

@ -252,15 +252,11 @@ def extmake(target)
return true if !error and target.start_with?("-") return true if !error and target.start_with?("-")
mess = "Failed to configure #{target}. It will not be installed.\n" if Logging.log_opened?
if error Logging::message(error.to_s) if error
mess = "#{error}\n#{mess}" Logging::message("Failed to configure #{target}. It will not be installed.\n")
end end
return [target, error]
Logging::message(mess) if Logging.log_opened?
print(mess)
$stdout.flush
return true
end end
args = sysquote($mflags) args = sysquote($mflags)
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR") unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
@ -544,11 +540,13 @@ Dir::chdir('ext')
hdrdir = $hdrdir hdrdir = $hdrdir
$hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include" $hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include"
fails = []
exts.each do |d| exts.each do |d|
$static = $force_static ? true : $static_ext[d] $static = $force_static ? true : $static_ext[d]
if $ignore or !$nodynamic or $static if $ignore or !$nodynamic or $static
extmake(d) or abort result = extmake(d) or abort
fails << result unless result == true
end end
end end
@ -713,6 +711,7 @@ if $configure_only and $command_output
targets = %w[all install static install-so install-rb clean distclean realclean] targets = %w[all install static install-so install-rb clean distclean realclean]
targets.each do |tgt| targets.each do |tgt|
mf.puts "#{tgt}: $(extensions:/.=/#{tgt})" mf.puts "#{tgt}: $(extensions:/.=/#{tgt})"
mf.puts "#{tgt}: note" unless /clean\z/ =~ tgt
end end
mf.puts mf.puts
mf.puts "clean:\n\t-$(Q)$(RM) ext/extinit.#{$OBJEXT}" mf.puts "clean:\n\t-$(Q)$(RM) ext/extinit.#{$OBJEXT}"
@ -742,6 +741,15 @@ if $configure_only and $command_output
mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)" mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
end end
end end
mf.puts "\n""note:\n"
unless fails.empty?
mf.puts %Q<\t@echo "*** Following extensions failed to configure:">
fails.each do |d, e|
mf.puts %Q<\t@echo " #{d}#{e && %Q(: #{e})}">
end
mf.puts %Q<\t@echo "*** Fix the problems, then remove these directories and try again if you want.">
end
end end
elsif $command_output elsif $command_output
message = "making #{rubies.join(', ')}" message = "making #{rubies.join(', ')}"