diff --git a/configure b/configure index 3052a28..2e91224 100755 --- a/configure +++ b/configure @@ -750,6 +750,8 @@ enable_silent_rules enable_extrawarnings enable_static enable_debug +enable_coverage +enable_profiling enable_dependency_tracking enable_commoncrypto enable_iconv @@ -1395,6 +1397,8 @@ Optional Features: —-disable-extrawarnings do not compile with -Wextra warnings enabled --enable-static compile static binaries --enable-debug compile with debuging enabled + --enable-coverage enable code coverage + --enable-profiling enable profiling --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking @@ -3497,6 +3501,30 @@ $as_echo "#define NDEBUG 1" >>confdefs.h fi +# Check whether --enable-coverage was given. +if test "${enable_coverage+set}" = set; then : + enableval=$enable_coverage; +fi + +if test "x$enable_coverage" = xyes +then + CFLAGS="${CFLAGS} --coverage" + CXXFLAGS="${CXXFLAGS} --coverage" + LDFLAGS="${LDFLAGS} --coverage" +fi + +# Check whether --enable-profiling was given. +if test "${enable_profiling+set}" = set; then : + enableval=$enable_profiling; +fi + +if test "x$enable_profiling" = xyes +then + CFLAGS="${CFLAGS} -pg" + CXXFLAGS="${CXXFLAGS} -pg" + LDFLAGS="${LDFLAGS} -pg" +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/configure.ac b/configure.ac index f5a55ca..8c0d96a 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,22 @@ else AC_DEFINE(NDEBUG, 1, [Compile without debug code]) fi +AC_ARG_ENABLE(coverage, [ --enable-coverage enable code coverage]) +if test "x$enable_coverage" = xyes +then + CFLAGS="${CFLAGS} --coverage" + CXXFLAGS="${CXXFLAGS} --coverage" + LDFLAGS="${LDFLAGS} --coverage" +fi + +AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling]) +if test "x$enable_profiling" = xyes +then + CFLAGS="${CFLAGS} -pg" + CXXFLAGS="${CXXFLAGS} -pg" + LDFLAGS="${LDFLAGS} -pg" +fi + dnl ################### dnl Checks for programs dnl ###################