summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-09 06:58:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-09 06:58:18 +0000
commitc5e8342d4f6e0cec730497ead5c67226d212a104 (patch)
treef623b9e8d2fecebc3b2e7f1fe6bab13fc630fd3f
parent7ea2bb32350dcf4ef075f69cbcdedbd38f11a338 (diff)
mkmf.rb: macro assigments
* lib/mkmf.rb ($configure_args): store macro assigments as-is, not only in option style. e.g., ruby extconf.rb optflags=-O0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/mkmf.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 0d19562..415f149 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -98,22 +98,16 @@ module MakeMakefile
arg, val = arg.split('=', 2)
next unless arg
arg.tr!('_', '-')
- if arg.sub!(/^(?!--)/, '--')
- val or next
- arg.downcase!
- end
- next if /^--(?:top|topsrc|src|cur)dir$/ =~ arg
+ next if /\A(--)?(?:top|topsrc|src|cur)dir\z/i =~ arg
$configure_args[arg] = val || true
+ $configure_args["--#{arg.downcase}"] = val if val and /\A--/ !~ arg
end
for arg in ARGV
arg, val = arg.split('=', 2)
next unless arg
arg.tr!('_', '-')
- if arg.sub!(/^(?!--)/, '--')
- val or next
- arg.downcase!
- end
$configure_args[arg] = val || true
+ $configure_args["--#{arg.downcase}"] = val if val and /\A--/ !~ arg
end
end