5ea9c37fa30daa7aa10e50f13d7ad33046a6c736
[m6w6/ext-psi] / config.m4
1 m4_foreach(incfile, [
2 [ax/ax_check_sign.m4],
3 [ax/ax_pthread.m4],
4 [psi/psi.m4],
5 [psi/psi_const.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_FUNC_FNMATCH
46 AC_FUNC_MMAP
47 AC_CHECK_FUNCS([mknodat eaccess])
48
49 PSI_CHECK_PTHREAD
50 PSI_CHECK_LIBJIT
51 PSI_CHECK_LIBFFI
52
53 PSI_CONFIG_DONE
54
55 AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix)
56
57 PHP_SUBST(PSI_SHARED_LIBADD)
58 PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
59 PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
60
61 PHP_ADD_MAKEFILE_FRAGMENT
62 AC_MSG_RESULT()
63 fi