]> git.ipfire.org Git - thirdparty/util-linux.git/blame - login-utils/Makemodule.am
build-sys: cleanup $vendordir use
[thirdparty/util-linux.git] / login-utils / Makemodule.am
CommitLineData
48d7b13a 1
48d7b13a 2if BUILD_LAST
30688dde 3usrbin_exec_PROGRAMS += last
ec01e9d0 4dist_man_MANS += \
ce602720
OO
5 login-utils/last.1 \
6 login-utils/lastb.1
cd2876d2 7last_SOURCES = login-utils/last.c lib/monotonic.c
254743e4 8last_LDADD = $(LDADD) libcommon.la $(REALTIME_LIBS)
ce602720
OO
9
10install-exec-hook-last:
bccc956d 11 cd $(DESTDIR)$(usrbin_execdir) && ln -sf last lastb
ce602720
OO
12
13INSTALL_EXEC_HOOKS += install-exec-hook-last
48d7b13a
KZ
14endif
15
de217489
KZ
16if BUILD_SULOGIN
17sbin_PROGRAMS += sulogin
ffeb2805
KZ
18dist_man_MANS += login-utils/sulogin.8
19sulogin_SOURCES = \
a73f59fa
KZ
20 login-utils/sulogin.c \
21 login-utils/sulogin-consoles.c \
22 login-utils/sulogin-consoles.h
dcdb349b 23sulogin_LDADD = $(LDADD) libcommon.la
a73f59fa 24
de217489
KZ
25if HAVE_LIBCRYPT
26sulogin_LDADD += -lcrypt
27endif
28if HAVE_SELINUX
29sulogin_LDADD += -lselinux
30endif
a73f59fa
KZ
31
32check_PROGRAMS += test_consoles
33test_consoles_SOURCES = login-utils/sulogin-consoles.c
b0b54cc5 34test_consoles_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM
b201f1d8 35test_consoles_LDADD = $(LDADD) libcommon.la
de217489
KZ
36endif # BUILD_SULOGIN
37
48d7b13a 38
e7614a07
KZ
39if BUILD_LOGIN
40bin_PROGRAMS += login
ffeb2805 41dist_man_MANS += login-utils/login.1
e7614a07 42login_SOURCES = \
ffeb2805
KZ
43 login-utils/login.c \
44 login-utils/logindefs.c \
d77ab74a 45 login-utils/logindefs.h
fe2c9909
WJ
46login_LDADD = $(LDADD) libcommon.la -lpam
47if HAVE_LINUXPAM
48login_LDADD += -lpam_misc
49endif
e7614a07
KZ
50if HAVE_AUDIT
51login_LDADD += -laudit
52endif
53if HAVE_SELINUX
54login_LDADD += -lselinux
55endif
9e584ff3
TK
56if HAVE_ECONF
57login_LDADD += -leconf
58endif
e7614a07
KZ
59endif # BUILD_LOGIN
60
61
88407b93
KZ
62if BUILD_NOLOGIN
63sbin_PROGRAMS += nologin
64dist_man_MANS += login-utils/nologin.8
65nologin_SOURCES = login-utils/nologin.c
66endif
67
68
78d5ceac
KZ
69if BUILD_UTMPDUMP
70usrbin_exec_PROGRAMS += utmpdump
71dist_man_MANS += login-utils/utmpdump.1
72utmpdump_SOURCES = login-utils/utmpdump.c
1173d0a6 73utmpdump_LDADD = $(LDADD) libcommon.la
78d5ceac
KZ
74endif
75
76
2c8a3e16
KZ
77if BUILD_CHFN_CHSH
78usrbin_exec_PROGRAMS += chfn chsh
ffeb2805
KZ
79dist_man_MANS += \
80 login-utils/chfn.1 \
81 login-utils/chsh.1
2c8a3e16 82
144ae70e
SK
83chfn_chsh_sources = \
84 login-utils/ch-common.h \
85 login-utils/ch-common.c
2c8a3e16
KZ
86chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
87chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
e41ae450 88chfn_chsh_ldadd = libcommon.la $(READLINE_LIBS)
d86918b6
KZ
89
90if CHFN_CHSH_PASSWORD
fe2c9909
WJ
91chfn_chsh_ldadd += -lpam
92if HAVE_LINUXPAM
93chfn_chsh_ldadd += -lpam_misc
94endif
d86918b6
KZ
95chfn_chsh_sources += \
96 login-utils/auth.c \
97 login-utils/auth.h
fe2c9909 98endif # CHFN_CHSH_PASSWORD
2c8a3e16 99
7e4714f2
CM
100if HAVE_USER
101chfn_chsh_ldflags += $(LIBUSER_LIBS)
102chfn_chsh_cflags += $(LIBUSER_CFLAGS)
6adb1ef2
CM
103chfn_chsh_sources+= \
104 login-utils/libuser.c \
105 login-utils/libuser.h
d86918b6
KZ
106else
107chfn_chsh_sources += \
108 login-utils/islocal.c \
109 login-utils/islocal.h \
110 login-utils/setpwnam.c \
111 login-utils/setpwnam.h
7e4714f2
CM
112endif
113
2c8a3e16 114if HAVE_SELINUX
ffeb2805
KZ
115chfn_chsh_sources += \
116 login-utils/selinux_utils.c \
117 login-utils/selinux_utils.h
2c8a3e16
KZ
118chfn_chsh_ldadd += -lselinux
119endif
120
e88f0059
SK
121chfn_SOURCES = \
122 login-utils/chfn.c \
123 login-utils/logindefs.c \
124 login-utils/logindefs.h \
125 $(chfn_chsh_sources)
2c8a3e16
KZ
126chfn_CFLAGS = $(chfn_chsh_cflags)
127chfn_LDFLAGS = $(chfn_chsh_ldflags)
dcdb349b 128chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
9e584ff3
TK
129if HAVE_ECONF
130chfn_LDADD += -leconf
131endif
2c8a3e16 132
ffeb2805 133chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
2c8a3e16
KZ
134chsh_CFLAGS = $(chfn_chsh_cflags)
135chsh_LDFLAGS = $(chfn_chsh_ldflags)
dcdb349b 136chsh_LDADD = $(LDADD) $(chfn_chsh_ldadd)
2c8a3e16
KZ
137endif # BUILD_CHFN_CHSH
138
139
ff4c5555 140if BUILD_SU
e7614a07 141bin_PROGRAMS += su
6edbca18 142dist_man_MANS += login-utils/su.1
ff4c5555 143su_SOURCES = \
ffeb2805 144 login-utils/su.c \
cf1a99da
KZ
145 login-utils/su-common.c \
146 login-utils/su-common.h \
ffeb2805
KZ
147 login-utils/logindefs.c \
148 login-utils/logindefs.h
23f75093 149su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
ff4c5555 150su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
23f75093 151su_LDADD = $(LDADD) libcommon.la -lpam
fe2c9909
WJ
152if HAVE_LINUXPAM
153su_LDADD += -lpam_misc
ff4c5555 154endif
b923bdbe
KZ
155if HAVE_PTY
156su_SOURCES += lib/pty-session.c \
63869b84
KZ
157 include/pty-session.h \
158 lib/monotonic.c
159su_LDADD += -lutil $(REALTIME_LIBS)
eb7d0ad0 160endif
9e584ff3
TK
161if HAVE_ECONF
162su_LDADD += -leconf
163endif
fe2c9909 164endif # BUILD_SU
ff4c5555 165
ffeb2805 166
7ec6adb1 167if BUILD_RUNUSER
5b68dea9 168sbin_PROGRAMS += runuser
7ec6adb1
KZ
169dist_man_MANS += login-utils/runuser.1
170runuser_SOURCES = \
171 login-utils/runuser.c \
172 login-utils/su-common.c \
173 login-utils/su-common.h \
174 login-utils/logindefs.c \
175 login-utils/logindefs.h
23f75093 176runuser_LDADD = $(LDADD) libcommon.la -lpam
fe2c9909
WJ
177if HAVE_LINUXPAM
178runuser_LDADD += -lpam_misc
7ec6adb1 179endif
b923bdbe
KZ
180if HAVE_PTY
181runuser_SOURCES += lib/pty-session.c \
63869b84
KZ
182 include/pty-session.h \
183 lib/monotonic.c
184runuser_LDADD += -lutil $(REALTIME_LIBS)
204aa771 185endif
9e584ff3
TK
186if HAVE_ECONF
187runuser_LDADD += -leconf
188endif
fe2c9909 189endif # BUILD_RUNUSER
7ec6adb1
KZ
190
191
aec9ecbd
KZ
192if BUILD_NEWGRP
193usrbin_exec_PROGRAMS += newgrp
ffeb2805
KZ
194dist_man_MANS += login-utils/newgrp.1
195newgrp_SOURCES = login-utils/newgrp.c
aec9ecbd
KZ
196newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
197newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
dcdb349b 198newgrp_LDADD = $(LDADD)
aec9ecbd
KZ
199if HAVE_LIBCRYPT
200newgrp_LDADD += -lcrypt
201endif
202endif # BUILD_NEWGRP
203
29cc2a55
OO
204if BUILD_LSLOGINS
205usrbin_exec_PROGRAMS += lslogins
206dist_man_MANS += login-utils/lslogins.1
207lslogins_SOURCES = \
208 login-utils/lslogins.c \
209 login-utils/logindefs.c \
210 login-utils/logindefs.h
211lslogins_LDADD = $(LDADD) libcommon.la libsmartcols.la
212lslogins_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir)
213if HAVE_SELINUX
214lslogins_LDADD += -lselinux
215endif
f37b357b
KZ
216if HAVE_SYSTEMD
217lslogins_LDADD += $(SYSTEMD_LIBS) $(SYSTEMD_JOURNAL_LIBS)
218lslogins_CFLAGS += $(SYSTEMD_CFLAGS) $(SYSTEMD_JOURNAL_CFLAGS)
219endif
9e584ff3
TK
220if HAVE_ECONF
221lslogins_LDADD += -leconf
222endif
29cc2a55 223endif # BUILD_LSLOGINS
ff4c5555 224
cc76731e
KZ
225if BUILD_VIPW
226usrsbin_exec_PROGRAMS += vipw
ffeb2805
KZ
227dist_man_MANS += \
228 login-utils/vigr.8 \
229 login-utils/vipw.8
f06b4328 230vipw_SOURCES = \
ffeb2805 231 login-utils/vipw.c \
d77ab74a 232 login-utils/setpwnam.h
dcdb349b 233vipw_LDADD = $(LDADD) libcommon.la
48d7b13a 234if HAVE_SELINUX
48d7b13a
KZ
235vipw_LDADD += -lselinux
236endif
ffeb2805
KZ
237install-exec-hook-vipw::
238 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
239
240INSTALL_EXEC_HOOKS += install-exec-hook-vipw
cc76731e 241endif # BUILD_VIPW
48d7b13a 242
48d7b13a 243
922e6775 244check_PROGRAMS += \
ffeb2805
KZ
245 test_islocal \
246 test_logindefs
247
248test_islocal_SOURCES = login-utils/islocal.c
c293a7e8 249test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
c82d9c97 250
ffeb2805
KZ
251test_logindefs_SOURCES = \
252 login-utils/logindefs.c \
253 login-utils/logindefs.h
c82d9c97 254test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
9e584ff3
TK
255if HAVE_ECONF
256test_logindefs_LDADD = -leconf
257endif
d07dc5e4
KZ
258
259
260install-exec-hook:
261if BUILD_SU
a65041b5 262if MAKEINSTALL_DO_CHOWN
8c197994 263 chown root:root $(DESTDIR)$(bindir)/su
a65041b5
KZ
264endif
265if MAKEINSTALL_DO_SETUID
d07dc5e4
KZ
266 chmod 4755 $(DESTDIR)$(bindir)/su
267endif
268endif
269if BUILD_VIPW
270 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
271endif