diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-27 19:48:02 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-27 19:48:02 +0000 |
commit | 79862de36334225179ee4e462ccb982ea5250800 (patch) | |
tree | 9854926ca85dc7f9da2c468f6937713aa34474f3 | |
parent | f24b4d0532c94ded83219d03ab991267b4c81bab (diff) | |
download | ruby-79862de36334225179ee4e462ccb982ea5250800.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ext/extmk.rb | 24 | ||||
-rw-r--r-- | instruby.rb | 26 |
3 files changed, 23 insertions, 33 deletions
@@ -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> * error.c (get_syserror): use snprintf() instead of sprintf(). pointed diff --git a/ext/extmk.rb b/ext/extmk.rb index 5e13d9ffb0..89d8f088a3 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -122,28 +122,20 @@ def parse_args() $force_static = $OPT['extstatic'] == 'static' $destdir = $OPT['dest-dir'] || '' $make = $OPT['make'] || $make || 'make' - make_flags = ($OPT['make-flags'] || '').strip - mflags = ($OPT['mflags'] || '').strip - - # 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 = ($OPT['make-flags'] || '').strip + mflags = ($OPT['mflags'] || '').strip if mflags.empty? $mflags = Shellwords.shellwords(mflags) + if arg = $mflags.first + arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg + end + $make, *rest = Shellwords.shellwords($make) $mflags.unshift(*rest) unless rest.empty? def $mflags.set?(flag) - # Only nmake puts flags together - if $nmake == ?m - grep(/^-(?!-).*#{'%c' % flag}/i) { return true } - false - else - include?('-%c' % flag) - end + grep(/\A-(?!-).*#{'%c' % flag}/i) { return true } + false end if $mflags.set?(?n) diff --git a/instruby.rb b/instruby.rb index fc8639f112..8311f9dc9a 100644 --- a/instruby.rb +++ b/instruby.rb @@ -19,29 +19,21 @@ def parse_args() $dryrun = $OPT['n'] $destdir = $OPT['dest-dir'] || '' $make = $OPT['make'] || $make || 'make' - make_flags = ($OPT['make-flags'] || '').strip - mflags = ($OPT['mflags'] || '').strip - $mantype = $OPT["mantype"] - - # 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 + $mantype = $OPT['mantype'] + mflags = ($OPT['make-flags'] || '').strip + mflags = ($OPT['mflags'] || '').strip if mflags.empty? $mflags = Shellwords.shellwords(mflags) + if arg = $mflags.first + arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg + end + $make, *rest = Shellwords.shellwords($make) $mflags.unshift(*rest) unless rest.empty? def $mflags.set?(flag) - # Only nmake puts flags together - if /nmake/ =~ $make - grep(/^-(?!-).*#{'%c' % flag}/i) { return true } - false - else - include?('-%c' % flag) - end + grep(/\A-(?!-).*#{'%c' % flag}/i) { return true } + false end if $mflags.set?(?n) |