From 81aff2127f35da2ec667bc60989cac7df7a8ef48 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 21 Jul 2021 11:23:23 +0200 Subject: [PATCH] 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 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ecab39a30f..c86f47d073 100644 --- a/configure.ac +++ b/configure.ac @@ -264,11 +264,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 -- 2.39.5