chiark / gitweb /
util: fix missing memory initialization
[elogind.git] / Makefile.am
1 #  This file is part of systemd.
2 #
3 #  Copyright 2010 Lennart Poettering
4 #
5 #  systemd is free software; you can redistribute it and/or modify it
6 #  under the terms of the GNU General Public License as published by
7 #  the Free Software Foundation; either version 2 of the License, or
8 #  (at your option) any later version.
9 #
10 #  systemd is distributed in the hope that it will be useful, but
11 #  WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 #  General Public License for more details.
14 #
15 #  You should have received a copy of the GNU General Public License
16 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
18 ACLOCAL_AMFLAGS = -I m4
19
20 # Dirs of external packages
21 dbuspolicydir=@dbuspolicydir@
22 dbussessionservicedir=@dbussessionservicedir@
23 dbussystemservicedir=@dbussystemservicedir@
24 dbusinterfacedir=@dbusinterfacedir@
25 udevrulesdir=@udevrulesdir@
26 pamlibdir=@pamlibdir@
27 pkgconfigdatadir=$(datadir)/pkgconfig
28
29 # Our own, non-special dirs
30 pkgsysconfdir=$(sysconfdir)/systemd
31 sessionunitdir=$(pkgdatadir)/session
32
33 # And these are the special ones for /
34 rootdir=@rootdir@
35 rootbindir=$(rootdir)/bin
36 rootlibexecdir=$(rootdir)/lib/systemd
37 systemunitdir=$(rootdir)/lib/systemd/system
38
39 AM_CPPFLAGS = \
40         -include $(top_builddir)/config.h \
41         -DSYSTEM_CONFIG_FILE=\"$(pkgsysconfdir)/system.conf\" \
42         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
43         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
44         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
45         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
46         -DSESSION_CONFIG_FILE=\"$(pkgsysconfdir)/session.conf\" \
47         -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
48         -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
49         -DCGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
50         -DSYSTEMD_BINARY_PATH=\"$(rootbindir)/systemd\" \
51         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
52         -DRUNTIME_DIR=\"$(localstatedir)/run\" \
53         -I $(top_srcdir)/src
54
55 rootbin_PROGRAMS = \
56         systemd \
57         systemctl \
58         systemd-notify
59
60 bin_PROGRAMS = \
61         systemd-install
62
63 if HAVE_GTK
64 bin_PROGRAMS += \
65         systemadm
66 endif
67
68 rootlibexec_PROGRAMS = \
69         systemd-logger \
70         systemd-cgroups-agent \
71         systemd-initctl
72
73 noinst_PROGRAMS = \
74         test-engine \
75         test-job-type \
76         test-ns \
77         test-loopback \
78         test-daemon \
79         test-cgroup
80
81 if HAVE_PAM
82 pamlib_LTLIBRARIES = \
83         pam_systemd.la
84 endif
85
86 dist_pkgsysconf_DATA = \
87         src/system.conf
88
89 dist_dbuspolicy_DATA = \
90         src/org.freedesktop.systemd1.conf
91
92 dist_dbussystemservice_DATA = \
93         src/org.freedesktop.systemd1.service
94
95 dist_udevrules_DATA = \
96         src/99-systemd.rules
97
98 dbusinterface_DATA = \
99         org.freedesktop.systemd1.Manager.xml \
100         org.freedesktop.systemd1.Job.xml \
101         org.freedesktop.systemd1.Unit.xml \
102         org.freedesktop.systemd1.Service.xml \
103         org.freedesktop.systemd1.Socket.xml \
104         org.freedesktop.systemd1.Timer.xml \
105         org.freedesktop.systemd1.Target.xml \
106         org.freedesktop.systemd1.Device.xml \
107         org.freedesktop.systemd1.Mount.xml \
108         org.freedesktop.systemd1.Automount.xml \
109         org.freedesktop.systemd1.Snapshot.xml \
110         org.freedesktop.systemd1.Swap.xml \
111         org.freedesktop.systemd1.Path.xml
112
113 dist_systemunit_DATA = \
114         units/emergency.service \
115         units/basic.target \
116         units/getty.target \
117         units/halt.target \
118         units/local-fs.target \
119         units/network.target \
120         units/nss-lookup.target \
121         units/mail-transfer-agent.target \
122         units/poweroff.target \
123         units/reboot.target \
124         units/rescue.target \
125         units/rpcbind.target \
126         units/rtc-set.target \
127         units/shutdown.target \
128         units/sigpwr.target \
129         units/sockets.target \
130         units/swap.target \
131         units/systemd-initctl.socket \
132         units/systemd-logger.socket \
133         units/dev-hugepages.automount \
134         units/dev-hugepages.mount \
135         units/dev-mqueue.automount \
136         units/dev-mqueue.mount \
137         units/proc-sys-fs-binfmt_misc.automount \
138         units/proc-sys-fs-binfmt_misc.mount \
139         units/sys-kernel-debug.automount \
140         units/sys-kernel-debug.mount \
141         units/sys-kernel-security.automount \
142         units/sys-kernel-security.mount \
143         units/var-lock.mount \
144         units/var-run.mount
145
146 nodist_systemunit_DATA = \
147         units/sysinit.target \
148         units/getty@.service \
149         units/graphical.target \
150         units/remote-fs.target \
151         units/multi-user.target \
152         units/systemd-initctl.service \
153         units/systemd-logger.service \
154         units/syslog.target \
155         units/dbus.target
156
157 dist_sessionunit_DATA = \
158         units/session/default.target
159
160 nodist_sessionunit_DATA = \
161         units/session/remote-fs.target \
162         units/session/exit.service
163
164 EXTRA_DIST = \
165         units/sysinit.target.m4 \
166         units/getty@.service.m4 \
167         units/graphical.target.m4 \
168         units/multi-user.target.m4 \
169         units/remote-fs.target.m4 \
170         units/systemd-initctl.service.in \
171         units/systemd-logger.service.in \
172         units/syslog.target.in \
173         units/dbus.target.in \
174         units/session/exit.service.in \
175         systemd.pc.in
176
177 if TARGET_FEDORA
178 dist_systemunit_DATA += \
179         units/fedora/halt.service \
180         units/fedora/killall.service \
181         units/fedora/poweroff.service \
182         units/fedora/prefdm.service \
183         units/fedora/rc-local.service \
184         units/fedora/reboot.service \
185         units/fedora/sysinit.service
186 endif
187
188 if TARGET_SUSE
189 dist_systemunit_DATA += \
190         units/suse/halt.service \
191         units/suse/poweroff.service \
192         units/suse/reboot.service
193 endif
194
195 if TARGET_GENTOO
196 dist_systemunit_DATA += \
197         units/gentoo/halt.service \
198         units/gentoo/killall.service \
199         units/gentoo/poweroff.service \
200         units/gentoo/reboot.service \
201         units/gentoo/xdm.service
202 endif
203
204 if TARGET_ARCH
205 dist_systemunit_DATA += \
206         units/arch/sysinit.service \
207         units/arch/rc-local.service \
208         units/arch/halt.service \
209         units/arch/poweroff.service \
210         units/arch/reboot.service
211 endif
212
213 dist_doc_DATA = \
214         README \
215         LICENSE \
216         DISTRO_PORTING \
217         src/sd-daemon.h \
218         src/sd-daemon.c
219
220 pkgconfigdata_DATA = \
221         systemd.pc
222
223 noinst_LTLIBRARIES = \
224         libsystemd-basic.la \
225         libsystemd-core.la
226
227 libsystemd_basic_la_SOURCES = \
228         src/util.c \
229         src/hashmap.c \
230         src/set.c \
231         src/strv.c \
232         src/conf-parser.c \
233         src/socket-util.c \
234         src/log.c \
235         src/ratelimit.c
236
237 libsystemd_core_la_SOURCES = \
238         src/unit.c \
239         src/job.c \
240         src/manager.c \
241         src/path-lookup.c \
242         src/load-fragment.c \
243         src/service.c \
244         src/automount.c \
245         src/mount.c \
246         src/swap.c \
247         src/device.c \
248         src/target.c \
249         src/snapshot.c \
250         src/socket.c \
251         src/timer.c \
252         src/path.c \
253         src/load-dropin.c \
254         src/execute.c \
255         src/dbus.c \
256         src/dbus-manager.c \
257         src/dbus-unit.c \
258         src/dbus-job.c \
259         src/dbus-service.c \
260         src/dbus-socket.c \
261         src/dbus-timer.c \
262         src/dbus-target.c \
263         src/dbus-mount.c \
264         src/dbus-automount.c \
265         src/dbus-swap.c \
266         src/dbus-snapshot.c \
267         src/dbus-device.c \
268         src/dbus-execute.c \
269         src/dbus-path.c \
270         src/cgroup.c \
271         src/mount-setup.c \
272         src/hostname-setup.c \
273         src/loopback-setup.c \
274         src/kmod-setup.c \
275         src/modprobe-setup.c \
276         src/utmp-wtmp.c \
277         src/specifier.c \
278         src/unit-name.c \
279         src/fdset.c \
280         src/namespace.c \
281         src/tcpwrap.c \
282         src/cgroup-util.c
283
284 libsystemd_core_la_CFLAGS = \
285         $(AM_CFLAGS) \
286         $(DBUS_CFLAGS) \
287         $(UDEV_CFLAGS) \
288         $(CGROUP_CFLAGS)
289
290 libsystemd_core_la_LIBADD = \
291         libsystemd-basic.la \
292         $(DBUS_LIBS) \
293         $(UDEV_LIBS) \
294         $(CGROUP_LIBS) \
295         $(LIBWRAP_LIBS) \
296         $(PAM_LIBS)
297
298 # This is needed because automake is buggy in how it generates the
299 # rules for C programs, but not Vala programs.  We therefore can't
300 # list the .h files as dependencies if we want make dist to work.
301
302 EXTRA_DIST += \
303         ${libsystemd_basic_la_SOURCES:.c=.h} \
304         ${libsystemd_core_la_SOURCES:.c=.h} \
305         src/macro.h \
306         src/ioprio.h \
307         src/missing.h \
308         src/list.h \
309         src/securebits.h \
310         src/linux/auto_dev-ioctl.h \
311         src/initreq.h \
312         src/sd-daemon.h \
313         src/special.h \
314         src/dbus-common.h \
315         src/bus-errors.h
316
317 MANPAGES = \
318         man/systemd.1 \
319         man/systemctl.1 \
320         man/systemadm.1 \
321         man/systemd-install.1 \
322         man/systemd-notify.1 \
323         man/sd_notify.3 \
324         man/sd_booted.3 \
325         man/sd_listen_fds.3 \
326         man/sd_is_fifo.3 \
327         man/systemd.unit.5 \
328         man/systemd.service.5 \
329         man/systemd.socket.5 \
330         man/systemd.mount.5 \
331         man/systemd.automount.5 \
332         man/systemd.swap.5 \
333         man/systemd.timer.5 \
334         man/systemd.path.5 \
335         man/systemd.target.5 \
336         man/systemd.device.5 \
337         man/systemd.snapshot.5 \
338         man/systemd.exec.5 \
339         man/daemon.7 \
340         man/sd-daemon.7 \
341         man/runlevel.8 \
342         man/telinit.8 \
343         man/halt.8 \
344         man/shutdown.8 \
345         man/pam_systemd.8 \
346         man/systemd.conf.5
347
348 MANPAGES_ALIAS = \
349         man/reboot.8 \
350         man/poweroff.8 \
351         man/sd_is_socket.3 \
352         man/sd_is_socket_unix.3 \
353         man/sd_is_socket_inet.3 \
354         man/sd_notifyf.3 \
355         man/init.1
356
357 man/reboot.8: man/halt.8
358 man/poweroff.8: man/halt.8
359 man/sd_is_socket.3: man/sd_is_fifo.3
360 man/sd_is_socket_unix.3: man/sd_is_fifo.3
361 man/sd_is_socket_inet.3: man/sd_is_fifo.3
362 man/sd_notifyf.3: man/sd_notify.3
363 man/init.1: man/systemd.1
364
365 dist_man_MANS = \
366         $(MANPAGES) \
367         $(MANPAGES_ALIAS)
368
369 nodist_man_MANS = \
370         man/systemd.special.7
371
372 XML_FILES = \
373         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
374
375 XML_IN_FILES = \
376         ${patsubst %.1,%.xml.in,${patsubst %.3,%.xml.in,${patsubst %.5,%.xml.in,${patsubst %.7,%.xml.in,${patsubst %.8,%.xml.in,$(nodist_man_MANS)}}}}}
377
378 dist_noinst_DATA = \
379         ${XML_FILES:.xml=.html}
380
381 nodist_noinst_DATA = \
382         ${XML_IN_FILES:.xml.in=.html}
383
384 EXTRA_DIST += \
385         $(XML_FILES) \
386         $(XML_IN_FILES) \
387         ${nodist_man_MANS:=.in} \
388         ${XML_IN_FILES:.xml.in=.html.in}
389
390 systemd_SOURCES = \
391         src/main.c
392
393 systemd_CFLAGS = \
394         $(AM_CFLAGS) \
395         $(DBUS_CFLAGS) \
396         $(UDEV_CFLAGS) \
397         $(CGROUP_CFLAGS)
398
399 systemd_LDADD = \
400         libsystemd-core.la
401
402 test_engine_SOURCES = \
403         src/test-engine.c
404
405 test_engine_CFLAGS = $(systemd_CFLAGS)
406 test_engine_LDADD = $(systemd_LDADD)
407
408 test_job_type_SOURCES = \
409         src/test-job-type.c
410
411 test_job_type_CFLAGS = $(systemd_CFLAGS)
412 test_job_type_LDADD = $(systemd_LDADD)
413
414 test_ns_SOURCES = \
415         src/test-ns.c
416
417 test_ns_CFLAGS = $(systemd_CFLAGS)
418 test_ns_LDADD = $(systemd_LDADD)
419
420 test_loopback_SOURCES = \
421         src/test-loopback.c \
422         src/loopback-setup.c
423
424 test_loopback_LDADD = \
425         libsystemd-basic.la
426
427 test_daemon_SOURCES = \
428         src/test-daemon.c \
429         src/sd-daemon.c
430
431 test_daemon_LDADD = \
432         libsystemd-basic.la
433
434 test_cgroup_SOURCES = \
435         src/test-cgroup.c \
436         src/cgroup-util.c
437
438 test_cgroup_CFLAGS = \
439         $(AM_CFLAGS) \
440         $(CGROUP_CFLAGS)
441
442 test_cgroup_LDADD = \
443         libsystemd-basic.la \
444         $(CGROUP_LIBS)
445
446 systemd_logger_SOURCES = \
447         src/logger.c \
448         src/sd-daemon.c \
449         src/tcpwrap.c
450
451 systemd_logger_LDADD = \
452         libsystemd-basic.la \
453         $(LIBWRAP_LIBS)
454
455 systemd_initctl_SOURCES = \
456         src/initctl.c \
457         src/sd-daemon.c \
458         src/dbus-common.c
459
460 systemd_initctl_CFLAGS = \
461         $(AM_CFLAGS) \
462         $(DBUS_CFLAGS)
463
464 systemd_initctl_LDADD = \
465         libsystemd-basic.la \
466         $(DBUS_LIBS)
467
468 systemd_cgroups_agent_SOURCES = \
469         src/cgroups-agent.c
470
471 systemd_cgroups_agent_CFLAGS = \
472         $(AM_CFLAGS) \
473         $(DBUS_CFLAGS)
474
475 systemd_cgroups_agent_LDADD = \
476         libsystemd-basic.la \
477         $(DBUS_LIBS)
478
479 systemctl_SOURCES = \
480         src/systemctl.c \
481         src/utmp-wtmp.c \
482         src/dbus-common.c
483
484 systemctl_CFLAGS = \
485         $(AM_CFLAGS) \
486         $(DBUS_CFLAGS)
487
488 systemctl_LDADD = \
489         libsystemd-basic.la \
490         $(DBUS_LIBS)
491
492 systemd_notify_SOURCES = \
493         src/notify.c \
494         src/sd-daemon.c
495
496 systemd_notify_LDADD = \
497         libsystemd-basic.la
498
499 systemd_install_SOURCES = \
500         src/install.c \
501         src/path-lookup.c \
502         src/dbus-common.c
503
504 systemd_install_LDADD = \
505         libsystemd-basic.la \
506         $(DBUS_LIBS)
507
508 systemd_install_CFLAGS = \
509         $(AM_CFLAGS) \
510         $(DBUS_CFLAGS)
511
512 systemadm_SOURCES = \
513         src/systemadm.vala \
514         src/systemd-interfaces.vala
515
516 systemadm_CFLAGS = \
517         $(AM_CFLAGS) \
518         $(DBUSGLIB_CFLAGS) \
519         $(GTK_CFLAGS) \
520         -Wno-unused-variable \
521         -Wno-unused-function \
522         -Wno-shadow \
523         -Wno-format-nonliteral
524
525 systemadm_VALAFLAGS = \
526         --pkg=dbus-glib-1 \
527         --pkg=posix \
528         --pkg=gtk+-2.0 \
529         -g
530
531 systemadm_LDADD = \
532         $(DBUSGLIB_LIBS) \
533         $(GTK_LIBS)
534
535 pam_systemd_la_SOURCES = \
536         src/pam-module.c \
537         src/cgroup-util.c \
538         src/sd-daemon.c
539
540 pam_systemd_la_CFLAGS = \
541         $(AM_CFLAGS) \
542         $(CGROUP_CFLAGS) \
543         -fvisibility=hidden
544
545 pam_systemd_la_LDFLAGS = \
546         -module \
547         -export-dynamic \
548         -avoid-version \
549         -shared \
550         -export-symbols-regex '^pam_sm_.*'
551
552 pam_systemd_la_LIBADD = \
553         libsystemd-basic.la \
554         $(PAM_LIBS) \
555         $(CGROUP_LIBS)
556
557 SED_PROCESS = \
558         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
559         $(SED)  -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
560                 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
561                 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
562                 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
563                 -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
564                 -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
565                 -e 's,@systemunitdir\@,$(systemunitdir),g' \
566                 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
567                 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
568                 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
569                 -e 's,@prefix\@,$(prefix),g' \
570                 < $< > $@
571
572 units/%: units/%.in Makefile
573         $(SED_PROCESS)
574
575 man/%: man/%.in Makefile
576         $(SED_PROCESS)
577
578 %.pc: %.pc.in Makefile
579         $(SED_PROCESS)
580
581 M4_PROCESS_SYSTEM = \
582         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
583         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
584
585 M4_PROCESS_SESSION = \
586         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
587         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
588
589 units/%: units/%.m4 Makefile
590         $(M4_PROCESS_SYSTEM)
591
592 units/session/%: units/%.m4 Makefile
593         $(M4_PROCESS_SESSION)
594
595 CLEANFILES = \
596         $(nodist_systemunit_DATA) \
597         $(nodist_sessionunit_DATA) \
598         $(nodist_man_MANS) \
599         ${XML_IN_FILES:.xml.in=.html} \
600         $(pkgconfigdata_DATA)
601
602 if HAVE_VALAC
603 CLEANFILES += \
604         ${systemadm_SOURCES:.vala=.c}
605 endif
606
607 if HAVE_XSLTPROC
608 XSLTPROC_FLAGS = \
609         --nonet \
610         --param funcsynopsis.style "'ansi'"
611
612 XSLTPROC_PROCESS_MAN = \
613         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
614         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
615
616 XSLTPROC_PROCESS_MAN_IN = \
617         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
618         $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
619         mv ${@:.in=} $@
620
621 XSLTPROC_PROCESS_HTML = \
622         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
623         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
624
625 XSLTPROC_PROCESS_HTML_IN = \
626         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
627         $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
628         mv ${@:.in=} $@
629
630 man/%.1: man/%.xml
631         $(XSLTPROC_PROCESS_MAN)
632
633 man/%.1.in: man/%.xml.in
634         $(XSLTPROC_PROCESS_MAN)
635
636 man/%.3: man/%.xml
637         $(XSLTPROC_PROCESS_MAN)
638
639 man/%.3.in: man/%.xml.in
640         $(XSLTPROC_PROCESS_MAN)
641
642 man/%.5: man/%.xml
643         $(XSLTPROC_PROCESS_MAN)
644
645 man/%.5.in: man/%.xml.in
646         $(XSLTPROC_PROCESS_MAN)
647
648 man/%.7: man/%.xml
649         $(XSLTPROC_PROCESS_MAN)
650
651 man/%.7.in: man/%.xml.in
652         $(XSLTPROC_PROCESS_MAN_IN)
653
654 man/%.8: man/%.xml
655         $(XSLTPROC_PROCESS_MAN)
656
657 man/%.8.in: man/%.xml.in
658         $(XSLTPROC_PROCESS_MAN_IN)
659
660 man/%.html: man/%.xml
661         $(XSLTPROC_PROCESS_HTML)
662
663 man/%.html.in: man/%.xml.in
664         $(XSLTPROC_PROCESS_HTML_IN)
665
666 CLEANFILES += \
667         $(dist_man_MANS) \
668         ${nodist_man_MANS:=.in} \
669         ${XML_FILES:.xml=.html} \
670         ${XML_IN_FILES:.xml.in=.html.in}
671 endif
672
673 org.freedesktop.systemd1.%.xml: systemd
674         $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
675
676 CLEANFILES += \
677         $(dbusinterface_DATA)
678
679 install-data-hook:
680         $(MKDIR_P) -m 0755 \
681                 $(DESTDIR)$(systemunitdir) \
682                 $(DESTDIR)$(sessionunitdir) \
683                 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
684                 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
685                 $(DESTDIR)$(pkgsysconfdir)/system \
686                 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
687                 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
688                 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
689                 $(DESTDIR)$(pkgsysconfdir)/session \
690                 $(DESTDIR)$(sysconfdir)/xdg/systemd
691         $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup || \
692                 echo "Don't forget to create /cgroup! Couldn't create it for you, continuing anyway."
693         ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
694                 rm -f session && \
695                 $(LN_S) $(pkgsysconfdir)/session session )
696         ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
697                 rm -f systemd-initctl.socket systemd-logger.socket && \
698                 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
699                 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
700         ( cd $(DESTDIR)$(sessionunitdir) && \
701                 rm -f shutdown.target sockets.target local-fs.target swap.target && \
702                 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
703                 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
704                 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
705                 $(LN_S) $(systemunitdir)/swap.target swap.target )
706         ( cd $(DESTDIR)$(systemunitdir) && \
707                 rm -f runlevel0.target runlevel1.target runlevel6.target && \
708                 $(LN_S) poweroff.target runlevel0.target && \
709                 $(LN_S) rescue.target runlevel1.target && \
710                 $(LN_S) reboot.target runlevel6.target )
711         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
712                 rm -f default.target ctrl-alt-del.target kbrequest.target && \
713                 $(LN_S) $(systemunitdir)/graphical.target default.target && \
714                 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
715                 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
716                 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
717                 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
718                 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
719                 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
720                 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
721         ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
722                 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
723                 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
724                 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
725                 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
726                 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
727                 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
728                 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
729         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
730                 rm -f getty.target remote-fs.target && \
731                 $(LN_S) $(systemunitdir)/getty.target getty.target && \
732                 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
733         ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
734                 rm -f dev-hugepages.automount \
735                         dev-mqueue.automount \
736                         proc-sys-fs-binfmt_misc.automount \
737                         sys-kernel-debug.automount \
738                         sys-kernel-security.automount && \
739                 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
740                 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
741                 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
742                 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
743                 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
744         ( cd $(DESTDIR)$(dbussessionservicedir) && \
745                 rm -f org.freedesktop.systemd1.service && \
746                 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
747 if TARGET_FEDORA
748         $(MKDIR_P) -m 0755 \
749                 $(DESTDIR)$(SYSTEM_SYSVINIT_PATH)
750         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
751                 rm -f display-manager.service && \
752                 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
753         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
754                 rm -f prefdm.service && \
755                 $(LN_S) ../prefdm.service prefdm.service )
756         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
757                 rm -f rc-local.service && \
758                 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
759         ( cd $(DESTDIR)$(systemunitdir) && \
760                 rm -f local.service && \
761                 $(LN_S) rc-local.service local.service )
762         ( cd $(DESTDIR)$(SYSTEM_SYSVINIT_PATH) && \
763                 $(LN_S) halt reboot > /dev/null 2>&1 || true )
764 endif
765 if TARGET_GENTOO
766         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
767                 rm -f display-manager.service && \
768                 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
769         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
770                 rm -f prefdm.service && \
771                 $(LN_S) ../prefdm.service prefdm.service )
772 endif
773
774 DISTCHECK_CONFIGURE_FLAGS = \
775         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
776         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
777         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
778         --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
779         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
780         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
781         --with-rootdir=$$dc_install_base/$(rootdir)