Skip to content

Commit

Permalink
Default to gmake for BSD and Solaris
Browse files Browse the repository at this point in the history
The BSD `make` is not compatible with many directives in GNU make.
For FreeBSD and Solaris systems, default to `gmake` so that native gem
builds work without having to specify `MAKE=gmake` in the environment.

Relates to:
* oxidize-rb/rb-sys#299
* redis/hiredis-rb#23
  • Loading branch information
stanhu committed Jan 2, 2024
1 parent a6c847b commit cd7ddc0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/rubygems/ext/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cd7ddc0

Please sign in to comment.