Skip to content

Commit f8d5309

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Use PKG_CHECK_MODULES to detect valgrind, and share build config with pcre
2 parents daa9172 + ef34e00 commit f8d5309

File tree

2 files changed

+10
-49
lines changed

2 files changed

+10
-49
lines changed

configure.ac

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -762,35 +762,22 @@ fi
762762
dnl Check valgrind support.
763763
PHP_ARG_WITH([valgrind],
764764
[whether to enable valgrind support],
765-
[AS_HELP_STRING([--with-valgrind=DIR],
765+
[AS_HELP_STRING([--with-valgrind],
766766
[Enable valgrind support])],
767767
[yes],
768768
[no])
769769

770770
if test "$PHP_VALGRIND" != "no"; then
771+
PKG_CHECK_MODULES([VALGRIND], [valgrind], [have_valgrind="yes"], [have_valgrind="no"])
771772

772-
AC_MSG_CHECKING([for valgrind header])
773-
774-
if test "$PHP_VALGRIND" = "yes"; then
775-
SEARCH_PATH="/usr/local /usr"
773+
if test "$have_valgrind" = "yes"; then
774+
PHP_EVAL_INCLINE($VALGRIND_CFLAGS)
775+
AC_DEFINE(HAVE_VALGRIND, 1, [ ])
776776
else
777-
SEARCH_PATH="$PHP_VALGRIND"
778-
fi
779-
780-
SEARCH_FOR="/include/valgrind/valgrind.h"
781-
for i in $SEARCH_PATH ; do
782-
if test -r $i/$SEARCH_FOR; then
783-
VALGRIND_DIR=$i
777+
if test "$with_valgrind" = "yes"; then
778+
AC_MSG_ERROR([Valgrind not found. Please install Valgrind.])
784779
fi
785-
done
786-
787-
if test -z "$VALGRIND_DIR"; then
788-
AC_MSG_RESULT([not found])
789-
else
790-
AC_MSG_RESULT(found in $VALGRIND_DIR)
791-
AC_DEFINE(HAVE_VALGRIND, 1, [ ])
792780
fi
793-
794781
fi
795782

796783
dnl General settings.

ext/pcre/config0.m4

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -80,34 +80,8 @@ else
8080
else
8181
AC_MSG_RESULT([no])
8282
fi
83-
fi
84-
85-
PHP_ARG_WITH([pcre-valgrind],,
86-
[AS_HELP_STRING([--with-pcre-valgrind=DIR],
87-
[Enable PCRE valgrind support. Developers only!])],
88-
[no],
89-
[no])
9083

91-
if test "$PHP_EXTERNAL_PCRE" != "no"; then
92-
AC_MSG_WARN([PHP is going to be linked with an external PCRE, --with-pcre-valgrind has no effect])
93-
else
94-
if test "$PHP_PCRE_VALGRIND" != "no"; then
95-
PHP_PCRE_VALGRIND_INCDIR=
96-
AC_MSG_CHECKING([for Valgrind headers location])
97-
for i in $PHP_PCRE_VALGRIND $PHP_PCRE_VALGRIND/include $PHP_PCRE_VALGRIND/local/include /usr/include /usr/local/include; do
98-
if test -f $i/valgrind/memcheck.h
99-
then
100-
PHP_PCRE_VALGRIND_INCDIR=$i
101-
break
102-
fi
103-
done
104-
if test -z "$PHP_PCRE_VALGRIND_INCDIR"
105-
then
106-
AC_MSG_ERROR([Could not find valgrind/memcheck.h])
107-
else
108-
AC_DEFINE(HAVE_PCRE_VALGRIND_SUPPORT, 1, [ ])
109-
PHP_ADD_INCLUDE($PHP_PCRE_VALGRIND_INCDIR)
110-
AC_MSG_RESULT([$PHP_PCRE_VALGRIND_INCDIR])
111-
fi
112-
fi
84+
if test "$PHP_VALGRIND" != "no" && test "$have_valgrind" = "yes"; then
85+
AC_DEFINE(HAVE_PCRE_VALGRIND_SUPPORT, 1, [ ])
11386
fi
87+
fi

0 commit comments

Comments
 (0)