diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-16 17:28:42 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-16 17:28:42 +0000 |
commit | a88191b1cacfcc27944edff728753944ee20e166 (patch) | |
tree | 937fa8cceb7e2de92f66a63a94efb950d759de4e | |
parent | 08c467330ba0bc92150a65a01cd397562a5ea78d (diff) |
* 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
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | tool/mkconfig.rb | 21 |
2 files changed, 17 insertions, 11 deletions
@@ -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> * 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 |