aboutsummaryrefslogtreecommitdiffstats
path: root/ext/fiddle
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 07:27:18 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 07:27:18 +0000
commitd303a2c45a60240cbd6ed33745c267205642184d (patch)
tree6cbfa8da011d3636b1c466ab98854a7179cc73b1 /ext/fiddle
parent8d3b2631ba5967a154df541917739af50b8a723d (diff)
downloadruby-d303a2c45a60240cbd6ed33745c267205642184d.tar.gz
Merge fiddle from github repository.
* ext/fiddle/extconf.rb: It supports to build libffi with standalone gem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/extconf.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 2c333001e5..654667feed 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -18,6 +18,16 @@ if ! bundle
end and (have_library('ffi') || have_library('libffi'))
end or
begin
+ # for https://github.com/ruby/fiddle
+ if bundle && File.exit?("../../bin/extlibs.rb")
+ require "fileutils"
+ require_relative "../../bin/extlibs"
+ extlibs = ExtLibs.new
+ cache_dir = File.expand_path("../../tmp/.download_cache", $srcdir)
+ ext_dir = File.expand_path("../../ext", $srcdir)
+ Dir.glob("#{$srcdir}/libffi-*/").each{|dir| FileUtils.rm_rf(dir)}
+ extlibs.run(["--cache=#{cache_dir}", ext_dir])
+ end
ver = bundle != false &&
Dir.glob("#{$srcdir}/libffi-*/")
.map {|n| File.basename(n)}