From e0ea7a130c84ac9d68a380c399096688a1da065a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 21 Jan 2019 18:45:38 +0000 Subject: [PATCH] Consistently add CODE_COVERAGE_LIBS everywhere We need to link the code coverage objects, directly or indirectly, into every executable and every shared library. The rule I've followed to make it clear that we do this, without too much repetition, is: each executable, shared library or convenience library has CODE_COVERAGE_LIBS in its LDADD or LIBADD, unless it is linked to a convenience library in the same directory that has CODE_COVERAGE_LIBS in *its* LIBADD. Signed-off-by: Simon McVittie --- dbus/Makefile.am | 11 +++++++++-- test/Makefile.am | 5 ++++- test/name-test/Makefile.am | 40 ++++++++++++++++++++++++++++++-------- tools/Makefile.am | 15 ++++++++++++-- 4 files changed, 58 insertions(+), 13 deletions(-) diff --git a/dbus/Makefile.am b/dbus/Makefile.am index 608caaa26..8c9551df4 100644 --- a/dbus/Makefile.am +++ b/dbus/Makefile.am @@ -282,7 +282,10 @@ else SYMBOL_EXPORT_LDFLAGS= endif -libdbus_1_la_LIBADD= $(LIBDBUS_LIBS) +libdbus_1_la_LIBADD = \ + $(CODE_COVERAGE_LIBS) \ + $(LIBDBUS_LIBS) \ + $(NULL) libdbus_1_la_LDFLAGS = \ $(AM_LDFLAGS) \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ @@ -290,7 +293,11 @@ libdbus_1_la_LDFLAGS = \ -no-undefined \ $(NULL) -libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) libdbus-1.la +libdbus_internal_la_LIBADD = \ + $(CODE_COVERAGE_LIBS) \ + $(LIBDBUS_LIBS) \ + libdbus-1.la \ + $(NULL) if DBUS_WIN AM_CXXFLAGS = \ diff --git a/test/Makefile.am b/test/Makefile.am index e1d1e078e..95a4592f9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -176,7 +176,10 @@ test_bus_launch_helper_oom_LDADD = \ $(NULL) dbus_daemon_launch_helper_for_tests_SOURCES = bus/launch-helper-for-tests.c -dbus_daemon_launch_helper_for_tests_LDADD = $(top_builddir)/bus/liblaunch-helper-internal.la +dbus_daemon_launch_helper_for_tests_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + $(top_builddir)/bus/liblaunch-helper-internal.la \ + $(NULL) test_bus_system_SOURCES = bus/system.c test_bus_system_LDADD = \ diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am index 37d1472d6..63b077532 100644 --- a/test/name-test/Makefile.am +++ b/test/name-test/Makefile.am @@ -68,14 +68,38 @@ if DBUS_ENABLE_EMBEDDED_TESTS ## build even when not doing "make check" noinst_PROGRAMS=test-pending-call-dispatch test-pending-call-timeout test-pending-call-disconnected test-threads-init test-ids test-shutdown test-privserver-client test-autolaunch -test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-1.la -test_pending_call_timeout_LDADD=$(top_builddir)/dbus/libdbus-1.la -test_pending_call_disconnected_LDADD=$(top_builddir)/dbus/libdbus-1.la -test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-1.la -test_ids_LDADD=$(top_builddir)/dbus/libdbus-1.la +test_pending_call_dispatch_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + $(top_builddir)/dbus/libdbus-1.la \ + $(NULL) +test_pending_call_timeout_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + $(top_builddir)/dbus/libdbus-1.la \ + $(NULL) +test_pending_call_disconnected_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + $(top_builddir)/dbus/libdbus-1.la \ + $(NULL) +test_threads_init_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + $(top_builddir)/dbus/libdbus-1.la \ + $(NULL) +test_ids_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + $(top_builddir)/dbus/libdbus-1.la \ + $(NULL) -test_shutdown_LDADD=../libdbus-testutils.la -test_privserver_client_LDADD=../libdbus-testutils.la -test_autolaunch_LDADD=../libdbus-testutils.la +test_shutdown_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + ../libdbus-testutils.la \ + $(NULL) +test_privserver_client_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + ../libdbus-testutils.la \ + $(NULL) +test_autolaunch_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + ../libdbus-testutils.la \ + $(NULL) endif diff --git a/tools/Makefile.am b/tools/Makefile.am index 85dcba649..3d52a7a57 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -64,6 +64,7 @@ dbus_launch_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(NULL) dbus_launch_LDADD = \ + $(CODE_COVERAGE_LIBS) \ $(top_builddir)/dbus/libdbus-1.la \ $(DBUS_X_LIBS) \ $(NULL) @@ -72,6 +73,7 @@ dbus_run_session_SOURCES = \ dbus-run-session.c dbus_run_session_LDADD = \ + $(CODE_COVERAGE_LIBS) \ $(top_builddir)/dbus/libdbus-internal.la \ $(NULL) @@ -82,15 +84,18 @@ dbus_uuidgen_SOURCES= \ dbus-uuidgen.c dbus_send_LDADD = \ + $(CODE_COVERAGE_LIBS) \ $(top_builddir)/dbus/libdbus-1.la \ $(NULL) dbus_monitor_LDADD = \ + $(CODE_COVERAGE_LIBS) \ $(top_builddir)/dbus/libdbus-1.la \ $(NETWORK_libs) \ $(NULL) dbus_uuidgen_LDADD = \ + $(CODE_COVERAGE_LIBS) \ $(top_builddir)/dbus/libdbus-1.la \ $(NULL) @@ -107,14 +112,20 @@ dbus_test_tool_SOURCES = \ test-tool.c \ test-tool.h \ $(NULL) -dbus_test_tool_LDADD = $(top_builddir)/dbus/libdbus-1.la +dbus_test_tool_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + $(top_builddir)/dbus/libdbus-1.la \ + $(NULL) dbus_update_activation_environment_SOURCES = \ dbus-update-activation-environment.c \ tool-common.c \ tool-common.h \ $(NULL) -dbus_update_activation_environment_LDADD = $(top_builddir)/dbus/libdbus-1.la +dbus_update_activation_environment_LDADD = \ + $(CODE_COVERAGE_LIBS) \ + $(top_builddir)/dbus/libdbus-1.la \ + $(NULL) if DBUS_WIN SUFFIXES = .rc -- 2.47.3