PageRenderTime 36ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/resolv/Makefile

https://gitlab.com/gbenson/glibc
Makefile | 210 lines | 140 code | 39 blank | 31 comment | 0 complexity | fb163a82ca2f453ffbb9cda9ef6eddb5 MD5 | raw file
  1. # Copyright (C) 1994-2018 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. # <http://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. generate := mtrace-tst-leaks.out tst-leaks.mtrace tst-leaks2.mtrace
  29. extra-libs := libresolv libnss_dns
  30. ifeq ($(have-thread-library),yes)
  31. extra-libs += libanl
  32. routines += gai_sigqueue
  33. tests += \
  34. tst-bug18665 \
  35. tst-bug18665-tcp \
  36. tst-ns_name \
  37. tst-ns_name_compress \
  38. tst-ns_name_pton \
  39. tst-res_hconf_reorder \
  40. tst-res_hnok \
  41. tst-res_use_inet6 \
  42. tst-resolv-basic \
  43. tst-resolv-binary \
  44. tst-resolv-edns \
  45. tst-resolv-network \
  46. tst-resolv-res_init-multi \
  47. tst-resolv-search \
  48. # These tests need libdl.
  49. ifeq (yes,$(build-shared))
  50. tests += \
  51. tst-resolv-ai_idn \
  52. tst-resolv-ai_idn-latin1 \
  53. tst-resolv-ai_idn-nolibidn2 \
  54. tst-resolv-canonname \
  55. # uses DEPRECATED_RES_USE_INET6 from <resolv-internal.h>.
  56. tests-internal += \
  57. tst-resolv-res_init \
  58. tst-resolv-res_init-thread \
  59. # Needs resolv_context.
  60. tests-internal += \
  61. tst-resolv-res_ninit \
  62. tst-resolv-threads \
  63. # Used by tst-resolv-ai_idn-nolibidn2 to disable libidn2 (by not
  64. # providing any functions in libidn2.so.0).
  65. modules-names += tst-no-libidn2
  66. extra-test-objs += tst-no-libidn2.os
  67. LDFLAGS-tst-no-libidn2.so = -Wl,-soname,libidn2.so.0
  68. endif # $(build-shared)
  69. # This test accesses __inet_ntop_length, an internal libc function.
  70. tests-internal += tst-inet_pton
  71. # This test accesses the __p_secstodate compat symbol.
  72. tests-internal += tst-p_secstodate
  73. # This test sends millions of packets and is rather slow.
  74. xtests += tst-resolv-qtypes
  75. # This test has dropped packet tests and runs for a long time.
  76. xtests += tst-resolv-rotate
  77. endif
  78. extra-libs-others = $(extra-libs)
  79. libresolv-routines := res_comp res_debug \
  80. res_data res_mkquery res_query res_send \
  81. inet_net_ntop inet_net_pton inet_neta base64 \
  82. ns_parse ns_name ns_netint ns_ttl ns_print \
  83. ns_samedomain ns_date \
  84. compat-hooks compat-gethnamaddr
  85. libanl-routines := gai_cancel gai_error gai_misc gai_notify gai_suspend \
  86. getaddrinfo_a
  87. subdir-dirs = nss_dns
  88. vpath %.c nss_dns
  89. libnss_dns-routines := dns-host dns-network dns-canon
  90. libnss_dns-inhibit-o = $(filter-out .os,$(object-suffixes))
  91. ifeq ($(build-static-nss),yes)
  92. routines += $(libnss_dns-routines) $(libresolv-routines)
  93. static-only-routines += $(libnss_dns-routines) $(libresolv-routines)
  94. endif
  95. ifeq ($(run-built-tests),yes)
  96. ifneq (no,$(PERL))
  97. tests-special += $(objpfx)mtrace-tst-leaks.out
  98. xtests-special += $(objpfx)mtrace-tst-leaks2.out
  99. tests-special += $(objpfx)mtrace-tst-resolv-res_ninit.out
  100. endif
  101. endif
  102. ifeq (,$(filter sunrpc,$(subdirs)))
  103. # The netdb.h we install does '#include <rpc/netdb.h>', so one must exist.
  104. # If sunrpc/ is built in this configuration, it installs a real <rpc/netdb.h>.
  105. # If that's not going to happen, install our dummy file.
  106. headers += rpc/netdb.h
  107. endif
  108. generated += mtrace-tst-leaks.out tst-leaks.mtrace \
  109. mtrace-tst-leaks2.out tst-leaks2.mtrace \
  110. mtrace-tst-resolv-res_ninit.out tst-resolv-res_ninit.mtrace \
  111. include ../Rules
  112. LOCALES := en_US.UTF-8 en_US.ISO-8859-1
  113. include ../gen-locales.mk
  114. CFLAGS-res_hconf.c += -fexceptions
  115. # The DNS NSS modules needs the resolver.
  116. $(objpfx)libnss_dns.so: $(objpfx)libresolv.so
  117. # The asynchronous name lookup code needs the thread library.
  118. $(objpfx)libanl.so: $(shared-thread-library)
  119. $(objpfx)tst-res_hconf_reorder: $(libdl) $(shared-thread-library)
  120. tst-res_hconf_reorder-ENV = RESOLV_REORDER=on
  121. $(objpfx)tst-leaks: $(objpfx)libresolv.so
  122. tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace
  123. $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
  124. $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@; \
  125. $(evaluate-test)
  126. tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace
  127. $(objpfx)mtrace-tst-leaks2.out: $(objpfx)tst-leaks2.out
  128. $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@; \
  129. $(evaluate-test)
  130. tst-resolv-res_ninit-ENV = MALLOC_TRACE=$(objpfx)tst-resolv-res_ninit.mtrace
  131. $(objpfx)mtrace-tst-resolv-res_ninit.out: $(objpfx)tst-resolv-res_ninit.out
  132. $(common-objpfx)malloc/mtrace \
  133. $(objpfx)tst-resolv-res_ninit.mtrace > $@; \
  134. $(evaluate-test)
  135. $(objpfx)tst-bug18665-tcp: $(objpfx)libresolv.so $(shared-thread-library)
  136. $(objpfx)tst-bug18665: $(objpfx)libresolv.so $(shared-thread-library)
  137. $(objpfx)tst-res_use_inet6: $(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-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
  158. $(objpfx)tst-resolv-rotate: $(objpfx)libresolv.so $(shared-thread-library)
  159. $(objpfx)tst-resolv-search: $(objpfx)libresolv.so $(shared-thread-library)
  160. $(objpfx)tst-resolv-threads: \
  161. $(libdl) $(objpfx)libresolv.so $(shared-thread-library)
  162. $(objpfx)tst-resolv-canonname: \
  163. $(libdl) $(objpfx)libresolv.so $(shared-thread-library)
  164. $(objpfx)tst-ns_name: $(objpfx)libresolv.so
  165. $(objpfx)tst-ns_name.out: tst-ns_name.data
  166. $(objpfx)tst-ns_name_compress: $(objpfx)libresolv.so
  167. $(objpfx)tst-ns_name_pton: $(objpfx)libresolv.so
  168. $(objpfx)tst-res_hnok: $(objpfx)libresolv.so
  169. $(objpfx)tst-p_secstodate: $(objpfx)libresolv.so
  170. # This test case uses the deprecated RES_USE_INET6 resolver option.
  171. CFLAGS-tst-res_use_inet6.c += -Wno-error