syslog: Improve fortify with clang
[glibc.git] / inet / Makefile
blob2f03e6f7ee211525daa6bb98d0ca2019faf05d9c
1 # Copyright (C) 1991-2024 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.
21 subdir := inet
23 include ../Makeconfig
25 headers := \
26 $(wildcard arpa/*.h protocols/*.h) \
27 bits/in.h \
28 ifaddrs.h \
29 netinet/ether.h \
30 netinet/icmp6.h \
31 netinet/if_ether.h \
32 netinet/igmp.h \
33 netinet/in.h \
34 netinet/in_systm.h \
35 netinet/ip.h \
36 netinet/ip6.h \
37 netinet/tcp.h \
38 rpc/netdb.h \
39 # headers
41 routines := \
42 bindresvport \
43 deadline \
44 ether_aton \
45 ether_aton_r \
46 ether_line \
47 ether_ntoa \
48 ether_ntoa_r \
49 getipv4sourcefilter \
50 getsourcefilter \
51 herrno \
52 herrno-loc \
53 htonl \
54 htons \
55 idna \
56 idna_name_classify \
57 if_index \
58 ifaddrs \
59 in6_addr \
60 inet6_opt \
61 inet6_option \
62 inet6_rth \
63 inet6_scopeid_pton \
64 inet_lnaof \
65 inet_mkadr \
66 inet_net \
67 inet_netof \
68 inet_ntoa \
69 rcmd \
70 rexec \
71 ruserpass \
72 setipv4sourcefilter \
73 setsourcefilter \
74 # routines
76 install-others = $(inst_sysconfdir)/rpc
78 aux := check_pf check_native ifreq
80 tests := \
81 bug-if1 \
82 htontest \
83 test-hnto-types \
84 test-ifaddrs \
85 test-inet6_opt \
86 test_ifindex \
87 tst-checks \
88 tst-checks-posix \
89 tst-ether_aton \
90 tst-ether_line \
91 tst-getni1 \
92 tst-getni2 \
93 tst-if_index-long \
94 tst-inet6_rth \
95 tst-network \
96 tst-ntoa \
97 tst-sockaddr \
98 # tests
100 # tst-deadline must be linked statically so that we can access
101 # internal functions.
102 tests-static += tst-deadline
103 tests-internal += tst-deadline
105 # tst-idna_name_classify must be linked statically because it tests
106 # internal functionality.
107 tests-static += tst-idna_name_classify
108 tests-internal += tst-idna_name_classify
110 # tst-inet6_scopeid_pton also needs internal functions but does not
111 # need to be linked statically.
112 tests-internal += tst-inet6_scopeid_pton
114 include ../Rules
116 LOCALES := en_US.UTF-8 en_US.ISO-8859-1
117 include ../gen-locales.mk
119 ifeq ($(have-thread-library),yes)
121 CFLAGS-rcmd.c += -fexceptions
122 CFLAGS-either_ntoh.c += -fexceptions
123 CFLAGS-either_hton.c += -fexceptions
124 CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
125 CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
126 CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
128 CFLAGS-tst-checks-posix.c += -std=c99
129 CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
131 endif
133 # Install the rpc database file.
134 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
135 $(do-install)
137 ifeq ($(build-static-nss),yes)
138 CFLAGS += -DSTATIC_NSS
139 endif
141 # The test uses dlopen indirectly and would otherwise load system
142 # objects.
143 tst-idna_name_classify-ENV = \
144 LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx):$(common-objpfx)elf
145 $(objpfx)tst-idna_name_classify.out: $(gen-locales)