Commit graph

12 commits

Author SHA1 Message Date
Jan Nieuwenhuizen 18195b4d05
mescc: Mes C Library: Fix compile warnings.
* include/stdlib.h (abort): Add prototype.
2019-06-12 15:59:06 +02:00
Jan Nieuwenhuizen 5dc245e739
build: Simplify.
core: Make mes src/ c files separate compilation units.

* include/mes/constants.h: New file.
* include/mes/macros.h: New file.
* include/mes/mes.h: New file.
* src/gc.c: Update.
* src/hash.c: Update.
* src/lib.c: Update.
* src/math.c: Update.
* src/mes.c: Update.
* src/module.c: Update.
* src/posix.c: Update.
* src/reader.c: Update.
* src/string.c: Update.
* src/struct.c: Update.
* src/vector.c: Update.

    mes: Update datadir.

* src/mes.c (g_datadir): New global.
(open_boot): Rename from read_boot.
(read_boot): New function.
* mes/module/mes/boot-0.scm: Move from boot-0.scm.in
* configure: Update.
* configure.sh: Update.

    mescc: Create libraries from separate files.

* .gitignore: Update.
* build-aux/bootstrap-mes.sh: Remove.
* build-aux/bootstrap.sh.in: Remove.
* build-aux/build-guile.sh: Update.
* build-aux/build-mes.sh: Update.
* build-aux/build-scaffold.sh: New file.
* build-aux/build.sh.in: Update.
* build-aux/cc.sh: Update.
* build-aux/check-tcc.sh: Remove.
* build-aux/config.sh.in: New file.
* build-aux/config.sh: Remove.
* build-aux/install.sh.in: Update.
* build-aux/test-boot.sh: New file.
* build-aux/test-c.sh: New file.
* build-aux/test-driver: New file.
* build-aux/test-suite.sh: New file.
* build-aux/trace.sh: Update.
* build-aux/uninstall.sh.in: Update.
* configure: Update.
* configure.sh: Update.
* lib/linux/x86-mes-mescc/crt1.c: Move from lib/linux/x86-mes.
* lib/linux/x86-mes-mescc/mini.c: Likewise.
* lib/linux/x86_64-mes-mescc/crt1.c: Move from lib/linux/x86_64-mes.
* lib/linux/x86_64-mes-mescc/mini.c: Likewise.
* lib/linux/x86-mes-gcc/syscall.c: Rename from mes.c.
* lib/linux/x86-mes-mescc/syscall.c: Likewise.
* lib/linux/x86_64-mes-gcc/syscall.c: Likewise.
* lib/linux/x86_64-mes-mescc/syscall.c: Likewise.
* lib/mes/mes_open.c: Include config.h.
* lib/tests/stdio/70-printf-hello.c: Likewise.
* lib/tests/stdio/70-printf-simple.c: Likewise.
* scaffold/gc-test.sh: New file.
* simple.sh: Update.
2019-06-08 15:36:22 +02:00
Jan Nieuwenhuizen eff35b8a54
mescc: Mes C Library: Fix compile warnings.
* lib/stdio/fputc.c (fputc): Oops, stream is a long.
* lib/stdlib/malloc.c (malloc): Cast to char *. FIXME
* lib/string/memchr.c (memchr): Cast to void *.
* lib/string/memcmp.c (memcmp): Add const cast.
2019-05-26 13:41:00 +02:00
Jan Nieuwenhuizen c33d6d00bc
mes: Run build-aux/indent.sh.
* src/mes.c: Re-indent.
* src: Likewise.
* include: Likewise.
* lib: Likewise.
* scaffold: Likewise.
2019-05-18 13:27:42 +02:00
Jan Nieuwenhuizen 3ed82d7010
mescc: Mes C Library: Cleanup includes.
* include/mes/lib-mini.h: Move from include/libmes-mini.h.  Update users.
* include/mes/lib.h: Move from include/libmes.h.  Update users.
2019-05-08 00:25:41 +02:00
Jan Nieuwenhuizen 9ecc11ee52
mescc: Support GNU Bash.
* include/errno.h (EACCES, ENOSPC, ESPIPE): New macro.
* include/linux/x86/syscall.h (SYS_setuid, SYS_geteuid, SYS_getegid,
SYS_setgid): New macro.
* include/linux/x86_64/syscall.h: Likewise.
* include/stdint.h (LLONG_MIN, LLONG_MAX, SIZE_MAX): New macro.
* include/sys/stat.h (S_ISUID, S_ISGID, S_IXGRP, S_IXOTH, S_IRGRP,
S_IROTH, S_IWGRP, S_IWOTH, S_IRWXG, S_IRWXO): New macro.
* include/termio.h: New file.
* include/unistd.h (_POSIX_VERSION): New macro.
* lib/linux/gnu.c (geteuid, getegid, setuid, setgid): New function.
* lib/string/memchr.c: New file.
* lib/stub/getpwuid.c: New file.
* lib/stub/rand.c: New file.
* lib/stub/ttyname.c: New file.
* include/string.h (memchr): Declare.
* include/unistd.h (geteuid, getegid, setuid, setgid): Declare.
2018-11-09 21:26:10 +01:00
Jan Nieuwenhuizen 457d120770
mescc: Mes C Library: Explode libc+gnu.c.
* modified:   include/math.h: Add declarations.
* lib/posix/getopt.c: Rename from lib/getopt.c.
* lib/gcc.c: Remove.
* lib/m4.c: Remove.
* lib/ctype/isalnum.c: New file, explode from libc+gnu.c.
* lib/ctype/isalpha.c: Likewise.
* lib/ctype/isascii.c: Likewise.
* lib/ctype/iscntrl.c: Likewise.
* lib/ctype/isnumber.c: Likewise.
* lib/ctype/isprint.c: Likewise.
* lib/ctype/ispunct.c: Likewise.
* lib/math/fabs.c: Likewise.
* lib/posix/alarm.c: Likewise.
* lib/posix/mktemp.c: Likewise.
* lib/posix/raise.c: Likewise.
* lib/posix/sbrk.c: Likewise.
* lib/posix/sleep.c: Likewise.
* lib/posix/unsetenv.c: Likewise.
* lib/stdio/clearerr.c: Likewise.
* lib/stdio/fdgets.c: Likewise.
* lib/stdio/feof.c: Likewise.
* lib/stdio/fgets.c: Likewise.
* lib/stdio/fileno.c: Likewise.
* lib/stdio/freeopen.c: Likewise.
* lib/stdio/freopen.c: Likewise.
* lib/stdio/perror.c: Likewise.
* lib/stdlib/__exit.c: Likewise.
* lib/stdlib/abs.c: Likewise.
* lib/stdlib/atexit.c: Likewise.
* lib/stdlib/atol.c: Likewise.
* lib/stdlib/bsearch.c: Likewise.
* lib/stdlib/mbstowcs.c: Likewise.
* lib/string/bcmp.c: Likewise.
* lib/string/bcopy.c: Likewise.
* lib/string/bzero.c: Likewise.
* lib/string/index.c: Likewise.
* lib/string/rindex.c: Likewise.
* lib/string/strcspn.c: Likewise.
* lib/string/strdup.c: Likewise.
* lib/string/strerror.c: Likewise.
* lib/string/strncat.c: Likewise.
* lib/string/strpbrk.c: Likewise.
* lib/string/strspn.c: Likewise.
* lib/stub/__cleanup.c: Likewise.
* lib/stub/atof.c: Likewise.
* lib/stub/chown.c: Likewise.
* lib/stub/ctime.c: Likewise.
* lib/stub/fpurge.c: Likewise.
* lib/stub/freadahead.c: Likewise.
* lib/stub/frexp.c: Likewise.
* lib/stub/fscanf.c: Likewise.
* lib/stub/getpwnam.c: Likewise.
* lib/stub/gmtime.c: Likewise.
* lib/stub/pclose.c: Likewise.
* lib/stub/popen.c: Likewise.
* lib/stub/rewind.c: Likewise.
* lib/stub/setbuf.c: Likewise.
* lib/stub/sigsetmask.c: Likewise.
* lib/stub/strftime.c: Likewise.
* lib/stub/sys_siglist.c: Likewise.
* lib/stub/system.c: Likewise.
* lib/stub/times.c: Likewise.
* lib/stub/umask.c: Likewise.
* lib/stub/utime.c: Likewise.
* lib/libc+gnu.c: Include explodings.
* lib/libg.c: Likewise.
* lib/libgetopt.c: Include explodings.
2018-08-24 20:57:34 +02:00
Jan Nieuwenhuizen e9d9e80980
mescc: Mes C Library: Explode libc+tcc.c.
* include/libmes.h: Add declarations.
* include/string.h: Likewise.
* lib/ctype/islower.c: New file, explode from lib/libc+tcc.c.
* lib/ctype/isupper.c: Likewise.
* lib/ctype/tolower.c: Likewise.
* lib/ctype/toupper.c: Likewise.
* lib/mes/search-path.c: Likewise.
* lib/posix/execvp.c: Likewise.
* lib/stdio/fclose.c: Likewise.
* lib/stdio/fdopen.c: Likewise.
* lib/stdio/ferror.c: Likewise.
* lib/stdio/fflush.c: Likewise.
* lib/stdio/fopen.c: Likewise.
* lib/stdio/fprintf.c: Likewise.
* lib/stdio/fread.c: Likewise.
* lib/stdio/fseek.c: Likewise.
* lib/stdio/ftell.c: Likewise.
* lib/stdio/fwrite.c: Likewise.
* lib/stdio/printf.c: Likewise.
* lib/stdio/remove.c: Likewise.
* lib/stdio/snprintf.c: Likewise.
* lib/stdio/sprintf.c: Likewise.
* lib/stdio/sscanf.c: Likewise.
* lib/stdio/vfprintf.c: Likewise.
* lib/stdio/vprintf.c: Likewise.
* lib/stdio/vsnprintf.c: Likewise.
* lib/stdio/vsprintf.c: Likewise.
* lib/stdio/vsscanf.c: Likewise.
* lib/stdlib/calloc.c: Likewise.
* lib/stdlib/qsort.c: Likewise.
* lib/stdlib/strtof.c: Likewise.
* lib/stdlib/strtol.c: Likewise.
* lib/stdlib/strtold.c: Likewise.
* lib/stdlib/strtoll.c: Likewise.
* lib/stdlib/strtoul.c: Likewise.
* lib/stdlib/strtoull.c: Likewise.
* lib/string/memcmp.c: Likewise.
* lib/string/memmem.c: Likewise.
* lib/string/memmove.c: Likewise.
* lib/string/memset.c: Likewise.
* lib/string/strcat.c: Likewise.
* lib/string/strchr.c: Likewise.
* lib/string/strlwr.c: Likewise.
* lib/string/strncpy.c: Likewise.
* lib/string/strrchr.c: Likewise.
* lib/string/strstr.c: Likewise.
* lib/string/strupr.c: Likewise.
* lib/stub/gettimeofday.c: Likewise.
* lib/stub/ldexp.c: Likewise.
* lib/stub/localtime.c: Likewise.
* lib/stub/mprotect.c: Likewise.
* lib/stub/sigaction.c: Likewise.
* lib/stub/sigemptyset.c: Likewise.
* lib/stub/strtod.c: Likewise.
* lib/stub/time.c: Likewise.
* lib/libc+tcc.c: Include explodings.
2018-08-22 07:23:27 +02:00
Jan Nieuwenhuizen 38a7077b72
mescc: Mes C Library: Explode libc-mini.c.
* include/libmes.h: Add declarations.
* lib/mes/eputs.c: New file, explode from lib/libc-mini.c.
* lib/mes/oputs.c: Likewise.
* lib/stdlib/exit.c: Likewise.
* lib/stdlib/puts.c: Likewise.
* lib/string/strlen.c: Likewise.
* lib/libc-mini.c: Include explodings.
2018-08-16 11:07:33 +02:00
Jan Nieuwenhuizen 3e4a56a05b
mescc: Mes C Library: Explode libc.c.
* lib/libc.c: New file, explode from lib/libc.c.
* lib/posix/execv.c: Likewise.
* lib/posix/isatty.c: Likewise.
* lib/posix/wait.c: Likewise.
* lib/stdio/fgetc.c: Likewise.
* lib/stdio/fputc.c: Likewise.
* lib/stdio/fputs.c: Likewise.
* lib/stdio/getc.c: Likewise.
* lib/stdio/getchar.c: Likewise.
* lib/stdio/putc.c: Likewise.
* lib/stdio/putchar.c: Likewise.
* lib/stdio/ungetc.c: Likewise.
* lib/stdlib/free.c: Likewise.
* lib/stdlib/getenv.c: Likewise.
* lib/stdlib/realloc.c: Likewise.
* lib/stdlib/setenv.c: Likewise.
* lib/string/strcmp.c: Likewise.
* lib/string/strcpy.c: Likewise.
* lib/string/strncmp.c: Likewise.
* lib/libc.c: Include explodings.
2018-08-16 10:50:53 +02:00
Jan Nieuwenhuizen 72cb975213
GNU Mes.
Throughout, make these changes

   Copyright headers: GNU Mes
   First mention of name: GNU Mes
   Website: https://www.gnu.org/software/mes
   Git:     git://git.savannah.gnu.org/mes.git
2018-07-22 14:24:36 +02:00
Jan Nieuwenhuizen 573896cc1c
core: Prepare for the Hurd.
* lib/linux/libc.c: Move from lib/linux.c.
* lib/linux/gcc.c: Move from lib/linux-gcc.c.
* lib/linux/gnu.c: Move from lib/linux+gnu.c.
* lib/linux/libc.c: Move from lib/linux.c.
* lib/linux/mes.c: Move from lib/linux-mes.c.
* lib/linux/mini-gcc.c: Move from lib/linux-mini-gcc.c.
* lib/linux/mini-mes.c: Move from lib/linux-mini-mes.c.
* lib/linux/tcc.c: Move from lib/linux+tcc.c.
* lib/linux/crt0.c: Move from lib/crt0.c.
* lib/linux/crt1.c: Move from lib/crt1.c.
* lib/linux/crti.c: Move from lib/crti.c.
* lib/linux/crtn.c: Move from lib/crtn.c.
* build-aux/build-cc.sh: Update for new layout.
* build-aux/build-cc32.sh: Likewise.
* build-aux/build-mes.sh: Likewise.
* build-aux/cc-mes.sh: Likewise.
* build-aux/cc32-mes.sh: Likewise.
* lib/string/argz-count.c: New file taken from GNU C Library,
  relicensed.
* lib/string/argz-extract.c: New file taken from GNU C Library,
  relicensed.
* include/argz.h: New file.
* lib/string/memcpy.c: New file, extract from libc.
* lib/assert/assert.c: Likewise.
2018-06-30 13:11:03 +02:00