summaryrefslogtreecommitdiff
path: root/mkconfig.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-30 03:06:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-30 03:06:02 +0000
commitbfc2a070b1c1d877dee7050bb5fa89ec56dabc12 (patch)
treea49ebc1bba9a14f154c6aa8cdf6edefe6798f018 /mkconfig.rb
parentdbee7c9072aabc1ffafcd3343622d1e8f9b7ebe8 (diff)
* mkconfig.rb: autoconf 2.61 support. [ruby-core:10016]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mkconfig.rb')
-rwxr-xr-xmkconfig.rb31
1 files changed, 28 insertions, 3 deletions
diff --git a/mkconfig.rb b/mkconfig.rb
index 9cbffa4a89..2d79c5fff1 100755
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -36,11 +36,38 @@ v_fast = []
v_others = []
vars = {}
has_version = false
+continued_name = nil
+continued_line = nil
File.foreach "config.status" do |line|
next if /^#/ =~ line
- if /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/ =~ line
+ name = nil
+ case line
+ when /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/
name = $2
val = $3.gsub(/\\(?=,)/, '')
+ when /^S\["(\w+)"\]\s*=\s*"(.*)"\s*(\\)?$/
+ name = $1
+ val = $2
+ if $3
+ continued_line = []
+ continued_line << val
+ continued_name = name
+ next
+ end
+ when /^"(.+)"\s*(\\)?$/
+ if continued_line
+ continued_line << $1
+ unless $2
+ val = continued_line.join("")
+ name = continued_name
+ continued_line = nil
+ end
+ end
+ when /^(?:ac_given_)?INSTALL=(.*)/
+ v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
+ end
+
+ if name
next if /^(?:ac_.*|DEFS|configure_input|(?:top_)?srcdir|\w+OBJS)$/ =~ name
next if /^\$\(ac_\w+\)$/ =~ val
next if /^\$\{ac_\w+\}$/ =~ val
@@ -67,8 +94,6 @@ File.foreach "config.status" do |line|
v_others << v
end
has_version = true if name == "MAJOR"
- elsif /^(?:ac_given_)?INSTALL=(.*)/ =~ line
- v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
end
# break if /^CEOF/
end