From: Remi Collet Date: Fri, 29 Sep 2017 13:47:50 +0000 (+0200) Subject: Fixed bug #75285i Broken build when system libpcre don't have jit support X-Git-Tag: php-7.2.0RC4~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c8357929cc3e0cabcb312c3fae48f6fb949944e;p=php Fixed bug #75285i Broken build when system libpcre don't have jit support Detect JIT support in system library, So --with-pcre-jit is only for bundled library. --- diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4 index 6d5b257791..80c8a58721 100644 --- a/ext/pcre/config0.m4 +++ b/ext/pcre/config0.m4 @@ -9,6 +9,8 @@ PHP_ARG_WITH(pcre-regex,, [ --with-pcre-regex=DIR Include Perl Compatible Regular Expressions support. DIR is the PCRE install prefix [BUNDLED]], yes, no) +PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality (BUNDLED only)], yes, no) + if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then AC_MSG_CHECKING([for PCRE headers location]) for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do @@ -43,6 +45,13 @@ PHP_ARG_WITH(pcre-regex,, AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 6.6]) fi + PHP_CHECK_LIBRARY(pcre, pcre_jit_exec, + [ + AC_DEFINE(HAVE_PCRE_JIT_SUPPORT, 1, [ ]) + ],[ + ],[ + -L$PCRE_LIBDIR + ]) PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR) AC_DEFINE(HAVE_PCRE, 1, [ ]) @@ -65,16 +74,15 @@ PHP_ARG_WITH(pcre-regex,, PHP_ADD_BUILD_DIR($ext_builddir/pcrelib) PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/]) AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ]) - fi -PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality], yes, no) - if test "$PHP_PCRE_REGEX" != "no"; then - AC_MSG_CHECKING([whether to enable PCRE JIT functionality]) - if test "$PHP_PCRE_JIT" != "no"; then - AC_DEFINE(HAVE_PCRE_JIT_SUPPORT, 1, [ ]) - AC_MSG_RESULT([yes]) - else + if test "$PHP_PCRE_REGEX" != "no"; then + AC_MSG_CHECKING([whether to enable PCRE JIT functionality]) + if test "$PHP_PCRE_JIT" != "no"; then + AC_DEFINE(HAVE_PCRE_JIT_SUPPORT, 1, [ ]) + AC_MSG_RESULT([yes]) + else AC_MSG_RESULT([no]) + fi fi fi