fcntl
[m6w6/ext-psi] / m4 / psi.m4
index 3853fa668374eb426bfe4879dcbdefcf71171c73..1f6af02f1930e960ba3661730d29d5a6023a3ebe 100644 (file)
--- a/m4/psi.m4
+++ b/m4/psi.m4
@@ -14,6 +14,7 @@ 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_TYPES <<EOF
+/* generated by configure */
 static struct psi_predef_type {
        token_t type_tag;
        const char *type_name;
@@ -21,6 +22,7 @@ static struct psi_predef_type {
 } psi_predef_types@<:@@:>@ = {
 EOF
        cat >$PSI_STRUCTS <<EOF
+/* generated by configure */
 static struct psi_predef_struct {
        token_t type_tag;
        const char *type_name;
@@ -32,6 +34,7 @@ static struct psi_predef_struct {
 } psi_predef_structs@<:@@:>@ = {
 EOF
        cat >$PSI_CONSTS <<EOF
+/* generated by configure */
 static struct psi_predef_const {
        token_t type_tag;
        const char *type_name;
@@ -41,6 +44,7 @@ static struct psi_predef_const {
 } psi_predef_consts@<:@@:>@ = {
 EOF
        cat >$PSI_REDIRS <<EOF
+/* generated by configure */
 static struct psi_func_redir {
        const char *name;
        void (*func)(void);
@@ -48,6 +52,7 @@ static struct psi_func_redir {
 EOF
        cat >$PSI_MACROS </dev/null
        cat >$PSI_DECLS <<EOF
+/* generated by configure */
 static struct psi_predef_decl {
        token_t type_tag;
        const char *type_name;
@@ -57,6 +62,7 @@ static struct psi_predef_decl {
 } psi_predef_decls@<:@@:>@ = {
 EOF
        cat >$PSI_VA_DECLS <<EOF
+/* generated by configure */
 static struct psi_predef_decl psi_predef_vararg_decls@<:@@:>@ = {
 EOF
 ])
@@ -65,6 +71,7 @@ dnl PSI_CONFIG_DONE()
 dnl Finish the headers with the pre-defined types etc.
 AC_DEFUN(PSI_CONFIG_DONE, [
        cat >$PSI_STDINC <<EOF
+/* generated by configure */
 PSI_INCLUDES
 EOF
        for i in $PSI_TYPES $PSI_STRUCTS $PSI_CONSTS $PSI_REDIRS $PSI_DECLS $PSI_VA_DECLS; do
@@ -100,6 +107,9 @@ AC_DEFUN(PSI_INCLUDES, [AC_INCLUDES_DEFAULT()
 #ifdef HAVE_ARPA_NAMESER_H
 # include <arpa/nameser.h>
 #endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
 #ifdef HAVE_NDBM_H
 # include <ndbm.h>
 #endif
@@ -154,7 +164,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 +174,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_<TYPE>
+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 +212,11 @@ AC_DEFUN(PSI_CHECK_OFFSETOF, [
        )
 ])
 
+dnl PSI_SH_OFFSETOF(type)
+dnl Expand to shell variable $ac_cv_offsetof_<TYPE>
+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 +257,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 +273,7 @@ AC_DEFUN(PSI_CHECK_LIBFFI, [
        else
                psi_cv_libffi=false
        fi])
-       
+
        if $psi_cv_libffi
        then
                AC_MSG_CHECKING(for libffi)