summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/extmk.rb.in13
-rw-r--r--lib/mkmf.rb15
2 files changed, 9 insertions, 19 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index bb50e88cfd..388edd0d66 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -71,13 +71,7 @@ end
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c"
-if FileTest.readable? 'nul'
- $null = open('nul', 'w')
-elsif FileTest.readable? '/dev/null'
- $null = open('/dev/null', 'w')
-else
- $null = open('test.log', 'w')
-end
+$log = open('extmk.log', 'w')
$orgerr = $stderr.dup
$orgout = $stdout.dup
@@ -86,8 +80,9 @@ def xsystem command
puts command
return system(command)
end
- $stderr.reopen($null)
- $stdout.reopen($null)
+ $stderr.reopen($log)
+ $stdout.reopen($log)
+ puts command
r = system(command)
$stderr.reopen($orgerr)
$stdout.reopen($orgout)
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 8ca32c9b6c..22d2b2e002 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -37,13 +37,7 @@ elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody|-darwin/
CFLAGS.gsub!( /-arch\s\w*/, '' )
end
-if FileTest.readable? 'nul'
- $null = open('nul', 'w')
-elsif FileTest.readable? '/dev/null'
- $null = open('/dev/null', 'w')
-else
- $null = open('test.log', 'w')
-end
+$log = open('mkmf.log', 'w')
LINK = "#{CONFIG['CC']} -o conftest -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
CPP = "#{CONFIG['CPP']} -E %s -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s conftest.c"
@@ -64,11 +58,12 @@ $orgout = $stdout.dup
def xsystem command
Config.expand(command)
if $DEBUG
- print command, "\n"
+ puts command
return system(command)
end
- $stderr.reopen($null)
- $stdout.reopen($null)
+ $stderr.reopen($log)
+ $stdout.reopen($log)
+ puts command
r = system(command)
$stderr.reopen($orgerr)
$stdout.reopen($orgout)