| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
subdir := login |
| 23 |
|
| 24 |
include ../Makeconfig |
| 25 |
|
| 26 |
headers := \ |
| 27 |
bits/utmp.h \ |
| 28 |
lastlog.h \ |
| 29 |
pty.h \ |
| 30 |
utmp.h \ |
| 31 |
# headers |
| 32 |
|
| 33 |
routines := \ |
| 34 |
forkpty \ |
| 35 |
getlogin \ |
| 36 |
getlogin_r \ |
| 37 |
getlogin_r_chk \ |
| 38 |
getpt \ |
| 39 |
getutent \ |
| 40 |
getutent_r \ |
| 41 |
getutid \ |
| 42 |
getutid_r \ |
| 43 |
getutline \ |
| 44 |
getutline_r \ |
| 45 |
grantpt \ |
| 46 |
login \ |
| 47 |
login_tty \ |
| 48 |
logout \ |
| 49 |
logwtmp \ |
| 50 |
openpty \ |
| 51 |
ptsname \ |
| 52 |
ptsname_r_chk \ |
| 53 |
setlogin \ |
| 54 |
unlockpt \ |
| 55 |
updwtmp \ |
| 56 |
utmp_file \ |
| 57 |
utmpname \ |
| 58 |
# routines |
| 59 |
|
| 60 |
CFLAGS-grantpt.c += -DLIBEXECDIR='"$(libexecdir)"' |
| 61 |
|
| 62 |
others = utmpdump |
| 63 |
|
| 64 |
ifeq (yes,$(build-pt-chown)) |
| 65 |
others += \ |
| 66 |
pt_chown \ |
| 67 |
# others |
| 68 |
others-pie = \ |
| 69 |
pt_chown \ |
| 70 |
# others-pie |
| 71 |
install-others-programs = $(inst_libexecdir)/pt_chown |
| 72 |
endif |
| 73 |
|
| 74 |
subdir-dirs = programs |
| 75 |
vpath %.c programs |
| 76 |
|
| 77 |
tests := \ |
| 78 |
tst-getlogin \ |
| 79 |
tst-grantpt \ |
| 80 |
tst-ptsname \ |
| 81 |
tst-pututxline-cache \ |
| 82 |
tst-pututxline-lockfail \ |
| 83 |
tst-updwtmpx \ |
| 84 |
tst-utmp \ |
| 85 |
tst-utmp-size \ |
| 86 |
tst-utmp-size-64 \ |
| 87 |
tst-utmp-unsigned \ |
| 88 |
tst-utmp-unsigned-64 \ |
| 89 |
tst-utmpx \ |
| 90 |
# tests |
| 91 |
|
| 92 |
CFLAGS-tst-utmp-size-64.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 |
| 93 |
CFLAGS-tst-utmp-unsigned-64.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 |
| 94 |
|
| 95 |
|
| 96 |
extra-libs := libutil |
| 97 |
extra-libs-others := $(extra-libs) |
| 98 |
ifeq ($(have-GLIBC_2.33),yes) |
| 99 |
libutil-routines := libutil-compat |
| 100 |
libutil-shared-only-routines := libutil-compat |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
install-lib-ldscripts = libutil.so |
| 105 |
$(inst_libdir)/libutil.so: |
| 106 |
else |
| 107 |
libutil-inhibit-o = $(filter-out .o,$(object-suffixes)) |
| 108 |
endif |
| 109 |
|
| 110 |
include ../Rules |
| 111 |
|
| 112 |
CFLAGS-getpt.c += -fexceptions |
| 113 |
|
| 114 |
|
| 115 |
routines_no_fortify += \ |
| 116 |
getlogin_r \ |
| 117 |
ptsname_r \ |
| 118 |
# routines_no_fortify |
| 119 |
|
| 120 |
ifeq (yesyes,$(have-fpie)$(build-shared)) |
| 121 |
pt_chown-cflags += $(pie-ccflag) |
| 122 |
endif |
| 123 |
ifeq (yes,$(have-libcap)) |
| 124 |
libcap = -lcap |
| 125 |
endif |
| 126 |
CFLAGS-pt_chown.c += $(pt_chown-cflags) |
| 127 |
LDLIBS-pt_chown = $(libcap) |
| 128 |
ifeq (yesyes,$(have-fpie)$(build-shared)) |
| 129 |
LDFLAGS-pt_chown = -Wl,-z,now |
| 130 |
endif |
| 131 |
|
| 132 |
|
| 133 |
$(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force) |
| 134 |
$(make-target-directory) |
| 135 |
-$(INSTALL_PROGRAM) -m 4755 -o root $< $@ |
| 136 |
|
| 137 |
$(objpfx)tst-pututxline-lockfail: $(shared-thread-library) |
| 138 |
$(objpfx)tst-pututxline-cache: $(shared-thread-library) |