]> granicus.if.org Git - php/commitdiff
Fixed bug #75285i Broken build when system libpcre don't have jit support
authorRemi Collet <remi@php.net>
Fri, 29 Sep 2017 13:47:50 +0000 (15:47 +0200)
committerRemi Collet <remi@php.net>
Fri, 29 Sep 2017 13:47:50 +0000 (15:47 +0200)
Detect JIT support in system library,
So --with-pcre-jit is only for bundled library.

ext/pcre/config0.m4

index 6d5b2577911666d9fa2ad0c0563b16c6ec9fb4ed..80c8a58721476126b906991aef820e11574a9191 100644 (file)
@@ -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