diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-19 05:29:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-19 05:29:18 +0000 |
commit | 1b26041724a9b74eaa7364a6693a2a1040042fb3 (patch) | |
tree | 3d27c525896214ff9ab187f23641f23d37cacd59 /ext/extmk.rb | |
parent | 281825d48d3a0cf7281d5b42501d7191a821d21b (diff) | |
download | ruby-1b26041724a9b74eaa7364a6693a2a1040042fb3.tar.gz |
* Makefile.in (clean-ext): allow glob patterns.
* ext/extmk.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rw-r--r-- | ext/extmk.rb | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb index 13812fc8bb..6715bcee3b 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -396,29 +396,27 @@ end unless $extstatic ext_prefix = "#{$top_srcdir}/ext" exts = $static_ext.sort_by {|t, i| i}.collect {|t, i| t} -if $extension - exts |= $extension.select {|d| File.directory?("#{ext_prefix}/#{d}")} -else - withes, withouts = %w[--with --without].collect {|w| - if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any? - nil - elsif (w = w.grep(String)).empty? - proc {true} - else - proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)} - end - } - if withes - withouts ||= proc {true} +withes, withouts = %w[--with --without].collect {|w| + if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any? + nil + elsif (w = w.grep(String)).empty? + proc {true} else - withes = proc {false} - withouts ||= withes + proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)} end - cond = proc {|ext, *| - cond1 = proc {|n| File.fnmatch(n, ext)} - withes.call(cond1) or !withouts.call(cond1) - } - exts |= Dir.glob("#{ext_prefix}/*/**/extconf.rb").collect {|d| +} +if withes + withouts ||= proc {true} +else + withes = proc {false} + withouts ||= withes +end +cond = proc {|ext, *| + cond1 = proc {|n| File.fnmatch(n, ext)} + withes.call(cond1) or !withouts.call(cond1) +} +($extension || %w[*]).each do |e| + exts |= Dir.glob("#{ext_prefix}/#{e}/**/extconf.rb").collect {|d| d = File.dirname(d) d.slice!(0, ext_prefix.length + 1) d |