diff options
author | Sam Spilsbury <smspillaz@gmail.com> | 2015-01-15 11:35:25 +0800 |
---|---|---|
committer | Philip Chimento <philip@endlessm.com> | 2015-01-16 17:27:38 -0800 |
commit | ae54d000adbd68a32afd56b996a1f793dff32b59 (patch) | |
tree | ff2bdff9a5c513ef6dd4202dc102ac6e9bb7cbde /m4/eos-coverage.m4 | |
parent | 43f55eee25b048acf84bf8797ee3cee7a0700c44 (diff) |
m4: Don't use as-compiler-flag in eos-coverage.m4
We ship this module and the dependency is a burden on
clients of the coverage module.
[endlessm/eos-shell#2264]
Diffstat (limited to 'm4/eos-coverage.m4')
-rw-r--r-- | m4/eos-coverage.m4 | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/m4/eos-coverage.m4 b/m4/eos-coverage.m4 index e179dc2..6bd605f 100644 --- a/m4/eos-coverage.m4 +++ b/m4/eos-coverage.m4 @@ -68,20 +68,25 @@ AC_DEFUN_ONCE([EOS_COVERAGE_REPORT], [ # Turn on the coverage generating flags in GCC. This # does not work with clang # (see llvm.org/bugs/show_bug.cgi?id=16568). - EOS_COVERAGE_COMPILER_FLAGS="-coverage" - EOS_COVERAGE_NODEBUG_COMPILER_FLAGS="-g -O0" + EOS_COVERAGE_COMPILER_FLAGS="-coverage -g -O0" EOS_C_COVERAGE_LDFLAGS="-lgcov" - AS_COMPILER_FLAGS([EOS_SUPPORTED_COVERAGE_CFLAGS], [$EOS_COVERAGE_COMPILER_FLAGS]) + EOS_COVERAGE_CFLAGS_SUPPORTED=no + + LAST_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $EOS_COVERAGE_COMPILER_FLAGS" + AC_MSG_CHECKING(if compiler supports $EOS_COVERAGE_COMPILER_FLAGS) + AC_TRY_COMPILE([], [], [EOS_COVERAGE_CFLAGS_SUPPORTED=yes]) + CFLAGS="$LAST_CFLAGS" + AC_MSG_RESULT($EOS_COVERAGE_CFLAGS_SUPPORTED) # If this is empty then coverage reporting is not # supported by the compiler. - AS_IF([test x"$EOS_SUPPORTED_COVERAGE_CFLAGS" != "x"], [ + AS_IF([test x"$EOS_COVERAGE_CFLAGS_SUPPORTED" = "xyes"], [ EOS_HAVE_C_COVERAGE=yes # These flags aren't mandatory, but they make # coverage reports more accurate - AS_COMPILER_FLAGS([EOS_SUPPORTED_NODEBUG_CFLAGS], [$EOS_COVERAGE_NODEBUG_COMPILER_FLAGS]) - EOS_C_COVERAGE_CFLAGS="$EOS_SUPPORTED_COVERAGE_CFLAGS $EOS_SUPPORTED_NODEBUG_CFLAGS" + EOS_C_COVERAGE_CFLAGS="$EOS_COVERAGE_COMPILER_FLAGS" ]) ], [js], [ |