summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-27 05:11:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-27 05:11:13 +0000
commit6c840ba8f466d3050bfb4bfcc092c9459481fdb1 (patch)
treeaf08481f8b534cc56f0b2fe9cbe974224efa509a /lib
parente5ce6155af93a5cdaaef02ad44dfc143d0bafd9c (diff)
--with-xxx=yyy
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 2b314fd..d4d24e1 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -242,6 +242,36 @@ def have_header(header)
return TRUE
end
+def arg_config(config, default="yes")
+ unless defined? $configure_args
+ $configure_args = {}
+ for arg in CONFIG["configure_args"].split + ARGV
+ next unless /^--/ =~ arg
+ if /=/ =~ arg
+ $configure_args[$`] = $'
+ else
+ $configure_args[arg] = default
+ end
+ end
+ end
+ p [$configure_args, config]
+ $configure_args.fetch(config, default)
+end
+
+def with_config(config, default="yes")
+ unless /^--with-/ =~ config
+ config = '--with-' + config
+ end
+ arg_config(config, default)
+end
+
+def with_config(config, value="yes")
+ unless /^-with-/ =~ config
+ config = '-with-' + config
+ end
+ arg_config(config, value)
+end
+
def create_header()
print "creating extconf.h\n"
STDOUT.flush