summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-07-21 11:23:23 +0200
committermergify-bot <noreply@mergify.io>2021-07-23 09:32:52 +0000
commit2faed357057731b92a9a96294db2ada3c96122ff (patch)
tree448e72bb6a1a4aa4dffa4176ea56dcef3dd5325f
parent1e0c986956b431c1d87e96182b2c457d2a636860 (diff)
build: use `--coverage` for gcov
libtool does not understand `-coverage` with a single dash. Official gcc docs also say `--coverage` rather than `-coverage`. (clang lists both.) Also, for correct linking, libtool needs `--coverage` in LDFLAGS as opposed to `-lgcov` (with the latter you get library ordering/deps issues) Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 81aff2127f35da2ec667bc60989cac7df7a8ef48)
-rw-r--r--configure.ac4
1 files changed, 2 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index eae63aa84b..9f9518f6d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -273,11 +273,11 @@ AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"])
dnl if the user has specified any CFLAGS, override our settings
if test "$enable_gcov" = "yes"; then
if test "$orig_cflags" = ""; then
- AC_C_FLAG([-coverage])
+ AC_C_FLAG([--coverage])
AC_C_FLAG([-O0])
fi
- AC_LDFLAGS="${AC_LDFLAGS} -lgcov"
+ AC_LDFLAGS="${AC_LDFLAGS} --coverage"
fi
if test "$enable_clang_coverage" = "yes"; then