Skip to content

Commit 3718a95

Browse files
committed
Remove configure checks for ltp when using --enable-gcov
gcov builds can also be used with other tools like gcovr, so remove the hard dependency on LTP.
1 parent a78b09c commit 3718a95

File tree

2 files changed

+4
-49
lines changed

2 files changed

+4
-49
lines changed

build/Makefile.gcov

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# LCOV
33
#
44

5+
LTP = lcov
6+
LTP_GENHTML = genhtml
7+
58
lcov: lcov-html
69

710
lcov-test: lcov-clean-data test

configure.ac

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ PHP_HELP_SEPARATOR([General settings:])
781781
PHP_ARG_ENABLE([gcov],
782782
[whether to include gcov symbols],
783783
[AS_HELP_STRING([--enable-gcov],
784-
[Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!])],
784+
[Enable GCOV code coverage - FOR DEVELOPERS ONLY!!])],
785785
[no],
786786
[no])
787787

@@ -801,54 +801,6 @@ if test "$PHP_GCOV" = "yes"; then
801801
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
802802
fi
803803

804-
dnl Min: 1.5 (i.e. 105, major * 100 + minor for easier comparison).
805-
ltp_version_min="105"
806-
dnl Non-working versions, e.g. "1.8 1.18";
807-
dnl Remove "none" when introducing the first incompatible LTP version and
808-
dnl separate any following additions by spaces.
809-
ltp_version_exclude="1.8"
810-
811-
AC_CHECK_PROG(LTP, lcov, lcov)
812-
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
813-
PHP_SUBST(LTP)
814-
PHP_SUBST(LTP_GENHTML)
815-
816-
if test "$LTP"; then
817-
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
818-
php_cv_ltp_version=invalid
819-
ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
820-
if test -n "$ltp_version_vars"; then
821-
set $ltp_version_vars
822-
ltp_version="${1}.${2}"
823-
ltp_version_num="`expr ${1} \* 100 + ${2}`"
824-
if test $ltp_version_num -ge $ltp_version_min; then
825-
php_cv_ltp_version="$ltp_version (ok)"
826-
for ltp_check_version in $ltp_version_exclude; do
827-
if test "$ltp_version" = "$ltp_check_version"; then
828-
php_cv_ltp_version=invalid
829-
break
830-
fi
831-
done
832-
fi
833-
fi
834-
])
835-
else
836-
ltp_msg="To enable code coverage reporting you must have LTP installed"
837-
AC_MSG_ERROR([$ltp_msg])
838-
fi
839-
840-
case $php_cv_ltp_version in
841-
""|invalid[)]
842-
ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
843-
AC_MSG_ERROR([$ltp_msg])
844-
LTP="exit 0;"
845-
;;
846-
esac
847-
848-
if test -z "$LTP_GENHTML"; then
849-
AC_MSG_ERROR([Could not find genhtml from the LTP package])
850-
fi
851-
852804
AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
853805
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/build/Makefile.gcov, $abs_srcdir)
854806

0 commit comments

Comments
 (0)