summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 415f149fe4..0d19562db6 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -98,16 +98,22 @@ module MakeMakefile
arg, val = arg.split('=', 2)
next unless arg
arg.tr!('_', '-')
- next if /\A(--)?(?:top|topsrc|src|cur)dir\z/i =~ arg
+ if arg.sub!(/^(?!--)/, '--')
+ val or next
+ arg.downcase!
+ end
+ next if /^--(?:top|topsrc|src|cur)dir$/ =~ 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