X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=config.m4;h=75ea3f73052a5f4b9f32695e04179762693530d2;hp=c4eb5783a89c04a5335fc55848e866623b4354bc;hb=cd0567b4052ee24259bc6b8a9858af9d26f3de48;hpb=b4508f6b917660970f887894a6aaed6c220a2c72 diff --git a/config.m4 b/config.m4 index c4eb578..75ea3f7 100644 --- a/config.m4 +++ b/config.m4 @@ -1,88 +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]) - m4_foreach(incfile, [ - [ax_check_sign.m4], - [psi.m4], - [psi_type.m4], - [psi_const.m4], - [psi_decl.m4], - [psi_macro.m4], - [psi_struct.m4], - [errno.m4], - [glob.m4], - [stddef.m4], - [stdio.m4], - [stdint.m4], - [stdlib.m4], - [sys_stat.m4], - [sys_time.m4], - [sys_times.m4], - [sys_types.m4], - [sys_uio.m4], - [time.m4], - [wchar.m4]], [ - dnl pecl build - sinclude([m4/]incfile) - dnl php-src build - sinclude([ext/psi/m4/]incfile) - ]) - PSI_LEMON - PSI_CHECK_LIBJIT - PSI_CHECK_LIBFFI + PHP_ARG_WITH(psi-libjit, where to find libjit, + [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ]) - AC_FUNC_FNMATCH - AC_HEADER_DIRENT + PHP_ARG_WITH(psi-libffi, where to find libffi, + [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ]) - PSI_CHECK_STD_TYPES - PSI_CHECK_STDINT - PSI_CHECK_STDDEF - PSI_CHECK_SYS_TYPES - PSI_CHECK_ERRNO - PSI_CHECK_GLOB - PSI_CHECK_STDIO - PSI_CHECK_STDLIB - PSI_CHECK_TIME - PSI_CHECK_SYS_TIME - PSI_CHECK_SYS_TIMES - PSI_CHECK_SYS_STAT - PSI_CHECK_SYS_UIO - PSI_CHECK_WCHAR + AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG - PHP_SUBST(PSI_SHARED_LIBADD) + PSI_CONFIG_INIT + + PSI_CHECK_MAINTAINER_MODE + PSI_CHECK_THREADED_PARSER - AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix) + 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]) - AC_DEFINE_UNQUOTED([PSI_TYPES], [$PSI_TYPES], [Predefined types]) - AC_DEFINE_UNQUOTED([PSI_STRUCTS], [$PSI_STRUCTS], [Predefined structs]) - AC_DEFINE_UNQUOTED([PSI_CONSTS], [$PSI_CONSTS], [Predefined constants]) - AC_DEFINE_UNQUOTED([PSI_MACROS], [$PSI_MACROS], [Redirected Macros]) - AC_DEFINE_UNQUOTED([PSI_REDIRS], [$PSI_REDIRS], [Redirected functions]) - AC_DEFINE_UNQUOTED([PSI_DECLS], [$PSI_DECLS], [Predefined functions]) + 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