PageRenderTime 44ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/resolv/Makefile

https://github.com/hjl-tools/glibc
Makefile | 210 lines | 143 code | 38 blank | 29 comment | 0 complexity | fc3b1a6b4193cbe12cbf5ea7ff9707a3 MD5 | raw file
  1. # Copyright (C) 1994-2020 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3. # The GNU C Library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Lesser General Public
  5. # License as published by the Free Software Foundation; either
  6. # version 2.1 of the License, or (at your option) any later version.
  7. # The GNU C Library is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. # Lesser General Public License for more details.
  11. # You should have received a copy of the GNU Lesser General Public
  12. # License along with the GNU C Library; if not, see
  13. # <https://www.gnu.org/licenses/>.
  14. #
  15. # Sub-makefile for resolv portion of the library.
  16. #
  17. subdir := resolv
  18. include ../Makeconfig
  19. headers := resolv.h bits/types/res_state.h \
  20. netdb.h bits/netdb.h \
  21. arpa/nameser.h arpa/nameser_compat.h \
  22. sys/bitypes.h
  23. routines := herror inet_addr inet_ntop inet_pton nsap_addr res_init \
  24. res_hconf res_libc res-state res_randomid res-close \
  25. resolv_context resolv_conf
  26. tests = tst-aton tst-leaks tst-inet_ntop
  27. xtests = tst-leaks2
  28. tests-internal += tst-inet_aton_exact
  29. generate := mtrace-tst-leaks.out tst-leaks.mtrace tst-leaks2.mtrace
  30. extra-libs := libresolv libnss_dns
  31. ifeq ($(have-thread-library),yes)
  32. extra-libs += libanl
  33. routines += gai_sigqueue
  34. tests += \
  35. tst-bug18665 \
  36. tst-bug18665-tcp \
  37. tst-ns_name \
  38. tst-ns_name_compress \
  39. tst-ns_name_pton \
  40. tst-res_hconf_reorder \
  41. tst-res_hnok \
  42. tst-resolv-basic \
  43. tst-resolv-binary \
  44. tst-resolv-edns \
  45. tst-resolv-network \
  46. tst-resolv-nondecimal \
  47. tst-resolv-res_init-multi \
  48. tst-resolv-search \
  49. tst-resolv-trailing \
  50. # These tests need libdl.
  51. ifeq (yes,$(build-shared))
  52. tests += \
  53. tst-resolv-ai_idn \
  54. tst-resolv-ai_idn-latin1 \
  55. tst-resolv-ai_idn-nolibidn2 \
  56. tst-resolv-canonname \
  57. tst-resolv-trustad \
  58. # Needs resolv_context.
  59. tests-internal += \
  60. tst-resolv-res_init \
  61. tst-resolv-res_init-thread \
  62. tst-resolv-res_ninit \
  63. tst-resolv-threads \
  64. # Used by tst-resolv-ai_idn-nolibidn2 to disable libidn2 (by not
  65. # providing any functions in libidn2.so.0).
  66. modules-names += tst-no-libidn2
  67. extra-test-objs += tst-no-libidn2.os
  68. LDFLAGS-tst-no-libidn2.so = -Wl,-soname,libidn2.so.0
  69. endif # $(build-shared)
  70. # This test accesses __inet_ntop_length, an internal libc function.
  71. tests-internal += tst-inet_pton
  72. # This test accesses the __p_secstodate compat symbol.
  73. tests-internal += tst-p_secstodate
  74. # This test sends millions of packets and is rather slow.
  75. xtests += tst-resolv-qtypes
  76. # This test has dropped packet tests and runs for a long time.
  77. xtests += tst-resolv-rotate
  78. endif
  79. extra-libs-others = $(extra-libs)
  80. libresolv-routines := res_comp res_debug \
  81. res_data res_mkquery res_query res_send \
  82. inet_net_ntop inet_net_pton inet_neta base64 \
  83. ns_parse ns_name ns_netint ns_ttl ns_print \
  84. ns_samedomain ns_date res_enable_icmp \
  85. compat-hooks compat-gethnamaddr
  86. libanl-routines := gai_cancel gai_error gai_misc gai_notify gai_suspend \
  87. getaddrinfo_a
  88. subdir-dirs = nss_dns
  89. vpath %.c nss_dns
  90. libnss_dns-routines := dns-host dns-network dns-canon
  91. libnss_dns-inhibit-o = $(filter-out .os,$(object-suffixes))
  92. ifeq ($(build-static-nss),yes)
  93. routines += $(libnss_dns-routines) $(libresolv-routines)
  94. static-only-routines += $(libnss_dns-routines) $(libresolv-routines)
  95. endif
  96. ifeq ($(run-built-tests),yes)
  97. ifneq (no,$(PERL))
  98. tests-special += $(objpfx)mtrace-tst-leaks.out
  99. xtests-special += $(objpfx)mtrace-tst-leaks2.out
  100. tests-special += $(objpfx)mtrace-tst-resolv-res_ninit.out
  101. endif
  102. endif
  103. ifeq (,$(filter sunrpc,$(subdirs)))
  104. # The netdb.h we install does '#include <rpc/netdb.h>', so one must exist.
  105. # If sunrpc/ is built in this configuration, it installs a real <rpc/netdb.h>.
  106. # If that's not going to happen, install our dummy file.
  107. headers += rpc/netdb.h
  108. endif
  109. generated += mtrace-tst-leaks.out tst-leaks.mtrace \
  110. mtrace-tst-leaks2.out tst-leaks2.mtrace \
  111. mtrace-tst-resolv-res_ninit.out tst-resolv-res_ninit.mtrace \
  112. include ../Rules
  113. LOCALES := en_US.UTF-8 en_US.ISO-8859-1
  114. include ../gen-locales.mk
  115. CFLAGS-res_hconf.c += -fexceptions
  116. # The DNS NSS modules needs the resolver.
  117. $(objpfx)libnss_dns.so: $(objpfx)libresolv.so
  118. # The asynchronous name lookup code needs the thread library.
  119. $(objpfx)libanl.so: $(shared-thread-library)
  120. $(objpfx)tst-res_hconf_reorder: $(libdl) $(shared-thread-library)
  121. tst-res_hconf_reorder-ENV = RESOLV_REORDER=on
  122. $(objpfx)tst-leaks: $(objpfx)libresolv.so
  123. tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace
  124. $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
  125. $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@; \
  126. $(evaluate-test)
  127. tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace
  128. $(objpfx)mtrace-tst-leaks2.out: $(objpfx)tst-leaks2.out
  129. $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@; \
  130. $(evaluate-test)
  131. tst-resolv-res_ninit-ENV = MALLOC_TRACE=$(objpfx)tst-resolv-res_ninit.mtrace
  132. $(objpfx)mtrace-tst-resolv-res_ninit.out: $(objpfx)tst-resolv-res_ninit.out
  133. $(common-objpfx)malloc/mtrace \
  134. $(objpfx)tst-resolv-res_ninit.mtrace > $@; \
  135. $(evaluate-test)
  136. $(objpfx)tst-bug18665-tcp: $(objpfx)libresolv.so $(shared-thread-library)
  137. $(objpfx)tst-bug18665: $(objpfx)libresolv.so $(shared-thread-library)
  138. $(objpfx)tst-resolv-ai_idn: \
  139. $(libdl) $(objpfx)libresolv.so $(shared-thread-library)
  140. $(objpfx)tst-resolv-ai_idn-latin1: \
  141. $(libdl) $(objpfx)libresolv.so $(shared-thread-library)
  142. $(objpfx)tst-resolv-ai_idn-nolibidn2: \
  143. $(libdl) $(objpfx)libresolv.so $(shared-thread-library)
  144. $(objpfx)tst-resolv-ai_idn.out: $(gen-locales)
  145. $(objpfx)tst-resolv-ai_idn-latin1.out: $(gen-locales)
  146. $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
  147. $(gen-locales) $(objpfx)tst-no-libidn2.so
  148. $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
  149. $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
  150. $(objpfx)tst-resolv-edns: $(objpfx)libresolv.so $(shared-thread-library)
  151. $(objpfx)tst-resolv-network: $(objpfx)libresolv.so $(shared-thread-library)
  152. $(objpfx)tst-resolv-res_init: $(libdl) $(objpfx)libresolv.so
  153. $(objpfx)tst-resolv-res_init-multi: $(objpfx)libresolv.so \
  154. $(shared-thread-library)
  155. $(objpfx)tst-resolv-res_init-thread: $(libdl) $(objpfx)libresolv.so \
  156. $(shared-thread-library)
  157. $(objpfx)tst-resolv-nondecimal: $(objpfx)libresolv.so $(shared-thread-library)
  158. $(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
  159. $(objpfx)tst-resolv-rotate: $(objpfx)libresolv.so $(shared-thread-library)
  160. $(objpfx)tst-resolv-search: $(objpfx)libresolv.so $(shared-thread-library)
  161. $(objpfx)tst-resolv-trailing: $(objpfx)libresolv.so $(shared-thread-library)
  162. $(objpfx)tst-resolv-threads: \
  163. $(libdl) $(objpfx)libresolv.so $(shared-thread-library)
  164. $(objpfx)tst-resolv-canonname: \
  165. $(libdl) $(objpfx)libresolv.so $(shared-thread-library)
  166. $(objpfx)tst-resolv-trustad: $(objpfx)libresolv.so $(shared-thread-library)
  167. $(objpfx)tst-ns_name: $(objpfx)libresolv.so
  168. $(objpfx)tst-ns_name.out: tst-ns_name.data
  169. $(objpfx)tst-ns_name_compress: $(objpfx)libresolv.so
  170. $(objpfx)tst-ns_name_pton: $(objpfx)libresolv.so
  171. $(objpfx)tst-res_hnok: $(objpfx)libresolv.so
  172. $(objpfx)tst-p_secstodate: $(objpfx)libresolv.so