]> git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/Makemodule.am
build-sys: cleanup realtime lib usage
[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_DEPRECATED_LAST
17 usrbin_exec_PROGRAMS += last
18 dist_man_MANS += login-utils/last-deprecated.1
19 last_SOURCES = login-utils/last-deprecated.c
20 endif # BUILD_DEPRECATED_LAST
21
22
23 if BUILD_SULOGIN
24 sbin_PROGRAMS += sulogin
25 dist_man_MANS += login-utils/sulogin.8
26 sulogin_SOURCES = \
27 login-utils/sulogin.c \
28 login-utils/sulogin-consoles.c \
29 login-utils/sulogin-consoles.h
30 sulogin_LDADD = $(LDADD) libcommon.la
31
32 if HAVE_LIBCRYPT
33 sulogin_LDADD += -lcrypt
34 endif
35 if HAVE_SELINUX
36 sulogin_LDADD += -lselinux
37 endif
38
39 check_PROGRAMS += test_consoles
40 test_consoles_SOURCES = login-utils/sulogin-consoles.c
41 test_consoles_CFLAGS = -DTEST_PROGRAM
42 test_consoles_LDADD = libcommon.la
43 endif # BUILD_SULOGIN
44
45
46 if BUILD_LOGIN
47 bin_PROGRAMS += login
48 dist_man_MANS += login-utils/login.1
49 login_SOURCES = \
50 login-utils/login.c \
51 login-utils/logindefs.c \
52 login-utils/logindefs.h
53 login_LDADD = $(LDADD) libcommon.la -lpam
54 if HAVE_LINUXPAM
55 login_LDADD += -lpam_misc
56 endif
57 if HAVE_AUDIT
58 login_LDADD += -laudit
59 endif
60 if HAVE_SELINUX
61 login_LDADD += -lselinux
62 endif
63 endif # BUILD_LOGIN
64
65
66 if BUILD_NOLOGIN
67 sbin_PROGRAMS += nologin
68 dist_man_MANS += login-utils/nologin.8
69 nologin_SOURCES = login-utils/nologin.c
70 endif
71
72
73 if BUILD_UTMPDUMP
74 usrbin_exec_PROGRAMS += utmpdump
75 dist_man_MANS += login-utils/utmpdump.1
76 utmpdump_SOURCES = login-utils/utmpdump.c
77 endif
78
79
80 if BUILD_CHFN_CHSH
81 usrbin_exec_PROGRAMS += chfn chsh
82 dist_man_MANS += \
83 login-utils/chfn.1 \
84 login-utils/chsh.1
85
86 chfn_chsh_sources = \
87 login-utils/ch-common.h \
88 login-utils/ch-common.c
89 chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
90 chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
91 chfn_chsh_ldadd = libcommon.la
92
93 if CHFN_CHSH_PASSWORD
94 chfn_chsh_ldadd += -lpam
95 if HAVE_LINUXPAM
96 chfn_chsh_ldadd += -lpam_misc
97 endif
98 chfn_chsh_sources += \
99 login-utils/auth.c \
100 login-utils/auth.h
101 endif # CHFN_CHSH_PASSWORD
102
103 if HAVE_USER
104 chfn_chsh_ldflags += $(LIBUSER_LIBS)
105 chfn_chsh_cflags += $(LIBUSER_CFLAGS)
106 chfn_chsh_sources+= \
107 login-utils/libuser.c \
108 login-utils/libuser.h
109 else
110 chfn_chsh_sources += \
111 login-utils/islocal.c \
112 login-utils/islocal.h \
113 login-utils/setpwnam.c \
114 login-utils/setpwnam.h
115 endif
116
117 if HAVE_SELINUX
118 chfn_chsh_sources += \
119 login-utils/selinux_utils.c \
120 login-utils/selinux_utils.h
121 chfn_chsh_ldadd += -lselinux
122 endif
123
124 chfn_SOURCES = \
125 login-utils/chfn.c \
126 login-utils/logindefs.c \
127 login-utils/logindefs.h \
128 $(chfn_chsh_sources)
129 chfn_CFLAGS = $(chfn_chsh_cflags)
130 chfn_LDFLAGS = $(chfn_chsh_ldflags)
131 chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
132
133 chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
134 chsh_CFLAGS = $(chfn_chsh_cflags)
135 chsh_LDFLAGS = $(chfn_chsh_ldflags)
136 chsh_LDADD = $(LDADD) $(chfn_chsh_ldadd)
137 endif # BUILD_CHFN_CHSH
138
139
140 if BUILD_SU
141 bin_PROGRAMS += su
142 dist_man_MANS += login-utils/su.1
143 su_SOURCES = \
144 login-utils/su.c \
145 login-utils/su-common.c \
146 login-utils/su-common.h \
147 login-utils/logindefs.c \
148 login-utils/logindefs.h
149 su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
150 su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
151 su_LDADD = $(LDADD) libcommon.la -lpam
152 if HAVE_LINUXPAM
153 su_LDADD += -lpam_misc
154 endif
155 endif # BUILD_SU
156
157
158 if BUILD_RUNUSER
159 sbin_PROGRAMS += runuser
160 dist_man_MANS += login-utils/runuser.1
161 runuser_SOURCES = \
162 login-utils/runuser.c \
163 login-utils/su-common.c \
164 login-utils/su-common.h \
165 login-utils/logindefs.c \
166 login-utils/logindefs.h
167 runuser_LDADD = $(LDADD) libcommon.la -lpam
168 if HAVE_LINUXPAM
169 runuser_LDADD += -lpam_misc
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_SETUID
239 chmod 4755 $(DESTDIR)$(bindir)/su
240 endif
241 endif
242 if BUILD_VIPW
243 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
244 endif