summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-12-23 16:56:17 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2012-12-23 16:56:17 +0100
commitff9bf8f8e2872c1882f8c5a325be3252c9ba7a22 (patch)
tree2aa5c8d4f5c06ab8ec2507003fd47ba4a626d0e6
parent527f92ebfc9dfb3d5a4bad744071004d478fa71e (diff)
Add "configure --enable-coverage=yes" option
-rw-r--r--configure.ac28
1 files changed, 27 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index f66b44b..4aadae1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@
AC_PREREQ([2.59])
AC_INIT([testdisk],[6.14-WIP],[grenier@cgsecurity.org])
sinclude(acx_pthread.m4)
-TESTDISKDATE="May 2012"
+TESTDISKDATE="December 2012"
AC_SUBST(TESTDISKDATE)
AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release])
AC_CONFIG_AUX_DIR(config)
@@ -230,6 +230,31 @@ AC_ARG_ENABLE([dfxml],
esac],
[AC_DEFINE([ENABLE_DFXML],1,[Define to 1 if DFXML log is enabled])])
+# Enable code coverage collection
+AC_ARG_ENABLE(coverage,
+[ --enable-coverage[=LEVEL]
+ enable compiler's code coverage collection.
+ Use to measure compiler performance and locate
+ unused parts of the compiler. With LEVEL, specify
+ optimization. Values are opt, noopt,
+ default is noopt],
+[case "${enableval}" in
+ yes|noopt)
+ coverage_flags="--coverage -frandom-seed=\$@ -O0"
+ ;;
+ opt)
+ coverage_flags="--coverage -frandom-seed=\$@ -O2"
+ ;;
+ no)
+ # a.k.a. --disable-coverage
+ coverage_flags=""
+ ;;
+ *)
+ AC_MSG_ERROR(unknown coverage setting $enableval)
+ ;;
+esac],
+[coverage_flags=""])
+
use_icon=no
case "$target" in
@@ -792,6 +817,7 @@ ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
CFLAGS="$SAVE_CFLAGS"
photorecf_LDADD=$photorec_LDADD
+CFLAGS="$CFLAGS $coverage_flags"
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)