Skip to content

Commit 25590eb

Browse files
authored
gh-100540: Remove obsolete '--with-system-ffi' configure option (GH-100544)
It has had no effect on non-macOS platforms for a long time, and has had the non-obvious effect of invoking `pkg_config` and not setting `-DUSING_APPLE_OS_LIBFFI` on macOS since GH-22855.
1 parent fd4b55f commit 25590eb

File tree

4 files changed

+87
-156
lines changed

4 files changed

+87
-156
lines changed

Doc/using/configure.rst

-5
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,6 @@ Libraries options
471471
Build the :mod:`pyexpat` module using an installed ``expat`` library
472472
(default is no).
473473

474-
.. cmdoption:: --with-system-ffi
475-
476-
Build the :mod:`_ctypes` extension module using an installed ``ffi``
477-
library, see the :mod:`ctypes` module (default is system-dependent).
478-
479474
.. cmdoption:: --with-system-libmpdec
480475

481476
Build the ``_decimal`` extension module using an installed ``mpdec``
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Removed the ``--with-system-ffi`` ``configure`` option; ``libffi`` must
2+
now always be supplied by the system on all non-Windows platforms. The
3+
option has had no effect on non-Darwin platforms for several releases, and
4+
in 3.11 only had the non-obvious effect of invoking ``pkg-config`` to
5+
find ``libffi`` and never setting ``-DUSING_APPLE_OS_LIBFFI``. Now on
6+
Darwin platforms ``configure`` will first check for the OS ``libffi`` and
7+
then fall back to the same processing as other platforms if it is not
8+
found.

configure

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

configure.ac

+14-42
Original file line numberDiff line numberDiff line change
@@ -3705,36 +3705,22 @@ AS_VAR_IF([with_system_expat], [yes], [
37053705
AC_SUBST([LIBEXPAT_CFLAGS])
37063706
AC_SUBST([LIBEXPAT_INTERNAL])
37073707

3708-
# Check for use of the system libffi library
3709-
AC_MSG_CHECKING(for --with-system-ffi)
3710-
AC_ARG_WITH(system_ffi,
3711-
AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library, see Doc/library/ctypes.rst (default is system-dependent)]),,,)
3712-
3713-
if test "$ac_sys_system" = "Darwin"
3714-
then
3715-
case "$with_system_ffi" in
3716-
"")
3717-
with_system_ffi="no"
3718-
;;
3719-
yes|no)
3720-
;;
3721-
*)
3722-
AC_MSG_ERROR([--with-system-ffi accepts no arguments])
3723-
;;
3724-
esac
3725-
AC_MSG_RESULT($with_system_ffi)
3726-
else
3727-
AC_MSG_RESULT(yes)
3728-
if test "$with_system_ffi" != ""
3729-
then
3730-
AC_MSG_WARN([--with(out)-system-ffi is ignored on this platform])
3731-
fi
3732-
with_system_ffi="yes"
3733-
fi
3734-
37353708
dnl detect libffi
37363709
have_libffi=missing
3737-
AS_VAR_IF([with_system_ffi], [yes], [
3710+
AS_VAR_IF([ac_sys_system], [Darwin], [
3711+
WITH_SAVE_ENV([
3712+
CFLAGS="-I${SDKROOT}/usr/include/ffi $CFLAGS"
3713+
AC_CHECK_HEADER([ffi.h], [
3714+
AC_CHECK_LIB([ffi], [ffi_call], [
3715+
dnl use ffi from SDK root
3716+
have_libffi=yes
3717+
LIBFFI_CFLAGS="-I${SDKROOT}/usr/include/ffi -DUSING_APPLE_OS_LIBFFI=1"
3718+
LIBFFI_LIBS="-lffi"
3719+
])
3720+
])
3721+
])
3722+
])
3723+
AS_VAR_IF([have_libffi], [missing], [
37383724
PKG_CHECK_MODULES([LIBFFI], [libffi], [have_libffi=yes], [
37393725
WITH_SAVE_ENV([
37403726
CPPFLAGS="$CPPFLAGS $LIBFFI_CFLAGS"
@@ -3748,20 +3734,6 @@ AS_VAR_IF([with_system_ffi], [yes], [
37483734
])
37493735
])
37503736
])
3751-
], [
3752-
AS_VAR_IF([ac_sys_system], [Darwin], [
3753-
WITH_SAVE_ENV([
3754-
CFLAGS="-I${SDKROOT}/usr/include/ffi $CFLAGS"
3755-
AC_CHECK_HEADER([ffi.h], [
3756-
AC_CHECK_LIB([ffi], [ffi_call], [
3757-
dnl use ffi from SDK root
3758-
have_libffi=yes
3759-
LIBFFI_CFLAGS="-I${SDKROOT}/usr/include/ffi -DUSING_APPLE_OS_LIBFFI=1"
3760-
LIBFFI_LIBS="-lffi"
3761-
], [have_libffi=no])
3762-
])
3763-
])
3764-
])
37653737
])
37663738

37673739
AS_VAR_IF([have_libffi], [yes], [

0 commit comments

Comments
 (0)