Commit graph

1807 commits

Author SHA1 Message Date
Jan Nieuwenhuizen 594b2859b1
mescc: Mes C Library: vfprintf: Support --with-system-libc.
* include/stdarg.h (va_arg8)[SYSTEM_LIBC]: Define.
2019-11-23 21:37:57 +01:00
Jan Nieuwenhuizen 2673d28e50
mescc: Mes C Library: Support gcc-4.6.4: Fix ctime stub.
* lib/stub/ctime.c (ctime): Fix stub to avoid segfault upon use.
2019-11-23 21:35:05 +01:00
Jan Nieuwenhuizen 5480c133ae
mescc: Mes C Library: Fix isatty for x86_64.
* lib/linux/ioctl.c (ioctl3): New function.
* include/sys/ioctl.h: Declare it.
* lib/posix/isatty.c (__tcgetattr): Use it.
2019-11-23 21:29:36 +01:00
Jan Nieuwenhuizen 11798d4272
build: Prefer /bin/bash if available. Thanks, Vagrant!
Ensure the configure script uses /bin/bash, otherwise on systems with
/bin -> /usr/bin it results in /bin/bash being embedded in various
scripts.

Inspired by

    https://salsa.debian.org/debian/mes/blob/debian/master/debian/patches/force-use-of-bin-bash

* configure: Prefer /bin/bash, /bin/sh if available.  Helps
reproducibility on Debian.
2019-11-09 10:59:01 +01:00
Jan Nieuwenhuizen c6cceb47f3
build: Update script help and usage.
* doc/mes.texi (Invoking mesar): New section.
* mes/module/mes/boot-0.scm: Add one line help description.
* module/mescc.scm (parse-opts): Likewise.
* scripts/diff.scm (main): Add -h,--help, -v,--version.
* scripts/mesar.in: Likewise.
2019-11-04 23:56:15 +01:00
Jan Nieuwenhuizen 6a5619de9a
build: Use unversioned doc directory. Thanks, Vagrant!
* configure (docdir): Drop version.  Fixes Debian lint error.
* configure.sh (docdir): Likewise.
2019-11-04 23:54:30 +01:00
Jan Nieuwenhuizen 45427bc641
build: Add sensible NAME section for man pages. Thanks, Vagrant!
* build-aux/GNUmakefile.in (mes.1, mescc.1, mesar.1): Add sensible
--name section.  Fixes Debian lint error.  Reported by Vagrant
Cascadian.
2019-11-04 23:43:38 +01:00
Jan Nieuwenhuizen d663c3ded6
Revert "build: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-gcc."
This reverts commit dc0b41f83efa973b7a92c0c7a0ad1eb21a7c4c7a.
2019-11-09 11:10:31 +01:00
Jan Nieuwenhuizen b458314b4f
build: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-gcc.
* build-aux/check-mescc.sh (XFAIL_TESTS)[x86_64-gcc]: Add
lib/tests/dirent/90-readdir.c.
2019-10-30 09:33:54 +01:00
Jan Nieuwenhuizen 5bb1dc47da
Revert "build: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-mescc."
This reverts commit 17986224095ed72649fb2383f72c21f525977310.
2019-11-09 11:10:25 +01:00
Jan Nieuwenhuizen 70693696ce
build: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-mescc.
* build-aux/check-mescc.sh (XFAIL_TESTS)[x86_64-mescc]: Add
lib/tests/dirent/90-readdir.c.
2019-10-30 09:32:46 +01:00
Jan Nieuwenhuizen 66296abdc8
build: Better and friendlier tarball.
* build-aux/GNUmakefile.in (dist): Be friendly to Debian; avoid using
EPOCH.  Cater for file permission differences.
2019-10-24 13:19:28 +02:00
Jan Nieuwenhuizen 36ae666f05
build: bootstrap fixes.
* build-aux/config.sh.in (bootstrap): Set up for substitution.
* configure.sh (bootstrap): Substitute.
* build-aux/install.sh.in (_v): Robustify check for V.
(__exclude_go, __exclude_scm): Initialize.
2019-10-15 20:18:31 +02:00
Jan Nieuwenhuizen 092626243a
mes: Fix -c, --command.
* mes/module/mes/boot-0.scm: Prepend 'begin to expr list.
2019-10-10 13:22:12 +02:00
Jan Nieuwenhuizen 8d49b40b13
check: Remove duplicate test.
* build-aux/check-boot.sh (TESTS): Remove duplicate test.
2019-10-03 22:17:50 +02:00
Jan Nieuwenhuizen 0e55071bc7
mescc: Mes C Library: Support gcc-4.6.4: vfprintf, vsnprintf: pad with space.
* lib/stdio/vfprintf.c (vfprintf): pad with space.
* lib/stdio/vsnprintf.c (vsnprintf): pad with space.
2019-09-20 14:44:31 +02:00
Jan Nieuwenhuizen 98b9ac8e98
mescc: Mes C Library: Support gcc-4.6.4: Add math stubs.
* lib/math/ceil.c: New file.
* lib/math/floor.c: New file.
* lib/stub/atan2.c: New file.
* lib/stub/cos.c: New file.
* lib/stub/exp.c: New file.
* lib/stub/log.c: New file.
* lib/stub/modf.c: New file.
* lib/stub/pow.c: New file.
* lib/stub/sin.c: New file.
* lib/stub/sqrt.c: New file.
* lib/libc+gnu.c: Include them.
* include/math.h (atan2, ceil, cos, exp, fabs, floor, log, modf, pow,
sin, sqrt): Declare.
* lib/math/fabs.c: Update.
* lib/stub/ldexp.c: Update.
2019-09-13 15:11:38 +02:00
Jan Nieuwenhuizen 6bb225b403
mescc: Mes C Library: Support gcc-4.6.4: Add fscanf, vfscanf.
* lib/stdio/vfscanf.c: New file.
* lib/stdio/fscanf.c: New file.
* build-aux/configure-lib.sh (libc_gnu_SOURCES): Add them.
* include/stdio.h (fscanf): Declare.
* include/stdarg.h (vfscanf): Declare.
* lib/stub/fscanf.c: Remove.
2019-09-06 19:04:50 +02:00
Jan Nieuwenhuizen d643f923a3
mescc: Mes C Libray: Fix off_t.
* include/sys/types.h (off_t): Drop unsigned.
2019-09-04 17:35:33 +02:00
Jan Nieuwenhuizen a56918eaa2
mescc: Environment setup.
* scripts/mescc.in (MES_ARENA, MES_MAX_ARENA, MES_STACK): Reduce defaults.
* build-aux/check.sh.in (MES_ARENA): Likewise.  Export them.
* build-aux/bootstrap.sh.in (MES_STACK): Likewise.
(MES_PREFIX): Set default.
2019-09-06 23:24:23 +02:00
Danny Milosavljevic 73715dab4a
Add missing #include.
* lib/stdlib/mbstowcs.c: Add missing #include.
2019-08-27 01:46:57 +02:00
Danny Milosavljevic 01ae1994ed
Fix dtoab.
* lib/mes/dtoab.c (dtoab): Fix it.
* lib/tests/mes/90-dtoab.c (main): Fix test.
* build-aux/check-mescc.sh (XFAIL_TESTS: Remove it.
2019-08-27 00:43:37 +02:00
Danny Milosavljevic 3d5557c34a
va_align: Fix compiler warning.
Follow-up to 49b0cd7d2e6952044d7436260d6ba950e40ee05f.

* include/stdarg.h: Fix compiler warning.
2019-08-27 05:49:22 +02:00
Danny Milosavljevic abc0809bfa
Add missing #include.
* lib/tests/mes/90-abtod.c (main): Add missing #include.
2019-08-27 04:32:02 +02:00
Danny Milosavljevic 4c77c2c9ca
Fix variable argument list traversal for doubles.
* include/stdarg.h (va_align): New macro.
(va_arg8): New macro.
* lib/stdio/vfprintf.c (vfprintf): Use it.
* lib/stdio/vsnprintf.c (vsnprintf): Use it.
2019-08-27 04:04:56 +02:00
Jan Nieuwenhuizen 58fb0cf764
build: Improve --with-system-libc support.
* build-aux/build-lib.sh: Avoid building libc for --with-system-libc.
Make libmes richer.
build-aux/check-mescc.sh: Enable 50-malloc test.
* include/dirstream.h: Use HAVE_DIRSTREAM_H to cater for non-existing
dirstream.h.
* include/grp.h[SYSTEM_LIBC]: Typo.
* include/mes/lib.h (__brk, __call_at_exit)[SYSTEM_LIBC]: Declare.
* include/stdlib.h (comparison_fn_t)[SYSTEM_LIBC]: Declare.
* include/time.h (mktime): Return time_t.
* lib/posix/isatty.c [SYSTEM_LIBC]: Do not (re)declare termios.
* lib/stub/mktime.c (mktime): Return time_t.
* lib/tests/scaffold/41-ternary.c (main): Remove assumption that
locals are initialized.
* lib/tests/scaffold/70-stdarg.c: Cater for SYSTEM_LIBC.
* lib/tests/setjmp/80-setjmp.c: Declare jmp buf.
* lib/*/*.c: Add missing mes/lib.h, errno.h includes.
2019-08-24 19:05:58 +02:00
Jan Nieuwenhuizen fd1109a25f
mescc: Mes C Library: vfprintf, vsnprintf: Pad floats with space.
* lib/stdio/vfprintf.c (vfprintf): Pad floats with space.
* lib/stdio/vsnprintf.c (vsnprintf): Pad floats with space.
* lib/tests/stdio/90-sprintf.c: Test it.
2019-09-01 22:18:00 +02:00
Jan Nieuwenhuizen f097a9d270
mescc: Mes C Library: vsscanf: Increase count for scanned float.
* lib/stdio/vsscanf.c (vsscanf): Increase count for scanned float.
2019-08-01 11:01:47 +02:00
Jan Nieuwenhuizen de197a48f5
mescc: Mes C Library: Support GNU Tar: Fix getpwnam, getpwuid stubs.
* lib/stub/getpwnam.c (getpwnam): Return pointer to static struct
passwd.
* lib/stub/getpwuid.c (getpwuid): Likewise.
2019-07-31 12:25:43 +02:00
Jan Nieuwenhuizen 5c979a8ce1
mescc: Mes C Library: Support GNU Tar: Add getgrgid, getgrnam, setgrent stub.
* include/grp.h: New file.
* lib/stub/getgrgid.c: New file.
* lib/stub/getgrnam.c: New file.
* lib/stub/setgrent.c: New file.
* lib/libc+gnu.c: Include them.
2019-07-24 12:23:54 +02:00
Jan Nieuwenhuizen 9573f469f8
mescc: Mes C Library: Support GNU Awk: Add wchar_t.
* include/sys/types.h (wchar_t): New typedef.
2019-07-21 13:23:49 +02:00
Jan Nieuwenhuizen fe96cc37df
mescc: Mes C Library: Support GNU Awk: Add getpgid, getpgrp stubs.
* include/unistd.h (getpgid, getpgrp): Declare.
* lib/stub/getpgid.c: New file.
* lib/stub/getpgrp.c: New file.
* lib/libc+gnu.c: Include them.
2019-07-18 12:13:18 +02:00
Jan Nieuwenhuizen 0d3f1ed2ae
mescc: Mes C Library: Support GNU Tar: Add mktime stub, fix localtime stub.
* include/time.h (mktime): Declare.
* lib/stub/mktime.c: New stub.
* lib/libc+gnu.c: Include it.
* lib/stub/localtime.c (localtime): Return pointer to static struct
tm.  Avoids segfaults.
2019-07-15 11:58:21 +02:00
Jan Nieuwenhuizen b97c59ff21
mescc: Mes C Library: Support GNU Tar: Add creat, mknod.
* include/linux/x86_64/syscall.h (SYS_mknod): New macro.
* include/linux/x86/syscall.h (SYS_mknod): New macro.
* lib/linux/mknod.c: New file.
* build-aux/configure-lib.sh (libc_gnu_SOURCES): Add it.
* include/sys/stat.h (mknod): Declare it.
* include/fcntl.h (creat): New macro.
2019-07-12 11:56:58 +02:00
Jan Nieuwenhuizen 203ef4944b
mescc: Mes C Library: Support GNU Tar: Add missing defines.
* include/errno.h (ENXIO): New macro.
* include/sys/stat.h (S_IFIFO, S_ISFIFO): New macro.
2019-07-09 11:53:16 +02:00
Jan Nieuwenhuizen 860f5ce7d5
mescc: Mes C Library: Support GNU Bash: Add struct winsize.
* include/termio.h (struct winsize): New type.
2019-07-06 11:25:02 +02:00
Jan Nieuwenhuizen 8d45c6484f
mescc: Mes C Library: Support GNU Awk: Implement atof.
* lib/stdlib/atoi.c: Update.
* lib/stdlib/atof.c: Rename from stub/atof.c; Implement.
* lib/libc+gnu.c: Update include.
* lib/libg.c: Update include.
2019-07-03 11:22:57 +02:00
Jan Nieuwenhuizen f3154aabe4
mescc: Mes C Library: Support GNU Awk: Add dtoab, %f in vfprintf, vsnprintf.
* include/libmes.h (dtoab): Declare.
* lib/mes/ntoab.c (ntoab): Update.
* lib/mes/dtoab.c: New file.
* build-aux/configure-lib.sh (libmes_SOURCES, libc_tcc_SOURCES): Add
it.
* lib/tests/mes/90-dtoab.c: Test it.
* lib/tests/stdio/90-sprintf.c: Test it.
* build-aux/check-mescc.sh (tests): Run it, against...
* lib/tests/mes/90-dtoab.stdout: ...baseline.
* lib/stdio/vfprintf.c (vfprintf): Support %f, even more naive support
for %e, %E, %g, %G.
* lib/stdio/vsnprintf.c (vsnprintf): Likewise.
2020-01-12 18:42:25 +01:00
Jan Nieuwenhuizen 742e88abd5
mescc: Mes C Library: Support GNU Awk: Add abtod, implementing strtod.
* include/libmes.h (abtod): Declare.
* lib/mes/abtod.c: New file.
* build-aux/configure-lib.sh (libmes_SOURCES, libc_tcc_SOURCES): Add
it.
* lib/mes/abtol.c: Update.
* lib/stdlib/strtod.c: Use it to implement; move from stub/strtod.
* lib/tests/mes/90-abtod.c: Test it.
* lib/tests/mes/90-abtod.stdout: Baseline.
* build-aux/check-mescc.sh (tests): Run it.
2019-06-25 12:51:44 +02:00
Jan Nieuwenhuizen cd50beca3a
mescc: Mes C Library: Support GNU Awk: vsscanf: Support %f.
* lib/stdio/vsscanf.c (vsscanf): Support %f.
2019-06-22 11:48:39 +02:00
Jan Nieuwenhuizen 749248ac3a
mescc: Mes C Library: Support GNU Awk: Do not flush std files.
* lib/stdio/fflush.c (fflush): Do not flush std files.
2019-06-19 11:26:37 +02:00
Jan Nieuwenhuizen 9faa38bee1
mescc: Mes C Library: Support GNU Awk: Add isgraph.
* lib/ctype/isgraph.c: New file.
* lib/libc+gnu.c: Include it.
* include/ctype.h: Add missing prototypes.
2019-06-16 11:25:37 +02:00
Jan Nieuwenhuizen 9be33485e2
mescc: Mes C Library: Support GNU Tar: Add readlink, symlink.
* lib/linux/gnu.c (readlink, symlink): New function.
* include/unistd.h (readlink, symlink): Declare.
* include/linux/x86/syscall.h (SYS_readlink, SYS_symlink): New macro.
* include/linux/x86_64/syscall.h (SYS_symlink, SYS_readlink): New
macro.
2019-06-13 01:07:19 +02:00
Jan Nieuwenhuizen 4e6a3ce846
mescc: Mes C Library: Support GNU Tar: Add execlp.
* lib/posix/execl.c (vexec): New function.
(execl): Use it.
* lib/posix/execlp.c: New file.
* build-aux/configure-lib.sh (libc_tcc_SOURCES): Add it.
* lib/libc+gnu.c: Include it.
* include/unistd.h (execlp): Declare.
* lib/tests/posix/90-execlp.c: New file.
* lib/tests/posix/90-execlp.stdout: New file.
* build-aux/check-mescc.sh: Test it.
2019-06-10 00:56:42 +02:00
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 396e96c056
mescc: Mes C Library: Add missing stubs.
* build-aux/configure-lib.sh (libc_gnu_SOURCES): Add fscanf, rewind stubs.
* lib/stdio/freeopen.c: Remove.
2019-11-10 09:00:08 +01:00
Jan Nieuwenhuizen b3cac19d4c
build: Avoid tar --exclude=.
* build-aux/install.sh.in: Only use `tar --exclude=' if we also have .go
files compiled by Guile.
2019-09-20 19:33:29 +02:00
Jan Nieuwenhuizen 4f4be8d6b7
build: mesar: Remove bashisms.
* scripts/mesar.in: Remove bashisms.
2019-09-16 22:46:39 +02:00
Jan Nieuwenhuizen 558d9cc60c
configure.sh: Cleanup argument parsing. Thanks, Timothy!
* configure.sh: Cleanup argument parsing.
2019-10-01 19:12:56 +02:00
Jan Nieuwenhuizen 5fe0432301
configure.sh: Remove bashisms.
* configure.sh: Remove bashisms.  Fixes running with Gash 0.1.
2019-09-16 21:12:56 +02:00