summaryrefslogtreecommitdiff
path: root/tool/fake.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-14 04:42:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-14 04:42:14 +0000
commitf34e8ff67234db9d49831b1073139602d01e4d6a (patch)
treebb3311484891e4d63e68d9c0e30b89d1b330af4d /tool/fake.rb
parent7a823be8d04813ab174a51c220d73d4ca3ab8a1c (diff)
downloadruby-f34e8ff67234db9d49831b1073139602d01e4d6a.tar.gz
Add RbConfig.fire_update!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/fake.rb')
-rw-r--r--tool/fake.rb35
1 files changed, 11 insertions, 24 deletions
diff --git a/tool/fake.rb b/tool/fake.rb
index dc8cf83e69..42174052e2 100644
--- a/tool/fake.rb
+++ b/tool/fake.rb
@@ -12,20 +12,9 @@ end
static = !!(defined?($static) && $static)
$:.unshift(builddir)
posthook = proc do
- config = RbConfig::CONFIG
- mkconfig = RbConfig::MAKEFILE_CONFIG
- [
- ["top_srcdir", $top_srcdir],
- ["topdir", $topdir],
- ].each do |var, val|
- next unless val
- mkconfig[var] = config[var] = val
- t = /\A#{Regexp.quote(val)}(?=\/)/
- $hdrdir.sub!(t) {"$(#{var})"}
- mkconfig.keys.grep(/dir\z/) do |k|
- mkconfig[k] = "$(#{var})#$'" if t =~ mkconfig[k]
- end
- end
+ RbConfig.fire_update!("top_srcdir", $top_srcdir)
+ RbConfig.fire_update!("topdir", $topdir)
+ $hdrdir.sub!(/\A#{Regexp.quote($top_srcdir)}(?=\/)/, "$(top_srcdir)")
if $extmk
$ruby = "$(topdir)/miniruby -I'$(topdir)' -I'$(top_srcdir)/lib' -I'$(extout)/$(arch)' -I'$(extout)/common'"
else
@@ -54,16 +43,14 @@ prehook = proc do |extmk|
$extout_prefix = '$(extout)$(target_prefix)/'
config = RbConfig::CONFIG
mkconfig = RbConfig::MAKEFILE_CONFIG
- mkconfig["builddir"] = config["builddir"] = builddir
- mkconfig["buildlibdir"] = config["buildlibdir"] = builddir
- mkconfig["libdir"] = config["libdir"] = builddir
- mkconfig["top_srcdir"] = $top_srcdir if $top_srcdir
- mkconfig["extout"] ||= $extout
- config["top_srcdir"] = File.expand_path($top_srcdir ||= top_srcdir)
- config["rubyhdrdir"] = join[$top_srcdir, "include"]
- config["rubyarchhdrdir"] = join[builddir, config["EXTOUT"], "include", config["arch"]]
- config["extout"] ||= join[$topdir, ".ext"]
- mkconfig["libdirname"] = "buildlibdir"
+ RbConfig.fire_update!("builddir", builddir)
+ RbConfig.fire_update!("buildlibdir", builddir)
+ RbConfig.fire_update!("libdir", builddir)
+ RbConfig.fire_update!("top_srcdir", $top_srcdir ||= top_srcdir)
+ RbConfig.fire_update!("extout", $extout)
+ RbConfig.fire_update!("rubyhdrdir", "$(top_srcdir)/include")
+ RbConfig.fire_update!("rubyarchhdrdir", "$(extout)/include/$(arch)")
+ RbConfig.fire_update!("libdirname", "buildlibdir")
trace_var(:$ruby, posthook)
untrace_var(:$extmk, prehook)
end