Skip to content

Commit 7c83579

Browse files
committed
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.
1 parent c3a1cc3 commit 7c83579

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

ext/pcre/config0.m4

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PHP_ARG_WITH(pcre-regex,,
99
[ --with-pcre-regex=DIR Include Perl Compatible Regular Expressions support.
1010
DIR is the PCRE install prefix [BUNDLED]], yes, no)
1111

12+
PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality (BUNDLED only)], yes, no)
13+
1214
if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
1315
AC_MSG_CHECKING([for PCRE headers location])
1416
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,,
4345
AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 6.6])
4446
fi
4547

48+
PHP_CHECK_LIBRARY(pcre, pcre_jit_exec,
49+
[
50+
AC_DEFINE(HAVE_PCRE_JIT_SUPPORT, 1, [ ])
51+
],[
52+
],[
53+
-L$PCRE_LIBDIR
54+
])
4655
PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
4756

4857
AC_DEFINE(HAVE_PCRE, 1, [ ])
@@ -65,16 +74,15 @@ PHP_ARG_WITH(pcre-regex,,
6574
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
6675
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
6776
AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
68-
fi
6977

70-
PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality], yes, no)
71-
if test "$PHP_PCRE_REGEX" != "no"; then
72-
AC_MSG_CHECKING([whether to enable PCRE JIT functionality])
73-
if test "$PHP_PCRE_JIT" != "no"; then
74-
AC_DEFINE(HAVE_PCRE_JIT_SUPPORT, 1, [ ])
75-
AC_MSG_RESULT([yes])
76-
else
78+
if test "$PHP_PCRE_REGEX" != "no"; then
79+
AC_MSG_CHECKING([whether to enable PCRE JIT functionality])
80+
if test "$PHP_PCRE_JIT" != "no"; then
81+
AC_DEFINE(HAVE_PCRE_JIT_SUPPORT, 1, [ ])
82+
AC_MSG_RESULT([yes])
83+
else
7784
AC_MSG_RESULT([no])
85+
fi
7886
fi
7987
fi
8088

0 commit comments

Comments
 (0)