aboutsummaryrefslogtreecommitdiffstats
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-09 05:52:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-09 05:52:59 +0000
commit77811031e549b0e8011182f6f703a07ab2ae767b (patch)
treee1e093009ad72c0f14cf592d5a1a0cbc16d8f744 /ext/extmk.rb
parentecb8b52f56f108ac93f0f470462f3a3cb697d91e (diff)
downloadruby-77811031e549b0e8011182f6f703a07ab2ae767b.tar.gz
extmk.rb: check if parent is build
* ext/extmk.rb (extmake): don't build nested libraries if parent library isn't build. * ext/{dl/callback,tk/tkutil}/extconf.rb: no longer need to check if the parent is build. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 978095cd30..b80a4fc36e 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -141,6 +141,16 @@ def extmake(target)
FileUtils.mkpath target unless File.directory?(target)
begin
+ # don't build if parent library isn't build
+ parent = true
+ d = target
+ until (d = File.dirname(d)) == '.'
+ if File.exist?("#{$top_srcdir}/ext/#{d}/extconf.rb")
+ parent = (/^all:\s*install/ =~ IO.read("#{d}/Makefile") rescue false)
+ break
+ end
+ end
+
dir = Dir.pwd
FileUtils.mkpath target unless File.directory?(target)
Dir.chdir target
@@ -161,8 +171,8 @@ def extmake(target)
makefile = "./Makefile"
static = $static
$static = nil if noinstall = File.fnmatch?("-*", target)
- ok = File.exist?(makefile)
- unless $ignore
+ ok = parent && File.exist?(makefile)
+ if parent && !$ignore
rbconfig0 = RbConfig::CONFIG
mkconfig0 = CONFIG
rbconfig = {
@@ -288,13 +298,15 @@ def extmake(target)
end
ensure
Logging::log_close
- unless $ignore
+ if rbconfig0
RbConfig.module_eval {
remove_const(:CONFIG)
const_set(:CONFIG, rbconfig0)
remove_const(:MAKEFILE_CONFIG)
const_set(:MAKEFILE_CONFIG, mkconfig0)
}
+ end
+ if mkconfig0
MakeMakefile.class_eval {
remove_const(:CONFIG)
const_set(:CONFIG, mkconfig0)