1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/extmk.rb.in, lib/mkmf.rb (xsystem): write log file.

print command line.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2001-06-05 04:54:52 +00:00
parent ac376af4f4
commit 21524a3fc0
2 changed files with 9 additions and 19 deletions

View file

@ -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@" 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" CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c"
if FileTest.readable? 'nul' $log = open('extmk.log', 'w')
$null = open('nul', 'w')
elsif FileTest.readable? '/dev/null'
$null = open('/dev/null', 'w')
else
$null = open('test.log', 'w')
end
$orgerr = $stderr.dup $orgerr = $stderr.dup
$orgout = $stdout.dup $orgout = $stdout.dup
@ -86,8 +80,9 @@ def xsystem command
puts command puts command
return system(command) return system(command)
end end
$stderr.reopen($null) $stderr.reopen($log)
$stdout.reopen($null) $stdout.reopen($log)
puts command
r = system(command) r = system(command)
$stderr.reopen($orgerr) $stderr.reopen($orgerr)
$stdout.reopen($orgout) $stdout.reopen($orgout)

View file

@ -37,13 +37,7 @@ elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody|-darwin/
CFLAGS.gsub!( /-arch\s\w*/, '' ) CFLAGS.gsub!( /-arch\s\w*/, '' )
end end
if FileTest.readable? 'nul' $log = open('mkmf.log', 'w')
$null = open('nul', 'w')
elsif FileTest.readable? '/dev/null'
$null = open('/dev/null', 'w')
else
$null = open('test.log', 'w')
end
LINK = "#{CONFIG['CC']} -o conftest -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}" 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" 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 def xsystem command
Config.expand(command) Config.expand(command)
if $DEBUG if $DEBUG
print command, "\n" puts command
return system(command) return system(command)
end end
$stderr.reopen($null) $stderr.reopen($log)
$stdout.reopen($null) $stdout.reopen($log)
puts command
r = system(command) r = system(command)
$stderr.reopen($orgerr) $stderr.reopen($orgerr)
$stdout.reopen($orgout) $stdout.reopen($orgout)