]> git.ipfire.org Git - thirdparty/util-linux.git/blame - login-utils/Makefile.am
build-sys: rename to _execdir
[thirdparty/util-linux.git] / login-utils / Makefile.am
CommitLineData
48d7b13a
KZ
1include $(top_srcdir)/config/include-Makefile.am
2
3bin_PROGRAMS =
30688dde 4usrbin_exec_PROGRAMS =
48d7b13a 5sbin_PROGRAMS =
30688dde 6usrsbin_exec_PROGRAMS =
a3ca3a44 7dist_man_MANS =
48d7b13a 8
562218e6
KZ
9EXTRA_DIST = README.getty README.modems-with-agetty README.poeigl
10
48d7b13a
KZ
11if BUILD_AGETTY
12sbin_PROGRAMS += agetty
a3ca3a44 13dist_man_MANS += agetty.8
48d7b13a
KZ
14endif
15
16if BUILD_INIT
17
18sbin_PROGRAMS += simpleinit shutdown initctl
a3ca3a44 19dist_man_MANS += fastboot.8 fasthalt.8 halt.8 reboot.8 simpleinit.8 shutdown.8 \
48d7b13a
KZ
20 initctl.8
21
562218e6
KZ
22simpleinit_SOURCES = simpleinit.c my_crypt.h simpleinit.h
23initctl_SOURCES = initctl.c simpleinit.h
48d7b13a
KZ
24
25if NEED_LIBCRYPT
26simpleinit_LDADD = -lcrypt
27endif
28
f3831bbd 29endif
48d7b13a
KZ
30
31if BUILD_LAST
30688dde 32usrbin_exec_PROGRAMS += last
a3ca3a44 33dist_man_MANS += last.1
48d7b13a
KZ
34endif
35
36if BUILD_LOGIN_UTILS
37
38bin_PROGRAMS += login
30688dde
KZ
39usrbin_exec_PROGRAMS += chfn chsh newgrp
40usrsbin_exec_PROGRAMS += vipw
a3ca3a44 41dist_man_MANS += chfn.1 chsh.1 login.1 newgrp.1 vipw.8 vigr.8
48d7b13a 42
2984313a
SK
43chfn_SOURCES = chfn.c $(chfn_chsh_common)
44chsh_SOURCES = chsh.c $(chfn_chsh_common)
45chfn_chsh_common = islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h \
46 ../lib/env.c
47login_SOURCES = login.c login.h my_crypt.h ../lib/setproctitle.c
562218e6
KZ
48newgrp_SOURCES = newgrp.c my_crypt.h
49vipw_SOURCES = vipw.c setpwnam.h
48d7b13a 50
2984313a
SK
51chfn_LDADD =
52chsh_LDADD =
53login_LDADD =
48d7b13a
KZ
54newgrp_LDADD =
55vipw_LDADD =
56
8c453685
SK
57chfn_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
58chsh_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
59newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
06bcee19 60
3f3c9c90
SK
61chfn_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
62chsh_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
63newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
64
48d7b13a 65if NEED_LIBCRYPT
48d7b13a
KZ
66chfn_LDADD += -lcrypt
67chsh_LDADD += -lcrypt
68login_LDADD += -lcrypt
69newgrp_LDADD += -lcrypt
70endif
71
72if HAVE_PAM
73chfn_LDADD += -lpam -lpam_misc
74chsh_LDADD += -lpam -lpam_misc
75login_LDADD += -lpam -lpam_misc
48d7b13a 76else
2984313a 77login_SOURCES += checktty.c
48d7b13a
KZ
78endif
79
f8bdba2f
KZ
80if HAVE_AUDIT
81login_LDADD += -laudit
82endif
48d7b13a
KZ
83
84if HAVE_SELINUX
562218e6 85chfn_SOURCES += selinux_utils.c selinux_utils.h
48d7b13a 86chfn_LDADD += -lselinux
562218e6 87chsh_SOURCES += selinux_utils.c selinux_utils.h
48d7b13a
KZ
88chsh_LDADD += -lselinux
89vipw_LDADD += -lselinux
90endif
91
92
baf39af1 93install-exec-hook::
30688dde 94 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
48d7b13a
KZ
95
96endif
97
98if BUILD_MESG
30688dde 99usrbin_exec_PROGRAMS += mesg
a3ca3a44 100dist_man_MANS += mesg.1
48d7b13a
KZ
101endif
102
103if BUILD_WALL
30688dde 104usrbin_exec_PROGRAMS += wall
562218e6 105wall_SOURCES = wall.c ttymsg.c ttymsg.h
a3ca3a44 106dist_man_MANS += wall.1
48d7b13a
KZ
107
108if USE_TTY_GROUP
f3831bbd 109if MAKEINSTALL_DO_CHOWN
baf39af1 110install-exec-hook::
30688dde
KZ
111 chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
112 chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
48d7b13a 113endif
f3831bbd 114endif
48d7b13a
KZ
115endif
116
baf39af1
KZ
117if BUILD_INIT
118
48d7b13a
KZ
119install-exec-hook::
120 cd $(DESTDIR)$(sbindir) && ln -sf shutdown reboot
121 cd $(DESTDIR)$(sbindir) && ln -sf shutdown fastboot
122 cd $(DESTDIR)$(sbindir) && ln -sf shutdown halt
123 cd $(DESTDIR)$(sbindir) && ln -sf shutdown fasthalt
124 cd $(DESTDIR)$(sbindir) && ln -sf initctl need
125 cd $(DESTDIR)$(sbindir) && ln -sf initctl display-services
126 cd $(DESTDIR)$(sbindir) && ln -sf initctl provide
6ed7a96d
KZ
127
128install-data-hook:
48d7b13a
KZ
129 cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 need.8
130 cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 display-services.8
131 cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 provide.8
132
baf39af1 133endif
71562c1f 134
8e025972 135noinst_PROGRAMS = checktty_test islocal_test
71562c1f 136checktty_test_SOURCES = checktty.c login.h
1f317686 137checktty_test_CPPFLAGS = -DMAIN_TEST_CHECKTTY $(AM_CPPFLAGS)
8e025972
JY
138islocal_test_SOURCES = islocal.c
139islocal_test_CPPFLAGS = -DMAIN_TEST_ISLOCAL $(AM_CPPFLAGS)
71562c1f 140