summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorMikko Koppanen <mkoppanen@php.net>2011-04-02 22:49:41 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-04-02 22:49:41 +0200
commitbdeddb89f727c434ad499da5a349f3959eba3226 (patch)
treef5e331a7380322f40be6f875aa11031be06416fe /acinclude.m4
parent7af18468f8ca0c14975ea12a1e6a549d42b81347 (diff)
Added code coverage checking
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m432
1 files changed, 32 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 1257c9e..f488b00 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -318,6 +318,38 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{
}])
dnl ##############################################################################
+dnl # AC_ZMQ_WITH_GCOV([action-if-found], [action-if-not-found]) #
+dnl # Check whether to build with code coverage #
+dnl ##############################################################################
+AC_DEFUN([AC_ZMQ_WITH_GCOV], [{
+ # Require compiler specifics
+ AC_REQUIRE([AC_ZMQ_CHECK_COMPILERS])
+
+ AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
+ [With GCC Code Coverage reporting.])],
+ [ZMQ_GCOV="$withval"])
+
+ AC_MSG_CHECKING(whether to enable code coverage)
+
+ if test "x$GXX" != "xyes"; then
+ AC_MSG_ERROR([--with-gcov=yes works only with GCC])
+ fi
+
+ CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
+ if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then
+ CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}"
+ fi
+
+ CPPFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
+ if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then
+ CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}"
+ fi
+
+ AS_IF([test "x$ZMQ_GCOV" = "xyes"],
+ [AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2])
+}])
+
+dnl ##############################################################################
dnl # AC_ZMQ_CHECK_WITH_FLAG([flags], [macro]) #
dnl # Runs a normal autoconf check with compiler flags #
dnl ##############################################################################