From c2fb727924e5bd3e23712814d2d8f5347a6c2751 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 11 Sep 2014 16:18:29 +0100 Subject: [PATCH 3/4] Partially revert previous commit so the tests can build This brings back the old $(static_cppflags) but renames it to $(internal_cppflags). Known regression: compilation with dbus-glib enabled is broken. --- bus/Makefile.am | 8 ++++---- test/Makefile.am | 38 +++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/bus/Makefile.am b/bus/Makefile.am index 1b40698..c4bbf01 100644 --- a/bus/Makefile.am +++ b/bus/Makefile.am @@ -133,7 +133,7 @@ dbus_daemon_launch_helper_test_SOURCES= \ $(LAUNCH_HELPER_SOURCES) dbus_daemon_launch_helper_test_LDADD= \ - $(top_builddir)/dbus/libdbus-1.la \ + $(top_builddir)/dbus/libdbus-internal.la \ $(DBUS_LAUNCHER_LIBS) dbus_daemon_launch_helper_test_CPPFLAGS = \ @@ -147,7 +147,7 @@ test_bus_launch_helper_SOURCES= \ $(LAUNCH_HELPER_SOURCES) test_bus_launch_helper_LDADD= \ - $(top_builddir)/dbus/libdbus-1.la \ + $(top_builddir)/dbus/libdbus-internal.la \ $(DBUS_LAUNCHER_LIBS) test_bus_launch_helper_CPPFLAGS = \ @@ -192,13 +192,13 @@ test_bus_system_SOURCES= \ utils.h \ test-system.c -test_bus_system_LDADD=$(top_builddir)/dbus/libdbus-1.la $(DBUS_BUS_LIBS) +test_bus_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS) test_bus_SOURCES= \ $(BUS_SOURCES) \ test-main.c -test_bus_LDADD=$(top_builddir)/dbus/libdbus-1.la $(DBUS_BUS_LIBS) +test_bus_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS) ## mop up the gcov files clean-local: diff --git a/test/Makefile.am b/test/Makefile.am index dc095e2..068e33a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS= . name-test DIST_SUBDIRS=name-test -# CPPFLAGS for binaries that are normally dynamic +# CPPFLAGS for binaries that only use public libdbus interfaces AM_CPPFLAGS = \ -I$(top_srcdir) \ $(GLIB_CFLAGS) \ @@ -14,6 +14,13 @@ AM_CPPFLAGS = \ # improve backtraces from test stuff AM_LDFLAGS = @R_DYNAMIC_LDFLAG@ +# CPPFLAGS for binaries that use libdbus internals, and used to be static +internal_cppflags = \ + $(AM_CPPFLAGS) \ + -DDBUS_COMPILATION \ + -DDBUS_TEST_USE_INTERNAL \ + $(NULL) + noinst_LTLIBRARIES = libdbus-testutils.la libdbus_testutils_la_SOURCES = \ test-utils.c \ @@ -32,11 +39,7 @@ libdbus_testutils_la_LIBADD += \ testutils_shared_if_possible_cppflags = $(AM_CPPFLAGS) else -testutils_shared_if_possible_cppflags = \ - $(AM_CPPFLAGS) \ - -DDBUS_COMPILATION \ - -DDBUS_TEST_USE_INTERNAL \ - $(NULL) +testutils_shared_if_possible_cppflags = $(internal_cppflags) endif libdbus_testutils_la_CPPFLAGS = $(testutils_shared_if_possible_cppflags) @@ -76,34 +79,35 @@ endif !DBUS_ENABLE_EMBEDDED_TESTS noinst_PROGRAMS= $(TEST_BINARIES) +test_service_CPPFLAGS = $(internal_cppflags) test_service_LDADD = libdbus-testutils.la -test_service_CPPFLAGS = $(testutils_shared_if_possible_cppflags) +test_names_CPPFLAGS = $(internal_cppflags) test_names_LDADD = libdbus-testutils.la -test_names_CPPFLAGS = $(testutils_shared_if_possible_cppflags) -## break_loader_LDADD = $(top_builddir)/dbus/libdbus-1.la -test_shell_service_CPPFLAGS = $(testutils_shared_if_possible_cppflags) +## break_loader_CPPFLAGS = $(internal_cppflags) +## break_loader_LDADD = $(top_builddir)/dbus/libdbus-internal.la +test_shell_service_CPPFLAGS = $(internal_cppflags) test_shell_service_LDADD = libdbus-testutils.la test_shell_SOURCES = shell-test.c -test_shell_CPPFLAGS = $(testutils_shared_if_possible_cppflags) +test_shell_CPPFLAGS = $(internal_cppflags) test_shell_LDADD = libdbus-testutils.la test_spawn_SOURCES = spawn-test.c -test_spawn_CPPFLAGS = $(testutils_shared_if_possible_cppflags) -test_spawn_LDADD = $(top_builddir)/dbus/libdbus-1.la +test_spawn_CPPFLAGS = $(internal_cppflags) +test_spawn_LDADD = $(top_builddir)/dbus/libdbus-internal.la test_printf_SOURCES = internals/printf.c -test_printf_CPPFLAGS = $(testutils_shared_if_possible_cppflags) +test_printf_CPPFLAGS = $(internal_cppflags) test_printf_LDADD = $(top_builddir)/dbus/libdbus-1.la test_refs_SOURCES = internals/refs.c -test_refs_CPPFLAGS = $(testutils_shared_if_possible_cppflags) +test_refs_CPPFLAGS = $(internal_cppflags) test_refs_LDADD = libdbus-testutils.la $(GLIB_LIBS) test_syslog_SOURCES = internals/syslog.c -test_syslog_CPPFLAGS = $(testutils_shared_if_possible_cppflags) +test_syslog_CPPFLAGS = $(internal_cppflags) test_syslog_LDADD = libdbus-testutils.la $(GLIB_LIBS) manual_dir_iter_SOURCES = manual-dir-iter.c -manual_dir_iter_CPPFLAGS = $(static_cppflags) +manual_dir_iter_CPPFLAGS = $(internal_cppflags) manual_dir_iter_LDADD = $(top_builddir)/dbus/libdbus-internal.la EXTRA_DIST = dbus-test-runner -- 2.1.0