]> git.ipfire.org Git - thirdparty/util-linux.git/blame - login-utils/Makemodule.am
su: add --pty option
[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
56endif # BUILD_LOGIN
57
58
88407b93
KZ
59if BUILD_NOLOGIN
60sbin_PROGRAMS += nologin
61dist_man_MANS += login-utils/nologin.8
62nologin_SOURCES = login-utils/nologin.c
63endif
64
65
78d5ceac
KZ
66if BUILD_UTMPDUMP
67usrbin_exec_PROGRAMS += utmpdump
68dist_man_MANS += login-utils/utmpdump.1
69utmpdump_SOURCES = login-utils/utmpdump.c
1173d0a6 70utmpdump_LDADD = $(LDADD) libcommon.la
78d5ceac
KZ
71endif
72
73
2c8a3e16
KZ
74if BUILD_CHFN_CHSH
75usrbin_exec_PROGRAMS += chfn chsh
ffeb2805
KZ
76dist_man_MANS += \
77 login-utils/chfn.1 \
78 login-utils/chsh.1
2c8a3e16 79
144ae70e
SK
80chfn_chsh_sources = \
81 login-utils/ch-common.h \
82 login-utils/ch-common.c
2c8a3e16
KZ
83chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
84chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
e41ae450 85chfn_chsh_ldadd = libcommon.la $(READLINE_LIBS)
d86918b6
KZ
86
87if CHFN_CHSH_PASSWORD
fe2c9909
WJ
88chfn_chsh_ldadd += -lpam
89if HAVE_LINUXPAM
90chfn_chsh_ldadd += -lpam_misc
91endif
d86918b6
KZ
92chfn_chsh_sources += \
93 login-utils/auth.c \
94 login-utils/auth.h
fe2c9909 95endif # CHFN_CHSH_PASSWORD
2c8a3e16 96
7e4714f2
CM
97if HAVE_USER
98chfn_chsh_ldflags += $(LIBUSER_LIBS)
99chfn_chsh_cflags += $(LIBUSER_CFLAGS)
6adb1ef2
CM
100chfn_chsh_sources+= \
101 login-utils/libuser.c \
102 login-utils/libuser.h
d86918b6
KZ
103else
104chfn_chsh_sources += \
105 login-utils/islocal.c \
106 login-utils/islocal.h \
107 login-utils/setpwnam.c \
108 login-utils/setpwnam.h
7e4714f2
CM
109endif
110
2c8a3e16 111if HAVE_SELINUX
ffeb2805
KZ
112chfn_chsh_sources += \
113 login-utils/selinux_utils.c \
114 login-utils/selinux_utils.h
2c8a3e16
KZ
115chfn_chsh_ldadd += -lselinux
116endif
117
e88f0059
SK
118chfn_SOURCES = \
119 login-utils/chfn.c \
120 login-utils/logindefs.c \
121 login-utils/logindefs.h \
122 $(chfn_chsh_sources)
2c8a3e16
KZ
123chfn_CFLAGS = $(chfn_chsh_cflags)
124chfn_LDFLAGS = $(chfn_chsh_ldflags)
dcdb349b 125chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
2c8a3e16 126
ffeb2805 127chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
2c8a3e16
KZ
128chsh_CFLAGS = $(chfn_chsh_cflags)
129chsh_LDFLAGS = $(chfn_chsh_ldflags)
dcdb349b 130chsh_LDADD = $(LDADD) $(chfn_chsh_ldadd)
2c8a3e16
KZ
131endif # BUILD_CHFN_CHSH
132
133
ff4c5555 134if BUILD_SU
e7614a07 135bin_PROGRAMS += su
6edbca18 136dist_man_MANS += login-utils/su.1
ff4c5555 137su_SOURCES = \
ffeb2805 138 login-utils/su.c \
cf1a99da
KZ
139 login-utils/su-common.c \
140 login-utils/su-common.h \
ffeb2805
KZ
141 login-utils/logindefs.c \
142 login-utils/logindefs.h
23f75093 143su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
ff4c5555 144su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
23f75093 145su_LDADD = $(LDADD) libcommon.la -lpam
fe2c9909
WJ
146if HAVE_LINUXPAM
147su_LDADD += -lpam_misc
ff4c5555 148endif
fe2c9909 149endif # BUILD_SU
ff4c5555 150
ffeb2805 151
7ec6adb1 152if BUILD_RUNUSER
5b68dea9 153sbin_PROGRAMS += runuser
7ec6adb1
KZ
154dist_man_MANS += login-utils/runuser.1
155runuser_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
23f75093 161runuser_LDADD = $(LDADD) libcommon.la -lpam
fe2c9909
WJ
162if HAVE_LINUXPAM
163runuser_LDADD += -lpam_misc
7ec6adb1 164endif
fe2c9909 165endif # BUILD_RUNUSER
7ec6adb1
KZ
166
167
aec9ecbd
KZ
168if BUILD_NEWGRP
169usrbin_exec_PROGRAMS += newgrp
ffeb2805
KZ
170dist_man_MANS += login-utils/newgrp.1
171newgrp_SOURCES = login-utils/newgrp.c
aec9ecbd
KZ
172newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
173newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
dcdb349b 174newgrp_LDADD = $(LDADD)
aec9ecbd
KZ
175if HAVE_LIBCRYPT
176newgrp_LDADD += -lcrypt
177endif
178endif # BUILD_NEWGRP
179
29cc2a55
OO
180if BUILD_LSLOGINS
181usrbin_exec_PROGRAMS += lslogins
182dist_man_MANS += login-utils/lslogins.1
183lslogins_SOURCES = \
184 login-utils/lslogins.c \
185 login-utils/logindefs.c \
186 login-utils/logindefs.h
187lslogins_LDADD = $(LDADD) libcommon.la libsmartcols.la
188lslogins_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir)
189if HAVE_SELINUX
190lslogins_LDADD += -lselinux
191endif
f37b357b
KZ
192if HAVE_SYSTEMD
193lslogins_LDADD += $(SYSTEMD_LIBS) $(SYSTEMD_JOURNAL_LIBS)
194lslogins_CFLAGS += $(SYSTEMD_CFLAGS) $(SYSTEMD_JOURNAL_CFLAGS)
195endif
29cc2a55 196endif # BUILD_LSLOGINS
ff4c5555 197
cc76731e
KZ
198if BUILD_VIPW
199usrsbin_exec_PROGRAMS += vipw
ffeb2805
KZ
200dist_man_MANS += \
201 login-utils/vigr.8 \
202 login-utils/vipw.8
f06b4328 203vipw_SOURCES = \
ffeb2805 204 login-utils/vipw.c \
d77ab74a 205 login-utils/setpwnam.h
dcdb349b 206vipw_LDADD = $(LDADD) libcommon.la
48d7b13a 207if HAVE_SELINUX
48d7b13a
KZ
208vipw_LDADD += -lselinux
209endif
ffeb2805
KZ
210install-exec-hook-vipw::
211 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
212
213INSTALL_EXEC_HOOKS += install-exec-hook-vipw
cc76731e 214endif # BUILD_VIPW
48d7b13a 215
48d7b13a 216
922e6775 217check_PROGRAMS += \
ffeb2805
KZ
218 test_islocal \
219 test_logindefs
220
221test_islocal_SOURCES = login-utils/islocal.c
c293a7e8 222test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
c82d9c97 223
ffeb2805
KZ
224test_logindefs_SOURCES = \
225 login-utils/logindefs.c \
226 login-utils/logindefs.h
c82d9c97 227test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
d07dc5e4
KZ
228
229
230install-exec-hook:
231if BUILD_SU
a65041b5 232if MAKEINSTALL_DO_CHOWN
8c197994 233 chown root:root $(DESTDIR)$(bindir)/su
a65041b5
KZ
234endif
235if MAKEINSTALL_DO_SETUID
d07dc5e4
KZ
236 chmod 4755 $(DESTDIR)$(bindir)/su
237endif
238endif
239if BUILD_VIPW
240 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
241endif