]> git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/Makemodule.am
Merge branch 'master' of https://github.com/pali/util-linux
[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 endif # BUILD_SU
150
151
152 if BUILD_RUNUSER
153 sbin_PROGRAMS += runuser
154 dist_man_MANS += login-utils/runuser.1
155 runuser_SOURCES = \
156 login-utils/runuser.c \
157 login-utils/su-common.c \
158 login-utils/su-common.h \
159 login-utils/logindefs.c \
160 login-utils/logindefs.h
161 runuser_LDADD = $(LDADD) libcommon.la -lpam
162 if HAVE_LINUXPAM
163 runuser_LDADD += -lpam_misc
164 endif
165 endif # BUILD_RUNUSER
166
167
168 if BUILD_NEWGRP
169 usrbin_exec_PROGRAMS += newgrp
170 dist_man_MANS += login-utils/newgrp.1
171 newgrp_SOURCES = login-utils/newgrp.c
172 newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
173 newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
174 newgrp_LDADD = $(LDADD)
175 if HAVE_LIBCRYPT
176 newgrp_LDADD += -lcrypt
177 endif
178 endif # BUILD_NEWGRP
179
180 if BUILD_LSLOGINS
181 usrbin_exec_PROGRAMS += lslogins
182 dist_man_MANS += login-utils/lslogins.1
183 lslogins_SOURCES = \
184 login-utils/lslogins.c \
185 login-utils/logindefs.c \
186 login-utils/logindefs.h
187 lslogins_LDADD = $(LDADD) libcommon.la libsmartcols.la
188 lslogins_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir)
189 if HAVE_SELINUX
190 lslogins_LDADD += -lselinux
191 endif
192 if HAVE_SYSTEMD
193 lslogins_LDADD += $(SYSTEMD_LIBS) $(SYSTEMD_JOURNAL_LIBS)
194 lslogins_CFLAGS += $(SYSTEMD_CFLAGS) $(SYSTEMD_JOURNAL_CFLAGS)
195 endif
196 endif # BUILD_LSLOGINS
197
198 if BUILD_VIPW
199 usrsbin_exec_PROGRAMS += vipw
200 dist_man_MANS += \
201 login-utils/vigr.8 \
202 login-utils/vipw.8
203 vipw_SOURCES = \
204 login-utils/vipw.c \
205 login-utils/setpwnam.h
206 vipw_LDADD = $(LDADD) libcommon.la
207 if HAVE_SELINUX
208 vipw_LDADD += -lselinux
209 endif
210 install-exec-hook-vipw::
211 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
212
213 INSTALL_EXEC_HOOKS += install-exec-hook-vipw
214 endif # BUILD_VIPW
215
216
217 check_PROGRAMS += \
218 test_islocal \
219 test_logindefs
220
221 test_islocal_SOURCES = login-utils/islocal.c
222 test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
223
224 test_logindefs_SOURCES = \
225 login-utils/logindefs.c \
226 login-utils/logindefs.h
227 test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
228
229
230 install-exec-hook:
231 if BUILD_SU
232 if MAKEINSTALL_DO_CHOWN
233 chown root:root $(DESTDIR)$(bindir)/su
234 endif
235 if MAKEINSTALL_DO_SETUID
236 chmod 4755 $(DESTDIR)$(bindir)/su
237 endif
238 endif
239 if BUILD_VIPW
240 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
241 endif