Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for ffi_prep_closure_loc() to make sure we can use this function #787

Merged
merged 1 commit into from Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions ext/ffi_c/extconf.rb
Expand Up @@ -13,18 +13,17 @@ def system_libffi_usable?
"/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")
Expand Down