summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 40c3f40bdd..084136ff02 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -1,5 +1,5 @@
#! /usr/local/bin/ruby
-# -*- ruby -*-
+# -*- mode: ruby; coding: us-ascii -*-
$extension = nil
$extstatic = nil
@@ -42,6 +42,12 @@ $" << "mkmf.rb"
load File.expand_path("lib/mkmf.rb", srcdir)
require 'optparse/shellwords'
+if defined?(File::NULL)
+ @null = File::NULL
+elsif !File.chardev?(@null = "/dev/null")
+ @null = "nul"
+end
+
def sysquote(x)
@quote ||= /os2/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
@quote ? x.quote : x
@@ -190,7 +196,7 @@ def extmake(target)
stdout = $stdout.dup
stderr = $stderr.dup
unless verbose?
- $stderr.reopen($stdout.reopen(File::NULL))
+ $stderr.reopen($stdout.reopen(@null))
end
begin
load $0 = conf
@@ -225,7 +231,7 @@ def extmake(target)
mess = "Failed to configure #{target}. It will not be installed.\n"
if error
- mess.prepend(error.to_s + "\n")
+ mess = "#{error}\n#{mess}"
end
Logging::message(mess)