sniper          Sun Nov  6 17:44:06 2005 EDT

  Modified files:              
    /php-src    configure.in 
  Log:
  - Do the LTP thing properly
  
http://cvs.php.net/diff.php/php-src/configure.in?r1=1.589&r2=1.590&ty=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.589 php-src/configure.in:1.590
--- php-src/configure.in:1.589  Wed Oct 19 20:18:23 2005
+++ php-src/configure.in        Sun Nov  6 17:44:05 2005
@@ -1,4 +1,4 @@
- ## $Id: configure.in,v 1.589 2005/10/20 00:18:23 john Exp $ -*- autoconf -*-
+ ## $Id: configure.in,v 1.590 2005/11/06 22:44:05 sniper Exp $ -*- autoconf -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -597,56 +597,65 @@
 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],[
 
-    ltp_version_list="1.4"
+  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"])
 
-    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
-        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)"
-          fi
-        done
-      ])
-    else
-      ltp_msg="To enable code coverage reporting you must have one of the 
following LTP versions installed: $ltp_version_list"      
+  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
+      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)"
+        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])
-    fi
+      LTP="exit 0;"
+      ;;
+  esac
 
-    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])
-        LTP="exit 0;"
-        ;;
-    esac
+  if test -z "$LTP_GENHTML"; then
+    AC_MSG_ERROR([Could not find genhtml from the LTP package])
+  fi
 
-    if test "$LTP_GENHTML" = ""; then
-       AC_MSG_ERROR([Could not find genhtml from the LTP package])
-    fi
+  PHP_SUBST(LTP)
+  PHP_SUBST(LTP_GENHTML)
 
-    PHP_SUBST(LTP)
-    PHP_SUBST(LTP_GENHTML)
-  ])
+  PHP_ADD_LIBRARY(gcov)
+  AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
+  PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.gcov, $abs_srcdir)
+
+  dnl Remove all optimization flags from CFLAGS
+  changequote({,})
+  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  changequote([,])
 
-  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 Add the special gcc flags
+  CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
 fi
 
 PHP_ARG_ENABLE(debug, whether to include debugging symbols,

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to