Skip to content

Commit eed66e6

Browse files
authored
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.
1 parent 3c36c73 commit eed66e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/ffi/config.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ if test "$PHP_FFI" != "no"; then
1616
AC_DEFUN([PHP_FFI_CHECK_DECL],
1717
[AC_CHECK_DECL([$1],
1818
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1],
19-
[Whether libffi supports the '$1' calling convention.])],,
19+
[Define to 1 if libffi supports the '$1' calling convention.])],,
2020
[#include <ffi.h>])])
2121

22+
CFLAGS_SAVE=$CFLAGS
23+
CFLAGS="$CFLAGS $FFI_CFLAGS"
2224
PHP_FFI_CHECK_DECL([FFI_FASTCALL])
2325
PHP_FFI_CHECK_DECL([FFI_THISCALL])
2426
PHP_FFI_CHECK_DECL([FFI_STDCALL])
2527
PHP_FFI_CHECK_DECL([FFI_PASCAL])
2628
PHP_FFI_CHECK_DECL([FFI_REGISTER])
2729
PHP_FFI_CHECK_DECL([FFI_MS_CDECL])
2830
PHP_FFI_CHECK_DECL([FFI_SYSV])
31+
CFLAGS=$CFLAGS_SAVE
2932

3033
PHP_NEW_EXTENSION([ffi],
3134
[ffi.c ffi_parser.c],

0 commit comments

Comments
 (0)