* tool/mkconfig.rb: Fix build with m4 1.4.15 generating duplicate

lines in config.status.  According to nobu, the mswin32 port may
  depend on the piece of code in question, so the behavior is left
  unchanged on mswin32.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2010-09-16 17:28:42 +00:00
parent 08c467330b
commit a88191b1ca
2 changed files with 17 additions and 11 deletions

View File

@ -1,3 +1,10 @@
Fri Sep 17 02:18:41 2010 Akinori MUSHA <knu@iDaemons.org>
* tool/mkconfig.rb: Fix build with m4 1.4.15 generating duplicate
lines in config.status. According to nobu, the mswin32 port may
depend on the piece of code in question, so the behavior is left
unchanged on mswin32.
Thu Sep 16 23:47:59 2010 Tanaka Akira <akr@fsij.org> Thu Sep 16 23:47:59 2010 Tanaka Akira <akr@fsij.org>
* ext/pathname/pathname.c (path_opendir): Pathname#opendir translated * ext/pathname/pathname.c (path_opendir): Pathname#opendir translated

View File

@ -35,6 +35,7 @@ module RbConfig
] ]
arch = RUBY_PLATFORM arch = RUBY_PLATFORM
win32 = /mswin32/ =~ arch
v_fast = [] v_fast = []
v_others = [] v_others = []
vars = {} vars = {}
@ -51,19 +52,17 @@ File.foreach "config.status" do |line|
name = $1 name = $1
val = $2 val = $2
if $3 if $3
continued_line = [] continued_line = [val]
continued_line << val
continued_name = name continued_name = name
next next
end end
when /^"(.*)"\s*(\\)?$/ when /^"(.*)"\s*(\\)?$/
if continued_line next if !continued_line
continued_line << $1 continued_line << $1
next if $2 next if $2
val = continued_line.join("") val = continued_line.join
name = continued_name name = continued_name
continued_line = nil continued_line = nil
end
when /^(?:ac_given_)?INSTALL=(.*)/ when /^(?:ac_given_)?INSTALL=(.*)/
v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n" v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
end end
@ -112,14 +111,14 @@ File.foreach "config.status" do |line|
end end
end end
if name == "configure_args" if name == "configure_args"
val.gsub!(/ +(?!-)/, "=") if /mswin32/ =~ RUBY_PLATFORM val.gsub!(/ +(?!-)/, "=") if win32
val.gsub!(/--with-out-ext/, "--without-ext") val.gsub!(/--with-out-ext/, "--without-ext")
end end
val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
if /^prefix$/ =~ name if /^prefix$/ =~ name
val = "(TOPDIR || DESTDIR + #{val})" val = "(TOPDIR || DESTDIR + #{val})"
end end
v = " CONFIG[\"#{name}\"] #{vars[name] ? '<< "\n"' : '='} #{val}\n" v = " CONFIG[\"#{name}\"] #{win32 && vars[name] ? '<< "\n"' : '='} #{val}\n"
vars[name] = true vars[name] = true
if fast[name] if fast[name]
v_fast << v v_fast << v