diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-07-12 21:03:29 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-07-12 14:18:40 +0000 |
commit | 4fced7860535c650aa20c10cc59c053943aeeb3d (patch) | |
tree | 7a19ecfd27a4a69a0041158e14c8f0f6d2553a6d /ext | |
parent | 2fa77fb82d14deb8c2fa2064305c9a7f0ae63057 (diff) | |
download | ruby-4fced7860535c650aa20c10cc59c053943aeeb3d.tar.gz |
[ruby/etc] Chec if the target file exists, not "depend" file
https://github.com/ruby/etc/commit/b95ddef386
Diffstat (limited to 'ext')
-rw-r--r-- | ext/etc/extconf.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb index 1e8bd16d1d..2e28d58037 100644 --- a/ext/etc/extconf.rb +++ b/ext/etc/extconf.rb @@ -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")') |