]> git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/Makemodule.am
Merge branch 'master' of https://github.com/dankamongmen/util-linux
[thirdparty/util-linux.git] / login-utils / Makemodule.am
1
2 if BUILD_LAST
3 usrbin_exec_PROGRAMS += last
4 dist_man_MANS += login-utils/last.1
5 last_SOURCES = login-utils/last.c
6 endif
7
8 if BUILD_SULOGIN
9 sbin_PROGRAMS += sulogin
10 dist_man_MANS += login-utils/sulogin.8
11 sulogin_SOURCES = \
12 login-utils/sulogin.c
13 sulogin_LDADD = $(LDADD) libcommon.la
14 if HAVE_LIBCRYPT
15 sulogin_LDADD += -lcrypt
16 endif
17 if HAVE_SELINUX
18 sulogin_LDADD += -lselinux
19 endif
20 endif # BUILD_SULOGIN
21
22
23 if BUILD_LOGIN
24 bin_PROGRAMS += login
25 dist_man_MANS += login-utils/login.1
26 login_SOURCES = \
27 login-utils/login.c \
28 login-utils/logindefs.c \
29 login-utils/logindefs.h
30 login_LDADD = $(LDADD) libcommon.la -lpam -lpam_misc
31 if HAVE_AUDIT
32 login_LDADD += -laudit
33 endif
34 if HAVE_SELINUX
35 login_LDADD += -lselinux
36 endif
37 endif # BUILD_LOGIN
38
39
40 if BUILD_UTMPDUMP
41 usrbin_exec_PROGRAMS += utmpdump
42 dist_man_MANS += login-utils/utmpdump.1
43 utmpdump_SOURCES = login-utils/utmpdump.c
44 endif
45
46
47 if BUILD_CHFN_CHSH
48 usrbin_exec_PROGRAMS += chfn chsh
49 dist_man_MANS += \
50 login-utils/chfn.1 \
51 login-utils/chsh.1
52
53 chfn_chsh_sources = \
54 login-utils/islocal.c \
55 login-utils/islocal.h \
56 login-utils/setpwnam.c \
57 login-utils/setpwnam.h
58 chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
59 chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
60 chfn_chsh_ldadd = libcommon.la -lpam -lpam_misc
61
62 if HAVE_SELINUX
63 chfn_chsh_sources += \
64 login-utils/selinux_utils.c \
65 login-utils/selinux_utils.h
66 chfn_chsh_ldadd += -lselinux
67 endif
68
69 chfn_SOURCES = login-utils/chfn.c $(chfn_chsh_sources)
70 chfn_CFLAGS = $(chfn_chsh_cflags)
71 chfn_LDFLAGS = $(chfn_chsh_ldflags)
72 chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
73
74 chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
75 chsh_CFLAGS = $(chfn_chsh_cflags)
76 chsh_LDFLAGS = $(chfn_chsh_ldflags)
77 chsh_LDADD = $(LDADD) $(chfn_chsh_ldadd)
78 endif # BUILD_CHFN_CHSH
79
80
81 if BUILD_SU
82 bin_PROGRAMS += su
83 su_SOURCES = \
84 login-utils/su.c \
85 login-utils/logindefs.c \
86 login-utils/logindefs.h
87 su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
88 su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
89 su_LDADD = $(LDADD) -lpam -lpam_misc
90 endif
91
92
93 if BUILD_NEWGRP
94 usrbin_exec_PROGRAMS += newgrp
95 dist_man_MANS += login-utils/newgrp.1
96 newgrp_SOURCES = login-utils/newgrp.c
97 newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
98 newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
99 newgrp_LDADD = $(LDADD)
100 if HAVE_LIBCRYPT
101 newgrp_LDADD += -lcrypt
102 endif
103 endif # BUILD_NEWGRP
104
105
106 if BUILD_VIPW
107 usrsbin_exec_PROGRAMS += vipw
108 dist_man_MANS += \
109 login-utils/vigr.8 \
110 login-utils/vipw.8
111 vipw_SOURCES = \
112 login-utils/vipw.c \
113 login-utils/setpwnam.h
114 vipw_LDADD = $(LDADD) libcommon.la
115 if HAVE_SELINUX
116 vipw_LDADD += -lselinux
117 endif
118 install-exec-hook-vipw::
119 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
120
121 INSTALL_EXEC_HOOKS += install-exec-hook-vipw
122 endif # BUILD_VIPW
123
124
125 noinst_PROGRAMS += \
126 test_islocal \
127 test_logindefs
128
129 test_islocal_SOURCES = login-utils/islocal.c
130 test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
131
132 test_logindefs_SOURCES = \
133 login-utils/logindefs.c \
134 login-utils/logindefs.h
135 test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
136
137
138 install-exec-hook:
139 if BUILD_SU
140 if MAKEINSTALL_DO_SETUID
141 chmod 4755 $(DESTDIR)$(bindir)/su
142 endif
143 endif
144 if BUILD_VIPW
145 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
146 endif