]> git.ipfire.org Git - thirdparty/util-linux.git/blame - login-utils/Makemodule.am
build-sys: use CLOCKGETTIME_LIBS
[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
08ca3e26 7last_SOURCES = login-utils/last.c lib/boottime.c
8fc4a886 8last_LDADD = $(LDADD) libcommon.la $(CLOCKGETTIME_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
ce602720 16if BUILD_DEPRECATED_LAST
ce602720
OO
17usrbin_exec_PROGRAMS += last
18dist_man_MANS += login-utils/last-deprecated.1
19last_SOURCES = login-utils/last-deprecated.c
ce602720 20endif # BUILD_DEPRECATED_LAST
a73f59fa 21
ec01e9d0 22
de217489
KZ
23if BUILD_SULOGIN
24sbin_PROGRAMS += sulogin
ffeb2805
KZ
25dist_man_MANS += login-utils/sulogin.8
26sulogin_SOURCES = \
a73f59fa
KZ
27 login-utils/sulogin.c \
28 login-utils/sulogin-consoles.c \
29 login-utils/sulogin-consoles.h
dcdb349b 30sulogin_LDADD = $(LDADD) libcommon.la
a73f59fa 31
de217489
KZ
32if HAVE_LIBCRYPT
33sulogin_LDADD += -lcrypt
34endif
35if HAVE_SELINUX
36sulogin_LDADD += -lselinux
37endif
a73f59fa
KZ
38
39check_PROGRAMS += test_consoles
40test_consoles_SOURCES = login-utils/sulogin-consoles.c
41test_consoles_CFLAGS = -DTEST_PROGRAM
42test_consoles_LDADD = libcommon.la
de217489
KZ
43endif # BUILD_SULOGIN
44
48d7b13a 45
e7614a07
KZ
46if BUILD_LOGIN
47bin_PROGRAMS += login
ffeb2805 48dist_man_MANS += login-utils/login.1
e7614a07 49login_SOURCES = \
ffeb2805
KZ
50 login-utils/login.c \
51 login-utils/logindefs.c \
d77ab74a 52 login-utils/logindefs.h
dcdb349b 53login_LDADD = $(LDADD) libcommon.la -lpam -lpam_misc
e7614a07
KZ
54if HAVE_AUDIT
55login_LDADD += -laudit
56endif
57if HAVE_SELINUX
58login_LDADD += -lselinux
59endif
60endif # BUILD_LOGIN
61
62
88407b93
KZ
63if BUILD_NOLOGIN
64sbin_PROGRAMS += nologin
65dist_man_MANS += login-utils/nologin.8
66nologin_SOURCES = login-utils/nologin.c
67endif
68
69
78d5ceac
KZ
70if BUILD_UTMPDUMP
71usrbin_exec_PROGRAMS += utmpdump
72dist_man_MANS += login-utils/utmpdump.1
73utmpdump_SOURCES = login-utils/utmpdump.c
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
d86918b6 83chfn_chsh_sources =
2c8a3e16
KZ
84chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
85chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
d86918b6
KZ
86chfn_chsh_ldadd = libcommon.la
87
88if CHFN_CHSH_PASSWORD
89chfn_chsh_ldadd += -lpam -lpam_misc
90chfn_chsh_sources += \
91 login-utils/auth.c \
92 login-utils/auth.h
93endif
2c8a3e16 94
7e4714f2
CM
95if HAVE_USER
96chfn_chsh_ldflags += $(LIBUSER_LIBS)
97chfn_chsh_cflags += $(LIBUSER_CFLAGS)
6adb1ef2
CM
98chfn_chsh_sources+= \
99 login-utils/libuser.c \
100 login-utils/libuser.h
d86918b6
KZ
101else
102chfn_chsh_sources += \
103 login-utils/islocal.c \
104 login-utils/islocal.h \
105 login-utils/setpwnam.c \
106 login-utils/setpwnam.h
7e4714f2
CM
107endif
108
2c8a3e16 109if HAVE_SELINUX
ffeb2805
KZ
110chfn_chsh_sources += \
111 login-utils/selinux_utils.c \
112 login-utils/selinux_utils.h
2c8a3e16
KZ
113chfn_chsh_ldadd += -lselinux
114endif
115
ffeb2805 116chfn_SOURCES = login-utils/chfn.c $(chfn_chsh_sources)
2c8a3e16
KZ
117chfn_CFLAGS = $(chfn_chsh_cflags)
118chfn_LDFLAGS = $(chfn_chsh_ldflags)
dcdb349b 119chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
2c8a3e16 120
ffeb2805 121chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
2c8a3e16
KZ
122chsh_CFLAGS = $(chfn_chsh_cflags)
123chsh_LDFLAGS = $(chfn_chsh_ldflags)
dcdb349b 124chsh_LDADD = $(LDADD) $(chfn_chsh_ldadd)
2c8a3e16
KZ
125endif # BUILD_CHFN_CHSH
126
127
ff4c5555 128if BUILD_SU
e7614a07 129bin_PROGRAMS += su
6edbca18 130dist_man_MANS += login-utils/su.1
ff4c5555 131su_SOURCES = \
ffeb2805 132 login-utils/su.c \
cf1a99da
KZ
133 login-utils/su-common.c \
134 login-utils/su-common.h \
ffeb2805
KZ
135 login-utils/logindefs.c \
136 login-utils/logindefs.h
ff4c5555
KZ
137su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
138su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
bbc5a5ea 139su_LDADD = $(LDADD) libcommon.la -lpam -lpam_misc
ff4c5555
KZ
140endif
141
ffeb2805 142
7ec6adb1 143if BUILD_RUNUSER
5b68dea9 144sbin_PROGRAMS += runuser
7ec6adb1
KZ
145dist_man_MANS += login-utils/runuser.1
146runuser_SOURCES = \
147 login-utils/runuser.c \
148 login-utils/su-common.c \
149 login-utils/su-common.h \
150 login-utils/logindefs.c \
151 login-utils/logindefs.h
bbc5a5ea 152runuser_LDADD = $(LDADD) libcommon.la -lpam -lpam_misc
7ec6adb1
KZ
153endif
154
155
aec9ecbd
KZ
156if BUILD_NEWGRP
157usrbin_exec_PROGRAMS += newgrp
ffeb2805
KZ
158dist_man_MANS += login-utils/newgrp.1
159newgrp_SOURCES = login-utils/newgrp.c
aec9ecbd
KZ
160newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
161newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
dcdb349b 162newgrp_LDADD = $(LDADD)
aec9ecbd
KZ
163if HAVE_LIBCRYPT
164newgrp_LDADD += -lcrypt
165endif
166endif # BUILD_NEWGRP
167
29cc2a55
OO
168if BUILD_LSLOGINS
169usrbin_exec_PROGRAMS += lslogins
170dist_man_MANS += login-utils/lslogins.1
171lslogins_SOURCES = \
172 login-utils/lslogins.c \
173 login-utils/logindefs.c \
174 login-utils/logindefs.h
175lslogins_LDADD = $(LDADD) libcommon.la libsmartcols.la
176lslogins_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir)
177if HAVE_SELINUX
178lslogins_LDADD += -lselinux
179endif
f37b357b
KZ
180if HAVE_SYSTEMD
181lslogins_LDADD += $(SYSTEMD_LIBS) $(SYSTEMD_JOURNAL_LIBS)
182lslogins_CFLAGS += $(SYSTEMD_CFLAGS) $(SYSTEMD_JOURNAL_CFLAGS)
183endif
29cc2a55 184endif # BUILD_LSLOGINS
ff4c5555 185
cc76731e
KZ
186if BUILD_VIPW
187usrsbin_exec_PROGRAMS += vipw
ffeb2805
KZ
188dist_man_MANS += \
189 login-utils/vigr.8 \
190 login-utils/vipw.8
f06b4328 191vipw_SOURCES = \
ffeb2805 192 login-utils/vipw.c \
d77ab74a 193 login-utils/setpwnam.h
dcdb349b 194vipw_LDADD = $(LDADD) libcommon.la
48d7b13a 195if HAVE_SELINUX
48d7b13a
KZ
196vipw_LDADD += -lselinux
197endif
ffeb2805
KZ
198install-exec-hook-vipw::
199 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
200
201INSTALL_EXEC_HOOKS += install-exec-hook-vipw
cc76731e 202endif # BUILD_VIPW
48d7b13a 203
48d7b13a 204
922e6775 205check_PROGRAMS += \
ffeb2805
KZ
206 test_islocal \
207 test_logindefs
208
209test_islocal_SOURCES = login-utils/islocal.c
c293a7e8 210test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
c82d9c97 211
ffeb2805
KZ
212test_logindefs_SOURCES = \
213 login-utils/logindefs.c \
214 login-utils/logindefs.h
c82d9c97 215test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
d07dc5e4
KZ
216
217
218install-exec-hook:
219if BUILD_SU
220if MAKEINSTALL_DO_SETUID
221 chmod 4755 $(DESTDIR)$(bindir)/su
222endif
223endif
224if BUILD_VIPW
225 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
226endif