* ext/extmk.rb (extmake): Use Logging.open to switch stdout and
stderr. Delay Logging::log_close until the failure message is written. Write the failure message only if log file is opened. * lib/mkmf.rb (Logging.log_opened?): New method. [ruby-dev:47215] [Bug #8209] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9089f57207
commit
1d339ff212
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Wed Apr 3 18:53:58 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/extmk.rb (extmake): Use Logging.open to switch stdout and
|
||||||
|
stderr. Delay Logging::log_close until the failure message is
|
||||||
|
written. Write the failure message only if log file is opened.
|
||||||
|
|
||||||
|
* lib/mkmf.rb (Logging.log_opened?): New method.
|
||||||
|
|
||||||
|
[ruby-dev:47215] [Bug #8209]
|
||||||
|
|
||||||
Wed Apr 3 17:11:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Apr 3 17:11:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* win32/win32.c (constat_apply): pass through unknown sequence which
|
* win32/win32.c (constat_apply): pass through unknown sequence which
|
||||||
|
20
ext/extmk.rb
20
ext/extmk.rb
@ -193,19 +193,11 @@ def extmake(target)
|
|||||||
Logging::logfile 'mkmf.log'
|
Logging::logfile 'mkmf.log'
|
||||||
rm_f makefile
|
rm_f makefile
|
||||||
if conf
|
if conf
|
||||||
stdout = $stdout.dup
|
Logging.open do
|
||||||
stderr = $stderr.dup
|
unless verbose?
|
||||||
unless verbose?
|
$stderr.reopen($stdout.reopen(@null))
|
||||||
$stderr.reopen($stdout.reopen(@null))
|
end
|
||||||
end
|
|
||||||
begin
|
|
||||||
load $0 = conf
|
load $0 = conf
|
||||||
ensure
|
|
||||||
Logging::log_close
|
|
||||||
$stderr.reopen(stderr)
|
|
||||||
$stdout.reopen(stdout)
|
|
||||||
stdout.close
|
|
||||||
stderr.close
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
create_makefile(target)
|
create_makefile(target)
|
||||||
@ -235,11 +227,13 @@ def extmake(target)
|
|||||||
mess = "#{error}\n#{mess}"
|
mess = "#{error}\n#{mess}"
|
||||||
end
|
end
|
||||||
|
|
||||||
Logging::message(mess)
|
Logging::message(mess) if Logging.log_opened?
|
||||||
print(mess)
|
print(mess)
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
|
Logging::log_close
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
Logging::log_close
|
||||||
args = sysquote($mflags)
|
args = sysquote($mflags)
|
||||||
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
|
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
|
||||||
args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))]
|
args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))]
|
||||||
|
@ -310,6 +310,10 @@ module MakeMakefile
|
|||||||
@log.sync = true
|
@log.sync = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self::log_opened?
|
||||||
|
@log and not @log.closed?
|
||||||
|
end
|
||||||
|
|
||||||
def self::open
|
def self::open
|
||||||
log_open
|
log_open
|
||||||
$stderr.reopen(@log)
|
$stderr.reopen(@log)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user