]> granicus.if.org Git - php/commitdiff
Enable valgrind support for PCRE by default in debug builds
authorAnatol Belski <ab@php.net>
Thu, 13 Jul 2017 16:36:00 +0000 (18:36 +0200)
committerAnatol Belski <ab@php.net>
Thu, 13 Jul 2017 16:38:28 +0000 (18:38 +0200)
Thanks Nikita for the hint.

ext/pcre/config0.m4

index 6d5b2577911666d9fa2ad0c0563b16c6ec9fb4ed..aa8cd304e09683eb0a6694460242aa628d549a6c 100644 (file)
@@ -79,11 +79,14 @@ PHP_ARG_WITH(pcre-jit,,[  --with-pcre-jit         Enable PCRE JIT functionality]
   fi
 
 PHP_ARG_WITH(pcre-valgrind,,[  --with-pcre-valgrind=DIR
-                          Enable PCRE valgrind support. Developers only!], no, no)
+                          Enable PCRE valgrind support. Developers only!], $PHP_DEBUG, no)
+
   if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
     AC_MSG_WARN([PHP is going to be linked with an external PCRE, --with-pcre-valgrind has no effect])
   else
-    if test "$PHP_PCRE_VALGRIND" != "no"; then
+    if test "$PHP_PCRE_VALGRIND" = "no" && test "$PHP_DEBUG" != "no"; then
+      AC_MSG_NOTICE([PCRE Valgrind support is disabled for debug build])
+    elif test "$PHP_PCRE_VALGRIND" != "no" || test "$PHP_DEBUG" != "no"; then
       PHP_PCRE_VALGRIND_INCDIR=
       AC_MSG_CHECKING([for Valgrind headers location])
       for i in $PHP_PCRE_VALGRIND $PHP_PCRE_VALGRIND/include $PHP_PCRE_VALGRIND/local/include /usr/include /usr/local/include; do