1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Leave builddir absolute

So that rubygems installer will work to build extension gems.
This commit is contained in:
Nobuyoshi Nakada 2021-10-04 17:56:37 +09:00
parent bac6e8ca5d
commit 3842e723da
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -24,6 +24,7 @@ posthook = proc do
untrace_var(:$ruby, posthook)
end
prehook = proc do |extmk|
=begin
pat = %r[(?:\A(?:\w:|//[^/]+)|\G)/[^/]*]
dir = builddir.scan(pat)
pwd = Dir.pwd.scan(pat)
@ -35,6 +36,7 @@ prehook = proc do |extmk|
builddir = File.join((pwd.empty? ? ["."] : [".."]*pwd.size) + dir)
builddir = "." if builddir.empty?
end
=end
join = proc {|*args| File.join(*args).sub!(/\A(?:\.\/)*/, '')}
$topdir ||= builddir
$top_srcdir ||= (File.identical?(top_srcdir, dir = join[$topdir, srcdir]) ?