lib/mkmf/lite.rb in mkmf-lite-0.7.0 vs lib/mkmf/lite.rb in mkmf-lite-0.7.1

- old
+ new

@@ -14,18 +14,24 @@ # Mkmf module in the standard library. module Lite extend Memoist # The version of the mkmf-lite library - MKMF_LITE_VERSION = '0.7.0' + MKMF_LITE_VERSION = '0.7.1' private def cpp_defs RbConfig::CONFIG['DEFS'] end + def jruby? + defined?(JRUBY_VERSION) ? true : false + end + + memoize :jruby? + # rubocop:disable Layout/LineLength def cpp_command command = RbConfig::CONFIG['CC'] || RbConfig::CONFIG['CPP'] || File.which('cc') || File.which('gcc') || File.which('cl') raise 'Compiler not found' unless command command @@ -48,9 +54,10 @@ memoize :cpp_out_file def cpp_libraries return if File::ALT_SEPARATOR && RbConfig::CONFIG['CPP'] =~ /^cl/ + return if jruby? if cpp_command =~ /clang/i '-Lrt -Ldl -Lcrypt -Lm' else '-lrt -ldl -lcrypt -lm'