summaryrefslogtreecommitdiffstats
path: root/lib
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
commitbd80904effeb9e82582677cfc22c7b5b571af831 (patch)
treef910132d754933660c33c2826fb8548e965d1bc4 /lib
parent86b710d9133b124fe084bdda278deb7948c9dd90 (diff)
downloadruby-bd80904effeb9e82582677cfc22c7b5b571af831.tar.gz
ruby-bd80904effeb9e82582677cfc22c7b5b571af831.tar.xz
ruby-bd80904effeb9e82582677cfc22c7b5b571af831.zip
* ext/extmk.rb, lib/mkmf.rb (xsystem): open the log file if xsystem is called.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 1f3910b0c..723529459 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