diff options
Diffstat (limited to 'lib/rubygems/ext')
-rw-r--r-- | lib/rubygems/ext/builder.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index 9b6ad304a2..ab454b4ba1 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -23,9 +23,14 @@ class Gem::Ext::Builder make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make' end - ['', ' install'].each do |target| - cmd = "#{make_program}#{target}" - run(cmd, results, "make#{target}") + ['', 'install'].each do |target| + # Pass DESTDIR via command line to override what's in MAKEFLAGS + cmd = [ + make_program, + '"DESTDIR=%s"' % ENV['DESTDIR'], + target + ].join(' ').rstrip + run(cmd, results, "make #{target}".rstrip) end end |