From: Sebastian Harl Date: Sat, 21 Dec 2013 20:55:21 +0000 (+0100) Subject: configure: Do stricter GCC checking. X-Git-Tag: sysdb-0.1.0~290 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=7dc71a66ca212863e6f748edf1eced45436577c1 configure: Do stricter GCC checking. $GCC might be true for clang as well but clang does not support gcov coverage testing. --- diff --git a/configure.ac b/configure.ac index d927b60..4977fb5 100644 --- a/configure.ac +++ b/configure.ac @@ -191,9 +191,21 @@ AC_ARG_ENABLE([gcov], [enable_gcov="$enableval"], [enable_gcov="no"]) +dnl $GCC is based on some heuristics which might apply to clang as well. +dnl However, clang does not support gcov. +cc_is_gcc="no" +case "x$CC" in + gcc) + cc_is_gcc="yes" + ;; + gcc-*) + cc_is_gcc="yes" + ;; +esac + COVERAGE_CFLAGS="" COVERAGE_LDFLAGS="" -if test "x$enable_gcov" = "xyes" && test "x$GCC" == "xyes"; then +if test "x$enable_gcov" = "xyes" && test "x$GCC$cc_is_gcc" == "xyesyes"; then COVERAGE_CFLAGS="-O0" cov_flag_have_problem="no"