From: Frantisek Sumsal Date: Tue, 20 Jun 2023 21:00:28 +0000 (+0200) Subject: ci: hide coverage-related stuff begind --enable-coverage X-Git-Tag: v2.40-rc1~374^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b4b8f8c293507cbe86dbe55c9c955e511279d673;p=thirdparty%2Futil-linux.git ci: hide coverage-related stuff begind --enable-coverage --- diff --git a/.github/workflows/cibuild.sh b/.github/workflows/cibuild.sh index 8adac1ab68..6bb10862f4 100755 --- a/.github/workflows/cibuild.sh +++ b/.github/workflows/cibuild.sh @@ -87,9 +87,7 @@ for phase in "${PHASES[@]}"; do ) if [[ "$COVERAGE" == "yes" ]]; then - CFLAGS+=(--coverage) - CXXFLAGS+=(--coverage) - LDFLAGS+=(--coverage) + opts+=(--enable-coverage) fi if [[ "$SANITIZE" == "yes" ]]; then diff --git a/Makefile.am b/Makefile.am index effbb02fc2..e52a7f592d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,7 @@ endif AM_CFLAGS = -fsigned-char $(WARN_CFLAGS) AM_CXXFLAGS = $(AM_CFLAGS) -AM_LDFLAGS = $(ASAN_LDFLAGS) $(UBSAN_LDFLAGS) $(FUZZING_ENGINE_LDFLAGS) +AM_LDFLAGS = $(ASAN_LDFLAGS) $(UBSAN_LDFLAGS) $(FUZZING_ENGINE_LDFLAGS) $(COVERAGE_LDFLAGS) # Add gettext stuff to the global LDADD for systems with separate libintl # library. The LTLIBINTL is generated by AM_GNU_GETTEXT macro. diff --git a/configure.ac b/configure.ac index 7de254c2d5..8bd10ee69e 100644 --- a/configure.ac +++ b/configure.ac @@ -215,6 +215,17 @@ AC_PROG_CXX AM_CONDITIONAL([FUZZING_ENGINE], [test "x$enable_fuzzing_engine" = xyes]) AM_CONDITIONAL([OSS_FUZZ], [test "x$LIB_FUZZING_ENGINE" != x]) +AC_ARG_ENABLE([coverage], + AS_HELP_STRING([--enable-coverage], [compile with gcov]), + [], [enable_coverage=no] +) +AS_IF([test "x$enable_coverage" = xyes], [ + UL_WARN_ADD([--coverage]) + COVERAGE_LDFLAGS="--coverage" +]) +AC_SUBST([COVERAGE_LDFLAGS]) +AM_CONDITIONAL([WITH_COVERAGE], [test "x$enable_coverage" = xyes]) + dnl libtool-2 LT_INIT @@ -2891,7 +2902,8 @@ AC_MSG_RESULT([ ldflags: ${LDFLAGS} suid ldflags: ${SUID_LDFLAGS} ASAN enabled: ${enable_asan} - Fuzzing enabled: ${enable_fuzzing_engine} + Fuzzing enabled: ${enable_fuzzing_engine} + Coverage enabled ${enable_coverage} cflags: ${CFLAGS}