aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorVollstrecker <werner@vollstreckernet.de>2024-12-25 12:52:53 +0100
committerMark Adler <madler@alumni.caltech.edu>2025-01-31 19:59:10 -0800
commit44919160dee8de9f6bf03e1af0162be988dcd493 (patch)
tree1b92812c72fc427335b884ae99190b233e8ada65 /configure
parent9ddf1b4bc56d0183c4a41868ecc8515f5fc2d897 (diff)
downloadzlib-44919160dee8de9f6bf03e1af0162be988dcd493.tar.gz
zlib-44919160dee8de9f6bf03e1af0162be988dcd493.tar.bz2
zlib-44919160dee8de9f6bf03e1af0162be988dcd493.zip
Adjust coverage testing to the llvm gcov calling convention.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure29
1 files changed, 24 insertions, 5 deletions
diff --git a/configure b/configure
index 54c802e..dcf1a08 100755
--- a/configure
+++ b/configure
@@ -87,6 +87,7 @@ zprefix=0
87zconst=0 87zconst=0
88build64=0 88build64=0
89gcc=0 89gcc=0
90clang=0
90warn=0 91warn=0
91debug=0 92debug=0
92address=0 93address=0
@@ -185,14 +186,31 @@ else
185fi 186fi
186 187
187case "$cc" in 188case "$cc" in
188 *gcc*) gcc=1 ;; 189 *gcc*) gcc=1
189 *clang*) gcc=1 ;; 190 GCOV="gcov" ;;
191 *clang*) gcc=1
192 clang=1 ;;
190esac 193esac
191case `$cc -v 2>&1` in 194case `$cc -v 2>&1` in
192 *gcc*) gcc=1 ;; 195 *gcc*) gcc=1
193 *clang*) gcc=1 ;; 196 GCOV="gcov" ;;
197 *clang*) gcc=1
198 clang=1 ;;
194esac 199esac
195 200
201if test "$clang" -eq 1; then
202 clangV=`echo "$cc" | sed -e 's/^.*-//'`
203 if `llvm-cov-${clangV} --version > /dev/null`; then
204 GCOV="llvm-cov-${clangV}"
205 LLVM_GCOV_FLAG="gcov"
206 echo "Using ${GCOV} for coverage"
207 else
208 cover=0
209 LLVM_GCOV_FLAG=""
210 echo "Deactivating cover as no suitable gcov can be found"
211 fi
212fi
213
196show $cc -c $test.c 214show $cc -c $test.c
197if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then 215if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
198 echo ... using gcc >> configure.log 216 echo ... using gcc >> configure.log
@@ -620,7 +638,6 @@ fi
620 638
621# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X 639# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
622if test $cover -eq 1; then 640if test $cover -eq 1; then
623 CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
624 if test -n "$GCC_CLASSIC"; then 641 if test -n "$GCC_CLASSIC"; then
625 CC=$GCC_CLASSIC 642 CC=$GCC_CLASSIC
626 fi 643 fi
@@ -872,6 +889,8 @@ echo uname = $uname >> configure.log
872# update Makefile with the configure results 889# update Makefile with the configure results
873sed < ${SRCDIR}Makefile.in " 890sed < ${SRCDIR}Makefile.in "
874/^CC *=/s#=.*#=$CC# 891/^CC *=/s#=.*#=$CC#
892/^GCOV *=/s#=.*#=$GCOV#
893/^LLVM_GCOV_FLAG *=/s#=.*#=$LLVM_GCOV_FLAG#
875/^CFLAGS *=/s#=.*#=$CFLAGS# 894/^CFLAGS *=/s#=.*#=$CFLAGS#
876/^SFLAGS *=/s#=.*#=$SFLAGS# 895/^SFLAGS *=/s#=.*#=$SFLAGS#
877/^LDFLAGS *=/s#=.*#=$LDFLAGS# 896/^LDFLAGS *=/s#=.*#=$LDFLAGS#