Skip to content

Commit dcad8fe

Browse files
authored
gh-125206: Correct detection of complex numbers support in libffi (#126104)
1 parent 35df4eb commit dcad8fe

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Correct detection of complex numbers support in libffi.

configure

+16-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+5-3
Original file line numberDiff line numberDiff line change
@@ -4090,8 +4090,10 @@ AS_VAR_IF([have_libffi], [yes], [
40904090
# See https://github.com/python/cpython/issues/125206 for more details.
40914091
#
40924092
AC_CACHE_CHECK([libffi has complex type support], [ac_cv_ffi_complex_double_supported],
4093-
[ac_save_cc="$CC"
4094-
CC="$CC -lffi"
4093+
[WITH_SAVE_ENV([
4094+
CPPFLAGS="$LIBFFI_CFLAGS $CPPFLAGS"
4095+
LDFLAGS="$LIBFFI_LIBS $LDFLAGS"
4096+
LIBS="$LIBFFI_LIBS $LIBS"
40954097
AC_RUN_IFELSE([AC_LANG_SOURCE([[
40964098
#include <complex.h>
40974099
#include <ffi.h>
@@ -4118,7 +4120,7 @@ int main(void)
41184120
]])], [ac_cv_ffi_complex_double_supported=yes],
41194121
[ac_cv_ffi_complex_double_supported=no],
41204122
[ac_cv_ffi_complex_double_supported=no])
4121-
CC="$ac_save_cc"])
4123+
])])
41224124
if test "$ac_cv_ffi_complex_double_supported" = "yes"; then
41234125
AC_DEFINE([Py_FFI_SUPPORT_C_COMPLEX], [1],
41244126
[Defined if _Complex C type can be used with libffi.])

0 commit comments

Comments
 (0)