From d6acdc1b60de4f6fd05c6654a9661b7edddf0448 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 1 Jul 2022 09:23:41 +0200 Subject: [PATCH] gh-90005-ffi: Fix building _ctypes without pkg-config (GH-94451) The fallback path did not set LIBFFI_LIBS variable to link with ``-lffi``. --- .../2022-06-30-17-00-54.gh-issue-90005.iiq5qD.rst | 1 + configure | 10 ++++++++-- configure.ac | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2022-06-30-17-00-54.gh-issue-90005.iiq5qD.rst diff --git a/Misc/NEWS.d/next/Build/2022-06-30-17-00-54.gh-issue-90005.iiq5qD.rst b/Misc/NEWS.d/next/Build/2022-06-30-17-00-54.gh-issue-90005.iiq5qD.rst new file mode 100644 index 00000000000..62f40b8f95f --- /dev/null +++ b/Misc/NEWS.d/next/Build/2022-06-30-17-00-54.gh-issue-90005.iiq5qD.rst @@ -0,0 +1 @@ +Fix building ``_ctypes`` extension without ``pkg-config``. diff --git a/configure b/configure index 014d2cefb47..9144ee19036 100755 --- a/configure +++ b/configure @@ -12133,7 +12133,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_call" >&5 $as_echo "$ac_cv_lib_ffi_ffi_call" >&6; } if test "x$ac_cv_lib_ffi_ffi_call" = xyes; then : - have_libffi=yes + + have_libffi=yes + LIBFFI_LIBS="-lffi" + else have_libffi=no fi @@ -12200,7 +12203,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_call" >&5 $as_echo "$ac_cv_lib_ffi_ffi_call" >&6; } if test "x$ac_cv_lib_ffi_ffi_call" = xyes; then : - have_libffi=yes + + have_libffi=yes + LIBFFI_LIBS="-lffi" + else have_libffi=no fi diff --git a/configure.ac b/configure.ac index ab1c6873f73..12ae2ae8d87 100644 --- a/configure.ac +++ b/configure.ac @@ -3605,7 +3605,10 @@ AS_VAR_IF([with_system_ffi], [yes], [ PKG_CHECK_MODULES([LIBFFI], [libffi], [have_libffi=yes], [ AC_CHECK_HEADER([ffi.h], [ WITH_SAVE_ENV([ - AC_CHECK_LIB([ffi], [ffi_call], [have_libffi=yes], [have_libffi=no]) + AC_CHECK_LIB([ffi], [ffi_call], [ + have_libffi=yes + LIBFFI_LIBS="-lffi" + ], [have_libffi=no]) ]) ]) ])