chiark / gitweb /
Add sabridge for socket activation of traditional daemons
[elogind.git] / Makefile.am
index c64934e..2877184 100644 (file)
@@ -5,6 +5,7 @@
 #  Copyright 2010-2012 Lennart Poettering
 #  Copyright 2010-2012 Kay Sievers
 #  Copyright 2013 Zbigniew JÄ™drzejewski-Szmek
+#  Copyright 2013 David Strauss
 #
 #  systemd is free software; you can redistribute it and/or modify it
 #  under the terms of the GNU Lesser General Public License as published by
@@ -31,29 +32,32 @@ SUBDIRS = . po
 # keep intermediate files
 .SECONDARY:
 
-LIBUDEV_CURRENT=4
-LIBUDEV_REVISION=5
-LIBUDEV_AGE=3
+# Keep the test-suite.log
+.PRECIOUS: $(TEST_SUITE_LOG) Makefile
+
+LIBUDEV_CURRENT=5
+LIBUDEV_REVISION=0
+LIBUDEV_AGE=4
 
 LIBGUDEV_CURRENT=1
 LIBGUDEV_REVISION=3
 LIBGUDEV_AGE=1
 
-LIBSYSTEMD_LOGIN_CURRENT=7
+LIBSYSTEMD_LOGIN_CURRENT=9
 LIBSYSTEMD_LOGIN_REVISION=1
-LIBSYSTEMD_LOGIN_AGE=7
+LIBSYSTEMD_LOGIN_AGE=9
 
 LIBSYSTEMD_DAEMON_CURRENT=0
 LIBSYSTEMD_DAEMON_REVISION=10
 LIBSYSTEMD_DAEMON_AGE=0
 
 LIBSYSTEMD_ID128_CURRENT=0
-LIBSYSTEMD_ID128_REVISION=23
+LIBSYSTEMD_ID128_REVISION=26
 LIBSYSTEMD_ID128_AGE=0
 
-LIBSYSTEMD_JOURNAL_CURRENT=10
-LIBSYSTEMD_JOURNAL_REVISION=2
-LIBSYSTEMD_JOURNAL_AGE=10
+LIBSYSTEMD_JOURNAL_CURRENT=11
+LIBSYSTEMD_JOURNAL_REVISION=3
+LIBSYSTEMD_JOURNAL_AGE=11
 
 # Dirs of external packages
 dbuspolicydir=@dbuspolicydir@
@@ -61,11 +65,13 @@ dbussessionservicedir=@dbussessionservicedir@
 dbussystemservicedir=@dbussystemservicedir@
 dbusinterfacedir=@dbusinterfacedir@
 pamlibdir=@pamlibdir@
+pamconfdir=@pamconfdir@
 pkgconfigdatadir=$(datadir)/pkgconfig
 pkgconfiglibdir=$(libdir)/pkgconfig
 polkitpolicydir=$(datadir)/polkit-1/actions
 bashcompletiondir=@bashcompletiondir@
-rpmmacrosdir=$(sysconfdir)/rpm
+zshcompletiondir=@zshcompletiondir@
+rpmmacrosdir=$(prefix)/lib/rpm/macros.d
 sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
 sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
 varlogdir=$(localstatedir)/log
@@ -78,9 +84,9 @@ userunitdir=$(prefix)/lib/systemd/user
 userpresetdir=$(prefix)/lib/systemd/user-preset
 tmpfilesdir=$(prefix)/lib/tmpfiles.d
 sysctldir=$(prefix)/lib/sysctl.d
-usergeneratordir=$(prefix)/lib/systemd/user-generators
 pkgincludedir=$(includedir)/systemd
 systemgeneratordir=$(rootlibexecdir)/system-generators
+usergeneratordir=$(prefix)/lib/systemd/user-generators
 systemshutdowndir=$(rootlibexecdir)/system-shutdown
 systemsleepdir=$(rootlibexecdir)/system-sleep
 systemunitdir=$(rootprefix)/lib/systemd/system
@@ -154,7 +160,7 @@ AM_CPPFLAGS = \
        -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\" \
        -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
        -DROOTPREFIX=\"$(rootprefix)\" \
-       -DRANDOM_SEED=\"$(localstatedir)/lib/random-seed\" \
+       -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
        -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
        -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
        -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
@@ -165,6 +171,7 @@ AM_CPPFLAGS = \
        -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
        -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
        -DQUOTACHECK=\"$(QUOTACHECK)\" \
+       -DKEXEC=\"$(KEXEC)\" \
        -I $(top_srcdir)/src \
        -I $(top_srcdir)/src/shared \
        -I $(top_srcdir)/src/login \
@@ -174,6 +181,7 @@ AM_CPPFLAGS = \
        -I $(top_srcdir)/src/core \
        -I $(top_srcdir)/src/libudev \
        -I $(top_srcdir)/src/udev \
+       -I $(top_builddir)/src/udev \
        -I $(top_srcdir)/src/libsystemd-bus \
        $(OUR_CPPFLAGS)
 
@@ -290,7 +298,9 @@ bin_PROGRAMS = \
        systemd-nspawn \
        systemd-detect-virt \
        systemd-delta \
-       systemd-analyze
+       systemd-analyze \
+       systemd-run \
+       systemd-sabridge
 
 dist_bin_SCRIPTS = \
        src/kernel-install/kernel-install
@@ -309,7 +319,6 @@ rootlibexec_PROGRAMS = \
        systemd-remount-fs \
        systemd-reply-password \
        systemd-fsck \
-       systemd-timestamp \
        systemd-ac-power \
        systemd-sysctl \
        systemd-sleep
@@ -334,7 +343,20 @@ dist_bashcompletion_DATA = \
        shell-completion/bash/journalctl \
        shell-completion/bash/systemctl \
        shell-completion/bash/systemd-analyze \
-       shell-completion/bash/udevadm
+       shell-completion/bash/systemd-run \
+       shell-completion/bash/udevadm \
+       shell-completion/bash/kernel-install
+
+dist_zshcompletion_DATA = \
+       shell-completion/zsh/_systemctl \
+       shell-completion/zsh/_journalctl \
+       shell-completion/zsh/_udevadm \
+       shell-completion/zsh/_kernel-install \
+       shell-completion/zsh/_systemd-nspawn \
+       shell-completion/zsh/_systemd-analyze \
+       shell-completion/zsh/_sd_hosts_or_user_at_host \
+       shell-completion/zsh/_systemd-delta \
+       shell-completion/zsh/_systemd
 
 dist_sysctl_DATA = \
        sysctl.d/50-default.conf
@@ -379,7 +401,7 @@ dist_systemunit_DATA = \
        units/swap.target \
        units/slices.target \
        units/system.slice \
-       units/-.slice \
+       units/x-.slice \
        units/systemd-initctl.socket \
        units/systemd-shutdownd.socket \
        units/syslog.socket \
@@ -498,6 +520,17 @@ EXTRA_DIST += \
        units/rc-local.service.in \
        units/halt-local.service.in
 
+# automake is broken and can't handle files with a dash in front
+# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14728#8
+units-install-hook:
+       mv $(DESTDIR)$(systemunitdir)/x-.slice $(DESTDIR)/$(systemunitdir)/-.slice
+
+units-uninstall-hook:
+       rm -f $(DESTDIR)/$(systemunitdir)/-.slice
+
+INSTALL_DATA_HOOKS += units-install-hook
+UNINSTALL_DATA_HOOKS += units-uninstall-hook
+
 dist_doc_DATA = \
        README \
        NEWS \
@@ -593,7 +626,7 @@ EXTRA_DIST += \
        $(XML_FILES) \
        $(HTML_FILES) \
        $(HTML_ALIAS) \
-       $(dist_MANS) \
+       $(man_MANS) \
        make-man-index.py \
        make-directive-index.py \
        xml_helper.py
@@ -611,9 +644,12 @@ libsystemd_shared_la_SOURCES = \
        src/shared/list.h \
        src/shared/macro.h \
        src/shared/def.h \
+       src/shared/device-nodes.c \
+       src/shared/device-nodes.h \
        src/shared/sparse-endian.h \
        src/shared/util.c \
        src/shared/util.h \
+       src/shared/udev-util.h \
        src/shared/virt.c \
        src/shared/virt.h \
        src/shared/efivars.c \
@@ -650,6 +686,8 @@ libsystemd_shared_la_SOURCES = \
        src/shared/exit-status.h \
        src/shared/utf8.c \
        src/shared/utf8.h \
+       src/shared/gunicode.c \
+       src/shared/gunicode.h \
        src/shared/pager.c \
        src/shared/pager.h \
        src/shared/ioprio.h \
@@ -684,7 +722,19 @@ libsystemd_shared_la_SOURCES = \
        src/shared/output-mode.h \
        src/shared/MurmurHash3.c \
        src/shared/MurmurHash3.h \
-       src/shared/refcnt.h
+       src/shared/acpi-fpdt.h \
+       src/shared/acpi-fpdt.c \
+       src/shared/boot-timestamps.h \
+       src/shared/boot-timestamps.c \
+       src/shared/refcnt.h \
+       src/shared/mkdir.c \
+       src/shared/mkdir.h \
+       src/shared/smack-util.c \
+       src/shared/smack-util.h \
+       src/shared/apparmor-util.c \
+       src/shared/apparmor-util.h \
+       src/shared/ima-util.c \
+       src/shared/ima-util.h
 
 #-------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -728,14 +778,12 @@ noinst_LTLIBRARIES += \
        libsystemd-label.la
 
 libsystemd_label_la_SOURCES = \
-       src/shared/cgroup-label.c \
        src/shared/socket-label.c \
        src/shared/label.c \
        src/shared/label.h \
        src/shared/selinux-util.c \
        src/shared/selinux-util.h \
-       src/shared/mkdir.c \
-       src/shared/mkdir.h \
+       src/shared/mkdir-label.c \
        src/shared/ask-password-api.c \
        src/shared/ask-password-api.h \
        src/shared/fileio-label.c \
@@ -849,6 +897,8 @@ libsystemd_core_la_SOURCES = \
        src/core/path.h \
        src/core/slice.c \
        src/core/slice.h \
+       src/core/scope.c \
+       src/core/scope.h \
        src/core/load-dropin.c \
        src/core/load-dropin.h \
        src/core/execute.c \
@@ -885,6 +935,8 @@ libsystemd_core_la_SOURCES = \
        src/core/dbus-path.h \
        src/core/dbus-slice.c \
        src/core/dbus-slice.h \
+       src/core/dbus-scope.c \
+       src/core/dbus-scope.h \
        src/core/dbus-execute.c \
        src/core/dbus-execute.h \
        src/core/dbus-kill.c \
@@ -931,8 +983,8 @@ libsystemd_core_la_SOURCES = \
        src/core/syscall-list.h \
        src/core/audit-fd.c \
        src/core/audit-fd.h \
-       src/core/sync.c \
-       src/core/sync.h
+       src/core/async.c \
+       src/core/async.h
 
 if HAVE_KMOD
 libsystemd_core_la_SOURCES += \
@@ -991,7 +1043,7 @@ BUILT_SOURCES += \
 
 src/core/syscall-list.txt: Makefile
        $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h - < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9(]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@
+       $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h - < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9(]/ { sub(/__NR_/, "", $$2); if ($$2 !~ /SYSCALL_BASE/) print $$2; }' > $@
 
 src/core/syscall-from-name.gperf: src/core/syscall-list.txt Makefile
        $(AM_V_at)$(MKDIR_P) $(dir $@)
@@ -1087,6 +1139,8 @@ tests += \
        test-strxcpyx \
        test-unit-name \
        test-unit-file \
+       test-utf8 \
+       test-ellipsize \
        test-util \
        test-date \
        test-sleep \
@@ -1099,7 +1153,9 @@ tests += \
        test-fileio \
        test-time \
        test-hashmap \
-       test-list
+       test-list \
+       test-tables \
+       test-device-nodes
 
 EXTRA_DIST += \
        test/sched_idle_bad.service \
@@ -1108,6 +1164,15 @@ EXTRA_DIST += \
        test/sched_rr_ok.service \
        test/sched_rr_change.service
 
+EXTRA_DIST += \
+       src/test/test-helper.h
+
+test_device_nodes_SOURCES = \
+       src/test/test-device-nodes.c
+
+test_device_nodes_LDADD = \
+       libsystemd-shared.la
+
 test_engine_SOURCES = \
        src/test/test-engine.c
 
@@ -1156,12 +1221,12 @@ test_hostname_LDADD = \
 
 if ENABLE_EFI
 manual_tests += \
-       test-efivars
+       test-boot-timestamp
 
-test_efivars_SOURCES = \
-       src/test/test-efivars.c
+test_boot_timestamp_SOURCES = \
+       src/test/test-boot-timestamps.c
 
-test_efivars_LDADD = \
+test_boot_timestamp_LDADD = \
        libsystemd-shared.la
 endif
 
@@ -1185,6 +1250,15 @@ test_unit_file_CFLAGS = \
 test_unit_file_LDADD = \
        libsystemd-core.la
 
+test_utf8_SOURCES = \
+       src/test/test-utf8.c
+
+test_utf8_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_utf8_LDADD = \
+       libsystemd-shared.la
+
 test_util_SOURCES = \
        src/test/test-util.c
 
@@ -1212,6 +1286,18 @@ test_list_CFLAGS = \
 test_list_LDADD = \
        libsystemd-core.la
 
+test_tables_SOURCES = \
+       src/test/test-tables.c \
+       src/shared/test-tables.h
+
+test_tables_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(DBUS_CFLAGS)
+
+test_tables_LDADD = \
+       libsystemd-core.la \
+       libsystemd-logs.la
+
 test_prioq_SOURCES = \
        src/test/test-prioq.c
 
@@ -1245,6 +1331,12 @@ test_log_SOURCES = \
 test_log_LDADD = \
        libsystemd-core.la
 
+test_ellipsize_SOURCES = \
+       src/test/test-ellipsize.c
+
+test_ellipsize_LDADD = \
+       libsystemd-core.la
+
 test_date_SOURCES = \
        src/test/test-date.c
 
@@ -1294,7 +1386,8 @@ test_cgroup_util_SOURCES = \
 
 test_cgroup_util_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-daemon.la
 
 test_env_replace_SOURCES = \
        src/test/test-env-replace.c
@@ -1360,6 +1453,44 @@ test_sched_prio_LDADD = \
        libsystemd-daemon.la
 
 # ------------------------------------------------------------------------------
+## .PHONY so it always rebuilds it
+.PHONY: coverage lcov-run lcov-report
+
+# run lcov from scratch, always
+coverage:
+       $(MAKE) lcov-run
+       $(MAKE) lcov-report
+
+coverage_dir = coverage
+coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
+
+if ENABLE_COVERAGE
+# reset run coverage tests
+lcov-run:
+       @rm -rf $(coverage_dir)
+       lcov $(coverage_opts) --zerocounters
+       -$(MAKE) check
+
+# generate report based on current coverage data
+lcov-report:
+       $(MKDIR_P) $(coverage_dir)
+       lcov $(coverage_opts) --compat-libtool --capture --no-external \
+               | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
+       genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info
+       @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
+
+# lcov doesn't work properly with vpath builds, make sure that bad
+# output is not uploaded by mistake.
+coverage-sync: coverage
+       test "$(builddir)" = "$(srcdir)"
+       rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
+
+else
+lcov-run lcov-report:
+       echo "Need to reconfigure with --enable-coverage"
+endif
+
+# ------------------------------------------------------------------------------
 systemd_initctl_SOURCES = \
        src/initctl/initctl.c
 
@@ -1435,20 +1566,31 @@ nodist_systemunit_DATA += \
 SYSINIT_TARGET_WANTS += \
        systemd-modules-load.service
 
+if ENABLE_TMPFILES
+nodist_systemunit_DATA += \
+       units/kmod-static-nodes.service
+
+SYSINIT_TARGET_WANTS += \
+       kmod-static-nodes.service
+endif
 endif
 
 EXTRA_DIST += \
-       units/systemd-modules-load.service.in
+        units/systemd-modules-load.service.in \
+        units/kmod-static-nodes.service.in
 
 # ------------------------------------------------------------------------------
 if ENABLE_TMPFILES
 systemd_tmpfiles_SOURCES = \
-       src/tmpfiles/tmpfiles.c
+       src/tmpfiles/tmpfiles.c \
+       src/shared/specifier.c \
+       src/shared/specifier.h
 
 systemd_tmpfiles_LDADD = \
        libsystemd-label.la \
        libsystemd-shared.la \
-       libsystemd-capability.la
+       libsystemd-capability.la \
+       libsystemd-id128-internal.la
 
 rootbin_PROGRAMS += \
        systemd-tmpfiles
@@ -1475,6 +1617,9 @@ SYSINIT_TARGET_WANTS += \
        systemd-tmpfiles-setup-dev.service \
        systemd-tmpfiles-setup.service
 
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_systemd-tmpfiles
+
 TIMERS_TARGET_WANTS += \
        systemd-tmpfiles-clean.timer
 
@@ -1527,13 +1672,6 @@ systemd_fsck_LDADD = \
        libudev.la
 
 # ------------------------------------------------------------------------------
-systemd_timestamp_SOURCES = \
-       src/timestamp/timestamp.c
-
-systemd_timestamp_LDADD = \
-       libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
 systemd_ac_power_SOURCES = \
        src/ac-power/ac-power.c
 
@@ -1616,6 +1754,26 @@ bin_PROGRAMS += \
 endif
 
 # ------------------------------------------------------------------------------
+if HAVE_BLKID
+systemgenerator_PROGRAMS +=  \
+       systemd-gpt-auto-generator
+
+systemd_gpt_auto_generator_SOURCES = \
+       src/gpt-auto-generator/gpt-auto-generator.c
+
+systemd_gpt_auto_generator_LDADD = \
+       libsystemd-label.la \
+       libsystemd-shared.la \
+       libsystemd-id128-internal.la \
+       libudev-private.la \
+       $(BLKID_LIBS)
+
+systemd_gpt_auto_generator_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(BLKID_CFLAGS)
+endif
+
+# ------------------------------------------------------------------------------
 systemd_rc_local_generator_SOURCES = \
        src/rc-local-generator/rc-local-generator.c
 
@@ -1716,6 +1874,18 @@ systemd_nspawn_LDADD = \
        libsystemd-bus.la
 
 # ------------------------------------------------------------------------------
+systemd_run_SOURCES = \
+       src/run/run.c
+
+systemd_run_LDADD = \
+       libsystemd-label.la \
+       libsystemd-capability.la \
+       libsystemd-shared.la \
+       libsystemd-daemon.la \
+       libsystemd-id128-internal.la \
+       libsystemd-bus.la
+
+# ------------------------------------------------------------------------------
 systemd_stdio_bridge_SOURCES = \
        src/stdio-bridge/stdio-bridge.c
 
@@ -1749,6 +1919,9 @@ libsystemd_daemon_la_LDFLAGS = \
        -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
        -Wl,--version-script=$(top_srcdir)/src/libsystemd-daemon/libsystemd-daemon.sym
 
+libsystemd_daemon_la_LIBADD =  \
+       $(RT_LIBS)
+
 pkginclude_HEADERS += \
        src/systemd/sd-daemon.h
 
@@ -1779,7 +1952,9 @@ EXTRA_DIST += \
 libsystemd_bus_la_SOURCES = \
        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-event.h \
        src/libsystemd-bus/sd-bus.c \
        src/libsystemd-bus/bus-control.c \
        src/libsystemd-bus/bus-control.h \
@@ -1801,8 +1976,14 @@ libsystemd_bus_la_SOURCES = \
        src/libsystemd-bus/bus-match.h \
        src/libsystemd-bus/bus-bloom.c \
        src/libsystemd-bus/bus-bloom.h \
+       src/libsystemd-bus/bus-introspect.c \
+       src/libsystemd-bus/bus-introspect.h \
+       src/libsystemd-bus/bus-objects.c \
+       src/libsystemd-bus/bus-objects.h \
+       src/libsystemd-bus/bus-convenience.c \
        src/libsystemd-bus/kdbus.h \
-       src/libsystemd-bus/sd-memfd.c
+       src/libsystemd-bus/sd-memfd.c \
+       src/libsystemd-bus/sd-event.c
 
 libsystemd_bus_la_LIBADD =  \
        libsystemd-id128-internal.la \
@@ -1826,7 +2007,10 @@ tests += \
        test-bus-kernel-bloom \
        test-bus-kernel-benchmark \
        test-bus-memfd \
-       test-bus-zero-copy
+       test-bus-zero-copy \
+       test-bus-introspect \
+       test-bus-objects \
+       test-event
 
 noinst_PROGRAMS += \
        busctl
@@ -1876,6 +2060,18 @@ test_bus_server_LDADD = \
        libsystemd-bus.la \
        libsystemd-id128-internal.la
 
+test_bus_objects_SOURCES = \
+       src/libsystemd-bus/test-bus-objects.c
+
+test_bus_objects_CFLAGS = \
+       $(AM_CFLAGS) \
+       -pthread
+
+test_bus_objects_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la \
+       libsystemd-id128-internal.la
+
 test_bus_match_SOURCES = \
        src/libsystemd-bus/test-bus-match.c
 
@@ -1940,6 +2136,24 @@ test_bus_zero_copy_LDADD = \
        libsystemd-shared.la \
        libsystemd-bus.la
 
+test_bus_introspect_SOURCES = \
+       src/libsystemd-bus/test-bus-introspect.c
+
+test_bus_introspect_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_bus_introspect_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la
+
+test_event_SOURCES = \
+       src/libsystemd-bus/test-event.c
+
+test_event_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la \
+       libsystemd-id128-internal.la
+
 busctl_SOURCES = \
        src/libsystemd-bus/busctl.c
 
@@ -2044,6 +2258,7 @@ dist_udevrules_DATA += \
        rules/99-systemd.rules \
        rules/42-usb-hid-pm.rules \
        rules/50-udev-default.rules \
+       rules/60-keyboard.rules \
        rules/60-persistent-storage-tape.rules \
        rules/60-persistent-serial.rules \
        rules/60-persistent-input.rules \
@@ -2063,7 +2278,8 @@ dist_udevhwdb_DATA = \
        hwdb/20-usb-classes.hwdb \
        hwdb/20-bluetooth-vendor-product.hwdb \
        hwdb/20-acpi-vendor.hwdb \
-       hwdb/20-OUI.hwdb
+       hwdb/20-OUI.hwdb \
+       hwdb/60-keyboard.hwdb
 
 udevconfdir = $(sysconfdir)/udev
 dist_udevconf_DATA = \
@@ -2107,6 +2323,19 @@ rootlibexec_PROGRAMS += \
 noinst_LTLIBRARIES += \
        libudev-core.la
 
+src/udev/keyboard-keys.txt: Makefile
+       $(AM_V_at)$(MKDIR_P) $(dir $@)
+       $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
+
+src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt Makefile
+       $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
+
+src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf Makefile
+       $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
+
+src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt Makefile
+       $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
+
 libudev_core_la_SOURCES = \
        src/udev/udev.h \
        src/udev/udev-event.c \
@@ -2118,10 +2347,22 @@ libudev_core_la_SOURCES = \
        src/udev/udev-builtin-btrfs.c \
        src/udev/udev-builtin-hwdb.c \
        src/udev/udev-builtin-input_id.c \
+       src/udev/udev-builtin-keyboard.c \
        src/udev/udev-builtin-net_id.c \
        src/udev/udev-builtin-path_id.c \
        src/udev/udev-builtin-usb_id.c
 
+nodist_libudev_core_la_SOURCES = \
+       src/udev/keyboard-keys-from-name.h \
+       src/udev/keyboard-keys-to-name.h
+
+BUILT_SOURCES += \
+       $(nodist_libudev_core_la_SOURCES)
+
+CLEANFILES += \
+       src/udev/keyboard-keys-from-name.gperf \
+       src/udev/keyboard-keys.txt
+
 libudev_core_la_CFLAGS = \
        $(AM_CFLAGS) \
        $(BLKID_CFLAGS) \
@@ -2164,7 +2405,10 @@ if HAVE_ACL
 libudev_core_la_SOURCES += \
        src/udev/udev-builtin-uaccess.c \
        src/login/logind-acl.c \
-       src/login/sd-login.c
+       src/login/sd-login.c \
+       src/systemd/sd-login.h \
+       src/login/login-shared.c \
+       src/login/login-shared.h
 
 libudev_core_la_LIBADD += \
        libsystemd-acl.la
@@ -2189,6 +2433,7 @@ udevadm_SOURCES = \
 
 udevadm_LDADD = \
        libudev-core.la \
+       libsystemd-label.la \
        libsystemd-shared.la
 
 # Update hwdb on installation. Do not bother if installing
@@ -2487,139 +2732,6 @@ EXTRA_DIST += \
        src/gudev/seed-example.js
 
 # ------------------------------------------------------------------------------
-if ENABLE_KEYMAP
-keymap_SOURCES = \
-       src/udev/keymap/keymap.c
-
-keymap_CPPFLAGS = \
-       $(AM_CPPFLAGS) -I src/udev/keymap
-
-keymap_LDADD = \
-       libsystemd-shared.la
-
-nodist_keymap_SOURCES = \
-       src/udev/keymap/keys-from-name.h \
-       src/udev/keymap/keys-to-name.h
-
-BUILT_SOURCES += \
-       $(nodist_keymap_SOURCES)
-
-udevlibexec_PROGRAMS += \
-       keymap
-
-dist_doc_DATA += \
-       src/udev/keymap/README.keymap.txt
-
-dist_udevrules_DATA += \
-       src/udev/keymap/95-keymap.rules \
-       src/udev/keymap/95-keyboard-force-release.rules
-
-dist_udevhome_SCRIPTS = \
-       src/udev/keymap/findkeyboards \
-       src/udev/keymap/keyboard-force-release.sh
-
-TESTS += \
-       src/udev/keymap/check-keymaps.sh
-
-CLEANFILES += \
-       src/udev/keymap/keys.txt \
-       src/udev/keymap/keys-from-name.gperf \
-       src/udev/keymap/keyboard-force-release.sh
-
-udevkeymapdir = $(udevlibexecdir)/keymaps
-dist_udevkeymap_DATA = \
-       keymaps/acer \
-       keymaps/acer-aspire_5720 \
-       keymaps/acer-aspire_8930 \
-       keymaps/acer-aspire_5920g \
-       keymaps/acer-aspire_6920 \
-       keymaps/acer-travelmate_c300 \
-       keymaps/asus \
-       keymaps/compaq-e_evo \
-       keymaps/dell \
-       keymaps/dell-latitude-xt2 \
-       keymaps/everex-xt5000 \
-       keymaps/fujitsu-amilo_li_2732 \
-       keymaps/fujitsu-amilo_pa_2548 \
-       keymaps/fujitsu-amilo_pro_edition_v3505 \
-       keymaps/fujitsu-amilo_pro_v3205 \
-       keymaps/fujitsu-amilo_si_1520 \
-       keymaps/fujitsu-esprimo_mobile_v5 \
-       keymaps/fujitsu-esprimo_mobile_v6 \
-       keymaps/genius-slimstar-320 \
-       keymaps/hewlett-packard \
-       keymaps/hewlett-packard-2510p_2530p \
-       keymaps/hewlett-packard-compaq_elitebook \
-       keymaps/hewlett-packard-pavilion \
-       keymaps/hewlett-packard-presario-2100 \
-       keymaps/hewlett-packard-tablet \
-       keymaps/hewlett-packard-tx2 \
-       keymaps/hewlett-packard_elitebook-8440p \
-       keymaps/hewlett-packard_elitebook-8460p \
-       keymaps/hewlett-packard-hdx9494nr \
-       keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
-       keymaps/inventec-symphony_6.0_7.0 \
-       keymaps/lenovo-3000 \
-       keymaps/lenovo-ideapad \
-       keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
-       keymaps/lenovo-thinkpad_x6_tablet \
-       keymaps/lenovo-thinkpad_x200_tablet \
-       keymaps/lg-x110 \
-       keymaps/logitech-usb \
-       keymaps/logitech-wave \
-       keymaps/logitech-wave-cordless \
-       keymaps/logitech-wave-pro-cordless \
-       keymaps/maxdata-pro_7000 \
-       keymaps/medion-fid2060 \
-       keymaps/medionnb-a555 \
-       keymaps/micro-star \
-       keymaps/module-asus-w3j \
-       keymaps/module-ibm \
-       keymaps/module-lenovo \
-       keymaps/module-sony \
-       keymaps/module-sony-old \
-       keymaps/module-sony-vgn \
-       keymaps/module-sony-vpc \
-       keymaps/olpc-xo \
-       keymaps/onkyo \
-       keymaps/oqo-model2 \
-       keymaps/samsung-other \
-       keymaps/samsung-series-9 \
-       keymaps/samsung-sq1us \
-       keymaps/samsung-sx20s \
-       keymaps/toshiba-satellite_a100 \
-       keymaps/toshiba-satellite_a110 \
-       keymaps/toshiba-satellite_m30x \
-       keymaps/zepto-znote
-
-udevkeymapforcereldir = $(udevlibexecdir)/keymaps/force-release
-dist_udevkeymapforcerel_DATA = \
-       keymaps-force-release/dell-touchpad \
-       keymaps-force-release/dell-xps \
-       keymaps-force-release/hp-other \
-       keymaps-force-release/samsung-other \
-       keymaps-force-release/samsung-series-9 \
-       keymaps-force-release/common-volume-keys
-
-src/udev/keymap/keys.txt: Makefile
-       $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
-
-src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt Makefile
-       $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
-
-src/udev/keymap/keys-from-name.h: src/udev/keymap/keys-from-name.gperf Makefile
-       $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
-
-src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt Makefile
-       $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
-endif
-
-EXTRA_DIST += \
-       src/udev/keymap/check-keymaps.sh \
-       src/udev/keymap/keyboard-force-release.sh.in
-
-# ------------------------------------------------------------------------------
 mtd_probe_SOURCES =  \
        src/udev/mtd_probe/mtd_probe.c \
        src/udev/mtd_probe/mtd_probe.h \
@@ -2648,8 +2760,7 @@ libsystemd_id128_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/libsystemd-id128/libsystemd-id128.sym
 
 libsystemd_id128_la_LIBADD = \
-       libsystemd-shared.la \
-       libsystemd-daemon-internal.la
+       libsystemd-shared.la
 
 libsystemd_id128_internal_la_SOURCES = \
        $(libsystemd_id128_la_SOURCES)
@@ -2659,7 +2770,8 @@ test_id128_SOURCES = \
 
 test_id128_LDADD = \
        libsystemd-shared.la \
-       libsystemd-id128-internal.la
+       libsystemd-id128-internal.la \
+       libsystemd-daemon.la
 
 tests += \
        test-id128
@@ -2796,6 +2908,15 @@ test_journal_stream_LDADD = \
        libsystemd-journal-internal.la \
        libsystemd-id128-internal.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
+
 test_journal_verify_SOURCES = \
        src/journal/test-journal-verify.c
 
@@ -2822,6 +2943,10 @@ test_mmap_cache_LDADD = \
 test_catalog_SOURCES = \
        src/journal/test-catalog.c
 
+test_catalog_CFLAGS = \
+       $(AM_CFLAGS) \
+       -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
+
 test_catalog_LDADD = \
        libsystemd-shared.la \
        libsystemd-label.la \
@@ -2860,6 +2985,7 @@ libsystemd_journal_la_LIBADD = \
        libsystemd-shared.la \
        libsystemd-label.la \
        libsystemd-daemon-internal.la \
+       $(RT_LIBS) \
        libsystemd-id128-internal.la
 
 libsystemd_journal_internal_la_SOURCES = \
@@ -2884,7 +3010,6 @@ libsystemd_journal_internal_la_CFLAGS = \
        $(AM_CFLAGS)
 
 libsystemd_journal_internal_la_LIBADD = \
-       libsystemd-label.la \
        libsystemd-audit.la \
        libsystemd-daemon.la \
        libudev.la \
@@ -2986,6 +3111,7 @@ tests += \
        test-journal-syslog \
        test-journal-match \
        test-journal-stream \
+       test-journal-init \
        test-journal-verify \
        test-journal-interleaving \
        test-mmap-cache \
@@ -3083,6 +3209,22 @@ EXTRA_DIST += \
        units/systemd-journal-gatewayd.service.in
 
 # ------------------------------------------------------------------------------
+
+systemd_sabridge_SOURCES = \
+       src/sabridge/sabridge.c
+
+systemd_sabridge_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-logs.la \
+       libsystemd-journal-internal.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon.la \
+       libsystemd-bus.la
+
+systemd_sabridge_CFLAGS = \
+       $(AM_CFLAGS)
+
+# ------------------------------------------------------------------------------
 if ENABLE_COREDUMP
 systemd_coredump_SOURCES = \
        src/journal/coredump.c
@@ -3105,7 +3247,9 @@ systemd_coredumpctl_SOURCES = \
 
 systemd_coredumpctl_LDADD = \
        libsystemd-shared.la \
-       libsystemd-journal.la
+       libsystemd-journal.la \
+       libsystemd-journal-internal.la \
+       libsystemd-id128-internal.la
 
 bin_PROGRAMS += \
        systemd-coredumpctl
@@ -3113,6 +3257,9 @@ bin_PROGRAMS += \
 dist_bashcompletion_DATA += \
        shell-completion/bash/systemd-coredumpctl
 
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_systemd-coredumpctl
+
 sysctl_DATA = \
        sysctl.d/50-coredump.conf
 
@@ -3279,6 +3426,46 @@ EXTRA_DIST += \
        units/systemd-random-seed.service.in
 
 # ------------------------------------------------------------------------------
+if ENABLE_BACKLIGHT
+rootlibexec_PROGRAMS += \
+       systemd-backlight
+
+nodist_systemunit_DATA += \
+       units/systemd-backlight@.service
+
+systemd_backlight_SOURCES = \
+       src/backlight/backlight.c
+
+systemd_backlight_LDADD = \
+       libsystemd-label.la \
+       libsystemd-shared.la \
+       libudev-private.la
+endif
+
+EXTRA_DIST += \
+       units/systemd-backlight@.service.in
+
+# ------------------------------------------------------------------------------
+if ENABLE_RFKILL
+rootlibexec_PROGRAMS += \
+       systemd-rfkill
+
+nodist_systemunit_DATA += \
+       units/systemd-rfkill@.service
+
+systemd_rfkill_SOURCES = \
+       src/rfkill/rfkill.c
+
+systemd_rfkill_LDADD = \
+       libsystemd-label.la \
+       libsystemd-shared.la \
+       libudev-private.la
+endif
+
+EXTRA_DIST += \
+       units/systemd-rfkill@.service.in
+
+# ------------------------------------------------------------------------------
 if HAVE_LIBCRYPTSETUP
 rootlibexec_PROGRAMS += \
        systemd-cryptsetup
@@ -3373,6 +3560,9 @@ bin_PROGRAMS += \
 dist_bashcompletion_DATA += \
        shell-completion/bash/hostnamectl
 
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_hostnamectl
+
 endif
 
 polkitpolicy_in_files += \
@@ -3449,6 +3639,9 @@ bin_PROGRAMS += \
 dist_bashcompletion_DATA += \
        shell-completion/bash/localectl
 
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_localectl
+
 endif
 
 polkitpolicy_in_files += \
@@ -3518,6 +3711,9 @@ bin_PROGRAMS += \
 
 dist_bashcompletion_DATA += \
        shell-completion/bash/timedatectl
+
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_timedatectl
 endif
 
 polkitpolicy_in_files += \
@@ -3549,10 +3745,112 @@ lib_LTLIBRARIES += \
 endif
 
 # ------------------------------------------------------------------------------
+if ENABLE_MACHINED
+systemd_machined_SOURCES = \
+       src/machine/machined.c \
+       src/machine/machined.h
+
+systemd_machined_CFLAGS = \
+       $(libsystemd_machine_core_la_CFLAGS)
+
+systemd_machined_LDADD = \
+       libsystemd-machine-core.la \
+       $(libsystemd_machine_core_la_LIBADD)
+
+rootlibexec_PROGRAMS += \
+       systemd-machined
+
+libsystemd_machine_core_la_SOURCES = \
+       src/machine/machined-dbus.c \
+       src/machine/machine.c \
+       src/machine/machine.h \
+       src/machine/machine-dbus.c
+
+libsystemd_machine_core_la_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(DBUS_CFLAGS)
+
+libsystemd_machine_core_la_LIBADD = \
+       libsystemd-label.la \
+       libsystemd-audit.la \
+       libsystemd-shared.la \
+       libsystemd-daemon.la \
+       libsystemd-dbus.la \
+       libsystemd-id128-internal.la \
+       libudev.la
+
+noinst_LTLIBRARIES += \
+       libsystemd-machine-core.la
+
+machinectl_SOURCES = \
+       src/machine/machinectl.c
+
+machinectl_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(DBUS_CFLAGS)
+
+machinectl_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-dbus.la \
+       libudev.la
+
+rootbin_PROGRAMS += \
+       machinectl
+
+test_machine_tables_SOURCES = \
+       src/machine/test-machine-tables.c
+
+test_machine_tables_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(DBUS_CFLAGS)
+
+test_machine_tables_LDADD = \
+       libsystemd-machine-core.la
+
+tests += \
+       test-machine-tables
+
+nodist_systemunit_DATA += \
+       units/systemd-machined.service
+
+dist_systemunit_DATA += \
+       units/machine.slice
+
+dist_dbussystemservice_DATA += \
+       src/machine/org.freedesktop.machine1.service
+
+dist_dbuspolicy_DATA += \
+       src/machine/org.freedesktop.machine1.conf
+
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_machinectl
+
+SYSTEM_UNIT_ALIASES += \
+       systemd-machined.service dbus-org.freedesktop.machine1.service
+
+EXTRA_DIST += \
+       units/systemd-machined.service.in
+
+endif
+
+# ------------------------------------------------------------------------------
 if ENABLE_LOGIND
 systemd_logind_SOURCES = \
        src/login/logind.c \
-       src/login/logind.h \
+       src/login/logind.h
+
+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_SOURCES = \
+       src/login/logind-core.c \
        src/login/logind-dbus.c \
        src/login/logind-device.c \
        src/login/logind-device.h \
@@ -3564,8 +3862,8 @@ systemd_logind_SOURCES = \
        src/login/logind-seat.h \
        src/login/logind-session.c \
        src/login/logind-session.h \
-       src/login/logind-machine.c \
-       src/login/logind-machine.h \
+       src/login/logind-session-device.c \
+       src/login/logind-session-device.h \
        src/login/logind-user.c \
        src/login/logind-user.h \
        src/login/logind-inhibit.c \
@@ -3573,17 +3871,15 @@ systemd_logind_SOURCES = \
        src/login/logind-session-dbus.c \
        src/login/logind-seat-dbus.c \
        src/login/logind-user-dbus.c \
-       src/login/logind-machine-dbus.c \
-       src/login/logind-acl.h
+       src/login/logind-acl.h \
+       src/login/login-shared.c \
+       src/login/login-shared.h
 
-nodist_systemd_logind_SOURCES = \
-       src/login/logind-gperf.c
-
-systemd_logind_CFLAGS = \
+libsystemd_logind_core_la_CFLAGS = \
        $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
+        $(DBUS_CFLAGS)
 
-systemd_logind_LDADD = \
+libsystemd_logind_core_la_LIBADD = \
        libsystemd-label.la \
        libsystemd-audit.la \
        libsystemd-shared.la \
@@ -3593,13 +3889,16 @@ systemd_logind_LDADD = \
        libudev.la
 
 if HAVE_ACL
-systemd_logind_SOURCES += \
+libsystemd_logind_core_la_SOURCES += \
        src/login/logind-acl.c
 
-systemd_logind_LDADD += \
+libsystemd_logind_core_la_LIBADD += \
        libsystemd-acl.la
 endif
 
+noinst_LTLIBRARIES += \
+       libsystemd-logind-core.la
+
 systemd_user_sessions_SOURCES = \
        src/login/user-sessions.c
 
@@ -3629,6 +3928,10 @@ rootbin_PROGRAMS += \
 dist_bashcompletion_DATA += \
        shell-completion/bash/loginctl
 
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_loginctl \
+       shell-completion/zsh/_systemd-inhibit
+
 systemd_inhibit_SOURCES = \
        src/login/inhibit.c
 
@@ -3650,6 +3953,13 @@ test_login_LDADD = \
        libsystemd-login-internal.la \
        libsystemd-shared.la
 
+test_login_shared_SOURCES = \
+       src/login/test-login-shared.c
+
+test_login_shared_LDADD = \
+       libsystemd-login-internal.la \
+       libsystemd-shared.la
+
 test_inhibit_SOURCES = \
        src/login/test-inhibit.c
 
@@ -3661,12 +3971,29 @@ test_inhibit_CFLAGS = \
        $(AM_CFLAGS) \
        $(DBUS_CFLAGS)
 
+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
+
 manual_tests += \
        test-login \
        test-inhibit
 
+tests += \
+       test-login-tables \
+       test-login-shared
+
 libsystemd_login_la_SOURCES = \
-       src/login/sd-login.c
+       src/login/sd-login.c \
+       src/systemd/sd-login.h \
+       src/login/login-shared.c \
+       src/login/login-shared.h
 
 libsystemd_login_la_CFLAGS = \
        $(AM_CFLAGS) \
@@ -3679,7 +4006,8 @@ libsystemd_login_la_LDFLAGS = \
 
 libsystemd_login_la_LIBADD = \
        libsystemd-shared.la \
-       libsystemd-daemon-internal.la
+       libsystemd-daemon-internal.la \
+       $(RT_LIBS)
 
 libsystemd_login_internal_la_SOURCES = \
        $(libsystemd_login_la_SOURCES)
@@ -3707,10 +4035,14 @@ pam_systemd_la_LIBADD = \
        libsystemd-dbus.la \
        libsystemd-shared.la \
        libsystemd-daemon-internal.la \
+       $(RT_LIBS) \
        $(PAM_LIBS)
 
 pamlib_LTLIBRARIES = \
        pam_systemd.la
+
+dist_pamconf_DATA = \
+       src/login/systemd-user
 endif
 
 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
@@ -3728,8 +4060,7 @@ nodist_systemunit_DATA += \
        units/systemd-user-sessions.service
 
 dist_systemunit_DATA += \
-       units/user.slice \
-       units/machine.slice
+       units/user.slice
 
 dist_dbussystemservice_DATA += \
        src/login/org.freedesktop.login1.service
@@ -3816,7 +4147,7 @@ _journal_la_SOURCES = \
 _journal_la_CFLAGS = \
        $(AM_CFLAGS) \
        -fvisibility=default \
-       $(PYTHON_CFLAGS)
+       $(PYTHON_DEVEL_CFLAGS)
 
 _journal_la_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -3825,7 +4156,7 @@ _journal_la_LDFLAGS = \
        -avoid-version
 
 _journal_la_LIBADD = \
-       $(PYTHON_LIBS) \
+       $(PYTHON_DEVEL_LIBS) \
        libsystemd-journal.la
 
 id128_la_SOURCES = \
@@ -3837,7 +4168,7 @@ id128_la_SOURCES = \
 id128_la_CFLAGS = \
        $(AM_CFLAGS) \
        -fvisibility=default \
-       $(PYTHON_CFLAGS) \
+       $(PYTHON_DEVEL_CFLAGS) \
        -I$(top_builddir)/src/python-systemd
 
 id128_la_LDFLAGS = \
@@ -3847,7 +4178,7 @@ id128_la_LDFLAGS = \
        -avoid-version
 
 id128_la_LIBADD = \
-       $(PYTHON_LIBS) \
+       $(PYTHON_DEVEL_LIBS) \
        libsystemd-id128.la
 
 _daemon_la_SOURCES = \
@@ -3858,7 +4189,7 @@ _daemon_la_SOURCES = \
 _daemon_la_CFLAGS = \
        $(AM_CFLAGS) \
        -fvisibility=default \
-       $(PYTHON_CFLAGS) \
+       $(PYTHON_DEVEL_CFLAGS) \
        -I$(top_builddir)/src/python-systemd
 
 _daemon_la_LDFLAGS = \
@@ -3868,7 +4199,7 @@ _daemon_la_LDFLAGS = \
        -avoid-version
 
 _daemon_la_LIBADD = \
-       $(PYTHON_LIBS) \
+       $(PYTHON_DEVEL_LIBS) \
        libsystemd-daemon.la
 
 _reader_la_SOURCES = \
@@ -3879,7 +4210,7 @@ _reader_la_SOURCES = \
 _reader_la_CFLAGS = \
        $(AM_CFLAGS) \
        -fvisibility=default \
-       $(PYTHON_CFLAGS)
+       $(PYTHON_DEVEL_CFLAGS)
 
 _reader_la_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -3888,11 +4219,12 @@ _reader_la_LDFLAGS = \
        -avoid-version
 
 _reader_la_LIBADD = \
-       $(PYTHON_LIBS) \
+       $(PYTHON_DEVEL_LIBS) \
        libsystemd-journal.la \
        libsystemd-id128.la \
        libsystemd-shared.la \
-       libsystemd-daemon-internal.la
+       libsystemd-daemon-internal.la \
+       $(RT_LIBS)
 
 login_la_SOURCES = \
        src/python-systemd/login.c \
@@ -3902,7 +4234,7 @@ login_la_SOURCES = \
 login_la_CFLAGS = \
        $(AM_CFLAGS) \
        -fvisibility=default \
-       $(PYTHON_CFLAGS)
+       $(PYTHON_DEVEL_CFLAGS)
 
 login_la_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -3911,11 +4243,12 @@ login_la_LDFLAGS = \
        -avoid-version
 
 login_la_LIBADD = \
-       $(PYTHON_LIBS) \
+       $(PYTHON_DEVEL_LIBS) \
        libsystemd-journal.la \
        libsystemd-login.la \
        libsystemd-shared.la \
-       libsystemd-daemon-internal.la
+       libsystemd-daemon-internal.la \
+       $(RT_LIBS)
 
 dist_pkgpyexec_PYTHON = \
        src/python-systemd/journal.py \
@@ -3952,6 +4285,11 @@ CLEAN_LOCAL_HOOKS += clean-sphinx
 clean-sphinx:
        -rm -rf docs/html/python-systemd/
 
+# Remove Python stuff, e.g. to force rebuilding for a different Python version.
+clean-python:
+       -rm -rf src/python-systemd/.libs src/python-systemd/*.l[ao]
+       -rm -f _daemon.la id128.la _journal.la login.la _reader.la
+
 # ------------------------------------------------------------------------------
 substitutions = \
        '|rootlibexecdir=$(rootlibexecdir)|' \
@@ -3972,10 +4310,12 @@ substitutions = \
        '|catalogdir=$(catalogdir)|' \
        '|tmpfilesdir=$(tmpfilesdir)|' \
        '|sysctldir=$(sysctldir)|' \
+       '|systemgeneratordir=$(systemgeneratordir)|' \
+       '|usergeneratordir=$(usergeneratordir)|' \
        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
        '|PACKAGE_URL=$(PACKAGE_URL)|' \
-       '|RANDOM_SEED=$(localstatedir)/lib/random-seed|' \
+       '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
        '|prefix=$(prefix)|' \
        '|exec_prefix=$(exec_prefix)|' \
        '|libdir=$(libdir)|' \
@@ -3986,6 +4326,8 @@ substitutions = \
        '|SUSHELL=$(SUSHELL)|' \
        '|DEBUGTTY=$(DEBUGTTY)|' \
        '|KILL=$(KILL)|' \
+       '|KMOD=$(KMOD)|' \
+       '|MKDIR_P=$(MKDIR_P)|' \
        '|QUOTAON=$(QUOTAON)|' \
        '|QUOTACHECK=$(QUOTACHECK)|' \
        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
@@ -4140,9 +4482,6 @@ EXTRA_DIST += \
        docs/sysvinit/README.in \
        docs/var-log/README.in
 
-EXTRA_DIST += \
-       shell-completion/systemd-zsh-completion.zsh
-
 SOCKETS_TARGET_WANTS += \
        systemd-initctl.socket \
        systemd-shutdownd.socket
@@ -4257,7 +4596,9 @@ DISTCHECK_CONFIGURE_FLAGS = \
        --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
        --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
        --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
+       --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
        --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
+       --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
        --with-rootprefix=$$dc_install_base \
        --disable-split-usr
 
@@ -4309,3 +4650,8 @@ install-tree: all
        rm -rf $(abs_srcdir)/install-tree
        $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
        tree $(abs_srcdir)/install-tree
+
+# 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