[cairo-commit] cairo ChangeLog, 1.1164, 1.1165 configure.in, 1.153, 1.154

Carl Worth commit at pdx.freedesktop.org
Wed Dec 14 16:22:15 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo
In directory gabe:/tmp/cvs-serv2115

Modified Files:
	ChangeLog configure.in 
Log Message:

2005-12-14  Carl Worth  <cworth at cworth.org>

        * configure.in: Add preliminary support for --enable-gcov. Thanks to
        Pierre-Alain Joye (with inspiration from the PHP gcov support by
        Jani Taskinen and Ilia Alshanetsky).

        * src/.cvsignore:
        * test/.cvsignore: Ignore *.gcda and *.gcno gcov data files.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo/ChangeLog,v
retrieving revision 1.1164
retrieving revision 1.1165
diff -u -d -r1.1164 -r1.1165
--- ChangeLog	14 Dec 2005 00:31:14 -0000	1.1164
+++ ChangeLog	15 Dec 2005 00:22:06 -0000	1.1165
@@ -1,3 +1,12 @@
+2005-12-14  Carl Worth  <cworth at cworth.org>
+
+	* configure.in: Add preliminary support for --enable-gcov. Thanks to 
+	Pierre-Alain Joye (with inspiration from the PHP gcov support by 
+	Jani Taskinen and Ilia Alshanetsky).
+	
+	* src/.cvsignore:
+	* test/.cvsignore: Ignore *.gcda and *.gcno gcov data files.
+
 2005-12-13  Carl Worth  <cworth at cworth.org>
 
 	* src/cairo-ps-surface.c: (_cairo_ps_surface_finish): Make creator

Index: configure.in
===================================================================
RCS file: /cvs/cairo/cairo/configure.in,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- configure.in	12 Dec 2005 19:56:40 -0000	1.153
+++ configure.in	15 Dec 2005 00:22:06 -0000	1.154
@@ -88,8 +88,8 @@
 dnl ===========================================================================
 
 AC_ARG_ENABLE(xlib,
-  [  --disable-xlib          Disable cairo's Xlib backend],
-  [use_xlib=$enableval], [use_xlib=yes])
+[  --disable-xlib          Disable cairo's Xlib backend],
+[use_xlib=$enableval], [use_xlib=yes])
 
 if test "x$use_xlib" = "xyes"; then
   dnl Check for Xrender header files if the Xrender package is not installed:
@@ -580,6 +580,71 @@
 
 dnl ===========================================================================
 
+AC_ARG_ENABLE(gcov,
+[  --enable-gcov           Enable gcov],
+[use_gcov=$enableval], [use_gcov=no])
+
+if test "x$use_gcov" = "xyes"; then
+  dnl we need gcc:
+  if test "$GCC" != "yes"; then
+    AC_MSG_ERROR([GCC is required for --enable-gcov])
+  fi
+
+  dnl Check if ccache is being used
+  case `shtool path $CC` in
+    *ccache*[)] gcc_ccache=yes;;
+    *[)] gcc_ccache=no;;
+  esac
+
+  if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); 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.4"
+  AC_CHECK_PROG(LTP, lcov, lcov)
+  AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
+
+  if test "$LTP"; then
+    AC_CACHE_CHECK([for ltp version], cairo_cv_ltp_version, [
+      cairo_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
+          cairo_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 $cairo_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
+
+  AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
+dnl  PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.gcov, $abs_srcdir)
+
+  dnl Remove all optimization flags from CFLAGS
+  changequote({,})
+  CAIRO_CFLAGS=`echo "$CAIRO_CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  changequote([,])
+
+  dnl Add the special gcc flags
+  CAIRO_CFLAGS="$CAIRO_CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+fi
+
+dnl ===========================================================================
+
 AC_OUTPUT([
 cairo.pc
 Makefile
@@ -611,8 +676,13 @@
 echo "  Win32:      $use_win32"
 echo "  ATSUI:      $use_atsui"
 echo ""
-echo "and the following features:"
+echo "the following features:"
 echo "  PNG functions: $use_png"
+echo ""
+echo "and the following debug options:"
+echo "  gcov support:  $use_gcov"
+echo "using CFLAGS:"
+echo $CAIRO_CFLAGS
 
 if test x"$use_freetype" != "xyes" && \
    test x"$use_win32"    != "xyes" && \



More information about the cairo-commit mailing list