fix macro expansion
[m6w6/ext-psi] / config.m4
1 m4_foreach(incfile, [
2 [ax/ax_check_compile_flag.m4],
3 [ax/ax_check_sign.m4],
4 [ax/ax_pthread.m4],
5 [psi/psi.m4],
6 [psi/psi_type.m4]], [
7 dnl pecl build
8 sinclude([m4/]incfile)
9 dnl php-src build
10 sinclude([ext/psi/m4/]incfile)
11 ])
12
13 PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support,
14 [ --enable-psi Enable PSI (PHP System Interface) support])
15
16 if test "$PHP_PSI" != no; then
17
18 PHP_ARG_ENABLE(psi-maintainer-mode, whether to enable maintainer mode,
19 [ --enable-psi-maintainer-mode
20 PSI: enable maintainer mode
21 . make dependencies], [no], [no])
22 PHP_ARG_ENABLE(psi-threaded-parser, whether to enable threaded parser,
23 [ --enable-psi-threaded-parser
24 PSI: enable threads for startup parsing], [yes], [no])
25
26 PHP_ARG_WITH(psi-libjit, where to find libjit,
27 [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ])
28
29 PHP_ARG_WITH(psi-libffi, where to find libffi,
30 [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ])
31
32 AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG
33
34 PSI_CONFIG_INIT
35
36 PSI_CHECK_MAINTAINER_MODE
37 PSI_CHECK_THREADED_PARSER
38
39 dnl we cannot use AC_USE_SYSTEM_EXTENSIONS here, because we're way too late
40 dnl in the game, and we're currently only targeting _GNU_SOURCE for now
41 PSI_CHECK_GNU_SOURCE
42 PSI_CHECK_CPP
43 PSI_CHECK_STD_TYPES
44
45 AC_HEADER_DIRENT
46 AC_FUNC_FNMATCH
47 AC_FUNC_MMAP
48 AC_CHECK_FUNCS([mknodat eaccess])
49
50 PSI_CHECK_PTHREAD
51 PSI_CHECK_LIBJIT
52 PSI_CHECK_LIBFFI
53
54 PSI_CONFIG_DONE
55
56 AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix)
57
58 PHP_SUBST(PSI_SHARED_LIBADD)
59 PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
60 PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
61
62 PHP_ADD_MAKEFILE_FRAGMENT
63 AC_MSG_RESULT()
64 fi