From: Ivan Maidanski Date: Fri, 13 Jan 2017 17:47:35 +0000 (+0300) Subject: Add configure --enable-gcov option (enable code coverage analysis) X-Git-Tag: v7.6.0~137 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d0a16d395b158a00524ab84cccba9065e645c48;p=platform%2Fupstream%2Flibatomic_ops.git Add configure --enable-gcov option (enable code coverage analysis) * configure.ac (gcov): New --enable-* option. * configure.ac [enable_gcov] (CFLAGS): Add "--coverage" option; filter out "-O" options. --- diff --git a/configure.ac b/configure.ac index 28e10c0..0a723a4 100644 --- a/configure.ac +++ b/configure.ac @@ -110,6 +110,14 @@ if test "$enable_atomic_intrinsics" = no; then [Define to avoid C11 atomic intrinsics even if available.]) fi +AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov], + [Turn on code coverage analysis])) +if test "$enable_gcov" = "yes"; then + CFLAGS="$CFLAGS --coverage" + # Turn off code optimization to get accurate line numbers. + CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'` +fi + AC_SUBST(PICFLAG) AC_SUBST(DEFS)