Skip to content

Commit

Permalink
Fix for srcdir with spaces
Browse files Browse the repository at this point in the history
Fixes #22.
Build failure when the ruby installed directory name contains spaces.
  • Loading branch information
nobu committed Jul 12, 2023
1 parent 365398e commit 1ab19d5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ext/etc/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@

# for https://github.com/ruby/etc
srcdir = File.expand_path("..", __FILE__)
if !File.exist?("#{srcdir}/depend")
%x[#{RbConfig.ruby} #{srcdir}/mkconstants.rb -o #{srcdir}/constdefs.h]
constdefs = "#{srcdir}/constdefs.h"
ruby = RbConfig.ruby
if File.file?(ruby)
ruby = [ruby]
else
require "shellwords"
ruby = Shellwords.split(ruby)
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")')
Expand Down

0 comments on commit 1ab19d5

Please sign in to comment.