summaryrefslogtreecommitdiff
path: root/tool/rbinstall.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-08 18:50:46 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-08 18:51:49 +0900
commit0b9242ffacd92fe02e640efb8640041e6838cb8b (patch)
treef5387079d2c27280a00e419b0f3362e7c2a3def2 /tool/rbinstall.rb
parent00fd7dac32c283d073fc85d7b48362d86035b1cb (diff)
downloadruby-0b9242ffacd92fe02e640efb8640041e6838cb8b.tar.gz
[Misc #18153] Install debug symbol files/directories by the option
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-xtool/rbinstall.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 305287c637..2f70f46ad3 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -51,6 +51,7 @@ def parse_args(argv = ARGV)
$dir_mode = nil
$script_mode = nil
$strip = false
+ $debug_symbols = nil
$cmdtype = (if File::ALT_SEPARATOR == '\\'
File.exist?("rubystub.exe") ? 'exe' : 'cmd'
end)
@@ -92,6 +93,7 @@ def parse_args(argv = ARGV)
opt.on('--cmd-type=TYPE', %w[cmd plain]) {|cmd| $cmdtype = (cmd unless cmd == 'plain')}
opt.on('--[no-]strip') {|strip| $strip = strip}
opt.on('--gnumake') {gnumake = true}
+ opt.on('--debug-symbols=SUFFIX', /\w+/) {|name| $debug_symbols = ".#{name}"}
opt.order!(argv) do |v|
case v
@@ -678,6 +680,20 @@ install?(:dbg, :nodefault) do
end
install File.join(srcdir, "misc/lldb_cruby.py"), File.join(rubylibdir, "lldb_cruby.py")
install File.join(srcdir, ".gdbinit"), File.join(rubylibdir, "gdbinit")
+ if $debug_symbols
+ {
+ ruby_install_name => bindir,
+ rubyw_install_name => bindir,
+ goruby_install_name => bindir,
+ dll => libdir,
+ }.each do |src, dest|
+ next if src.empty?
+ src += $debug_symbols
+ if File.directory?(src)
+ install_recursive src, File.join(dest, src)
+ end
+ end
+ end
end
module RbInstall