lib/mkmf/lite.rb in mkmf-lite-0.2.0 vs lib/mkmf/lite.rb in mkmf-lite-0.2.1

- old
+ new

@@ -4,15 +4,15 @@ require 'ptools' module Mkmf module Lite # The version of the mkmf-lite library - MKMF_LITE_VERSION = '0.2.0' + MKMF_LITE_VERSION = '0.2.1' - @@cpp_command = Config::CONFIG['CC'] || Config::CONFIG['CPP'] - @@cpp_outfile = Config::CONFIG['CPPOUTFILE'] || "-o conftest.i" - @@cpp_srcfile = 'conftest.c' + @@cpp_command = Config::CONFIG['CC'] || Config::CONFIG['CPP'] + @@cpp_outfile = Config::CONFIG['CPPOUTFILE'] || "-o conftest.i" + @@cpp_srcfile = 'conftest.c' if Config::CONFIG['LIBS'] @@cpp_libraries = Config::CONFIG['LIBS'] + Config::CONFIG['LIBRUBYARG'] else # TODO: We should adjust this based on OS. For now we're using @@ -21,11 +21,11 @@ end # JRuby, and possibly others unless @@cpp_command case Config::CONFIG['host_os'] - when /msdos|mswin|win32|mingw|cygwin/i + when /msdos|mswin|win32|windows|mingw|cygwin/i @@cpp_command = File.which('cl') || File.which('gcc') when /sunos|solaris|hpux/i @@cpp_command = File.which('cc') || File.which('gcc') else @@cpp_command = 'gcc' @@ -109,29 +109,29 @@ # Note that $stderr is temporarily redirected to the null device because # we don't actually care about the reason for failure. # def try_to_compile(code) begin - bool = false + boolean = false stderr_orig = $stderr.dup Dir.chdir(Dir.tmpdir){ File.open(@@cpp_srcfile, 'w'){ |fh| fh.write(code) } command = @@cpp_command + ' ' command += @@cpp_outfile + ' ' command += @@cpp_srcfile $stderr.reopen(File.null) - bool = system(command) + boolean = system(command) } ensure File.delete(@@cpp_srcfile) if File.exists?(@@cpp_srcfile) File.delete(@@cpp_outfile) if File.exists?(@@cpp_outfile) $stderr.reopen(stderr_orig) end - bool + boolean end # Slurp the contents of the template file for evaluation later. # def read_template(file)