* instruby.rb (parse_args), ext/extmk.rb (parse_args): Prepend a
hyphen to the first argument of MAKEFLAGS only if appropriate. Remove wrong comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f24b4d0532
commit
79862de363
@ -1,3 +1,9 @@
|
|||||||
|
Tue Jan 28 04:45:03 2003 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* instruby.rb (parse_args), ext/extmk.rb (parse_args): Prepend a
|
||||||
|
hyphen to the first argument of MAKEFLAGS only if appropriate.
|
||||||
|
Remove wrong comments.
|
||||||
|
|
||||||
Mon Jan 27 03:30:06 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon Jan 27 03:30:06 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* error.c (get_syserror): use snprintf() instead of sprintf(). pointed
|
* error.c (get_syserror): use snprintf() instead of sprintf(). pointed
|
||||||
|
24
ext/extmk.rb
24
ext/extmk.rb
@ -122,28 +122,20 @@ def parse_args()
|
|||||||
$force_static = $OPT['extstatic'] == 'static'
|
$force_static = $OPT['extstatic'] == 'static'
|
||||||
$destdir = $OPT['dest-dir'] || ''
|
$destdir = $OPT['dest-dir'] || ''
|
||||||
$make = $OPT['make'] || $make || 'make'
|
$make = $OPT['make'] || $make || 'make'
|
||||||
make_flags = ($OPT['make-flags'] || '').strip
|
mflags = ($OPT['make-flags'] || '').strip
|
||||||
mflags = ($OPT['mflags'] || '').strip
|
mflags = ($OPT['mflags'] || '').strip if mflags.empty?
|
||||||
|
|
||||||
# BSD make defines both MFLAGS and MAKEFLAGS, and MAKEFLAGS it
|
|
||||||
# defines includes a preceding '-' unlike other implementations.
|
|
||||||
# So we use MFLAGS if defined, otherwise use ('-' + MAKEFLAGS).
|
|
||||||
if mflags.empty?
|
|
||||||
mflags = "-#{make_flags}" unless make_flags.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
$mflags = Shellwords.shellwords(mflags)
|
$mflags = Shellwords.shellwords(mflags)
|
||||||
|
if arg = $mflags.first
|
||||||
|
arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
|
||||||
|
end
|
||||||
|
|
||||||
$make, *rest = Shellwords.shellwords($make)
|
$make, *rest = Shellwords.shellwords($make)
|
||||||
$mflags.unshift(*rest) unless rest.empty?
|
$mflags.unshift(*rest) unless rest.empty?
|
||||||
|
|
||||||
def $mflags.set?(flag)
|
def $mflags.set?(flag)
|
||||||
# Only nmake puts flags together
|
grep(/\A-(?!-).*#{'%c' % flag}/i) { return true }
|
||||||
if $nmake == ?m
|
false
|
||||||
grep(/^-(?!-).*#{'%c' % flag}/i) { return true }
|
|
||||||
false
|
|
||||||
else
|
|
||||||
include?('-%c' % flag)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if $mflags.set?(?n)
|
if $mflags.set?(?n)
|
||||||
|
26
instruby.rb
26
instruby.rb
@ -19,29 +19,21 @@ def parse_args()
|
|||||||
$dryrun = $OPT['n']
|
$dryrun = $OPT['n']
|
||||||
$destdir = $OPT['dest-dir'] || ''
|
$destdir = $OPT['dest-dir'] || ''
|
||||||
$make = $OPT['make'] || $make || 'make'
|
$make = $OPT['make'] || $make || 'make'
|
||||||
make_flags = ($OPT['make-flags'] || '').strip
|
$mantype = $OPT['mantype']
|
||||||
mflags = ($OPT['mflags'] || '').strip
|
mflags = ($OPT['make-flags'] || '').strip
|
||||||
$mantype = $OPT["mantype"]
|
mflags = ($OPT['mflags'] || '').strip if mflags.empty?
|
||||||
|
|
||||||
# BSD make defines both MFLAGS and MAKEFLAGS, and MAKEFLAGS it
|
|
||||||
# defines includes a preceding '-' unlike other implementations.
|
|
||||||
# So we use MFLAGS if defined, otherwise use ('-' + MAKEFLAGS).
|
|
||||||
if mflags.empty?
|
|
||||||
mflags = "-#{make_flags}" unless make_flags.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
$mflags = Shellwords.shellwords(mflags)
|
$mflags = Shellwords.shellwords(mflags)
|
||||||
|
if arg = $mflags.first
|
||||||
|
arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
|
||||||
|
end
|
||||||
|
|
||||||
$make, *rest = Shellwords.shellwords($make)
|
$make, *rest = Shellwords.shellwords($make)
|
||||||
$mflags.unshift(*rest) unless rest.empty?
|
$mflags.unshift(*rest) unless rest.empty?
|
||||||
|
|
||||||
def $mflags.set?(flag)
|
def $mflags.set?(flag)
|
||||||
# Only nmake puts flags together
|
grep(/\A-(?!-).*#{'%c' % flag}/i) { return true }
|
||||||
if /nmake/ =~ $make
|
false
|
||||||
grep(/^-(?!-).*#{'%c' % flag}/i) { return true }
|
|
||||||
false
|
|
||||||
else
|
|
||||||
include?('-%c' % flag)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if $mflags.set?(?n)
|
if $mflags.set?(?n)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user