fix memleaks
[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 if test "$PHP_PSI" != no; then
5 PHP_CONFIGURE_PART(Configuring PSI)
6
7 PHP_PSI_SRCDIR=PHP_EXT_SRCDIR(psi)
8 PHP_PSI_BUILDDIR=PHP_EXT_BUILDDIR(psi)
9
10 m4_foreach(incfile, [
11 [ax_check_sign.m4],
12 [psi.m4],
13 [psi_type.m4],
14 [psi_const.m4],
15 [psi_decl.m4],
16 [psi_macro.m4],
17 [psi_struct.m4],
18 [errno.m4],
19 [glob.m4],
20 [stddef.m4],
21 [stdio.m4],
22 [stdint.m4],
23 [stdlib.m4],
24 [sys_select.m4],
25 [sys_socket.m4],
26 [sys_stat.m4],
27 [sys_time.m4],
28 [sys_times.m4],
29 [sys_types.m4],
30 [sys_uio.m4],
31 [sys_utsname.m4],
32 [time.m4],
33 [wchar.m4]], [
34 dnl pecl build
35 sinclude([m4/]incfile)
36 dnl php-src build
37 sinclude([ext/psi/m4/]incfile)
38 ])
39 PSI_LEMON
40 PSI_CHECK_LIBJIT
41 PSI_CHECK_LIBFFI
42
43 AC_FUNC_FNMATCH
44 AC_HEADER_DIRENT
45
46 PSI_CHECK_STD_TYPES
47 PSI_CHECK_STDINT
48 PSI_CHECK_STDDEF
49 PSI_CHECK_SYS_TYPES
50 PSI_CHECK_ERRNO
51 PSI_CHECK_GLOB
52 PSI_CHECK_STDIO
53 PSI_CHECK_STDLIB
54 PSI_CHECK_TIME
55 PSI_CHECK_SYS_SELECT
56 PSI_CHECK_SYS_SOCKET
57 PSI_CHECK_SYS_TIME
58 PSI_CHECK_SYS_TIMES
59 PSI_CHECK_SYS_STAT
60 PSI_CHECK_SYS_UIO
61 PSI_CHECK_SYS_UTSNAME
62 PSI_CHECK_WCHAR
63
64 PHP_SUBST(PSI_SHARED_LIBADD)
65
66 AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix)
67
68 AC_DEFINE_UNQUOTED([PSI_TYPES], [$PSI_TYPES], [Predefined types])
69 AC_DEFINE_UNQUOTED([PSI_STRUCTS], [$PSI_STRUCTS], [Predefined structs])
70 AC_DEFINE_UNQUOTED([PSI_CONSTS], [$PSI_CONSTS], [Predefined constants])
71 AC_DEFINE_UNQUOTED([PSI_MACROS], [$PSI_MACROS], [Redirected Macros])
72 AC_DEFINE_UNQUOTED([PSI_REDIRS], [$PSI_REDIRS], [Redirected functions])
73 AC_DEFINE_UNQUOTED([PSI_DECLS], [$PSI_DECLS], [Predefined functions])
74
75 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src)
76 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)
77
78 PHP_PSI_HEADERS=`(cd $PHP_PSI_SRCDIR/src && echo *.h)`
79 PHP_PSI_SOURCES="src/parser_proc.c src/parser.c src/module.c src/context.c"
80 PHP_PSI_SOURCES="$PHP_PSI_SOURCES src/libjit.c src/libffi.c"
81
82 PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
83 PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
84
85 PHP_SUBST(PHP_PSI_HEADERS)
86 PHP_SUBST(PHP_PSI_SOURCES)
87
88 PHP_SUBST(PHP_PSI_SRCDIR)
89 PHP_SUBST(PHP_PSI_BUILDDIR)
90
91 PHP_ADD_MAKEFILE_FRAGMENT
92
93 AC_MSG_RESULT()
94 fi