summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/spec_helper.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-28 15:15:48 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-28 15:15:48 +0000
commit8c5b60eb22d6d661e87992a65d54e3a5bc0aeed4 (patch)
tree7905b284cb5b3d62c17ad8a939e339621a498a2c /spec/ruby/optional/capi/spec_helper.rb
parent6530b14cee76e2512424d225e64d3c61dd1f6511 (diff)
Update to ruby/spec@a6b8805
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/optional/capi/spec_helper.rb')
-rw-r--r--spec/ruby/optional/capi/spec_helper.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/spec_helper.rb b/spec/ruby/optional/capi/spec_helper.rb
index 21d2cd04c5..a5f64b51fb 100644
--- a/spec/ruby/optional/capi/spec_helper.rb
+++ b/spec/ruby/optional/capi/spec_helper.rb
@@ -23,11 +23,18 @@ def compile_extension(name)
ext = "#{name}_spec"
lib = "#{object_path}/#{ext}.#{RbConfig::CONFIG['DLEXT']}"
ruby_header = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h"
+ libruby_so = RbConfig::CONFIG['LIBRUBY_SO']
+ ruby_library = "#{RbConfig::CONFIG['libdir']}/#{libruby_so}"
+ unless libruby_so and File.exist?(ruby_library)
+ # Statically-compiled lib in the binary
+ ruby_library = RbConfig.ruby
+ end
return lib if File.exist?(lib) and
File.mtime(lib) > File.mtime("#{extension_path}/rubyspec.h") and
File.mtime(lib) > File.mtime("#{extension_path}/#{ext}.c") and
File.mtime(lib) > File.mtime(ruby_header) and
+ File.mtime(lib) > File.mtime(ruby_library) and
true # sentinel
# Copy needed source files to tmpdir