chiark / gitweb /
zsh-completion: add bootctl
[elogind.git] / Makefile.am
index df552e3..558aa1b 100644 (file)
@@ -177,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 \
@@ -1729,6 +1730,10 @@ bootctl_LDADD = \
 
 bin_PROGRAMS += \
        bootctl
+
+dist_zshcompletion_DATA += \
+       shell-completion/zsh/_bootctl
+
 endif
 
 # ------------------------------------------------------------------------------
@@ -1783,14 +1788,10 @@ systemd_cgroups_agent_LDADD = \
 systemctl_SOURCES = \
        src/systemctl/systemctl.c
 
-systemctl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 systemctl_LDADD = \
        libsystemd-units.la \
        libsystemd-label.la \
-       libsystemd-dbus.la \
+       libsystemd-bus-internal.la \
        libsystemd-logs.la \
        libsystemd-login-internal.la \
        libsystemd-journal-internal.la \
@@ -1884,6 +1885,7 @@ 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 = \
@@ -1929,11 +1931,11 @@ 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 \
@@ -1994,8 +1996,7 @@ pkgconfiglib_DATA += \
        src/libsystemd-bus/libsystemd-bus.pc
 
 EXTRA_DIST += \
-       src/libsystemd-bus/libsystemd-bus.pc.in \
-       src/libsystemd-bus/libsystemd-bus.sym
+       src/libsystemd-bus/libsystemd-bus.pc.in
 
 lib_LTLIBRARIES += \
        libsystemd-bus.la
@@ -2009,6 +2010,17 @@ libsystemd_bus_internal_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 \
@@ -2024,7 +2036,7 @@ tests += \
        test-bus-objects \
        test-event
 
-noinst_PROGRAMS += \
+bin_PROGRAMS += \
        busctl
 
 test_bus_marshal_SOURCES = \
@@ -2035,13 +2047,17 @@ test_bus_marshal_LDADD = \
        libsystemd-id128-internal.la \
        libsystemd-daemon-internal.la \
        libsystemd-shared.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
@@ -2081,13 +2097,17 @@ test_bus_objects_SOURCES = \
 
 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-shared.la \
+       libsystemd-bus-dump.la \
+       libsystemd-capability.la \
+       $(CAP_LIBS)
 
 test_bus_match_SOURCES = \
        src/libsystemd-bus/test-bus-match.c
@@ -2105,7 +2125,14 @@ test_bus_kernel_LDADD = \
        libsystemd-bus-internal.la \
        libsystemd-id128-internal.la \
        libsystemd-daemon-internal.la \
-       libsystemd-shared.la
+       libsystemd-shared.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
@@ -2139,7 +2166,14 @@ test_bus_zero_copy_LDADD = \
        libsystemd-bus-internal.la \
        libsystemd-id128-internal.la \
        libsystemd-daemon-internal.la \
-       libsystemd-shared.la
+       libsystemd-shared.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
@@ -2164,7 +2198,14 @@ busctl_LDADD = \
        libsystemd-bus-internal.la \
        libsystemd-id128-internal.la \
        libsystemd-daemon-internal.la \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-bus-dump.la \
+       libsystemd-capability.la \
+       $(CAP_LIBS)
+
+busctl_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(CAP_CFLAGS)
 
 # ------------------------------------------------------------------------------
 if ENABLE_GTK_DOC
@@ -2183,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 \
@@ -2212,8 +2254,7 @@ 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 \
@@ -2765,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 = \
@@ -2777,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 = \
@@ -2816,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
 
 # ------------------------------------------------------------------------------
 
@@ -2947,6 +2989,7 @@ test_catalog_LDADD = \
        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 \
@@ -3164,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
@@ -3775,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 \
@@ -3847,14 +3944,12 @@ loginctl_SOURCES = \
        src/login/loginctl.c \
        src/login/sysfs-show.c
 
-loginctl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 loginctl_LDADD = \
-       libsystemd-dbus.la \
+       libsystemd-bus-internal.la \
        libudev-internal.la \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la
 
 rootbin_PROGRAMS += \
        loginctl
@@ -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 \
@@ -4051,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 \
@@ -4572,15 +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 ; \
+       $(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
 
-check-api-docs: $(lib_LTLIBRARIES) man
-       for symbol in `for f in $(lib_LTLIBRARIES) ; do nm -g --defined-only $(builddir)/.libs/"$${f/.la/.so}" 2>&1 /dev/null | grep " T " | cut -d" " -f3 ; done` ; do \
+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
+       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