mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
- Do the LTP thing properly
This commit is contained in:
parent
e4c8e1dc85
commit
0977376369
1 changed files with 48 additions and 39 deletions
87
configure.in
87
configure.in
|
@ -597,56 +597,65 @@ dnl -------------------------------------------------------------------------
|
||||||
PHP_CONFIGURE_PART(General settings)
|
PHP_CONFIGURE_PART(General settings)
|
||||||
|
|
||||||
PHP_HELP_SEPARATOR([General settings:])
|
PHP_HELP_SEPARATOR([General settings:])
|
||||||
|
|
||||||
PHP_ARG_ENABLE(gcov, whether to include gcov symbols,
|
PHP_ARG_ENABLE(gcov, whether to include gcov symbols,
|
||||||
[ --enable-gcov Enable GCOV code coverage (requires LTP)], no, no)
|
[ --enable-gcov Enable GCOV code coverage (requires LTP)], no, no)
|
||||||
|
|
||||||
if test "$PHP_GCOV" = "yes"; then
|
if test "$PHP_GCOV" = "yes"; then
|
||||||
AC_DEFUN([PHP_PROG_LTP],[
|
|
||||||
|
|
||||||
ltp_version_list="1.4"
|
if test "$GCC" != "yes"; then
|
||||||
|
AC_MSG_ERROR([GCC is required to be able use --enable-gcov])
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
dnl Check if we can pass GCC the --ccache-disable option
|
||||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
PHP_CHECK_GCC_ARG([--ccache-disable], [CC="$CC --ccache-disable"])
|
||||||
if test "$LTP"; then
|
|
||||||
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
|
ltp_version_list="1.4"
|
||||||
php_cv_ltp_version=invalid
|
|
||||||
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
|
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||||
for ltp_check_version in $ltp_version_list; do
|
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||||
if test "$ltp_version" = "$ltp_check_version"; then
|
|
||||||
php_cv_ltp_version="$ltp_check_version (ok)"
|
if test "$LTP"; then
|
||||||
fi
|
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
|
||||||
done
|
php_cv_ltp_version=invalid
|
||||||
])
|
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
|
||||||
else
|
for ltp_check_version in $ltp_version_list; do
|
||||||
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
|
if test "$ltp_version" = "$ltp_check_version"; then
|
||||||
|
php_cv_ltp_version="$ltp_check_version (ok)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
])
|
||||||
|
else
|
||||||
|
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
|
||||||
|
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)."
|
||||||
AC_MSG_ERROR([$ltp_msg])
|
AC_MSG_ERROR([$ltp_msg])
|
||||||
fi
|
LTP="exit 0;"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
case $php_cv_ltp_version in
|
if test -z "$LTP_GENHTML"; then
|
||||||
""|invalid[)]
|
AC_MSG_ERROR([Could not find genhtml from the LTP package])
|
||||||
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
|
fi
|
||||||
AC_MSG_ERROR([$ltp_msg])
|
|
||||||
LTP="exit 0;"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test "$LTP_GENHTML" = ""; then
|
PHP_SUBST(LTP)
|
||||||
AC_MSG_ERROR([Could not find genhtml from the LTP package])
|
PHP_SUBST(LTP_GENHTML)
|
||||||
fi
|
|
||||||
|
|
||||||
PHP_SUBST(LTP)
|
PHP_ADD_LIBRARY(gcov)
|
||||||
PHP_SUBST(LTP_GENHTML)
|
AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
|
||||||
])
|
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.gcov, $abs_srcdir)
|
||||||
|
|
||||||
PHP_PROG_LTP
|
dnl Remove all optimization flags from CFLAGS
|
||||||
AC_CHECK_LIB(gcov, __gcov_open, [
|
changequote({,})
|
||||||
PHP_ADD_LIBRARY(gcov)
|
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
|
||||||
AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
|
changequote([,])
|
||||||
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
|
|
||||||
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.gcov,$abs_srcdir)
|
dnl Add the special gcc flags
|
||||||
], [
|
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
|
||||||
AC_MSG_ERROR([Problem with enabling gcov. Please check config.log for details.])
|
|
||||||
])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
|
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue