зеркало из https://github.com/github/ruby.git
[ruby/etc] Chec if the target file exists, not "depend" file
https://github.com/ruby/etc/commit/b95ddef386
This commit is contained in:
Родитель
2fa77fb82d
Коммит
4fced78605
|
@ -44,14 +44,16 @@ have_struct_member('struct group', 'gr_passwd', 'grp.h')
|
|||
# for https://github.com/ruby/etc
|
||||
srcdir = File.expand_path("..", __FILE__)
|
||||
constdefs = "#{srcdir}/constdefs.h"
|
||||
ruby = RbConfig.ruby
|
||||
if File.file?(ruby)
|
||||
ruby = [ruby]
|
||||
else
|
||||
require "shellwords"
|
||||
ruby = Shellwords.split(ruby)
|
||||
if !File.exist?(constdefs)
|
||||
ruby = RbConfig.ruby
|
||||
if File.file?(ruby)
|
||||
ruby = [ruby]
|
||||
else
|
||||
require "shellwords"
|
||||
ruby = Shellwords.split(ruby)
|
||||
end
|
||||
system(*ruby, "#{srcdir}/mkconstants.rb", "-o", constdefs)
|
||||
end
|
||||
system(*ruby, "#{srcdir}/mkconstants.rb", "-o", constdefs)
|
||||
|
||||
# TODO: remove when dropping 2.7 support, as exported since 3.0
|
||||
have_func('rb_deprecate_constant(Qnil, "None")')
|
||||
|
|
Загрузка…
Ссылка в новой задаче