[rubygems/rubygems] GNU Make needs DESTDIR on Windows environment like msys or mingw

https://github.com/rubygems/rubygems/commit/7fd987d30d
This commit is contained in:
Hiroshi SHIBATA 2021-11-06 07:22:35 +09:00 коммит произвёл git
Родитель fbd6cc5856
Коммит 666a918595
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -24,14 +24,14 @@ class Gem::Ext::Builder
# try to find make program from Ruby configure arguments first
RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/
make_program = ENV['MAKE'] || ENV['make'] || $1
unless make_program
make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
make_program_name = ENV['MAKE'] || ENV['make'] || $1
unless make_program_name
make_program_name = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
end
make_program = Shellwords.split(make_program)
make_program = Shellwords.split(make_program_name)
# The installation of the bundled gems is failed when DESTDIR is empty in mswin platform.
destdir = (ENV['DESTDIR'] && ENV['DESTDIR'] != "") ? 'DESTDIR=%s' % ENV['DESTDIR'] : ''
destdir = (/\bnmake/i !~ make_program_name || ENV['DESTDIR'] && ENV['DESTDIR'] != "") ? 'DESTDIR=%s' % ENV['DESTDIR'] : ''
['clean', '', 'install'].each do |target|
# Pass DESTDIR via command line to override what's in MAKEFLAGS