summaryrefslogtreecommitdiff
path: root/mkconfig.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-25 14:03:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-25 14:03:10 +0000
commit0c98397ad39f3168cee997c1de7a7376324a9290 (patch)
tree7c16ca46fc65f881053231f626b9070fa4ad73a8 /mkconfig.rb
parentc033e22d27891b0c94f59526490702af9d0e32cf (diff)
* Makefile.in, mkconfig.rb: catch-up for latest autoconf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mkconfig.rb')
-rw-r--r--mkconfig.rb35
1 files changed, 15 insertions, 20 deletions
diff --git a/mkconfig.rb b/mkconfig.rb
index 74db915..5858287 100644
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -38,24 +38,27 @@ vars = {}
has_version = false
File.foreach "config.status" do |line|
next if /^#/ =~ line
- line.gsub!(/\|#_!!_#\|/, '')
- if /^s[%,]@program_transform_name@[%,]s(\\?.)(.*)\1[%,]/ =~ line
- next if $install_name
- sep = Regexp.quote($1)
- ptn = $2.sub(/\$\$/, '$').split(/#{sep}/,2)
- v_fast << " CONFIG[\"ruby_install_name\"] = \"" + "ruby".sub(/#{ptn[0]}/,ptn[1]) + "\"\n"
- elsif /^s[%,]@(\w+)@[%,](.*)[%,]/ =~ line
- name = $1
- val = $2 || ""
+ if /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/ =~ line
+ name = $2
+ val = $3.gsub(/\\(?=,)/, '')
next if /^(?:ac_.*|DEFS|configure_input)$/ =~ name
next if /^\$\(ac_\w+\)$/ =~ val
next if /^\$\{ac_\w+\}$/ =~ val
next if /^\$ac_\w+$/ =~ val
next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name
next if $so_name and /^RUBY_SO_NAME$/ =~ name
- v = " CONFIG[\"" + name + "\"] #{vars[name] ? '<<' : ''}= " +
- (vars[name] ? '"\n" ' : '') +
- val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump + "\n"
+ if /^program_transform_name$/ =~ name and /^s(\\?.)(.*)\1$/ =~ val
+ next if $install_name
+ sep = %r"#{Regexp.quote($1)}"
+ ptn = $2.sub(/\$\$/, '$').split(sep, 2)
+ name = "ruby_install_name"
+ val = "ruby".sub(/#{ptn[0]}/, ptn[1])
+ end
+ val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
+ if /^prefix$/ =~ name
+ val = "(TOPDIR || DESTDIR + #{val})"
+ end
+ v = " CONFIG[\"#{name}\"] #{vars[name] ? '<< "\n"' : '='} #{val}\n"
vars[name] = true
if fast[name]
v_fast << v
@@ -69,14 +72,6 @@ File.foreach "config.status" do |line|
# break if /^CEOF/
end
-v_fast.collect! do |x|
- if /"prefix"/ === x
- x.sub(/= (.*)/, '= (TOPDIR || DESTDIR + \1)')
- else
- x
- end
-end
-
drive = File::PATH_SEPARATOR == ';'
prefix = '/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM