]>
Commit | Line | Data |
---|---|---|
2b778ceb | 1 | # Copyright (C) 1994-2021 Free Software Foundation, Inc. |
28f540f4 RM |
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 | |
41bdb6e2 AJ |
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. | |
28f540f4 RM |
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 | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
28f540f4 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | # License along with the GNU C Library; if not, see |
5a82c748 | 16 | # <https://www.gnu.org/licenses/>. |
28f540f4 RM |
17 | |
18 | # | |
19 | # Sub-makefile for resolv portion of the library. | |
20 | # | |
21 | subdir := resolv | |
22 | ||
a5f891ac JM |
23 | include ../Makeconfig |
24 | ||
500b3a49 | 25 | headers := resolv.h bits/types/res_state.h \ |
c6d80202 RM |
26 | netdb.h bits/netdb.h \ |
27 | arpa/nameser.h arpa/nameser_compat.h \ | |
6500dff6 | 28 | sys/bitypes.h |
28f540f4 | 29 | |
389c1114 | 30 | routines := \ |
fd8a87c0 | 31 | dn_comp \ |
640bbdf7 | 32 | dn_expand \ |
391e0223 | 33 | dn_skipname \ |
e1fcf214 FW |
34 | dns-canon \ |
35 | dns-host \ | |
36 | dns-network \ | |
389c1114 FW |
37 | herror \ |
38 | inet_addr \ | |
39 | inet_ntop \ | |
40 | inet_pton \ | |
08d4a980 | 41 | ns_makecanon \ |
13e1f867 | 42 | ns_name_compress \ |
adcc572a | 43 | ns_name_ntop \ |
7ed1ac6d | 44 | ns_name_pack \ |
276e9822 | 45 | ns_name_pton \ |
cff2c78c | 46 | ns_name_skip \ |
4e1d3db1 | 47 | ns_name_uncompress \ |
820bb23f | 48 | ns_name_unpack \ |
762a2b2d | 49 | ns_samename \ |
389c1114 | 50 | nsap_addr \ |
ee5ed999 | 51 | nss_dns_functions \ |
389c1114 | 52 | res-close \ |
2fbe5860 | 53 | res-name-checking \ |
389c1114 | 54 | res-state \ |
be5773e1 | 55 | res_context_hostalias \ |
b165c65c | 56 | res_enable_icmp \ |
9515126f | 57 | res_get_nsaddr \ |
389c1114 FW |
58 | res_hconf \ |
59 | res_init \ | |
60 | res_libc \ | |
21a497cc | 61 | res_mkquery \ |
72a51ac6 | 62 | res_nameinquery \ |
7131727c | 63 | res_queriesmatch \ |
ea9878ec | 64 | res_query \ |
389c1114 | 65 | res_randomid \ |
b165c65c | 66 | res_send \ |
389c1114 FW |
67 | resolv_conf \ |
68 | resolv_context \ | |
69 | # routines | |
282d8743 | 70 | |
37f02b1d | 71 | tests = tst-aton tst-leaks tst-inet_ntop |
29fddfc7 | 72 | tests-container = tst-leaks2 |
b062f051 | 73 | |
108bc404 FW |
74 | tests-internal += tst-inet_aton_exact |
75 | ||
76 | ||
0b20a9e8 | 77 | generate := mtrace-tst-leaks.out tst-leaks.mtrace tst-leaks2.mtrace |
0696c2c0 | 78 | |
e10546cb AJ |
79 | extra-libs := libresolv libnss_dns |
80 | ifeq ($(have-thread-library),yes) | |
3897dbb6 | 81 | routines += gai_sigqueue |
737e873b AZ |
82 | endif |
83 | ||
84 | ifeq ($(have-GLIBC_2.34)$(have-thread-library),yesyes) | |
85 | # Empty compatibility library for old binaries. | |
86 | extra-libs += libanl | |
5840c75c FW |
87 | |
88 | tests += \ | |
89 | tst-bug18665 \ | |
90 | tst-bug18665-tcp \ | |
07d6f1a3 | 91 | tst-ns_name \ |
c803cb9b | 92 | tst-ns_name_compress \ |
e2a9fca8 | 93 | tst-ns_name_pton \ |
5840c75c | 94 | tst-res_hconf_reorder \ |
5c1a6923 | 95 | tst-res_hnok \ |
5840c75c | 96 | tst-resolv-basic \ |
401311cf | 97 | tst-resolv-binary \ |
e14a2772 | 98 | tst-resolv-edns \ |
5840c75c | 99 | tst-resolv-network \ |
108bc404 | 100 | tst-resolv-nondecimal \ |
89f6307c | 101 | tst-resolv-res_init-multi \ |
5840c75c | 102 | tst-resolv-search \ |
108bc404 | 103 | tst-resolv-trailing \ |
5840c75c | 104 | |
f1f00c07 FW |
105 | # This test calls __res_context_send directly, which is not exported |
106 | # from libresolv. | |
107 | tests-internal += tst-resolv-txnid-collision | |
108 | tests-static += tst-resolv-txnid-collision | |
109 | ||
c3261cdb FW |
110 | # These tests need libdl. |
111 | ifeq (yes,$(build-shared)) | |
112 | tests += \ | |
7f9f1ecb FW |
113 | tst-resolv-ai_idn \ |
114 | tst-resolv-ai_idn-latin1 \ | |
115 | tst-resolv-ai_idn-nolibidn2 \ | |
c3261cdb | 116 | tst-resolv-canonname \ |
446997ff | 117 | tst-resolv-trustad \ |
c3261cdb | 118 | |
3f8b44be | 119 | # Needs resolv_context. |
2714c5f3 FW |
120 | tests-internal += \ |
121 | tst-resolv-res_init \ | |
122 | tst-resolv-res_init-thread \ | |
cb3c27e8 FW |
123 | tst-resolv-res_ninit \ |
124 | tst-resolv-threads \ | |
e237357a | 125 | |
7f9f1ecb FW |
126 | # Used by tst-resolv-ai_idn-nolibidn2 to disable libidn2 (by not |
127 | # providing any functions in libidn2.so.0). | |
128 | modules-names += tst-no-libidn2 | |
129 | extra-test-objs += tst-no-libidn2.os | |
130 | LDFLAGS-tst-no-libidn2.so = -Wl,-soname,libidn2.so.0 | |
131 | ||
132 | endif # $(build-shared) | |
c3261cdb | 133 | |
44dade71 | 134 | # This test accesses __inet_ntop_length, an internal libc function. |
60149b28 FW |
135 | tests-internal += tst-inet_pton |
136 | ||
754034c4 | 137 | # This test accesses the __p_secstodate compat symbol. |
cfaf5367 FW |
138 | ifeq ($(have-GLIBC_2.26)$(build-shared),yesyes) |
139 | tests += tst-p_secstodate | |
140 | endif | |
754034c4 | 141 | |
fc82b0a2 FW |
142 | # This test sends millions of packets and is rather slow. |
143 | xtests += tst-resolv-qtypes | |
5b757a51 FW |
144 | |
145 | # This test has dropped packet tests and runs for a long time. | |
146 | xtests += tst-resolv-rotate | |
e10546cb | 147 | endif |
f0f1bf85 | 148 | extra-libs-others = $(extra-libs) |
389c1114 FW |
149 | libresolv-routines := \ |
150 | base64 \ | |
151 | compat-gethnamaddr \ | |
152 | compat-hooks \ | |
153 | inet_net_ntop \ | |
154 | inet_net_pton \ | |
155 | inet_neta \ | |
156 | ns_date \ | |
157 | ns_name \ | |
158 | ns_netint \ | |
159 | ns_parse \ | |
160 | ns_print \ | |
161 | ns_samedomain \ | |
162 | ns_ttl \ | |
7ec366a0 | 163 | res-putget \ |
389c1114 FW |
164 | res_data \ |
165 | res_debug \ | |
66ac4268 | 166 | res_hostalias \ |
17d0407a | 167 | res_isourserver \ |
08d4a980 | 168 | resolv-deprecated \ |
389c1114 | 169 | # libresolv-routines |
28f540f4 | 170 | |
dbb949f5 | 171 | $(libanl-routines-var) += \ |
389c1114 FW |
172 | gai_cancel \ |
173 | gai_error \ | |
174 | gai_misc \ | |
175 | gai_notify \ | |
176 | gai_suspend \ | |
177 | getaddrinfo_a \ | |
178 | # $(libanl-routines-var) | |
dbb949f5 FW |
179 | |
180 | libanl-routines += libanl-compat | |
181 | libanl-shared-only-routines += libanl-compat | |
2ace5721 | 182 | |
fd26970f | 183 | subdir-dirs = nss_dns |
68dbb3a6 UD |
184 | vpath %.c nss_dns |
185 | ||
20be978f FW |
186 | # Build only an empty shared libnss_dns. |
187 | libnss_dns-inhibit-o = $(filter-out .os,$(object-suffixes)) | |
188 | ||
189 | # Pretend that libnss_dns.so is a linker script, so that the symbolic link | |
190 | # is not installed. | |
191 | install-lib-ldscripts = libnss_dns.so | |
192 | $(inst_libdir)/libnss_dns.so: | |
193 | ||
f214606a JM |
194 | ifeq ($(run-built-tests),yes) |
195 | ifneq (no,$(PERL)) | |
29fddfc7 SL |
196 | tests-special += $(objpfx)mtrace-tst-leaks.out $(objpfx)mtrace-tst-leaks2.out \ |
197 | $(objpfx)mtrace-tst-resolv-res_ninit.out | |
f214606a JM |
198 | endif |
199 | endif | |
200 | ||
0b20a9e8 | 201 | generated += mtrace-tst-leaks.out tst-leaks.mtrace \ |
e237357a FW |
202 | mtrace-tst-leaks2.out tst-leaks2.mtrace \ |
203 | mtrace-tst-resolv-res_ninit.out tst-resolv-res_ninit.mtrace \ | |
434190c0 | 204 | |
28f540f4 | 205 | include ../Rules |
0793d348 | 206 | |
7f9f1ecb FW |
207 | LOCALES := en_US.UTF-8 en_US.ISO-8859-1 |
208 | include ../gen-locales.mk | |
209 | ||
36975e8e | 210 | CFLAGS-res_hconf.c += -fexceptions |
443f7933 | 211 | |
68dbb3a6 | 212 | # The DNS NSS modules needs the resolver. |
fab7ce3f | 213 | $(objpfx)libnss_dns.so: $(objpfx)libresolv.so |
2ace5721 UD |
214 | |
215 | # The asynchronous name lookup code needs the thread library. | |
fab7ce3f | 216 | $(objpfx)libanl.so: $(shared-thread-library) |
2ace5721 | 217 | |
6f1c7010 | 218 | $(objpfx)tst-res_hconf_reorder: $(shared-thread-library) |
b57525f1 DL |
219 | tst-res_hconf_reorder-ENV = RESOLV_REORDER=on |
220 | ||
dd174748 | 221 | $(objpfx)tst-leaks: $(objpfx)libresolv.so |
2d2d9f2b SP |
222 | tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \ |
223 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
0b20a9e8 | 224 | $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out |
f0881698 JM |
225 | $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@; \ |
226 | $(evaluate-test) | |
2ed2dc18 | 227 | |
2d2d9f2b SP |
228 | tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace \ |
229 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
0b20a9e8 | 230 | $(objpfx)mtrace-tst-leaks2.out: $(objpfx)tst-leaks2.out |
aa7e05c3 SL |
231 | { test -r $(objpfx)tst-leaks2.mtrace \ |
232 | || ( echo "tst-leaks2.mtrace does not exist"; exit 77; ) \ | |
233 | && $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace; } > $@; \ | |
f0881698 | 234 | $(evaluate-test) |
5840c75c | 235 | |
2d2d9f2b SP |
236 | tst-resolv-res_ninit-ENV = MALLOC_TRACE=$(objpfx)tst-resolv-res_ninit.mtrace \ |
237 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
e237357a FW |
238 | $(objpfx)mtrace-tst-resolv-res_ninit.out: $(objpfx)tst-resolv-res_ninit.out |
239 | $(common-objpfx)malloc/mtrace \ | |
240 | $(objpfx)tst-resolv-res_ninit.mtrace > $@; \ | |
241 | $(evaluate-test) | |
242 | ||
5840c75c FW |
243 | $(objpfx)tst-bug18665-tcp: $(objpfx)libresolv.so $(shared-thread-library) |
244 | $(objpfx)tst-bug18665: $(objpfx)libresolv.so $(shared-thread-library) | |
6f1c7010 | 245 | $(objpfx)tst-resolv-ai_idn: $(objpfx)libresolv.so $(shared-thread-library) |
7f9f1ecb | 246 | $(objpfx)tst-resolv-ai_idn-latin1: \ |
6f1c7010 | 247 | $(objpfx)libresolv.so $(shared-thread-library) |
7f9f1ecb | 248 | $(objpfx)tst-resolv-ai_idn-nolibidn2: \ |
6f1c7010 | 249 | $(objpfx)libresolv.so $(shared-thread-library) |
7f9f1ecb FW |
250 | $(objpfx)tst-resolv-ai_idn.out: $(gen-locales) |
251 | $(objpfx)tst-resolv-ai_idn-latin1.out: $(gen-locales) | |
252 | $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \ | |
253 | $(gen-locales) $(objpfx)tst-no-libidn2.so | |
5840c75c | 254 | $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library) |
401311cf | 255 | $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library) |
e14a2772 | 256 | $(objpfx)tst-resolv-edns: $(objpfx)libresolv.so $(shared-thread-library) |
5840c75c | 257 | $(objpfx)tst-resolv-network: $(objpfx)libresolv.so $(shared-thread-library) |
6f1c7010 | 258 | $(objpfx)tst-resolv-res_init: $(objpfx)libresolv.so |
89f6307c FW |
259 | $(objpfx)tst-resolv-res_init-multi: $(objpfx)libresolv.so \ |
260 | $(shared-thread-library) | |
6f1c7010 | 261 | $(objpfx)tst-resolv-res_init-thread: $(objpfx)libresolv.so \ |
2714c5f3 | 262 | $(shared-thread-library) |
108bc404 | 263 | $(objpfx)tst-resolv-nondecimal: $(objpfx)libresolv.so $(shared-thread-library) |
fc82b0a2 | 264 | $(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library) |
5b757a51 | 265 | $(objpfx)tst-resolv-rotate: $(objpfx)libresolv.so $(shared-thread-library) |
5840c75c | 266 | $(objpfx)tst-resolv-search: $(objpfx)libresolv.so $(shared-thread-library) |
108bc404 | 267 | $(objpfx)tst-resolv-trailing: $(objpfx)libresolv.so $(shared-thread-library) |
6f1c7010 | 268 | $(objpfx)tst-resolv-threads: $(objpfx)libresolv.so $(shared-thread-library) |
f1f00c07 FW |
269 | $(objpfx)tst-resolv-txnid-collision: $(objpfx)libresolv.a \ |
270 | $(static-thread-library) | |
6f1c7010 | 271 | $(objpfx)tst-resolv-canonname: $(objpfx)libresolv.so $(shared-thread-library) |
446997ff | 272 | $(objpfx)tst-resolv-trustad: $(objpfx)libresolv.so $(shared-thread-library) |
b76e0659 | 273 | |
07d6f1a3 FW |
274 | $(objpfx)tst-ns_name: $(objpfx)libresolv.so |
275 | $(objpfx)tst-ns_name.out: tst-ns_name.data | |
c803cb9b | 276 | $(objpfx)tst-ns_name_compress: $(objpfx)libresolv.so |
e2a9fca8 | 277 | $(objpfx)tst-ns_name_pton: $(objpfx)libresolv.so |
5c1a6923 | 278 | $(objpfx)tst-res_hnok: $(objpfx)libresolv.so |
f120cda6 | 279 | $(objpfx)tst-p_secstodate: $(objpfx)libresolv.so |