summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/extmk.rb')
-rw-r--r--ext/extmk.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 859538fe52..f14475fcab 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -156,6 +156,9 @@ def extmake(target)
return true
end
args = sysquote($mflags)
+ unless $destdir.to_s.empty? or $mflags.include?("DESTDIR")
+ args << sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))
+ end
if $static
args += ["static"] unless $clean
$extlist.push [$static, $target, File.basename($target), $preload]
@@ -265,10 +268,6 @@ def parse_args()
end
$continue = $mflags.set?(?k)
- if !$destdir.to_s.empty?
- $destdir = File.expand_path($destdir)
- $mflags.defined?("DESTDIR") or $mflags << "DESTDIR=#{$destdir}"
- end
if $extout
$extout = '$(topdir)/'+$extout
$extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
@@ -445,6 +444,9 @@ rubies = []
}
Dir.chdir ".."
+unless $destdir.to_s.empty?
+ $mflags.defined?("DESTDIR") or $mflags << "DESTDIR=#{$destdir}"
+end
if !$extlist.empty? and $extupdate
rm_f(Config::CONFIG["LIBRUBY_SO"])
end