summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-21 04:51:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-21 04:51:24 +0000
commitd78a00cc0ccc69f8e27f8e415506837d0c9f5592 (patch)
tree293ca325dbd1dfe574e38f11e3db55daaa2089e9 /lib
parent433999fd5c82a8925baf312155351252320a44ce (diff)
mkmf.rb: $extmk for symlink
* lib/mkmf.rb ($extmk): traverse parent directories for the case srcdir is a symlink. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index e54f6113c5..7f7d13627f 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -199,9 +199,14 @@ module MakeMakefile
topdir = File.dirname(File.dirname(__FILE__))
path = File.expand_path($0)
- $extmk = path[0, topdir.size+1] == topdir+"/"
- $extmk &&= %r"\A(?:ext|enc|tool|test(?:/.+)?)\z" =~ File.dirname(path[topdir.size+1..-1])
- $extmk &&= true
+ until (dir = File.dirname(path)) == path
+ if File.identical?(dir, topdir)
+ $extmk = true if %r"\A(?:ext|enc|tool|test)\z" =~ File.basename(path)
+ break
+ end
+ path = dir
+ end
+ $extmk ||= false
if not $extmk and File.exist?(RbConfig::CONFIG["rubyhdrdir"] + "/ruby/ruby.h")
$hdrdir = CONFIG["rubyhdrdir"]
$topdir = $hdrdir