Index: ext/extmk.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/extmk.rb,v
retrieving revision 1.47
diff -u -2 -p -d -r1.47 extmk.rb
--- ext/extmk.rb	9 Jan 2004 02:20:28 -0000	1.47
+++ ext/extmk.rb	13 Jan 2004 05:00:17 -0000
@@ -120,6 +120,15 @@ end
 
   $dryrun = $OPT['n']
-  $force_static = $OPT['extstatic'] == 'static'
+  if $extstatic = $OPT['extstatic']
+    if $extstatic.empty?
+      $extstatic = nil
+    elsif $extstatic == "none"
+      $extstatic = ""
+    else
+      $force_static = true
+      $extstatic = nil if $extstatic == 'static'
+    end
+  end
   $destdir = $OPT['dest-dir'] || ''
   $make = $OPT['make'] || $make || 'make'
@@ -189,4 +215,10 @@ MTIMES = [__FILE__, srcdir+'/lib/mkmf.rb
 # get static-link modules
 $static_ext = {}
+if $extstatic
+  $extstatic.split(/,/).each do |target|
+    target = target.downcase if /mswin32|bccwin32/ =~ RUBY_PLATFORM
+    $static_ext[target] = $static_ext.size
+  end
+else
 for dir in ["ext", File::join($top_srcdir, "ext")]
   setup = File::join(dir, CONFIG['setup'])
@@ -214,4 +246,5 @@ for dir in ["ext", File::join($top_srcdi
   end
 end
+end
 
 FileUtils::makedirs('ext')
@@ -228,5 +261,5 @@ Dir.glob("#{ext_prefix}/*/**/MANIFEST") 
   next if $static_ext[d]
   extmake(d) or abort
-end
+end unless $extstatic
 
 if $ignore
