mescc: Mes C Library: Support GNU Awk: Implement atof.
[mes.git] / build-aux / configure-lib.sh
1 #! /bin/sh
2
3 # GNU Mes --- Maxwell Equations of Software
4 # Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 #
6 # This file is part of GNU Mes.
7 #
8 # GNU Mes is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
12 #
13 # GNU Mes is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
20
21 set -e
22 set -u
23
24 V=${V-1}
25
26 if [ "$V" = 2 ]; then
27     set -x
28 fi
29
30 . ./config.sh
31
32 libc_mini_shared_SOURCES="
33 lib/mes/eputs.c
34 lib/mes/oputs.c
35 "
36
37 if test $mes_libc = mes; then
38     libc_mini_shared_SOURCES="$libc_mini_shared_SOURCES
39 lib/$mes_kernel/$mes_cpu-mes-$compiler/mini.c
40 lib/stdlib/exit.c
41 lib/stdlib/puts.c
42 lib/string/strlen.c
43 "
44 fi
45
46 libc_mini_SOURCES="$libc_mini_shared_SOURCES"
47
48 if test $mes_libc = mes; then
49     libc_mini_SOURCES="$libc_mini_SOURCES
50 lib/mes/write.c
51 "
52 fi
53
54 libmes_SOURCES="
55 $libc_mini_shared_SOURCES
56 lib/ctype/isnumber.c
57 lib/mes/abtol.c
58 lib/mes/div.c
59 lib/mes/eputc.c
60 lib/mes/fdgetc.c
61 lib/mes/fdputc.c
62 lib/mes/fdputs.c
63 lib/mes/fdungetc.c
64 lib/mes/itoa.c
65 lib/mes/ltoa.c
66 lib/mes/ltoab.c
67 lib/mes/mes_open.c
68 lib/mes/ntoab.c
69 lib/mes/oputc.c
70 lib/mes/ultoa.c
71 lib/mes/utoa.c
72 "
73
74 if test $mes_libc = mes; then
75     libmes_SOURCES="$libmes_SOURCES
76 lib/ctype/isdigit.c
77 lib/ctype/isspace.c
78 lib/ctype/isxdigit.c
79 lib/posix/write.c
80 lib/stdlib/atoi.c
81 "
82     if test $mes_kernel = linux; then
83         libmes_SOURCES="$libmes_SOURCES
84 lib/linux/lseek.c
85 "
86     fi
87 else
88     libmes_SOURCES="$libmes_SOURCES
89 lib/mes/abtod.c
90 lib/mes/dtoab.c
91 "
92 fi
93
94 libc_SOURCES="
95 $libmes_SOURCES
96 lib/mes/__assert_fail.c
97 lib/mes/__buffered_read.c
98 lib/mes/__mes_debug.c
99 lib/posix/execv.c
100 lib/posix/getcwd.c
101 lib/posix/getenv.c
102 lib/posix/isatty.c
103 lib/posix/open.c
104 lib/posix/read.c
105 lib/posix/setenv.c
106 lib/posix/wait.c
107 lib/stdio/fgetc.c
108 lib/stdio/fputc.c
109 lib/stdio/fputs.c
110 lib/stdio/getc.c
111 lib/stdio/getchar.c
112 lib/stdio/putc.c
113 lib/stdio/putchar.c
114 lib/stdio/ungetc.c
115 lib/stdlib/free.c
116 lib/stdlib/malloc.c
117 lib/stdlib/realloc.c
118 lib/string/memchr.c
119 lib/string/memcmp.c
120 lib/string/memcpy.c
121 lib/string/memmove.c
122 lib/string/memset.c
123 lib/string/strcmp.c
124 lib/string/strcpy.c
125 lib/string/strncmp.c
126 "
127
128 if test $mes_kernel = linux; then
129     libc_SOURCES="$libc_SOURCES
130 lib/linux/access.c
131 lib/linux/brk.c
132 lib/linux/chmod.c
133 lib/linux/clock_gettime.c
134 lib/linux/dup.c
135 lib/linux/dup2.c
136 lib/linux/execve.c
137 lib/linux/fork.c
138 lib/linux/fsync.c
139 lib/linux/_getcwd.c
140 lib/linux/gettimeofday.c
141 lib/linux/ioctl.c
142 lib/linux/_open3.c
143 lib/linux/_read.c
144 lib/linux/time.c
145 lib/linux/unlink.c
146 lib/linux/waitpid.c
147 lib/linux/$mes_cpu-mes-$compiler/syscall.c
148 "
149 fi
150
151 libtcc1_SOURCES="
152 lib/libtcc1.c
153 "
154
155 libc_tcc_SOURCES="
156 $libc_SOURCES
157 lib/ctype/islower.c
158 lib/ctype/isupper.c
159 lib/ctype/tolower.c
160 lib/ctype/toupper.c
161 lib/mes/abtod.c
162 lib/mes/dtoab.c
163 lib/mes/search-path.c
164 lib/posix/execvp.c
165 lib/stdio/fclose.c
166 lib/stdio/fdopen.c
167 lib/stdio/ferror.c
168 lib/stdio/fflush.c
169 lib/stdio/fopen.c
170 lib/stdio/fprintf.c
171 lib/stdio/fread.c
172 lib/stdio/fseek.c
173 lib/stdio/ftell.c
174 lib/stdio/fwrite.c
175 lib/stdio/printf.c
176 lib/stdio/remove.c
177 lib/stdio/snprintf.c
178 lib/stdio/sprintf.c
179 lib/stdio/sscanf.c
180 lib/stdio/vfprintf.c
181 lib/stdio/vprintf.c
182 lib/stdio/vsnprintf.c
183 lib/stdio/vsprintf.c
184 lib/stdio/vsscanf.c
185 lib/stdlib/calloc.c
186 lib/stdlib/qsort.c
187 lib/stdlib/strtod.c
188 lib/stdlib/strtof.c
189 lib/stdlib/strtol.c
190 lib/stdlib/strtold.c
191 lib/stdlib/strtoll.c
192 lib/stdlib/strtoul.c
193 lib/stdlib/strtoull.c
194 lib/string/memmem.c
195 lib/string/strcat.c
196 lib/string/strchr.c
197 lib/string/strlwr.c
198 lib/string/strncpy.c
199 lib/string/strrchr.c
200 lib/string/strstr.c
201 lib/string/strupr.c
202 lib/stub/sigaction.c
203 lib/stub/ldexp.c
204 lib/stub/mprotect.c
205 lib/stub/localtime.c
206 lib/stub/sigemptyset.c
207 lib/$mes_cpu-mes-$compiler/setjmp.c
208 "
209
210 if test $mes_kernel = linux; then
211     libc_tcc_SOURCES="$libc_tcc_SOURCES
212 lib/linux/close.c
213 lib/linux/rmdir.c
214 lib/linux/stat.c
215 "
216 fi
217
218 libc_gnu_SOURCES="
219 $libc_tcc_SOURCES
220 lib/ctype/isalnum.c
221 lib/ctype/isalpha.c
222 lib/ctype/isascii.c
223 lib/ctype/iscntrl.c
224 lib/ctype/isgraph.c
225 lib/ctype/isprint.c
226 lib/ctype/ispunct.c
227 lib/dirent/__getdirentries.c
228 lib/dirent/closedir.c
229 lib/dirent/opendir.c
230 lib/dirent/readdir.c
231 lib/math/fabs.c
232 lib/mes/fdgets.c
233 lib/posix/alarm.c
234 lib/posix/execl.c
235 lib/posix/execlp.c
236 lib/posix/mktemp.c
237 lib/posix/raise.c
238 lib/posix/sbrk.c
239 lib/posix/sleep.c
240 lib/posix/unsetenv.c
241 lib/stdio/clearerr.c
242 lib/stdio/feof.c
243 lib/stdio/fgets.c
244 lib/stdio/fileno.c
245 lib/stdio/freopen.c
246 lib/stdio/perror.c
247 lib/stdlib/__exit.c
248 lib/stdlib/abort.c
249 lib/stdlib/abs.c
250 lib/stdlib/alloca.c
251 lib/stdlib/atexit.c
252 lib/stdlib/atof.c
253 lib/stdlib/atol.c
254 lib/stdlib/mbstowcs.c
255 lib/string/bcmp.c
256 lib/string/bcopy.c
257 lib/string/bzero.c
258 lib/string/index.c
259 lib/string/rindex.c
260 lib/string/strcspn.c
261 lib/string/strdup.c
262 lib/string/strerror.c
263 lib/string/strncat.c
264 lib/string/strpbrk.c
265 lib/string/strspn.c
266 lib/stub/__cleanup.c
267 lib/stub/bsearch.c
268 lib/stub/chown.c
269 lib/stub/ctime.c
270 lib/stub/fpurge.c
271 lib/stub/freadahead.c
272 lib/stub/frexp.c
273 lib/stub/fscanf.c
274 lib/stub/getlogin.c
275 lib/stub/getpwnam.c
276 lib/stub/getpwuid.c
277 lib/stub/gmtime.c
278 lib/stub/pclose.c
279 lib/stub/popen.c
280 lib/stub/rand.c
281 lib/stub/rewind.c
282 lib/stub/setbuf.c
283 lib/stub/setlocale.c
284 lib/stub/setvbuf.c
285 lib/stub/sigaddset.c
286 lib/stub/sigblock.c
287 lib/stub/sigdelset.c
288 lib/stub/sigsetmask.c
289 lib/stub/strftime.c
290 lib/stub/sys_siglist.c
291 lib/stub/system.c
292 lib/stub/times.c
293 lib/stub/ttyname.c
294 lib/stub/umask.c
295 lib/stub/utime.c
296 "
297
298 if test $mes_kernel = linux; then
299     libc_gnu_SOURCES="$libc_gnu_SOURCES
300 lib/linux/chdir.c
301 lib/linux/fcntl.c
302 lib/linux/fstat.c
303 lib/linux/getdents.c
304 lib/linux/getegid.c
305 lib/linux/geteuid.c
306 lib/linux/getgid.c
307 lib/linux/getpid.c
308 lib/linux/getppid.c
309 lib/linux/getrusage.c
310 lib/linux/getuid.c
311 lib/linux/kill.c
312 lib/linux/link.c
313 lib/linux/lstat.c
314 lib/linux/mkdir.c
315 lib/linux/nanosleep.c
316 lib/linux/pipe.c
317 lib/linux/readlink.c
318 lib/linux/rename.c
319 lib/linux/setgid.c
320 lib/linux/settimer.c
321 lib/linux/setuid.c
322 lib/linux/signal.c
323 lib/linux/sigprogmask.c
324 lib/linux/symlink.c
325 "
326 fi
327
328 mes_SOURCES="
329 src/gc.c
330 src/hash.c
331 src/lib.c
332 src/math.c
333 src/mes.c
334 src/module.c
335 src/posix.c
336 src/reader.c
337 src/string.c
338 src/struct.c
339 src/vector.c
340 "