Skip to content

Commit 4f25633

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: make LTP version check a blacklist
2 parents 0b648a4 + 3b78a24 commit 4f25633

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

configure.in

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,12 @@ if test "$PHP_GCOV" = "yes"; then
787787
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
788788
fi
789789

790-
ltp_version_list="1.5 1.6 1.7 1.9 1.10"
790+
dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
791+
ltp_version_min="105"
792+
dnl non-working versions, e.g. "1.8 1.18";
793+
dnl remove "none" when introducing the first incompatible LTP version an
794+
dnl separate any following additions by spaces
795+
ltp_version_exclude="1.8"
791796

792797
AC_CHECK_PROG(LTP, lcov, lcov)
793798
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
@@ -797,21 +802,30 @@ if test "$PHP_GCOV" = "yes"; then
797802
if test "$LTP"; then
798803
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
799804
php_cv_ltp_version=invalid
800-
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
801-
for ltp_check_version in $ltp_version_list; do
802-
if test "$ltp_version" = "$ltp_check_version"; then
803-
php_cv_ltp_version="$ltp_check_version (ok)"
805+
ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
806+
if test -n "$ltp_version_vars"; then
807+
set $ltp_version_vars
808+
ltp_version="${1}.${2}"
809+
ltp_version_num="`expr ${1} \* 100 + ${2}`"
810+
if test $ltp_version_num -ge $ltp_version_min; then
811+
php_cv_ltp_version="$ltp_version (ok)"
812+
for ltp_check_version in $ltp_version_exclude; do
813+
if test "$ltp_version" = "$ltp_check_version"; then
814+
php_cv_ltp_version=invalid
815+
break
816+
fi
817+
done
804818
fi
805-
done
819+
fi
806820
])
807821
else
808-
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
822+
ltp_msg="To enable code coverage reporting you must have LTP installed"
809823
AC_MSG_ERROR([$ltp_msg])
810824
fi
811825

812826
case $php_cv_ltp_version in
813827
""|invalid[)]
814-
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
828+
ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
815829
AC_MSG_ERROR([$ltp_msg])
816830
LTP="exit 0;"
817831
;;

0 commit comments

Comments
 (0)