1
0
mirror of https://github.com/madler/zlib synced 2025-03-28 21:13:15 +00:00

Disable make cover if no gcov was found.

This commit is contained in:
Vollstrecker 2024-12-25 18:52:44 +01:00 committed by Mark Adler
parent 039c3610e5
commit e677f1f1c7
2 changed files with 12 additions and 6 deletions

View File

@ -121,9 +121,13 @@ infcover: infcover.o libz.a
$(CC) $(CFLAGS) -coverage -o $@ infcover.o libz.a
cover: infcover
ifdef $(GCOV)
rm -f *.gcda
${QEMU_RUN} ./infcover
${GCOV} ${LLVM_GCOV_FLAG} inf*.c -o ./infcover.gcda
else
@echo 'cover disabled as no suitable gcov was found'
endif
libz.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)

14
configure vendored
View File

@ -200,25 +200,27 @@ esac
if test "$clang" -eq 1; then
if test "$cc" = "clang"; then
if `llvm-cov --version > /dev/null`; then
GCOV="llvm-cov-${clangV}"
if which -s llvm-cov; then
GCOV="llvm-cov"
LLVM_GCOV_FLAG="gcov"
GCOV="llvm-cov"
LLVM_GCOV_FLAG="gcov"
echo "Using ${GCOV} for coverage"
else
cover=0
GCOV=""
LLVM_GCOV_FLAG=""
echo "Deactivating cover as no suitable gcov can be found"
fi
GCOV="llvm-cov"
LLVM_GCOV_FLAG="gcov"
echo "Using ${GCOV} for coverage"
else
clangV=`echo "$cc" | sed -e 's/^.*-//'`
if `llvm-cov-${clangV} --version > /dev/null`; then
if which -s llvm-cov-${clangV}; then
GCOV="llvm-cov-${clangV}"
LLVM_GCOV_FLAG="gcov"
echo "Using ${GCOV} for coverage"
else
cover=0
GCOV=""
LLVM_GCOV_FLAG=""
echo "Deactivating cover as no suitable gcov can be found"
fi