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 /lib | |
| 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 'lib')
| -rw-r--r-- | lib/mkmf.rb | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index e8acbf2e4..4365cbe57 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -793,11 +793,25 @@ def arg_config(config, *defaults, &block) $configure_args.fetch(config.tr('_', '-'), *defaults, &block) end -def with_config(config, *defaults, &block) - unless /^--with[-_]/ =~ config - config = '--with-' + config +def with_config(config, *defaults) + config = config.sub(/^--with[-_]/, '') + val = arg_config("--with-"+config) do + if arg_config("--without-"+config) + false + elsif block_given? + yield(config, *defaults) + else + break *defaults + end + end + case val + when "yes" + true + when "no" + false + else + val end - arg_config(config, *defaults, &block) end def enable_config(config, *defaults) |
