- PSI_TYPES=""
- dnl PSI_TYPE(type name, basic type, includes)
- AC_DEFUN(PSI_TYPE, [
- ifdef(AC_TYPE_[]patsubst(translit($1,a-z,A-Z),\W,_),AC_TYPE_[]patsubst(translit($1,a-z,A-Z),\W,_))
- AC_CHECK_SIZEOF($1, [], PSI_INCLUDES_DEFAULT($3))
- if test "$2" && test "$ac_cv_sizeof_[]$1" -gt 0; then
- PSI_TYPES="{`psi_type_pair $2 $ac_cv_sizeof_[]$1`, \""$1"\"}, $PSI_TYPES"
- fi
- ])
-
-
- PSI_CONSTS=""
- dnl PSI_COMPUTE_STR(variable, string or expression, includes)
- AC_DEFUN(PSI_COMPUTE_STR, [
- AC_TRY_RUN([
- $3
- int main() {
- return EOF == fputs($2, fopen("conftest.out", "w"));
- }
- ], [
- eval $1=\\\"`cat conftest.out`\\\"
- ])
- ])
-
- dnl PSI_CONST(const name, type, headers to include)
- AC_DEFUN(PSI_CONST, [
- AC_CACHE_CHECK(value of $1, psi_cv_const_$1, [
- case $2 in
- str*|quoted_str*)
- if test "$cross_compiling" = "yes"
- then
- AC_TRY_CPP(PSI_INCLUDES_DEFAULT($3)$1, psi_const_val=`eval "$ac_try|tail -n1"`, psi_const_val=)
- else
- PSI_COMPUTE_STR(psi_const_val, $1, PSI_INCLUDES_DEFAULT($3))
- fi
- ;;
- *)
- AC_COMPUTE_INT(psi_const_val, $1, PSI_INCLUDES_DEFAULT($3))
- ;;
- esac
- psi_cv_const_$1=$psi_const_val
- ])
- if test "$psi_cv_const_$1"
- then
- case $2 in
- str*|quoted_str*)
- PSI_CONSTS="{PSI_T_STRING, \"string\", \"$1\", $psi_cv_const_$1, PSI_T_QUOTED_STRING}, $PSI_CONSTS"
- ;;
- *)
- PSI_CONSTS="{PSI_T_INT, \"int\", \"$1\", \"$psi_cv_const_$1\", PSI_T_NUMBER}, $PSI_CONSTS"
- ;;
- esac
- fi
- ])
-
- AC_DEFUN([AX_CHECK_SIGN], [
- typename=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g"`
- AC_CACHE_CHECK([whether $1 is signed], ax_cv_decl_${typename}_signed, [
- AC_TRY_COMPILE([$4],
- [ int foo @<:@ 1 - 2 * !((($1) -1) < 0) @:>@ ],
- [ eval "ax_cv_decl_${typename}_signed=\"yes\"" ],
- [ eval "ax_cv_decl_${typename}_signed=\"no\"" ])])
- symbolname=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g" | tr "a-z" "A-Z"`
- if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then
- $2
- elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then
- $3
- fi
- ])
- dnl PSI_CHECK_OFFSETOF(struct, member, include)
- dnl[AS_LITERAL_IF([$1], [], [m4_fatal([$0: requires literal arguments])])]dnl
- dnl[AS_LITERAL_IF([$2], [], [m4_fatal([$0: requires literal arguments])])]dnl
- AC_DEFUN(PSI_CHECK_OFFSETOF, [
- _AC_CACHE_CHECK_INT(
- [offset of $2 in $1],
- [AS_TR_SH([ac_cv_offsetof_$1_$2])],
- [(long int) (offsetof ($1, $2))],
- [AC_INCLUDES_DEFAULT([$3])],
- [AC_MSG_FAILURE([cannot compute offsetof ($1, $2)])]
- )
- AC_DEFINE_UNQUOTED(
- AS_TR_CPP(offsetof_$1_$2),
- $AS_TR_SH([ac_cv_offsetof_$1_$2]),
- [The offset of `$1' in `$2', as computed by offsetof.]
- )
+ PHP_ARG_ENABLE(psi-maintainer-mode, whether to enable maintainer mode,
+ [ --enable-psi-maintainer-mode
+ PSI: enable maintainer mode
+ . parallel configure
+ . make dependencies
+ . extra debug wrappers], [no], [no])
+
+ PHP_ARG_WITH(psi-libjit, where to find libjit,
+ [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ])
+
+ PHP_ARG_WITH(psi-libffi, where to find libffi,
+ [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ])
+
+ AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG
+
+ dnl we cannot use AC_USE_SYSTEM_EXTENSIONS here, because we're way too late
+ dnl in the game, and we're currently only targeting _GNU_SOURCE for now
+ AC_MSG_CHECKING([for _GNU_SOURCE])
+ AC_EGREP_CPP([gnu_source_not_defined], [
+ #ifndef _GNU_SOURCE
+ gnu_source_not_defined
+ #endif
+ ], [
+ AC_MSG_RESULT([needs define])
+ AC_DEFINE([_GNU_SOURCE], [1], [ ])
+ ], [
+ AC_MSG_RESULT([already defined])