test: reverse assumption regarding static/dynamic linking
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 15 Jun 2011 13:21:14 +0000 (14:21 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 29 Jul 2011 10:17:29 +0000 (11:17 +0100)
If we change the default assumption to be that new tests will be
dynamically-linked to libdbus, those tests can be useful for
installcheck or even for installation. Accordingly, explicitly use
new variable $(static_cppflags) for all tests that need static linking.

test/Makefile.am

index 0448dca..fd687cd 100644 (file)
@@ -88,15 +88,22 @@ test_segfault_SOURCES =                             \
 test_sleep_forever_SOURCES =                   \
        test-sleep-forever.c
 
-# This assumes that most tests will be linked to libdbus-internal;
-# tests linked to only the public libdbus have their own CPPFLAGS.
-AM_CPPFLAGS=-DDBUS_STATIC_BUILD
+static_cppflags = \
+       $(AM_CPPFLAGS) \
+       -DDBUS_STATIC_BUILD \
+       $(NULL)
 
+test_service_CPPFLAGS = $(static_cppflags)
 test_service_LDADD = libdbus-testutils.la
+test_names_CPPFLAGS = $(static_cppflags)
 test_names_LDADD = libdbus-testutils.la
+## break_loader_CPPFLAGS = $(static_cppflags)
 ## break_loader_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+test_shell_service_CPPFLAGS = $(static_cppflags)
 test_shell_service_LDADD = libdbus-testutils.la
+shell_test_CPPFLAGS = $(static_cppflags)
 shell_test_LDADD = libdbus-testutils.la
+spawn_test_CPPFLAGS = $(static_cppflags)
 spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la
 
 EXTRA_DIST = dbus-test-runner