summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-19 05:54:24 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-19 05:54:24 +0000
commitfa1f7befa95c930a68f4b7ace4a4e6e1dd221773 (patch)
treef910132d754933660c33c2826fb8548e965d1bc4 /lib/mkmf.rb
parent772f420a18ba30a5e7a0cf03827fc958cf25db95 (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/trunk@2584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 1f3910b0c6..7235294596 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -74,8 +74,6 @@ elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody|-darwin/
CFLAGS.gsub!( /-arch\s\w*/, '' )
end
-$log = open('mkmf.log', 'w')
-
if /mswin32/ =~ RUBY_PLATFORM
OUTFLAG = '-Fe'
elsif /bccwin32/ =~ RUBY_PLATFORM
@@ -97,14 +95,17 @@ def rm_f(*files)
end
end
+$log = nil
$orgerr = $stderr.dup
$orgout = $stdout.dup
+
def xsystem command
Config.expand(command)
if $DEBUG
puts command
return system(command)
end
+ $log ||= open('mkmf.log', 'w')
$stderr.reopen($log)
$stdout.reopen($log)
puts command