com php-src: Use PKG_CHECK_MODULES to detect valgrind , and share build config with pcre: UPGRADING .INTERNALS configure.ac ext/pcre/config0.m4
| From: | Joe Watkins | Date: | Sat, 25 May 2019 07:04:22 +0000 |
| Subject: | com php-src: Use PKG_CHECK_MODULES to detect valgrind , and share build config with pcre: UPGRADING .INTERNALS configure.ac ext/pcre/config0.m4 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106325@lists.php.net to get a copy of this message | ||
Commit: ef34e00df34f88c852baac84ad1428d4360c6d06
Author: Hugh McMaster <hugh.mcmaster@outlook.com> Thu, 23 May 2019 23:01:04 +1000
Committer: Joe Watkins <krakjoe@php.net> Sat, 25 May 2019 09:04:22 +0200
Parents: e7a1409fe1c13a7619c1834956d4c3607909c96b
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ef34e00df34f88c852baac84ad1428d4360c6d06
Log:
Use PKG_CHECK_MODULES to detect valgrind, and share build config with pcre
Changed paths:
M UPGRADING.INTERNALS
M configure.ac
M ext/pcre/config0.m4
Diff:
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 5505184..3104be8 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 f4a01e1..c388eba 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 a6601fc..90bc782 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