Autotools: Fix ffi checks (#15197)

When libffi is installed on non-default places, also the calling
convention checks need adjusted compilation flags to be able to find the
ffi.h header file.
This commit is contained in:
Peter Kokot 2024-08-02 00:32:36 +02:00 committed by GitHub
parent 3c36c7308d
commit eed66e6183
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,9 +16,11 @@ if test "$PHP_FFI" != "no"; then
AC_DEFUN([PHP_FFI_CHECK_DECL],
[AC_CHECK_DECL([$1],
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1],
[Whether libffi supports the '$1' calling convention.])],,
[Define to 1 if libffi supports the '$1' calling convention.])],,
[#include <ffi.h>])])
CFLAGS_SAVE=$CFLAGS
CFLAGS="$CFLAGS $FFI_CFLAGS"
PHP_FFI_CHECK_DECL([FFI_FASTCALL])
PHP_FFI_CHECK_DECL([FFI_THISCALL])
PHP_FFI_CHECK_DECL([FFI_STDCALL])
@ -26,6 +28,7 @@ if test "$PHP_FFI" != "no"; then
PHP_FFI_CHECK_DECL([FFI_REGISTER])
PHP_FFI_CHECK_DECL([FFI_MS_CDECL])
PHP_FFI_CHECK_DECL([FFI_SYSV])
CFLAGS=$CFLAGS_SAVE
PHP_NEW_EXTENSION([ffi],
[ffi.c ffi_parser.c],