1ARG_WITH('ffi', 'ffi support', 'no'); 2 3if (PHP_FFI != 'no') { 4 if (CHECK_HEADER_ADD_INCLUDE("ffi.h", "CFLAGS_FFI", PHP_FFI+ ";" + PHP_PHP_BUILD + "\\include") && 5 CHECK_LIB("libffi.lib", "ffi", PHP_FFI)) { 6 AC_DEFINE('HAVE_FFI', 1, "Define to 1 if the PHP extension 'ffi' is available."); 7 8 if (!X64) { 9 AC_DEFINE('HAVE_FFI_FASTCALL', 1, 'Define to 1 if libffi supports the fastcall calling convention.'); 10 AC_DEFINE('HAVE_FFI_THISCALL', 1, 'Define to 1 if libffi supports the thiscall calling convention.'); 11 AC_DEFINE('HAVE_FFI_STDCALL', 1, 'Define to 1 if libffi supports the stdcall calling convention.'); 12 AC_DEFINE('HAVE_FFI_MS_CDECL', 1, 'Define to 1 if libffi supports the ms_cdecl calling convention.'); 13 AC_DEFINE('HAVE_FFI_SYSV', 1, 'Define to 1 if libffi supports the sysv calling convention.'); 14 } 15 // Available in https://github.com/winlibs/libffi. 16 if (GREP_HEADER("ffitarget.h", "FFI_VECTORCALL_PARTIAL", PHP_PHP_BUILD + "\\include")) { 17 AC_DEFINE('HAVE_FFI_VECTORCALL_PARTIAL', 1, 'Define to 1 if libffi partially supports the vectorcall calling convention.'); 18 } 19 20 EXTENSION('ffi', 'ffi.c ffi_parser.c', null, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); 21 } else { 22 WARNING('ffi not enabled, headers or libraries not found'); 23 } 24} 25