[ruby/etc] Chec if the target file exists, not "depend" file

https://github.com/ruby/etc/commit/b95ddef386
This commit is contained in:
Nobuyoshi Nakada 2023-07-12 21:03:29 +09:00 committed by git
parent 2fa77fb82d
commit 4fced78605

View File

@ -44,6 +44,7 @@ have_struct_member('struct group', 'gr_passwd', 'grp.h')
# for https://github.com/ruby/etc # for https://github.com/ruby/etc
srcdir = File.expand_path("..", __FILE__) srcdir = File.expand_path("..", __FILE__)
constdefs = "#{srcdir}/constdefs.h" constdefs = "#{srcdir}/constdefs.h"
if !File.exist?(constdefs)
ruby = RbConfig.ruby ruby = RbConfig.ruby
if File.file?(ruby) if File.file?(ruby)
ruby = [ruby] ruby = [ruby]
@ -52,6 +53,7 @@ else
ruby = Shellwords.split(ruby) ruby = Shellwords.split(ruby)
end end
system(*ruby, "#{srcdir}/mkconstants.rb", "-o", constdefs) system(*ruby, "#{srcdir}/mkconstants.rb", "-o", constdefs)
end
# TODO: remove when dropping 2.7 support, as exported since 3.0 # TODO: remove when dropping 2.7 support, as exported since 3.0
have_func('rb_deprecate_constant(Qnil, "None")') have_func('rb_deprecate_constant(Qnil, "None")')