com php-src: make LTP version check a blacklist: configure.in
| From: | Michael Wallner | Date: | Wed, 10 Sep 2014 11:30:52 +0000 |
| Subject: | com php-src: make LTP version check a blacklist: configure.in | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81493@lists.php.net to get a copy of this message | ||
Commit: 3b78a24ee987d8b99f9647b3695ee82dc5cbebe8
Author: Michael Wallner <mike@php.net> Wed, 10 Sep 2014 13:30:52 +0200
Parents: bf2f80b22356cd93748dd7551dfa0b54fb53e5b5
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3b78a24ee987d8b99f9647b3695ee82dc5cbebe8
Log:
make LTP version check a blacklist
Changed paths:
M configure.in
Diff:
diff --git a/configure.in b/configure.in
index dff05e5..92b4900 100644
--- a/configure.in
+++ b/configure.in
@@ -784,7 +784,12 @@ if test "$PHP_GCOV" = "yes"; then
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache
by setting environment variable CCACHE_DISABLE=1.])
fi
- ltp_version_list="1.5 1.6 1.7 1..9 1.10"
+ dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
+ ltp_version_min="105"
+ dnl non-working versions, e.g. "1.8 1.18";
+ dnl remove "none" when introducing the first incompatible LTP version an
+ dnl separate any following additions by spaces
+ ltp_version_exclude="1.8"
AC_CHECK_PROG(LTP, lcov, lcov)
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
@@ -794,21 +799,30 @@ if test "$PHP_GCOV" = "yes"; then
if test "$LTP"; then
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
php_cv_ltp_version=invalid
- ltp_version=
$LTP -v 2>/dev/null | $SED -e 's/^.* //'
- for ltp_check_version in $ltp_version_list; do
- if test "$ltp_version" = "$ltp_check_version"; then
- php_cv_ltp_version="$ltp_check_version (ok)"
+ ltp_version_vars=$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./
/g' | tr -d a-z
+ if test -n "$ltp_version_vars"; then
+ set $ltp_version_vars
+ ltp_version="${1}.${2}"
+ ltp_version_num="expr ${1} \* 100 + ${2}"
+ if test $ltp_version_num -ge $ltp_version_min; then
+ php_cv_ltp_version="$ltp_version (ok)"
+ for ltp_check_version in $ltp_version_exclude; do
+ if test "$ltp_version" = "$ltp_check_version"; then
+ php_cv_ltp_version=invalid
+ break
+ fi
+ done
fi
- done
+ fi
])
else
- ltp_msg="To enable code coverage reporting you must have one of the following LTP versions
installed: $ltp_version_list"
+ ltp_msg="To enable code coverage reporting you must have LTP installed"
AC_MSG_ERROR([$ltp_msg])
fi
case $php_cv_ltp_version in
""|invalid[)]
- ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found:
$ltp_version)."
+ ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min,
excluded: $ltp_version_exclude)."
AC_MSG_ERROR([$ltp_msg])
LTP="exit 0;"
;;