1 # Copyright (C) 1994-2022 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 resolv portion of the library.
25 headers
:= resolv.h bits
/types
/res_state.h \
26 netdb.h bits
/netdb.h \
27 arpa
/nameser.h arpa
/nameser_compat.h \
55 res_context_hostalias \
71 tests
= tst-aton tst-leaks tst-inet_ntop
72 tests-container
= tst-leaks2
74 tests-internal
+= tst-inet_aton_exact
77 generate
:= mtrace-tst-leaks.out tst-leaks.mtrace tst-leaks2.mtrace
79 extra-libs
:= libresolv libnss_dns
80 ifeq ($(have-thread-library
),yes
)
81 routines
+= gai_sigqueue
84 ifeq ($(have-GLIBC_2.34
)$(have-thread-library
),yesyes
)
85 # Empty compatibility library for old binaries.
92 tst-ns_name_compress \
94 tst-res_hconf_reorder \
100 tst-resolv-nondecimal \
101 tst-resolv-res_init-multi \
103 tst-resolv-trailing \
105 # This test calls __res_context_send directly, which is not exported
107 tests-internal
+= tst-resolv-txnid-collision
108 tests-static
+= tst-resolv-txnid-collision
110 # These tests need libdl.
111 ifeq (yes
,$(build-shared
))
114 tst-resolv-ai_idn-latin1 \
115 tst-resolv-ai_idn-nolibidn2 \
116 tst-resolv-canonname \
119 # Needs resolv_context.
121 tst-resolv-res_init \
122 tst-resolv-res_init-thread \
123 tst-resolv-res_ninit \
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
132 endif # $(build-shared)
134 # This test accesses __inet_ntop_length, an internal libc function.
135 tests-internal
+= tst-inet_pton
137 # This test accesses the __p_secstodate compat symbol.
138 ifeq ($(have-GLIBC_2.26
)$(build-shared
),yesyes
)
139 tests
+= tst-p_secstodate
142 # This test sends millions of packets and is rather slow.
143 xtests
+= tst-resolv-qtypes
145 # This test has dropped packet tests and runs for a long time.
146 xtests
+= tst-resolv-rotate
148 extra-libs-others
= $(extra-libs
)
149 libresolv-routines
:= \
171 $(libanl-routines-var
) += \
178 # $(libanl-routines-var)
180 libanl-routines
+= libanl-compat
181 libanl-shared-only-routines
+= libanl-compat
183 # Pretend that libanl.so is a linker script, so that the symbolic link
185 install-lib-ldscripts
= libanl.so
186 $(inst_libdir
)/libanl.so
:
188 subdir-dirs
= nss_dns
191 # Build only an empty shared libnss_dns.
192 libnss_dns-inhibit-o
= $(filter-out .os
,$(object-suffixes
))
194 # Pretend that libnss_dns.so is a linker script, so that the symbolic link
196 install-lib-ldscripts
= libnss_dns.so
197 $(inst_libdir
)/libnss_dns.so
:
199 ifeq ($(run-built-tests
),yes
)
201 tests-special
+= $(objpfx
)mtrace-tst-leaks.out
$(objpfx
)mtrace-tst-leaks2.out \
202 $(objpfx
)mtrace-tst-resolv-res_ninit.out
206 generated
+= mtrace-tst-leaks.out tst-leaks.mtrace \
207 mtrace-tst-leaks2.out tst-leaks2.mtrace \
208 mtrace-tst-resolv-res_ninit.out tst-resolv-res_ninit.mtrace \
212 LOCALES
:= en_US.UTF-8 en_US.ISO-8859-1
213 include ..
/gen-locales.mk
215 CFLAGS-res_hconf.c
+= -fexceptions
217 # The DNS NSS modules needs the resolver.
218 $(objpfx
)libnss_dns.so
: $(objpfx
)libresolv.so
220 # The asynchronous name lookup code needs the thread library.
221 $(objpfx
)libanl.so
: $(shared-thread-library
)
223 $(objpfx
)tst-res_hconf_reorder
: $(shared-thread-library
)
224 tst-res_hconf_reorder-ENV
= RESOLV_REORDER
=on
226 $(objpfx
)tst-leaks
: $(objpfx
)libresolv.so
227 tst-leaks-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks.mtrace \
228 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
229 $(objpfx
)mtrace-tst-leaks.out
: $(objpfx
)tst-leaks.out
230 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks.mtrace
> $@
; \
233 tst-leaks2-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks2.mtrace \
234 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
235 $(objpfx
)mtrace-tst-leaks2.out
: $(objpfx
)tst-leaks2.out
236 { test -r
$(objpfx
)tst-leaks2.mtrace \
237 ||
( echo
"tst-leaks2.mtrace does not exist"; exit
77; ) \
238 && $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks2.mtrace
; } > $@
; \
241 tst-resolv-res_ninit-ENV
= MALLOC_TRACE
=$(objpfx
)tst-resolv-res_ninit.mtrace \
242 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
243 $(objpfx
)mtrace-tst-resolv-res_ninit.out
: $(objpfx
)tst-resolv-res_ninit.out
244 $(common-objpfx
)malloc
/mtrace \
245 $(objpfx
)tst-resolv-res_ninit.mtrace
> $@
; \
248 $(objpfx
)tst-bug18665-tcp
: $(objpfx
)libresolv.so
$(shared-thread-library
)
249 $(objpfx
)tst-bug18665
: $(objpfx
)libresolv.so
$(shared-thread-library
)
250 $(objpfx
)tst-resolv-ai_idn
: $(objpfx
)libresolv.so
$(shared-thread-library
)
251 $(objpfx
)tst-resolv-ai_idn-latin1
: \
252 $(objpfx
)libresolv.so
$(shared-thread-library
)
253 $(objpfx
)tst-resolv-ai_idn-nolibidn2
: \
254 $(objpfx
)libresolv.so
$(shared-thread-library
)
255 $(objpfx
)tst-resolv-ai_idn.out
: $(gen-locales
)
256 $(objpfx
)tst-resolv-ai_idn-latin1.out
: $(gen-locales
)
257 $(objpfx
)tst-resolv-ai_idn-nolibidn2.out
: \
258 $(gen-locales
) $(objpfx
)tst-no-libidn2.so
259 $(objpfx
)tst-resolv-basic
: $(objpfx
)libresolv.so
$(shared-thread-library
)
260 $(objpfx
)tst-resolv-binary
: $(objpfx
)libresolv.so
$(shared-thread-library
)
261 $(objpfx
)tst-resolv-edns
: $(objpfx
)libresolv.so
$(shared-thread-library
)
262 $(objpfx
)tst-resolv-network
: $(objpfx
)libresolv.so
$(shared-thread-library
)
263 $(objpfx
)tst-resolv-res_init
: $(objpfx
)libresolv.so
264 $(objpfx
)tst-resolv-res_init-multi
: $(objpfx
)libresolv.so \
265 $(shared-thread-library
)
266 $(objpfx
)tst-resolv-res_init-thread
: $(objpfx
)libresolv.so \
267 $(shared-thread-library
)
268 $(objpfx
)tst-resolv-nondecimal
: $(objpfx
)libresolv.so
$(shared-thread-library
)
269 $(objpfx
)tst-resolv-qtypes
: $(objpfx
)libresolv.so
$(shared-thread-library
)
270 $(objpfx
)tst-resolv-rotate
: $(objpfx
)libresolv.so
$(shared-thread-library
)
271 $(objpfx
)tst-resolv-search
: $(objpfx
)libresolv.so
$(shared-thread-library
)
272 $(objpfx
)tst-resolv-trailing
: $(objpfx
)libresolv.so
$(shared-thread-library
)
273 $(objpfx
)tst-resolv-threads
: $(objpfx
)libresolv.so
$(shared-thread-library
)
274 $(objpfx
)tst-resolv-txnid-collision
: $(objpfx
)libresolv.a \
275 $(static-thread-library
)
276 $(objpfx
)tst-resolv-canonname
: $(objpfx
)libresolv.so
$(shared-thread-library
)
277 $(objpfx
)tst-resolv-trustad
: $(objpfx
)libresolv.so
$(shared-thread-library
)
279 $(objpfx
)tst-ns_name
: $(objpfx
)libresolv.so
280 $(objpfx
)tst-ns_name.out
: tst-ns_name.data
281 $(objpfx
)tst-ns_name_compress
: $(objpfx
)libresolv.so
282 $(objpfx
)tst-ns_name_pton
: $(objpfx
)libresolv.so
283 $(objpfx
)tst-res_hnok
: $(objpfx
)libresolv.so
284 $(objpfx
)tst-p_secstodate
: $(objpfx
)libresolv.so