1#
2# SPDX-License-Identifier: BSD-3-Clause
3#
4# Copyright © 2022 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#
35picolibc_sources(
36  asprintf.c
37  atold_engine.c
38  bufio.c
39  clearerr.c
40  dtox_engine.c
41  ecvt.c
42  ecvtf.c
43  ecvtf_r.c
44  ecvtl.c
45  ecvtl_r.c
46  ecvt_r.c
47  fclose.c
48  fcvt.c
49  fcvtf.c
50  fcvtf_r.c
51  fcvtl.c
52  fcvtl_r.c
53  fcvt_r.c
54  fdevopen.c
55  feof.c
56  ferror.c
57  fflush.c
58  fgetc.c
59  fgets.c
60  fgetwc.c
61  fgetws.c
62  fileno.c
63  filestrget.c
64  filestrputalloc.c
65  filestrput.c
66  filewstrget.c
67  fmemopen.c
68  fprintf.c
69  fputc.c
70  fputs.c
71  fputwc.c
72  fputws.c
73  fread.c
74  fscanf.c
75  fseek.c
76  fseeko.c
77  ftell.c
78  ftello.c
79  ftox_engine.c
80  fwide.c
81  fwprintf.c
82  fwrite.c
83  fwscanf.c
84  gcvt.c
85  gcvtf.c
86  gcvtl.c
87  getchar.c
88  getdelim.c
89  getline.c
90  gets.c
91  getwchar.c
92  ldtoa_engine.c
93  ldtox_engine.c
94  matchcaseprefix.c
95  mktemp.c
96  perror.c
97  printf.c
98  putchar.c
99  puts.c
100  putwchar.c
101  remove.c
102  rewind.c
103  scanf.c
104  setbuf.c
105  setbuffer.c
106  setlinebuf.c
107  setvbuf.c
108  sflags.c
109  snprintf.c
110  snprintfd.c
111  snprintff.c
112  sprintf.c
113  sprintfd.c
114  sprintff.c
115  sscanf.c
116  strfromd.c
117  strfromf.c
118  strfroml.c
119  strtod.c
120  strtod_l.c
121  strtof.c
122  strtof_l.c
123  strtoimax.c
124  strtol.c
125  strtold.c
126  strtold_l.c
127  strtol_l.c
128  strtoll.c
129  strtoll_l.c
130  strtoul.c
131  strtoul_l.c
132  strtoull.c
133  strtoull_l.c
134  strtoumax.c
135  swprintf.c
136  swscanf.c
137  tmpfile.c
138  tmpnam.c
139  ungetc.c
140  ungetwc.c
141  vasprintf.c
142  vffprintf.c
143  vffscanf.c
144  vfiprintf.c
145  vfiscanf.c
146  vflprintf.c
147  vflscanf.c
148  vfmprintf.c
149  vfmscanf.c
150  vfprintf.c
151  vfscanf.c
152  vfwprintf.c
153  vfwscanf.c
154  vprintf.c
155  vscanf.c
156  vsnprintf.c
157  vsprintf.c
158  vsscanf.c
159  vswprintf.c
160  vswscanf.c
161  vwprintf.c
162  vwscanf.c
163  wprintf.c
164  wscanf.c
165  )
166
167picolibc_sources(
168  compare_exchange.c
169  exchange.c
170  )
171
172picolibc_sources(
173  fdopen.c
174  fopen.c
175  freopen.c
176  )
177
178if(_IO_FLOAT_EXACT)
179  picolibc_sources(
180    atod_ryu.c
181    atof_ryu.c
182    dtoa_ryu.c
183    ftoa_ryu.c
184    ryu_divpow2.c
185    ryu_log10.c
186    ryu_log2pow5.c
187    ryu_pow5bits.c
188    ryu_table.c
189    ryu_umul128.c
190    )
191else()
192  picolibc_sources(
193    atod_engine.c
194    atof_engine.c
195    dtoa_engine.c
196    ftoa_engine.c
197    )
198endif()
199
200if(POSIX_CONSOLE)
201  picolibc_sources(
202    posixiob_stdin.c
203    posixiob_stdout.c
204    posixiob_stderr.c
205    )
206endif()
207
208picolibc_headers(""
209  stdio.h
210  stdio-bufio.h
211  )
212