chiark / gitweb /
zsh-completion: add bootctl
[elogind.git] / Makefile.am
index bc67063..558aa1b 100644 (file)
@@ -59,6 +59,10 @@ LIBSYSTEMD_JOURNAL_CURRENT=11
 LIBSYSTEMD_JOURNAL_REVISION=3
 LIBSYSTEMD_JOURNAL_AGE=11
 
+LIBSYSTEMD_BUS_CURRENT=0
+LIBSYSTEMD_BUS_REVISION=0
+LIBSYSTEMD_BUS_AGE=0
+
 # Dirs of external packages
 dbuspolicydir=@dbuspolicydir@
 dbussessionservicedir=@dbussessionservicedir@
@@ -173,6 +177,7 @@ AM_CPPFLAGS = \
        -DKEXEC=\"$(KEXEC)\" \
        -I $(top_srcdir)/src \
        -I $(top_srcdir)/src/shared \
+       -I $(top_srcdir)/src/network \
        -I $(top_srcdir)/src/login \
        -I $(top_srcdir)/src/journal \
        -I $(top_srcdir)/src/systemd \
@@ -640,8 +645,8 @@ test_rtnl_SOURCES = \
        src/libsystemd-rtnl/test-rtnl.c
 
 test_rtnl_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-rtnl.la
+       libsystemd-rtnl.la \
+       libsystemd-shared.la
 
 tests += test-rtnl
 
@@ -820,11 +825,6 @@ libsystemd_logs_la_SOURCES = \
        src/shared/logs-show.c \
        src/shared/logs-show.h
 
-libsystemd_logs_la_LIBADD = \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la \
-       libsystemd-shared.la
-
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
        libsystemd-capability.la
@@ -848,9 +848,6 @@ libsystemd_audit_la_SOURCES = \
        src/shared/audit.c \
        src/shared/audit.h
 
-libsystemd_audit_la_LIBADD = \
-       libsystemd-capability.la
-
 # ------------------------------------------------------------------------------
 if HAVE_ACL
 noinst_LTLIBRARIES += \
@@ -865,8 +862,7 @@ libsystemd_acl_la_CFLAGS = \
        $(ACL_CFLAGS)
 
 libsystemd_acl_la_LIBADD = \
-       $(ACL_LIBS) \
-       libsystemd-shared.la
+       $(ACL_LIBS)
 endif
 
 # ------------------------------------------------------------------------------
@@ -1022,12 +1018,12 @@ libsystemd_core_la_LIBADD = \
        libsystemd-capability.la \
        libsystemd-units.la \
        libsystemd-label.la \
-       libsystemd-shared.la \
        libsystemd-dbus.la \
        libsystemd-audit.la \
        libsystemd-id128-internal.la \
-       libsystemd-daemon.la \
-       libudev.la \
+       libsystemd-daemon-internal.la \
+       libudev-internal.la \
+       libsystemd-shared.la \
        $(LIBWRAP_LIBS) \
        $(PAM_LIBS) \
        $(AUDIT_LIBS) \
@@ -1078,9 +1074,7 @@ systemd_CFLAGS = \
 
 systemd_LDADD = \
        libsystemd-core.la \
-       libsystemd-daemon.la \
-       libsystemd-id128-internal.la \
-       libsystemd-dbus.la
+       $(RT_LIBS)
 
 dist_pkgsysconf_DATA += \
        src/core/system.conf \
@@ -1174,8 +1168,7 @@ test_engine_CFLAGS = \
 
 test_engine_LDADD = \
        libsystemd-core.la \
-       libsystemd-daemon.la \
-       libsystemd-dbus.la
+       $(RT_LIBS)
 
 test_job_type_SOURCES = \
        src/test/test-job-type.c
@@ -1186,7 +1179,7 @@ test_job_type_CFLAGS = \
 
 test_job_type_LDADD = \
        libsystemd-core.la \
-       libsystemd-daemon.la
+       $(RT_LIBS)
 
 test_ns_SOURCES = \
        src/test/test-ns.c
@@ -1202,7 +1195,6 @@ test_loopback_SOURCES = \
        src/test/test-loopback.c
 
 test_loopback_LDADD = \
-       libsystemd-shared.la \
        libsystemd-core.la
 
 test_hostname_SOURCES = \
@@ -1230,7 +1222,8 @@ test_unit_name_CFLAGS = \
        $(DBUS_CFLAGS)
 
 test_unit_name_LDADD = \
-       libsystemd-core.la
+       libsystemd-core.la \
+       $(RT_LIBS)
 
 test_unit_file_SOURCES = \
        src/test/test-unit-file.c
@@ -1240,7 +1233,8 @@ test_unit_file_CFLAGS = \
        $(DBUS_CFLAGS)
 
 test_unit_file_LDADD = \
-       libsystemd-core.la
+       libsystemd-core.la \
+       $(RT_LIBS)
 
 test_utf8_SOURCES = \
        src/test/test-utf8.c
@@ -1281,8 +1275,10 @@ test_tables_CFLAGS = \
        $(DBUS_CFLAGS)
 
 test_tables_LDADD = \
+       libsystemd-logs.la \
+       libsystemd-journal-internal.la \
        libsystemd-core.la \
-       libsystemd-logs.la
+       $(RT_LIBS)
 
 test_prioq_SOURCES = \
        src/test/test-prioq.c
@@ -1348,8 +1344,8 @@ test_daemon_SOURCES = \
        src/test/test-daemon.c
 
 test_daemon_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-daemon.la
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 test_cgroup_SOURCES = \
        src/test/test-cgroup.c
@@ -1363,8 +1359,8 @@ test_cgroup_util_SOURCES = \
 
 test_cgroup_util_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 test_env_replace_SOURCES = \
        src/test/test-env-replace.c
@@ -1382,9 +1378,9 @@ test_strv_SOURCES = \
        src/test/test-strv.c
 
 test_strv_LDADD = \
-       libsystemd-shared.la \
        libsystemd-units.la \
-       libsystemd-id128-internal.la
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 test_path_util_SOURCES = \
        src/test/test-path-util.c
@@ -1408,8 +1404,8 @@ test_install_CFLAGS = \
 test_install_LDADD = \
        libsystemd-units.la \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libsystemd-id128-internal.la
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 test_watchdog_SOURCES = \
        src/test/test-watchdog.c
@@ -1427,7 +1423,7 @@ test_sched_prio_CFLAGS = \
 
 test_sched_prio_LDADD = \
        libsystemd-core.la \
-       libsystemd-daemon.la
+       $(RT_LIBS)
 
 # ------------------------------------------------------------------------------
 ## .PHONY so it always rebuilds it
@@ -1471,26 +1467,21 @@ endif
 systemd_analyze_SOURCES = \
        src/analyze/analyze.c
 
-systemd_analyze_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 systemd_analyze_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_initctl_SOURCES = \
        src/initctl/initctl.c
 
-systemd_initctl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 systemd_initctl_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_update_utmp_SOURCES = \
@@ -1498,12 +1489,13 @@ systemd_update_utmp_SOURCES = \
 
 systemd_update_utmp_CFLAGS = \
        $(AM_CFLAGS) \
-       $(DBUS_CFLAGS) \
        $(AUDIT_CFLAGS)
 
 systemd_update_utmp_LDADD = \
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
        libsystemd-shared.la \
-       libsystemd-bus.la \
        $(AUDIT_LIBS)
 
 # ------------------------------------------------------------------------------
@@ -1512,10 +1504,10 @@ systemd_shutdownd_SOURCES = \
 
 systemd_shutdownd_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
-pkginclude_HEADERS += \
+dist_doc_DATA += \
        src/systemd/sd-shutdown.h
 
 # ------------------------------------------------------------------------------
@@ -1530,8 +1522,8 @@ systemd_shutdown_SOURCES = \
 
 systemd_shutdown_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libudev.la
+       libudev-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 if HAVE_KMOD
@@ -1577,9 +1569,9 @@ systemd_tmpfiles_SOURCES = \
 
 systemd_tmpfiles_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
        libsystemd-capability.la \
-       libsystemd-id128-internal.la
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 rootbin_PROGRAMS += \
        systemd-tmpfiles
@@ -1630,8 +1622,8 @@ systemd_machine_id_setup_SOURCES = \
 
 systemd_machine_id_setup_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libsystemd-id128-internal.la
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_sysctl_SOURCES = \
@@ -1651,22 +1643,20 @@ systemd_sleep_LDADD = \
 systemd_fsck_SOURCES = \
        src/fsck/fsck.c
 
-systemd_fsck_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 systemd_fsck_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libudev.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libudev-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_ac_power_SOURCES = \
        src/ac-power/ac-power.c
 
 systemd_ac_power_LDADD = \
-       libsystemd-shared.la \
-       libudev.la
+       libudev-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_detect_virt_SOURCES = \
@@ -1735,11 +1725,15 @@ bootctl_SOURCES = \
 
 bootctl_LDADD = \
        libsystemd-shared.la \
-       libsystemd-id128.la \
-       libsystemd-daemon.la
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la
 
 bin_PROGRAMS += \
        bootctl
+
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_bootctl
+
 endif
 
 # ------------------------------------------------------------------------------
@@ -1752,9 +1746,9 @@ systemd_gpt_auto_generator_SOURCES = \
 
 systemd_gpt_auto_generator_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
        libsystemd-id128-internal.la \
-       libudev-private.la \
+       libudev-internal.la \
+       libsystemd-shared.la \
        $(BLKID_LIBS)
 
 systemd_gpt_auto_generator_CFLAGS = \
@@ -1785,24 +1779,25 @@ systemd_cgroups_agent_SOURCES = \
        src/cgroups-agent/cgroups-agent.c
 
 systemd_cgroups_agent_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemctl_SOURCES = \
        src/systemctl/systemctl.c
 
-systemctl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 systemctl_LDADD = \
        libsystemd-units.la \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
-       libsystemd-dbus.la \
-       libsystemd-logs.la
+       libsystemd-bus-internal.la \
+       libsystemd-logs.la \
+       libsystemd-login-internal.la \
+       libsystemd-journal-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_notify_SOURCES = \
@@ -1810,8 +1805,8 @@ systemd_notify_SOURCES = \
        src/readahead/sd-readahead.c
 
 systemd_notify_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-daemon.la
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_ask_password_SOURCES = \
@@ -1853,10 +1848,10 @@ systemd_nspawn_SOURCES = \
 systemd_nspawn_LDADD = \
        libsystemd-label.la \
        libsystemd-capability.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
+       libsystemd-bus-internal.la \
        libsystemd-id128-internal.la \
-       libsystemd-bus.la
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_run_SOURCES = \
@@ -1865,19 +1860,20 @@ systemd_run_SOURCES = \
 systemd_run_LDADD = \
        libsystemd-label.la \
        libsystemd-capability.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
+       libsystemd-bus-internal.la \
+       libsystemd-daemon-internal.la \
        libsystemd-id128-internal.la \
-       libsystemd-bus.la
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_stdio_bridge_SOURCES = \
        src/stdio-bridge/stdio-bridge.c
 
 systemd_stdio_bridge_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-daemon.la
+       libsystemd-bus-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_tty_ask_password_agent_SOURCES = \
@@ -1889,11 +1885,16 @@ systemd_tty_ask_password_agent_LDADD = \
 
 # ------------------------------------------------------------------------------
 libsystemd_daemon_la_SOURCES = \
+       src/libsystemd-daemon/libsystemd-daemon.sym \
        src/libsystemd-daemon/sd-daemon.c
 
 libsystemd_daemon_internal_la_SOURCES = \
        $(libsystemd_daemon_la_SOURCES)
 
+libsystemd_daemon_internal_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DSD_DAEMON_DISABLE_MQ
+
 libsystemd_daemon_la_CFLAGS = \
        $(AM_CFLAGS) \
        -fvisibility=hidden \
@@ -1930,15 +1931,16 @@ pkgconfiglib_DATA += \
        src/libsystemd-daemon/libsystemd-daemon.pc
 
 EXTRA_DIST += \
-       src/libsystemd-daemon/libsystemd-daemon.pc.in \
-       src/libsystemd-daemon/libsystemd-daemon.sym
+       src/libsystemd-daemon/libsystemd-daemon.pc.in
 
 # ------------------------------------------------------------------------------
 libsystemd_bus_la_SOURCES = \
+       src/libsystemd-bus/libsystemd-bus.sym \
        src/systemd/sd-bus.h \
        src/systemd/sd-bus-protocol.h \
        src/systemd/sd-bus-vtable.h \
        src/systemd/sd-memfd.h \
+       src/systemd/sd-utf8.h \
        src/systemd/sd-event.h \
        src/libsystemd-bus/sd-bus.c \
        src/libsystemd-bus/bus-control.c \
@@ -1970,23 +1972,55 @@ libsystemd_bus_la_SOURCES = \
        src/libsystemd-bus/bus-convenience.c \
        src/libsystemd-bus/kdbus.h \
        src/libsystemd-bus/sd-memfd.c \
-       src/libsystemd-bus/sd-event.c \
        src/libsystemd-bus/bus-util.c \
        src/libsystemd-bus/bus-util.h \
+       src/libsystemd-bus/sd-utf8.c \
+       src/libsystemd-bus/sd-event.c \
        src/libsystemd-bus/event-util.h
 
-libsystemd_bus_la_LIBADD =  \
+libsystemd_bus_la_LIBADD = \
        libsystemd-id128-internal.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 libsystemd_bus_la_CFLAGS = \
        $(AM_CFLAGS) \
        -pthread
 
-noinst_LTLIBRARIES += \
+libsystemd_bus_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -version-info $(LIBSYSTEMD_BUS_CURRENT):$(LIBSYSTEMD_BUS_REVISION):$(LIBSYSTEMD_BUS_AGE) \
+       -Wl,--version-script=$(top_srcdir)/src/libsystemd-bus/libsystemd-bus.sym
+
+pkgconfiglib_DATA += \
+       src/libsystemd-bus/libsystemd-bus.pc
+
+EXTRA_DIST += \
+       src/libsystemd-bus/libsystemd-bus.pc.in
+
+lib_LTLIBRARIES += \
        libsystemd-bus.la
 
+libsystemd_bus_internal_la_SOURCES = \
+       $(libsystemd_bus_la_SOURCES)
+
+libsystemd_bus_internal_la_CFLAGS = \
+       $(libsystemd_bus_la_CFLAGS)
+
+noinst_LTLIBRARIES += \
+       libsystemd-bus-internal.la
+
+libsystemd_bus_dump_la_SOURCES = \
+       src/libsystemd-bus/bus-dump.c \
+       src/libsystemd-bus/bus-dump.h
+
+libsystemd_bus_dump_la_CFLAGS = \
+       $(AM_CFLAGS)
+       $(CAP_CFLAGS)
+
+noinst_LTLIBRARIES += \
+       libsystemd-bus-dump.la
+
 tests += \
        test-bus-marshal \
        test-bus-signature \
@@ -2002,29 +2036,35 @@ tests += \
        test-bus-objects \
        test-event
 
-noinst_PROGRAMS += \
+bin_PROGRAMS += \
        busctl
 
 test_bus_marshal_SOURCES = \
        src/libsystemd-bus/test-bus-marshal.c
 
 test_bus_marshal_LDADD = \
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
        libsystemd-shared.la \
-       libsystemd-bus.la \
+       libsystemd-bus-dump.la \
+       libsystemd-capability.la \
        $(GLIB_LIBS) \
-       $(DBUS_LIBS)
+       $(DBUS_LIBS) \
+       $(CAP_LIBS)
 
 test_bus_marshal_CFLAGS = \
        $(AM_CFLAGS) \
        $(GLIB_CFLAGS) \
-       $(DBUS_CFLAGS)
+       $(DBUS_CFLAGS) \
+       $(CAP_CFLAGS)
 
 test_bus_signature_SOURCES = \
        src/libsystemd-bus/test-bus-signature.c
 
 test_bus_signature_LDADD = \
        libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la
 
 test_bus_chat_SOURCES = \
        src/libsystemd-bus/test-bus-chat.c
@@ -2034,9 +2074,10 @@ test_bus_chat_CFLAGS = \
        -pthread
 
 test_bus_chat_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 test_bus_server_SOURCES = \
        src/libsystemd-bus/test-bus-server.c
@@ -2046,89 +2087,125 @@ test_bus_server_CFLAGS = \
        -pthread
 
 test_bus_server_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 test_bus_objects_SOURCES = \
        src/libsystemd-bus/test-bus-objects.c
 
 test_bus_objects_CFLAGS = \
        $(AM_CFLAGS) \
+       $(CAP_CFLAGS) \
        -pthread
 
 test_bus_objects_LDADD = \
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
        libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-dump.la \
+       libsystemd-capability.la \
+       $(CAP_LIBS)
 
 test_bus_match_SOURCES = \
        src/libsystemd-bus/test-bus-match.c
 
 test_bus_match_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 test_bus_kernel_SOURCES = \
        src/libsystemd-bus/test-bus-kernel.c
 
 test_bus_kernel_LDADD = \
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
        libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-dump.la \
+       libsystemd-capability.la \
+       $(CAP_LIBS)
+
+test_bus_kernel_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(CAP_CFLAGS)
 
 test_bus_kernel_bloom_SOURCES = \
        src/libsystemd-bus/test-bus-kernel-bloom.c
 
 test_bus_kernel_bloom_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 test_bus_kernel_benchmark_SOURCES = \
        src/libsystemd-bus/test-bus-kernel-benchmark.c
 
 test_bus_kernel_benchmark_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 test_bus_memfd_SOURCES = \
        src/libsystemd-bus/test-bus-memfd.c
 
 test_bus_memfd_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-shared.la
 
 test_bus_zero_copy_SOURCES = \
        src/libsystemd-bus/test-bus-zero-copy.c
 
 test_bus_zero_copy_LDADD = \
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
        libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-dump.la \
+       libsystemd-capability.la \
+       $(CAP_LIBS)
+
+test_bus_zero_copy_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(CAP_CFLAGS)
 
 test_bus_introspect_SOURCES = \
        src/libsystemd-bus/test-bus-introspect.c
 
 test_bus_introspect_LDADD = \
        libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la
 
 test_event_SOURCES = \
        src/libsystemd-bus/test-event.c
 
 test_event_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 busctl_SOURCES = \
        src/libsystemd-bus/busctl.c
 
 busctl_LDADD = \
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
        libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-dump.la \
+       libsystemd-capability.la \
+       $(CAP_LIBS)
+
+busctl_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(CAP_CFLAGS)
 
 # ------------------------------------------------------------------------------
 if ENABLE_GTK_DOC
@@ -2147,6 +2224,7 @@ lib_LTLIBRARIES += \
        libudev.la
 
 libudev_la_SOURCES =\
+       src/libudev/libudev.sym \
        src/libudev/libudev-private.h \
        src/libudev/libudev.c \
        src/libudev/libudev-list.c \
@@ -2168,16 +2246,15 @@ libudev_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
 
 libudev_la_LIBADD = \
-       libsystemd-shared.la \
        libsystemd-daemon-internal.la \
-       libsystemd-id128-internal.la
-
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
+
 pkgconfiglib_DATA += \
        src/libudev/libudev.pc
 
 EXTRA_DIST += \
-       src/libudev/libudev.pc.in \
-       src/libudev/libudev.sym
+       src/libudev/libudev.pc.in
 
 CLEANFILES += \
        src/libudev/libudev.pc \
@@ -2204,20 +2281,17 @@ UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
-       libudev-private.la
+       libudev-internal.la
 
-libudev_private_la_SOURCES =\
+libudev_internal_la_SOURCES =\
        $(libudev_la_SOURCES) \
        src/libudev/libudev-device-private.c \
        src/libudev/libudev-queue-private.c
 
-libudev_private_la_CFLAGS = \
+libudev_internal_la_CFLAGS = \
        $(AM_CFLAGS) \
        -fvisibility=default
 
-libudev_private_la_LIBADD = \
-       libsystemd-shared.la
-
 # ------------------------------------------------------------------------------
 INSTALL_DIRS += \
        $(sysconfdir)/udev/rules.d \
@@ -2352,12 +2426,12 @@ libudev_core_la_CFLAGS = \
        $(KMOD_CFLAGS)
 
 libudev_core_la_LIBADD = \
-       libudev-private.la \
+       libudev-internal.la \
        libsystemd-label.la \
        libsystemd-daemon-internal.la \
-       libsystemd-shared.la \
        libsystemd-rtnl.la \
        libsystemd-id128-internal.la \
+       libsystemd-shared.la \
        $(BLKID_LIBS) \
        $(KMOD_LIBS)
 
@@ -2417,9 +2491,7 @@ udevadm_SOURCES = \
        src/udev/udevadm-test-builtin.c
 
 udevadm_LDADD = \
-       libudev-core.la \
-       libsystemd-label.la \
-       libsystemd-shared.la
+       libudev-core.la
 
 # Update hwdb on installation. Do not bother if installing
 # in DESTDIR, since this is likely for packaging purposes.
@@ -2446,15 +2518,14 @@ test_libudev_SOURCES = \
 
 test_libudev_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libudev.la
+       libudev-internal.la \
+       libsystemd-shared.la
 
 test_udev_SOURCES = \
        src/test/test-udev.c
 
 test_udev_LDADD = \
        libudev-core.la \
-       libsystemd-shared.la \
        $(BLKID_LIBS) \
        $(KMOD_LIBS) \
        $(SELINUX_LIBS)
@@ -2487,7 +2558,7 @@ ata_id_SOURCES = \
        src/udev/ata_id/ata_id.c
 
 ata_id_LDADD = \
-       libudev-private.la \
+       libudev-internal.la \
        libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
@@ -2498,7 +2569,7 @@ cdrom_id_SOURCES = \
        src/udev/cdrom_id/cdrom_id.c
 
 cdrom_id_LDADD = \
-       libudev.la \
+       libudev-internal.la \
        libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
@@ -2512,7 +2583,8 @@ collect_SOURCES = \
        src/udev/collect/collect.c
 
 collect_LDADD = \
-       libudev-private.la
+       libudev-internal.la \
+       libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
        collect
@@ -2525,7 +2597,7 @@ scsi_id_SOURCES =\
        src/udev/scsi_id/scsi_id.h
 
 scsi_id_LDADD = \
-       libudev-private.la \
+       libudev-internal.la \
        libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
@@ -2539,7 +2611,7 @@ v4l_id_SOURCES = \
        src/udev/v4l_id/v4l_id.c
 
 v4l_id_LDADD = \
-       libudev.la
+       libudev-internal.la
 
 udevlibexec_PROGRAMS += \
        v4l_id
@@ -2552,7 +2624,7 @@ accelerometer_SOURCES = \
        src/udev/accelerometer/accelerometer.c
 
 accelerometer_LDADD = \
-       libudev.la -lm \
+       libudev-internal.la -lm \
        libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
@@ -2734,6 +2806,7 @@ udevlibexec_PROGRAMS += \
 
 # ------------------------------------------------------------------------------
 libsystemd_id128_la_SOURCES = \
+       src/libsystemd-id128/libsystemd-id128.sym \
        src/libsystemd-id128/sd-id128.c
 
 libsystemd_id128_la_CFLAGS = \
@@ -2746,6 +2819,7 @@ libsystemd_id128_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/libsystemd-id128/libsystemd-id128.sym
 
 libsystemd_id128_la_LIBADD = \
+       libsystemd-daemon-internal.la \
        libsystemd-shared.la
 
 libsystemd_id128_internal_la_SOURCES = \
@@ -2755,9 +2829,9 @@ test_id128_SOURCES = \
        src/test/test-id128.c
 
 test_id128_LDADD = \
-       libsystemd-shared.la \
        libsystemd-id128-internal.la \
-       libsystemd-daemon.la
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 tests += \
        test-id128
@@ -2785,8 +2859,7 @@ INSTALL_EXEC_HOOKS += libsystemd-id128-install-hook
 UNINSTALL_EXEC_HOOKS += libsystemd-id128-uninstall-hook
 
 EXTRA_DIST += \
-       src/libsystemd-id128/libsystemd-id128.pc.in \
-       src/libsystemd-id128/libsystemd-id128.sym
+       src/libsystemd-id128/libsystemd-id128.pc.in
 
 # ------------------------------------------------------------------------------
 
@@ -2797,8 +2870,9 @@ systemd_activate_SOURCES = \
        src/activate/activate.c
 
 systemd_activate_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-daemon.la
+       libsystemd-label.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_journald_SOURCES = \
@@ -2806,16 +2880,13 @@ systemd_journald_SOURCES = \
        src/journal/journald-server.h
 
 systemd_journald_LDADD = \
-       libsystemd-journal-internal.la \
-       libsystemd-shared.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 systemd_cat_SOURCES = \
        src/journal/cat.c
 
 systemd_cat_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la
+       libsystemd-journal-core.la
 
 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
 journalctl_CFLAGS = \
@@ -2825,10 +2896,10 @@ journalctl_SOURCES = \
        src/journal/journalctl.c
 
 journalctl_LDADD = \
-       libsystemd-shared.la \
        libsystemd-journal-internal.la \
        libsystemd-id128-internal.la \
-       libsystemd-logs.la
+       libsystemd-logs.la \
+       libsystemd-shared.la
 
 if HAVE_ACL
 journalctl_LDADD += \
@@ -2851,81 +2922,61 @@ test_journal_SOURCES = \
        src/journal/test-journal.c
 
 test_journal_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 test_journal_send_SOURCES = \
        src/journal/test-journal-send.c
 
 test_journal_send_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 test_journal_syslog_SOURCES = \
        src/journal/test-journal-syslog.c
 
 test_journal_syslog_LDADD = \
-       libsystemd-journal-internal.la \
-       libsystemd-shared.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 test_journal_match_SOURCES = \
        src/journal/test-journal-match.c
 
 test_journal_match_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 test_journal_enum_SOURCES = \
        src/journal/test-journal-enum.c
 
 test_journal_enum_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 test_journal_stream_SOURCES = \
        src/journal/test-journal-stream.c
 
 test_journal_stream_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 test_journal_init_SOURCES = \
        src/journal/test-journal-init.c
 
 test_journal_init_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-daemon-internal.la \
-       $(RT_LIBS) \
-       libsystemd-journal.la
+       libsystemd-journal-core.la
 
 test_journal_verify_SOURCES = \
        src/journal/test-journal-verify.c
 
 test_journal_verify_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 test_journal_interleaving_SOURCES = \
        src/journal/test-journal-interleaving.c
 
 test_journal_interleaving_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 test_mmap_cache_SOURCES = \
        src/journal/test-mmap-cache.c
 
 test_mmap_cache_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal-internal.la
+       libsystemd-journal-core.la
 
 test_catalog_SOURCES = \
        src/journal/test-catalog.c
@@ -2935,12 +2986,10 @@ test_catalog_CFLAGS = \
        -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
 
 test_catalog_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-label.la \
-       libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-journal-core.la
 
 libsystemd_journal_la_SOURCES = \
+       src/journal/libsystemd-journal.sym \
        src/journal/sd-journal.c \
        src/systemd/sd-journal.h \
        src/systemd/_sd-common.h \
@@ -2970,14 +3019,38 @@ libsystemd_journal_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/journal/libsystemd-journal.sym
 
 libsystemd_journal_la_LIBADD = \
-       libsystemd-shared.la \
        libsystemd-label.la \
        libsystemd-daemon-internal.la \
-       $(RT_LIBS) \
-       libsystemd-id128-internal.la
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 libsystemd_journal_internal_la_SOURCES = \
-       $(libsystemd_journal_la_SOURCES) \
+       $(libsystemd_journal_la_SOURCES)
+
+# using _CFLAGS = in the conditional below would suppress AM_CFLAGS
+libsystemd_journal_internal_la_CFLAGS = \
+       $(AM_CFLAGS)
+
+libsystemd_journal_internal_la_LIBADD =
+
+if HAVE_XZ
+libsystemd_journal_la_SOURCES += \
+       src/journal/compress.c
+
+libsystemd_journal_la_CFLAGS += \
+       $(XZ_CFLAGS)
+
+libsystemd_journal_la_LIBADD += \
+       $(XZ_LIBS)
+
+libsystemd_journal_internal_la_CFLAGS += \
+       $(XZ_CFLAGS)
+
+libsystemd_journal_internal_la_LIBADD += \
+       $(XZ_LIBS)
+endif
+
+libsystemd_journal_core_la_SOURCES = \
        src/journal/journald-kmsg.c \
        src/journal/journald-kmsg.h \
        src/journal/journald-syslog.c \
@@ -2994,47 +3067,31 @@ libsystemd_journal_internal_la_SOURCES = \
        src/journal/journald-rate-limit.h \
        src/journal/journal-internal.h
 
-# using _CFLAGS = in the conditional below would suppress AM_CFLAGS
-libsystemd_journal_internal_la_CFLAGS = \
-       $(AM_CFLAGS)
+nodist_libsystemd_journal_core_la_SOURCES = \
+       src/journal/journald-gperf.c
 
-libsystemd_journal_internal_la_LIBADD = \
+libsystemd_journal_core_la_LIBADD = \
+       libsystemd-journal-internal.la \
+       libudev-internal.la \
        libsystemd-audit.la \
-       libsystemd-daemon.la \
-       libudev.la \
-       libsystemd-shared.la \
-       libsystemd-label.la
-
-nodist_libsystemd_journal_internal_la_SOURCES = \
-       src/journal/journald-gperf.c
+       libsystemd-capability.la \
+       libsystemd-label.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 if ENABLE_LOGIND
-libsystemd_journal_internal_la_LIBADD += \
+libsystemd_journal_core_la_LIBADD += \
        libsystemd-login-internal.la
 endif
 
 if HAVE_ACL
-libsystemd_journal_internal_la_LIBADD += \
+libsystemd_journal_core_la_LIBADD += \
        libsystemd-acl.la
 endif
 
-if HAVE_XZ
-libsystemd_journal_la_SOURCES += \
-       src/journal/compress.c
-
-libsystemd_journal_la_CFLAGS += \
-       $(XZ_CFLAGS)
-
-libsystemd_journal_la_LIBADD += \
-       $(XZ_LIBS)
-
-libsystemd_journal_internal_la_CFLAGS += \
-       $(XZ_CFLAGS)
-
-libsystemd_journal_internal_la_LIBADD += \
-       $(XZ_LIBS)
-
-endif
+noinst_LTLIBRARIES += \
+       libsystemd-journal-core.la
 
 if HAVE_GCRYPT
 libsystemd_journal_la_SOURCES += \
@@ -3150,7 +3207,6 @@ SYSINIT_TARGET_WANTS += \
 
 EXTRA_DIST += \
        src/journal/libsystemd-journal.pc.in \
-       src/journal/libsystemd-journal.sym \
        units/systemd-journald.service.in \
        units/systemd-journal-flush.service.in \
        src/journal/journald-gperf.gperf
@@ -3171,12 +3227,12 @@ systemd_journal_gatewayd_SOURCES = \
        src/journal/microhttpd-util.c
 
 systemd_journal_gatewayd_LDADD = \
-       libsystemd-shared.la \
        libsystemd-logs.la \
        libsystemd-journal-internal.la \
        libsystemd-id128-internal.la \
-       libsystemd-daemon.la \
-       libsystemd-bus.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-bus-internal.la \
+       libsystemd-shared.la \
        $(MICROHTTPD_LIBS)
 
 systemd_journal_gatewayd_CFLAGS = \
@@ -3204,12 +3260,12 @@ systemd_socket_proxyd_SOURCES = \
        src/socket-proxy/socket-proxyd.c
 
 systemd_socket_proxyd_LDADD = \
-       libsystemd-shared.la \
        libsystemd-logs.la \
+       libsystemd-bus-internal.la \
        libsystemd-journal-internal.la \
        libsystemd-id128-internal.la \
-       libsystemd-daemon.la \
-       libsystemd-bus.la
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 if ENABLE_COREDUMP
@@ -3233,10 +3289,9 @@ systemd_coredumpctl_SOURCES = \
        src/journal/coredumpctl.c
 
 systemd_coredumpctl_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal.la \
        libsystemd-journal-internal.la \
-       libsystemd-id128-internal.la
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 bin_PROGRAMS += \
        systemd-coredumpctl
@@ -3320,9 +3375,9 @@ systemd_readahead_SOURCES = \
        src/readahead/readahead-common.h
 
 systemd_readahead_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
-       libudev.la
+       libsystemd-daemon-internal.la \
+       libudev-internal.la \
+       libsystemd-shared.la
 
 dist_doc_DATA += \
        src/readahead/sd-readahead.c \
@@ -3358,8 +3413,8 @@ systemd_bootchart_SOURCES = \
        src/bootchart/svg.h
 
 systemd_bootchart_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-journal.la
+       libsystemd-journal-internal.la \
+       libsystemd-shared.la
 
 rootlibexec_PROGRAMS += \
        systemd-bootchart
@@ -3425,8 +3480,8 @@ systemd_backlight_SOURCES = \
 
 systemd_backlight_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libudev-private.la
+       libudev-internal.la \
+       libsystemd-shared.la
 endif
 
 EXTRA_DIST += \
@@ -3445,8 +3500,8 @@ systemd_rfkill_SOURCES = \
 
 systemd_rfkill_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libudev-private.la
+       libudev-internal.la \
+       libsystemd-shared.la
 endif
 
 EXTRA_DIST += \
@@ -3472,8 +3527,8 @@ systemd_cryptsetup_CFLAGS = \
 
 systemd_cryptsetup_LDADD = \
        libsystemd-label.la \
+       libudev-internal.la \
        libsystemd-shared.la \
-       libudev.la \
        $(LIBCRYPTSETUP_LIBS)
 
 systemd_cryptsetup_generator_SOURCES = \
@@ -3495,9 +3550,10 @@ systemd_hostnamed_SOURCES = \
 
 systemd_hostnamed_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 rootlibexec_PROGRAMS += \
        systemd-hostnamed
@@ -3520,13 +3576,11 @@ SYSTEM_UNIT_ALIASES += \
 hostnamectl_SOURCES = \
        src/hostname/hostnamectl.c
 
-hostnamectl_CFLAGS = \
-       $(AM_CFLAGS)
-
 hostnamectl_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 bin_PROGRAMS += \
        hostnamectl
@@ -3552,9 +3606,10 @@ systemd_localed_SOURCES = \
 
 systemd_localed_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 nodist_systemunit_DATA += \
        units/systemd-localed.service
@@ -3587,9 +3642,10 @@ localectl_SOURCES = \
        src/locale/localectl.c
 
 localectl_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la \
-       libsystemd-id128-internal.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 bin_PROGRAMS += \
        localectl
@@ -3615,9 +3671,10 @@ systemd_timedated_SOURCES = \
 
 systemd_timedated_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 rootlibexec_PROGRAMS += \
        systemd-timedated
@@ -3644,13 +3701,11 @@ SYSTEM_UNIT_ALIASES += \
 timedatectl_SOURCES = \
        src/timedate/timedatectl.c
 
-timedatectl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 timedatectl_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 bin_PROGRAMS += \
        timedatectl
@@ -3694,8 +3749,7 @@ systemd_machined_SOURCES = \
        src/machine/machined.h
 
 systemd_machined_LDADD = \
-       libsystemd-machine-core.la \
-       $(libsystemd_machine_core_la_LIBADD)
+       libsystemd-machine-core.la
 
 rootlibexec_PROGRAMS += \
        systemd-machined
@@ -3709,11 +3763,11 @@ libsystemd_machine_core_la_SOURCES = \
 libsystemd_machine_core_la_LIBADD = \
        libsystemd-label.la \
        libsystemd-audit.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
-       libsystemd-bus.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-bus-internal.la \
        libsystemd-id128-internal.la \
-       libudev.la
+       libudev-internal.la \
+       libsystemd-shared.la
 
 noinst_LTLIBRARIES += \
        libsystemd-machine-core.la
@@ -3721,13 +3775,11 @@ noinst_LTLIBRARIES += \
 machinectl_SOURCES = \
        src/machine/machinectl.c
 
-machinectl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 machinectl_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 rootbin_PROGRAMS += \
        machinectl
@@ -3765,6 +3817,61 @@ EXTRA_DIST += \
 endif
 
 # ------------------------------------------------------------------------------
+if ENABLE_NETWORKD
+rootlibexec_PROGRAMS += \
+       systemd-networkd
+
+systemd_networkd_SOURCES = \
+       src/network/networkd.h \
+       src/network/networkd.c \
+       src/network/networkd-link.c \
+       src/network/networkd-network.c \
+       src/network/networkd-address.c \
+       src/network/networkd-route.c \
+       src/network/networkd-manager.c
+
+nodist_systemd_networkd_SOURCES = \
+       src/network/networkd-gperf.c
+
+systemd_networkd_LDADD = \
+       libudev-internal.la \
+       libsystemd-bus.la \
+       libsystemd-rtnl.la \
+       libsystemd-shared.la
+
+nodist_systemunit_DATA += \
+       units/systemd-networkd.service
+
+MULTI_USER_TARGET_WANTS += \
+       systemd-networkd.service
+
+test_network_SOURCES = \
+       src/network/test-network.c \
+       src/network/networkd.h \
+       src/network/networkd-link.c \
+       src/network/networkd-network.c \
+       src/network/networkd-address.c \
+       src/network/networkd-route.c \
+       src/network/networkd-manager.c \
+       src/network/networkd-gperf.c
+
+test_network_LDADD = \
+       libudev-internal.la \
+       libsystemd-bus.la \
+       libsystemd-rtnl.la \
+       libsystemd-shared.la
+
+tests += test-network
+
+EXTRA_DIST += \
+       src/network/networkd-gperf.gperf \
+       units/systemd-networkd.service.in
+
+CLEANFILES += \
+       src/network/networkd-gperf.c
+endif
+
+# ------------------------------------------------------------------------------
 if ENABLE_LOGIND
 systemd_logind_SOURCES = \
        src/login/logind.c \
@@ -3773,12 +3880,8 @@ systemd_logind_SOURCES = \
 nodist_systemd_logind_SOURCES = \
        src/login/logind-gperf.c
 
-systemd_logind_CFLAGS = \
-       $(libsystemd_logind_core_la_CFLAGS)
-
 systemd_logind_LDADD = \
-       libsystemd-logind-core.la \
-       $(libsystemd_logind_core_la_LIBADD)
+       libsystemd-logind-core.la
 
 libsystemd_logind_core_la_SOURCES = \
        src/login/logind-core.c \
@@ -3806,17 +3909,15 @@ libsystemd_logind_core_la_SOURCES = \
        src/login/login-shared.c \
        src/login/login-shared.h
 
-libsystemd_logind_core_la_CFLAGS = \
-       $(AM_CFLAGS)
-
 libsystemd_logind_core_la_LIBADD = \
        libsystemd-label.la \
+       libsystemd-capability.la \
        libsystemd-audit.la \
-       libsystemd-shared.la \
-       libsystemd-daemon.la \
+       libsystemd-daemon-internal.la \
        libsystemd-id128-internal.la \
-       libsystemd-bus.la \
-       libudev.la
+       libsystemd-bus-internal.la \
+       libudev-internal.la \
+       libsystemd-shared.la
 
 if HAVE_ACL
 libsystemd_logind_core_la_SOURCES += \
@@ -3843,14 +3944,12 @@ loginctl_SOURCES = \
        src/login/loginctl.c \
        src/login/sysfs-show.c
 
-loginctl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 loginctl_LDADD = \
+       libsystemd-bus-internal.la \
+       libudev-internal.la \
        libsystemd-shared.la \
-       libsystemd-dbus.la \
-       libudev.la
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la
 
 rootbin_PROGRAMS += \
        loginctl
@@ -3865,13 +3964,11 @@ dist_zshcompletion_DATA += \
 systemd_inhibit_SOURCES = \
        src/login/inhibit.c
 
-systemd_inhibit_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 systemd_inhibit_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-shared.la
 
 rootbin_PROGRAMS += \
        systemd-inhibit
@@ -3894,16 +3991,14 @@ test_inhibit_SOURCES = \
        src/login/test-inhibit.c
 
 test_inhibit_LDADD = \
-       libsystemd-shared.la \
-       libsystemd-bus.la
+       libsystemd-bus-internal.la \
+       libsystemd-daemon-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la
 
 test_login_tables_SOURCES = \
        src/login/test-login-tables.c
 
-test_login_tables_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 test_login_tables_LDADD = \
        libsystemd-logind-core.la
 
@@ -3916,6 +4011,7 @@ tests += \
        test-login-shared
 
 libsystemd_login_la_SOURCES = \
+       src/login/libsystemd-login.sym \
        src/login/sd-login.c \
        src/systemd/sd-login.h \
        src/login/login-shared.c \
@@ -3931,9 +4027,8 @@ libsystemd_login_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/login/libsystemd-login.sym
 
 libsystemd_login_la_LIBADD = \
-       libsystemd-shared.la \
        libsystemd-daemon-internal.la \
-       $(RT_LIBS)
+       libsystemd-shared.la
 
 libsystemd_login_internal_la_SOURCES = \
        $(libsystemd_login_la_SOURCES)
@@ -3945,7 +4040,6 @@ pam_systemd_la_SOURCES = \
 pam_systemd_la_CFLAGS = \
        $(AM_CFLAGS) \
        $(PAM_CFLAGS) \
-       $(DBUS_CFLAGS) \
        -fvisibility=hidden
 
 pam_systemd_la_LDFLAGS = \
@@ -3957,11 +4051,12 @@ pam_systemd_la_LDFLAGS = \
        -export-symbols-regex '^pam_sm_.*'
 
 pam_systemd_la_LIBADD = \
+       libsystemd-capability.la \
        libsystemd-audit.la \
-       libsystemd-dbus.la \
-       libsystemd-shared.la \
+       libsystemd-bus-internal.la \
+       libsystemd-id128-internal.la \
        libsystemd-daemon-internal.la \
-       $(RT_LIBS) \
+       libsystemd-shared.la \
        $(PAM_LIBS)
 
 pamlib_LTLIBRARIES = \
@@ -4052,7 +4147,6 @@ polkitpolicy_in_files += \
 EXTRA_DIST += \
        src/login/logind-gperf.gperf \
        src/login/libsystemd-login.pc.in \
-       src/login/libsystemd-login.sym \
        src/login/71-seat.rules.in \
        src/login/73-seat-late.rules.in \
        units/systemd-logind.service.in \
@@ -4148,9 +4242,8 @@ _reader_la_LIBADD = \
        $(PYTHON_DEVEL_LIBS) \
        libsystemd-journal.la \
        libsystemd-id128.la \
-       libsystemd-shared.la \
        libsystemd-daemon-internal.la \
-       $(RT_LIBS)
+       libsystemd-shared.la
 
 login_la_SOURCES = \
        src/python-systemd/login.c \
@@ -4172,9 +4265,8 @@ login_la_LIBADD = \
        $(PYTHON_DEVEL_LIBS) \
        libsystemd-journal.la \
        libsystemd-login.la \
-       libsystemd-shared.la \
        libsystemd-daemon-internal.la \
-       $(RT_LIBS)
+       libsystemd-shared.la
 
 dist_pkgpyexec_PYTHON = \
        src/python-systemd/journal.py \
@@ -4575,4 +4667,136 @@ install-tree: all
 # Let's run all tests of the test suite, but under valgrind. Let's
 # exclude the one perl script we have in there
 valgrind-tests: $(TESTS)
-       for f in $(TESTS) ; do [ "$$f" == "$${f/.pl/}" ] && libtool --mode=execute valgrind --leak-check=full --error-exitcode=55 $(builddir)/$$f ; done
+       $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
+               echo "Running $$f"; \
+               libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=4194400 --error-exitcode=55 $(builddir)/$$f ; \
+       done
+
+exported-%: %
+       $(AM_V_GEN)nm -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
+
+exported: $(addprefix exported-, $(lib_LTLIBRARIES))
+       $(AM_V_GEN)cat $^ > $@
+
+check-api-docs: exported man
+       $(AM_V_GEN)for symbol in `cat exported` ; do \
+               if test -f $(builddir)/man/$$symbol.html ; then \
+                       echo "  Symbol $$symbol() is documented." ; \
+               else \
+                       echo "‣ Symbol $$symbol() lacks documentation." ; \
+               fi ; \
+       done
+
+OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
+ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
+
+undefined defined: $(ALL_OBJECTS)
+       $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
+               nm -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
+       done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
+
+CLEANFILES += \
+       defined \
+       undefined
+
+check-api-unused: defined undefined exported
+       ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
+
+# Stupid test that everything purported to be exported really is
+
+define generate-sym-test
+       $(AM_V_at)$(MKDIR_P) $(dir $@)
+       $(AM_V_at)echo '#include <stdio.h>' > $@
+       $(AM_V_at)for file in $(notdir $(filter %.h, $^)); do \
+               echo "#include \"$$file\""; \
+       done >> $@
+       $(AM_V_at)echo 'void* functions[] = {' >> $@
+       $(AM_V_GEN)sed -r -n 's/^( +[a-zA-Z0-9_]+);/\1,/p' $< >> $@
+       $(AM_V_at)echo '};' >> $@
+       $(AM_V_at)echo 'int main(void) {' >> $@
+       $(AM_V_at)echo ' unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%p\n", functions[i]);' >> $@
+       $(AM_V_at)echo 'return 0; }' >> $@
+endef
+
+test-libsystemd-bus-sym.c: \
+       src/libsystemd-bus/libsystemd-bus.sym \
+       src/systemd/sd-bus.h \
+       src/systemd/sd-utf8.h \
+       Makefile
+       $(generate-sym-test)
+
+test-libsystemd-daemon-sym.c: \
+       src/libsystemd-daemon/libsystemd-daemon.sym \
+       src/systemd/sd-daemon.h \
+       Makefile
+       $(generate-sym-test)
+
+test-libsystemd-id128-sym.c: \
+       src/libsystemd-id128/libsystemd-id128.sym \
+       src/systemd/sd-id128.h \
+       Makefile
+       $(generate-sym-test)
+
+test-libsystemd-journal-sym.c: \
+       src/journal/libsystemd-journal.sym \
+       src/systemd/sd-journal.h \
+       Makefile
+       $(generate-sym-test)
+
+test-libsystemd-login-sym.c: \
+       src/login/libsystemd-login.sym \
+       src/systemd/sd-login.h \
+       Makefile
+       $(generate-sym-test)
+
+test-libudev-sym.c: \
+       src/libudev/libudev.sym \
+       src/udev/udev.h \
+       Makefile
+       $(generate-sym-test)
+
+test_libsystemd_bus_sym_SOURCES = \
+       test-libsystemd-bus-sym.c
+test_libsystemd_bus_sym_LDADD = \
+       libsystemd-bus.la
+
+test_libsystemd_daemon_sym_SOURCES = \
+       test-libsystemd-daemon-sym.c
+test_libsystemd_daemon_sym_LDADD = \
+       libsystemd-daemon.la
+
+test_libsystemd_id128_sym_SOURCES = \
+       test-libsystemd-id128-sym.c
+test_libsystemd_id128_sym_LDADD = \
+       libsystemd-id128.la
+
+test_libsystemd_journal_sym_SOURCES = \
+       test-libsystemd-journal-sym.c
+test_libsystemd_journal_sym_LDADD = \
+       libsystemd-journal.la
+
+test_libsystemd_login_sym_SOURCES = \
+       test-libsystemd-login-sym.c
+test_libsystemd_login_sym_LDADD = \
+       libsystemd-login.la
+
+test_libudev_sym_SOURCES = \
+       test-libudev-sym.c
+test_libudev_sym_LDADD = \
+       libudev.la
+
+BUILT_SOURCES += \
+       $(test_libsystemd_bus_sym_SOURCES) \
+       $(test_libsystemd_daemon_sym_SOURCES) \
+       $(test_libsystemd_id128_sym_SOURCES) \
+       $(test_libsystemd_journal_sym_SOURCES) \
+       $(test_libsystemd_login_sym_SOURCES) \
+       $(test_libudev_sym_SOURCES)
+
+tests += \
+       test-libsystemd-bus-sym \
+       test-libsystemd-daemon-sym \
+       test-libsystemd-id128-sym \
+       test-libsystemd-journal-sym \
+       test-libsystemd-login-sym \
+       test-libudev-sym