diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-22 14:55:07 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-22 14:55:07 +0000 |
| commit | faa7729738f67128c00ae71819a269b547411614 (patch) | |
| tree | 87d197119c2de1782a2a0f9c788a0d3abb1f14ac /ext | |
| parent | ae203e6e5e1cae97fd49f66ba8e7dc01914de0ec (diff) | |
| download | ruby-faa7729738f67128c00ae71819a269b547411614.tar.gz ruby-faa7729738f67128c00ae71819a269b547411614.tar.xz ruby-faa7729738f67128c00ae71819a269b547411614.zip | |
* ext/extmk.rb, lib/mkmf.rb (with_config): support --with-extension
options. [ruby-dev:27449]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/extmk.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb index 334ddbcd1..331ed180e 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -354,10 +354,25 @@ 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 {|opt|arg_config(w+opt)}).any? + proc {false} + elsif (w = w.grep(String)).empty? + proc {true} + else + w.collect {|opt| opt.split(/,/)}.flatten.method(:any?) + end + } + cond = proc {|ext| + cond1 = proc {|n| File.fnmatch(n, ext, File::FNM_PATHNAME)} + withes.call(&cond1) or !withouts.call(&cond1) + } exts |= Dir.glob("#{ext_prefix}/*/**/extconf.rb").collect {|d| d = File.dirname(d) d.slice!(0, ext_prefix.length + 1) d + }.find_all {|ext| + with_config(ext, &cond) }.sort end |
