rework config.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 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 sinclude(config.ax_check_sign.m4)
11 sinclude(config.psi.m4)
12 sinclude(config.psi_errno.m4)
13 sinclude(config.psi_glob.m4)
14 sinclude(config.psi_stddef.m4)
15 sinclude(config.psi_stdint.m4)
16 sinclude(config.psi_sys_types.m4)
17 sinclude(config.psi_type.m4)
18
19 PSI_LEMON
20 PSI_CHECK_LIBJIT
21 PSI_CHECK_LIBFFI
22
23 AC_FUNC_FNMATCH
24 AC_HEADER_DIRENT
25
26 PSI_CHECK_STD_TYPES
27 PSI_CHECK_STDINT
28 PSI_CHECK_STDDEF
29 PSI_CHECK_SYS_TYPES
30 PSI_CHECK_ERRNO
31 PSI_CHECK_GLOB
32
33 echo PSI_TYPES=$PSI_TYPES
34 echo PSI_MACROS=$PSI_MACROS
35 echo PSI_REDIR=$PSI_REDIR
36 echo PSI_DECLS=$PSI_DECLS
37
38 PHP_SUBST(PSI_SHARED_LIBADD)
39
40 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src)
41 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)
42
43 PHP_PSI_HEADERS=`(cd $PHP_PSI_SRCDIR/src && echo *.h)`
44 PHP_PSI_SOURCES="src/parser_proc.c src/parser.c src/module.c src/context.c"
45 PHP_PSI_SOURCES="$PHP_PSI_SOURCES src/libjit.c src/libffi.c"
46
47 PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
48 PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
49
50 PHP_SUBST(PHP_PSI_HEADERS)
51 PHP_SUBST(PHP_PSI_SOURCES)
52
53 PHP_SUBST(PHP_PSI_SRCDIR)
54 PHP_SUBST(PHP_PSI_BUILDDIR)
55
56 PHP_ADD_MAKEFILE_FRAGMENT
57
58 AC_MSG_RESULT()
59 fi