diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-02-25 17:01:32 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-02-25 17:01:32 +0000 |
commit | 23b911a9d463a95fafab81f3e3a3b7cdbf576b3f (patch) | |
tree | c8b6c913a8ecee7aefa8cb8c1941a237c3f7df26 | |
parent | d59434e2b004ab716a9fa7d3e11a6f18e4833250 (diff) |
Restructure libtool convenience libraries to make a bit more sensewip-libdbus-util
Previously, libdbus-internal was falsely claimed to be the same as
libdbus-1, but with static linkage. It was actually a superset of
libdbus-1 which included "util" and test functionality
The direct equivalent of the old libdbus-internal is libdbus-test, which
contains test-only functionality and pulls in libdbus-util as a
dependency. libdbus-util contains the "util" source files, and pulls in
libdbus-internal as a dependency.
libdbus-internal now *actually* has the same contents as libdbus-1, but
compiled with different flags.
This is all done with libtool convenience libraries, so there's no
proliferation of shared libraries; everything will still be statically
linked at the end, unless libdbus-1 is used.
The CMake build system hasn't been touched; in that build system,
libdbus-1 contains the util and test sources ("for debugging"), so
libdbus-internal does in fact have the same contents as libdbus-1.
-rw-r--r-- | bus/Makefile.am | 12 | ||||
-rw-r--r-- | dbus/Makefile.am | 34 | ||||
-rw-r--r-- | test/Makefile.am | 6 | ||||
-rw-r--r-- | test/name-test/Makefile.am | 16 |
4 files changed, 41 insertions, 27 deletions
diff --git a/bus/Makefile.am b/bus/Makefile.am index efa8ab5b..ff71a38d 100644 --- a/bus/Makefile.am +++ b/bus/Makefile.am @@ -84,7 +84,7 @@ dbus_daemon_SOURCES= \ dbus_daemon_CPPFLAGS = -DDBUS_STATIC_BUILD dbus_daemon_LDADD= \ - $(top_builddir)/dbus/libdbus-internal.la \ + $(top_builddir)/dbus/libdbus-util.la \ $(EFENCE) \ $(DBUS_BUS_LIBS) @@ -111,7 +111,7 @@ dbus_daemon_launch_helper_SOURCES= \ dbus_daemon_launch_helper_CPPFLAGS = -DDBUS_STATIC_BUILD dbus_daemon_launch_helper_LDADD= \ - $(top_builddir)/dbus/libdbus-internal.la \ + $(top_builddir)/dbus/libdbus-util.la \ $(DBUS_LAUNCHER_LIBS) dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ @@ -123,7 +123,7 @@ dbus_daemon_launch_helper_test_SOURCES= \ $(LAUNCH_HELPER_SOURCES) dbus_daemon_launch_helper_test_LDADD= \ - $(top_builddir)/dbus/libdbus-internal.la \ + $(top_builddir)/dbus/libdbus-test.la \ $(DBUS_LAUNCHER_LIBS) dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ @@ -137,7 +137,7 @@ bus_test_launch_helper_SOURCES= \ $(LAUNCH_HELPER_SOURCES) bus_test_launch_helper_LDADD= \ - $(top_builddir)/dbus/libdbus-internal.la \ + $(top_builddir)/dbus/libdbus-test.la \ $(DBUS_LAUNCHER_LIBS) bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ @@ -182,7 +182,7 @@ bus_test_system_SOURCES= \ test-system.c bus_test_system_CPPFLAGS = -DDBUS_STATIC_BUILD -bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS) +bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-test.la $(DBUS_BUS_LIBS) bus_test_system_LDFLAGS=@R_DYNAMIC_LDFLAG@ bus_test_SOURCES= \ @@ -190,7 +190,7 @@ bus_test_SOURCES= \ test-main.c bus_test_CPPFLAGS = -DDBUS_STATIC_BUILD -bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS) +bus_test_LDADD=$(top_builddir)/dbus/libdbus-test.la $(DBUS_BUS_LIBS) bus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ ## mop up the gcov files diff --git a/dbus/Makefile.am b/dbus/Makefile.am index 740def3e..6ac31ca6 100644 --- a/dbus/Makefile.am +++ b/dbus/Makefile.am @@ -223,7 +223,7 @@ DBUS_SHARED_SOURCES= \ ### in the D-Bus client library (all symbols in here ### should be underscore-prefixed but don't really need ### to be unless they move to DBUS_SHARED_SOURCES later) -DBUS_UTIL_SOURCES= \ +libdbus_util_la_SOURCES = \ dbus-auth-util.c \ dbus-credentials-util.c \ dbus-mainloop.c \ @@ -239,9 +239,7 @@ DBUS_UTIL_SOURCES= \ $(DBUS_UTIL_arch_sources) \ dbus-spawn.h \ dbus-string-util.c \ - dbus-sysdeps-util.c \ - dbus-test.c \ - dbus-test.h + dbus-sysdeps-util.c libdbus_1_la_SOURCES= \ $(DBUS_LIB_SOURCES) \ @@ -249,24 +247,39 @@ libdbus_1_la_SOURCES= \ libdbus_internal_la_SOURCES= \ $(DBUS_LIB_SOURCES) \ - $(DBUS_SHARED_SOURCES) \ - $(DBUS_UTIL_SOURCES) + $(DBUS_SHARED_SOURCES) BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS) EXTRA_DIST=dbus-arch-deps.h.in -## this library is the same as libdbus, but exports all the symbols -## and is only used for static linking within the dbus package. -noinst_LTLIBRARIES=libdbus-internal.la +noinst_LTLIBRARIES = \ + libdbus-internal.la \ + libdbus-util.la \ + libdbus-test.la +# This is the public shared library. libdbus_1_la_CPPFLAGS= -Ddbus_1_EXPORTS libdbus_1_la_LIBADD= $(DBUS_CLIENT_LIBS) libdbus_1_la_LDFLAGS= $(export_symbols) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined @R_DYNAMIC_LDFLAG@ @PIC_LDFLAGS@ +# This library is the same as libdbus, but exports all the symbols +# and is only used for static linking within the dbus package. libdbus_internal_la_CPPFLAGS = -DDBUS_STATIC_BUILD libdbus_internal_la_LIBADD=$(DBUS_CLIENT_LIBS) libdbus_internal_la_LDFLAGS=$(export_symbols_internal) @R_DYNAMIC_LDFLAG@ +# This convenience library contains non-public utilities, for tests and the +# dbus-daemon only. +libdbus_util_la_CPPFLAGS = -DDBUS_STATIC_BUILD +libdbus_util_la_LIBADD = libdbus-internal.la + +# This convenience library contains extra goo for tests only. +libdbus_test_la_CPPFLAGS = -DDBUS_STATIC_BUILD +libdbus_test_la_LIBADD = libdbus-util.la +libdbus_test_la_SOURCES = \ + dbus-test.c \ + dbus-test.h + ## note that TESTS has special meaning (stuff to use in make check) ## so if adding tests not to be run in make check, don't add them to ## TESTS @@ -283,8 +296,7 @@ noinst_PROGRAMS=$(TESTS) dbus_test_SOURCES= \ dbus-test-main.c - -dbus_test_LDADD=libdbus-internal.la $(DBUS_TEST_LIBS) +dbus_test_LDADD=libdbus-test.la $(DBUS_TEST_LIBS) dbus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ ## mop up the gcov files diff --git a/test/Makefile.am b/test/Makefile.am index 9d0681b7..9f9c2e61 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -52,9 +52,11 @@ test_segfault_SOURCES = \ test_sleep_forever_SOURCES = \ test-sleep-forever.c -# When any programs are not linked to libdbus-internal, fix this. +# This assumes that most tests will be linked to libdbus-test (and +# hence libdbus-internal); tests linked to only the public libdbus have their +# own CPPFLAGS. AM_CPPFLAGS=-DDBUS_STATIC_BUILD -TEST_LIBS=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_TEST_LIBS) +TEST_LIBS=$(top_builddir)/dbus/libdbus-test.la $(DBUS_TEST_LIBS) test_service_LDADD=libdbus-testutils.la $(TEST_LIBS) test_service_LDFLAGS=@R_DYNAMIC_LDFLAG@ diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am index 5f11f0be..69a230eb 100644 --- a/test/name-test/Makefile.am +++ b/test/name-test/Makefile.am @@ -22,53 +22,53 @@ AM_CPPFLAGS = -DDBUS_STATIC_BUILD test_pending_call_dispatch_SOURCES = \ test-pending-call-dispatch.c -test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_TEST_LIBS) +test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-test.la $(DBUS_TEST_LIBS) test_pending_call_dispatch_LDFLAGS=@R_DYNAMIC_LDFLAG@ test_pending_call_timeout_SOURCES = \ test-pending-call-timeout.c -test_pending_call_timeout_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_TEST_LIBS) +test_pending_call_timeout_LDADD=$(top_builddir)/dbus/libdbus-test.la $(DBUS_TEST_LIBS) test_pending_call_timeout_LDFLAGS=@R_DYNAMIC_LDFLAG@ test_threads_init_SOURCES = \ test-threads-init.c -test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_TEST_LIBS) +test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-test.la $(DBUS_TEST_LIBS) test_threads_init_LDFLAGS=@R_DYNAMIC_LDFLAG@ test_ids_SOURCES = \ test-ids.c -test_ids_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_TEST_LIBS) +test_ids_LDADD=$(top_builddir)/dbus/libdbus-test.la $(DBUS_TEST_LIBS) test_ids_LDFLAGS=@R_DYNAMIC_LDFLAG@ test_shutdown_SOURCES = \ test-shutdown.c test_shutdown_CFLAGS= -test_shutdown_LDADD=$(top_builddir)/dbus/libdbus-internal.la ../libdbus-testutils.la $(DBUS_TEST_LIBS) +test_shutdown_LDADD=$(top_builddir)/dbus/libdbus-test.la ../libdbus-testutils.la $(DBUS_TEST_LIBS) test_shutdown_LDFLAGS=@R_DYNAMIC_LDFLAG@ test_privserver_SOURCES = \ test-privserver.c test_privserver_CFLAGS= -test_privserver_LDADD=$(top_builddir)/dbus/libdbus-internal.la ../libdbus-testutils.la $(DBUS_TEST_LIBS) +test_privserver_LDADD=$(top_builddir)/dbus/libdbus-test.la ../libdbus-testutils.la $(DBUS_TEST_LIBS) test_privserver_LDFLAGS=@R_DYNAMIC_LDFLAG@ test_privserver_client_SOURCES = \ test-privserver-client.c test_privserver_client_CFLAGS= -test_privserver_client_LDADD=$(top_builddir)/dbus/libdbus-internal.la ../libdbus-testutils.la $(DBUS_TEST_LIBS) +test_privserver_client_LDADD=$(top_builddir)/dbus/libdbus-test.la ../libdbus-testutils.la $(DBUS_TEST_LIBS) test_privserver_client_LDFLAGS=@R_DYNAMIC_LDFLAG@ test_autolaunch_SOURCES = \ test-autolaunch.c test_autolaunch_CFLAGS= -test_autolaunch_LDADD=$(top_builddir)/dbus/libdbus-internal.la ../libdbus-testutils.la $(DBUS_TEST_LIBS) +test_autolaunch_LDADD=$(top_builddir)/dbus/libdbus-test.la ../libdbus-testutils.la $(DBUS_TEST_LIBS) test_autolaunch_LDFLAGS=@R_DYNAMIC_LDFLAG@ endif |