diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-19 05:54:24 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-19 05:54:24 +0000 |
commit | 900b08f2756c5e6f26dbe849db5c79a358c3361a (patch) | |
tree | 27025c88655bbdb2a8807631d170dd367950eecd /lib | |
parent | da90c90c8cf42d4c16c283bd223d9d34fb5aa9df (diff) |
* ext/extmk.rb, lib/mkmf.rb (xsystem): open the log file if xsystem is called.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 5a540187dc..89a88cddb4 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -57,8 +57,6 @@ elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody|-darwin/ CFLAGS.gsub!( /-arch\s\w*/, '' ) end -$log = open('mkmf.log', 'w') - if /mswin32/ =~ RUBY_PLATFORM OUTFLAG = '-Fe' else @@ -78,17 +76,22 @@ def rm_f(*files) end end +$log = nil + $orgerr = $stderr.dup $orgout = $stdout.dup def xsystem command Config.expand(command) if $DEBUG puts command + $stdout.flush return system(command) end + $log ||= open('mkmf.log', 'w') $stderr.reopen($log) $stdout.reopen($log) puts command + $stdout.flush r = system(command) $stderr.reopen($orgerr) $stdout.reopen($orgout) |