aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/ext/builder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/ext/builder.rb')
-rw-r--r--lib/rubygems/ext/builder.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb
index 74689bb5e2..ee390578ae 100644
--- a/lib/rubygems/ext/builder.rb
+++ b/lib/rubygems/ext/builder.rb
@@ -23,11 +23,13 @@ class Gem::Ext::Builder
make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
end
+ destdir = '"DESTDIR=%s"' % ENV['DESTDIR'] if RUBY_VERSION > '2.0'
+
['', 'install'].each do |target|
# Pass DESTDIR via command line to override what's in MAKEFLAGS
cmd = [
make_program,
- '"DESTDIR=%s"' % ENV['DESTDIR'],
+ destdir,
target
].join(' ').rstrip
run(cmd, results, "make #{target}".rstrip)