diff --git a/third_party/nlbuild-autotools/repo/.default-version b/third_party/nlbuild-autotools/repo/.default-version index 9f05f9f2c..ec70f7556 100644 --- a/third_party/nlbuild-autotools/repo/.default-version +++ b/third_party/nlbuild-autotools/repo/.default-version @@ -1 +1 @@ -1.6.5 +1.6.6 diff --git a/third_party/nlbuild-autotools/repo/CHANGES b/third_party/nlbuild-autotools/repo/CHANGES index 516c8f187..6bd89216f 100644 --- a/third_party/nlbuild-autotools/repo/CHANGES +++ b/third_party/nlbuild-autotools/repo/CHANGES @@ -1,3 +1,9 @@ +1.6.6 (2019-04-09) + + * Added code coverage support for clang, which uses a link flag + --coverage instead of linking to a library(-lgov) as gcc does + for code coverage functions. + 1.6.5 (2018-11-19) * Addressed an issue in which the failure to make the 'repos-warning' diff --git a/third_party/nlbuild-autotools/repo/autoconf/m4/nl_enable_coverage.m4 b/third_party/nlbuild-autotools/repo/autoconf/m4/nl_enable_coverage.m4 index b60c4bb0d..7a62a5359 100644 --- a/third_party/nlbuild-autotools/repo/autoconf/m4/nl_enable_coverage.m4 +++ b/third_party/nlbuild-autotools/repo/autoconf/m4/nl_enable_coverage.m4 @@ -58,7 +58,7 @@ AC_DEFUN([NL_ENABLE_COVERAGE], AC_ARG_ENABLE(coverage, [AS_HELP_STRING([--enable-coverage],[Enable the generation of code-coverage instances @<:@default=$1@:>@.])], [ - case "${enableval}" in + case "${enableval}" in no|yes) nl_cv_build_coverage=${enableval} @@ -78,21 +78,23 @@ AC_DEFUN([NL_ENABLE_COVERAGE], if test "${nl_cv_build_optimized}" = "yes"; then AC_MSG_WARN([--enable-optimization was specified, coverage disabled]) nl_cv_build_coverage=no - + else nl_cv_build_coverage=$1 - + fi ]) - if test "${nl_cv_build_coverage}" = "yes"; then + if test "${nl_cv_build_coverage}" = "yes"; then if test "${GCC}" != "yes"; then AC_MSG_ERROR([GCC or a GCC-compatible toolchain is required for --enable-coverage]) - else NL_COVERAGE_CPPFLAGS="--coverage" - NL_COVERAGE_LIBS="-lgcov" - + if ${CC} --version | grep -q clang; then + NL_COVERAGE_LDFLAGS="--coverage" + else + NL_COVERAGE_LIBS="-lgcov" + fi fi fi ]) diff --git a/third_party/nlbuild-autotools/repo/examples/configure.ac b/third_party/nlbuild-autotools/repo/examples/configure.ac index 02bc83d96..4de427008 100644 --- a/third_party/nlbuild-autotools/repo/examples/configure.ac +++ b/third_party/nlbuild-autotools/repo/examples/configure.ac @@ -292,14 +292,14 @@ AC_PATH_PROG([PKG_CONFIG],[pkg-config]) # # configured nor built, so the normal checks we undertake for an # # external package cannot be run here. Simply set the appropriate # # variables and trust all will be well. -# +# # NLUNIT_TEST_CPPFLAGS="-I\${abs_top_srcdir}/third_party/nlunit-test/repo/src" # NLUNIT_TEST_LDFLAGS="-L${ac_pwd}/third_party/nlunit-test/repo/src" # NLUNIT_TEST_LIBS="-lnlunit-test" # ], # [ # # Check for required nlunit-test headers. -# +# # AC_CHECK_HEADERS([nlunit-test.h], # [], # [ @@ -312,7 +312,7 @@ AC_PATH_PROG([PKG_CONFIG],[pkg-config]) # # location, its directory stem within this package needs to be set # # accordingly. In addition, if the location is internal, then we need # # to attempt to pull it down using the bootstrap makefile. -# +# # if test "${nl_with_nlunit_test}" = "internal"; then # maybe_nlunit_test_dirstem="nlunit-test/repo" # nlunit_test_dirstem="third_party/${maybe_nlunit_test_dirstem}" @@ -364,7 +364,7 @@ fi # this, as needed. # # Add any nlunit-test CPPFLAGS, LDFLAGS, and LIBS -# +# # CPPFLAGS="${CPPFLAGS} ${NLUNIT_TEST_CPPFLAGS}" # LDFLAGS="${LDFLAGS} ${NLUNIT_TEST_LDFLAGS}" # LIBS="${LIBS} ${NLUNIT_TEST_LIBS}" @@ -373,6 +373,7 @@ fi CPPFLAGS="${CPPFLAGS} ${NL_COVERAGE_CPPFLAGS}" LIBS="${LIBS} ${NL_COVERAGE_LIBS}" +LDFLAGS="${LDFLAGS} ${NL_COVERAGE_LDFLAGS}" # At this point, we can restore the compiler flags to whatever the # user passed in, now that we're clear of any -Werror issues by