]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ci: hide coverage-related stuff begind --enable-coverage
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 20 Jun 2023 21:00:28 +0000 (23:00 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 22 Jun 2023 10:03:04 +0000 (12:03 +0200)
.github/workflows/cibuild.sh
Makefile.am
configure.ac

index 8adac1ab68ed6d2e98e72367d29243c29f150472..6bb10862f4b95a0744be3000c7ea6e667fda9125 100755 (executable)
@@ -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
index effbb02fc2b79d7981d2511786ad29612ea15d2b..e52a7f592d7155bce777019d3def3705a26454b2 100644 (file)
@@ -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.
index 7de254c2d531f07bd706f0d6e33de8e3e44ba0eb..8bd10ee69e01d8cbb64f74800c9d7d680cba87a3 100644 (file)
@@ -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}