diff options
| author | Hugh McMaster <hugh.mcmaster@outlook.com> | 2019-05-23 23:01:04 +1000 | 
|---|---|---|
| committer | Joe Watkins <krakjoe@php.net> | 2019-05-25 09:04:22 +0200 | 
| commit | ef34e00df34f88c852baac84ad1428d4360c6d06 (patch) | |
| tree | ca6bc5d896431af0763c8b65f4dc4563a6ee3ccd | |
| parent | e7a1409fe1c13a7619c1834956d4c3607909c96b (diff) | |
| download | php-git-ef34e00df34f88c852baac84ad1428d4360c6d06.tar.gz | |
Use PKG_CHECK_MODULES to detect valgrind, and share build config with pcre
| -rw-r--r-- | UPGRADING.INTERNALS | 2 | ||||
| -rw-r--r-- | configure.ac | 27 | ||||
| -rw-r--r-- | ext/pcre/config0.m4 | 32 | 
3 files changed, 12 insertions, 49 deletions
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 5505184092..3104be8524 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -227,6 +227,8 @@ PHP 7.4 INTERNALS UPGRADE NOTES        version and excluded versions that aren't supported.      - PHP_PROG_RE2C is not called in the generated configure.ac for extensions        anymore and now takes one optional argument - minimum required version. +    - with-pcre-valgrind and with-valgrind are merged, and valgrind detected by +      pkgconfig    c. Windows build system changes diff --git a/configure.ac b/configure.ac index f4a01e1e49..c388ebae91 100644 --- a/configure.ac +++ b/configure.ac @@ -761,35 +761,22 @@ fi  dnl Check valgrind support.  PHP_ARG_WITH([valgrind],    [whether to enable valgrind support], -  [AS_HELP_STRING([--with-valgrind=DIR], +  [AS_HELP_STRING([--with-valgrind],      [Enable valgrind support])],    [yes],    [no])  if test "$PHP_VALGRIND" != "no"; then +  PKG_CHECK_MODULES([VALGRIND], [valgrind], [have_valgrind="yes"], [have_valgrind="no"]) -  AC_MSG_CHECKING([for valgrind header]) - -  if test "$PHP_VALGRIND" = "yes"; then -    SEARCH_PATH="/usr/local /usr" +  if test "$have_valgrind" = "yes"; then +    PHP_EVAL_INCLINE($VALGRIND_CFLAGS) +    AC_DEFINE(HAVE_VALGRIND, 1, [ ])    else -    SEARCH_PATH="$PHP_VALGRIND" -  fi - -  SEARCH_FOR="/include/valgrind/valgrind.h" -  for i in $SEARCH_PATH ; do -    if test -r $i/$SEARCH_FOR; then -      VALGRIND_DIR=$i +    if test "$with_valgrind" = "yes"; then +      AC_MSG_ERROR([Valgrind not found. Please install Valgrind.])      fi -  done - -  if test -z "$VALGRIND_DIR"; then -    AC_MSG_RESULT([not found]) -  else -    AC_MSG_RESULT(found in $VALGRIND_DIR) -    AC_DEFINE(HAVE_VALGRIND, 1, [ ])    fi -  fi  dnl General settings. diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4 index a6601fc3f1..90bc782a3d 100644 --- a/ext/pcre/config0.m4 +++ b/ext/pcre/config0.m4 @@ -81,34 +81,8 @@ else    else      AC_MSG_RESULT([no])    fi -fi - -PHP_ARG_WITH([pcre-valgrind],, -  [AS_HELP_STRING([--with-pcre-valgrind=DIR], -    [Enable PCRE valgrind support. Developers only!])], -  [no], -  [no]) -  if test "$PHP_EXTERNAL_PCRE" != "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 -      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 -        if test -f $i/valgrind/memcheck.h -        then -          PHP_PCRE_VALGRIND_INCDIR=$i -          break -        fi -      done -      if test -z "$PHP_PCRE_VALGRIND_INCDIR" -      then -        AC_MSG_ERROR([Could not find valgrind/memcheck.h]) -      else -        AC_DEFINE(HAVE_PCRE_VALGRIND_SUPPORT, 1, [ ]) -        PHP_ADD_INCLUDE($PHP_PCRE_VALGRIND_INCDIR) -        AC_MSG_RESULT([$PHP_PCRE_VALGRIND_INCDIR]) -      fi -    fi +  if test "$PHP_VALGRIND" != "no" && test "$have_valgrind" = "yes"; then +      AC_DEFINE(HAVE_PCRE_VALGRIND_SUPPORT, 1, [ ])    fi +fi  | 
