1 # Copyright (C) 1996-2025 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
19 # Sub-makefile for login portion of the library.
60 CFLAGS-grantpt.c
+= -DLIBEXECDIR
='"$(libexecdir)"'
64 ifeq (yes
,$(build-pt-chown
))
71 install-others-programs
= $(inst_libexecdir
)/pt_chown
74 subdir-dirs
= programs
81 tst-pututxline-cache \
82 tst-pututxline-lockfail \
88 tst-utmp-unsigned-64 \
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
95 # Empty compatibility library for old binaries.
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
102 # Pretend that libutil.so is a linker script, so that the symbolic
103 # link is not installed.
104 install-lib-ldscripts
= libutil.so
105 $(inst_libdir
)/libutil.so
:
106 else # not $(have-GLIBC_2.33)
107 libutil-inhibit-o
= $(filter-out .o
,$(object-suffixes
))
108 endif # $(have-GLIBC_2.33)
112 CFLAGS-getpt.c
+= -fexceptions
113 CFLAGS-getlogin_r.c
+= $(config-cflags-wno-ignored-attributes
)
115 # Exclude fortified routines from being built with _FORTIFY_SOURCE
116 routines_no_fortify
+= \
119 # routines_no_fortify
121 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
122 pt_chown-cflags
+= $(pie-ccflag
)
124 ifeq (yes
,$(have-libcap
))
127 CFLAGS-pt_chown.c
+= $(pt_chown-cflags
)
128 LDLIBS-pt_chown
= $(libcap
)
129 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
130 LDFLAGS-pt_chown
= -Wl
,-z
,now
133 # pt_chown needs to be setuid root.
134 $(inst_libexecdir
)/pt_chown
: $(objpfx
)pt_chown
$(+force)
135 $(make-target-directory
)
136 -$(INSTALL_PROGRAM
) -m
4755 -o root
$< $@
138 $(objpfx
)tst-pututxline-lockfail
: $(shared-thread-library
)
139 $(objpfx
)tst-pututxline-cache
: $(shared-thread-library
)