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 /lib | |
| 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 '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 9fe0d9bbf..6150b59c9 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) |
