summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-05 12:29:29 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-05 12:29:29 (GMT)
commit1587b32480b8ff607f0a56626a6fbdc068a62a20 (patch)
tree7ac159f2ceaaf0174eede9ff1533425df65933f1 /tool
parentb38b57cb5434746899d16556f148026430353b36 (diff)
fake.rb: optimal paths
* tool/fake.rb: remove redundant dot directories from joined path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/fake.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/tool/fake.rb b/tool/fake.rb
index 298c204..b2bdd08 100644
--- a/tool/fake.rb
+++ b/tool/fake.rb
@@ -44,8 +44,9 @@ prehook = proc do |extmk|
builddir = File.join([".."]*pwd.size + dir)
builddir = "." if builddir.empty?
end
+ join = proc {|*args| File.join(*args).sub!(/\A(?:\.\/)*/, '')}
$topdir ||= builddir
- $top_srcdir ||= File.join($topdir, srcdir)
+ $top_srcdir ||= join[$topdir, srcdir]
$extout = '$(topdir)/.ext'
$extout_prefix = '$(extout)$(target_prefix)/'
config = RbConfig::CONFIG
@@ -53,8 +54,8 @@ prehook = proc do |extmk|
mkconfig["builddir"] = config["builddir"] = builddir
mkconfig["top_srcdir"] = $top_srcdir if $top_srcdir
config["top_srcdir"] = File.expand_path($top_srcdir ||= top_srcdir)
- config["rubyhdrdir"] = File.join($top_srcdir, "include")
- config["rubyarchhdrdir"] = File.join(builddir, config["EXTOUT"], "include", config["arch"])
+ config["rubyhdrdir"] = join[$top_srcdir, "include"]
+ config["rubyarchhdrdir"] = join[builddir, config["EXTOUT"], "include", config["arch"]]
mkconfig["libdirname"] = "builddir"
trace_var(:$ruby, posthook)
untrace_var(:$extmk, prehook)