diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2020-06-03 22:00:59 +0200 |
---|---|---|
committer | Lars Kanis <lars@greiz-reinsdorf.de> | 2020-06-03 22:14:04 +0200 |
commit | 440f336c9a7f2269f57b6fbf3c529e1db3e21f76 (patch) | |
tree | e53f1ff1213783663edb9904eb2f07d3402c8a4c | |
parent | 426be5e8c302eb4b37bf03a8fd34b61b13257666 (diff) | |
download | ffi-440f336c9a7f2269f57b6fbf3c529e1db3e21f76.tar.gz |
Test for ffi_prep_closure_loc() to make sure we can use this function
We use this function since ffi-1.13.0 but didn't test for it.
It seems that MacOS 10.14 ships a libffi which is missing this function (older than 11 years).
On the other hand we don't use ffi_closure_alloc() any longer.
Fixes #785
-rw-r--r-- | ext/ffi_c/extconf.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/ffi_c/extconf.rb b/ext/ffi_c/extconf.rb index a9c7a07..6dd28aa 100644 --- a/ext/ffi_c/extconf.rb +++ b/ext/ffi_c/extconf.rb @@ -13,18 +13,17 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx' "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi") || (find_header("ffi.h", `xcrun --sdk macosx --show-sdk-path`.strip + "/usr/include/ffi") rescue false) - # Ensure we can link to ffi_call - libffi_ok &&= have_library("ffi", "ffi_call", [ "ffi.h" ]) || - have_library("libffi", "ffi_call", [ "ffi.h" ]) || - have_library("libffi-8", "ffi_call", [ "ffi.h" ]) + # Ensure we can link to ffi_prep_closure_loc + libffi_ok &&= have_library("ffi", "ffi_prep_closure_loc", [ "ffi.h" ]) || + have_library("libffi", "ffi_prep_closure_loc", [ "ffi.h" ]) || + have_library("libffi-8", "ffi_prep_closure_loc", [ "ffi.h" ]) if RbConfig::CONFIG['host_os'] =~ /mswin/ have_library('libffi_convenience') have_library('shlwapi') end - # And we need a libffi version recent enough to provide ffi_closure_alloc - libffi_ok &&= have_func("ffi_closure_alloc") + libffi_ok end dir_config("ffi_c") |