diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-01-16 22:25:59 +0100 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-01-16 22:26:22 +0100 |
commit | b4fd9ea7f06db63c22ead534badf15784e6c5305 (patch) | |
tree | 754df49ce4dee8819ea35a7d8101aff63408e13b /configure.ac | |
parent | Merge pull request #5608 from dslicenc/frr-reload-deletes (diff) | |
download | frr-b4fd9ea7f06db63c22ead534badf15784e6c5305.tar.xz frr-b4fd9ea7f06db63c22ead534badf15784e6c5305.zip |
configure.ac: add --enable-clang-coverage
Like gcov but better!
Also has a driveby fix for --enable-dev-build being mutually exclusive
with --enable-gcov...
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'configure.ac')
-rwxr-xr-x | configure.ac | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 0057d627b..4158fdec3 100755 --- a/configure.ac +++ b/configure.ac @@ -249,7 +249,18 @@ if test "x${enable_gcov}" = "xyes"; then fi LDFLAGS="${LDFLAGS} -lgcov" -elif test "x${enable_dev_build}" = "xyes"; then +fi + +if test "x${enable_clang_coverage}" = "xyes"; then + AC_C_FLAG([-fprofile-instr-generate], [ + AC_MSG_ERROR([$CC does not support -fprofile-instr-generate.]) + ]) + AC_C_FLAG([-fcoverage-mapping], [ + AC_MSG_ERROR([$CC does not support -fcoverage-mapping.]) + ]) +fi + +if test "x${enable_dev_build}" = "xyes"; then AC_DEFINE([DEV_BUILD], [1], [Build for development]) if test "z$orig_cflags" = "z"; then AC_C_FLAG([-g3]) @@ -574,7 +585,9 @@ AC_ARG_ENABLE([clippy-only], AC_ARG_ENABLE([numeric_version], AS_HELP_STRING([--enable-numeric-version], [Only numeric digits allowed in version (for Alpine)])) AC_ARG_ENABLE([gcov], - AS_HELP_STRING([--enable-gcov], [Add code coverage information])) + AS_HELP_STRING([--enable-gcov], [Collect coverage information with gcov])) +AC_ARG_ENABLE([clang_coverage], + AS_HELP_STRING([--enable-clang-coverage], [Collect coverage information with Clang Coverage])) AC_ARG_ENABLE([bfdd], AS_HELP_STRING([--disable-bfdd], [do not build bfdd])) AC_ARG_ENABLE([address-sanitizer], |