then :
printf %s "(cached) " >&6
else $as_nop
- ac_save_cc="$CC"
-CC="$CC -lffi"
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ CPPFLAGS="$LIBFFI_CFLAGS $CPPFLAGS"
+ LDFLAGS="$LIBFFI_LIBS $LDFLAGS"
+ LIBS="$LIBFFI_LIBS $LIBS"
if test "$cross_compiling" = yes
then :
ac_cv_ffi_complex_double_supported=no
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-CC="$ac_save_cc"
+
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ffi_complex_double_supported" >&5
printf "%s\n" "$ac_cv_ffi_complex_double_supported" >&6; }
# See https://github.com/python/cpython/issues/125206 for more details.
#
AC_CACHE_CHECK([libffi has complex type support], [ac_cv_ffi_complex_double_supported],
-[ac_save_cc="$CC"
-CC="$CC -lffi"
+[WITH_SAVE_ENV([
+ CPPFLAGS="$LIBFFI_CFLAGS $CPPFLAGS"
+ LDFLAGS="$LIBFFI_LIBS $LDFLAGS"
+ LIBS="$LIBFFI_LIBS $LIBS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <complex.h>
#include <ffi.h>
]])], [ac_cv_ffi_complex_double_supported=yes],
[ac_cv_ffi_complex_double_supported=no],
[ac_cv_ffi_complex_double_supported=no])
-CC="$ac_save_cc"])
+])])
if test "$ac_cv_ffi_complex_double_supported" = "yes"; then
AC_DEFINE([Py_FFI_SUPPORT_C_COMPLEX], [1],
[Defined if _Complex C type can be used with libffi.])