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:
parent
a35d137a37
commit
9edad0df74
2 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,7 @@ nproc = $(subst -j,,$(filter -j%,$(MFLAGS)))
|
||||||
ifneq ($(filter %darwin%,$(arch)),)
|
ifneq ($(filter %darwin%,$(arch)),)
|
||||||
INSTRUBY_ENV += SDKROOT=/
|
INSTRUBY_ENV += SDKROOT=/
|
||||||
endif
|
endif
|
||||||
|
INSTRUBY_ARGS += --gnumake
|
||||||
|
|
||||||
CHECK_TARGETS := great exam love check test check% test% btest%
|
CHECK_TARGETS := great exam love check test check% test% btest%
|
||||||
# expand test targets, and those dependents
|
# expand test targets, and those dependents
|
||||||
|
|
|
@ -56,6 +56,7 @@ def parse_args(argv = ARGV)
|
||||||
File.exist?("rubystub.exe") ? 'exe' : 'cmd'
|
File.exist?("rubystub.exe") ? 'exe' : 'cmd'
|
||||||
end)
|
end)
|
||||||
mflags = []
|
mflags = []
|
||||||
|
gnumake = false
|
||||||
opt = OptionParser.new
|
opt = OptionParser.new
|
||||||
opt.on('-n', '--dry-run') {$dryrun = true}
|
opt.on('-n', '--dry-run') {$dryrun = true}
|
||||||
opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
|
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('--html-output [DIR]') {|dir| $htmldir = dir}
|
||||||
opt.on('--cmd-type=TYPE', %w[cmd plain]) {|cmd| $cmdtype = (cmd unless cmd == 'plain')}
|
opt.on('--cmd-type=TYPE', %w[cmd plain]) {|cmd| $cmdtype = (cmd unless cmd == 'plain')}
|
||||||
opt.on('--[no-]strip') {|strip| $strip = strip}
|
opt.on('--[no-]strip') {|strip| $strip = strip}
|
||||||
|
opt.on('--gnumake') {gnumake = true}
|
||||||
|
|
||||||
opt.order!(argv) do |v|
|
opt.order!(argv) do |v|
|
||||||
case v
|
case v
|
||||||
|
@ -113,6 +115,7 @@ def parse_args(argv = ARGV)
|
||||||
$make, *rest = Shellwords.shellwords($make)
|
$make, *rest = Shellwords.shellwords($make)
|
||||||
$mflags.unshift(*rest) unless rest.empty?
|
$mflags.unshift(*rest) unless rest.empty?
|
||||||
$mflags.unshift(*mflags)
|
$mflags.unshift(*mflags)
|
||||||
|
$mflags.reject! {|v| /\A-[OW]/ =~ v} if gnumake
|
||||||
|
|
||||||
def $mflags.set?(flag)
|
def $mflags.set?(flag)
|
||||||
grep(/\A-(?!-).*#{flag.chr}/i) { return true }
|
grep(/\A-(?!-).*#{flag.chr}/i) { return true }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue