1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.
This commit is contained in:
Nobuyoshi Nakada 2021-05-21 10:34:28 +09:00
parent a35d137a37
commit 9edad0df74
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 4 additions and 0 deletions

View file

@ -9,6 +9,7 @@ nproc = $(subst -j,,$(filter -j%,$(MFLAGS)))
ifneq ($(filter %darwin%,$(arch)),)
INSTRUBY_ENV += SDKROOT=/
endif
INSTRUBY_ARGS += --gnumake
CHECK_TARGETS := great exam love check test check% test% btest%
# expand test targets, and those dependents

View file

@ -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 }