summaryrefslogtreecommitdiff
path: root/tool/fake.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-06 05:20:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-06 05:20:10 +0000
commitad92b09e824f8fef81bf9877860981ab8db5141a (patch)
tree3a02b6d98e92cd4050a1f53315637d78d3faee5c /tool/fake.rb
parenta617afc643e17cea5c1960a60adcd5ffb25fdfe2 (diff)
split tool/fake.rb
* tool/fake.rb: split from template/fake.rb.in. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/fake.rb')
-rw-r--r--tool/fake.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/tool/fake.rb b/tool/fake.rb
new file mode 100644
index 0000000..7d3a471
--- /dev/null
+++ b/tool/fake.rb
@@ -0,0 +1,30 @@
+class File
+ sep = ("\\" if RUBY_PLATFORM =~ /mswin|bccwin|mingw/)
+ if sep != ALT_SEPARATOR
+ remove_const :ALT_SEPARATOR
+ ALT_SEPARATOR = sep
+ end
+end
+
+$:.unshift(builddir)
+posthook = proc do
+ mkconfig = RbConfig::MAKEFILE_CONFIG
+ extout = File.expand_path(mkconfig["EXTOUT"], builddir)
+ $arch_hdrdir = "#{extout}/include/$(arch)"
+ $ruby = baseruby
+ untrace_var(:$ruby, posthook)
+end
+prehook = proc do |extmk|
+ unless extmk
+ config = RbConfig::CONFIG
+ mkconfig = RbConfig::MAKEFILE_CONFIG
+ mkconfig["top_srcdir"] = $top_srcdir = top_srcdir
+ mkconfig["rubyhdrdir"] = "$(top_srcdir)/include"
+ mkconfig["builddir"] = config["builddir"] = builddir
+ config["rubyhdrdir"] = File.join(mkconfig["top_srcdir"], "include")
+ mkconfig["libdir"] = config["libdir"] = mkconfig["topdir"]
+ trace_var(:$ruby, posthook)
+ end
+ untrace_var(:$extmk, prehook)
+end
+trace_var(:$extmk, prehook)