Skip to content

gh-100540: Remove obsolete '--with-system-ffi' configure option #100544

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

Merged
merged 1 commit into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,6 @@ Libraries options
Build the :mod:`pyexpat` module using an installed ``expat`` library
(default is no).

.. cmdoption:: --with-system-ffi

Build the :mod:`_ctypes` extension module using an installed ``ffi``
library, see the :mod:`ctypes` module (default is system-dependent).

.. cmdoption:: --with-system-libmpdec

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 14 additions & 42 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3705,36 +3705,22 @@ AS_VAR_IF([with_system_expat], [yes], [
AC_SUBST([LIBEXPAT_CFLAGS])
AC_SUBST([LIBEXPAT_INTERNAL])

# Check for use of the system libffi library
AC_MSG_CHECKING(for --with-system-ffi)
AC_ARG_WITH(system_ffi,
AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library, see Doc/library/ctypes.rst (default is system-dependent)]),,,)

if test "$ac_sys_system" = "Darwin"
then
case "$with_system_ffi" in
"")
with_system_ffi="no"
;;
yes|no)
;;
*)
AC_MSG_ERROR([--with-system-ffi accepts no arguments])
;;
esac
AC_MSG_RESULT($with_system_ffi)
else
AC_MSG_RESULT(yes)
if test "$with_system_ffi" != ""
then
AC_MSG_WARN([--with(out)-system-ffi is ignored on this platform])
fi
with_system_ffi="yes"
fi

dnl detect libffi
have_libffi=missing
AS_VAR_IF([with_system_ffi], [yes], [
AS_VAR_IF([ac_sys_system], [Darwin], [
WITH_SAVE_ENV([
CFLAGS="-I${SDKROOT}/usr/include/ffi $CFLAGS"
AC_CHECK_HEADER([ffi.h], [
AC_CHECK_LIB([ffi], [ffi_call], [
dnl use ffi from SDK root
have_libffi=yes
LIBFFI_CFLAGS="-I${SDKROOT}/usr/include/ffi -DUSING_APPLE_OS_LIBFFI=1"
LIBFFI_LIBS="-lffi"
])
])
])
])
AS_VAR_IF([have_libffi], [missing], [
PKG_CHECK_MODULES([LIBFFI], [libffi], [have_libffi=yes], [
WITH_SAVE_ENV([
CPPFLAGS="$CPPFLAGS $LIBFFI_CFLAGS"
Expand All @@ -3748,20 +3734,6 @@ AS_VAR_IF([with_system_ffi], [yes], [
])
])
])
], [
AS_VAR_IF([ac_sys_system], [Darwin], [
WITH_SAVE_ENV([
CFLAGS="-I${SDKROOT}/usr/include/ffi $CFLAGS"
AC_CHECK_HEADER([ffi.h], [
AC_CHECK_LIB([ffi], [ffi_call], [
dnl use ffi from SDK root
have_libffi=yes
LIBFFI_CFLAGS="-I${SDKROOT}/usr/include/ffi -DUSING_APPLE_OS_LIBFFI=1"
LIBFFI_LIBS="-lffi"
], [have_libffi=no])
])
])
])
])

AS_VAR_IF([have_libffi], [yes], [
Expand Down