summaryrefslogtreecommitdiff
path: root/tool/rbinstall.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-21 10:34:28 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-21 10:34:28 +0900
commit9edad0df74c6ad39281852cca9793fc7dba5c81f (patch)
treee26c3e989bd3061252cd345d7f90e1f1c11ce611 /tool/rbinstall.rb
parenta35d137a37a0c12cb5694e419284b9e0ab718467 (diff)
downloadruby-9edad0df74c6ad39281852cca9793fc7dba5c81f.tar.gz
Remove short options with argument [Bug #17870]
Remove GNU make `-O` and `-W` options which are short but followed by an argument, so that `$mflags.set?(?n)` does not return `true` wrongly.
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-xtool/rbinstall.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 141b67097b..b7370a8577 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -56,6 +56,7 @@ def parse_args(argv = ARGV)
File.exist?("rubystub.exe") ? 'exe' : 'cmd'
end)
mflags = []
+ gnumake = false
opt = OptionParser.new
opt.on('-n', '--dry-run') {$dryrun = true}
opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
@@ -91,6 +92,7 @@ def parse_args(argv = ARGV)
opt.on('--html-output [DIR]') {|dir| $htmldir = dir}
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.order!(argv) do |v|
case v
@@ -113,6 +115,7 @@ def parse_args(argv = ARGV)
$make, *rest = Shellwords.shellwords($make)
$mflags.unshift(*rest) unless rest.empty?
$mflags.unshift(*mflags)
+ $mflags.reject! {|v| /\A-[OW]/ =~ v} if gnumake
def $mflags.set?(flag)
grep(/\A-(?!-).*#{flag.chr}/i) { return true }