]> git.ipfire.org Git - thirdparty/glibc.git/blame - resolv/Makefile
x86_64: Remove L(return_null) from rawmemchr.S
[thirdparty/glibc.git] / resolv / Makefile
CommitLineData
bfff8b1b 1# Copyright (C) 1994-2017 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
PE
15# License along with the GNU C Library; if not, see
16# <http://www.gnu.org/licenses/>.
28f540f4
RM
17
18#
19# Sub-makefile for resolv portion of the library.
20#
21subdir := resolv
22
a5f891ac
JM
23include ../Makeconfig
24
c6d80202
RM
25headers := resolv.h \
26 netdb.h bits/netdb.h \
27 arpa/nameser.h arpa/nameser_compat.h \
6500dff6 28 sys/bitypes.h
28f540f4 29
b43b13ac 30routines := herror inet_addr inet_ntop inet_pton nsap_addr res_init \
270d9d47 31 res_hconf res_libc res-state
282d8743 32
37f02b1d 33tests = tst-aton tst-leaks tst-inet_ntop
2ed2dc18 34xtests = tst-leaks2
b062f051 35
0b20a9e8 36generate := mtrace-tst-leaks.out tst-leaks.mtrace tst-leaks2.mtrace
0696c2c0 37
e10546cb
AJ
38extra-libs := libresolv libnss_dns
39ifeq ($(have-thread-library),yes)
40extra-libs += libanl
3897dbb6 41routines += gai_sigqueue
5840c75c
FW
42
43tests += \
44 tst-bug18665 \
45 tst-bug18665-tcp \
07d6f1a3 46 tst-ns_name \
c803cb9b 47 tst-ns_name_compress \
5840c75c
FW
48 tst-res_hconf_reorder \
49 tst-res_use_inet6 \
50 tst-resolv-basic \
e14a2772 51 tst-resolv-edns \
5840c75c
FW
52 tst-resolv-network \
53 tst-resolv-search \
54
c3261cdb
FW
55# These tests need libdl.
56ifeq (yes,$(build-shared))
57tests += \
58 tst-resolv-canonname \
59
60endif
61
fc82b0a2
FW
62# This test sends millions of packets and is rather slow.
63xtests += tst-resolv-qtypes
e10546cb 64endif
f0f1bf85 65extra-libs-others = $(extra-libs)
e7eceec0 66libresolv-routines := res_comp res_debug \
569c558c 67 res_data res_mkquery res_query res_send \
b43b13ac
UD
68 inet_net_ntop inet_net_pton inet_neta base64 \
69 ns_parse ns_name ns_netint ns_ttl ns_print \
e7eceec0
FW
70 ns_samedomain ns_date \
71 compat-hooks compat-gethnamaddr
28f540f4 72
2ace5721
UD
73libanl-routines := gai_cancel gai_error gai_misc gai_notify gai_suspend \
74 getaddrinfo_a
75
fd26970f 76subdir-dirs = nss_dns
68dbb3a6
UD
77vpath %.c nss_dns
78
28977c2c 79libnss_dns-routines := dns-host dns-network dns-canon
40a55d20 80libnss_dns-inhibit-o = $(filter-out .os,$(object-suffixes))
3ff42526
PP
81ifeq ($(build-static-nss),yes)
82routines += $(libnss_dns-routines) $(libresolv-routines)
83static-only-routines += $(libnss_dns-routines) $(libresolv-routines)
5107cf1d 84endif
68dbb3a6 85
e10546cb 86ifeq (yesyes,$(build-shared)$(have-thread-library))
2ace5721
UD
87tests: $(objpfx)ga_test
88endif
89
f214606a
JM
90ifeq ($(run-built-tests),yes)
91ifneq (no,$(PERL))
0b20a9e8
JM
92tests-special += $(objpfx)mtrace-tst-leaks.out
93xtests-special += $(objpfx)mtrace-tst-leaks2.out
f214606a
JM
94endif
95endif
96
b8a91836
RM
97ifeq (,$(filter sunrpc,$(subdirs)))
98# The netdb.h we install does '#include <rpc/netdb.h>', so one must exist.
99# If sunrpc/ is built in this configuration, it installs a real <rpc/netdb.h>.
100# If that's not going to happen, install our dummy file.
101headers += rpc/netdb.h
102endif
103
0b20a9e8
JM
104generated += mtrace-tst-leaks.out tst-leaks.mtrace \
105 mtrace-tst-leaks2.out tst-leaks2.mtrace
434190c0 106
28f540f4 107include ../Rules
0793d348 108
443f7933
UD
109CFLAGS-res_hconf.c = -fexceptions
110
68dbb3a6 111# The DNS NSS modules needs the resolver.
fab7ce3f 112$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
2ace5721
UD
113
114# The asynchronous name lookup code needs the thread library.
fab7ce3f 115$(objpfx)libanl.so: $(shared-thread-library)
2ace5721
UD
116
117$(objpfx)ga_test: $(objpfx)libanl.so $(shared-thread-library)
dd174748 118
b57525f1
DL
119$(objpfx)tst-res_hconf_reorder: $(libdl) $(shared-thread-library)
120tst-res_hconf_reorder-ENV = RESOLV_REORDER=on
121
dd174748
RM
122$(objpfx)tst-leaks: $(objpfx)libresolv.so
123tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace
0b20a9e8 124$(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
f0881698
JM
125 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@; \
126 $(evaluate-test)
2ed2dc18
UD
127
128tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace
0b20a9e8 129$(objpfx)mtrace-tst-leaks2.out: $(objpfx)tst-leaks2.out
f0881698
JM
130 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@; \
131 $(evaluate-test)
5840c75c
FW
132
133$(objpfx)tst-bug18665-tcp: $(objpfx)libresolv.so $(shared-thread-library)
134$(objpfx)tst-bug18665: $(objpfx)libresolv.so $(shared-thread-library)
135$(objpfx)tst-res_use_inet6: $(objpfx)libresolv.so $(shared-thread-library)
136$(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
e14a2772 137$(objpfx)tst-resolv-edns: $(objpfx)libresolv.so $(shared-thread-library)
5840c75c 138$(objpfx)tst-resolv-network: $(objpfx)libresolv.so $(shared-thread-library)
fc82b0a2 139$(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
5840c75c 140$(objpfx)tst-resolv-search: $(objpfx)libresolv.so $(shared-thread-library)
c3261cdb
FW
141$(objpfx)tst-resolv-canonname: \
142 $(libdl) $(objpfx)libresolv.so $(shared-thread-library)
b76e0659 143
07d6f1a3
FW
144$(objpfx)tst-ns_name: $(objpfx)libresolv.so
145$(objpfx)tst-ns_name.out: tst-ns_name.data
c803cb9b 146$(objpfx)tst-ns_name_compress: $(objpfx)libresolv.so
07d6f1a3
FW
147
148
b76e0659
FW
149# This test case uses the deprecated RES_USE_INET6 resolver option.
150CFLAGS-tst-res_use_inet6.c += -Wno-error