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],
29 [posix/sys_select.m4],
30 [posix/sys_socket.m4],
36 [posix/sys_utsname.m4],
39 [posix/netinet_in.m4],
40 [posix/netinet_tcp.m4],
49 sinclude([m4/]incfile)
51 sinclude([ext/psi/m4/]incfile)
54 PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support,
55 [ --enable-psi Enable PSI (PHP System Interface) support])
57 if test "$PHP_PSI" != no; then
58 PHP_ARG_ENABLE(psi-posix, whether to pre-define POSIX decls,
59 [ --enable-psi-posix=... PSI: pre-define POSIX decls], [all], [no])
61 PHP_ARG_ENABLE(psi-maintainer-mode, whether to enable maintainer mode,
62 [ --enable-psi-maintainer-mode
63 PSI: enable maintainer mode
66 . extra debug wrappers], [no], [no])
68 PHP_ARG_WITH(psi-libjit, where to find libjit,
69 [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ])
71 PHP_ARG_WITH(psi-libffi, where to find libffi,
72 [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ])
74 AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG
76 dnl we cannot use AC_USE_SYSTEM_EXTENSIONS here, because we're way too late
77 dnl in the game, and we're currently only targeting _GNU_SOURCE for now
78 AC_MSG_CHECKING([for _GNU_SOURCE])
79 AC_EGREP_CPP([gnu_source_not_defined], [
81 gnu_source_not_defined
84 AC_MSG_RESULT([needs define])
85 AC_DEFINE([_GNU_SOURCE], [1], [ ])
87 AC_MSG_RESULT([already defined])
90 AC_MSG_CHECKING([psi source dir])
91 AC_MSG_RESULT([$PHP_PSI_SRCDIR])
92 AC_MSG_CHECKING([psi build dir])
93 AC_MSG_RESULT([$PHP_PSI_BUILDDIR])
103 dnl basics, one-by-one
110 AC_MSG_CHECKING([for POSIX modules])
111 if ! $PSI_FAST_CONFIG; then
112 AC_MSG_RESULT([$PHP_PSI_POSIX])
115 PSI_CONFIG_POSIX(signal, signal.h, [
116 PSI_CONFIG_POSIX(time, time.h, [
117 PSI_CONFIG_POSIX(sys/stat, sys/stat.h)
118 PSI_CONFIG_POSIX(wchar, wchar.h, [
119 PSI_CONFIG_POSIX(wctype, wctype.h)
122 PSI_CONFIG_POSIX(sys/select, sys/select.h)
124 PSI_CONFIG_POSIX(poll, poll.h)
125 PSI_CONFIG_POSIX(syslog, syslog.h)
126 PSI_CONFIG_POSIX(errno, errno.h)
127 PSI_CONFIG_POSIX(fcntl, fcntl.h)
128 PSI_CONFIG_POSIX(glob, glob.h)
129 PSI_CONFIG_POSIX(locale, locale.h xlocale.h)
130 PSI_CONFIG_POSIX(stdio, stdio.h)
131 PSI_CONFIG_POSIX(stdlib, stdlib.h)
132 PSI_CONFIG_POSIX(unistd, unistd.h)
133 PSI_CONFIG_POSIX(stdarg, stdarg.h)
134 PSI_CONFIG_POSIX(sys/socket, sys/socket.h, [
135 PSI_CONFIG_POSIX(netinet/in, netinet/in.h, [
136 PSI_CONFIG_POSIX(arpa/inet, arpa/inet.h)
138 PSI_CONFIG_POSIX(netdb, netdb.h)
140 PSI_CONFIG_POSIX(netinet/tcp, netinet/tcp.h)
141 PSI_CONFIG_POSIX(sys/time, sys/time.h)
142 PSI_CONFIG_POSIX(sys/times, sys/times.h)
143 PSI_CONFIG_POSIX(sys/uio, sys/uio.h)
144 PSI_CONFIG_POSIX(sys/utsname, sys/utsname.h)
145 PSI_CONFIG_POSIX(ndbm, dnl
153 PHP_SUBST(PSI_SHARED_LIBADD)
155 AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix)
157 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR)
158 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src)
159 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/calc)
160 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/types)
161 PHP_ADD_INCLUDE($PHP_PSI_BUILDDIR)
162 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)
163 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src/types)
166 src/calc/basic.h src/calc/bin.h src/calc/bool.h src/calc/cast.h \
167 src/calc/cmp.h src/calc/oper.h \
168 `(cd $PHP_PSI_SRCDIR/src && ls *.h types/*.h)` \
170 # parser* should come first
172 src/parser_proc.c src/parser.c \
173 `(cd $PHP_PSI_SRCDIR && ls src/*.c src/types/*.c \
174 | $EGREP -v '^src/parser' \
177 PHP_PSI_GENERATED=" \
178 src/parser_proc.c src/parser.c \
179 src/calc/basic.h src/calc/bin.h src/calc/bool.h src/calc/cast.h \
180 src/calc/cmp.h src/calc/oper.h \
183 PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
184 PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
186 PHP_SUBST(PHP_PSI_GENERATED)
187 PHP_SUBST(PHP_PSI_HEADERS)
188 PHP_SUBST(PHP_PSI_SOURCES)
190 PHP_SUBST(PHP_PSI_SRCDIR)
191 PHP_SUBST(PHP_PSI_BUILDDIR)
193 PHP_ADD_MAKEFILE_FRAGMENT