From a88191b1cacfcc27944edff728753944ee20e166 Mon Sep 17 00:00:00 2001 From: knu Date: Thu, 16 Sep 2010 17:28:42 +0000 Subject: [PATCH] * 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 --- ChangeLog | 7 +++++++ tool/mkconfig.rb | 21 ++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32810357a2..dba9767c34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Sep 17 02:18:41 2010 Akinori MUSHA + + * 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 * ext/pathname/pathname.c (path_opendir): Pathname#opendir translated diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb index da636c971f..d099eebeb9 100755 --- a/tool/mkconfig.rb +++ b/tool/mkconfig.rb @@ -35,6 +35,7 @@ module RbConfig ] arch = RUBY_PLATFORM +win32 = /mswin32/ =~ arch v_fast = [] v_others = [] vars = {} @@ -51,19 +52,17 @@ File.foreach "config.status" do |line| name = $1 val = $2 if $3 - continued_line = [] - continued_line << val + continued_line = [val] continued_name = name next end when /^"(.*)"\s*(\\)?$/ - if continued_line - continued_line << $1 - next if $2 - val = continued_line.join("") - name = continued_name - continued_line = nil - end + next if !continued_line + continued_line << $1 + next if $2 + val = continued_line.join + name = continued_name + continued_line = nil when /^(?:ac_given_)?INSTALL=(.*)/ v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n" end @@ -112,14 +111,14 @@ File.foreach "config.status" do |line| end end if name == "configure_args" - val.gsub!(/ +(?!-)/, "=") if /mswin32/ =~ RUBY_PLATFORM + val.gsub!(/ +(?!-)/, "=") if win32 val.gsub!(/--with-out-ext/, "--without-ext") end val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump if /^prefix$/ =~ name val = "(TOPDIR || DESTDIR + #{val})" end - v = " CONFIG[\"#{name}\"] #{vars[name] ? '<< "\n"' : '='} #{val}\n" + v = " CONFIG[\"#{name}\"] #{win32 && vars[name] ? '<< "\n"' : '='} #{val}\n" vars[name] = true if fast[name] v_fast << v