chiark / gitweb /
loginctl: drop casts in printf
[elogind.git] / Makefile.am
index 2bd2898..8250572 100644 (file)
@@ -38,9 +38,9 @@ SUBDIRS = . po
 # Keep the test-suite.log
 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
 
-LIBELOGIND_CURRENT=12
-LIBELOGIND_REVISION=0
-LIBELOGIND_AGE=12
+LIBELOGIND_CURRENT=16
+LIBELOGIND_REVISION=4
+LIBELOGIND_AGE=16
 
 # Dirs of external packages
 dbuspolicydir=@dbuspolicydir@
@@ -58,7 +58,7 @@ PKTTYAGENT=$(bindir)/pkttyagent
 
 # Our own, non-special dirs
 pkgsysconfdir=$(sysconfdir)/elogind
-pkgincludedir=$(includedir)/elogind
+pkgincludedir=$(includedir)/elogind/systemd
 udevrulesdir=@udevrulesdir@
 udevbindir=@udevbindir@
 udevlibexecdir=$(udevbindir)
@@ -90,10 +90,12 @@ polkitpolicy_files =
 dist_udevrules_DATA =
 nodist_udevrules_DATA =
 dist_pkgsysconf_DATA =
+nodist_pkgsysconf_DATA =
 dist_dbuspolicy_DATA =
 dist_dbussystemservice_DATA =
 check_PROGRAMS =
 check_DATA =
+dist_rootlibexec_DATA =
 tests=
 manual_tests =
 if ENABLE_TESTS
@@ -104,6 +106,13 @@ noinst_PROGRAMS =
 TESTS =
 endif
 
+if ENABLE_BASH_COMPLETION
+dist_bashcompletion_DATA = $(dist_bashcompletion_data)
+endif
+if ENABLE_ZSH_COMPLETION
+dist_zshcompletion_DATA = $(dist_zshcompletion_data)
+endif
+
 in_files = $(filter %.in,$(EXTRA_DIST))
 in_in_files = $(filter %.in.in, $(in_files))
 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
@@ -121,7 +130,7 @@ AM_CPPFLAGS = \
        -include $(top_builddir)/config.h \
        -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
        -DSYSTEMD_CGROUP_CONTROLLER=\"$(CGROUP_CONTROLLER)\" \
-       -DELOGIND_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/elogind-cgroups-agent\" \
+       -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/elogind-cgroups-agent\" \
        -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
        -DPOLKIT_AGENT_BINARY_PATH=\"$(PKTTYAGENT)\" \
        -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
@@ -144,6 +153,9 @@ AM_CPPFLAGS = \
        -I $(top_srcdir)/src/libelogind/sd-bus \
        -I $(top_srcdir)/src/libelogind/sd-event \
        -I $(top_srcdir)/src/libelogind/sd-login \
+       -I $(top_srcdir)/src/libelogind/sd-id128 \
+       -I $(top_srcdir)/src/update-utmp \
+       -I $(top_srcdir)/src/sleep \
        $(OUR_CPPFLAGS)
 
 AM_CFLAGS = $(OUR_CFLAGS)
@@ -224,70 +236,65 @@ man_MANS = \
 
 noinst_DATA += \
        $(HTML_FILES) \
-       $(HTML_ALIAS)
+       $(HTML_ALIAS) \
+       docs/html/man
+endif
 
 CLEANFILES += \
        $(man_MANS) \
        $(HTML_FILES) \
-       $(HTML_ALIAS)
+       $(HTML_ALIAS) \
+       docs/html/man
 
 docs/html/man:
        $(AM_V_at)$(MKDIR_P) $(dir $@)
        $(AM_V_LN)$(LN_S) -f ../../man $@
 
-noinst_DATA += \
-       docs/html/man
-
-CLEANFILES += \
-       docs/html/man
-
-if HAVE_PYTHON
 man/index.html: man/elogind.index.html
        $(AM_V_LN)$(LN_S) -f elogind.index.html $@
 
+if HAVE_PYTHON
 noinst_DATA += \
        man/index.html
+endif
 
 CLEANFILES += \
        man/index.html
 
-XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml)
-NON_INDEX_XML_FILES = $(filter-out man/elogind.index.xml,$(XML_FILES))
-SOURCE_XML_FILES = ${patsubst %,$(top_srcdir)/%,$(filter-out man/elogind.directives.xml,$(NON_INDEX_XML_FILES))}
+XML_GLOB            := $(wildcard $(top_srcdir)/man/*.xml)
+DIRECTIVE_FILE      := man/elogind.directives.xml
+INDEX_XML_FILE      := man/elogind.index.xml
+NON_INDEX_XML_FILES := $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_FILES))
+ALL_XML_FILES       := $(INDEX_XML_FILE) $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_GLOB))
+SOURCE_XML_FILES    := ${patsubst %,$(top_srcdir)/%,$(filter-out $(DIRECTIVE_FILE),$(NON_INDEX_XML_FILES))}
 
 # This target should only be run manually. It recreates Makefile-man.am
 # file in the source directory based on all man/*.xml files. Run it after
 # adding, removing, or changing the conditional in a man page.
-update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB)
-       $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
+update-man-list: $(top_srcdir)/tools/make-man-rules.py $(ALL_XML_FILES) man/custom-entities.ent
+       $(AM_V_GEN)$(PYTHON) $< $(ALL_XML_FILES) > $(top_srcdir)/Makefile-man.tmp
        $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
-               @echo "Makefile-man.am has been regenerated"
+       @echo "Makefile-man.am has been regenerated"
 
-man/elogind.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
+$(INDEX_XML_FILE): $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
        $(AM_V_at)$(MKDIR_P) $(dir $@)
        $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
 
-man/elogind.directives.xml: $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
+$(DIRECTIVE_FILE): $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
        $(AM_V_at)$(MKDIR_P) $(dir $@)
        $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
 
 CLEANFILES += \
-       man/elogind.index.xml \
-       man/elogind.directives.xml
-
-EXTRA_DIST += \
-       tools/make-man-rules.py
-
-endif
-
-endif
+       $(INDEX_XML_FILE) \
+       $(DIRECTIVE_FILE)
 
 EXTRA_DIST += \
-       $(filter-out man/elogind.directives.xml,$(XML_FILES)) \
-       $(HTML_FILES) \
-       $(HTML_ALIAS) \
-       $(man_MANS) \
-       $(NULL)
+       $(filter-out $(DIRECTIVE_FILE) $(INDEX_XML_FILE),$(XML_FILES)) \
+       tools/make-man-index.py \
+       tools/make-man-rules.py \
+       tools/make-directive-index.py \
+       tools/xml_helper.py \
+       man/glib-event-glue.c
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -295,28 +302,67 @@ noinst_LTLIBRARIES += \
 
 libbasic_la_SOURCES = \
        src/basic/missing.h \
-       src/basic/musl_missing.h \
-       src/basic/musl_missing.c \
-       src/basic/capability.c \
-       src/basic/capability.h \
+       src/basic/capability-util.c \
+       src/basic/capability-util.h \
        src/basic/conf-files.c \
        src/basic/conf-files.h \
+       src/basic/stdio-util.h \
        src/basic/hostname-util.h \
        src/basic/hostname-util.c \
        src/basic/unit-name.c \
        src/basic/unit-name.h \
+       src/basic/unaligned.h \
        src/basic/util.c \
        src/basic/util.h \
+       src/basic/io-util.c \
+       src/basic/io-util.h \
+       src/basic/string-util.c \
+       src/basic/string-util.h \
+       src/basic/parse-util.c \
+       src/basic/parse-util.h \
+       src/basic/fd-util.c \
+       src/basic/fd-util.h \
+       src/basic/user-util.c \
+       src/basic/user-util.h \
+       src/basic/dirent-util.c \
+       src/basic/dirent-util.h \
+       src/basic/xattr-util.c \
+       src/basic/xattr-util.h \
+       src/basic/proc-cmdline.c \
+       src/basic/proc-cmdline.h \
+       src/basic/fs-util.c \
+       src/basic/fs-util.h \
+       src/basic/syslog-util.c \
+       src/basic/syslog-util.h \
+       src/basic/stat-util.c \
+       src/basic/stat-util.h \
+       src/basic/mount-util.c \
+       src/basic/mount-util.h \
+       src/basic/hexdecoct.c \
+       src/basic/hexdecoct.h \
+       src/basic/extract-word.c \
+       src/basic/extract-word.h \
+       src/basic/escape.c \
+       src/basic/escape.h \
        src/basic/path-util.c \
        src/basic/path-util.h \
+       src/basic/parse-printf-format.c \
+       src/basic/parse-printf-format.h \
        src/basic/time-util.c \
        src/basic/time-util.h \
+       src/basic/locale-util.c \
+       src/basic/locale-util.h \
+       src/basic/umask-util.h \
        src/basic/signal-util.c \
        src/basic/signal-util.h \
+       src/basic/string-table.c \
+       src/basic/string-table.h \
        src/basic/mempool.c \
        src/basic/mempool.h \
        src/basic/hashmap.c \
        src/basic/hashmap.h \
+       src/basic/hash-funcs.c \
+       src/basic/hash-funcs.h \
        src/basic/siphash24.c \
        src/basic/siphash24.h \
        src/basic/prioq.c \
@@ -335,6 +381,8 @@ libbasic_la_SOURCES = \
        src/basic/utf8.h \
        src/basic/gunicode.c \
        src/basic/gunicode.h \
+       src/basic/socket-util.c \
+       src/basic/socket-util.h \
        src/basic/fileio.c \
        src/basic/fileio.h \
        src/basic/mkdir.c \
@@ -347,8 +395,8 @@ libbasic_la_SOURCES = \
        src/basic/terminal-util.h \
        src/basic/login-util.h \
        src/basic/login-util.c \
-       src/basic/audit.c \
-       src/basic/audit.h \
+       src/basic/audit-util.c \
+       src/basic/audit-util.h \
        src/basic/memfd-util.c \
        src/basic/memfd-util.h \
        src/basic/process-util.c \
@@ -368,8 +416,8 @@ libbasic_la_SOURCES = \
        src/basic/rm-rf.h \
        src/basic/copy.c \
        src/basic/copy.h \
-       src/basic/parse-printf-format.c \
-       src/basic/parse-printf-format.h
+       src/basic/alloc-util.h \
+       src/basic/alloc-util.c
 
 nodist_libbasic_la_SOURCES = \
        src/basic/errno-from-name.h \
@@ -395,19 +443,20 @@ noinst_LTLIBRARIES += \
        libshared.la
 
 libshared_la_SOURCES = \
-       src/shared/sleep-config.c \
-       src/shared/sleep-config.h \
+       src/shared/bus-util.c \
+       src/shared/bus-util.h \
+       src/shared/clean-ipc.c \
+       src/shared/clean-ipc.h \
        src/shared/conf-parser.c \
        src/shared/conf-parser.h \
+       src/shared/musl_missing.h \
+       src/shared/musl_missing.c \
        src/shared/pager.c \
        src/shared/pager.h \
+       src/shared/sleep-config.c \
+       src/shared/sleep-config.h \
        src/shared/spawn-polkit-agent.c \
-       src/shared/spawn-polkit-agent.h \
-       src/shared/clean-ipc.c \
-       src/shared/clean-ipc.h \
-       src/shared/utmp-wtmp.h \
-       src/shared/bus-util.c \
-       src/shared/bus-util.h
+       src/shared/spawn-polkit-agent.h
 
 if HAVE_ACL
 libshared_la_SOURCES += \
@@ -421,9 +470,45 @@ libshared_la_CFLAGS = \
 
 libshared_la_LIBADD = \
        libelogind-internal.la \
+       libbasic.la \
        $(UDEV_LIBS) \
        $(ACL_LIBS)
 
+noinst_LTLIBRARIES += \
+       libelogind-shared.la
+
+libelogind_shared_la_SOURCES = \
+       $(libbasic_la_SOURCES) \
+       $(libshared_la_SOURCES) \
+       $(libelogind_internal_la_SOURCES)
+
+libelogind_shared_la_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(libbasic_la_CFLAGS) \
+       $(libshared_la_CFLAGS) \
+       $(libelogind_internal_la_CFLAGS) \
+       $(libelogind_journal_internal_la_CFLAGS) \
+       $(libudev_internal_la_CFLAGS) \
+       $(ACL_CFLAGS) \
+       $(LIBIDN_CFLAGS) \
+       $(SECCOMP_CFLAGS) \
+       -fvisibility=default
+
+# We can't use libshared_la_LIBADD here because it would
+# pull in libelogind*-internal.la
+libelogind_shared_la_LIBADD = \
+       $(libbasic_la_LIBADD) \
+       $(libelogind_internal_la_LIBADD) \
+       $(UDEV_LIBS) \
+       $(ACL_LIBS) \
+       $(LIBIDN_LIBS) \
+       $(SECCOMP_LIBS)
+
+libelogind_shared_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -release $(PACKAGE_VERSION)
+
+ # -----------------------------------------------------------------------------
 gperf_txt_sources = \
        src/basic/errno-list.txt
 
@@ -479,7 +564,7 @@ elogind_cgroups_agent_SOURCES = \
        src/cgroups-agent/cgroups-agent.c
 
 elogind_cgroups_agent_LDADD = \
-       libshared.la
+       libelogind-shared.la
 
 # ------------------------------------------------------------------------------
 libelogind_internal_la_SOURCES = \
@@ -532,13 +617,11 @@ libelogind_internal_la_SOURCES = \
        src/libelogind/sd-bus/bus-protocol.h \
        src/libelogind/sd-event/sd-event.c \
        src/libelogind/sd-id128/sd-id128.c \
+       src/libelogind/sd-id128/id128-util.h \
+       src/libelogind/sd-id128/id128-util.c \
        src/libelogind/sd-daemon/sd-daemon.c \
        src/libelogind/sd-login/sd-login.c
 
-libelogind_internal_la_LIBADD = \
-       libbasic.la \
-       -lresolv
-
 noinst_LTLIBRARIES += \
        libelogind-internal.la
 
@@ -547,14 +630,7 @@ EXTRA_DIST += \
        src/libelogind/sd-bus/DIFFERENCES \
        src/libelogind/sd-bus/GVARIANT-SERIALIZATION
 
-libelogind_la_SOURCES = \
-       $(libelogind_internal_la_SOURCES)
-
-nodist_libelogind_la_SOURCES = \
-       $(nodist_libelogind_internal_la_SOURCES)
-
-libelogind_la_CFLAGS = \
-       $(libelogind_internal_la_CFLAGS)
+libelogind_la_SOURCES =
 
 libelogind_la_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -562,7 +638,8 @@ libelogind_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/libelogind/libelogind.sym
 
 libelogind_la_LIBADD = \
-       $(libelogind_internal_la_LIBADD)
+       libelogind-internal.la \
+       libbasic.la
 
 libelogind-install-hook:
        libname=libelogind.so && $(move-to-rootlibdir)
@@ -582,6 +659,19 @@ pkginclude_HEADERS += \
        src/systemd/sd-id128.h \
        src/systemd/_sd-common.h
 
+header-install-hook:
+       $(MKDIR_P) $(DESTDIR)/$(pkgincludedir)
+       cd $(DESTDIR)/$(includedir)/elogind && \
+               for hdr in $(notdir $(pkginclude_HEADERS)) ; do \
+                       rm -f $$hdr ; \
+                       $(LN_S) systemd/$$hdr $$hdr ; \
+               done
+
+header-uninstall-hook:
+       m -f $(DESTDIR)/$(includedir)/elogind/*.h
+
+INSTALL_EXEC_HOOKS += header-install-hook
+UNINSTALL_EXEC_HOOKS += header-uninstall-hook
 
 lib_LTLIBRARIES += \
        libelogind.la
@@ -598,6 +688,16 @@ elogind_LDADD = \
        libelogind-core.la
 
 libelogind_core_la_SOURCES = \
+       src/core/cgroup.h \
+       src/core/cgroup.c \
+       src/core/mount-setup.h \
+       src/core/mount-setup.c \
+        src/login/elogind.c \
+        src/login/elogind.h \
+        src/login/elogind-action.c \
+        src/login/elogind-action.h \
+       src/login/elogind-dbus.c \
+       src/login/elogind-dbus.h \
        src/login/logind-core.c \
        src/login/logind-device.c \
        src/login/logind-device.h \
@@ -621,13 +721,17 @@ libelogind_core_la_SOURCES = \
        src/login/logind-user-dbus.c \
        src/login/logind-utmp.c \
        src/login/logind-acl.h \
-       src/core/cgroup.h \
-       src/core/cgroup.c \
-       src/core/mount-setup.h \
-       src/core/mount-setup.c
+       src/sleep/sleep.c \
+       src/sleep/sleep.h
+
+if HAVE_UTMP
+libelogind_core_la_SOURCES += \
+       src/shared/utmp-wtmp.c \
+       src/update-utmp/update-utmp.c
+endif
 
 libelogind_core_la_LIBADD = \
-       libshared.la
+       libelogind-shared.la
 
 if HAVE_ACL
 libelogind_core_la_SOURCES += \
@@ -641,32 +745,30 @@ pkglibexec_PROGRAMS += \
        elogind
 
 loginctl_SOURCES = \
+       src/login/eloginctl.c \
+       src/login/eloginctl.h \
        src/login/loginctl.c \
        src/login/sysfs-show.h \
        src/login/sysfs-show.c
 
 loginctl_LDADD = \
-       libshared.la
+       libelogind-shared.la
 
 rootbin_PROGRAMS += \
        loginctl
 
-if ENABLE_BASH_COMPLETION
-dist_bashcompletion_DATA = \
+dist_bashcompletion_data = \
        shell-completion/bash/loginctl
-endif
 
-if ENABLE_ZSH_COMPLETION
-dist_zshcompletion_DATA = \
+dist_zshcompletion_data = \
        shell-completion/zsh/_loginctl \
        shell-completion/zsh/_elogind-inhibit
-endif
 
 elogind_inhibit_SOURCES = \
        src/login/inhibit.c
 
 elogind_inhibit_LDADD = \
-       libshared.la
+       libelogind-shared.la
 
 rootbin_PROGRAMS += \
        elogind-inhibit
@@ -675,19 +777,19 @@ test_login_SOURCES = \
        src/libelogind/sd-login/test-login.c
 
 test_login_LDADD = \
-       libshared.la
+       libelogind-shared.la
 
 test_login_shared_SOURCES = \
        src/login/test-login-shared.c
 
 test_login_shared_LDADD = \
-       libshared.la
+       libelogind-shared.la
 
 test_inhibit_SOURCES = \
        src/login/test-inhibit.c
 
 test_inhibit_LDADD = \
-       libshared.la
+       libelogind-shared.la
 
 test_login_tables_SOURCES = \
        src/login/test-login-tables.c
@@ -740,7 +842,7 @@ dist_dbussystemservice_DATA += \
 dist_dbuspolicy_DATA += \
        src/login/org.freedesktop.login1.conf
 
-dist_pkgsysconf_DATA += \
+nodist_pkgsysconf_DATA += \
        src/login/logind.conf
 
 polkitpolicy_files += \
@@ -762,7 +864,8 @@ gperf_gperf_sources = \
 
 EXTRA_DIST += \
        src/login/71-seat.rules.in \
-       src/login/73-seat-late.rules.in
+       src/login/73-seat-late.rules.in \
+       src/login/logind.conf.in
 
 # ------------------------------------------------------------------------------
 substitutions = \
@@ -784,6 +887,7 @@ substitutions = \
        '|udevlibexecdir=$(udevlibexecdir)|' \
        '|KILL=$(KILL)|' \
        '|MKDIR_P=$(MKDIR_P)|' \
+       '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
        '|TTY_GID=$(TTY_GID)|'
@@ -934,7 +1038,6 @@ DISTCHECK_CONFIGURE_FLAGS += \
 endif
 
 .PHONY: dist-check-help
-
 dist-check-help: $(rootbin_PROGRAMS)
        for i in $(abspath $^); do                                             \
             if $$i  --help | grep -v 'default:' | grep -E -q '.{80}.' ; then   \
@@ -943,6 +1046,18 @@ dist-check-help: $(rootbin_PROGRAMS)
                exit 1;                                                        \
             fi; done
 
+include_compilers = "$(CC)" "$(CC) -ansi" "$(CC) -std=iso9899:1990"
+public_headers = $(filter-out src/systemd/_sd-common.h, $(pkginclude_HEADERS) $(include_HEADERS))
+.PHONY: dist-check-includes
+dist-check-includes: $(public_headers)
+       @res=0;                                                                 \
+       for i in $(abspath $^); do                                              \
+           for cc in $(include_compilers); do                                  \
+               echo "$$cc -o/dev/null -c -x c -include "$$i" - </dev/null";    \
+               $$cc -o/dev/null -c -x c -include "$$i" - </dev/null || res=1;  \
+           done;                                                               \
+       done; exit $$res
+
 dist:
 
 .PHONY: git-tag
@@ -957,7 +1072,7 @@ git-tar:
         for f in `find elogind-$(VERSION)-raw/ -type f | cut -d '/' -f 2-` ; do \
                $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ;            \
                $(AWK) 'BEGIN                    { i=0;e=0      }        \
-                       /^#if\s+0\s*$$/          { i=1;next     }        \
+                       /^#if\s+0.*elogind.*$$/  { i=1;next     }        \
                        /^#else\s*$$/            {                       \
                            { if ( i==1 ) e=1; else print }{next}        \
                        }                                                \
@@ -991,7 +1106,7 @@ install-tree: all
 .PHONY: valgrind-tests
 valgrind-tests: $(TESTS)
        $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
-               if file $$f | grep -q shell; then \
+               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; \