diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index be1ba3031cc9..14d9c2206762 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -27,7 +27,15 @@ def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil, targets = [ # try to find make program from Ruby configure arguments first RbConfig::CONFIG["configure_args"] =~ /with-make-prog\=(\w+)/ make_program_name = ENV["MAKE"] || ENV["make"] || $1 - make_program_name ||= RUBY_PLATFORM.include?("mswin") ? "nmake" : "make" + make_program_name ||= + case RUBY_PLATFORM + when /mswin/ + "nmake" + when /(bsd|solaris)/ + "gmake" + else + "make" + end make_program = Shellwords.split(make_program_name) # The installation of the bundled gems is failed when DESTDIR is empty in mswin platform.