1#
2# SPDX-License-Identifier: BSD-3-Clause
3#
4# Copyright © 2019 Keith Packard
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9#
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12#
13# 2. Redistributions in binary form must reproduce the above
14#    copyright notice, this list of conditions and the following
15#    disclaimer in the documentation and/or other materials provided
16#    with the distribution.
17#
18# 3. Neither the name of the copyright holder nor the names of its
19#    contributors may be used to endorse or promote products derived
20#    from this software without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33# OF THE POSSIBILITY OF SUCH DAMAGE.
34#
35srcs_ctype = [
36    'categories.c',
37    'ctype_.c',
38    'isalnum.c',
39    'isalnum_l.c',
40    'isalpha.c',
41    'isalpha_l.c',
42    'isascii.c',
43    'isascii_l.c',
44    'isblank.c',
45    'isblank_l.c',
46    'iscntrl.c',
47    'iscntrl_l.c',
48    'isdigit.c',
49    'isdigit_l.c',
50    'isgraph.c',
51    'isgraph_l.c',
52    'islower.c',
53    'islower_l.c',
54    'isprint.c',
55    'isprint_l.c',
56    'ispunct.c',
57    'ispunct_l.c',
58    'isspace.c',
59    'isspace_l.c',
60    'isupper.c',
61    'isupper_l.c',
62    'iswalnum.c',
63    'iswalnum_l.c',
64    'iswalpha.c',
65    'iswalpha_l.c',
66    'iswblank.c',
67    'iswblank_l.c',
68    'iswcntrl.c',
69    'iswcntrl_l.c',
70    'iswctype.c',
71    'iswctype_l.c',
72    'iswdigit.c',
73    'iswdigit_l.c',
74    'iswgraph.c',
75    'iswgraph_l.c',
76    'iswlower.c',
77    'iswlower_l.c',
78    'iswprint.c',
79    'iswprint_l.c',
80    'iswpunct.c',
81    'iswpunct_l.c',
82    'iswspace.c',
83    'iswspace_l.c',
84    'iswupper.c',
85    'iswupper_l.c',
86    'iswxdigit.c',
87    'iswxdigit_l.c',
88    'isxdigit.c',
89    'isxdigit_l.c',
90    'jp2uc.c',
91    'toascii.c',
92    'toascii_l.c',
93    'tolower.c',
94    'tolower_l.c',
95    'toupper.c',
96    'toupper_l.c',
97    'towctrans.c',
98    'towctrans_l.c',
99    'towlower.c',
100    'towlower_l.c',
101    'towupper.c',
102    'towupper_l.c',
103    'wctrans.c',
104    'wctrans_l.c',
105    'wctype.c',
106    'wctype_l.c',
107]
108hdrs_ctype = [
109    'categories.h',
110    'ctype_cp.h',
111    'ctype_.h',
112    'ctype_iso.h',
113    'jp2uc.h',
114    'local.h',
115]
116
117srcs_ctype_use = []
118foreach file : srcs_ctype
119  s_file = fs.replace_suffix(file, '.S')
120  if file in srcs_machine
121    message('libc/ctype/' + file + ': machine overrides generic')
122  elif s_file in srcs_machine
123    message('libc/ctype/' + s_file + ': machine overrides generic')
124  else
125    srcs_ctype_use += file
126  endif
127endforeach
128
129src_ctype = files(srcs_ctype_use)
130