From 45bff040c3c8f0ddf33356e400d8a0726febc4d8 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 14 Mar 2009 01:39:15 +0000 Subject: * lib/mkmf.rb (CXX_EXT): checks for case-sensitive filesystem with FNM_SYSCASE rather than build_os. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mkmf.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/mkmf.rb') diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 4d0a0dfa9..cfc5453ac 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -9,7 +9,7 @@ CONFIG = RbConfig::MAKEFILE_CONFIG ORIG_LIBPATH = ENV['LIB'] CXX_EXT = %w[cc cxx cpp] -if /mswin|bccwin|mingw|os2/ !~ CONFIG['build_os'] +if File::FNM_SYSCASE.zero? CXX_EXT.concat(%w[C]) end SRC_EXT = %w[c m] << CXX_EXT @@ -1189,16 +1189,16 @@ end # def create_header(header = "extconf.h") message "creating %s\n", header - sym = header.tr("a-z./\055", "A-Z___") + sym = header.tr("a-z./\055", "A-Z___") hdr = ["#ifndef #{sym}\n#define #{sym}\n"] - for line in $defs - case line - when /^-D([^=]+)(?:=(.*))?/ + for line in $defs + case line + when /^-D([^=]+)(?:=(.*))?/ hdr << "#define #$1 #{$2 ? Shellwords.shellwords($2)[0] : 1}\n" - when /^-U(.*)/ + when /^-U(.*)/ hdr << "#undef #$1\n" - end - end + end + end hdr << "#endif\n" hdr = hdr.join unless (IO.read(header) == hdr rescue false) @@ -1527,7 +1527,7 @@ end # Makefile. # # Setting the +target_prefix+ will, in turn, install the generated binary in -# a directory under your Config::CONFIG['sitearchdir'] that mimics your local +# a directory under your RbConfig::CONFIG['sitearchdir'] that mimics your local # filesystem when you run 'make install'. # # For example, given the following file tree: @@ -1937,7 +1937,7 @@ RPATHFLAG = config_string('RPATHFLAG') || '' LIBARG = config_string('LIBARG') || '-l%s' MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main() {return 0;}' -sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if sep != "/"} || "" +sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if s != "/"} || "" CLEANINGS = " clean-rb-default:: clean-rb:: -- cgit