diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-15 08:08:40 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-15 08:08:40 +0000 |
commit | f1bc46f06d56232b38d53e263efc631efe68eb9b (patch) | |
tree | ebfcdc67f273305f7af000b928e38eab4a7cb2d2 | |
parent | dc6e5706651f1a53c048c14db039091139bf79ba (diff) |
* tool/compile_prelude.rb: fix first substitution.
use constant for prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | tool/compile_prelude.rb | 7 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Thu Nov 15 17:07:54 2007 Tanaka Akira <akr@fsij.org> + + * tool/compile_prelude.rb: fix first substitution. + use constant for prefix. + Thu Nov 15 14:29:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * common.mk (prereq): added auto generated sources. [ruby-dev:32280] diff --git a/tool/compile_prelude.rb b/tool/compile_prelude.rb index ea77729311..4d08b4d68a 100644 --- a/tool/compile_prelude.rb +++ b/tool/compile_prelude.rb @@ -29,6 +29,7 @@ lines_list = preludes.map {|filename| need_ruby_prefix = false File.readlines(filename).each {|line| line.gsub!(/RbConfig::CONFIG\["(\w+)"\]/) { + key = $1 unless mkconf require 'rbconfig' mkconf = RbConfig::MAKEFILE_CONFIG.merge('prefix'=>'#{TMP_RUBY_PREFIX}') @@ -36,12 +37,12 @@ lines_list = preludes.map {|filename| setup_ruby_prefix = "TMP_RUBY_PREFIX = $:.grep(%r{\\A/}).last[0..#{-exlen-1}]\n" teardown_ruby_prefix = 'Object.class_eval { remove_const "TMP_RUBY_PREFIX" }' end - if RbConfig::MAKEFILE_CONFIG.has_key? $1 - val = RbConfig.expand("$(#$1)", mkconf) + if RbConfig::MAKEFILE_CONFIG.has_key? key + val = RbConfig.expand("$(#{key})", mkconf) need_ruby_prefix = true if /\A\#{TMP_RUBY_PREFIX\}/ =~ val c_esc(val) else - $& + "nil" end } lines << c_esc(line) |