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 | 871c3691235fd0bafb5612f451ac4fc50f1b3059 (patch) | |
tree | 11db3ff65ea32d4e1b3bccf205febb7ddcbf954a /ext | |
parent | e9640a4fba717a7e08b9aaf7b644b43fba018e84 (diff) | |
download | ruby-871c3691235fd0bafb5612f451ac4fc50f1b3059.tar.gz ruby-871c3691235fd0bafb5612f451ac4fc50f1b3059.tar.xz ruby-871c3691235fd0bafb5612f451ac4fc50f1b3059.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/branches/ruby_1_8@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 5d85d2d97..23be23c29 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -353,10 +353,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 |