summaryrefslogtreecommitdiffstats
path: root/login-utils/Makefile.am
blob: 8f5dc894340c062e689a9ea42b5112adb23777f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
include $(top_srcdir)/config/include-Makefile.am

bin_PROGRAMS =
usrbinexec_PROGRAMS =
sbin_PROGRAMS =
usrsbinexec_PROGRAMS =
dist_man_MANS =

EXTRA_DIST = README.getty  README.modems-with-agetty  README.poeigl

if BUILD_AGETTY
sbin_PROGRAMS += agetty
dist_man_MANS += agetty.8
endif

if BUILD_INIT

sbin_PROGRAMS += simpleinit shutdown initctl
dist_man_MANS += fastboot.8 fasthalt.8 halt.8 reboot.8 simpleinit.8 shutdown.8 \
	initctl.8

simpleinit_SOURCES = simpleinit.c my_crypt.h simpleinit.h
initctl_SOURCES = initctl.c simpleinit.h

if NEED_LIBCRYPT
simpleinit_LDADD = -lcrypt
endif

endif

if BUILD_LAST
usrbinexec_PROGRAMS += last
dist_man_MANS += last.1
endif

if BUILD_LOGIN_UTILS

bin_PROGRAMS += login
usrbinexec_PROGRAMS += chfn chsh newgrp
usrsbinexec_PROGRAMS += vipw
dist_man_MANS += chfn.1 chsh.1 login.1 newgrp.1 vipw.8 vigr.8

chfn_SOURCES = chfn.c $(chfn_chsh_common)
chsh_SOURCES = chsh.c $(chfn_chsh_common)
chfn_chsh_common = islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h \
	../lib/env.c
login_SOURCES = login.c login.h my_crypt.h ../lib/setproctitle.c
newgrp_SOURCES = newgrp.c my_crypt.h
vipw_SOURCES = vipw.c setpwnam.h

chfn_LDADD =
chsh_LDADD =
login_LDADD =
newgrp_LDADD =
vipw_LDADD =

chfn_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
chsh_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)

chfn_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
chsh_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)

if NEED_LIBCRYPT
chfn_LDADD += -lcrypt
chsh_LDADD += -lcrypt
login_LDADD += -lcrypt
newgrp_LDADD += -lcrypt
endif

if HAVE_PAM
chfn_LDADD += -lpam -lpam_misc
chsh_LDADD += -lpam -lpam_misc
login_LDADD += -lpam -lpam_misc
else
login_SOURCES += checktty.c
endif

if HAVE_AUDIT
login_LDADD += -laudit
endif

if HAVE_SELINUX
chfn_SOURCES += selinux_utils.c selinux_utils.h
chfn_LDADD += -lselinux
chsh_SOURCES += selinux_utils.c selinux_utils.h
chsh_LDADD += -lselinux
vipw_LDADD += -lselinux
endif


install-exec-hook::
	cd $(DESTDIR)$(usrsbinexecdir) && ln -sf vipw vigr

endif

if BUILD_MESG
usrbinexec_PROGRAMS += mesg
dist_man_MANS += mesg.1
endif

if BUILD_WALL
usrbinexec_PROGRAMS += wall
wall_SOURCES = wall.c ttymsg.c ttymsg.h
dist_man_MANS += wall.1

if USE_TTY_GROUP
if MAKEINSTALL_DO_CHOWN
install-exec-hook::
	chgrp tty $(DESTDIR)$(usrbinexecdir)/wall
	chmod g+s $(DESTDIR)$(usrbinexecdir)/wall
endif
endif
endif

if BUILD_INIT

install-exec-hook::
	cd $(DESTDIR)$(sbindir) && ln -sf shutdown reboot
	cd $(DESTDIR)$(sbindir) && ln -sf shutdown fastboot
	cd $(DESTDIR)$(sbindir) && ln -sf shutdown halt
	cd $(DESTDIR)$(sbindir) && ln -sf shutdown fasthalt
	cd $(DESTDIR)$(sbindir) && ln -sf initctl need
	cd $(DESTDIR)$(sbindir) && ln -sf initctl display-services
	cd $(DESTDIR)$(sbindir) && ln -sf initctl provide
	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 need.8
	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 display-services.8
	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 provide.8

endif

noinst_PROGRAMS = checktty_test
checktty_test_SOURCES = checktty.c login.h
checktty_test_CPPFLAGS = -DMAIN_TEST_CHECKTTY $(AM_CPPFLAGS)