blob: c135ca9c36762aba86c83993dc094457619d7f8b [file] [log] [blame]
xf.libdd93d52023-05-12 07:10:14 -07001# Copyright (C) 1996-2016 Free Software Foundation, Inc.
2# This file is part of the GNU C Library.
3
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.
8
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.
13
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# <http://www.gnu.org/licenses/>.
17
18# Generate the list of strings for errno codes from the section of the
19# manual which documents the codes.
20
21$(..)sysdeps/gnu/errlist.c: $(..)sysdeps/gnu/errlist.awk \
22 $(..)manual/errno.texi
23 $(AWK) -f $^ > $@-tmp
24# Make it unwritable so noone will edit it by mistake.
25 -chmod a-w $@-tmp
26 mv -f $@-tmp $@
27
28ifeq ($(subdir),stdio-common)
29
30errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
31
32libof-errlist-compat = extramodules
33
34ifeq ($(build-shared),yes)
35$(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
36 $(common-objpfx)Versions.v.i $(before-compile)
37else
38$(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
39 $(before-compile)
40endif
41 $(make-target-directory)
42 $(AWK) -v maxerr=`\
43 $(CC) -S $(CPPFLAGS) $(CFLAGS) -DEMIT_ERR_MAX $< -o - \
44 | sed -n 's/^.*@@@[^0-9]*\([0-9]*\)[^0-9]*@@@.*$$/\1/p'` \
45 -f $(..)sysdeps/gnu/errlist-compat.awk \
46 $(wildcard $(sysdirs:=/Versions)) > $@T
47# Make it unwritable so noone will edit it by mistake.
48 -chmod a-w $@T
49 mv -f $@T $@
50$(objpfx)errlist-compat.h: $(objpfx)errlist-compat.c
51 sed -n '1p;/ERR_MAX/p' $< > $@T
52 -chmod a-w $@T
53 mv -f $@T $@
54generated += errlist-compat.c errlist-compat.h
55
56# This will force the generation above to happy if need be.
57$(foreach o,$(object-suffixes) $(object-suffixes:=.d),\
58 $(objpfx)errlist$o): $(objpfx)errlist-compat.h
59endif
60
61ifeq ($(subdir),login)
62sysdep_routines += setutxent getutxent endutxent getutxid getutxline \
63 pututxline utmpxname updwtmpx getutmpx getutmp
64
65sysdep_headers += utmpx.h bits/utmpx.h
66endif
67
68
69ifeq ($(subdir),inet)
70sysdep_headers += netinet/udp.h netinet/ip_icmp.h
71endif
72
73
74ifeq ($(subdir),misc)
75sysdep_headers += sys/mtio.h
76endif
77
78
79ifeq ($(subdir),csu)
80routines += unwind-resume
81shared-only-routines += unwind-resume
82CFLAGS-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
83endif
84
85ifeq ($(subdir),rt)
86librt-sysdep_routines += rt-unwind-resume
87librt-shared-only-routines += rt-unwind-resume
88CFLAGS-rt-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
89endif