ruby-changes:26838
From: nobu <ko1@a...>
Date: Mon, 21 Jan 2013 13:51:38 +0900 (JST)
Subject: [ruby-changes:26838] nobu:r38889 (trunk): mkmf.rb: $extmk for symlink
nobu 2013-01-21 13:51:24 +0900 (Mon, 21 Jan 2013) New Revision: 38889 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38889 Log: mkmf.rb: $extmk for symlink * lib/mkmf.rb ($extmk): traverse parent directories for the case srcdir is a symlink. Modified files: trunk/ChangeLog trunk/lib/mkmf.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 38888) +++ ChangeLog (revision 38889) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jan 21 13:51:21 2013 Nobuyoshi Nakada <nobu@r...> + + * lib/mkmf.rb ($extmk): traverse parent directories for the case + srcdir is a symlink. + Sun Jan 20 23:55:37 2013 Nobuyoshi Nakada <nobu@r...> * marshal.c (w_object, r_object0): separate respond_to checks and Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 38888) +++ lib/mkmf.rb (revision 38889) @@ -199,9 +199,14 @@ module MakeMakefile https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L199 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/