Skip to content
Browse files

* 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: http://svn.ruby-lang.org/repos/ruby/trunk@3419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent a7a5ebe commit 7a865f040b1e52e0d273273d150fba1354d9b721 @knu knu committed
Showing with 23 additions and 33 deletions.
  1. +6 −0 ChangeLog
  2. +8 −16 ext/extmk.rb
  3. +9 −17 instruby.rb
View
6 ChangeLog
@@ -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
View
24 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)
View
26 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)

0 comments on commit 7a865f0

Please sign in to comment.
Something went wrong with that request. Please try again.