chiark / gitweb /
e973f1923b309b5649751937d6b09fec24dc8794
[elogind.git] / Makefile.am
1 #  -*- Mode: makefile; indent-tabs-mode: t -*-
2 #
3 #  This file is part of elogind.
4 #
5 #  Copyright 2010-2012 Lennart Poettering
6 #  Copyright 2010-2012 Kay Sievers
7 #  Copyright 2013 Zbigniew JÄ™drzejewski-Szmek
8 #  Copyright 2013 David Strauss
9 #
10 #  elogind is free software; you can redistribute it and/or modify it
11 #  under the terms of the GNU Lesser General Public License as published by
12 #  the Free Software Foundation; either version 2.1 of the License, or
13 #  (at your option) any later version.
14 #
15 #  elogind is distributed in the hope that it will be useful, but
16 #  WITHOUT ANY WARRANTY; without even the implied warranty of
17 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 #  Lesser General Public License for more details.
19 #
20 #  You should have received a copy of the GNU Lesser General Public License
21 #  along with elogind; If not, see <http://www.gnu.org/licenses/>.
22
23 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
24 AM_MAKEFLAGS = --no-print-directory
25 AUTOMAKE_OPTIONS = color-tests parallel-tests
26
27 GCC_COLORS ?= 'ooh, shiny!'
28 export GCC_COLORS
29
30 SUBDIRS = . po
31
32 # remove targets if the command fails
33 .DELETE_ON_ERROR:
34
35 # keep intermediate files
36 .SECONDARY:
37
38 # Keep the test-suite.log
39 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
40
41 LIBELOGIND_CURRENT=6
42 LIBELOGIND_REVISION=0
43 LIBELOGIND_AGE=6
44
45 # Dirs of external packages
46 dbuspolicydir=@dbuspolicydir@
47 dbussessionservicedir=@dbussessionservicedir@
48 dbussystemservicedir=@dbussystemservicedir@
49 pamlibdir=@pamlibdir@
50 pamconfdir=@pamconfdir@
51 pkgconfiglibdir=$(libdir)/pkgconfig
52 polkitpolicydir=$(datadir)/polkit-1/actions
53 bashcompletiondir=@bashcompletiondir@
54 zshcompletiondir=@zshcompletiondir@
55 varlogdir=$(localstatedir)/log
56 elogindstatedir=$(localstatedir)/lib/elogind
57 catalogstatedir=$(elogindstatedir)/catalog
58 xinitrcdir=$(sysconfdir)/X11/xinit/xinitrc.d
59
60 # Our own, non-special dirs
61 pkgsysconfdir=$(sysconfdir)/elogind
62 userunitdir=$(prefix)/lib/elogind/user
63 userpresetdir=$(prefix)/lib/elogind/user-preset
64 tmpfilesdir=$(prefix)/lib/tmpfiles.d
65 sysusersdir=$(prefix)/lib/sysusers.d
66 sysctldir=$(prefix)/lib/sysctl.d
67 binfmtdir=$(prefix)/lib/binfmt.d
68 modulesloaddir=$(prefix)/lib/modules-load.d
69 networkdir=$(rootprefix)/lib/elogind/network
70 pkgincludedir=$(includedir)/elogind
71 systemgeneratordir=$(rootlibexecdir)/system-generators
72 usergeneratordir=$(prefix)/lib/elogind/user-generators
73 systemshutdowndir=$(rootlibexecdir)/system-shutdown
74 systemsleepdir=$(rootlibexecdir)/system-sleep
75 systemunitdir=$(rootprefix)/lib/elogind/system
76 systempresetdir=$(rootprefix)/lib/elogind/system-preset
77 udevrulesdir=$(rootprefix)/lib/udev/rules.d
78 catalogdir=$(prefix)/lib/elogind/catalog
79 kernelinstalldir = $(prefix)/lib/kernel/install.d
80 factory_etcdir = $(prefix)/share/factory/etc
81 factory_pamdir = $(prefix)/share/factory/etc/pam.d
82 bootlibdir = $(prefix)/lib/elogind/boot/efi
83
84 # And these are the special ones for /
85 rootprefix=@rootprefix@
86 rootbindir=$(rootprefix)/bin
87 rootlibexecdir=$(rootprefix)/lib/elogind
88
89 EXTRA_DIST =
90 BUILT_SOURCES =
91 INSTALL_EXEC_HOOKS =
92 UNINSTALL_EXEC_HOOKS =
93 INSTALL_DATA_HOOKS =
94 UNINSTALL_DATA_HOOKS =
95 DISTCLEAN_LOCAL_HOOKS =
96 CLEAN_LOCAL_HOOKS =
97 pkginclude_HEADERS =
98 noinst_LTLIBRARIES =
99 lib_LTLIBRARIES =
100 include_HEADERS =
101 noinst_DATA =
102 pkgconfiglib_DATA =
103 polkitpolicy_in_in_files =
104 polkitpolicy_in_files =
105 polkitpolicy_files =
106 dist_pkgsysconf_DATA =
107 nodist_pkgsysconf_DATA =
108 dist_pkgdata_DATA =
109 dist_dbuspolicy_DATA =
110 dist_dbussystemservice_DATA =
111 dist_systemunit_DATA_busnames =
112 dist_sysusers_DATA =
113 check_PROGRAMS =
114 check_DATA =
115 tests=
116 manual_tests =
117 TEST_EXTENSIONS = .py
118 PY_LOG_COMPILER = $(PYTHON)
119 if ENABLE_TESTS
120 noinst_PROGRAMS = $(manual_tests) $(tests)
121 TESTS = $(tests)
122 else
123 noinst_PROGRAMS =
124 TESTS =
125 endif
126
127 in_files = $(filter %.in,$(EXTRA_DIST))
128 in_in_files = $(filter %.in.in, $(in_files))
129 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
130
131 CLEANFILES = $(BUILT_SOURCES) \
132         $(pkgconfiglib_DATA) \
133         $(in_files:.in=) $(in_in_files:.in.in=) \
134         $(m4_files:.m4=)
135
136 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
137         $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
138         $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
139
140 # FIXME a different pkttyagent path...
141
142 AM_CPPFLAGS = \
143         -include $(top_builddir)/config.h \
144         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
145         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
146         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
147         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
148         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
149         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
150         -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
151         -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
152         -DCERTIFICATE_ROOT=\"$(CERTIFICATEROOT)\" \
153         -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
154         -DROOTPREFIX=\"$(rootprefix)\" \
155         -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/elogind/\" \
156         -DRANDOM_SEED=\"$(localstatedir)/lib/elogind/random-seed\" \
157         -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
158         -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
159         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
160         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
161         -DELOGIND_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
162         -DELOGIND_LANGUAGE_FALLBACK_MAP=\"$(pkgdatadir)/language-fallback-map\" \
163         -DX_SERVER=\"$(bindir)/X\" \
164         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
165         -DQUOTACHECK=\"$(QUOTACHECK)\" \
166         -DKEXEC=\"$(KEXEC)\" \
167         -DLIBDIR=\"$(libdir)\" \
168         -DROOTLIBDIR=\"$(rootlibdir)\" \
169         -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
170         -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
171         -I $(top_srcdir)/src \
172         -I $(top_builddir)/src/shared \
173         -I $(top_srcdir)/src/shared \
174         -I $(top_srcdir)/src/login \
175         -I $(top_srcdir)/src/systemd \
176         -I $(top_builddir)/src/core \
177         -I $(top_srcdir)/src/core \
178         -I $(top_srcdir)/src/libelogind/sd-bus \
179         -I $(top_srcdir)/src/libelogind/sd-event \
180         -I $(top_srcdir)/src/libelogind/sd-device \
181         $(UDEV_CFLAGS) \
182         $(OUR_CPPFLAGS)
183
184 AM_CFLAGS = $(OUR_CFLAGS)
185 AM_LDFLAGS = $(OUR_LDFLAGS)
186
187 # ------------------------------------------------------------------------------
188 define move-to-rootlibdir
189         if test "$(libdir)" != "$(rootlibdir)"; then \
190                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
191                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
192                 rm -f $(DESTDIR)$(libdir)/$$libname && \
193                 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
194                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
195         fi
196 endef
197
198 INSTALL_DIRS =
199
200 SHUTDOWN_TARGET_WANTS =
201 LOCAL_FS_TARGET_WANTS =
202 MULTI_USER_TARGET_WANTS =
203 GRAPHICAL_TARGET_WANTS =
204 RESCUE_TARGET_WANTS =
205 SYSINIT_TARGET_WANTS =
206 SOCKETS_TARGET_WANTS =
207 BUSNAMES_TARGET_WANTS =
208 TIMERS_TARGET_WANTS =
209 USER_SOCKETS_TARGET_WANTS =
210 USER_DEFAULT_TARGET_WANTS =
211 USER_BUSNAMES_TARGET_WANTS =
212
213 SYSTEM_UNIT_ALIASES =
214 USER_UNIT_ALIASES =
215 GENERAL_ALIASES =
216
217 install-target-wants-hook:
218         what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
219         what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
220         what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
221         what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && dir=$(systemunitdir) && $(add-wants)
222         what="$(RESCUE_TARGET_WANTS)" && wants=rescue.target && dir=$(systemunitdir) && $(add-wants)
223         what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
224         what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
225         what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
226         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && dir=$(systemunitdir) && $(add-wants)
227         what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
228         what="$(USER_DEFAULT_TARGET_WANTS)" && wants=default.target && dir=$(userunitdir) && $(add-wants)
229
230 install-busnames-target-wants-hook:
231         what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
232         what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
233
234 define add-wants
235         [ -z "$$what" ] || ( \
236           dir=$(DESTDIR)$$dir/$$wants.wants && \
237           $(MKDIR_P) -m 0755 $$dir && \
238           cd $$dir && \
239           rm -f $$what && \
240           for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
241 endef
242
243 install-directories-hook:
244         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
245
246 install-aliases-hook:
247         set -- $(SYSTEM_UNIT_ALIASES) && \
248                 dir=$(systemunitdir) && $(install-aliases)
249         set -- $(USER_UNIT_ALIASES) && \
250                 dir=$(userunitdir) && $(install-relative-aliases)
251         set -- $(GENERAL_ALIASES) && \
252                 dir= && $(install-relative-aliases)
253
254 define install-aliases
255         while [ -n "$$1" ]; do \
256                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
257                 rm -f $(DESTDIR)$$dir/$$2 && \
258                 $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
259                 shift 2 || exit $$?; \
260         done
261 endef
262
263 define install-relative-aliases
264         while [ -n "$$1" ]; do \
265                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
266                 rm -f $(DESTDIR)$$dir/$$2 && \
267                 $(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
268                 shift 2 || exit $$?; \
269         done
270 endef
271
272 install-touch-usr-hook:
273         touch -c $(DESTDIR)/$(prefix)
274
275 INSTALL_EXEC_HOOKS += \
276         install-target-wants-hook \
277         install-directories-hook \
278         install-aliases-hook \
279         install-touch-usr-hook
280
281 if ENABLE_KDBUS
282 INSTALL_EXEC_HOOKS += \
283         install-busnames-target-wants-hook
284 endif
285
286 # ------------------------------------------------------------------------------
287 AM_V_M4 = $(AM_V_M4_$(V))
288 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
289 AM_V_M4_0 = @echo "  M4      " $@;
290
291 AM_V_XSLT = $(AM_V_XSLT_$(V))
292 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
293 AM_V_XSLT_0 = @echo "  XSLT    " $@;
294
295 AM_V_GPERF = $(AM_V_GPERF_$(V))
296 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
297 AM_V_GPERF_0 = @echo "  GPERF   " $@;
298
299 AM_V_LN = $(AM_V_LN_$(V))
300 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
301 AM_V_LN_0 = @echo "  LN      " $@;
302
303 AM_V_RM = $(AM_V_RM_$(V))
304 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
305 AM_V_RM_0 = @echo "  RM      " $@;
306
307 # ------------------------------------------------------------------------------
308 rootbin_PROGRAMS =
309 bin_PROGRAMS =
310 rootlibexec_PROGRAMS =
311 systemgenerator_PROGRAMS =
312 dist_bashcompletion_DATA =
313 dist_zshcompletion_DATA =
314
315 dist_doc_DATA = \
316         README \
317         NEWS \
318         LICENSE.LGPL2.1 \
319         LICENSE.GPL2 \
320         LICENSE.MIT \
321         src/libelogind/sd-bus/PORTING-DBUS1 \
322         src/libelogind/sd-bus/DIFFERENCES \
323         src/libelogind/sd-bus/GVARIANT-SERIALIZATION
324
325 @INTLTOOL_POLICY_RULE@
326
327 # ------------------------------------------------------------------------------
328
329 MANPAGES =
330 MANPAGES_ALIAS =
331
332 include Makefile-man.am
333
334 .PHONY: man update-man-list
335 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
336
337 XML_FILES = \
338         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
339 HTML_FILES = \
340         ${XML_FILES:.xml=.html}
341 HTML_ALIAS = \
342         ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
343
344 if ENABLE_MANPAGES
345 man_MANS = \
346         $(MANPAGES) \
347         $(MANPAGES_ALIAS)
348
349 noinst_DATA += \
350         $(HTML_FILES) \
351         $(HTML_ALIAS)
352
353 CLEANFILES += \
354         $(man_MANS) \
355         $(HTML_FILES) \
356         $(HTML_ALIAS)
357
358 docs/html/man:
359         $(AM_V_at)$(MKDIR_P) $(dir $@)
360         $(AM_V_LN)$(LN_S) -f ../../man $@
361
362 noinst_DATA += \
363         docs/html/man
364
365 CLEANFILES += \
366         docs/html/man
367
368 endif
369
370 EXTRA_DIST += \
371         $(XML_FILES) \
372         $(HTML_FILES) \
373         $(HTML_ALIAS) \
374         $(man_MANS) \
375         tools/make-man-index.py \
376         tools/make-directive-index.py \
377         tools/xml_helper.py
378
379 # ------------------------------------------------------------------------------
380 noinst_LTLIBRARIES += \
381         libelogind-shared.la
382
383 libelogind_shared_la_SOURCES = \
384         src/shared/capability.c \
385         src/shared/capability.h \
386         src/shared/linux/auto_dev-ioctl.h \
387         src/shared/ioprio.h \
388         src/shared/missing.h \
389         src/shared/initreq.h \
390         src/shared/securebits.h \
391         src/shared/special.h \
392         src/shared/list.h \
393         src/shared/unaligned.h \
394         src/shared/macro.h \
395         src/shared/def.h \
396         src/shared/sparse-endian.h \
397         src/shared/refcnt.h \
398         src/shared/udev-util.h \
399         src/shared/device-nodes.c \
400         src/shared/device-nodes.h \
401         src/shared/util.c \
402         src/shared/util.h \
403         src/shared/virt.c \
404         src/shared/virt.h \
405         src/shared/architecture.c \
406         src/shared/architecture.h \
407         src/shared/efivars.c \
408         src/shared/efivars.h \
409         src/shared/fstab-util.c \
410         src/shared/fstab-util.h \
411         src/shared/path-util.c \
412         src/shared/path-util.h \
413         src/shared/time-util.c \
414         src/shared/time-util.h \
415         src/shared/locale-util.c \
416         src/shared/locale-util.h \
417         src/shared/mempool.c \
418         src/shared/mempool.h \
419         src/shared/hashmap.c \
420         src/shared/hashmap.h \
421         src/shared/siphash24.c \
422         src/shared/siphash24.h \
423         src/shared/set.h \
424         src/shared/fdset.c \
425         src/shared/fdset.h \
426         src/shared/prioq.c \
427         src/shared/prioq.h \
428         src/shared/sleep-config.c \
429         src/shared/sleep-config.h \
430         src/shared/strv.c \
431         src/shared/strv.h \
432         src/shared/env-util.c \
433         src/shared/env-util.h \
434         src/shared/strbuf.c \
435         src/shared/strbuf.h \
436         src/shared/strxcpyx.c \
437         src/shared/strxcpyx.h \
438         src/shared/conf-parser.c \
439         src/shared/conf-parser.h \
440         src/shared/log.c \
441         src/shared/log.h \
442         src/shared/ratelimit.h \
443         src/shared/ratelimit.c \
444         src/shared/exit-status.c \
445         src/shared/exit-status.h \
446         src/shared/utf8.c \
447         src/shared/utf8.h \
448         src/shared/gunicode.c \
449         src/shared/gunicode.h \
450         src/shared/pager.c \
451         src/shared/pager.h \
452         src/shared/socket-util.c \
453         src/shared/socket-util.h \
454         src/shared/in-addr-util.c \
455         src/shared/in-addr-util.h \
456         src/shared/ether-addr-util.h \
457         src/shared/conf-files.c \
458         src/shared/conf-files.h \
459         src/shared/cgroup-util.c \
460         src/shared/cgroup-util.h \
461         src/shared/cgroup-show.c \
462         src/shared/cgroup-show.h \
463         src/shared/unit-name.c \
464         src/shared/unit-name.h \
465         src/shared/watchdog.c \
466         src/shared/watchdog.h \
467         src/shared/replace-var.c \
468         src/shared/replace-var.h \
469         src/shared/spawn-polkit-agent.c \
470         src/shared/spawn-polkit-agent.h \
471         src/shared/clock-util.c \
472         src/shared/clock-util.h \
473         src/shared/calendarspec.c \
474         src/shared/calendarspec.h \
475         src/shared/fileio.c \
476         src/shared/fileio.h \
477         src/shared/output-mode.h \
478         src/shared/MurmurHash2.c \
479         src/shared/MurmurHash2.h \
480         src/shared/acpi-fpdt.h \
481         src/shared/acpi-fpdt.c \
482         src/shared/boot-timestamps.h \
483         src/shared/boot-timestamps.c \
484         src/shared/mkdir.c \
485         src/shared/mkdir.h \
486         src/shared/smack-util.c \
487         src/shared/smack-util.h \
488         src/shared/apparmor-util.c \
489         src/shared/apparmor-util.h \
490         src/shared/ima-util.c \
491         src/shared/ima-util.h \
492         src/shared/ptyfwd.c \
493         src/shared/ptyfwd.h \
494         src/shared/errno-list.c \
495         src/shared/errno-list.h \
496         src/shared/af-list.c \
497         src/shared/af-list.h \
498         src/shared/arphrd-list.c \
499         src/shared/arphrd-list.h \
500         src/shared/cap-list.c \
501         src/shared/cap-list.h \
502         src/shared/audit.c \
503         src/shared/audit.h \
504         src/shared/xml.c \
505         src/shared/xml.h \
506         src/shared/json.c \
507         src/shared/json.h \
508         src/shared/selinux-util.c \
509         src/shared/selinux-util.h \
510         src/shared/label.c \
511         src/shared/label.h \
512         src/shared/socket-label.c \
513         src/shared/mkdir-label.c \
514         src/shared/fileio-label.h \
515         src/shared/fileio-label.c \
516         src/shared/bus-label.c \
517         src/shared/bus-label.h \
518         src/shared/gpt.h \
519         src/shared/clean-ipc.h \
520         src/shared/clean-ipc.c \
521         src/shared/login-shared.c \
522         src/shared/login-shared.h \
523         src/shared/ring.c \
524         src/shared/ring.h \
525         src/shared/barrier.c \
526         src/shared/barrier.h \
527         src/shared/pty.c \
528         src/shared/pty.h \
529         src/shared/async.c \
530         src/shared/async.h \
531         src/shared/base-filesystem.c \
532         src/shared/base-filesystem.h \
533         src/shared/memfd-util.c \
534         src/shared/memfd-util.h \
535         src/shared/uid-range.c \
536         src/shared/uid-range.h \
537         src/shared/nss-util.h \
538         src/shared/verbs.c \
539         src/shared/verbs.h \
540         src/shared/sigbus.c \
541         src/shared/sigbus.h \
542         src/shared/build.h \
543         src/shared/import-util.c \
544         src/shared/import-util.h \
545         src/shared/sysctl-util.c \
546         src/shared/sysctl-util.h
547
548 nodist_libelogind_shared_la_SOURCES = \
549         src/shared/errno-from-name.h \
550         src/shared/errno-to-name.h \
551         src/shared/af-from-name.h \
552         src/shared/af-to-name.h \
553         src/shared/arphrd-from-name.h \
554         src/shared/arphrd-to-name.h \
555         src/shared/cap-from-name.h \
556         src/shared/cap-to-name.h
557
558 libelogind_shared_la_CFLAGS = \
559         $(AM_CFLAGS) \
560         $(CAP_CFLAGS) \
561         $(SECCOMP_CFLAGS) \
562         -pthread
563
564 libelogind_shared_la_LIBADD = \
565         $(CAP_LIBS) \
566         -lm
567
568 # ------------------------------------------------------------------------------
569 if HAVE_ACL
570 noinst_LTLIBRARIES += \
571         libelogind-acl.la
572
573 libelogind_acl_la_SOURCES = \
574         src/shared/acl-util.c \
575         src/shared/acl-util.h
576
577 libelogind_acl_la_CFLAGS = \
578         $(AM_CFLAGS) \
579         $(ACL_CFLAGS)
580
581 libelogind_acl_la_LIBADD = \
582         $(ACL_LIBS)
583 endif
584
585 # ------------------------------------------------------------------------------
586 #noinst_LTLIBRARIES += \
587 #       elogind-core.la
588
589 elogind_core_la_SOURCES = \
590         src/core/unit.c \
591         src/core/unit.h \
592         src/core/unit-printf.c \
593         src/core/unit-printf.h \
594         src/core/job.c \
595         src/core/job.h \
596         src/core/manager.c \
597         src/core/manager.h \
598         src/core/transaction.c \
599         src/core/transaction.h \
600         src/core/load-fragment.c \
601         src/core/load-fragment.h \
602         src/core/service.c \
603         src/core/service.h \
604         src/core/socket.c \
605         src/core/socket.h \
606         src/core/busname.c \
607         src/core/busname.h \
608         src/core/bus-endpoint.c \
609         src/core/bus-endpoint.h \
610         src/core/bus-policy.c \
611         src/core/bus-policy.h \
612         src/core/target.c \
613         src/core/target.h \
614         src/core/snapshot.c \
615         src/core/snapshot.h \
616         src/core/device.c \
617         src/core/device.h \
618         src/core/swap.c \
619         src/core/swap.h \
620         src/core/timer.c \
621         src/core/timer.h \
622         src/core/path.c \
623         src/core/path.h \
624         src/core/slice.c \
625         src/core/slice.h \
626         src/core/scope.c \
627         src/core/scope.h \
628         src/core/load-dropin.c \
629         src/core/load-dropin.h \
630         src/core/execute.c \
631         src/core/execute.h \
632         src/core/kill.c \
633         src/core/kill.h \
634         src/core/dbus.c \
635         src/core/dbus.h \
636         src/core/dbus-manager.c \
637         src/core/dbus-manager.h \
638         src/core/dbus-unit.c \
639         src/core/dbus-unit.h \
640         src/core/dbus-job.c \
641         src/core/dbus-job.h \
642         src/core/dbus-service.c \
643         src/core/dbus-service.h \
644         src/core/dbus-socket.c \
645         src/core/dbus-socket.h \
646         src/core/dbus-busname.c \
647         src/core/dbus-busname.h \
648         src/core/dbus-target.c \
649         src/core/dbus-target.h \
650         src/core/dbus-snapshot.c \
651         src/core/dbus-snapshot.h \
652         src/core/dbus-device.c \
653         src/core/dbus-device.h \
654         src/core/dbus-swap.c \
655         src/core/dbus-swap.h \
656         src/core/dbus-timer.c \
657         src/core/dbus-timer.h \
658         src/core/dbus-path.c \
659         src/core/dbus-path.h \
660         src/core/dbus-slice.c \
661         src/core/dbus-slice.h \
662         src/core/dbus-scope.c \
663         src/core/dbus-scope.h \
664         src/core/dbus-execute.c \
665         src/core/dbus-execute.h \
666         src/core/dbus-kill.c \
667         src/core/dbus-kill.h \
668         src/core/dbus-cgroup.c \
669         src/core/dbus-cgroup.h \
670         src/core/cgroup.c \
671         src/core/cgroup.h \
672         src/core/selinux-access.c \
673         src/core/selinux-access.h \
674         src/core/selinux-setup.c \
675         src/core/selinux-setup.h \
676         src/core/smack-setup.c \
677         src/core/smack-setup.h \
678         src/core/ima-setup.c \
679         src/core/ima-setup.h \
680         src/core/locale-setup.h \
681         src/core/locale-setup.c \
682         src/core/hostname-setup.c \
683         src/core/hostname-setup.h \
684         src/core/machine-id-setup.c \
685         src/core/machine-id-setup.h \
686         src/core/kmod-setup.c \
687         src/core/kmod-setup.h \
688         src/core/namespace.c \
689         src/core/namespace.h \
690         src/core/killall.h \
691         src/core/killall.c \
692         src/core/audit-fd.c \
693         src/core/audit-fd.h \
694         src/core/show-status.c \
695         src/core/show-status.h \
696         src/core/failure-action.c \
697         src/core/failure-action.h
698
699 nodist_elogind_core_la_SOURCES = \
700         src/core/load-fragment-gperf.c \
701         src/core/load-fragment-gperf-nulstr.c
702
703 elogind_core_la_CFLAGS = \
704         $(AM_CFLAGS) \
705         $(PAM_CFLAGS) \
706         -pthread
707
708 elogind_core_la_LIBADD = \
709         libelogind-shared.la \
710         $(PAM_LIBS)
711
712 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
713         $(AM_V_at)$(MKDIR_P) $(dir $@)
714         $(AM_V_GEN)$(AWK) 'BEGIN{ keywords=0 ; FS="," ; print "extern const char load_fragment_gperf_nulstr[];" ; print "const char load_fragment_gperf_nulstr[] ="} ; keyword==1 { print "\"" $$1 "\\0\"" } ; /%%/ { keyword=1} ; END { print ";" }' < $< > $@
715
716 gperf_gperf_m4_sources = \
717         src/core/load-fragment-gperf.gperf.m4
718
719 gperf_txt_sources = \
720         src/shared/errno-list.txt \
721         src/shared/af-list.txt \
722         src/shared/arphrd-list.txt \
723         src/shared/cap-list.txt
724
725 BUILT_SOURCES += \
726         $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
727         $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf-nulstr.c) \
728         $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
729         $(gperf_txt_sources:-list.txt=-from-name.h) \
730         $(gperf_txt_sources:-list.txt=-to-name.h)
731
732 CLEANFILES += \
733         $(gperf_txt_sources:-list.txt=-from-name.gperf)
734 DISTCLEANFILES = \
735         $(gperf_txt_sources)
736
737 EXTRA_DIST += \
738         $(gperf_gperf_m4_sources) \
739         $(gperf_gperf_sources) \
740         $(gperf_txt_sources:-list.txt=-from-name.gperf)
741
742 CLEANFILES += \
743         $(gperf_txt_sources)
744
745 %-from-name.gperf: %-list.txt
746         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
747
748 %-from-name.h: %-from-name.gperf
749         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
750
751
752 src/shared/errno-list.txt:
753         $(AM_V_at)$(MKDIR_P) $(dir $@)
754         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
755
756 src/shared/errno-to-name.h: src/shared/errno-list.txt
757         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
758
759
760 src/shared/af-list.txt:
761         $(AM_V_at)$(MKDIR_P) $(dir $@)
762         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - </dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' >$@
763
764 src/shared/af-to-name.h: src/shared/af-list.txt
765         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
766
767
768 src/shared/arphrd-list.txt:
769         $(AM_V_at)$(MKDIR_P) $(dir $@)
770         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include net/if_arp.h - </dev/null | $(AWK) '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $$2; }' | sed -e 's/ARPHRD_//' >$@
771
772 src/shared/arphrd-to-name.h: src/shared/arphrd-list.txt
773         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
774
775 src/shared/arphrd-from-name.gperf: src/shared/arphrd-list.txt
776         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@
777
778
779 src/shared/cap-list.txt:
780         $(AM_V_at)$(MKDIR_P) $(dir $@)
781         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
782
783 src/shared/cap-to-name.h: src/shared/cap-list.txt
784         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@
785
786 src/shared/cap-from-name.gperf: src/shared/cap-list.txt
787         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
788
789 src/shared/cap-from-name.h: src/shared/cap-from-name.gperf
790         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@
791
792 # ------------------------------------------------------------------------------
793 dist_factory_etc_DATA = \
794         factory/etc/nsswitch.conf
795
796 if HAVE_PAM
797 dist_factory_pam_DATA = \
798         factory/etc/pam.d/system-auth \
799         factory/etc/pam.d/other
800 endif
801
802 # ------------------------------------------------------------------------------
803 noinst_LTLIBRARIES += \
804         libelogind-internal.la
805
806 libelogind_internal_la_SOURCES = \
807         src/systemd/sd-bus.h \
808         src/systemd/sd-bus-protocol.h \
809         src/systemd/sd-bus-vtable.h \
810         src/systemd/sd-utf8.h \
811         src/systemd/sd-event.h \
812         src/systemd/sd-rtnl.h \
813         src/systemd/sd-resolve.h \
814         src/systemd/sd-login.h \
815         src/systemd/sd-id128.h \
816         src/systemd/sd-daemon.h \
817         src/systemd/sd-path.h \
818         src/systemd/sd-network.h \
819         src/systemd/sd-device.h \
820         src/libelogind/sd-bus/sd-bus.c \
821         src/libelogind/sd-bus/bus-control.c \
822         src/libelogind/sd-bus/bus-control.h \
823         src/libelogind/sd-bus/bus-error.c \
824         src/libelogind/sd-bus/bus-error.h \
825         src/libelogind/sd-bus/bus-common-errors.h \
826         src/libelogind/sd-bus/bus-common-errors.c \
827         src/libelogind/sd-bus/bus-internal.c \
828         src/libelogind/sd-bus/bus-internal.h \
829         src/libelogind/sd-bus/bus-socket.c \
830         src/libelogind/sd-bus/bus-socket.h \
831         src/libelogind/sd-bus/bus-kernel.c \
832         src/libelogind/sd-bus/bus-kernel.h \
833         src/libelogind/sd-bus/bus-container.c \
834         src/libelogind/sd-bus/bus-container.h \
835         src/libelogind/sd-bus/bus-message.c \
836         src/libelogind/sd-bus/bus-message.h \
837         src/libelogind/sd-bus/bus-creds.c \
838         src/libelogind/sd-bus/bus-creds.h \
839         src/libelogind/sd-bus/bus-signature.c \
840         src/libelogind/sd-bus/bus-signature.h \
841         src/libelogind/sd-bus/bus-type.c \
842         src/libelogind/sd-bus/bus-type.h \
843         src/libelogind/sd-bus/bus-match.c \
844         src/libelogind/sd-bus/bus-match.h \
845         src/libelogind/sd-bus/bus-bloom.c \
846         src/libelogind/sd-bus/bus-bloom.h \
847         src/libelogind/sd-bus/bus-introspect.c \
848         src/libelogind/sd-bus/bus-introspect.h \
849         src/libelogind/sd-bus/bus-objects.c \
850         src/libelogind/sd-bus/bus-objects.h \
851         src/libelogind/sd-bus/bus-gvariant.c \
852         src/libelogind/sd-bus/bus-gvariant.h \
853         src/libelogind/sd-bus/bus-convenience.c \
854         src/libelogind/sd-bus/bus-track.c \
855         src/libelogind/sd-bus/bus-track.h \
856         src/libelogind/sd-bus/bus-util.c \
857         src/libelogind/sd-bus/bus-util.h \
858         src/libelogind/sd-bus/bus-slot.c \
859         src/libelogind/sd-bus/bus-slot.h \
860         src/libelogind/sd-bus/bus-protocol.h \
861         src/libelogind/sd-bus/kdbus.h \
862         src/libelogind/sd-utf8/sd-utf8.c \
863         src/libelogind/sd-event/sd-event.c \
864         src/libelogind/sd-event/event-util.h \
865         src/libelogind/sd-rtnl/sd-rtnl.c \
866         src/libelogind/sd-rtnl/rtnl-internal.h \
867         src/libelogind/sd-rtnl/rtnl-message.c \
868         src/libelogind/sd-rtnl/rtnl-types.h \
869         src/libelogind/sd-rtnl/rtnl-types.c \
870         src/libelogind/sd-rtnl/rtnl-util.h \
871         src/libelogind/sd-rtnl/rtnl-util.c \
872         src/libelogind/sd-rtnl/local-addresses.h \
873         src/libelogind/sd-rtnl/local-addresses.c \
874         src/libelogind/sd-id128/sd-id128.c \
875         src/libelogind/sd-daemon/sd-daemon.c \
876         src/libelogind/sd-login/sd-login.c \
877         src/libelogind/sd-path/sd-path.c \
878         src/libelogind/sd-network/sd-network.c \
879         src/libelogind/sd-network/network-util.h \
880         src/libelogind/sd-network/network-util.c \
881         src/libelogind/sd-device/device-internal.h \
882         src/libelogind/sd-device/device-util.h \
883         src/libelogind/sd-device/sd-device.c \
884         src/libelogind/sd-device/device-private.c \
885         src/libelogind/sd-device/device-private.h
886
887 nodist_libelogind_internal_la_SOURCES = \
888         src/libelogind/libelogind.sym
889
890 libelogind_internal_la_CFLAGS = \
891         $(AM_CFLAGS) \
892         -pthread
893
894 BUILT_SOURCES += \
895        src/libelogind/libelogind.sym
896
897
898 libelogind_internal_la_LIBADD = \
899         $(RT_LIBS) \
900         libelogind-shared.la
901
902 libelogind_internal_la_LDFLAGS = \
903         $(AM_LDFLAGS) \
904         -version-info $(LIBELOGIND_CURRENT):$(LIBELOGIND_REVISION):$(LIBELOGIND_AGE) \
905         -Wl,--version-script=$(top_builddir)/src/libelogind/libelogind.sym
906
907 libelogind-install-hook:
908         libname=libelogind.so && $(move-to-rootlibdir)
909
910 libelogind-uninstall-hook:
911         rm -f $(DESTDIR)$(rootlibdir)/libelogind.so*
912
913 INSTALL_EXEC_HOOKS += libelogind-install-hook
914 UNINSTALL_EXEC_HOOKS += libelogind-uninstall-hook
915
916 pkgconfiglib_DATA += \
917         src/libelogind/libsystemd.pc
918
919 pkginclude_HEADERS += \
920         src/systemd/sd-login.h
921
922 # ------------------------------------------------------------------------------
923 elogind_SOURCES = \
924         src/login/logind.c \
925         src/login/logind.h
926
927 nodist_elogind_SOURCES = \
928         src/login/logind-gperf.c
929
930 elogind_LDADD = \
931         libelogind-core.la
932
933 libelogind_core_la_SOURCES = \
934         src/login/logind-core.c \
935         src/login/logind-device.c \
936         src/login/logind-device.h \
937         src/login/logind-button.c \
938         src/login/logind-button.h \
939         src/login/logind-action.c \
940         src/login/logind-action.h \
941         src/login/logind-seat.c \
942         src/login/logind-seat.h \
943         src/login/logind-session.c \
944         src/login/logind-session.h \
945         src/login/logind-session-device.c \
946         src/login/logind-session-device.h \
947         src/login/logind-user.c \
948         src/login/logind-user.h \
949         src/login/logind-inhibit.c \
950         src/login/logind-inhibit.h \
951         src/login/logind-dbus.c \
952         src/login/logind-session-dbus.c \
953         src/login/logind-seat-dbus.c \
954         src/login/logind-user-dbus.c \
955         src/login/logind-acl.h
956
957 libelogind_core_la_LIBADD = \
958         $(UDEV_LIBS) \
959         libelogind-internal.la
960
961 if HAVE_ACL
962 libelogind_core_la_SOURCES += \
963         src/login/logind-acl.c
964
965 libelogind_core_la_LIBADD += \
966         libelogind-acl.la
967 endif
968
969 noinst_LTLIBRARIES += \
970         libelogind-core.la
971
972 rootlibexec_PROGRAMS += \
973         elogind
974
975 loginctl_SOURCES = \
976         src/login/loginctl.c \
977         src/login/sysfs-show.h \
978         src/login/sysfs-show.c
979
980 loginctl_LDADD = \
981         $(UDEV_LIBS) \
982         libelogind-internal.la \
983         libelogind-shared.la
984
985 rootbin_PROGRAMS += \
986         loginctl
987
988 dist_bashcompletion_DATA += \
989         shell-completion/bash/loginctl
990
991 dist_zshcompletion_DATA += \
992         shell-completion/zsh/_loginctl \
993         shell-completion/zsh/_systemd-inhibit
994
995 systemd_inhibit_SOURCES = \
996         src/login/inhibit.c
997
998 systemd_inhibit_LDADD = \
999         libelogind-internal.la \
1000         libelogind-shared.la
1001
1002 rootbin_PROGRAMS += \
1003         systemd-inhibit
1004
1005 test_login_SOURCES = \
1006         src/libelogind/sd-login/test-login.c
1007
1008 test_login_LDADD = \
1009         libelogind-internal.la \
1010         libelogind-shared.la
1011
1012 test_login_shared_SOURCES = \
1013         src/login/test-login-shared.c
1014
1015 test_login_shared_LDADD = \
1016         libelogind-internal.la \
1017         libelogind-shared.la
1018
1019 test_inhibit_SOURCES = \
1020         src/login/test-inhibit.c
1021
1022 test_inhibit_LDADD = \
1023         libelogind-internal.la \
1024         libelogind-shared.la
1025
1026 test_login_tables_SOURCES = \
1027         src/login/test-login-tables.c
1028
1029 test_login_tables_LDADD = \
1030         libelogind-core.la
1031
1032 manual_tests += \
1033         test-login \
1034         test-inhibit
1035
1036 tests += \
1037         test-login-tables \
1038         test-login-shared
1039
1040 if HAVE_PAM
1041 pam_elogind_la_SOURCES = \
1042         src/login/pam_elogind.sym \
1043         src/login/pam_elogind.c
1044
1045 pam_elogind_la_CFLAGS = \
1046         $(AM_CFLAGS) \
1047         $(PAM_CFLAGS) \
1048         -fvisibility=hidden
1049
1050 pam_elogind_la_LDFLAGS = \
1051         $(AM_LDFLAGS) \
1052         -module \
1053         -export-dynamic \
1054         -avoid-version \
1055         -shared \
1056         -Wl,--version-script=$(top_srcdir)/src/login/pam_elogind.sym
1057
1058 pam_elogind_la_LIBADD = \
1059         libelogind-internal.la \
1060         $(PAM_LIBS)
1061
1062 pamlib_LTLIBRARIES = \
1063         pam_elogind.la
1064
1065 dist_pamconf_DATA = \
1066         src/login/elogind-user
1067
1068 endif
1069
1070 dist_dbussystemservice_DATA += \
1071         src/login/org.freedesktop.login1.service
1072
1073 dist_dbuspolicy_DATA += \
1074         src/login/org.freedesktop.login1.conf
1075
1076 dist_pkgsysconf_DATA += \
1077         src/login/logind.conf
1078
1079 polkitpolicy_files += \
1080         src/login/org.freedesktop.login1.policy
1081
1082 INSTALL_DIRS += \
1083         $(elogindstatedir)
1084
1085 SYSTEM_UNIT_ALIASES += \
1086         elogind.service dbus-org.freedesktop.login1.service
1087
1088 dist_udevrules_DATA = \
1089         src/login/70-uaccess.rules \
1090         src/login/70-power-switch.rules
1091
1092 nodist_udevrules_DATA = \
1093         src/login/71-seat.rules \
1094         src/login/73-seat-late.rules
1095
1096 polkitpolicy_in_files += \
1097         src/login/org.freedesktop.login1.policy.in
1098
1099 gperf_gperf_sources = \
1100         src/login/logind-gperf.gperf
1101
1102 EXTRA_DIST += \
1103         src/login/71-seat.rules.in \
1104         src/login/73-seat-late.rules.in
1105
1106 # ------------------------------------------------------------------------------
1107 substitutions = \
1108        '|rootlibexecdir=$(rootlibexecdir)|' \
1109        '|rootbindir=$(rootbindir)|' \
1110        '|bindir=$(bindir)|' \
1111        '|pkgsysconfdir=$(pkgsysconfdir)|' \
1112        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
1113        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
1114        '|pkgdatadir=$(pkgdatadir)|' \
1115        '|systemunitdir=$(systemunitdir)|' \
1116        '|userunitdir=$(userunitdir)|' \
1117        '|systempresetdir=$(systempresetdir)|' \
1118        '|userpresetdir=$(userpresetdir)|' \
1119        '|udevrulesdir=$(udevrulesdir)|' \
1120        '|catalogdir=$(catalogdir)|' \
1121        '|tmpfilesdir=$(tmpfilesdir)|' \
1122        '|sysusersdir=$(sysusersdir)|' \
1123        '|sysctldir=$(sysctldir)|' \
1124        '|systemgeneratordir=$(systemgeneratordir)|' \
1125        '|usergeneratordir=$(usergeneratordir)|' \
1126        '|CERTIFICATEROOT=$(CERTIFICATEROOT)|' \
1127        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
1128        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
1129        '|PACKAGE_URL=$(PACKAGE_URL)|' \
1130        '|RANDOM_SEED_DIR=$(localstatedir)/lib/elogind/|' \
1131        '|RANDOM_SEED=$(localstatedir)/lib/elogind/random-seed|' \
1132        '|prefix=$(prefix)|' \
1133        '|exec_prefix=$(exec_prefix)|' \
1134        '|libdir=$(libdir)|' \
1135        '|includedir=$(includedir)|' \
1136        '|VERSION=$(VERSION)|' \
1137        '|rootprefix=$(rootprefix)|' \
1138        '|udevlibexecdir=$(udevlibexecdir)|' \
1139        '|SUSHELL=$(SUSHELL)|' \
1140        '|SULOGIN=$(SULOGIN)|' \
1141        '|DEBUGTTY=$(DEBUGTTY)|' \
1142        '|KILL=$(KILL)|' \
1143        '|KMOD=$(KMOD)|' \
1144        '|MKDIR_P=$(MKDIR_P)|' \
1145        '|QUOTAON=$(QUOTAON)|' \
1146        '|QUOTACHECK=$(QUOTACHECK)|' \
1147        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
1148        '|VARLOGDIR=$(varlogdir)|' \
1149        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
1150        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
1151        '|PYTHON=$(PYTHON)|' \
1152        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
1153        '|NTP_SERVERS=$(NTP_SERVERS)|' \
1154        '|DNS_SERVERS=$(DNS_SERVERS)|' \
1155        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
1156        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
1157        '|TTY_GID=$(TTY_GID)|' \
1158        '|systemsleepdir=$(systemsleepdir)|' \
1159        '|systemshutdowndir=$(systemshutdowndir)|' \
1160        '|binfmtdir=$(binfmtdir)|' \
1161        '|modulesloaddir=$(modulesloaddir)|'
1162
1163 SED_PROCESS = \
1164         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
1165         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
1166                 < $< > $@
1167
1168 units/%: units/%.in
1169         $(SED_PROCESS)
1170
1171 man/%: man/%.in
1172         $(SED_PROCESS)
1173
1174 sysctl.d/%: sysctl.d/%.in
1175         $(SED_PROCESS)
1176
1177 %.pc: %.pc.in
1178         $(SED_PROCESS)
1179
1180 %.conf: %.conf.in
1181         $(SED_PROCESS)
1182
1183 src/core/macros.%: src/core/macros.%.in
1184         $(SED_PROCESS)
1185
1186 src/%.policy.in: src/%.policy.in.in
1187         $(SED_PROCESS)
1188
1189 shell-completion/%: shell-completion/%.in
1190         $(SED_PROCESS)
1191
1192 %.rules: %.rules.in
1193         $(SED_PROCESS)
1194
1195 %.conf: %.conf.in
1196         $(SED_PROCESS)
1197
1198 %.sh: %.sh.in
1199         $(SED_PROCESS)
1200         $(AM_V_GEN)chmod +x $@
1201
1202 src/%.c: src/%.gperf
1203         $(AM_V_at)$(MKDIR_P) $(dir $@)
1204         $(AM_V_GPERF)$(GPERF) < $< > $@
1205
1206 src/%: src/%.m4
1207         $(AM_V_at)$(MKDIR_P) $(dir $@)
1208         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1209
1210 sysusers.d/%: sysusers.d/%.m4
1211         $(AM_V_at)$(MKDIR_P) $(dir $@)
1212         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1213
1214 tmpfiles.d/%: tmpfiles.d/%.m4
1215         $(AM_V_at)$(MKDIR_P) $(dir $@)
1216         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1217
1218
1219 units/%: units/%.m4
1220         $(AM_V_at)$(MKDIR_P) $(dir $@)
1221         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
1222
1223 units/user/%: units/user/%.m4
1224         $(AM_V_at)$(MKDIR_P) $(dir $@)
1225         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
1226
1227 if ENABLE_POLKIT
1228 nodist_polkitpolicy_DATA = \
1229         $(polkitpolicy_files) \
1230         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
1231 endif
1232
1233 EXTRA_DIST += \
1234         $(polkitpolicy_in_files) \
1235         $(polkitpolicy_in_in_files)
1236
1237 # ------------------------------------------------------------------------------
1238 if ENABLE_MANPAGES
1239 man/custom-entities.ent: configure.ac
1240         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
1241         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
1242          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
1243          > $@ # '
1244
1245 DISTCLEANFILES += \
1246         man/custom-entities.ent
1247
1248 XSLTPROC_FLAGS = \
1249         --nonet \
1250         --xinclude \
1251         --stringparam man.output.quietly 1 \
1252         --stringparam funcsynopsis.style ansi \
1253         --stringparam man.authors.section.enabled 0 \
1254         --stringparam man.copyright.section.enabled 0 \
1255         --stringparam elogind.version $(VERSION) \
1256         --path '$(builddir)/man:$(srcdir)/man'
1257
1258 XSLTPROC_PROCESS_MAN = \
1259         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
1260
1261 XSLTPROC_PROCESS_HTML = \
1262         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
1263
1264 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
1265         $(XSLTPROC_PROCESS_MAN)
1266
1267 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
1268         $(XSLTPROC_PROCESS_MAN)
1269
1270 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
1271         $(XSLTPROC_PROCESS_MAN)
1272
1273 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
1274         $(XSLTPROC_PROCESS_MAN)
1275
1276 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
1277         $(XSLTPROC_PROCESS_MAN)
1278
1279 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
1280         $(XSLTPROC_PROCESS_HTML)
1281
1282 define html-alias
1283         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
1284 endef
1285
1286 endif
1287
1288 EXTRA_DIST += \
1289         man/custom-html.xsl \
1290         man/custom-man.xsl
1291
1292 install-exec-hook: $(INSTALL_EXEC_HOOKS)
1293
1294 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
1295
1296 install-data-hook: $(INSTALL_DATA_HOOKS)
1297
1298 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
1299
1300 clean-local: $(CLEAN_LOCAL_HOOKS)
1301         rm -rf $(abs_srcdir)/install-tree
1302
1303 DISTCHECK_CONFIGURE_FLAGS = \
1304         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
1305         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
1306         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
1307         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
1308         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
1309         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
1310         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
1311         --with-rootprefix=$$dc_install_base \
1312         --disable-split-usr \
1313         --enable-kdbus
1314
1315 DISTCHECK_CONFIGURE_FLAGS += \
1316         --with-sysvinit-path= \
1317         --with-sysvrcnd-path=
1318
1319 if ENABLE_GTK_DOC
1320 DISTCHECK_CONFIGURE_FLAGS += \
1321         --enable-gtk-doc
1322 endif
1323
1324 #
1325 # Require python when making dist
1326 #
1327 .PHONY: dist-check-help
1328
1329 dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS)
1330         for i in $(abspath $^); do                                             \
1331             if $$i  --help | grep -v 'default:' | grep -E -q '.{80}.' ; then   \
1332                 echo "$(basename $$i) --help output is too wide:";             \
1333                 $$i  --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
1334                 exit 1;                                                        \
1335             fi; done
1336
1337 dist: dist-check-python