From d303a2c45a60240cbd6ed33745c267205642184d Mon Sep 17 00:00:00 2001 From: hsbt Date: Sat, 20 Oct 2018 07:27:18 +0000 Subject: [PATCH] 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 --- ext/fiddle/extconf.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)}