diff options
author | Koichi Sasada <ko1@atdot.net> | 2021-10-01 03:13:00 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2021-10-05 02:07:33 +0900 |
commit | bc96a45f12503956e323e6c2a47aa550ca1da3dc (patch) | |
tree | c2bffe24d2e5d9ee80c42e00e34f9d437ccbd73b /tool/rbinstall.rb | |
parent | ae1da7e1f76cabc6c2d9b45a6c56b1607200147a (diff) | |
download | ruby-bc96a45f12503956e323e6c2a47aa550ca1da3dc.tar.gz |
introduce debug.gem
For the `test-bundled-gems`, make `debug.so` with extconf.rb and
`make` command directly because `rake-compiler` assume ruby is
installed (but `test-bundled-gems` can run without installation).
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-x | tool/rbinstall.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 0e88d93c8f..6629b4aa73 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -989,6 +989,20 @@ def install_default_gem(dir, srcdir, bindir) end install?(:ext, :comm, :gem, :'bundled-gems') do + if CONFIG['CROSS_COMPILING'] == 'yes' + # The following hacky steps set "$ruby = BASERUBY" in tool/fake.rb + $hdrdir = '' + $extmk = nil + $ruby = nil # ... + ruby_path = $ruby + " -I#{Dir.pwd}" # $baseruby + " -I#{Dir.pwd}" + else + # ruby_path = File.expand_path(with_destdir(File.join(bindir, ruby_install_name))) + ENV['RUBYLIB'] = nil + ENV['RUBYOPT'] = nil + ruby_path = File.expand_path(with_destdir(File.join(bindir, ruby_install_name))) + " --disable=gems -I#{with_destdir(archlibdir)}" + end + Gem.instance_variable_set(:@ruby, ruby_path) if Gem.ruby != ruby_path + gem_dir = Gem.default_dir install_dir = with_destdir(gem_dir) prepare "bundled gems", gem_dir @@ -1009,7 +1023,8 @@ install?(:ext, :comm, :gem, :'bundled-gems') do :format_executable => true, } gem_ext_dir = "#$extout/gems/#{CONFIG['arch']}" - extensions_dir = Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir + extensions_dir = with_destdir(Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir) + File.foreach("#{srcdir}/gems/bundled_gems") do |name| next if /^\s*(?:#|$)/ =~ name next unless /^(\S+)\s+(\S+).*/ =~ name |