mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Simplify srcdir fallback
This commit is contained in:
parent
0381d10533
commit
e1e3657746
1 changed files with 1 additions and 5 deletions
|
@ -9,11 +9,7 @@ OBJDIR = File.expand_path("spec/ruby/optional/capi/ext")
|
|||
class MSpecScript
|
||||
builddir = Dir.pwd
|
||||
srcdir = ENV['SRCDIR']
|
||||
if !srcdir and File.exist?("#{builddir}/Makefile") then
|
||||
File.open("#{builddir}/Makefile", "r:US-ASCII") {|f|
|
||||
f.read[/^\s*srcdir\s*=\s*(.+)/i] and srcdir = $1
|
||||
}
|
||||
end
|
||||
srcdir ||= File.read("Makefile", encoding: "US-ASCII")[/^\s*srcdir\s*=\s*(.+)/i, 1] rescue nil
|
||||
srcdir = File.expand_path(srcdir)
|
||||
config = RbConfig::CONFIG
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue