1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Files
archived-php-src/ext/ffi/config.w32
T
Peter Kokot b5e2f3a4b6 Check FFI_* ABI with Autoconf AC_CHECK_DECL (#13552)
The FFI_* calling conventions are enum constants and AC_CHECK_DECL(S)
can be used to check for their existence in the ffi.h header. This
simplifes the checks and adds a simple AC_CHECK_DECL macro wrapper which
defines the HAVE_FFI_* belonging symbols.
2024-03-01 19:31:55 +01:00

25 lines
1.1 KiB
Plaintext

ARG_WITH('ffi', 'ffi support', 'no');
if (PHP_FFI != 'no') {
if (CHECK_HEADER_ADD_INCLUDE("ffi.h", "CFLAGS_FFI", PHP_FFI+ ";" + PHP_PHP_BUILD + "\\include") &&
CHECK_LIB("libffi.lib", "ffi", PHP_FFI)) {
AC_DEFINE('HAVE_FFI', 1, 'ffi support enabled');
if (!X64) {
AC_DEFINE('HAVE_FFI_FASTCALL', 1 ,'libffi supports fastcall calling convention');
AC_DEFINE('HAVE_FFI_THISCALL', 1 ,'libffi supports thiscall calling convention');
AC_DEFINE('HAVE_FFI_STDCALL', 1 ,'libffi supports stdcall calling convention');
AC_DEFINE('HAVE_FFI_MS_CDECL', 1 ,'libffi supports ms_cdecl calling convention');
AC_DEFINE('HAVE_FFI_SYSV', 1 ,'libffi supports sysv calling convention');
}
// Available in https://github.com/winlibs/libffi.
if (GREP_HEADER("ffitarget.h", "FFI_VECTORCALL_PARTIAL", PHP_PHP_BUILD + "\\include")) {
AC_DEFINE('HAVE_FFI_VECTORCALL_PARTIAL', 1 ,'libffi partially supports vectorcall calling convention');
}
EXTENSION('ffi', 'ffi.c ffi_parser.c', null, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
} else {
WARNING('ffi not enabled, headers or libraries not found');
}
}