X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=config.m4;h=75ea3f73052a5f4b9f32695e04179762693530d2;hp=c05ed058835ba7c4f057c01c50c4267b8a25ee89;hb=e918b10a9b5a8de154d12385665728f7408e5cc7;hpb=5d54598329a4d04dd0080bc1252d1de85a7befef diff --git a/config.m4 b/config.m4 index c05ed05..75ea3f7 100644 --- a/config.m4 +++ b/config.m4 @@ -1,59 +1,64 @@ +m4_foreach(incfile, [ + [ax/ax_check_compile_flag.m4], + [ax/ax_check_sign.m4], + [ax/ax_pthread.m4], + [psi/psi.m4], + [psi/psi_type.m4]], [ + dnl pecl build + sinclude([m4/]incfile) + dnl php-src build + sinclude([ext/psi/m4/]incfile) +]) + PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support, -[ --enable-psi Enable PHP System Interface support]) +[ --enable-psi Enable PSI (PHP System Interface) support]) if test "$PHP_PSI" != no; then - PHP_CONFIGURE_PART(Configuring PSI) - PHP_PSI_SRCDIR=PHP_EXT_SRCDIR(psi) - PHP_PSI_BUILDDIR=PHP_EXT_BUILDDIR(psi) + PHP_ARG_ENABLE(psi-maintainer-mode, whether to enable maintainer mode, + [ --enable-psi-maintainer-mode + PSI: enable maintainer mode + . make dependencies], [no], [no]) + PHP_ARG_ENABLE(psi-threaded-parser, whether to enable threaded parser, + [ --enable-psi-threaded-parser + PSI: enable threads for startup parsing], [yes], [no]) - sinclude(config.ax_check_sign.m4) - sinclude(config.psi.m4) - sinclude(config.psi_errno.m4) - sinclude(config.psi_glob.m4) - sinclude(config.psi_stddef.m4) - sinclude(config.psi_stdint.m4) - sinclude(config.psi_sys_types.m4) - sinclude(config.psi_type.m4) + PHP_ARG_WITH(psi-libjit, where to find libjit, + [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ]) - PSI_LEMON - PSI_CHECK_LIBJIT - PSI_CHECK_LIBFFI + PHP_ARG_WITH(psi-libffi, where to find libffi, + [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ]) - AC_FUNC_FNMATCH - AC_HEADER_DIRENT + AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG - PSI_CHECK_STD_TYPES - PSI_CHECK_STDINT - PSI_CHECK_STDDEF - PSI_CHECK_SYS_TYPES - PSI_CHECK_ERRNO - PSI_CHECK_GLOB + PSI_CONFIG_INIT + + PSI_CHECK_MAINTAINER_MODE + PSI_CHECK_THREADED_PARSER - echo PSI_TYPES=$PSI_TYPES - echo PSI_MACROS=$PSI_MACROS - echo PSI_REDIR=$PSI_REDIR - echo PSI_DECLS=$PSI_DECLS + dnl we cannot use AC_USE_SYSTEM_EXTENSIONS here, because we're way too late + dnl in the game, and we're currently only targeting _GNU_SOURCE for now + PSI_CHECK_GNU_SOURCE + PSI_CHECK_CPP + PSI_CHECK_STD_TYPES + + AC_HEADER_DIRENT + AC_FUNC_FNMATCH + AC_FUNC_MMAP + AC_CHECK_FUNCS([mknodat eaccess]) - PHP_SUBST(PSI_SHARED_LIBADD) + PSI_CHECK_PTHREAD + PSI_CHECK_LIBJIT + PSI_CHECK_LIBFFI - PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src) - PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src) + PSI_CONFIG_DONE - PHP_PSI_HEADERS=`(cd $PHP_PSI_SRCDIR/src && echo *.h)` - PHP_PSI_SOURCES="src/parser_proc.c src/parser.c src/module.c src/context.c" - PHP_PSI_SOURCES="$PHP_PSI_SOURCES src/libjit.c src/libffi.c" + AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix) + PHP_SUBST(PSI_SHARED_LIBADD) PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared) PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS) - PHP_SUBST(PHP_PSI_HEADERS) - PHP_SUBST(PHP_PSI_SOURCES) - - PHP_SUBST(PHP_PSI_SRCDIR) - PHP_SUBST(PHP_PSI_BUILDDIR) - PHP_ADD_MAKEFILE_FRAGMENT - AC_MSG_RESULT() fi