[ruby/etc] Fix for srcdir with spaces

Fixes https://github.com/ruby/etc/pull/22.
Build failure when the ruby installed directory name contains spaces.

https://github.com/ruby/etc/commit/1ab19d5815
This commit is contained in:
Nobuyoshi Nakada 2023-07-12 20:39:16 +09:00 коммит произвёл git
Родитель efd8ea366b
Коммит 2fa77fb82d
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -43,9 +43,15 @@ 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__)
if !File.exist?("#{srcdir}/depend") constdefs = "#{srcdir}/constdefs.h"
%x[#{RbConfig.ruby} #{srcdir}/mkconstants.rb -o #{srcdir}/constdefs.h] ruby = RbConfig.ruby
if File.file?(ruby)
ruby = [ruby]
else
require "shellwords"
ruby = Shellwords.split(ruby)
end end
system(*ruby, "#{srcdir}/mkconstants.rb", "-o", constdefs)
# 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")')