powerpc64: Fix by using the configure value $libc_cv_cc_submachine [BZ #31629]
[glibc.git] / wcsmbs / Makefile
blob1cddd8cc6dc3e90c438b1e7e5b47a766db19eb06
1 # Copyright (C) 1995-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 wcsmbs portion of the library.
21 subdir := wcsmbs
23 include ../Makeconfig
25 headers := \
26 bits/types/__mbstate_t.h \
27 bits/types/mbstate_t.h \
28 bits/types/wint_t.h \
29 bits/wchar-ldbl.h \
30 bits/wchar.h \
31 bits/wchar2-decl.h \
32 bits/wchar2.h \
33 uchar.h \
34 wchar.h \
35 # headers
37 routines := \
38 btowc \
39 c16rtomb \
40 c32rtomb \
41 c8rtomb \
42 isoc23_fwscanf \
43 isoc23_swscanf \
44 isoc23_vfwscanf \
45 isoc23_vswscanf \
46 isoc23_vwscanf \
47 isoc23_wscanf \
48 isoc99_fwscanf \
49 isoc99_swscanf \
50 isoc99_vfwscanf \
51 isoc99_vswscanf \
52 isoc99_vwscanf \
53 isoc99_wscanf \
54 mbrlen \
55 mbrtoc8 \
56 mbrtoc16 \
57 mbrtoc32 \
58 mbrtowc \
59 mbsinit \
60 mbsnrtowcs \
61 mbsrtowcs \
62 mbsrtowcs_l \
63 wcpcpy \
64 wcpncpy \
65 wcrtomb \
66 wcscasecmp \
67 wcscasecmp_l \
68 wcscat \
69 wcschr \
70 wcschrnul \
71 wcscmp \
72 wcscoll \
73 wcscoll_l \
74 wcscpy \
75 wcscspn \
76 wcsdup \
77 wcslcat \
78 wcslcpy \
79 wcslen \
80 wcsmbsload \
81 wcsncase \
82 wcsncase_l \
83 wcsncat \
84 wcsncmp \
85 wcsncpy \
86 wcsnlen \
87 wcsnrtombs \
88 wcspbrk \
89 wcsrchr \
90 wcsrtombs \
91 wcsspn \
92 wcsstr \
93 wcstod \
94 wcstod_l \
95 wcstod_nan \
96 wcstof \
97 wcstof_l \
98 wcstof_nan \
99 wcstok \
100 wcstol \
101 wcstol_l \
102 wcstold \
103 wcstold_l \
104 wcstold_nan \
105 wcstoll \
106 wcstoll_l \
107 wcstoul \
108 wcstoul_l \
109 wcstoull \
110 wcstoull_l \
111 wcswidth \
112 wcsxfrm \
113 wcsxfrm_l \
114 wctob \
115 wcwidth \
116 wmemchr \
117 wmemcmp \
118 wmemcpy \
119 wmemmove \
120 wmempcpy \
121 wmemset \
122 # routines
124 # Exclude fortified routines from being built with _FORTIFY_SOURCE
125 routines_no_fortify += \
126 mbsnrtowcs \
127 mbsrtowcs \
128 wcpcpy \
129 wcpncpy \
130 wcrtomb \
131 wcscat \
132 wcscpy \
133 wcslcat \
134 wcslcpy \
135 wcsncat \
136 wcsncpy \
137 wcsnrtombs \
138 wcsrtombs \
139 wmemcpy \
140 wmemmove \
141 wmempcpy \
142 wmemset \
143 # routines_no_fortify
145 tests := \
146 test-c8rtomb \
147 test-char-types \
148 test-mbrtoc8 \
149 test-wcpcpy \
150 test-wcpncpy \
151 test-wcscat \
152 test-wcschr \
153 test-wcschrnul \
154 test-wcscmp \
155 test-wcscpy \
156 test-wcscspn \
157 test-wcsdup \
158 test-wcslen \
159 test-wcsncat \
160 test-wcsncmp \
161 test-wcsncpy \
162 test-wcsnlen \
163 test-wcspbrk \
164 test-wcsrchr \
165 test-wcsspn \
166 test-wcsstr \
167 test-wmemchr \
168 test-wmemcmp \
169 test-wmemset \
170 tst-btowc \
171 tst-c16-surrogate \
172 tst-c16c32-1 \
173 tst-c32-state \
174 tst-fgetwc-after-eof \
175 tst-mbrtowc \
176 tst-mbrtowc2 \
177 tst-mbsrtowcs \
178 tst-mbstowcs \
179 tst-wchar-h \
180 tst-wcpncpy \
181 tst-wcrtomb \
182 tst-wcslcat \
183 tst-wcslcat2 \
184 tst-wcslcpy \
185 tst-wcslcpy2 \
186 tst-wcsnlen \
187 tst-wcstod-nan-locale \
188 tst-wcstod-nan-sign \
189 tst-wcstod-round \
190 tst-wcstof \
191 tst-wcstol-binary-c11 \
192 tst-wcstol-binary-c23 \
193 tst-wcstol-binary-gnu11 \
194 tst-wcstol-binary-gnu23 \
195 tst-wcstol-locale \
196 tst-wprintf-binary \
197 tst-wprintf-intn \
198 tst-wscanf-binary-c11 \
199 tst-wscanf-binary-c23 \
200 tst-wscanf-binary-gnu11 \
201 tst-wscanf-binary-gnu89 \
202 tst-wscanf-intn \
203 tst-wscanf-to_inpunct \
204 wcsatcliff \
205 wcsmbs-tst1 \
206 # tests
208 include ../Rules
210 ifeq ($(run-built-tests),yes)
211 LOCALES := \
212 de_DE.ISO-8859-1 \
213 de_DE.UTF-8 \
214 en_US.ANSI_X3.4-1968 \
215 fa_IR.UTF-8 \
216 hr_HR.ISO-8859-2 \
217 ja_JP.EUC-JP \
218 tr_TR.ISO-8859-9 \
219 tr_TR.UTF-8 \
220 zh_HK.BIG5-HKSCS \
221 zh_TW.EUC-TW \
222 # LOCALES
223 include ../gen-locales.mk
225 $(objpfx)tst-btowc.out: $(gen-locales)
226 $(objpfx)tst-c16c32-1.out: $(gen-locales)
227 $(objpfx)tst-mbrtowc.out: $(gen-locales)
228 $(objpfx)tst-mbrtowc2.out: $(gen-locales)
229 $(objpfx)tst-wcrtomb.out: $(gen-locales)
230 $(objpfx)wcsmbs-tst1.out: $(gen-locales)
231 $(objpfx)tst-wcstol-locale.out: $(gen-locales)
232 $(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
233 $(objpfx)tst-c16-surrogate.out: $(gen-locales)
234 $(objpfx)tst-c32-state.out: $(gen-locales)
235 $(objpfx)test-c8rtomb.out: $(gen-locales)
236 $(objpfx)test-mbrtoc8.out: $(gen-locales)
237 $(objpfx)tst-wscanf-to_inpunct.out: $(gen-locales)
238 endif
240 $(objpfx)tst-wcstod-round: $(libm)
242 CFLAGS-wcwidth.c += -I../wctype
243 CFLAGS-wcswidth.c += -I../wctype
245 strtox-CFLAGS = -I../include
246 CFLAGS-wcstol.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
247 CFLAGS-wcstoul.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
248 CFLAGS-wcstoll.c += $(strtox-CFLAGS)
249 CFLAGS-wcstoull.c += $(strtox-CFLAGS)
250 CFLAGS-wcstod.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
251 CFLAGS-wcstold.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
252 CFLAGS-wcstof128.c += $(strtox-CFLAGS)
253 CFLAGS-wcstof.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
254 CFLAGS-wcstol_l.c += $(strtox-CFLAGS)
255 CFLAGS-wcstoul_l.c += $(strtox-CFLAGS)
256 CFLAGS-wcstoll_l.c += $(strtox-CFLAGS)
257 CFLAGS-wcstoull_l.c += $(strtox-CFLAGS)
258 CFLAGS-wcstod_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
259 CFLAGS-wcstold_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
260 CFLAGS-wcstof128_l.c += $(strtox-CFLAGS)
261 CFLAGS-wcstof_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
262 CPPFLAGS-tst-wchar-h.c += $(no-fortify-source),-D_FORTIFY_SOURCE=2
264 CFLAGS-wcschr.c += $(config-cflags-wno-ignored-attributes)
265 CFLAGS-wmemchr.c += $(config-cflags-wno-ignored-attributes)
266 CFLAGS-wmemset.c += $(config-cflags-wno-ignored-attributes)
267 CFLAGS-mbrtowc.c += $(config-cflags-wno-ignored-attributes)
268 CFLAGS-wcrtomb.c += $(config-cflags-wno-ignored-attributes)
269 CFLAGS-wcstoll.c += $(config-cflags-wno-ignored-attributes)
270 CFLAGS-wcstoull.c += $(config-cflags-wno-ignored-attributes)
272 CFLAGS-isoc99_wscanf.c += -fexceptions
273 CFLAGS-isoc99_fwscanf.c += -fexceptions
274 CFLAGS-isoc99_vwscanf.c += -fexceptions
275 CFLAGS-isoc99_vfwscanf.c += -fexceptions
276 CFLAGS-isoc23_wscanf.c += -fexceptions
277 CFLAGS-isoc23_fwscanf.c += -fexceptions
278 CFLAGS-isoc23_vwscanf.c += -fexceptions
279 CFLAGS-isoc23_vfwscanf.c += -fexceptions
281 CPPFLAGS += $(libio-mtsafe)
283 # We need to find the default version of strtold_l in stdlib.
284 CPPFLAGS-wcstold_l.c += -I../stdlib
286 $(objpfx)tst-wcstod-nan-locale: $(libm)
287 $(objpfx)tst-wcstod-nan-sign: $(libm)
289 # Some versions of GCC supported for building glibc do not support -std=c23
290 # or -std=gnu23 (added in GCC 14), or the older names -std=c2x or -std=gnu2x
291 # (added in GCC 9), so the tests for those versions use -std=c11 and -std=gnu11
292 # and then _ISOC23_SOURCE is defined in the test as needed.
293 CFLAGS-tst-wcstol-binary-c11.c += -std=c11
294 CFLAGS-tst-wcstol-binary-c23.c += -std=c11
295 CFLAGS-tst-wcstol-binary-gnu11.c += -std=gnu11
296 CFLAGS-tst-wcstol-binary-gnu23.c += -std=gnu11
297 CFLAGS-tst-wscanf-binary-c11.c += -std=c11 -DOBJPFX=\"$(objpfx)\"
298 CFLAGS-tst-wscanf-binary-c23.c += -std=c11 -DOBJPFX=\"$(objpfx)\"
299 CFLAGS-tst-wscanf-binary-gnu11.c += -std=gnu11 -DOBJPFX=\"$(objpfx)\"
300 CFLAGS-tst-wscanf-binary-gnu89.c += -std=gnu89 -DOBJPFX=\"$(objpfx)\"