summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-05 07:04:10 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-05 07:04:10 +0000
commit15774ab1fbc7149adb9864817ed336375bfcc005 (patch)
treec495c53d1e086a4ffe6e65d46ee6a0df43d519e1 /ext
parenta287a10df79e77b288921e9c330cf31d6d23a317 (diff)
* instruby.rb: need paren in regexp(make -n install).
* ext/extmk.rb (sysquote): do not need to quote on mswin/bccwin/mingw. * ext/extm.rb ($mflags): uniq items and remove '-' and '--'. move options to the lead. * lib/fileutils.rb (install): model on the real install command(message). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb20
1 files changed, 9 insertions, 11 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index c13c6e3f69..1280daf118 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -28,11 +28,9 @@ $topdir = File.expand_path(".")
$top_srcdir = srcdir
$hdrdir = $top_srcdir
-$quote =
- /mswin|bccwin|mingw|human|os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
-
def sysquote(x)
- $quote ? x.quote : x
+ @quote ||= /human|os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
+ @quote ? x.quote : x
end
def extmake(target)
@@ -113,11 +111,13 @@ getopts('', 'extstatic', 'make:', 'make-flags:')
$force_static = $OPT['extstatic'] == 'static'
$make = $OPT['make'] || $make
-$mflags = Shellwords.shellwords($OPT['make-flags'] || "")
+$mflags = Shellwords.shellwords($OPT['make-flags'] || "").uniq
$mflags[0].sub!(/^\w+$/, '-\&') unless $mflags.empty?
$make, *$mflags[0, 0] = Shellwords.shellwords($make)
-mflags = $mflags.grep(/^-([^-].*)/) {$1}.join
+$mflags.delete_if{|x| x == '-' || x == '--'}
+
+mflags = $mflags.grep(/^-([^-])/){$1}.join
mflags.downcase! if $nmake == ?m
$continue = mflags.include?(?k)
$dryrun = mflags.include?(?n)
@@ -141,6 +141,8 @@ unless $message
end
end
+$mflags = $mflags.partition{|x| x[0] == ?-}.flatten!
+
EXEEXT = CONFIG['EXEEXT']
if CROSS_COMPILING
$ruby = CONFIG['MINIRUBY']
@@ -237,11 +239,7 @@ puts "making #{rubies.join(', ')}"
$stdout.flush
$mflags.concat(rubies)
-if $quote
- system($make, *$mflags.quote) or exit($?.exitstatus)
-else
- exec($make, *$mflags)
-end
+system($make, *sysquote($mflags)) or exit($?.exitstatus)
#Local variables:
# mode: ruby