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
27
configure.in
27
configure.in
|
@ -597,16 +597,24 @@ dnl -------------------------------------------------------------------------
|
|||
PHP_CONFIGURE_PART(General settings)
|
||||
|
||||
PHP_HELP_SEPARATOR([General settings:])
|
||||
|
||||
PHP_ARG_ENABLE(gcov, whether to include gcov symbols,
|
||||
[ --enable-gcov Enable GCOV code coverage (requires LTP)], no, no)
|
||||
|
||||
if test "$PHP_GCOV" = "yes"; then
|
||||
AC_DEFUN([PHP_PROG_LTP],[
|
||||
|
||||
if test "$GCC" != "yes"; then
|
||||
AC_MSG_ERROR([GCC is required to be able use --enable-gcov])
|
||||
fi
|
||||
|
||||
dnl Check if we can pass GCC the --ccache-disable option
|
||||
PHP_CHECK_GCC_ARG([--ccache-disable], [CC="$CC --ccache-disable"])
|
||||
|
||||
ltp_version_list="1.4"
|
||||
|
||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
|
||||
if test "$LTP"; then
|
||||
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
|
||||
php_cv_ltp_version=invalid
|
||||
|
@ -630,23 +638,24 @@ if test "$PHP_GCOV" = "yes"; then
|
|||
;;
|
||||
esac
|
||||
|
||||
if test "$LTP_GENHTML" = ""; then
|
||||
if test -z "$LTP_GENHTML"; then
|
||||
AC_MSG_ERROR([Could not find genhtml from the LTP package])
|
||||
fi
|
||||
|
||||
PHP_SUBST(LTP)
|
||||
PHP_SUBST(LTP_GENHTML)
|
||||
])
|
||||
|
||||
PHP_PROG_LTP
|
||||
AC_CHECK_LIB(gcov, __gcov_open, [
|
||||
PHP_ADD_LIBRARY(gcov)
|
||||
AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
|
||||
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
|
||||
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.gcov, $abs_srcdir)
|
||||
], [
|
||||
AC_MSG_ERROR([Problem with enabling gcov. Please check config.log for details.])
|
||||
])
|
||||
|
||||
dnl Remove all optimization flags from CFLAGS
|
||||
changequote({,})
|
||||
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
|
||||
changequote([,])
|
||||
|
||||
dnl Add the special gcc flags
|
||||
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
|
||||
fi
|
||||
|
||||
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue