X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=m4%2Fpsi.m4;h=e8d8069c35b4f0642a187cf3e0a3d07f05220813;hp=3853fa668374eb426bfe4879dcbdefcf71171c73;hb=ed5ebb3caac1ac8bf6a4b32eabfb523f23de8576;hpb=77a446cbcdce6558c00066e5f13e43e8b1b18ff7 diff --git a/m4/psi.m4 b/m4/psi.m4 index 3853fa6..e8d8069 100644 --- a/m4/psi.m4 +++ b/m4/psi.m4 @@ -1,5 +1,6 @@ dnl Generated headers with pre-defined types, structs, consts and decls. PSI_STDINC=$PHP_PSI_SRCDIR/php_psi_stdinc.h +PSI_STDTYPES=$PHP_PSI_SRCDIR/php_psi_stdtypes.h PSI_TYPES=$PHP_PSI_SRCDIR/php_psi_types.h PSI_STRUCTS=$PHP_PSI_SRCDIR/php_psi_structs.h PSI_CONSTS=$PHP_PSI_SRCDIR/php_psi_consts.h @@ -13,7 +14,24 @@ dnl Creates stubs of the headers with pre-defined types etc. dnl These headers are included by src/context.c. dnl This macro must be called prior any checks for a type, struct, decl etc. AC_DEFUN(PSI_CONFIG_INIT, [ + cat >$PSI_STDTYPES <@ = { + {PSI_T_INT8, "int8_t", NULL}, + {PSI_T_INT16, "int16_t", NULL}, + {PSI_T_INT32, "int32_t", NULL}, + {PSI_T_INT64, "int64_t", NULL}, + {PSI_T_UINT8, "uint8_t", NULL}, + {PSI_T_UINT16, "uint16_t", NULL}, + {PSI_T_UINT32, "uint32_t", NULL}, + {PSI_T_UINT64, "uint64_t", NULL}, +EOF cat >$PSI_TYPES <@ = { EOF cat >$PSI_STRUCTS <@ = { EOF cat >$PSI_CONSTS <@ = { EOF cat >$PSI_REDIRS <$PSI_MACROS $PSI_DECLS <@ = { EOF cat >$PSI_VA_DECLS <@ = { EOF ]) @@ -65,9 +88,10 @@ dnl PSI_CONFIG_DONE() dnl Finish the headers with the pre-defined types etc. AC_DEFUN(PSI_CONFIG_DONE, [ cat >$PSI_STDINC <>$i </dev/null || return 0 ;; + esac + ifelse($2,,,AC_CHECK_HEADERS($2)) +]) + dnl PSI_INCLUDES() dnl Expands to a complete list of include statements including dnl AC_INCLUDES_DEFAULT(). @@ -100,6 +133,9 @@ AC_DEFUN(PSI_INCLUDES, [AC_INCLUDES_DEFAULT() #ifdef HAVE_ARPA_NAMESER_H # include #endif +#ifdef HAVE_FCNTL_H +# include +#endif #ifdef HAVE_NDBM_H # include #endif @@ -154,7 +190,7 @@ AC_DEFUN(PSI_LEMON, [ dnl PSI_PKG_CONFIG() dnl Check for `pkg-config` and add possible libjit and libffi directories to -dnl $PKG_CONFIG_PATH, because those libs often ship with headers etc. in +dnl $PKG_CONFIG_PATH, because those libs often ship with headers etc. in dnl arch-dependent locations. AC_DEFUN([PSI_PKG_CONFIG], [ if test -z "$PKG_CONFIG" @@ -164,6 +200,10 @@ AC_DEFUN([PSI_PKG_CONFIG], [ export PKG_CONFIG_PATH="$PHP_PSI_LIBFFI/lib/pkgconfig:$PHP_PSI_LIBJIT/lib/pkgconfig:$PKG_CONFIG_PATH" ]) +dnl PSI_SH_SIZEOF(type) +dnl expand to shell variable $ac_cv_sizeof_ +AC_DEFUN([PSI_SH_SIZEOF], [$AS_TR_SH([ac_cv_sizeof_]$1)]) + dnl PSI_SH_TEST_SIZEOF(type) dnl `if` condition to test if $ac_cv_sizeof_$1 is greater than 0. AC_DEFUN([PSI_SH_TEST_SIZEOF], [test -n "$AS_TR_SH([ac_cv_sizeof_]$1)" && test "$AS_TR_SH([ac_cv_sizeof_]$1)" -gt 0]) @@ -198,6 +238,11 @@ AC_DEFUN(PSI_CHECK_OFFSETOF, [ ) ]) +dnl PSI_SH_OFFSETOF(type) +dnl Expand to shell variable $ac_cv_offsetof_ +AC_DEFUN([PSI_SH_OFFSETOF], [$AS_TR_SH([ac_cv_offsetof_]$1)]) + + dnl PSI_COMPUTE_STR(variable, string or expression) dnl Compute a string constant value in a similar manner like AC_COMPUTE_INT. AC_DEFUN(PSI_COMPUTE_STR, [ @@ -238,11 +283,11 @@ AC_DEFUN(PSI_CHECK_LIBJIT, [ dnl PSI_CHECK_LIBFFI() dnl Check for libffi with `pkg-config`. If that fails, `configure` looks into dnl $PHP_PSI_LIBFFI or standard locations to find libjit deps. -dnl Checks for availability of recent closure API: +dnl Checks for availability of recent closure API: dnl \ffi_closure_alloc and \ffi_prep_closure. dnl Checks for availability of recent vararg API: dnl \ffi_prep_cif_var. -dnl AC_DEFINEs HAVE_LIBFFI, PSI_HAVE_FFI_CLOSURE_ALLOC, +dnl AC_DEFINEs HAVE_LIBFFI, PSI_HAVE_FFI_CLOSURE_ALLOC, dnl PSI_HAVE_FFI_PREP_CLOSURE and PSI_HAVE_FFO_PREP_VIF_VAR. AC_DEFUN(PSI_CHECK_LIBFFI, [ AC_REQUIRE([PSI_PKG_CONFIG])dnl @@ -254,7 +299,7 @@ AC_DEFUN(PSI_CHECK_LIBFFI, [ else psi_cv_libffi=false fi]) - + if $psi_cv_libffi then AC_MSG_CHECKING(for libffi)