missing m4
[m6w6/ext-psi] / config.m4
1 PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support,
2 [ --enable-psi Enable PHP System Interface support])
3
4 PHP_ARG_WITH(psi-libjit, where to find libjit,
5 [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ])
6
7 PHP_ARG_WITH(psi-libffi, where to find libffi,
8 [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ])
9
10 PHP_PSI_SRCDIR=PHP_EXT_SRCDIR(psi)
11 PHP_PSI_BUILDDIR=PHP_EXT_BUILDDIR(psi)
12
13 m4_foreach(incfile, [
14 [ax_check_sign.m4],
15 [psi.m4],
16 [psi_type.m4],
17 [psi_const.m4],
18 [psi_decl.m4],
19 [psi_macro.m4],
20 [psi_struct.m4],
21 [errno.m4],
22 [glob.m4],
23 [locale.m4],
24 [stddef.m4],
25 [stdio.m4],
26 [stdint.m4],
27 [stdlib.m4],
28 [sys_select.m4],
29 [sys_socket.m4],
30 [sys_stat.m4],
31 [sys_time.m4],
32 [sys_times.m4],
33 [sys_types.m4],
34 [sys_uio.m4],
35 [sys_utsname.m4],
36 [ndbm.m4],
37 [netdb.m4],
38 [netinet_in.m4],
39 [netinet_tcp.m4],
40 [poll.m4],
41 [syslog.m4],
42 [time.m4],
43 [wchar.m4],
44 [wctype.m4]], [
45 dnl pecl build
46 sinclude([m4/]incfile)
47 dnl php-src build
48 sinclude([ext/psi/m4/]incfile)
49 ])
50
51 if test "$PHP_PSI" != no; then
52 PHP_CONFIGURE_PART(Configuring PSI)
53
54 PSI_LEMON
55 PSI_CHECK_LIBJIT
56 PSI_CHECK_LIBFFI
57
58 AC_FUNC_FNMATCH
59 AC_HEADER_DIRENT
60
61 PSI_CONFIG_INIT
62 PSI_CHECK_STD_TYPES
63 PSI_CHECK_STDINT
64 PSI_CHECK_STDDEF
65 PSI_CHECK_SYS_TYPES
66 PSI_CHECK_ERRNO
67 PSI_CHECK_GLOB
68 PSI_CHECK_LOCALE
69 PSI_CHECK_STDIO
70 PSI_CHECK_STDLIB
71 PSI_CHECK_TIME
72 PSI_CHECK_SYS_SELECT
73 PSI_CHECK_SYS_SOCKET
74 PSI_CHECK_SYS_TIME
75 PSI_CHECK_SYS_TIMES
76 PSI_CHECK_SYS_STAT
77 PSI_CHECK_SYS_UIO
78 PSI_CHECK_SYS_UTSNAME
79 PSI_CHECK_NDBM
80 PSI_CHECK_NETDB
81 PSI_CHECK_NETINET_IN
82 PSI_CHECK_NETINET_TCP
83 PSI_CHECK_POLL
84 PSI_CHECK_SYSLOG
85 PSI_CHECK_WCHAR
86 PSI_CHECK_WCTYPE
87 PSI_CONFIG_DONE
88
89 PHP_SUBST(PSI_SHARED_LIBADD)
90
91 AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix)
92
93 AC_DEFINE_UNQUOTED([PSI_STDINC], [$PSI_STDINC], [Standard includes])
94 AC_DEFINE_UNQUOTED([PSI_TYPES], [$PSI_TYPES], [Predefined types])
95 AC_DEFINE_UNQUOTED([PSI_STRUCTS], [$PSI_STRUCTS], [Predefined structs])
96 AC_DEFINE_UNQUOTED([PSI_CONSTS], [$PSI_CONSTS], [Predefined constants])
97 AC_DEFINE_UNQUOTED([PSI_MACROS], [$PSI_MACROS], [Redirected Macros])
98 AC_DEFINE_UNQUOTED([PSI_REDIRS], [$PSI_REDIRS], [Redirected functions])
99 AC_DEFINE_UNQUOTED([PSI_DECLS], [$PSI_DECLS], [Predefined functions])
100 AC_DEFINE_UNQUOTED([PSI_VA_DECLS], [$PSI_VA_DECLS], [Predefined vararg functions])
101
102 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src)
103 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)
104
105 PHP_PSI_HEADERS=`(cd $PHP_PSI_SRCDIR/src && echo *.h)`
106 PHP_PSI_SOURCES="src/parser_proc.c src/parser.c src/module.c src/context.c"
107 PHP_PSI_SOURCES="$PHP_PSI_SOURCES src/libjit.c src/libffi.c"
108
109 PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
110 PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
111
112 PHP_SUBST(PHP_PSI_HEADERS)
113 PHP_SUBST(PHP_PSI_SOURCES)
114
115 PHP_SUBST(PHP_PSI_SRCDIR)
116 PHP_SUBST(PHP_PSI_BUILDDIR)
117
118 PHP_ADD_MAKEFILE_FRAGMENT
119 AC_MSG_RESULT()
120 fi