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
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 <<EOF
+/* generated by configure */
+static struct psi_std_type {
+ token_t type_tag;
+ const char *type_name;
+ const char *alias;
+} psi_std_types@<:@@:>@ = {
+ {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
/* generated by configure */
static struct psi_predef_type {
/* generated by configure */
PSI_INCLUDES
EOF
- for i in $PSI_TYPES $PSI_STRUCTS $PSI_CONSTS $PSI_REDIRS $PSI_DECLS $PSI_VA_DECLS; do
+ for i in $PSI_STDTYPES $PSI_TYPES $PSI_STRUCTS $PSI_CONSTS $PSI_REDIRS $PSI_DECLS $PSI_VA_DECLS; do
cat >>$i <<EOF
{0}
};
done
])
+dnl PSI_CONFIG_POSIX(section, headers)
+AC_DEFUN(PSI_CONFIG_POSIX, [
+ case "$PHP_PSI_POSIX" in
+ yes|all) ;;
+ *) expr "$PHP_PSI_POSIX" : '\b$1\b' >/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().