summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-03 09:37:17 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-03 09:37:17 +0000
commite0f9bdab157daab818d51504a1cb7a30cff765fe (patch)
treec9db64554aa6a97dfbd706e66b8e3dd2f4789ba0 /lib/mkmf.rb
parent9dd98aa46e01544afb84c64d461e5b2360b81eac (diff)
* lib/mkmf.rb: use null device if it exists for cross-compiling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 1f9373a..d09b85b 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -33,11 +33,15 @@ if RUBY_PLATFORM == "m68k-human"
elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody/
CFLAGS.gsub!( /-arch\s\w*/, '' )
end
-if /win32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ RUBY_PLATFORM
- $null = open("nul", "w")
+
+if FileTest.readable? 'nul'
+ $null = open('nul', 'w')
+elsif FileTest.readable? '/dev/null'
+ $null = open('/dev/null', 'w')
else
- $null = open("/dev/null", "w")
+ $null = open('test.log', 'w')
end
+
LINK = "#{CONFIG['CC']} -o conftest -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
CPP = "#{CONFIG['CPP']} -E -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s conftest.c"