]> git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/Makemodule.am
scriptreplay: add --stream to the man page
[thirdparty/util-linux.git] / login-utils / Makemodule.am
1
2 if BUILD_LAST
3 usrbin_exec_PROGRAMS += last
4 dist_man_MANS += \
5 login-utils/last.1 \
6 login-utils/lastb.1
7 last_SOURCES = login-utils/last.c lib/monotonic.c
8 last_LDADD = $(LDADD) libcommon.la $(REALTIME_LIBS)
9
10 install-exec-hook-last:
11 cd $(DESTDIR)$(usrbin_execdir) && ln -sf last lastb
12
13 INSTALL_EXEC_HOOKS += install-exec-hook-last
14 endif
15
16 if BUILD_SULOGIN
17 sbin_PROGRAMS += sulogin
18 dist_man_MANS += login-utils/sulogin.8
19 sulogin_SOURCES = \
20 login-utils/sulogin.c \
21 login-utils/sulogin-consoles.c \
22 login-utils/sulogin-consoles.h
23 sulogin_LDADD = $(LDADD) libcommon.la
24
25 if HAVE_LIBCRYPT
26 sulogin_LDADD += -lcrypt
27 endif
28 if HAVE_SELINUX
29 sulogin_LDADD += -lselinux
30 endif
31
32 check_PROGRAMS += test_consoles
33 test_consoles_SOURCES = login-utils/sulogin-consoles.c
34 test_consoles_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM
35 test_consoles_LDADD = $(LDADD) libcommon.la
36 endif # BUILD_SULOGIN
37
38
39 if BUILD_LOGIN
40 bin_PROGRAMS += login
41 dist_man_MANS += login-utils/login.1
42 login_SOURCES = \
43 login-utils/login.c \
44 login-utils/logindefs.c \
45 login-utils/logindefs.h
46 login_LDADD = $(LDADD) libcommon.la -lpam
47 if HAVE_LINUXPAM
48 login_LDADD += -lpam_misc
49 endif
50 if HAVE_AUDIT
51 login_LDADD += -laudit
52 endif
53 if HAVE_SELINUX
54 login_LDADD += -lselinux
55 endif
56 endif # BUILD_LOGIN
57
58
59 if BUILD_NOLOGIN
60 sbin_PROGRAMS += nologin
61 dist_man_MANS += login-utils/nologin.8
62 nologin_SOURCES = login-utils/nologin.c
63 endif
64
65
66 if BUILD_UTMPDUMP
67 usrbin_exec_PROGRAMS += utmpdump
68 dist_man_MANS += login-utils/utmpdump.1
69 utmpdump_SOURCES = login-utils/utmpdump.c
70 utmpdump_LDADD = $(LDADD) libcommon.la
71 endif
72
73
74 if BUILD_CHFN_CHSH
75 usrbin_exec_PROGRAMS += chfn chsh
76 dist_man_MANS += \
77 login-utils/chfn.1 \
78 login-utils/chsh.1
79
80 chfn_chsh_sources = \
81 login-utils/ch-common.h \
82 login-utils/ch-common.c
83 chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
84 chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
85 chfn_chsh_ldadd = libcommon.la $(READLINE_LIBS)
86
87 if CHFN_CHSH_PASSWORD
88 chfn_chsh_ldadd += -lpam
89 if HAVE_LINUXPAM
90 chfn_chsh_ldadd += -lpam_misc
91 endif
92 chfn_chsh_sources += \
93 login-utils/auth.c \
94 login-utils/auth.h
95 endif # CHFN_CHSH_PASSWORD
96
97 if HAVE_USER
98 chfn_chsh_ldflags += $(LIBUSER_LIBS)
99 chfn_chsh_cflags += $(LIBUSER_CFLAGS)
100 chfn_chsh_sources+= \
101 login-utils/libuser.c \
102 login-utils/libuser.h
103 else
104 chfn_chsh_sources += \
105 login-utils/islocal.c \
106 login-utils/islocal.h \
107 login-utils/setpwnam.c \
108 login-utils/setpwnam.h
109 endif
110
111 if HAVE_SELINUX
112 chfn_chsh_sources += \
113 login-utils/selinux_utils.c \
114 login-utils/selinux_utils.h
115 chfn_chsh_ldadd += -lselinux
116 endif
117
118 chfn_SOURCES = \
119 login-utils/chfn.c \
120 login-utils/logindefs.c \
121 login-utils/logindefs.h \
122 $(chfn_chsh_sources)
123 chfn_CFLAGS = $(chfn_chsh_cflags)
124 chfn_LDFLAGS = $(chfn_chsh_ldflags)
125 chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
126
127 chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
128 chsh_CFLAGS = $(chfn_chsh_cflags)
129 chsh_LDFLAGS = $(chfn_chsh_ldflags)
130 chsh_LDADD = $(LDADD) $(chfn_chsh_ldadd)
131 endif # BUILD_CHFN_CHSH
132
133
134 if BUILD_SU
135 bin_PROGRAMS += su
136 dist_man_MANS += login-utils/su.1
137 su_SOURCES = \
138 login-utils/su.c \
139 login-utils/su-common.c \
140 login-utils/su-common.h \
141 login-utils/logindefs.c \
142 login-utils/logindefs.h
143 su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
144 su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
145 su_LDADD = $(LDADD) libcommon.la -lpam
146 if HAVE_LINUXPAM
147 su_LDADD += -lpam_misc
148 endif
149 if HAVE_UTIL
150 su_LDADD += -lutil
151 endif
152 endif # BUILD_SU
153
154
155 if BUILD_RUNUSER
156 sbin_PROGRAMS += runuser
157 dist_man_MANS += login-utils/runuser.1
158 runuser_SOURCES = \
159 login-utils/runuser.c \
160 login-utils/su-common.c \
161 login-utils/su-common.h \
162 login-utils/logindefs.c \
163 login-utils/logindefs.h
164 runuser_LDADD = $(LDADD) libcommon.la -lpam
165 if HAVE_LINUXPAM
166 runuser_LDADD += -lpam_misc
167 endif
168 if HAVE_UTIL
169 runuser_LDADD += -lutil
170 endif
171 endif # BUILD_RUNUSER
172
173
174 if BUILD_NEWGRP
175 usrbin_exec_PROGRAMS += newgrp
176 dist_man_MANS += login-utils/newgrp.1
177 newgrp_SOURCES = login-utils/newgrp.c
178 newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
179 newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
180 newgrp_LDADD = $(LDADD)
181 if HAVE_LIBCRYPT
182 newgrp_LDADD += -lcrypt
183 endif
184 endif # BUILD_NEWGRP
185
186 if BUILD_LSLOGINS
187 usrbin_exec_PROGRAMS += lslogins
188 dist_man_MANS += login-utils/lslogins.1
189 lslogins_SOURCES = \
190 login-utils/lslogins.c \
191 login-utils/logindefs.c \
192 login-utils/logindefs.h
193 lslogins_LDADD = $(LDADD) libcommon.la libsmartcols.la
194 lslogins_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir)
195 if HAVE_SELINUX
196 lslogins_LDADD += -lselinux
197 endif
198 if HAVE_SYSTEMD
199 lslogins_LDADD += $(SYSTEMD_LIBS) $(SYSTEMD_JOURNAL_LIBS)
200 lslogins_CFLAGS += $(SYSTEMD_CFLAGS) $(SYSTEMD_JOURNAL_CFLAGS)
201 endif
202 endif # BUILD_LSLOGINS
203
204 if BUILD_VIPW
205 usrsbin_exec_PROGRAMS += vipw
206 dist_man_MANS += \
207 login-utils/vigr.8 \
208 login-utils/vipw.8
209 vipw_SOURCES = \
210 login-utils/vipw.c \
211 login-utils/setpwnam.h
212 vipw_LDADD = $(LDADD) libcommon.la
213 if HAVE_SELINUX
214 vipw_LDADD += -lselinux
215 endif
216 install-exec-hook-vipw::
217 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
218
219 INSTALL_EXEC_HOOKS += install-exec-hook-vipw
220 endif # BUILD_VIPW
221
222
223 check_PROGRAMS += \
224 test_islocal \
225 test_logindefs
226
227 test_islocal_SOURCES = login-utils/islocal.c
228 test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
229
230 test_logindefs_SOURCES = \
231 login-utils/logindefs.c \
232 login-utils/logindefs.h
233 test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
234
235
236 install-exec-hook:
237 if BUILD_SU
238 if MAKEINSTALL_DO_CHOWN
239 chown root:root $(DESTDIR)$(bindir)/su
240 endif
241 if MAKEINSTALL_DO_SETUID
242 chmod 4755 $(DESTDIR)$(bindir)/su
243 endif
244 endif
245 if BUILD_VIPW
246 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
247 endif