aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/edje/m4/efl_coverage.m4
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/edje/m4/efl_coverage.m4')
-rw-r--r--libraries/edje/m4/efl_coverage.m462
1 files changed, 62 insertions, 0 deletions
diff --git a/libraries/edje/m4/efl_coverage.m4 b/libraries/edje/m4/efl_coverage.m4
new file mode 100644
index 0000000..85d0321
--- /dev/null
+++ b/libraries/edje/m4/efl_coverage.m4
@@ -0,0 +1,62 @@
1dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if coverage support is wanted and, if yes, if
5dnl lcov is available.
6
7dnl Usage: EFL_CHECK_COVERAGE(tests [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
8dnl The parameter 'tests' is used if a dependency is needed. If set to "yes",
9dnl the dependency is available.
10dnl Defines EFL_COVERAGE_CFLAGS and EFL_COVERAGE_LIBS variables
11dnl Defines the automake conditionnal EFL_ENABLE_COVERAGE
12
13AC_DEFUN([EFL_CHECK_COVERAGE],
14[
15
16dnl configure option
17
18AC_ARG_ENABLE([coverage],
19 [AC_HELP_STRING([--enable-coverage], [enable coverage profiling instrumentation @<:@default=disabled@:>@])],
20 [
21 if test "x${enableval}" = "xyes" ; then
22 _efl_enable_coverage="yes"
23 else
24 _efl_enable_coverage="no"
25 fi
26 ],
27 [_efl_enable_coverage="no"])
28
29AC_MSG_CHECKING([whether to use profiling instrumentation])
30AC_MSG_RESULT([$_efl_enable_coverage])
31
32dnl lcov check
33
34if test "x$_efl_enable_coverage" = "xyes" && test ! "x$1" = "xyes" ; then
35 AC_MSG_WARN([Coverage report requested but tests not being built, disable profiling instrumentation.])
36 AC_MSG_WARN([Run configure with --enable-tests])
37 _efl_enable_coverage="no"
38fi
39
40if test "x$_efl_enable_coverage" = "xyes" ; then
41 AC_CHECK_PROG(have_lcov, [lcov], [yes], [no])
42 if test "x$have_lcov" = "xyes" ; then
43 EFL_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
44 EFL_COVERAGE_LIBS="-lgcov"
45# remove any optimisation flag and force debug symbols
46 EFL_DEBUG_CFLAGS="-g -O0 -DDEBUG"
47 else
48 AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
49 _efl_enable_coverage="no"
50 fi
51fi
52
53dnl Substitution
54AC_SUBST(EFL_COVERAGE_CFLAGS)
55AC_SUBST(EFL_COVERAGE_LIBS)
56
57AM_CONDITIONAL(EFL_ENABLE_COVERAGE, test "x${_efl_enable_coverage}" = "xyes")
58
59AS_IF([test "x$_efl_enable_coverage" = "xyes"], [$2], [$3])
60])
61
62dnl End of efl_coverage.m4