@@ -36,12 +36,39 @@ module Config
36
36
v_others = [ ]
37
37
vars = { }
38
38
has_version = false
39
+ continued_name = nil
40
+ continued_line = nil
39
41
File . foreach "config.status" do |line |
40
42
next if /^#/ =~ line
41
- if /^s([%,])@(\w +)@\1 (?:\| \# _!!_\# \| )?(.*)\1 / =~ line
43
+ name = nil
44
+ case line
45
+ when /^s([%,])@(\w +)@\1 (?:\| \# _!!_\# \| )?(.*)\1 /
42
46
name = $2
43
47
val = $3. gsub ( /\\ (?=,)/ , '' )
44
- next if /^(?:ac_.*|DEFS|configure_input)$/ =~ name
48
+ when /^S\[ "(\w +)"\] \s *=\s *"(.*)"\s *(\\ )?$/
49
+ name = $1
50
+ val = $2
51
+ if $3
52
+ continued_line = [ ]
53
+ continued_line << val
54
+ continued_name = name
55
+ next
56
+ end
57
+ when /^"(.+)"\s *(\\ )?$/
58
+ if continued_line
59
+ continued_line << $1
60
+ unless $2
61
+ val = continued_line . join ( "" )
62
+ name = continued_name
63
+ continued_line = nil
64
+ end
65
+ end
66
+ when /^(?:ac_given_)?INSTALL=(.*)/
67
+ v_fast << " CONFIG[\" INSTALL\" ] = " + $1 + "\n "
68
+ end
69
+
70
+ if name
71
+ next if /^(?:ac_.*|DEFS|configure_input|(?:top_)?srcdir|\w +OBJS)$/ =~ name
45
72
next if /^\$ \( ac_\w +\) $/ =~ val
46
73
next if /^\$ \{ ac_\w +\} $/ =~ val
47
74<
8000
/code>
next if /^\$ ac_\w +$/ =~ val
@@ -54,6 +81,7 @@ module Config
54
81
name = "ruby_install_name"
55
82
val = "ruby" . sub ( /#{ ptn [ 0 ] } / , ptn [ 1 ] )
56
83
end
84
+ val . gsub! ( / +(?!-)/ , "=" ) if name == "configure_args" && /mswin32/ =~ RUBY_PLATFORM
57
85
val = val . gsub ( /\$ (?:\$ |\{ ?(\w +)\} ?)/ ) { $1 ? "$(#{ $1} )" : $&} . dump
58
86
if /^prefix$/ =~ name
59
87
val = "(TOPDIR || DESTDIR + #{ val } )"
@@ -66,8 +94,6 @@ module Config
66
94
v_others << v
67
95
end
68
96
has_version = true if name == "MAJOR"
69
- elsif /^(?:ac_given_)?INSTALL=(.*)/ =~ line
70
- v_fast << " CONFIG[\" INSTALL\" ] = " + $1 + "\n "
71
97
end
72
98
# break if /^CEOF/
73
99
end
@@ -109,7 +135,8 @@ module Config
109
135
v_fast << " CONFIG[\" RUBY_SO_NAME\" ] = \" " + $so_name + "\" \n "
110
136
end
111
137
112
- print v_fast , v_others
138
+ print ( *v_fast )
139
+ print ( *v_others )
113
140
print <<EOS
114
141
CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
115
142
CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
0 commit comments