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.
25 headers
:= wchar.h bits
/wchar.h bits
/wchar2.h bits
/wchar2-decl.h \
26 bits
/wchar-ldbl.h uchar.h bits
/types
/__mbstate_t.h \
27 bits
/types
/mbstate_t.h bits
/types
/wint_t.h
29 routines
:= wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
30 wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
31 wmemcmp wmemcpy wmemmove wmemset wcpcpy wcpncpy wmempcpy \
33 mbrlen mbrtowc wcrtomb mbsrtowcs wcsrtombs \
34 mbsnrtowcs wcsnrtombs wcsnlen wcschrnul \
35 wcstol wcstoul wcstoll wcstoull wcstod wcstold wcstof \
36 wcstol_l wcstoul_l wcstoll_l wcstoull_l \
37 wcstod_l wcstold_l wcstof_l \
38 wcstod_nan wcstold_nan wcstof_nan \
42 wcscasecmp wcsncase wcscasecmp_l wcsncase_l \
43 wcsmbsload mbsrtowcs_l \
44 isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf \
45 isoc99_swscanf isoc99_vswscanf \
46 isoc23_wscanf isoc23_vwscanf isoc23_fwscanf isoc23_vfwscanf \
47 isoc23_swscanf isoc23_vswscanf \
48 mbrtoc8 c8rtomb mbrtoc16 c16rtomb mbrtoc32 c32rtomb
50 strop-tests
:= wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \
51 wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk \
52 wcscspn wmemchr wmemset
53 tests
:= tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
54 tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \
55 tst-c16c32-1 wcsatcliff tst-wcstol-locale tst-wcstod-nan-locale \
56 tst-wcstod-round test-char-types tst-fgetwc-after-eof \
57 tst-wcstod-nan-sign tst-c16-surrogate tst-c32-state \
58 test-mbrtoc8 test-c8rtomb \
59 $(addprefix test-
,$(strop-tests
)) tst-mbstowcs \
61 tst-wcstol-binary-c11 \
62 tst-wcstol-binary-c2x \
63 tst-wcstol-binary-gnu11 \
64 tst-wcstol-binary-gnu2x \
65 tst-wscanf-binary-c11 \
66 tst-wscanf-binary-c2x \
67 tst-wscanf-binary-gnu11 \
68 tst-wscanf-binary-gnu89
72 ifeq ($(run-built-tests
),yes
)
73 LOCALES
:= de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4
-1968 hr_HR.ISO-8859-2 \
74 ja_JP.EUC-JP zh_TW.EUC-TW tr_TR.UTF-8 tr_TR.ISO-8859-9 zh_HK.BIG5-HKSCS
75 include ..
/gen-locales.mk
77 $(objpfx
)tst-btowc.out
: $(gen-locales
)
78 $(objpfx
)tst-c16c32-1.out
: $(gen-locales
)
79 $(objpfx
)tst-mbrtowc.out
: $(gen-locales
)
80 $(objpfx
)tst-mbrtowc2.out
: $(gen-locales
)
81 $(objpfx
)tst-wcrtomb.out
: $(gen-locales
)
82 $(objpfx
)wcsmbs-tst1.out
: $(gen-locales
)
83 $(objpfx
)tst-wcstol-locale.out
: $(gen-locales
)
84 $(objpfx
)tst-wcstod-nan-locale.out
: $(gen-locales
)
85 $(objpfx
)tst-c16-surrogate.out
: $(gen-locales
)
86 $(objpfx
)tst-c32-state.out
: $(gen-locales
)
87 $(objpfx
)test-c8rtomb.out
: $(gen-locales
)
88 $(objpfx
)test-mbrtoc8.out
: $(gen-locales
)
91 $(objpfx
)tst-wcstod-round
: $(libm
)
93 CFLAGS-wcwidth.c
+= -I..
/wctype
94 CFLAGS-wcswidth.c
+= -I..
/wctype
96 strtox-CFLAGS
= -I..
/include
97 CFLAGS-wcstol.c
+= $(strtox-CFLAGS
) $(config-cflags-wno-ignored-attributes
)
98 CFLAGS-wcstoul.c
+= $(strtox-CFLAGS
) $(config-cflags-wno-ignored-attributes
)
99 CFLAGS-wcstoll.c
+= $(strtox-CFLAGS
)
100 CFLAGS-wcstoull.c
+= $(strtox-CFLAGS
)
101 CFLAGS-wcstod.c
+= $(strtox-CFLAGS
) $(config-cflags-wno-ignored-attributes
)
102 CFLAGS-wcstold.c
+= $(strtox-CFLAGS
) $(config-cflags-wno-ignored-attributes
)
103 CFLAGS-wcstof128.c
+= $(strtox-CFLAGS
)
104 CFLAGS-wcstof.c
+= $(strtox-CFLAGS
) $(config-cflags-wno-ignored-attributes
)
105 CFLAGS-wcstol_l.c
+= $(strtox-CFLAGS
)
106 CFLAGS-wcstoul_l.c
+= $(strtox-CFLAGS
)
107 CFLAGS-wcstoll_l.c
+= $(strtox-CFLAGS
)
108 CFLAGS-wcstoull_l.c
+= $(strtox-CFLAGS
)
109 CFLAGS-wcstod_l.c
+= $(strtox-CFLAGS
) $(config-cflags-wno-ignored-attributes
)
110 CFLAGS-wcstold_l.c
+= $(strtox-CFLAGS
) $(config-cflags-wno-ignored-attributes
)
111 CFLAGS-wcstof128_l.c
+= $(strtox-CFLAGS
)
112 CFLAGS-wcstof_l.c
+= $(strtox-CFLAGS
) $(config-cflags-wno-ignored-attributes
)
113 CPPFLAGS-tst-wchar-h.c
+= -D_FORTIFY_SOURCE
=2
115 CFLAGS-wcschr.c
+= $(config-cflags-wno-ignored-attributes
)
116 CFLAGS-wmemchr.c
+= $(config-cflags-wno-ignored-attributes
)
117 CFLAGS-wmemset.c
+= $(config-cflags-wno-ignored-attributes
)
118 CFLAGS-mbrtowc.c
+= $(config-cflags-wno-ignored-attributes
)
119 CFLAGS-wcrtomb.c
+= $(config-cflags-wno-ignored-attributes
)
120 CFLAGS-wcstoll.c
+= $(config-cflags-wno-ignored-attributes
)
121 CFLAGS-wcstoull.c
+= $(config-cflags-wno-ignored-attributes
)
123 CFLAGS-isoc99_wscanf.c
+= -fexceptions
124 CFLAGS-isoc99_fwscanf.c
+= -fexceptions
125 CFLAGS-isoc99_vwscanf.c
+= -fexceptions
126 CFLAGS-isoc99_vfwscanf.c
+= -fexceptions
127 CFLAGS-isoc23_wscanf.c
+= -fexceptions
128 CFLAGS-isoc23_fwscanf.c
+= -fexceptions
129 CFLAGS-isoc23_vwscanf.c
+= -fexceptions
130 CFLAGS-isoc23_vfwscanf.c
+= -fexceptions
132 CPPFLAGS
+= $(libio-mtsafe
)
134 # We need to find the default version of strtold_l in stdlib.
135 CPPFLAGS-wcstold_l.c
+= -I..
/stdlib
137 $(objpfx
)tst-wcstod-nan-locale
: $(libm
)
138 $(objpfx
)tst-wcstod-nan-sign
: $(libm
)
140 # Some versions of GCC supported for building glibc do not support -std=c2x
141 # or -std=gnu2x, so the tests for those versions use -std=c11 and -std=gnu11
142 # and then _ISOC2X_SOURCE is defined in the test as needed.
143 CFLAGS-tst-wcstol-binary-c11.c
+= -std
=c11
144 CFLAGS-tst-wcstol-binary-c2x.c
+= -std
=c11
145 CFLAGS-tst-wcstol-binary-gnu11.c
+= -std
=gnu11
146 CFLAGS-tst-wcstol-binary-gnu2x.c
+= -std
=gnu11
147 CFLAGS-tst-wscanf-binary-c11.c
+= -std
=c11
-DOBJPFX
=\"$(objpfx
)\"
148 CFLAGS-tst-wscanf-binary-c2x.c
+= -std
=c11
-DOBJPFX
=\"$(objpfx
)\"
149 CFLAGS-tst-wscanf-binary-gnu11.c
+= -std
=gnu11
-DOBJPFX
=\"$(objpfx
)\"
150 CFLAGS-tst-wscanf-binary-gnu89.c
+= -std
=gnu89
-DOBJPFX
=\"$(objpfx
)\"