1 # Copyright (C) 1991-2019 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 inet portion of the library.
25 headers
:= netinet
/ether.h netinet
/in.h netinet
/in_systm.h \
26 netinet
/if_ether.h netinet
/igmp.h \
27 netinet
/tcp.h netinet
/ip.h
$(wildcard arpa
/*.h protocols
/*.h
) \
28 aliases.h ifaddrs.h netinet
/ip6.h netinet
/icmp6.h bits
/in.h
30 routines
:= htonl htons \
31 inet_lnaof inet_mkadr \
32 inet_netof inet_ntoa inet_net herrno herrno-loc \
33 gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \
34 gethstbynm_r gethstent gethstent_r \
35 getnetbyad getnetbyad_r getnetbynm getnetent getnetent_r \
37 getproto getproto_r getprtent getprtent_r getprtname getprtname_r \
38 getsrvbynm getsrvbynm_r getsrvbypt getsrvbypt_r getservent \
40 ether_aton ether_aton_r ether_hton ether_line \
41 ether_ntoa ether_ntoa_r ether_ntoh \
42 rcmd rexec ruserpass \
43 getnetgrent_r getnetgrent \
44 getaliasent_r getaliasent getaliasname getaliasname_r \
45 in6_addr getnameinfo if_index ifaddrs inet6_option \
46 getipv4sourcefilter setipv4sourcefilter \
47 getsourcefilter setsourcefilter inet6_opt inet6_rth \
48 inet6_scopeid_pton deadline idna idna_name_classify
50 aux
:= check_pf check_native ifreq
52 tests
:= htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
53 tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \
54 tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-checks-posix \
55 tst-sockaddr test-hnto-types tst-if_index-long
57 # tst-deadline must be linked statically so that we can access
59 tests-static
+= tst-deadline
60 tests-internal
+= tst-deadline
62 # tst-idna_name_classify must be linked statically because it tests
63 # internal functionality.
64 tests-static
+= tst-idna_name_classify
65 tests-internal
+= tst-idna_name_classify
67 # tst-inet6_scopeid_pton also needs internal functions but does not
68 # need to be linked statically.
69 tests-internal
+= tst-inet6_scopeid_pton
73 LOCALES
:= en_US.UTF-8 en_US.ISO-8859-1
74 include ..
/gen-locales.mk
76 ifeq ($(have-thread-library
),yes
)
78 CFLAGS-gethstbyad_r.c
+= -fexceptions
79 CFLAGS-gethstbyad.c
+= -fexceptions
80 CFLAGS-gethstbynm_r.c
+= -fexceptions
81 CFLAGS-gethstbynm.c
+= -fexceptions
82 CFLAGS-gethstbynm2_r.c
+= -fexceptions
83 CFLAGS-gethstbynm2.c
+= -fexceptions
84 CFLAGS-gethstent_r.c
+= -fexceptions
85 CFLAGS-gethstent.c
+= -fexceptions
86 CFLAGS-rcmd.c
+= -fexceptions
87 CFLAGS-getnetbynm_r.c
+= -fexceptions
88 CFLAGS-getnetbynm.c
+= -fexceptions
89 CFLAGS-getnetbyad_r.c
+= -fexceptions
90 CFLAGS-getnetbyad.c
+= -fexceptions
91 CFLAGS-getnetent_r.c
+= -fexceptions
92 CFLAGS-getnetent.c
+= -fexceptions
93 CFLAGS-getaliasent_r.c
+= -fexceptions
94 CFLAGS-getaliasent.c
+= -fexceptions
95 CFLAGS-getrpcent_r.c
+= -fexceptions
96 CFLAGS-getrpcent.c
+= -fexceptions
97 CFLAGS-getservent_r.c
+= -fexceptions
98 CFLAGS-getservent.c
+= -fexceptions
99 CFLAGS-getprtent_r.c
+= -fexceptions
100 CFLAGS-getprtent.c
+= -fexceptions
101 CFLAGS-either_ntoh.c
+= -fexceptions
102 CFLAGS-either_hton.c
+= -fexceptions
103 CFLAGS-getnetgrent.c
+= -fexceptions
104 CFLAGS-getnetgrent_r.c
+= -fexceptions
106 CFLAGS-tst-checks-posix.c
+= -std
=c99
107 CFLAGS-tst-sockaddr.c
+= -fno-strict-aliasing
111 ifeq ($(build-static-nss
),yes
)
112 CFLAGS
+= -DSTATIC_NSS
115 # The test uses dlopen indirectly and would otherwise load system
117 tst-idna_name_classify-ENV
= \
118 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)elf
119 $(objpfx
)tst-idna_name_classify.out
: $(gen-locales
)