summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWatson <watson1978@gmail.com>2020-07-26 02:07:09 +0900
committerWatson <watson1978@gmail.com>2020-07-26 02:09:38 +0900
commita10ac1b8fadeed65064ed9a8e8d5956a9c2d6980 (patch)
treed4ca1a439b2396a942cb6e0e81d9983ceb62a320
parent2c9c517876fd115191cd05f62ff8e77ebd493641 (diff)
downloadffi-a10ac1b8fadeed65064ed9a8e8d5956a9c2d6980.tar.gz
Fix build error with “--disable-system-libffi” option
-rw-r--r--ext/ffi_c/extconf.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/ffi_c/extconf.rb b/ext/ffi_c/extconf.rb
index 6dd28aa..a8bdc28 100644
--- a/ext/ffi_c/extconf.rb
+++ b/ext/ffi_c/extconf.rb
@@ -61,6 +61,9 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
File.open("Makefile", "a") do |mf|
mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias")
if RbConfig::CONFIG['host_os'].downcase =~ /darwin/
+ if RbConfig::CONFIG['host'] =~ /arm/
+ mf.puts "LIBFFI_HOST=--host=aarch64-apple-#{RbConfig::CONFIG['host_os']}"
+ end
mf.puts "include ${srcdir}/libffi.darwin.mk"
elsif RbConfig::CONFIG['host_os'].downcase =~ /bsd/
mf.puts '.include "${srcdir}/libffi.bsd.mk"'