Files
php-src/ext/ffi/config.m4
Peter Kokot 1ceadaed52 Autotools: Normalize and quote all PHP_NEW_EXTENSION arguments (#15144)
This adds Autoconf quote characters to all PHP_NEW_EXTENSION arguments
and syncs the CS across the php-src Autotools build system.
2024-07-29 00:14:59 +02:00

36 lines
963 B
Plaintext

PHP_ARG_WITH([ffi],
[for FFI support],
[AS_HELP_STRING([--with-ffi],
[Include FFI support])])
if test "$PHP_FFI" != "no"; then
PKG_CHECK_MODULES([FFI], [libffi >= 3.0.11])
PHP_EVAL_INCLINE([$FFI_CFLAGS])
PHP_EVAL_LIBLINE([$FFI_LIBS], [FFI_SHARED_LIBADD])
AC_DEFINE(HAVE_FFI, 1, [Have ffi support])
AC_CHECK_TYPES([long double])
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.])],,
[#include <ffi.h>])])
PHP_FFI_CHECK_DECL([FFI_FASTCALL])
PHP_FFI_CHECK_DECL([FFI_THISCALL])
PHP_FFI_CHECK_DECL([FFI_STDCALL])
PHP_FFI_CHECK_DECL([FFI_PASCAL])
PHP_FFI_CHECK_DECL([FFI_REGISTER])
PHP_FFI_CHECK_DECL([FFI_MS_CDECL])
PHP_FFI_CHECK_DECL([FFI_SYSV])
PHP_NEW_EXTENSION([ffi],
[ffi.c ffi_parser.c],
[$ext_shared],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
PHP_SUBST([FFI_SHARED_LIBADD])
fi