diff --git a/configure.ac b/configure.ac index 85c17586..99660a03 100644 --- a/configure.ac +++ b/configure.ac @@ -560,7 +560,7 @@ AC_SUBST([DOLLAR_SIGN],[$]) # __tests__ AC_ARG_ENABLE([tests], [AS_HELP_STRING([--enable-tests], - [Enable building the binary testsuite [default=no]])], + [Enable building the binary testsuite. Requires --enable-static [default=no]])], [build_tests="$enableval"], [build_tests="no"]) @@ -573,6 +573,10 @@ if test "x$build_tests" = "xyes"; then AC_MSG_WARN([==> You want to build the testing binary but the pkg-config file cunit.pc could not be found or installed CUnit version is too old!]) AC_MSG_ERROR([==> Install the package(s) that contains the development files for CUnit or disable the testing binary using '--disable-tests'.]) ]) + if test "x$enable_static" = "xno"; then + enable_static=yes + AC_MSG_WARN([--enable-tests requires --enable-static which is now enabled.]) + fi fi AM_CONDITIONAL(HAVE_CUNIT, [test "x$CUNIT_LIBS" != "x"]) diff --git a/tests/Makefile.am b/tests/Makefile.am index d47be10e..37ea0c1a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,7 +26,9 @@ testdriver_SOURCES = \ test_wellknown.c \ test_tls.c -testdriver_LDADD = $(CUNIT_LIBS) $(DTLS_LIBS) $(top_builddir)/.libs/libcoap-$(LIBCOAP_NAME_SUFFIX).la +# The .a file is uses instead of .la so that testdriver can always access the +# internal functions that are not globaly exposed in a .so file. +testdriver_LDADD = $(CUNIT_LIBS) $(top_builddir)/.libs/libcoap-$(LIBCOAP_NAME_SUFFIX).a ${DTLS_LIBS} # If there is a API change to something $(LIBCOAP_API_VERSION) > 1 there is # nothing to adopt here. No needed to implement something here because the test