mes.git
6 months agotest: 90-abtod: Remove printf dependency. Fixes gcc.
Jan Nieuwenhuizen [Mon, 2 Dec 2019 09:00:03 +0000 (10:00 +0100)]
test: 90-abtod: Remove printf dependency.  Fixes gcc.

* lib/tests/mes/90-abtod.stdout: Remove.
* lib/tests/mes/90-abtod.c (main): Remove printf.

6 months agotest: 90-readdir: Remove qsort dependency. Fixes tmpfs failures.
Jan Nieuwenhuizen [Sun, 1 Dec 2019 22:58:48 +0000 (23:58 +0100)]
test: 90-readdir: Remove qsort dependency.  Fixes tmpfs failures.

* lib/tests/dirent/90-readdir.c (check_seen): New function.
(main): Use it instead of qsort.
(qsort_strcmp): Remove.

6 months agocore: Throw instead of segfault on non-existing input file.
Jan Nieuwenhuizen [Sun, 24 Nov 2019 22:12:29 +0000 (23:12 +0100)]
core: Throw instead of segfault on non-existing input file.

Reported by theruran.

* src/posix.c (open_input_file): Call error instead of failing silently.

11 months agoboot-0: Fix spelling of "evaluate"
Vagrant Cascadian [Tue, 11 Jun 2019 06:56:04 +0000 (23:56 -0700)]
boot-0: Fix spelling of "evaluate"

6 months agomescc: Honor --includedir, --libdir.
Jan Nieuwenhuizen [Sun, 24 Nov 2019 10:14:14 +0000 (11:14 +0100)]
mescc: Honor --includedir, --libdir.

* guix/git/mes.scm (mes):
* module/mescc.scm (%includedir, %libdir): New variable.
(mescc:main): Add them to options.
* module/mescc/mescc.scm (mescc:preprocess, c->info): Add %includedir.
(arch-find): Use %libdir instead of
prefix-file.
(prefix-file): Remove.
* scripts/mescc.scm.in (%includedir, %libdir): Initialize from and set
in environment.

xx

* module/mescc/mescc.scm :

6 months agodoc: Post-release update.
Jan Nieuwenhuizen [Sun, 24 Nov 2019 09:30:40 +0000 (10:30 +0100)]
doc: Post-release update.

* NEWS: Typo.
* doc/announce/ANNOUNCE-0.21: Add checksums.

6 months agoRelease 0.21. v0.21
Jan Nieuwenhuizen [Sun, 10 Nov 2019 07:31:38 +0000 (08:31 +0100)]
Release 0.21.

* configure (VERSION): Update to 0.21.
(main): Likewise.
* build-aux/GNUmakefile.in: Likewise.
* configure.sh (VERSION): Likewise.
* guix/git/mes.scm (mes, mes.git): Likewise.

7 months agodoc: Release update.
Jan Nieuwenhuizen [Mon, 4 Nov 2019 18:59:13 +0000 (19:59 +0100)]
doc: Release update.

* BLURB: Release update.
* HACKING: Remove roadmap.
* INSTALL: Release update.
* NEWS: Add 0.21 section.
* README: Release update.
* ROADMAP: New file.
* configure.sh: Release update.
* doc/announce/ANNOUNCE-0.21: New file.
* doc/mes.texi: Release update.

6 months agomescc: Mes C Library: vfprintf: Support --with-system-libc.
Jan Nieuwenhuizen [Sat, 23 Nov 2019 20:37:57 +0000 (21:37 +0100)]
mescc: Mes C Library: vfprintf: Support --with-system-libc.

* include/stdarg.h (va_arg8)[SYSTEM_LIBC]: Define.

6 months agomescc: Mes C Library: Support gcc-4.6.4: Fix ctime stub.
Jan Nieuwenhuizen [Sat, 23 Nov 2019 20:35:05 +0000 (21:35 +0100)]
mescc: Mes C Library: Support gcc-4.6.4: Fix ctime stub.

* lib/stub/ctime.c (ctime): Fix stub to avoid segfault upon use.

6 months agomescc: Mes C Library: Fix isatty for x86_64.
Jan Nieuwenhuizen [Sat, 23 Nov 2019 20:29:36 +0000 (21:29 +0100)]
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.

6 months agobuild: Prefer /bin/bash if available. Thanks, Vagrant!
Jan Nieuwenhuizen [Sat, 9 Nov 2019 09:59:01 +0000 (10:59 +0100)]
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.

7 months agobuild: Update script help and usage.
Jan Nieuwenhuizen [Mon, 4 Nov 2019 22:56:15 +0000 (23:56 +0100)]
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.

7 months agobuild: Use unversioned doc directory. Thanks, Vagrant!
Jan Nieuwenhuizen [Mon, 4 Nov 2019 22:54:30 +0000 (23:54 +0100)]
build: Use unversioned doc directory. Thanks, Vagrant!

* configure (docdir): Drop version.  Fixes Debian lint error.
* configure.sh (docdir): Likewise.

7 months agobuild: Add sensible NAME section for man pages. Thanks, Vagrant!
Jan Nieuwenhuizen [Mon, 4 Nov 2019 22:43:38 +0000 (23:43 +0100)]
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.

6 months agoRevert "build: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-gcc."
Jan Nieuwenhuizen [Sat, 9 Nov 2019 10:10:31 +0000 (11:10 +0100)]
Revert "build: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-gcc."

This reverts commit dc0b41f83efa973b7a92c0c7a0ad1eb21a7c4c7a.

7 months agobuild: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-gcc.
Jan Nieuwenhuizen [Wed, 30 Oct 2019 08:33:54 +0000 (09:33 +0100)]
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.

6 months agoRevert "build: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-mescc."
Jan Nieuwenhuizen [Sat, 9 Nov 2019 10:10:25 +0000 (11:10 +0100)]
Revert "build: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-mescc."

This reverts commit 17986224095ed72649fb2383f72c21f525977310.

7 months agobuild: Mark lib/tests/dirent/90-readdir.c as XFAIL on x86_64-mescc.
Jan Nieuwenhuizen [Wed, 30 Oct 2019 08:32:46 +0000 (09:32 +0100)]
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.

7 months agobuild: Better and friendlier tarball.
Jan Nieuwenhuizen [Thu, 24 Oct 2019 11:19:28 +0000 (13:19 +0200)]
build: Better and friendlier tarball.

* build-aux/GNUmakefile.in (dist): Be friendly to Debian; avoid using
EPOCH.  Cater for file permission differences.

7 months agobuild: bootstrap fixes.
Jan Nieuwenhuizen [Tue, 15 Oct 2019 18:18:31 +0000 (20:18 +0200)]
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.

7 months agomes: Fix -c, --command.
Jan Nieuwenhuizen [Thu, 10 Oct 2019 11:22:12 +0000 (13:22 +0200)]
mes: Fix -c, --command.

* mes/module/mes/boot-0.scm: Prepend 'begin to expr list.

8 months agocheck: Remove duplicate test.
Jan Nieuwenhuizen [Thu, 3 Oct 2019 20:17:50 +0000 (22:17 +0200)]
check: Remove duplicate test.

* build-aux/check-boot.sh (TESTS): Remove duplicate test.

8 months agomescc: Mes C Library: Support gcc-4.6.4: vfprintf, vsnprintf: pad with space.
Jan Nieuwenhuizen [Fri, 20 Sep 2019 12:44:31 +0000 (14:44 +0200)]
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.

8 months agomescc: Mes C Library: Support gcc-4.6.4: Add math stubs.
Jan Nieuwenhuizen [Fri, 13 Sep 2019 13:11:38 +0000 (15:11 +0200)]
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.

8 months agomescc: Mes C Library: Support gcc-4.6.4: Add fscanf, vfscanf.
Jan Nieuwenhuizen [Fri, 6 Sep 2019 17:04:50 +0000 (19:04 +0200)]
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.

9 months agomescc: Mes C Libray: Fix off_t.
Jan Nieuwenhuizen [Wed, 4 Sep 2019 15:35:33 +0000 (17:35 +0200)]
mescc: Mes C Libray: Fix off_t.

* include/sys/types.h (off_t): Drop unsigned.

8 months agomescc: Environment setup.
Jan Nieuwenhuizen [Fri, 6 Sep 2019 21:24:23 +0000 (23:24 +0200)]
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.

9 months agoAdd missing #include.
Danny Milosavljevic [Mon, 26 Aug 2019 23:46:57 +0000 (01:46 +0200)]
Add missing #include.

* lib/stdlib/mbstowcs.c: Add missing #include.

9 months agoFix dtoab.
Danny Milosavljevic [Mon, 26 Aug 2019 22:43:37 +0000 (00:43 +0200)]
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.

9 months agova_align: Fix compiler warning.
Danny Milosavljevic [Tue, 27 Aug 2019 03:49:22 +0000 (05:49 +0200)]
va_align: Fix compiler warning.

Follow-up to 49b0cd7d2e6952044d7436260d6ba950e40ee05f.

* include/stdarg.h: Fix compiler warning.

9 months agoAdd missing #include.
Danny Milosavljevic [Tue, 27 Aug 2019 02:32:02 +0000 (04:32 +0200)]
Add missing #include.

* lib/tests/mes/90-abtod.c (main): Add missing #include.

9 months agoFix variable argument list traversal for doubles.
Danny Milosavljevic [Tue, 27 Aug 2019 02:04:56 +0000 (04:04 +0200)]
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.

9 months agobuild: Improve --with-system-libc support.
Jan Nieuwenhuizen [Sat, 24 Aug 2019 17:05:58 +0000 (19:05 +0200)]
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.

9 months agomescc: Mes C Library: vfprintf, vsnprintf: Pad floats with space.
Jan Nieuwenhuizen [Sun, 1 Sep 2019 20:18:00 +0000 (22:18 +0200)]
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.

10 months agomescc: Mes C Library: vsscanf: Increase count for scanned float.
Jan Nieuwenhuizen [Thu, 1 Aug 2019 09:01:47 +0000 (11:01 +0200)]
mescc: Mes C Library: vsscanf: Increase count for scanned float.

* lib/stdio/vsscanf.c (vsscanf): Increase count for scanned float.

10 months agomescc: Mes C Library: Support GNU Tar: Fix getpwnam, getpwuid stubs.
Jan Nieuwenhuizen [Wed, 31 Jul 2019 10:25:43 +0000 (12:25 +0200)]
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.

10 months agomescc: Mes C Library: Support GNU Tar: Add getgrgid, getgrnam, setgrent stub.
Jan Nieuwenhuizen [Wed, 24 Jul 2019 10:23:54 +0000 (12:23 +0200)]
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.

10 months agomescc: Mes C Library: Support GNU Awk: Add wchar_t.
Jan Nieuwenhuizen [Sun, 21 Jul 2019 11:23:49 +0000 (13:23 +0200)]
mescc: Mes C Library: Support GNU Awk: Add wchar_t.

* include/sys/types.h (wchar_t): New typedef.

10 months agomescc: Mes C Library: Support GNU Awk: Add getpgid, getpgrp stubs.
Jan Nieuwenhuizen [Thu, 18 Jul 2019 10:13:18 +0000 (12:13 +0200)]
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.

10 months agomescc: Mes C Library: Support GNU Tar: Add mktime stub, fix localtime stub.
Jan Nieuwenhuizen [Mon, 15 Jul 2019 09:58:21 +0000 (11:58 +0200)]
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.

10 months agomescc: Mes C Library: Support GNU Tar: Add creat, mknod.
Jan Nieuwenhuizen [Fri, 12 Jul 2019 09:56:58 +0000 (11:56 +0200)]
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.

10 months agomescc: Mes C Library: Support GNU Tar: Add missing defines.
Jan Nieuwenhuizen [Tue, 9 Jul 2019 09:53:16 +0000 (11:53 +0200)]
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.

11 months agomescc: Mes C Library: Support GNU Bash: Add struct winsize.
Jan Nieuwenhuizen [Sat, 6 Jul 2019 09:25:02 +0000 (11:25 +0200)]
mescc: Mes C Library: Support GNU Bash: Add struct winsize.

* include/termio.h (struct winsize): New type.

11 months agomescc: Mes C Library: Support GNU Awk: Implement atof.
Jan Nieuwenhuizen [Wed, 3 Jul 2019 09:22:57 +0000 (11:22 +0200)]
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.

4 months agomescc: Mes C Library: Support GNU Awk: Add dtoab, %f in vfprintf, vsnprintf.
Jan Nieuwenhuizen [Sun, 12 Jan 2020 17:42:25 +0000 (18:42 +0100)]
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.

11 months agomescc: Mes C Library: Support GNU Awk: Add abtod, implementing strtod.
Jan Nieuwenhuizen [Tue, 25 Jun 2019 10:51:44 +0000 (12:51 +0200)]
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.

11 months agomescc: Mes C Library: Support GNU Awk: vsscanf: Support %f.
Jan Nieuwenhuizen [Sat, 22 Jun 2019 09:48:39 +0000 (11:48 +0200)]
mescc: Mes C Library: Support GNU Awk: vsscanf: Support %f.

* lib/stdio/vsscanf.c (vsscanf): Support %f.

11 months agomescc: Mes C Library: Support GNU Awk: Do not flush std files.
Jan Nieuwenhuizen [Wed, 19 Jun 2019 09:26:37 +0000 (11:26 +0200)]
mescc: Mes C Library: Support GNU Awk: Do not flush std files.

* lib/stdio/fflush.c (fflush): Do not flush std files.

11 months agomescc: Mes C Library: Support GNU Awk: Add isgraph.
Jan Nieuwenhuizen [Sun, 16 Jun 2019 09:25:37 +0000 (11:25 +0200)]
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.

11 months agomescc: Mes C Library: Support GNU Tar: Add readlink, symlink.
Jan Nieuwenhuizen [Wed, 12 Jun 2019 23:07:19 +0000 (01:07 +0200)]
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.

11 months agomescc: Mes C Library: Support GNU Tar: Add execlp.
Jan Nieuwenhuizen [Sun, 9 Jun 2019 22:56:42 +0000 (00:56 +0200)]
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.

11 months agomescc: Mes C Library: Fix compile warnings.
Jan Nieuwenhuizen [Wed, 12 Jun 2019 13:59:06 +0000 (15:59 +0200)]
mescc: Mes C Library: Fix compile warnings.

* include/stdlib.h (abort): Add prototype.

6 months agomescc: Mes C Library: Add missing stubs.
Jan Nieuwenhuizen [Sun, 10 Nov 2019 08:00:08 +0000 (09:00 +0100)]
mescc: Mes C Library: Add missing stubs.

* build-aux/configure-lib.sh (libc_gnu_SOURCES): Add fscanf, rewind stubs.
* lib/stdio/freeopen.c: Remove.

8 months agobuild: Avoid tar --exclude=.
Jan Nieuwenhuizen [Fri, 20 Sep 2019 17:33:29 +0000 (19:33 +0200)]
build: Avoid tar --exclude=.

* build-aux/install.sh.in: Only use `tar --exclude=' if we also have .go
files compiled by Guile.

8 months agobuild: mesar: Remove bashisms.
Jan Nieuwenhuizen [Mon, 16 Sep 2019 20:46:39 +0000 (22:46 +0200)]
build: mesar: Remove bashisms.

* scripts/mesar.in: Remove bashisms.

8 months agoconfigure.sh: Cleanup argument parsing. Thanks, Timothy!
Jan Nieuwenhuizen [Tue, 1 Oct 2019 17:12:56 +0000 (19:12 +0200)]
configure.sh: Cleanup argument parsing. Thanks, Timothy!

* configure.sh: Cleanup argument parsing.

8 months agoconfigure.sh: Remove bashisms.
Jan Nieuwenhuizen [Mon, 16 Sep 2019 19:12:56 +0000 (21:12 +0200)]
configure.sh: Remove bashisms.

* configure.sh: Remove bashisms.  Fixes running with Gash 0.1.

8 months agoRevert "nyacc: 0.86.0 compatibility stub. WIP"
Jan Nieuwenhuizen [Mon, 16 Sep 2019 19:14:15 +0000 (21:14 +0200)]
Revert "nyacc: 0.86.0 compatibility stub. WIP"

This reverts commit 0183cc1c42437fda27196e27b490285a61d47f59.

While it works to run Nyacc 0.86.0, it breaks running Nyacc 0.93 and
up.  This would need more thought and work, adding a nyacc-compat
directory or so.  Seems not worth the effort right now.

8 months agonyacc: 0.86.0 compatibility stub. WIP
Jan Nieuwenhuizen [Mon, 16 Sep 2019 19:13:46 +0000 (21:13 +0200)]
nyacc: 0.86.0 compatibility stub. WIP

* mes/module/nyacc/lang/c99/util.scm: 0.86.0 compatibility stub.

8 months agobuild: Split-out build-source-lib.sh from build-lib.sh.
Jan Nieuwenhuizen [Fri, 20 Sep 2019 17:40:37 +0000 (19:40 +0200)]
build: Split-out build-source-lib.sh from build-lib.sh.

* build-aux/build-lib.sh: Remove building of source lib.
* build-aux/build-source-lib.sh: New file.
* build-aux/build.sh.in: Invoke it.
* build-aux/bootstrap.sh.in: Likewise.

6 months agobuild: Honor configure's --includedir. Thanks, Vagrant!
Jan Nieuwenhuizen [Wed, 13 Nov 2019 08:23:27 +0000 (09:23 +0100)]
build: Honor configure's --includedir. Thanks, Vagrant!

Suggested by Vagrant Cascadian

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902174#84

* build-aux/install.sh.in: Install headers in $includedir.
* configure (includedir): Typo.
* configure.sh (includedir): Likewise.

6 months agobuild: Create ascii signature.
Jan Nieuwenhuizen [Sat, 23 Nov 2019 21:23:33 +0000 (22:23 +0100)]
build: Create ascii signature.

* build-aux/GNUmakefile.in (sign): Create ascii signature.

8 months agodoc: Post-release update.
Jan Nieuwenhuizen [Mon, 9 Sep 2019 14:48:15 +0000 (16:48 +0200)]
doc: Post-release update.

* doc/announce/ANNOUNCE-0.20: Update.
* guix/git/mes.scm (mes): Update.

8 months agoRelease 0.20. v0.20
Jan Nieuwenhuizen [Sun, 8 Sep 2019 07:31:38 +0000 (09:31 +0200)]
Release 0.20.

* configure (VERSION): Update to 0.20.
(main): Likewise.
* configure.sh (VERSION): Likewise.
* guix/git/mes.scm (mes, mes.git): Likewise.

8 months agodoc: Release update.
Jan Nieuwenhuizen [Thu, 20 Dec 2018 06:44:18 +0000 (07:44 +0100)]
doc: Release update.

* BLURB: New file.
* AUTHORS: Update.
* HACKING: Update.
* INSTALL: Update.
* NEWS: Update.
* README: Update.
* doc/images/gcc-mesboot-graph.dot: Update.
* doc/mes.texi: Update.
* simple.sh: Update.
* doc/announce/ANNOUNCE-0.20: New file.

8 months agoguix: Update mescc-tools to 0.6.1.
Jan Nieuwenhuizen [Mon, 9 Sep 2019 14:39:08 +0000 (16:39 +0200)]
guix: Update mescc-tools to 0.6.1.

* guix/git/mes.scm (mescc-tools): Update to 0.6.1.
* configure: Check for mescc-tools versions 0.6 or higher.

8 months agobuild: Create ascii signature.
Jan Nieuwenhuizen [Sun, 8 Sep 2019 09:10:45 +0000 (11:10 +0200)]
build: Create ascii signature.

* build-aux/GNUmakefile.in (sign): Create ascii signature.

8 months agoguix: Update Nyacc to 0.99.
Jan Nieuwenhuizen [Sat, 7 Sep 2019 15:15:05 +0000 (17:15 +0200)]
guix: Update Nyacc to 0.99.

* guix/git/mes.scm (nyacc): Update to 0.99.

8 months agodoc: Add PORTING.
Jan Nieuwenhuizen [Sun, 3 Mar 2019 19:19:42 +0000 (20:19 +0100)]
doc: Add PORTING.

* PORTING: New file.

8 months agodoc: Typos. Thanks, dddddd.
Jan Nieuwenhuizen [Mon, 22 Apr 2019 17:21:41 +0000 (19:21 +0200)]
doc: Typos. Thanks, dddddd.

* doc/announce/ANNOUNCE-0.11: Typo.
* doc/announce/ANNOUNCE-0.12: Typo.
* doc/announce/ANNOUNCE-0.13: Typo.
* doc/announce/ANNOUNCE-0.14: Typo.

8 months agomescc: Remove dead code. Thanks Mark Weaver.
Jan Nieuwenhuizen [Sat, 7 Sep 2019 14:17:03 +0000 (16:17 +0200)]
mescc: Remove dead code. Thanks Mark Weaver.

* module/mescc/compile.scm (field-size): Remove dead function.

8 months agoguix: Update packaging.
Jan Nieuwenhuizen [Sat, 20 Jul 2019 14:49:00 +0000 (16:49 +0200)]
guix: Update packaging.

* build-aux/manifest.scm (string-append):
* guix/git/mes.scm (nyacc, git-file?): Remove.
(mescc-tools): Bump to 0.6.0.
(%source-dir): New variable.
(mes.git): Ues it.
* guix.scm: Rename from .guix.scm.

8 months agobuild: Do not generate ChangeLog from tarball.
Jan Nieuwenhuizen [Sun, 21 Jul 2019 15:13:39 +0000 (17:13 +0200)]
build: Do not generate ChangeLog from tarball.

* configure (main): Set .git-for-build.
* build-aux/install.sh.in (DESTDIR): Use it as canary to skip
ChangeLog rebuild.

8 months agobuild: Use mesar instead of ar.
Jan Nieuwenhuizen [Sun, 21 Jul 2019 14:44:54 +0000 (16:44 +0200)]
build: Use mesar instead of ar.

* scripts/mesar.in: Rename from ar.in.  Update users.
* build-aux/build.sh.in (LIBS): Update.
* build-aux/check.sh.in (recheck): Likwise.
* build-aux/install.sh.in (DESTDIR): Likwise.
* configure (main): Likwise.
* configure.sh (mes_system): Likwise.
* .gitignore: Update.

8 months agogetopt: Remove old FSF address, thanks Vagrant.
Jan Nieuwenhuizen [Sun, 21 Jul 2019 13:55:07 +0000 (15:55 +0200)]
getopt: Remove old FSF address, thanks Vagrant.

* lib/posix/getopt.c: Remove old FSF address.

8 months agoAdd missing #include.
Danny Milosavljevic [Fri, 5 Jul 2019 15:13:16 +0000 (17:13 +0200)]
Add missing #include.

* lib/tests/scaffold/55-char-array.c: Add missing #include.

8 months agoAdd missing #include.
Danny Milosavljevic [Fri, 5 Jul 2019 15:12:54 +0000 (17:12 +0200)]
Add missing #include.

* lib/tests/io/90-stat.c: Add missing #include.

8 months agoAdd missing #include.
Danny Milosavljevic [Fri, 5 Jul 2019 15:12:28 +0000 (17:12 +0200)]
Add missing #include.

* lib/posix/getcwd.c: Add missing #include.

8 months agosignal: Use SA_RESTORER on x86-64.
Jan Nieuwenhuizen [Sat, 7 Sep 2019 16:52:09 +0000 (18:52 +0200)]
signal: Use SA_RESTORER on x86-64.

* lib/linux/signal.c (signal)[x86_64]: Avoid segfault by setting
SA_RESTORER flag.

8 months agosignal: Add comment on why we don't use the restorer.
Danny Milosavljevic [Thu, 4 Jul 2019 11:22:42 +0000 (13:22 +0200)]
signal: Add comment on why we don't use the restorer.

* lib/linux/signal.c: Add comment on why we don't use the restorer.

8 months agosignal: Remove SA_SIGINFO.
Danny Milosavljevic [Thu, 4 Jul 2019 01:43:32 +0000 (03:43 +0200)]
signal: Remove SA_SIGINFO.

* lib/linux/signal.c (signal): Remove SA_SIGINFO.

8 months agosignal: Don't use custom restorer.
Danny Milosavljevic [Thu, 4 Jul 2019 01:36:19 +0000 (03:36 +0200)]
signal: Don't use custom restorer.

* lib/linux/signal.c (signal): Don't use custom restorer.

8 months agosignal: Use SA_SIGINFO (like glibc).
Danny Milosavljevic [Thu, 4 Jul 2019 01:25:59 +0000 (03:25 +0200)]
signal: Use SA_SIGINFO (like glibc).

* lib/linux/signal.c (_restorer): Rename to...
(_restorer_for_siginfo): ...this.
(signal): Use it.  Use SA_SIGINFO.

8 months agosignal: Make sure that the signal mask is actually unsigned long.
Danny Milosavljevic [Thu, 4 Jul 2019 00:39:11 +0000 (02:39 +0200)]
signal: Make sure that the signal mask is actually unsigned long.

* lib/linux/signal.c (signal): Make sure that the signal mask is actually
unsigned long.

8 months agoDelete "__sigmask".
Danny Milosavljevic [Thu, 4 Jul 2019 00:38:06 +0000 (02:38 +0200)]
Delete "__sigmask".

Follow-up to 6d95b89759d3c598fc84194429ae8c57249daa1a

* lib/linux/signal.c (__sigmask): Delete definition.

8 months agoFix "struct sigaction" structure for rt_sigaction.
Danny Milosavljevic [Thu, 4 Jul 2019 00:21:24 +0000 (02:21 +0200)]
Fix "struct sigaction" structure for rt_sigaction.

* include/signal.h (sigset_t): Increase size.
* lib/linux/signal.c (signal): Use new sigset_t.

8 months agoInherit CFLAGS for mes.
Danny Milosavljevic [Wed, 3 Jul 2019 14:47:42 +0000 (16:47 +0200)]
Inherit CFLAGS for mes.

* build-aux/check.sh.in: Inherit CFLAGS for mes.

8 months agoFix typo.
Danny Milosavljevic [Tue, 2 Jul 2019 23:07:05 +0000 (01:07 +0200)]
Fix typo.

* build-aux/build.sh.in: Fix typo in "CFLAGS".

8 months agotests: Fail early on nonexistent file.
Danny Milosavljevic [Tue, 2 Jul 2019 11:39:41 +0000 (13:39 +0200)]
tests: Fail early on nonexistent file.

* lib/tests/io/90-stat.c (main): Fail early on nonexistent file.

8 months agoopen: Check flags, and use _open2 if applicable.
Danny Milosavljevic [Tue, 2 Jul 2019 01:36:18 +0000 (03:36 +0200)]
open: Check flags, and use _open2 if applicable.

* lib/linux/open.c (open): Check flags; use _open2.

8 months agoldiv: Make rem < 0 if a < 0.
Danny Milosavljevic [Mon, 1 Jul 2019 21:02:19 +0000 (23:02 +0200)]
ldiv: Make rem < 0 if a < 0.

* lib/mes/div.c (ldiv): Make rem < 0 if a < 0.

8 months agoldiv: Handle a == LONG_MIN.
Danny Milosavljevic [Mon, 1 Jul 2019 20:14:11 +0000 (22:14 +0200)]
ldiv: Handle a == LONG_MIN.

* lib/mes/div.c (ldiv): Handle a == LONG_MIN.

8 months agontoab: Use __mesabi_uldiv only for arm.
Jan Nieuwenhuizen [Mon, 9 Sep 2019 14:01:40 +0000 (16:01 +0200)]
ntoab: Use __mesabi_uldiv only for arm.

* lib/mes/ntoab.c (ntoab)[__MESC__ && __arm__]: Use __mesabi_uldiv.
* build-aux/check-mescc.sh (XFAIL_TESTS): 70-printf-simple.c and
70-printf.c now pass for x86_64 mescc.

11 months agoFix ntoab.
Danny Milosavljevic [Mon, 1 Jul 2019 18:04:26 +0000 (20:04 +0200)]
Fix ntoab.

Follow-up to b5b19304b59fefbed923b146ec8c8d495556fa76.

* lib/mes/ntoab.c (ntoab): Fix non-MESC case.

11 months agosignal: Define "_restorer" everywhere except on i386.
Danny Milosavljevic [Tue, 18 Jun 2019 17:26:45 +0000 (19:26 +0200)]
signal: Define "_restorer" everywhere except on i386.

* lib/linux/signal.c: Define "_restorer" everywhere except on i386.

11 months agoClarify our data type choices in "struct stat".
Danny Milosavljevic [Tue, 18 Jun 2019 15:37:10 +0000 (17:37 +0200)]
Clarify our data type choices in "struct stat".

* include/sys/stat.h: Clarify our data type choices in "struct stat".

8 months agotest: Bump timeout.
Jan Nieuwenhuizen [Sat, 7 Sep 2019 17:55:12 +0000 (19:55 +0200)]
test: Bump timeout.

* build-aux/test-c.sh: Bump timeout to 10s, __mesabi_uldiv can be slow.

11 months agontoab: Use __mesabi_uldiv only on __MESC__.
Danny Milosavljevic [Fri, 14 Jun 2019 15:45:32 +0000 (17:45 +0200)]
ntoab: Use __mesabi_uldiv only on __MESC__.

* lib/mes/ntoab.c (ntoab): Use __mesabi_uldiv only on __MESC__.

11 months agomescc: Mes C Library: Include mes/div.c for mescc builds.
Jan Nieuwenhuizen [Fri, 14 Jun 2019 08:02:49 +0000 (10:02 +0200)]
mescc: Mes C Library: Include mes/div.c for mescc builds.

* build-aux/configure-lib.sh (libmes_SOURCES): Add mes/div.c.
* simple.sh: Likewise.