1 PHP_PSI_SRCDIR=PHP_EXT_SRCDIR(psi)
3 case "PHP_EXT_BUILDDIR(psi)" in
4 ""|.) PHP_PSI_BUILDDIR=$PHP_PSI_SRCDIR
6 *) PHP_PSI_BUILDDIR=PHP_EXT_BUILDDIR(psi)
11 [ax/ax_check_sign.m4],
18 [psi/psi_composite.m4],
28 [posix/sys_select.m4],
29 [posix/sys_socket.m4],
35 [posix/sys_utsname.m4],
38 [posix/netinet_in.m4],
39 [posix/netinet_tcp.m4],
48 sinclude([m4/]incfile)
50 sinclude([ext/psi/m4/]incfile)
53 PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support,
54 [ --enable-psi Enable PSI (PHP System Interface) support])
56 if test "$PHP_PSI" != no; then
57 PHP_ARG_ENABLE(psi-posix, whether to pre-define POSIX decls,
58 [ --enable-psi-posix=... PSI: pre-define POSIX decls], [all], [no])
60 PHP_ARG_ENABLE(psi-maintainer-mode, whether to enable maintainer mode,
61 [ --enable-psi-maintainer-mode
62 PSI: enable maintainer mode
65 . extra debug wrappers], [no], [no])
67 PHP_ARG_WITH(psi-libjit, where to find libjit,
68 [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ])
70 PHP_ARG_WITH(psi-libffi, where to find libffi,
71 [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ])
73 AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG
75 dnl we cannot use AC_USE_SYSTEM_EXTENSIONS here, because we're way too late
76 dnl in the game, and we're currently only targeting _GNU_SOURCE for now
77 AC_MSG_CHECKING([for _GNU_SOURCE])
78 AC_EGREP_CPP([gnu_source_not_defined], [
80 gnu_source_not_defined
83 AC_MSG_RESULT([needs define])
84 AC_DEFINE([_GNU_SOURCE], [1], [ ])
86 AC_MSG_RESULT([already defined])
89 AC_MSG_CHECKING([psi source dir])
90 AC_MSG_RESULT([$PHP_PSI_SRCDIR])
91 AC_MSG_CHECKING([psi build dir])
92 AC_MSG_RESULT([$PHP_PSI_BUILDDIR])
102 dnl basics, one-by-one
109 AC_MSG_CHECKING([for POSIX modules])
110 if ! $PSI_FAST_CONFIG; then
111 AC_MSG_RESULT([$PHP_PSI_POSIX])
114 PSI_CONFIG_POSIX(signal, signal.h, [
115 PSI_CONFIG_POSIX(time, time.h, [
116 PSI_CONFIG_POSIX(sys/stat, sys/stat.h)
117 PSI_CONFIG_POSIX(wchar, wchar.h, [
118 PSI_CONFIG_POSIX(wctype, wctype.h)
121 PSI_CONFIG_POSIX(sys/select, sys/select.h)
123 PSI_CONFIG_POSIX(poll, poll.h)
124 PSI_CONFIG_POSIX(syslog, syslog.h)
125 PSI_CONFIG_POSIX(errno, errno.h)
126 PSI_CONFIG_POSIX(fcntl, fcntl.h)
127 PSI_CONFIG_POSIX(glob, glob.h)
128 PSI_CONFIG_POSIX(locale, locale.h xlocale.h)
129 PSI_CONFIG_POSIX(stdio, stdio.h)
130 PSI_CONFIG_POSIX(stdlib, stdlib.h)
131 PSI_CONFIG_POSIX(unistd, unistd.h)
132 PSI_CONFIG_POSIX(sys/socket, sys/socket.h, [
133 PSI_CONFIG_POSIX(netinet/in, netinet/in.h, [
134 PSI_CONFIG_POSIX(arpa/inet, arpa/inet.h)
136 PSI_CONFIG_POSIX(netdb, netdb.h)
138 PSI_CONFIG_POSIX(netinet/tcp, netinet/tcp.h)
139 PSI_CONFIG_POSIX(sys/time, sys/time.h)
140 PSI_CONFIG_POSIX(sys/times, sys/times.h)
141 PSI_CONFIG_POSIX(sys/uio, sys/uio.h)
142 PSI_CONFIG_POSIX(sys/utsname, sys/utsname.h)
143 PSI_CONFIG_POSIX(ndbm, dnl
151 PHP_SUBST(PSI_SHARED_LIBADD)
153 AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix)
155 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR)
156 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src)
157 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/calc)
158 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/types)
159 PHP_ADD_INCLUDE($PHP_PSI_BUILDDIR)
160 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)
161 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src/types)
164 src/calc/basic.h src/calc/bin.h src/calc/bool.h src/calc/cast.h \
165 src/calc/cmp.h src/calc/oper.h \
166 `(cd $PHP_PSI_SRCDIR/src && ls *.h types/*.h)` \
168 # parser* should come first
170 src/parser_proc.c src/parser.c \
171 `(cd $PHP_PSI_SRCDIR && ls src/*.c src/types/*.c \
172 | $EGREP -v '^src/parser' \
175 PHP_PSI_GENERATED=" \
176 src/parser_proc.c src/parser.c \
177 src/calc/basic.h src/calc/bin.h src/calc/bool.h src/calc/cast.h \
178 src/calc/cmp.h src/calc/oper.h \
181 PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
182 PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
184 PHP_SUBST(PHP_PSI_GENERATED)
185 PHP_SUBST(PHP_PSI_HEADERS)
186 PHP_SUBST(PHP_PSI_SOURCES)
188 PHP_SUBST(PHP_PSI_SRCDIR)
189 PHP_SUBST(PHP_PSI_BUILDDIR)
191 PHP_ADD_MAKEFILE_FRAGMENT