]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - Makefile.am
resolved: default to the compile-time fallback hostname
[thirdparty/systemd.git] / Makefile.am
index 5cec19fbb8a8f4bfd7236c4ba29986d387886985..dd10aabd360e43eacd8e31667cc56f1b7544c0a2 100644 (file)
@@ -93,6 +93,7 @@ kernelinstalldir = $(prefix)/lib/kernel/install.d
 factory_etcdir = $(datadir)/factory/etc
 factory_pamdir = $(datadir)/factory/etc/pam.d
 bootlibdir = $(prefix)/lib/systemd/boot/efi
+testsdir = $(prefix)/lib/systemd/tests
 
 # And these are the special ones for /
 rootprefix=@rootprefix@
@@ -133,6 +134,7 @@ check_DATA =
 dist_rootlibexec_DATA =
 tests=
 manual_tests =
+TEST_DATA_FILES =
 TEST_EXTENSIONS = .py
 PY_LOG_COMPILER = $(PYTHON)
 DISABLE_HARD_ERRORS = yes
@@ -149,7 +151,8 @@ TESTS =
 endif
 AM_TESTS_ENVIRONMENT = \
        export SYSTEMD_KBD_MODEL_MAP=$(abs_top_srcdir)/src/locale/kbd-model-map; \
-       export SYSTEMD_LANGUAGE_FALLBACK_MAP=$(abs_top_srcdir)/src/locale/language-fallback-map;
+       export SYSTEMD_LANGUAGE_FALLBACK_MAP=$(abs_top_srcdir)/src/locale/language-fallback-map; \
+       export PATH=$(abs_top_builddir):$$PATH;
 
 if ENABLE_BASH_COMPLETION
 dist_bashcompletion_DATA = $(dist_bashcompletion_data)
@@ -217,7 +220,6 @@ AM_CPPFLAGS = \
        -DLIBDIR=\"$(libdir)\" \
        -DROOTLIBDIR=\"$(rootlibdir)\" \
        -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
-       -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
        -I $(top_srcdir)/src \
        -I $(top_builddir)/src/basic \
        -I $(top_srcdir)/src/basic \
@@ -249,6 +251,8 @@ AM_CPPFLAGS = \
        -I $(top_srcdir)/src/libsystemd/sd-device \
        -I $(top_srcdir)/src/libsystemd/sd-id128 \
        -I $(top_srcdir)/src/libsystemd-network \
+       -DABS_SRC_DIR=\"$(abs_top_srcdir)\" \
+       -DABS_BUILD_DIR=\"$(abs_top_builddir)\" \
        $(OUR_CPPFLAGS)
 
 AM_CFLAGS = $(OUR_CFLAGS)
@@ -396,6 +400,7 @@ rootlibexec_PROGRAMS = \
        systemd-initctl \
        systemd-shutdown \
        systemd-remount-fs \
+       systemd-volatile-root \
        systemd-reply-password \
        systemd-fsck \
        systemd-ac-power \
@@ -404,6 +409,11 @@ rootlibexec_PROGRAMS = \
        systemd-socket-proxyd \
        systemd-update-done
 
+if HAVE_BLKID
+rootlibexec_PROGRAMS += \
+       systemd-dissect
+endif
+
 if HAVE_UTMP
 rootlibexec_PROGRAMS += \
        systemd-update-utmp
@@ -529,8 +539,10 @@ nodist_systemunit_DATA = \
        units/serial-getty@.service \
        units/console-getty.service \
        units/container-getty@.service \
+       units/system-update-cleanup.service \
        units/systemd-initctl.service \
        units/systemd-remount-fs.service \
+       units/systemd-volatile-root.service \
        units/systemd-ask-password-wall.service \
        units/systemd-ask-password-console.service \
        units/systemd-sysctl.service \
@@ -592,8 +604,10 @@ EXTRA_DIST += \
        units/console-getty.service.m4.in \
        units/container-getty@.service.m4.in \
        units/rescue.service.in \
+       units/system-update-cleanup.service.in \
        units/systemd-initctl.service.in \
        units/systemd-remount-fs.service.in \
+       units/systemd-volatile-root.service.in \
        units/systemd-update-utmp.service.in \
        units/systemd-update-utmp-runlevel.service.in \
        units/systemd-ask-password-wall.service.in \
@@ -662,6 +676,15 @@ EXTRA_DIST += \
 
 @INTLTOOL_POLICY_RULE@
 
+systemd-mount-install-hook:
+       -$(LN_S) systemd-mount $(DESTDIR)$(bindir)/systemd-umount
+
+systemd-mount-uninstall-hook:
+       -rm $(DESTDIR)$(bindir)/systemd-umount
+
+INSTALL_EXEC_HOOKS += systemd-mount-install-hook
+UNINSTALL_EXEC_HOOKS += systemd-mount-uninstall-hook
+
 # ------------------------------------------------------------------------------
 
 MANPAGES =
@@ -936,7 +959,11 @@ libbasic_la_SOURCES = \
        src/basic/alloc-util.h \
        src/basic/alloc-util.c \
        src/basic/format-util.h \
-       src/basic/nss-util.h
+       src/basic/nss-util.h \
+       src/basic/khash.h \
+       src/basic/khash.c \
+       src/basic/journal-importer.h \
+       src/basic/journal-importer.c
 
 nodist_libbasic_la_SOURCES = \
        src/basic/errno-from-name.h \
@@ -1040,6 +1067,8 @@ libshared_la_SOURCES = \
        src/shared/machine-image.h \
        src/shared/machine-pool.c \
        src/shared/machine-pool.h \
+       src/shared/loop-util.c \
+       src/shared/loop-util.h \
        src/shared/resolve-util.c \
        src/shared/resolve-util.h \
        src/shared/bus-unit-util.c \
@@ -1051,7 +1080,11 @@ libshared_la_SOURCES = \
        src/shared/fdset.c \
        src/shared/fdset.h \
        src/shared/nsflags.h \
-       src/shared/nsflags.c
+       src/shared/nsflags.c \
+       src/shared/dissect-image.c \
+       src/shared/dissect-image.h \
+       src/shared/volatile-util.c \
+       src/shared/volatile-util.h
 
 if HAVE_UTMP
 libshared_la_SOURCES += \
@@ -1074,7 +1107,9 @@ libshared_la_CFLAGS = \
        $(AM_CFLAGS) \
        $(ACL_CFLAGS) \
        $(LIBIDN_CFLAGS) \
-       $(SECCOMP_CFLAGS)
+       $(SECCOMP_CFLAGS) \
+       $(BLKID_CFLAGS) \
+       $(LIBCRYPTSETUP_CFLAGS)
 
 libshared_la_LIBADD = \
        libsystemd-internal.la \
@@ -1083,7 +1118,9 @@ libshared_la_LIBADD = \
        libudev-internal.la \
        $(ACL_LIBS) \
        $(LIBIDN_LIBS) \
-       $(SECCOMP_LIBS)
+       $(SECCOMP_LIBS) \
+       $(BLKID_LIBS) \
+       $(LIBCRYPTSETUP_LIBS)
 
 rootlibexec_LTLIBRARIES += \
        libsystemd-shared.la
@@ -1105,6 +1142,8 @@ libsystemd_shared_la_CFLAGS = \
        $(ACL_CFLAGS) \
        $(LIBIDN_CFLAGS) \
        $(SECCOMP_CFLAGS) \
+       $(BLKID_CFLAGS) \
+       $(LIBCRYPTSETUP_CFLAGS) \
        -fvisibility=default
 
 # We can't use libshared_la_LIBADD here because it would
@@ -1116,7 +1155,9 @@ libsystemd_shared_la_LIBADD = \
        $(libudev_internal_la_LIBADD) \
        $(ACL_LIBS) \
        $(LIBIDN_LIBS) \
-       $(SECCOMP_LIBS)
+       $(SECCOMP_LIBS) \
+       $(BLKID_LIBS) \
+       $(LIBCRYPTSETUP_LIBS)
 
 libsystemd_shared_la_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -1454,7 +1495,8 @@ manual_tests += \
        test-btrfs \
        test-acd \
        test-ipv4ll-manual \
-       test-ask-password-api
+       test-ask-password-api \
+       test-dissect-image
 
 unsafe_tests = \
        test-hostname \
@@ -1490,6 +1532,7 @@ tests += \
        test-utf8 \
        test-ellipsize \
        test-util \
+       test-mount-util \
        test-cpu-set-util \
        test-hexdecoct \
        test-escape \
@@ -1556,7 +1599,8 @@ tests += \
        test-rlimit-util \
        test-signal-util \
        test-selinux \
-       test-sizeof
+       test-sizeof \
+       test-journal-importer
 
 if HAVE_ACL
 tests += \
@@ -1568,7 +1612,7 @@ tests += \
        test-seccomp
 endif
 
-EXTRA_DIST += \
+TEST_DATA_FILES += \
        test/a.service \
        test/basic.target \
        test/b.service \
@@ -1692,13 +1736,17 @@ EXTRA_DIST += \
        test/test-execute/exec-restrict-namespaces-yes.service \
        test/test-execute/exec-restrict-namespaces-mnt.service \
        test/test-execute/exec-restrict-namespaces-mnt-blacklist.service \
+       test/test-execute/exec-read-only-path-succeed.service \
+       test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service \
+       test/test-execute/exec-privatedevices-no-capability-sys-rawio.service \
        test/bus-policy/hello.conf \
        test/bus-policy/methods.conf \
        test/bus-policy/ownerships.conf \
        test/bus-policy/signals.conf \
        test/bus-policy/check-own-rules.conf \
        test/bus-policy/many-rules.conf \
-       test/bus-policy/test.conf
+       test/bus-policy/test.conf \
+       test/hwdb/10-bad.hwdb
 
 
 EXTRA_DIST += \
@@ -1867,6 +1915,12 @@ test_util_SOURCES = \
 test_util_LDADD = \
        libsystemd-shared.la
 
+test_mount_util_SOURCES = \
+       src/test/test-mount-util.c
+
+test_mount_util_LDADD = \
+       libsystemd-shared.la
+
 test_hexdecoct_SOURCES = \
        src/test/test-hexdecoct.c
 
@@ -2065,6 +2119,17 @@ test_ask_password_api_SOURCES = \
 test_ask_password_api_LDADD = \
        libsystemd-shared.la
 
+test_dissect_image_SOURCES = \
+       src/test/test-dissect-image.c
+
+test_dissect_image_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(BLKID_CFLAGS)
+
+test_dissect_image_LDADD = \
+       libsystemd-shared.la \
+       $(BLKID_LIBS)
+
 test_signal_util_SOURCES = \
        src/test/test-signal-util.c
 
@@ -2401,6 +2466,16 @@ test_arphrd_list_SOURCES = \
 test_arphrd_list_LDADD = \
        libsystemd-shared.la
 
+test_journal_importer_SOURCES = \
+       src/test/test-journal-importer.c
+
+test_journal_importer_LDADD = \
+       libsystemd-shared.la
+
+TEST_DATA_FILES += \
+       test/journal-data/journal-1.txt \
+       test/journal-data/journal-2.txt
+
 # ------------------------------------------------------------------------------
 ## .PHONY so it always rebuilds it
 .PHONY: coverage lcov-run lcov-report coverage-sync
@@ -3023,6 +3098,13 @@ systemd_remount_fs_SOURCES = \
 systemd_remount_fs_LDADD = \
        libsystemd-shared.la
 
+# ------------------------------------------------------------------------------
+systemd_volatile_root_SOURCES = \
+       src/volatile-root/volatile-root.c
+
+systemd_volatile_root_LDADD = \
+       libsystemd-shared.la
+
 # ------------------------------------------------------------------------------
 systemd_cgroups_agent_SOURCES = \
        src/cgroups-agent/cgroups-agent.c
@@ -3051,6 +3133,13 @@ systemd_notify_SOURCES = \
 systemd_notify_LDADD = \
        libsystemd-shared.la
 
+# ------------------------------------------------------------------------------
+systemd_dissect_SOURCES = \
+       src/dissect/dissect.c
+
+systemd_dissect_LDADD = \
+       libsystemd-shared.la
+
 # ------------------------------------------------------------------------------
 systemd_path_SOURCES = \
        src/path/path.c
@@ -3701,6 +3790,7 @@ dist_udevrules_DATA += \
        rules/60-persistent-input.rules \
        rules/60-persistent-alsa.rules \
        rules/60-persistent-storage.rules \
+       rules/60-sensor.rules \
        rules/60-serial.rules \
        rules/64-btrfs.rules \
        rules/70-mouse.rules \
@@ -3870,6 +3960,7 @@ dist_udevhwdb_DATA = \
        hwdb/20-net-ifname.hwdb \
        hwdb/60-evdev.hwdb \
        hwdb/60-keyboard.hwdb \
+       hwdb/60-sensor.hwdb \
        hwdb/70-mouse.hwdb \
        hwdb/70-pointingstick.hwdb \
        hwdb/70-touchpad.hwdb
@@ -3939,19 +4030,19 @@ check_DATA += \
        test/sys
 endif
 
-# packed sysfs test tree
-test/sys: test/sys.tar.xz
-       -rm -rf test/sys
+# sysfs test tree
+test/sys: test/sys-script.py
+       -rm -rf $@
        $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
-       -touch test/sys
+       $(AM_V_GEN)$(top_srcdir)/test/sys-script.py $(dir $@)
+       -touch $@
 
 test-sys-distclean:
        -rm -rf test/sys
 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
 
 EXTRA_DIST += \
-       test/sys.tar.xz \
+       test/sys-script.py \
        test/udev-test.pl \
        test/hwdb-test.sh \
        test/rule-syntax-check.py \
@@ -4043,6 +4134,16 @@ test_id128_LDADD = \
 tests += \
        test-id128
 
+# ------------------------------------------------------------------------------
+test_hash_SOURCES = \
+       src/test/test-hash.c
+
+test_hash_LDADD = \
+       libsystemd-shared.la
+
+tests += \
+       test-hash
+
 # ------------------------------------------------------------------------------
 
 bin_PROGRAMS += \
@@ -4760,10 +4861,12 @@ EXTRA_DIST += \
 # ------------------------------------------------------------------------------
 if HAVE_LIBCRYPTSETUP
 rootlibexec_PROGRAMS += \
-       systemd-cryptsetup
+       systemd-cryptsetup \
+       systemd-veritysetup
 
 systemgenerator_PROGRAMS += \
-       systemd-cryptsetup-generator
+       systemd-cryptsetup-generator \
+       systemd-veritysetup-generator
 
 dist_systemunit_DATA += \
        units/cryptsetup.target \
@@ -4786,6 +4889,23 @@ systemd_cryptsetup_generator_SOURCES = \
 systemd_cryptsetup_generator_LDADD = \
        libsystemd-shared.la
 
+systemd_veritysetup_SOURCES = \
+       src/veritysetup/veritysetup.c
+
+systemd_veritysetup_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(LIBCRYPTSETUP_CFLAGS)
+
+systemd_veritysetup_LDADD = \
+       libsystemd-shared.la \
+       $(LIBCRYPTSETUP_LIBS)
+
+systemd_veritysetup_generator_SOURCES = \
+       src/veritysetup/veritysetup-generator.c
+
+systemd_veritysetup_generator_LDADD = \
+       libsystemd-shared.la
+
 SYSINIT_TARGET_WANTS += \
        cryptsetup.target
 
@@ -5536,7 +5656,7 @@ test_dns_packet_SOURCES = \
 
 test_dns_packet_CPPFLAGS = \
        $(AM_CPPFLAGS) \
-       -DRESOLVE_TEST_DIR=\"$(abs_top_srcdir)/src/resolve/test-data\"
+       -I $(top_srcdir)/src/test
 
 test_dns_packet_CFLAGS = \
        $(AM_CFLAGS) \
@@ -5547,18 +5667,20 @@ test_dns_packet_LDADD = \
        $(GCRYPT_LIBS) \
        -lm
 
-EXTRA_DIST += \
-       src/resolve/test-data/_openpgpkey.fedoraproject.org.pkts \
-       src/resolve/test-data/fedoraproject.org.pkts \
-       src/resolve/test-data/gandi.net.pkts \
-       src/resolve/test-data/google.com.pkts \
-       src/resolve/test-data/root.pkts \
-       src/resolve/test-data/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts \
-       src/resolve/test-data/teamits.com.pkts \
-       src/resolve/test-data/zbyszek@fedoraproject.org.pkts \
-       src/resolve/test-data/_443._tcp.fedoraproject.org.pkts \
-       src/resolve/test-data/kyhwana.org.pkts \
-       src/resolve/test-data/fake-caa.pkts
+TEST_DATA_FILES += \
+       test/test-resolve/_openpgpkey.fedoraproject.org.pkts \
+       test/test-resolve/fedoraproject.org.pkts \
+       test/test-resolve/gandi.net.pkts \
+       test/test-resolve/google.com.pkts \
+       test/test-resolve/root.pkts \
+       test/test-resolve/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts \
+       test/test-resolve/teamits.com.pkts \
+       test/test-resolve/zbyszek@fedoraproject.org.pkts \
+       test/test-resolve/_443._tcp.fedoraproject.org.pkts \
+       test/test-resolve/kyhwana.org.pkts \
+       test/test-resolve/fake-caa.pkts
+
+EXTRA_DIST += $(TEST_DATA_FILES)
 
 test_dnssec_SOURCES = \
        src/resolve/test-dnssec.c \
@@ -5655,6 +5777,8 @@ libnetworkd_core_la_SOURCES = \
        src/network/networkd-link.c \
        src/network/networkd-link-bus.c \
        src/network/networkd-ipv4ll.c \
+       src/network/networkd-ipv6-proxy-ndp.h \
+       src/network/networkd-ipv6-proxy-ndp.c \
        src/network/networkd-dhcp4.c \
        src/network/networkd-dhcp6.c \
        src/network/networkd-ndisc.h \
@@ -5717,6 +5841,9 @@ networkctl_LDADD = \
 dist_bashcompletion_data += \
        shell-completion/bash/networkctl
 
+dist_zshcompletion_data += \
+       shell-completion/zsh/_networkctl
+
 test_networkd_conf_SOURCES = \
        src/network/test-networkd-conf.c
 
@@ -6061,6 +6188,8 @@ EXTRA_DIST += \
        test/TEST-13-NSPAWN-SMOKE/Makefile \
        test/TEST-13-NSPAWN-SMOKE/create-busybox-container \
        test/TEST-13-NSPAWN-SMOKE/test.sh \
+       test/TEST-14-MACHINE-ID/Makefile \
+       test/TEST-14-MACHINE-ID/test.sh \
        test/test-functions
 
 EXTRA_DIST += \
@@ -6138,6 +6267,7 @@ substitutions = \
 SED_PROCESS = \
        $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
        $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
+                -e '/^\#\# /d' \
                < $< > $@
 
 units/%: units/%.in
@@ -6486,7 +6616,7 @@ valgrind-tests: $(TESTS)
                if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \
                echo -e "$${x}Skipping non-binary $$f"; else \
                echo -e "$${x}Running $$f"; \
-               $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
+               $(AM_TESTS_ENVIRONMENT) $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
                x="\n\n"; \
        done
 
@@ -6584,6 +6714,20 @@ tests += \
        test-libsystemd-sym \
        test-libudev-sym
 
+.PHONY: install-tests
+install-tests: $(tests) $(TEST_DATA_FILES)
+       for f in $(tests); do \
+           if [ -x $(top_builddir)/.libs/$$f ]; then \
+               install -D -m 755 $(top_builddir)/.libs/$$f $(DESTDIR)/$(testsdir)/$$f; \
+           else \
+               install -D -m 755 $(top_builddir)/$$f $(DESTDIR)/$(testsdir)/$$f; \
+           fi; \
+       done
+       for f in $(TEST_DATA_FILES); do \
+           install -D -m 644 $(top_srcdir)/$$f $(DESTDIR)/$(testsdir)/testdata/$${f#test/}; \
+       done
+
+
 .PHONY: cppcheck
 cppcheck:
        cppcheck --enable=all -q $(top_srcdir)