From 9b9b31b32952fa1445f52e6333392f6c2fdbca01 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 22 Jul 2019 21:30:14 +0200 Subject: [PATCH] Ship code coverage autoconf macros in dist tarball This will enable code coverage for releases as well (install autoconf-archive into the release tarball build environment for that), and avoids incompatibilities between the version installed on the target system and release build system. Provide a dummy fallback for the Alpine and CentOS CI containers. Fixes #91 --- autogen.sh | 6 ++++++ configure.ac | 10 +--------- tests/run-ubuntu-chroot | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/autogen.sh b/autogen.sh index ff3d65f7..18ddcd01 100755 --- a/autogen.sh +++ b/autogen.sh @@ -27,6 +27,12 @@ else echo 'EXTRA_DIST =' > docs/gtk-doc.make fi +ax_coverage="$(aclocal --print)/ax_code_coverage.m4" +if ! cp --verbose "$ax_coverage" m4; then + echo "ax_code_coverage.m4 (from autoconf-archive) not available, using dummy" + echo 'AC_DEFUN([AX_CODE_COVERAGE],[[CODE_COVERAGE_RULES=''] AC_SUBST([CODE_COVERAGE_RULES])])' > m4/ax_code_coverage.m4 +fi + if type lcov >/dev/null 2>&1; then args="$args --enable-code-coverage" else diff --git a/configure.ac b/configure.ac index f2304640..97cf8c5c 100644 --- a/configure.ac +++ b/configure.ac @@ -84,15 +84,7 @@ AC_CHECK_PROGS(VALAC, [valac]) AM_PROG_VALAC([0.16.1]) # code coverage support -AC_MSG_CHECKING(for GNOME code coverage support) -m4_ifdef([AX_CODE_COVERAGE], - [AC_MSG_RESULT(yes) - AX_CODE_COVERAGE], - [AC_MSG_RESULT(no) - CODE_COVERAGE_RULES='' - AC_SUBST([CODE_COVERAGE_RULES]) - enable_code_coverage="no"]) - +AX_CODE_COVERAGE CPPFLAGS="$CPPFLAGS $CODE_COVERAGE_CPPFLAGS" CFLAGS="$CFLAGS $CODE_COVERAGE_CFLAGS" LDFLAGS="$LDFLAGS $CODE_COVERAGE_LIBS" diff --git a/tests/run-ubuntu-chroot b/tests/run-ubuntu-chroot index b55fbc62..d4eac7a7 100755 --- a/tests/run-ubuntu-chroot +++ b/tests/run-ubuntu-chroot @@ -49,7 +49,7 @@ if [ -n "${PROPOSED:-}" ]; then fi apt-get update $UPGRADE -apt-get install -y pkg-config dh-autoreconf valac libglib2.0-dev libudev-dev libgudev-1.0-dev python3-gi gobject-introspection libgirepository1.0-dev gir1.2-glib-2.0 gir1.2-gudev-1.0 gtk-doc-tools udev xserver-xorg-video-dummy xserver-xorg-input-evdev xserver-xorg-input-synaptics xinput usbutils gphoto2 valgrind +apt-get install -y pkg-config dh-autoreconf autoconf-archive valac libglib2.0-dev libudev-dev libgudev-1.0-dev python3-gi gobject-introspection libgirepository1.0-dev gir1.2-glib-2.0 gir1.2-gudev-1.0 gtk-doc-tools udev xserver-xorg-video-dummy xserver-xorg-input-evdev xserver-xorg-input-synaptics xinput usbutils gphoto2 valgrind # run build and tests as user chown -R buildd:buildd /build