check_native: Get rid of alloca
[glibc.git] / wcsmbs / Makefile
blob22192985e1284facdd6ce2b5ec5ae4d0f1e2301a
1 # Copyright (C) 1995-2023 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 tests := \
125 test-c8rtomb \
126 test-char-types \
127 test-mbrtoc8 \
128 test-wcpcpy \
129 test-wcpncpy \
130 test-wcscat \
131 test-wcschr \
132 test-wcschrnul \
133 test-wcscmp \
134 test-wcscpy \
135 test-wcscspn \
136 test-wcsdup \
137 test-wcslen \
138 test-wcsncat \
139 test-wcsncmp \
140 test-wcsncpy \
141 test-wcsnlen \
142 test-wcspbrk \
143 test-wcsrchr \
144 test-wcsspn \
145 test-wmemchr \
146 test-wmemcmp \
147 test-wmemset \
148 tst-btowc \
149 tst-c16-surrogate \
150 tst-c16c32-1 \
151 tst-c32-state \
152 tst-fgetwc-after-eof \
153 tst-mbrtowc \
154 tst-mbrtowc2 \
155 tst-mbsrtowcs \
156 tst-mbstowcs \
157 tst-wchar-h \
158 tst-wcpncpy \
159 tst-wcrtomb \
160 tst-wcslcat \
161 tst-wcslcpy \
162 tst-wcsnlen \
163 tst-wcstod-nan-locale \
164 tst-wcstod-nan-sign \
165 tst-wcstod-round \
166 tst-wcstof \
167 tst-wcstol-binary-c11 \
168 tst-wcstol-binary-c2x \
169 tst-wcstol-binary-gnu11 \
170 tst-wcstol-binary-gnu2x \
171 tst-wcstol-locale \
172 tst-wprintf-binary \
173 tst-wprintf-intn \
174 tst-wscanf-binary-c11 \
175 tst-wscanf-binary-c2x \
176 tst-wscanf-binary-gnu11 \
177 tst-wscanf-binary-gnu89 \
178 wcsatcliff \
179 wcsmbs-tst1 \
180 # tests
182 include ../Rules
184 ifeq ($(run-built-tests),yes)
185 LOCALES := \
186 de_DE.ISO-8859-1 \
187 de_DE.UTF-8 \
188 en_US.ANSI_X3.4-1968 \
189 hr_HR.ISO-8859-2 \
190 ja_JP.EUC-JP \
191 tr_TR.ISO-8859-9 \
192 tr_TR.UTF-8 \
193 zh_HK.BIG5-HKSCS \
194 zh_TW.EUC-TW \
195 # LOCALES
196 include ../gen-locales.mk
198 $(objpfx)tst-btowc.out: $(gen-locales)
199 $(objpfx)tst-c16c32-1.out: $(gen-locales)
200 $(objpfx)tst-mbrtowc.out: $(gen-locales)
201 $(objpfx)tst-mbrtowc2.out: $(gen-locales)
202 $(objpfx)tst-wcrtomb.out: $(gen-locales)
203 $(objpfx)wcsmbs-tst1.out: $(gen-locales)
204 $(objpfx)tst-wcstol-locale.out: $(gen-locales)
205 $(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
206 $(objpfx)tst-c16-surrogate.out: $(gen-locales)
207 $(objpfx)tst-c32-state.out: $(gen-locales)
208 $(objpfx)test-c8rtomb.out: $(gen-locales)
209 $(objpfx)test-mbrtoc8.out: $(gen-locales)
210 endif
212 $(objpfx)tst-wcstod-round: $(libm)
214 CFLAGS-wcwidth.c += -I../wctype
215 CFLAGS-wcswidth.c += -I../wctype
217 strtox-CFLAGS = -I../include
218 CFLAGS-wcstol.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
219 CFLAGS-wcstoul.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
220 CFLAGS-wcstoll.c += $(strtox-CFLAGS)
221 CFLAGS-wcstoull.c += $(strtox-CFLAGS)
222 CFLAGS-wcstod.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
223 CFLAGS-wcstold.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
224 CFLAGS-wcstof128.c += $(strtox-CFLAGS)
225 CFLAGS-wcstof.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
226 CFLAGS-wcstol_l.c += $(strtox-CFLAGS)
227 CFLAGS-wcstoul_l.c += $(strtox-CFLAGS)
228 CFLAGS-wcstoll_l.c += $(strtox-CFLAGS)
229 CFLAGS-wcstoull_l.c += $(strtox-CFLAGS)
230 CFLAGS-wcstod_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
231 CFLAGS-wcstold_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
232 CFLAGS-wcstof128_l.c += $(strtox-CFLAGS)
233 CFLAGS-wcstof_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
234 CPPFLAGS-tst-wchar-h.c += -D_FORTIFY_SOURCE=2
236 CFLAGS-wcschr.c += $(config-cflags-wno-ignored-attributes)
237 CFLAGS-wmemchr.c += $(config-cflags-wno-ignored-attributes)
238 CFLAGS-wmemset.c += $(config-cflags-wno-ignored-attributes)
239 CFLAGS-mbrtowc.c += $(config-cflags-wno-ignored-attributes)
240 CFLAGS-wcrtomb.c += $(config-cflags-wno-ignored-attributes)
241 CFLAGS-wcstoll.c += $(config-cflags-wno-ignored-attributes)
242 CFLAGS-wcstoull.c += $(config-cflags-wno-ignored-attributes)
244 CFLAGS-isoc99_wscanf.c += -fexceptions
245 CFLAGS-isoc99_fwscanf.c += -fexceptions
246 CFLAGS-isoc99_vwscanf.c += -fexceptions
247 CFLAGS-isoc99_vfwscanf.c += -fexceptions
248 CFLAGS-isoc23_wscanf.c += -fexceptions
249 CFLAGS-isoc23_fwscanf.c += -fexceptions
250 CFLAGS-isoc23_vwscanf.c += -fexceptions
251 CFLAGS-isoc23_vfwscanf.c += -fexceptions
253 CPPFLAGS += $(libio-mtsafe)
255 # We need to find the default version of strtold_l in stdlib.
256 CPPFLAGS-wcstold_l.c += -I../stdlib
258 $(objpfx)tst-wcstod-nan-locale: $(libm)
259 $(objpfx)tst-wcstod-nan-sign: $(libm)
261 # Some versions of GCC supported for building glibc do not support -std=c2x
262 # or -std=gnu2x, so the tests for those versions use -std=c11 and -std=gnu11
263 # and then _ISOC2X_SOURCE is defined in the test as needed.
264 CFLAGS-tst-wcstol-binary-c11.c += -std=c11
265 CFLAGS-tst-wcstol-binary-c2x.c += -std=c11
266 CFLAGS-tst-wcstol-binary-gnu11.c += -std=gnu11
267 CFLAGS-tst-wcstol-binary-gnu2x.c += -std=gnu11
268 CFLAGS-tst-wscanf-binary-c11.c += -std=c11 -DOBJPFX=\"$(objpfx)\"
269 CFLAGS-tst-wscanf-binary-c2x.c += -std=c11 -DOBJPFX=\"$(objpfx)\"
270 CFLAGS-tst-wscanf-binary-gnu11.c += -std=gnu11 -DOBJPFX=\"$(objpfx)\"
271 CFLAGS-tst-wscanf-binary-gnu89.c += -std=gnu89 -DOBJPFX=\"$(objpfx)\"