@@ -3540,7 +3540,7 @@ function u_setup_expat( _opt_result, with_system_expat) {
35403540 v_export("LIBEXPAT_INTERNAL")
35413541}
35423542
3543- function u_detect_libffi( ac_cv_ffi_complex_double_supported, ctypes_malloc_closure, ffi_inc, found_ffi_h, output, parts, pkg, sdkroot, status, _ar_4, _ar_5) {
3543+ function u_detect_libffi( ac_cv_ffi_complex_double_supported, ctypes_malloc_closure, ffi_inc, found_darwin_ffi, found_ffi_h, output, parts, pkg, sdkroot, status, _ar_4, _ar_5) {
35443544 delete _ar_4
35453545 delete _ar_5
35463546 V["have_libffi"] = "missing"
@@ -3550,16 +3550,20 @@ function u_detect_libffi( ac_cv_ffi_complex_double_supported, ctypes_malloc_c
35503550 if ((V["ac_sys_system"] == "Darwin")) {
35513551 sdkroot = V["SDKROOT"]
35523552 ffi_inc = (((sdkroot != "") && (sdkroot != "no")) ? sdkroot "/usr/include/ffi" : "/usr/include/ffi")
3553+ found_darwin_ffi = "no"
35533554 pyconf_save_env()
35543555 V["CFLAGS"] = _str_strip("-I" ffi_inc " " V["CFLAGS"])
35553556 if (pyconf_check_header("ffi.h")) {
35563557 if (pyconf_check_lib("ffi", "ffi_call", "", "")) {
3557- V["have_libffi"] = "yes"
3558- V["LIBFFI_CFLAGS"] = "-I" ffi_inc " -DUSING_APPLE_OS_LIBFFI=1"
3559- V["LIBFFI_LIBS"] = "-lffi"
3558+ found_darwin_ffi = "yes"
35603559 }
35613560 }
35623561 pyconf_restore_env()
3562+ if (((found_darwin_ffi != "") && (found_darwin_ffi != "no"))) {
3563+ V["have_libffi"] = "yes"
3564+ V["LIBFFI_CFLAGS"] = "-I" ffi_inc " -DUSING_APPLE_OS_LIBFFI=1"
3565+ V["LIBFFI_LIBS"] = "-lffi"
3566+ }
35633567 }
35643568 if ((V["have_libffi"] == "missing")) {
35653569 pkg = pyconf_find_prog("pkg-config")
0 commit comments