summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-03 07:52:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-03 07:52:22 +0000
commit6d57a52685b398d4a61d3eb5dee2ff5e393c5c66 (patch)
treede44f6278a8928f0a27e73c82c1a82710387eab9
parenta3ee54f8a653f2e7c8ea88ef5ee9f3a49a248447 (diff)
mkmf.rb: log messages
* lib/mkmf.rb (xsystem, xpopen, egrep_cpp, pkg_config): log messages to the log file too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/mkmf.rb21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index d871a9b..f155c13 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -382,7 +382,9 @@ module MakeMakefile
nil while command.gsub!(varpat) {vars[$1||$2]}
end
Logging::open do
- puts command.quote
+ msg = command.quote
+ puts msg
+ Logging.message "%s\n", msg
if opts and opts[:werror]
result = nil
Logging.postpone do |log|
@@ -399,11 +401,15 @@ module MakeMakefile
def xpopen command, *mode, &block
Logging::open do
- case mode[0]
+ msg = case mode[0]
when nil, /^r/
- puts "#{command} |"
+ "#{command} |"
else
- puts "| #{command}"
+ "| #{command}"
+ end
+ if msg
+ puts msg
+ Logging.message "%s\n", msg
end
IO.popen(libpath_env, command, *mode, &block)
end
@@ -808,13 +814,16 @@ SRC
xpopen(cpp_command('', opt)) do |f|
if Regexp === pat
puts(" ruby -ne 'print if #{pat.inspect}'")
+ Logging::message(" ruby -ne 'print if %p'\n", pat)
f.grep(pat) {|l|
puts "#{f.lineno}: #{l}"
+ Logging::message "%d: %s", f.lineno, l
return true
}
false
else
puts(" egrep '#{pat}'")
+ Logging::message(" egrep '%s'\n", pat)
begin
stdin = $stdin.dup
$stdin.reopen(f)
@@ -1792,7 +1801,7 @@ SRC
pkgconfig = $PKGCONFIG
get = proc {|opt|
opt = xpopen("#{$PKGCONFIG} --#{opt} #{pkg}", err:[:child, :out], &:read)
- Logging.open {puts opt.each_line.map{|s|"=> #{s.inspect}"}}
+ Logging.open {opt.each_line.map{|s|Logging.message "=> %p\n", s}}
opt.strip if $?.success?
}
elsif find_executable0(pkgconfig = "#{pkg}-config")
@@ -1803,7 +1812,7 @@ SRC
if pkgconfig
get ||= proc {|opt|
opt = xpopen("#{pkgconfig} --#{opt}", err:[:child, :out], &:read)
- Logging.open {puts opt.each_line.map{|s|"=> #{s.inspect}"}}
+ Logging.open {opt.each_line.map{|s|Logging.message "=> %p\n", s}}
opt.strip if $?.success?
}
end