summaryrefslogtreecommitdiffstats
path: root/login-utils/Makefile.am
blob: d02a282c42a3dbe8ae046857e80d7f89edd30ce8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
include $(top_srcdir)/config/include-Makefile.am

bin_PROGRAMS =
usrbin_exec_PROGRAMS =
sbin_PROGRAMS =
usrsbin_exec_PROGRAMS =
dist_man_MANS =

if BUILD_LAST
usrbin_exec_PROGRAMS += last
dist_man_MANS += last.1
endif

if BUILD_SULOGIN
sbin_PROGRAMS += sulogin
dist_man_MANS += sulogin.8
sulogin_SOURCES = sulogin.c $(top_srcdir)/lib/strutils.c
sulogin_LDADD =
if HAVE_LIBCRYPT
sulogin_LDADD += -lcrypt
endif
if HAVE_SELINUX
sulogin_LDADD += -lselinux
endif
endif # BUILD_SULOGIN


if BUILD_LOGIN
bin_PROGRAMS += login
dist_man_MANS += login.1
login_SOURCES = \
	login.c \
	logindefs.c \
	logindefs.h \
	$(top_srcdir)/lib/fileutils.c \
	$(top_srcdir)/lib/setproctitle.c
login_LDADD = -lpam -lpam_misc
if HAVE_AUDIT
login_LDADD += -laudit
endif
if HAVE_SELINUX
login_LDADD += -lselinux
endif
endif # BUILD_LOGIN


if BUILD_CHFN_CHSH
usrbin_exec_PROGRAMS += chfn chsh
dist_man_MANS += chfn.1 chsh.1

chfn_chsh_sources = \
	islocal.c \
	islocal.h \
	setpwnam.c \
	setpwnam.h \
	$(top_srcdir)/lib/env.c \
	$(top_srcdir)/lib/fileutils.c

chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
chfn_chsh_ldadd = -lpam -lpam_misc

if HAVE_SELINUX
chfn_chsh_sources += selinux_utils.c selinux_utils.h
chfn_chsh_ldadd += -lselinux
endif

chfn_SOURCES = chfn.c $(chfn_chsh_sources)
chfn_CFLAGS = $(chfn_chsh_cflags)
chfn_LDFLAGS = $(chfn_chsh_ldflags)
chfn_LDADD = $(chfn_chsh_ldadd)

chsh_SOURCES = chfn.c $(chfn_chsh_sources)
chsh_CFLAGS = $(chfn_chsh_cflags)
chsh_LDFLAGS = $(chfn_chsh_ldflags)
chsh_LDADD = $(chfn_chsh_ldadd)
endif # BUILD_CHFN_CHSH


if BUILD_SU
bin_PROGRAMS += su
su_SOURCES = \
	su.c \
	logindefs.c \
	logindefs.h
su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
su_LDADD = -lpam -lpam_misc
endif


if BUILD_LOGIN_UTILS
usrbin_exec_PROGRAMS += \
	newgrp
usrsbin_exec_PROGRAMS += \
	vipw
dist_man_MANS += \
	newgrp.1 \
	vigr.8 \
	vipw.8

vipw_SOURCES = \
	vipw.c \
	setpwnam.h \
	$(top_srcdir)/lib/fileutils.c

newgrp_LDADD =
vipw_LDADD =

newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)

if HAVE_LIBCRYPT
newgrp_LDADD += -lcrypt
endif

if HAVE_SELINUX
vipw_LDADD += -lselinux
endif


install-exec-hook::
	cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr

endif

noinst_PROGRAMS = test_islocal test_logindefs
test_islocal_SOURCES = islocal.c
test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)

test_logindefs_SOURCES = logindefs.c logindefs.h
test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)