+ AC_SUBST([PSI_CPP_SEARCH])
+ AC_SUBST([PSI_CPP_PREDEF])
+
+ PHP_ADD_INCLUDE($PHP_PSI_SRCDIR)
+ PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src)
+ PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/calc)
+ PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/types)
+ PHP_ADD_INCLUDE($PHP_PSI_BUILDDIR)
+ PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)
+ PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src/types)
+
+ PHP_PSI_HEADERS=" \
+ calc/basic.h calc/bin.h calc/bool.h calc/cast.h \
+ calc/unary.h calc/cmp.h calc/oper.h \
+ `(cd $PHP_PSI_SRCDIR/src && ls *.h types/*.h)` \
+ "
+ # parser_* should come first
+ PHP_PSI_SOURCES=" \
+ src/parser_proc.c src/parser_scan.c \
+ `(cd $PHP_PSI_SRCDIR && ls src/*.c src/types/*.c \
+ | $EGREP -v '^src/parser_' \
+ )` \
+ "
+ PHP_PSI_GENERATED=" \
+ src/parser_proc.c src/parser_scan.c \
+ src/calc/basic.h src/calc/bin.h src/calc/bool.h src/calc/cast.h \
+ src/calc/unary.h src/calc/cmp.h src/calc/oper.h \
+ "
+
+ PHP_SUBST(PHP_PSI_GENERATED)
+ PHP_SUBST(PHP_PSI_HEADERS)
+ PHP_SUBST(PHP_PSI_SOURCES)
+
+ PHP_SUBST(PHP_PSI_SRCDIR)
+ PHP_SUBST(PHP_PSI_BUILDDIR)
+])
+
+dnl PSI_CHECK_GNU_SOURCE
+dnl Check whether _GNU_SOURCE is already defined.
+AC_DEFUN([PSI_CHECK_GNU_SOURCE], [
+ 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])
+ ])