[cairo-commit] boilerplate/Makefile.am configure.in Makefile.am pixman/src src/Makefile.am test/Makefile.am

Chris Wilson ickle at kemper.freedesktop.org
Wed Apr 4 02:13:42 PDT 2007


 Makefile.am             |   13 ++++++++++++-
 boilerplate/Makefile.am |    2 +-
 configure.in            |   14 ++++++++++++--
 pixman/src/Makefile.am  |    5 ++++-
 src/Makefile.am         |    2 +-
 test/Makefile.am        |    5 +++--
 6 files changed, 33 insertions(+), 8 deletions(-)

New commits:
diff-tree 5c24711ee65cdb8ac0fdb7419e6466e2b7cb7d9e (from 59e5189818321c8a62ad107548facbcfce9e517a)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Apr 4 10:13:13 2007 +0100

    Restore gcov functionality
    
    Add -lgcov to the shared library else the test programs fail to link.
    Add a couple of lcov convenience targets to generate the coverage reports.

diff --git a/Makefile.am b/Makefile.am
index 37693cf..23166ea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,6 +21,17 @@ check-valgrind: all
 	cd test && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
 perf: all
 	cd perf && $(MAKE) $(AM_MAKEFLAGS) perf
+lcov: check
+	$(LTP) --directory $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_TEST --no-checksum
+	LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-test-lcov --title "Cairo Test Code Coverage" --show-details cairo-test-lcov.info
+lcov-perf: perf
+	$(LTP) --directory $(top_builddir) --capture --output-file cairo-perf-lcov.info --test-name CAIRO_PERF --no-checksum
+	LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-perf-lcov --title "Cairo Perf Code Coverage" --show-details cairo-perf-lcov.info
+lcov-clean:
+	$(LTP) --directory $(top_builddir) --reset
+	$(RM) -rf \
+	    cairo-test-lcov.info cairo-test-lcov \
+	    cairo-perf-lcov.info cairo-perf-lcov
 
 EXTRA_DIST = \
 	AUTHORS \
@@ -195,4 +206,4 @@ doc-publish: doc
 	scp $(MANUAL_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
 	ssh $(RELEASE_UPLOAD_HOST) "cd $(MANUAL_UPLOAD_DIR) && tar xzf $(MANUAL_TAR_FILE) && rm -f manual && ln -s $(MANUAL_DATED) manual && ln -sf $(MANUAL_TAR_FILE) cairo-manual.tar.gz"
 
-.PHONY: release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky release-check release-upload release-publish docs-publish
+.PHONY: release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky release-check release-upload release-publish docs-publish lcov lcov-perf lcov-clean
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 4cd6bf1..40afea4 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -6,7 +6,7 @@ cairo-quartz-boilerplate.c	\
 cairo-boilerplate.h	\
 xmalloc.c		\
 xmalloc.h
-libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la
+libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la $(CAIRO_LDADD)
 
 if CAIRO_HAS_BEOS_SURFACE
 libcairoboilerplate_la_SOURCES += cairo-test-beos.cpp cairo-test-beos.h
diff --git a/configure.in b/configure.in
index d0d84d2..e625fc5 100644
--- a/configure.in
+++ b/configure.in
@@ -221,9 +221,11 @@ CAIRO_FEATURES=""
 CAIRO_REQUIRES=""
 CAIRO_NONPKGCONFIG_CFLAGS=""
 CAIRO_NONPKGCONFIG_LIBS="$LIBM"
+CAIRO_LDADD=""
 CAIRO_CFLAGS=$CAIRO_NONPKGCONFIG_CFLAGS
 CAIRO_LIBS=$CAIRO_NONPKGCONFIG_LIBS
 PIXMAN_CFLAGS=""
+PIXMAN_LDADD=""
 
 dnl ===========================================================================
 
@@ -663,8 +665,10 @@ AC_SUBST(CAIRO_REQUIRES)
 AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)
 AC_SUBST(CAIRO_NONPKGCONFIG_LIBS)
 AC_SUBST(CAIRO_CFLAGS)
+AC_SUBST(CAIRO_LDADD)
 AC_SUBST(CAIRO_LIBS)
 AC_SUBST(PIXMAN_CFLAGS)
+AC_SUBST(PIXMAN_LDADD)
 
 dnl ===========================================================================
 dnl Check for gtk-doc and docbook
@@ -727,7 +731,8 @@ if test "x$use_gcov" = "xyes"; then
   fi
 
   dnl Check if ccache is being used
-  case `shtool path $CC` in
+  AC_CHECK_PROG(SHTOOL, shtool, shtool)
+  case `$SHTOOL path $CC` in
     *ccache*[)] gcc_ccache=yes;;
     *[)] gcc_ccache=no;;
   esac
@@ -736,7 +741,7 @@ if test "x$use_gcov" = "xyes"; 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"
+  ltp_version_list="1.4 1.5"
   AC_CHECK_PROG(LTP, lcov, lcov)
   AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
 
@@ -772,11 +777,16 @@ dnl  PHP_ADD_MAKEFILE_FRAGMENT($abs_srcd
 
   dnl Remove all optimization flags from CFLAGS
   changequote({,})
+  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
   CAIRO_CFLAGS=`echo "$CAIRO_CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  PIXMAN_CFLAGS=`echo "$PIXMAN_CFLAGS" | $SED -e 's/-O[0-9]*//g'`
   changequote([,])
 
   dnl Add the special gcc flags
   CAIRO_CFLAGS="$CAIRO_CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  CAIRO_LDADD="$CAIRO_LDADD -lgcov"
+  PIXMAN_CFLAGS="$PIXMAN_CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  PIXMAN_LDADD="$PIXMAN_LDADD -lgcov"
 fi
 
 dnl ===========================================================================
diff --git a/pixman/src/Makefile.am b/pixman/src/Makefile.am
index 7b0f0f6..afe097e 100644
--- a/pixman/src/Makefile.am
+++ b/pixman/src/Makefile.am
@@ -29,6 +29,8 @@ libpixman_la_SOURCES = \
 	fbcompose.c \
 	renderedge.c \
 	renderedge.h
+libpixman_la_CFLAGS = $(PIXMAN_CFLAGS)
+libpixman_la_LIBADD = $(PIXMAN_LDADD)
 
 if USE_MMX
 noinst_LTLIBRARIES += libpixman-mmx.la
@@ -36,7 +38,8 @@ libpixman_mmx_la_SOURCES = \
 	fbmmx.c		\
 	fbmmx.h
 libpixman_mmx_la_CFLAGS = $(PIXMAN_CFLAGS)
-libpixman_la_LIBADD = libpixman-mmx.la
+libpixman_mmx_la_LIBADD = $(PIXMAN_LDADD)
+libpixman_la_LIBADD += libpixman-mmx.la
 endif
 
 TESTS = check-config.sh
diff --git a/src/Makefile.am b/src/Makefile.am
index 66200a7..c936984 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -244,7 +244,7 @@ libcairo_la_LDFLAGS = -version-info @VER
 
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/pixman/src $(CAIRO_CFLAGS)
 
-libcairo_la_LIBADD = $(top_builddir)/pixman/src/libpixman.la $(CAIRO_LIBS) $(noinst_LTLIBRARIES)
+libcairo_la_LIBADD = $(top_builddir)/pixman/src/libpixman.la $(CAIRO_LIBS) $(noinst_LTLIBRARIES) $(CAIRO_LDADD)
 
 libcairo_la_DEPENDENCIES = $(cairo_def_dependency) $(top_builddir)/pixman/src/libpixman.la $(noinst_LTLIBRARIES)
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 3c590ce..e40aaf3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -455,9 +455,10 @@ libcairotest_la_SOURCES =\
 libcairotest_la_LIBADD =\
 	$(top_builddir)/test/pdiff/libpdiff.la \
         $(top_builddir)/boilerplate/libcairoboilerplate.la \
-	$(top_builddir)/src/libcairo.la
+	$(top_builddir)/src/libcairo.la \
+	$(CAIRO_LDADD)
 
-LDADD = libcairotest.la
+LDADD = $(CAIRO_LDADD) libcairotest.la
 
 $(top_builddir)/boilerplate/libcairoboilerplate.la:
 	cd $(top_builddir)/boilerplate && $(MAKE) $(AM_MAKEFLAGS) libcairoboilerplate.la


More information about the cairo-commit mailing list