]> git.ipfire.org Git - thirdparty/glibc.git/blob - inet/Makefile
4d053de748e21e32774ede318115c1e99bb45ed6
[thirdparty/glibc.git] / inet / Makefile
1 # Copyright (C) 1991-2023 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 # <https://www.gnu.org/licenses/>.
17
18 #
19 # Sub-makefile for inet portion of the library.
20 #
21 subdir := inet
22
23 include ../Makeconfig
24
25 headers := \
26 $(wildcard arpa/*.h protocols/*.h) \
27 bits/in.h \
28 ifaddrs.h \
29 netinet/ether.h \
30 netinet/icmp6.h \
31 netinet/if_ether.h \
32 netinet/igmp.h \
33 netinet/in.h \
34 netinet/in_systm.h \
35 netinet/ip.h \
36 netinet/ip6.h \
37 netinet/tcp.h \
38 rpc/netdb.h \
39 # headers
40
41 routines := \
42 bindresvport \
43 deadline \
44 ether_aton \
45 ether_aton_r \
46 ether_line \
47 ether_ntoa \
48 ether_ntoa_r \
49 gethstbyad \
50 gethstbyad_r \
51 gethstbynm \
52 gethstbynm2 \
53 gethstbynm2_r \
54 gethstbynm_r \
55 gethstent \
56 gethstent_r \
57 getipv4sourcefilter \
58 getnameinfo \
59 getnetbyad \
60 getnetbyad_r \
61 getnetbynm \
62 getnetbynm_r \
63 getnetent \
64 getnetent_r \
65 getnetgrent \
66 getnetgrent_r \
67 getproto \
68 getproto_r \
69 getprtent \
70 getprtent_r \
71 getprtname \
72 getprtname_r \
73 getrpcbyname \
74 getrpcbyname_r \
75 getrpcbynumber \
76 getrpcbynumber_r \
77 getrpcent \
78 getrpcent_r \
79 getservent \
80 getservent_r \
81 getsourcefilter \
82 getsrvbynm \
83 getsrvbynm_r \
84 getsrvbypt \
85 getsrvbypt_r \
86 herrno \
87 herrno-loc \
88 htonl \
89 htons \
90 idna \
91 idna_name_classify \
92 if_index \
93 ifaddrs \
94 in6_addr \
95 inet6_opt \
96 inet6_option \
97 inet6_rth \
98 inet6_scopeid_pton \
99 inet_lnaof \
100 inet_mkadr \
101 inet_net \
102 inet_netof \
103 inet_ntoa \
104 rcmd \
105 rexec \
106 ruserpass \
107 setipv4sourcefilter \
108 setsourcefilter \
109 # routines
110
111 install-others = $(inst_sysconfdir)/rpc
112
113 aux := check_pf check_native ifreq
114
115 tests := \
116 bug-if1 \
117 htontest \
118 test-hnto-types \
119 test-ifaddrs \
120 test-inet6_opt \
121 test_ifindex \
122 tst-checks \
123 tst-checks-posix \
124 tst-ether_aton \
125 tst-ether_line \
126 tst-gethnm \
127 tst-getni1 \
128 tst-getni2 \
129 tst-if_index-long \
130 tst-inet6_rth \
131 tst-network \
132 tst-ntoa \
133 tst-sockaddr \
134 # tests
135
136 # tst-deadline must be linked statically so that we can access
137 # internal functions.
138 tests-static += tst-deadline
139 tests-internal += tst-deadline
140
141 # tst-idna_name_classify must be linked statically because it tests
142 # internal functionality.
143 tests-static += tst-idna_name_classify
144 tests-internal += tst-idna_name_classify
145
146 # tst-inet6_scopeid_pton also needs internal functions but does not
147 # need to be linked statically.
148 tests-internal += tst-inet6_scopeid_pton
149
150 include ../Rules
151
152 LOCALES := en_US.UTF-8 en_US.ISO-8859-1
153 include ../gen-locales.mk
154
155 ifeq ($(have-thread-library),yes)
156
157 CFLAGS-gethstbyad_r.c += -fexceptions
158 CFLAGS-gethstbyad.c += -fexceptions
159 CFLAGS-gethstbynm_r.c += -fexceptions
160 CFLAGS-gethstbynm.c += -fexceptions
161 CFLAGS-gethstbynm2_r.c += -fexceptions
162 CFLAGS-gethstbynm2.c += -fexceptions
163 CFLAGS-gethstent_r.c += -fexceptions
164 CFLAGS-gethstent.c += -fexceptions
165 CFLAGS-rcmd.c += -fexceptions
166 CFLAGS-getnetbynm_r.c += -fexceptions
167 CFLAGS-getnetbynm.c += -fexceptions
168 CFLAGS-getnetbyad_r.c += -fexceptions
169 CFLAGS-getnetbyad.c += -fexceptions
170 CFLAGS-getnetent_r.c += -fexceptions
171 CFLAGS-getnetent.c += -fexceptions
172 CFLAGS-getrpcent_r.c += -fexceptions
173 CFLAGS-getrpcent.c += -fexceptions
174 CFLAGS-getservent_r.c += -fexceptions
175 CFLAGS-getservent.c += -fexceptions
176 CFLAGS-getprtent_r.c += -fexceptions
177 CFLAGS-getprtent.c += -fexceptions
178 CFLAGS-either_ntoh.c += -fexceptions
179 CFLAGS-either_hton.c += -fexceptions
180 CFLAGS-getnetgrent.c += -fexceptions
181 CFLAGS-getnetgrent_r.c += -fexceptions
182 CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
183 CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
184 CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
185
186 CFLAGS-tst-checks-posix.c += -std=c99
187 CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
188
189 endif
190
191 # Install the rpc database file.
192 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
193 $(do-install)
194
195 ifeq ($(build-static-nss),yes)
196 CFLAGS += -DSTATIC_NSS
197 endif
198
199 # The test uses dlopen indirectly and would otherwise load system
200 # objects.
201 tst-idna_name_classify-ENV = \
202 LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx):$(common-objpfx)elf
203 $(objpfx)tst-idna_name_classify.out: $(gen-locales)