mes.git
19 months agocore: reader: Prepare for M2-Planet.
Jan Nieuwenhuizen [Sun, 12 Aug 2018 12:53:06 +0000 (14:53 +0200)]
core: reader: Prepare for M2-Planet.

* src/reader.c (MAX_STRING): New define.
(read_input_file_env_): Remove dead code.
(reader_read_line_comment): Refactor to remove recursion.
(reader_read_line_sexp_): Refactor to use if instead of switch.
(reader_read_hash): Likewise.
(reader_read_character): Refactor: cache peekchar () value, make
M2-Planet friendly.
(reader_read_binary): Make M2-Planet friendly.
(reader_read_octal): Likewise.
(reader_read_hex): Likewise.
(reader_read_string): Refactor.
(dump): Make M2-Planet friendly.

19 months agobuild: src/mes build fixes.
Jan Nieuwenhuizen [Sun, 12 Aug 2018 13:05:21 +0000 (15:05 +0200)]
build: src/mes build fixes.

* build-aux/GNUmakefile.in (seed): Add dependency on gcc.
* build-aux/build-cc.sh: Copy result to src/mes.
* build-aux/build-cc32.sh: Likewise.
* build-aux/build.sh.in: Remove copying of results.

19 months agomescc: Mes C Library: Cleanup start files.
Jan Nieuwenhuizen [Sun, 12 Aug 2018 06:45:04 +0000 (08:45 +0200)]
mescc: Mes C Library: Cleanup start files.

* lib/linux/x86-mes-gcc/crt0.c: Split from lib/linux/crt0.c.
* lib/linux/x86-mes-gcc/crt1.c: Split from lib/linux/crt1.c.
* lib/linux/x86-mes-gcc/crti.c: Split from lib/linux/crti.c.
* lib/linux/x86-mes-gcc/crtn.c: Split from lib/linux/crtn.c.
* lib/linux/x86-mes/crt0.c: Split from lib/linux/crt0.c.
* lib/linux/x86-mes/crt1.c: Split from lib/linux/crt1.c.
* lib/linux/x86-mes/crti.c: Split from lib/linux/crti.c.
* lib/linux/x86-mes/crtn.c: Split from lib/linux/crtn.c.
* build-aux/build-cc.sh: Update.
* build-aux/build-cc32.sh: Update.
* build-aux/build-mes.sh: Update.

19 months agomescc: Mes C Library: Add x86_64 libc+gnu support.
Jan Nieuwenhuizen [Sat, 11 Aug 2018 17:04:01 +0000 (19:04 +0200)]
mescc: Mes C Library: Add x86_64 libc+gnu support.

* include/linux/x86/syscall.h: Move SYS_ defines from gnu.c.
* include/linux/x86_64/syscall.h: Add SYS_ defines for gnu.
* lib/linux/gnu.c: Update.
* lib/linux/gnu.c (signal)[__x86_64__]: Implement using rt_sigaction.
* lib/stdlib/abort.c: Support x86_64.

19 months agomescc: Mes C Library: Add x86_64 libc+tcc support.
Jan Nieuwenhuizen [Sat, 11 Aug 2018 16:39:48 +0000 (18:39 +0200)]
mescc: Mes C Library: Add x86_64 libc+tcc support.

* include/linux/x86/syscall.h: Move SYS_ defines from tcc.c.
* include/linux/x86_64/syscall.h: Add SYS_ defines for tcc.
* lib/x86-mes-gcc/setjmp.c: Rename from lib/libc+tcc-gcc.c
* lib/x86-mes/setjmp.c: Rename from lib/libc+tcc-mes.c
* lib/linux/tcc.c: Update.

19 months agomescc: Mes C Library: Add x86_64 libc support.
Jan Nieuwenhuizen [Sat, 11 Aug 2018 09:42:30 +0000 (11:42 +0200)]
mescc: Mes C Library: Add x86_64 libc support.

* include/linux/x86_64/syscall.h: New file.
* include/linux/x86/syscall.h: New file.
* lib/linux/x86_64-mes-gcc/mes.c: New file.
* lib/linux/x86-mes/mes.c: Rename from lib/linux/mes.c.
* lib/linux/x86-mes-gcc/mes.c: Rename from lib/linux/gcc.c.
* lib/linux/libc.c: Update includes.
(waitpid)[__x86_64__]: Use wait4.
* build-aux/build-cc.sh: Build libc too.
* lib/x86-mes/x86.M1 (mov____0x8(%ebp),%esi): New macro.

19 months agomescc: Mes C Library: Add x86_64 libc-mini support.
Jan Nieuwenhuizen [Fri, 10 Aug 2018 15:05:01 +0000 (17:05 +0200)]
mescc: Mes C Library: Add x86_64 libc-mini support.

* lib/linux/x86-mes-gcc/mini.c: Rename from lib/linux/mini-gcc.c.
* lib/linux/x86-mes/mini.c: Rename from lib/linux/mini-mes.c.
* lib/linux/x86_64-mes-gcc/crt1.c: Rename from lib/linux/x86_64/crt1.c.
* lib/linux/x86_64-mes-gcc/mini.c: New file.
* build-aux/build-cc.sh: Build libc-mini, scaffold/main, scaffold/hello.
* build-aux/cc64.sh: New file.

19 months agomescc: Add objdump'able x86_64-mes scaffold.
Jan Nieuwenhuizen [Fri, 10 Aug 2018 09:37:55 +0000 (11:37 +0200)]
mescc: Add objdump'able x86_64-mes scaffold.

* lib/x86_64-mes/elf64-header.hex2: New file.
* lib/x86_64-mes/elf64-footer-single-main.hex2: New file.
* build-aux/build-x86_64-mes.sh: Enable second, objdump'able exit-42
  scaffold test.

19 months agomescc: Initial x86_64-mes scaffold.
Jan Nieuwenhuizen [Fri, 10 Aug 2018 09:15:43 +0000 (11:15 +0200)]
mescc: Initial x86_64-mes scaffold.

* build-aux/GNUmakefile.in (x86_64-mes): New target.
* .gitignore: Ignore x86 and x86_64 out files.
* build-aux/build-mes.sh: Resurrect three initial exit42 scaffold tests.
* build-aux/build-x86_64-mes.sh: New file.  Add initial exit42
  scaffold test.
* lib/x86-mes/elf32-0header.hex2: Fix comment.
* lib/x86-mes/elf32-header.hex2: Likewise.
* lib/x86_64-mes/elf-0footer.hex2: New file.
* lib/x86_64-mes/elf64-0header.hex2: New file.
* lib/x86_64-mes/elf64-body-exit-42.hex2: New file.
* lib/x86_64-mes/exit-42.c: New file.

19 months agobuild: seed: Oops, copy TCC seed after it's been regenerated.
Jan Nieuwenhuizen [Sun, 12 Aug 2018 08:10:36 +0000 (10:10 +0200)]
build: seed: Oops, copy TCC seed after it's been regenerated.

* build-aux/GNUmakefile.in (seed): Oops, copy TCC seed after it's been
regenerated.

19 months agobuild: Fix mescc man page generation.
Jan Nieuwenhuizen [Fri, 10 Aug 2018 07:20:30 +0000 (09:20 +0200)]
build: Fix mescc man page generation.

* build-aux/GNUmakefile.in (doc/mescc.1): Reverse dependencies;
  generate page for mescc.

19 months agobuild: Fixes for make check.
Jan Nieuwenhuizen [Thu, 23 Aug 2018 17:57:50 +0000 (19:57 +0200)]
build: Fixes for make check.

* build-aux/config.sh (srcdir): Initialize if unset.
* build-aux/test.sh (DIFF): Do not fail if unset.

19 months agoguix: Update to 0.17.
Jan Nieuwenhuizen [Thu, 9 Aug 2018 22:35:02 +0000 (00:35 +0200)]
guix: Update to 0.17.

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

20 months agoRelease 0.17. v0.17
Jan Nieuwenhuizen [Sun, 22 Jul 2018 12:10:35 +0000 (14:10 +0200)]
Release 0.17.

* configure (VERSION): Update to 0.17.

20 months agodoc: Release update.
Jan Nieuwenhuizen [Sun, 22 Jul 2018 14:21:50 +0000 (16:21 +0200)]
doc: Release update.

* HACKING: Update.
* INSTALL: Update.
* NEWS: Update.
* README: Update.
* doc/announce/ANNOUNCE-0.17: New file.

19 months agobuild: Non-bootstrap install fixes.
Jan Nieuwenhuizen [Thu, 9 Aug 2018 09:00:10 +0000 (11:00 +0200)]
build: Non-bootstrap install fixes.

* configure (main): Fix default bindir.
* build-aux/GNUmakefile.in (PHONY_TARGETS): Remove src/mes.  Fixes
  re-build upon install.
* build-aux/install.sh.in: Fix tar arguments for scaffold files.
  Expand install directories.

19 months agocheck: Do not fail if partial test prerequisites fail.
Jan Nieuwenhuizen [Thu, 9 Aug 2018 08:22:26 +0000 (10:22 +0200)]
check: Do not fail if partial test prerequisites fail.

* build-aux/check-tcc.sh: Pass if no test directory found.
* build-aux/check.sh.in (TINYCC_PREFIX): Rename from TCC_PREFIX.  Pass
  if partial tests prerequisites fail.

19 months agocheck: Fix 4f-string-split.scm for Guile.
Jan Nieuwenhuizen [Thu, 9 Aug 2018 07:44:54 +0000 (09:44 +0200)]
check: Fix 4f-string-split.scm for Guile.

* module/mes/guile.scm (core:car, core:make-cell): New function.
  Fixes scaffold/boot/4f-string-split.scm.

19 months agobuild: configure: Oops, substitute @prefix@.
Jan Nieuwenhuizen [Thu, 9 Aug 2018 06:58:20 +0000 (08:58 +0200)]
build: configure: Oops, substitute @prefix@.

* build-aux/pre-inst-env.in (MES_PREFIX): Respect pre-set value.
* configure (main): Oops, substitute @prefix@.
* configure.sh (subst): Likewise.

20 months agobuild: web: New target.
Jan Nieuwenhuizen [Sat, 28 Jul 2018 09:37:47 +0000 (11:37 +0200)]
build: web: New target.

* README: Add bug-mes@gnu.org
* NEWS: Likewise.
* doc/mes.texi: Likewise.
* build-aux/gendocs.sh: New file, from gnulib.
* doc/gendocs_template: New file, from gnulib.
* build-aux/GNUmakefile.in (web): New target.

20 months agoRemove fosdem talk.
Jan Nieuwenhuizen [Sat, 28 Jul 2018 05:22:48 +0000 (07:22 +0200)]
Remove fosdem talk.

* doc/fosdem/GuixSD.png: Remove.
* doc/fosdem/LISP-1-5-page-13-bottom.png: Remove.
* doc/fosdem/LISP-1.5-page-13-bottom.png: Remove.
* doc/fosdem/LISP-1.5-page-13.pdf: Remove.
* doc/fosdem/LISP-1.5-page-13.png: Remove.
* doc/fosdem/README: Remove.
* doc/fosdem/beamercolorthemeX.sty: Remove.
* doc/fosdem/beamerthemeX.sty: Remove.
* doc/fosdem/bootstrap-graph.png: Remove.
* doc/fosdem/egg.jpeg: Remove.
* doc/fosdem/egg.png: Remove.
* doc/fosdem/egg.xcf: Remove.
* doc/fosdem/fosdem.org: Remove.
* doc/fosdem/fosdem.pdf: Remove.
* doc/fosdem/fsb-logo-guile-guix-gnu.png: Remove.
* doc/fosdem/fsb-logo-guile-guix-gnu.xcf: Remove.
* doc/fosdem/fsb-logo-guile-guix-mes.png: Remove.
* doc/fosdem/fsb-logo-guile-guix-mes.xcf: Remove.
* doc/fosdem/fsb-logo.png: Remove.
* doc/fosdem/guix-build-bootstrap-tarballs.log: Remove.
* doc/fosdem/mes.png: Remove.
* doc/fosdem/mes.xcf: Remove.

20 months agobuild: Remove tinycc/test2 import.
Jan Nieuwenhuizen [Thu, 26 Jul 2018 17:36:03 +0000 (19:36 +0200)]
build: Remove tinycc/test2 import.

* scaffold/tinycc/: Remove.
* build-aux/check-mescc.sh: Remove tinycc testing.
* build-aux/check-tcc.sh: New file.
* build-aux/check.sh.in: Use it.
* build-aux/config.sh: Update.
* build-aux/export.make: Update.

20 months agoAdd missing copyright headers and READMEs.
Jan Nieuwenhuizen [Thu, 26 Jul 2018 17:17:12 +0000 (19:17 +0200)]
Add missing copyright headers and READMEs.

* ChangeLog: Add copyright header.
* build-aux/GNUmakefile.in (generate-ChangeLog): Append it as copyright footer.
* BOOTSTRAP: Add copyright header.
* scaffold/boot/2f-define-second-lambda.scm: Likewise.
* scaffold/boot/39-global-define-override.scm: Likewise.
* scaffold/boot/3a-global-define-lambda-override.scm: Likewise.
* scaffold/boot/4f-string-split.scm: Likewise.
* scaffold/boot/numbers.scm: Likewise.
* scaffold/gc.scm: Likewise.
* scaffold/b-0.mes: Remove.
* doc/GNU-EVAL-APPLY: Remove.
* doc/announce/README: New file.
* doc/announce/ANNOUNCE: Move from doc/ANNOUNCE.
* doc/announce/ANNOUNCE-0.10: Likewise.
* doc/announce/ANNOUNCE-0.11: Likewise.
* doc/announce/ANNOUNCE-0.12: Likewise.
* doc/announce/ANNOUNCE-0.13: Likewise.
* doc/announce/ANNOUNCE-0.14: Likewise.
* doc/announce/ANNOUNCE-0.15: Likewise.
* doc/announce/ANNOUNCE-0.16: Likewise.
* doc/announce/ANNOUNCE-0.3: Likewise.
* doc/announce/ANNOUNCE-0.4: Likewise.
* doc/announce/ANNOUNCE-0.5: Likewise.
* doc/announce/ANNOUNCE-0.6: Likewise.
* doc/announce/ANNOUNCE-0.7: Likewise.
* doc/announce/ANNOUNCE-0.8: Likewise.
* doc/announce/ANNOUNCE-0.9: Likewise.
* doc/announce/ANNOUNCE-2: Likewise.
* doc/announce/UPDATE-0.13: Likewise.
* doc/fosdem/README: New file.
* doc/fosdem/fosdem.org: Add legalese.
* doc/fosdem/fosdem.pdf: Regenerate.
* doc/images/README: New file.
* mes/module/mes/psyntax.pp.header: New file.
* mes/module/mes/psyntax.pp: Add it to generated file.

20 months agobuild: Make build more autotools-like.
Jan Nieuwenhuizen [Wed, 25 Jul 2018 06:14:13 +0000 (08:14 +0200)]
build: Make build more autotools-like.

* build-aux/build.sh.in: Move from ./build.sh
* build-aux/check.sh.in: Likewise.
* build-aux/GNUmakefile.in: Likewise.
* build-aux/install.sh.in: Likewise.
* build-aux/uninstall.sh.in: Likewise.
* configure: Substitute them.
* configure.sh: Likewise.
* build-aux/build-cc.sh: Update: use ${srcdest} instead of ${top_builddest}.
* build-aux/build-cc32.sh: Likewise.
* build-aux/build-guile.sh: Likewise.
* build-aux/build-mes.sh: Likewise.
* build-aux/cc-mes.sh: Likewise.
* build-aux/cc.sh: Likewise.
* build-aux/cc32-mes.sh: Likewise.
* build-aux/check-boot.sh: Likewise.
* build-aux/check-mes.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* build-aux/config.sh: Likewise.
* build-aux/export.make: Likewise.
* build-aux/mes-snarf.scm: Likewise.
* build-aux/pre-inst-env.in: Likewise.
* build-aux/test.sh: Likewise.
* build-aux/trace.sh: Likewise.
* module/mescc/mescc.scm: Likewise.
* scripts/mescc.in: Likewise.
* src/mes.c: Likewise.
* .gitignore: Likewise.

20 months agobuild: Support all `Standard targets' for users.
Jan Nieuwenhuizen [Mon, 23 Jul 2018 18:03:57 +0000 (20:03 +0200)]
build: Support all `Standard targets' for users.

* GNUmakefile (distclean mostlyclean, maintainer-clean, html, dvi, ps,
  install-dvi, install-ps, install-html, installcheck): New target.
  (install-info): Remove fake target.
* configure (parse-opts): Add --srcdir.

xx

20 months agoAdd taken-from-Binutils and copyright line to alloca.c
Jan Nieuwenhuizen [Mon, 23 Jul 2018 17:13:40 +0000 (19:13 +0200)]
Add taken-from-Binutils and copyright line to alloca.c

* lib/stdlib/alloca.c: Add `taken from binutils' and copyright line to
  alloca.c for minor changes.

20 months agoRelicense some taken-from-GNU Guile LGPLv3+ files to GPLv3+.
Jan Nieuwenhuizen [Thu, 26 Jul 2018 18:47:46 +0000 (20:47 +0200)]
Relicense some taken-from-GNU Guile LGPLv3+ files to GPLv3+.

* mes/module/mes/pmatch.scm: Relicense to GPLv3+.
* mes/module/sxml/xpath.scm: Likewise.
* mes/module/mes/peg/cache.scm: Likewise.
* mes/module/mes/peg/codegen.scm: Likewise.
* mes/module/mes/peg/simplify-tree.scm: Likewise.
* mes/module/mes/peg/string-peg.scm: Likewise.
* mes/module/mes/peg/using-parsers.scm: Likewise.

20 months agoRelicense some taken-from-GNU Guile LGPLv2+ files to GPLv3+.
Jan Nieuwenhuizen [Mon, 23 Jul 2018 17:11:45 +0000 (19:11 +0200)]
Relicense some taken-from-GNU Guile LGPLv2+ files to GPLv3+.

* mes/module/mes/pretty-print.scm: Relicense to GPLv3+.
* mes/module/mes/psyntax.ss: Likewise.
* mes/module/srfi/srfi-1.scm: Likewise.
* mes/module/srfi/srfi-16.scm: Likewise.
* mes/module/srfi/srfi-26.scm: Likewise.
* module/mes/getopt-long.scm: Likewise.

20 months agoAdd missing copyright headers.
Jan Nieuwenhuizen [Mon, 23 Jul 2018 17:10:34 +0000 (19:10 +0200)]
Add missing copyright headers.

* .dir-locals.el: Add copyright header.
* AUTHORS: Likewise.
* HACKING: Likewise.
* INSTALL: Likewise.
* README: Likewise.
* build-aux/export.make: Likewise.
* build-aux/setup-mes.sh: Likewise.
* configure.sh: Likewise.
* install.sh: Likewise.
* scaffold/tests/90-goto-var.c: Likewise.
* scaffold/tests/91-goto-array.c: Likewise.
* tests/read.test: Likewise.
* uninstall.sh: Likewise.
* doc/fosdem/beamercolorthemeX.sty:
* doc/fosdem/beamerthemeX.sty:
* doc/fosdem/html.sty: Remove.
* doc/fosdem/README: New file.
* doc/images/README: New file.

20 months agoGNU Mes.
Jan Nieuwenhuizen [Sun, 22 Jul 2018 12:24:36 +0000 (14:24 +0200)]
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

20 months agobuild: Support uninstall.
Jan Nieuwenhuizen [Sun, 22 Jul 2018 15:00:22 +0000 (17:00 +0200)]
build: Support uninstall.

* uninstall.sh: New file.
* GNUmakefile (uninstall): Use it in new target.

20 months agobuild: Generate gcc-mesboot-graph from .dot.
Jan Nieuwenhuizen [Sun, 22 Jul 2018 20:27:24 +0000 (22:27 +0200)]
build: Generate gcc-mesboot-graph from .dot.

* doc/images/gcc-mesboot-graph.dot: New file.
* doc/images/gcc-mesboot-graph.png: Remove.
* GNUmakefile (${top_builddest}doc/images/gcc-mesboot-graph.png): New target.
* configure (det): Add check.
* build-aux/export.make: Export it.
* doc/mes.texi (The Mes Bootstrap Process): Describe new recipe.
* guix/git/mes.scm (mes): Add graphvis dependency.

20 months agoguix: Refactor package setup.
Jan Nieuwenhuizen [Sun, 22 Jul 2018 06:41:48 +0000 (08:41 +0200)]
guix: Refactor package setup.

Next to the convenient environment setup and package build from git

   guix environment -l .guix.scm
   guix build -f .guix.scm

we can now also build other included packages

    GUIX_PACKAGE_PATH=guix guix build mes@0.17
    GUIX_PACKAGE_PATH=guix guix build nyacc@0.80.42

* guix/git/mes.scm: Move from .guix.scm, make a module.
* .guix.scm: Move from guix.scm, use it.
* build-aux/manifest.scm: Update location.
* build-aux/pre-inst-env.in: Support it.
* configure: Check for guix.
* build-aux/export.make: Export GUIX.
* GNUmakefile (update-hash): New target.

20 months agobuild: Respect --docdir.
Jan Nieuwenhuizen [Sun, 22 Jul 2018 12:44:50 +0000 (14:44 +0200)]
build: Respect --docdir.

* configure: Respect --docdir.

20 months agobuild: Support --srcdir build.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 22:43:39 +0000 (00:43 +0200)]
build: Support --srcdir build.

* build-aux/config.sh: New file.
* build-aux/trace.sh: New file.
* build-aux/GNUmakefile.in: New file.
* configure: Support srcdir configure.
* GNUmakefile: Support srcdir build.
* build-aux/build-cc.sh: Likewise.
* build-aux/build-cc32.sh: Likewise.
* build-aux/build-guile.sh: Likewise.
* build-aux/build-mes.sh: Likewise.
* build-aux/cc-mes.sh: Likewise.
* build-aux/cc.sh: Likewise.
* build-aux/cc32-mes.sh: Likewise.
* build-aux/check-mes.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* build-aux/export.make: Likewise.
* build-aux/mes-snarf.scm: Likewise.
* build-aux/pre-inst-env.in: Likewise.
* build-aux/test.sh: Likewise.
* build.sh: Likewise.
* check.sh: Likewise.
* install.sh: Likewise.
* module/mescc/mescc.scm: Likewise.
* scripts/mescc.in: Likewise.
* src/mes.c: Likewise.

21 months agocore: Prepare for the Hurd.
Jan Nieuwenhuizen [Sat, 30 Jun 2018 11:11:03 +0000 (13:11 +0200)]
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.

20 months agobuild: Install ChangeLog.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 21:56:08 +0000 (23:56 +0200)]
build: Install ChangeLog.

* ChangeLog: New file.
* install.sh: Regenerate it, install it.

20 months agobuild: Refactor configure.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 19:20:48 +0000 (21:20 +0200)]
build: Refactor configure.

* configure: Refactor.

20 months agobuild: Prepare for autoconfiscation.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 16:28:47 +0000 (18:28 +0200)]
build: Prepare for autoconfiscation.

Make build system more in alignment with how autotools work.  This
will make transition easier.

* mes/module/mes/boot-0.scm.in: Update from module/mes/boot-0.scm.
* scripts/mescc.in: Update from scripts/mescc.
* build-aux/pre-inst-env.in: New file.
* build-aux/cc-mes.sh: Use pre-inst-env.
* configure: Substitute new .in files.
* install.sh: Do not substitute mescc, boot-0.scm.

20 months agocore: Document number->string INT-MIN failure with gcc-x86.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 13:20:01 +0000 (15:20 +0200)]
core: Document number->string INT-MIN failure with gcc-x86.

* src/mes.c (scm_symbol_arch, scm_symbol_compiler): New symbol.
  (mes_symbols, bload_env): Add them.
  (scm_symbol_gnuc, scm_symbol_mesc): Remove.
* scaffold/mini-mes.c: Likewise.
* module/mes/mes-0.scm (%arch, %compiler): New public variable.
* tests/srfi-13.test: Expect number->string INT-MIN to fail for
  gcc-x86.
* HACKING (Bugs): Add it.

20 months agobuild: Refactor mes tests.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 11:48:50 +0000 (13:48 +0200)]
build: Refactor mes tests.

* build-aux/check-mes.sh: New file.
* check.sh: Invoke it for Guile and Mes.
* .gitignore: Ignore new guile logs.
* mes/module/mes/boot-0.scm: Ignore some standard Guile options.
* module/mes/test.scm: Make a module.
* tests/base.test: Use it.  Make a module, support invoking with Guile
  or Mes alike.
* tests/boot.test: Likewise.
* tests/catch.test: Likewise.
* tests/closure.test: Likewise.
* tests/cwv.test: Likewise.
* tests/display.test: Likewise.
* tests/fluids.test: Likewise.
* tests/getopt-long.test: Likewise.
* tests/guile.test: Likewise.
* tests/let-syntax.test: Likewise.
* tests/let.test: Likewise.
* tests/match.test: Likewise.
* tests/math.test: Likewise.
* tests/module.test: Likewise.
* tests/optargs.test: Likewise.
* tests/peg.test: Likewise.
* tests/pmatch.test: Likewise.
* tests/psyntax.test: Likewise.
* tests/quasiquote.test: Likewise.
* tests/read.test: Likewise.
* tests/scm.test: Likewise.
* tests/srfi-13.test: Likewise.
* tests/srfi-14.test: Likewise.
* tests/srfi-16.test: Likewise.
* tests/srfi-1.test: Likewise.
* tests/srfi-43.test: Likewise.
* tests/srfi-9.test: Likewise.
* tests/syntax.test: Likewise.
* tests/vector.test: Likewise.
* tests/base.test-guile: Remove.
* tests/boot.test-guile: Remove.
* tests/catch.test-guile: Remove.
* tests/closure.test-guile: Remove.
* tests/cwv.test-guile: Remove.
* tests/display.test-guile: Remove.
* tests/fluids.test-guile: Remove.
* tests/getopt-long.test-guile: Remove.
* tests/guile.test-guile: Remove.
* tests/let-syntax.test-guile: Remove.
* tests/let.test-guile: Remove.
* tests/match.test-guile: Remove.
* tests/math.test-guile: Remove.
* tests/module.test-guile: Remove.
* tests/optargs.test-guile: Remove.
* tests/peg.test-guile: Remove.
* tests/pmatch.test-guile: Remove.
* tests/psyntax.test-guile: Remove.
* tests/quasiquote.test-guile: Remove.
* tests/read.test-guile: Remove.
* tests/scm.test-guile: Remove.
* tests/srfi-13.test-guile: Remove.
* tests/srfi-14.test-guile: Remove.
* tests/srfi-16.test-guile: Remove.
* tests/srfi-1.test-guile: Remove.
* tests/srfi-43.test-guile: Remove.
* tests/srfi-9.test-guile: Remove.
* tests/syntax.test-guile: Remove.
* tests/vector.test-guile: Remove.

20 months agobuild: all-go: Support V=0,1,2.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 10:02:43 +0000 (12:02 +0200)]
build: all-go: Support V=0,1,2.

* build-aux/build-guile.sh: Support V=0,1,2.

20 months agobuild: Fix for handling missing makeinfo.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 09:19:55 +0000 (11:19 +0200)]
build: Fix for handling missing makeinfo.

* configure (main): Update MAKEINFO.

20 months agomescc: fwrite: Increase debug tracing threshold.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 09:16:29 +0000 (11:16 +0200)]
mescc: fwrite: Increase debug tracing threshold.

* lib/libc+tcc.c (fwrite): Increase debug tracing threshold.

20 months agomescc: Add proper includes.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 09:15:48 +0000 (11:15 +0200)]
mescc: Add proper includes.

* include/libmes.h (__mes_debug): Declare.
* lib/libtcc1.c: Add proper includes.
* lib/linux+gnu.c: Likewise.
* lib/m4.c: Likewise.

20 months agocore: Resurrect gcc support.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 08:48:31 +0000 (10:48 +0200)]
core: Resurrect gcc support.

* src/mes.c (MES_ARENA)[POSIX]: Default to 100000000.

20 months agoscaffold: Add proper includes.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 08:47:05 +0000 (10:47 +0200)]
scaffold: Add proper includes.

* scaffold/argv.c: Add proper includes.
* scaffold/malloc.c: Likewise.
* scaffold/micro-mes.c: Likewise.
* scaffold/mini-mes.c: Likewise.
* scaffold/tiny-mes.c: Likewise.

20 months agobuild: cc32: Silence warnings.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 08:41:16 +0000 (10:41 +0200)]
build: cc32: Silence warnings.

* build-aux/build-cc32.sh (CC32_CFLAGS): Silence warnings.

20 months agobuild: Resurrect i686-unknown-linux-gnu-gcc support.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 08:40:00 +0000 (10:40 +0200)]
build: Resurrect i686-unknown-linux-gnu-gcc support.

* build-aux/build-cc32.sh (CC32_CFLAGS): Add -fno-builtin.  Resurrects
  i686-unknown-linux-gnu-gcc.

20 months agomescc: Support verbose int types.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 10:02:16 +0000 (12:02 +0200)]
mescc: Support verbose int types.

* module/mescc/compile.scm (i386:type-alist): Support verbose int types.

20 months agobuild: Separate Mes and Guile modules.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 05:15:52 +0000 (07:15 +0200)]
build: Separate Mes and Guile modules.

* scaffold/gc.scm: Move from guile/gc.scm.
* guile/: Remove.
* module/language/paren.mes: Remove.
* mes/module/mes/base.mes: Move from module/mes/.
* mes/module/mes/boot-0.scm: Likewise.
* mes/module/mes/boot-00.scm: Likewise.
* mes/module/mes/boot-01.scm: Likewise.
* mes/module/mes/boot-02.scm: Likewise.
* mes/module/mes/catch.mes: Likewise.
* mes/module/mes/display.mes: Likewise.
* mes/module/mes/fluids.mes: Likewise.
* mes/module/mes/getopt-long.mes: Likewise.
* mes/module/mes/guile.mes: Likewise.
* mes/module/mes/lalr.mes: Likewise.
* mes/module/mes/lalr.scm: Likewise.
* mes/module/mes/let.mes: Likewise.
* mes/module/mes/match.mes: Likewise.
* mes/module/mes/match.scm: Likewise.
* mes/module/mes/mescc.mes: Likewise.
* mes/module/mes/misc.mes: Likewise.
* mes/module/mes/module.mes: Likewise.
* mes/module/mes/optargs.mes: Likewise.
* mes/module/mes/optargs.scm: Likewise.
* mes/module/mes/peg.mes: Likewise.
* mes/module/mes/peg/cache.scm: Likewise.
* mes/module/mes/peg/codegen.scm: Likewise.
* mes/module/mes/peg/simplify-tree.scm: Likewise.
* mes/module/mes/peg/string-peg.scm: Likewise.
* mes/module/mes/peg/using-parsers.scm: Likewise.
* mes/module/mes/pmatch.mes: Likewise.
* mes/module/mes/pmatch.scm: Likewise.
* mes/module/mes/posix.mes: Likewise.
* mes/module/mes/pretty-print.mes: Likewise.
* mes/module/mes/pretty-print.scm: Likewise.
* mes/module/mes/psyntax-0.mes: Likewise.
* mes/module/mes/psyntax-1.mes: Likewise.
* mes/module/mes/psyntax.mes: Likewise.
* mes/module/mes/psyntax.pp: Likewise.
* mes/module/mes/psyntax.ss: Likewise.
* mes/module/mes/quasiquote.mes: Likewise.
* mes/module/mes/quasisyntax.mes: Likewise.
* mes/module/mes/quasisyntax.scm: Likewise.
* mes/module/mes/repl.mes: Likewise.
* mes/module/mes/scm.mes: Likewise.
* mes/module/mes/syntax.mes: Likewise.
* mes/module/mes/syntax.scm: Likewise.
* mes/module/mes/test.mes: Likewise.
* mes/module/mes/tiny-0.mes: Likewise.
* mes/module/mes/type-0.mes: Likewise.
* mes/module/mescc/M1.mes: Likewise.
* mes/module/mescc/as.mes: Likewise.
* mes/module/mescc/bytevectors.mes: Likewise.
* mes/module/mescc/compile.mes: Likewise.
* mes/module/mescc/i386/as.mes: Likewise.
* mes/module/mescc/info.mes: Likewise.
* mes/module/mescc/mescc.mes: Likewise.
* mes/module/mescc/preprocess.mes: Likewise.
* mes/module/nyacc/lalr.mes: Likewise.
* mes/module/nyacc/lang/c99/cpp.mes: Likewise.
* mes/module/nyacc/lang/c99/parser.mes: Likewise.
* mes/module/nyacc/lang/c99/pprint.mes: Likewise.
* mes/module/nyacc/lang/calc/parser.mes: Likewise.
* mes/module/nyacc/lang/util.mes: Likewise.
* mes/module/nyacc/lex.mes: Likewise.
* mes/module/nyacc/parse.mes: Likewise.
* mes/module/nyacc/util.mes: Likewise.
* mes/module/rnrs/arithmetic/bitwise.mes: Likewise.
* mes/module/srfi/srfi-0.mes: Likewise.
* mes/module/srfi/srfi-1.mes: Likewise.
* mes/module/srfi/srfi-1.scm: Likewise.
* mes/module/srfi/srfi-13.mes: Likewise.
* mes/module/srfi/srfi-14.mes: Likewise.
* mes/module/srfi/srfi-16.mes: Likewise.
* mes/module/srfi/srfi-16.scm: Likewise.
* mes/module/srfi/srfi-26.mes: Likewise.
* mes/module/srfi/srfi-26.scm: Likewise.
* mes/module/srfi/srfi-43.mes: Likewise.
* mes/module/srfi/srfi-8.mes: Likewise.
* mes/module/srfi/srfi-9.mes: Likewise.
* mes/module/srfi/srfi-9/gnu.mes: Likewise.
* mes/module/sxml/xpath.mes: Likewise.
* mes/module/sxml/xpath.scm: Likewise.
* module/mes/mes-0.scm: Likewise.
* build-aux/build-guile.sh: Update for new layout.
* build-aux/build-mes.sh: Likewise.
* build-aux/check-boot.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* install.sh: Likewise.
* scaffold/boot/51-module.scm: Likewise.
* scaffold/boot/52-define-module.scm: Likewise.
* scripts/mescc: Likewise.
* src/mes.c: Likewise.
* tests/base.test-guile: Likewise.
* tests/boot.test: Likewise.
* tests/srfi-9.test: Likewise.
* mes/include: New symlink.
* mes/lib: New symlink.
* AUTHORS: Update file names.

20 months agocore: typo: Remove trailing 1.
Jan Nieuwenhuizen [Sat, 21 Jul 2018 05:21:31 +0000 (07:21 +0200)]
core: typo: Remove trailing 1.

* include/alloca.h: typo: Remove trailing 1.

20 months agoAdd missing copyright header. Thanks, Mike!
Jan Nieuwenhuizen [Fri, 20 Jul 2018 04:40:51 +0000 (06:40 +0200)]
Add missing copyright header.  Thanks, Mike!

* guile/gc.c: Add missing copyright header.  Thanks, Mike!

20 months agoguix: mes: Updatee to 0.16.1.
Jan Nieuwenhuizen [Thu, 19 Jul 2018 16:46:59 +0000 (18:46 +0200)]
guix: mes: Updatee to 0.16.1.

* guix.scm (mes): Update to 0.16.1.
  (mes.git): Likewise.

20 months agoRelease 0.16.1 v0.16.1
Jan Nieuwenhuizen [Mon, 9 Jul 2018 14:44:06 +0000 (16:44 +0200)]
Release 0.16.1

* configure (VERSION): Bump to 0.16.1.

20 months agodoc: Release update.
Jan Nieuwenhuizen [Tue, 26 Jun 2018 20:22:56 +0000 (22:22 +0200)]
doc: Release update.

* BOOTSTRAP: Update.
* HACKING: Update.
* INSTALL: Update.
* NEWS: Update.
* README: Update.
* scaffold/tests/23-pointer.c: Add (janneke) to copyright line.
* doc/images/gcc-mesboot-graph.png: Update.
* doc/mes.texi (The Mes Bootstrap Process): Describe update.

20 months agobuild: setup-mes.sh: Cater for Debian/stretch too. Thanks, pdewacht!
Jan Nieuwenhuizen [Tue, 10 Jul 2018 19:57:56 +0000 (21:57 +0200)]
build: setup-mes.sh: Cater for Debian/stretch too.  Thanks, pdewacht!

* build-aux/setup-mes.sh: Cater for Debian/stretch too.  Thanks,
  pdewacht!

20 months agocore: Fix segfault on Debian/strectch. Thanks, pdewacht!
Jan Nieuwenhuizen [Tue, 10 Jul 2018 19:52:31 +0000 (21:52 +0200)]
core: Fix segfault on Debian/strectch.  Thanks, pdewacht!

* src/posix.c (execl_): Typo in initialization.  Fixes segfault on
  Debian/strectch.  Thanks, pdewacht!

20 months agodoc: Add html, pdf.
Jan Nieuwenhuizen [Mon, 9 Jul 2018 18:07:38 +0000 (20:07 +0200)]
doc: Add html, pdf.

* GNUmakefile (html, pdf): New target.
* .gitignore: Ignore html, pdf targets.

20 months agodoc: Remarks from Rutger.
Jan Nieuwenhuizen [Mon, 9 Jul 2018 17:59:54 +0000 (19:59 +0200)]
doc: Remarks from Rutger.

* doc/mes.texi: Remarks from Rutger.

20 months agodoc: Further work.
Jan Nieuwenhuizen [Fri, 29 Jun 2018 05:49:59 +0000 (07:49 +0200)]
doc: Further work.

* doc/images/gcc-mesboot-graph.png: New file.
* install.sh: Install it.
* doc/mes.texi (The Mes Bootstrap Process): Show it.
  (Bootstrapping): Add missing Mes direntry.
  (Running the Test Suites): Fix example.
  Fix typos.

20 months agobuild: Handle CFLAGS, CPPFLAGS for Debian.
Jan Nieuwenhuizen [Mon, 9 Jul 2018 09:49:49 +0000 (11:49 +0200)]
build: Handle CFLAGS, CPPFLAGS for Debian.

20 months agobuild: Have configure create a git archive.
Jan Nieuwenhuizen [Mon, 9 Jul 2018 07:57:15 +0000 (09:57 +0200)]
build: Have configure create a git archive.

* configure: Create git archive if necessary.

20 months agobuild: Use GNU style lower case directory configure variable naming.
Jan Nieuwenhuizen [Mon, 9 Jul 2018 08:46:28 +0000 (10:46 +0200)]
build: Use GNU style lower case directory configure variable naming.

* GNUmakefile: Use GNU style lower case directory configure variable naming.
* HACKING: Likewise.
* INSTALL: Likewise.
* build-aux/build-cc.sh: Likewise.
* build-aux/build-cc32.sh: Likewise.
* build-aux/cc-mes.sh: Likewise.
* build-aux/cc.sh: Likewise.
* build-aux/cc32-mes.sh: Likewise.
* build-aux/export.make: Likewise.
* build-aux/setup-mes.sh: Likewise.
* build.sh: Likewise.
* check.sh: Likewise.
* configure: Likewise.
* doc/mes.texi: Likewise.
* install.sh: Likewise.
* scripts/mescc: Likewise.

20 months agobuild: Support Debian build, install.
Jan Nieuwenhuizen [Sat, 7 Jul 2018 15:31:06 +0000 (17:31 +0200)]
build: Support Debian build, install.

* scripts/mescc: Support Debian build, install.
* lib/libmes.c (fdgetc): Allow Nyacc/ungetc conflict.
* build-aux/export.make (ARCH): Export.
* build-aux/build-mes.sh: Disable full build for non-bootstrap
  x86-only.
* check.sh (total): Use bash to invoke build-aux/check-mescc.sh.
* build-aux/build-guile.sh (SCM_FILES): Support guile-2.0.
* module/mes/guile.scm (guile-2.0): Support guile-2.0.
* build-aux/build-mes.sh: Use bash.
* build-aux/setup-mes.sh: New file.

20 months agomescc: Be sure to exit upon system* failure.
Jan Nieuwenhuizen [Mon, 9 Jul 2018 07:25:38 +0000 (09:25 +0200)]
mescc: Be sure to exit upon system* failure.

* module/mescc/mescc.scm (assert-system*): New function.
  (M1->hex2, hex2->elf, M1->blood-elf): Use it.

20 months agobuild: Support $DESTDIR.
Jan Nieuwenhuizen [Fri, 29 Jun 2018 18:38:11 +0000 (20:38 +0200)]
build: Support $DESTDIR.

* build-aux/export.make: export DESTDIR.
* install.sh: Support $DESTDIR.

20 months agobuild: Build and install manual pages.
Jan Nieuwenhuizen [Thu, 28 Jun 2018 21:10:14 +0000 (23:10 +0200)]
build: Build and install manual pages.

* build-aux/export.make: New file.
* GNUmakefile (man): New target.
  (doc): Depend on man.
  include build-aux/export.make, remove exports.
* guix.scm (mes): Add dependency on help2man.
* configure: Check for help2man.
* install.sh: Install manual pages if built.

20 months agodoc: Initial version.
Jan Nieuwenhuizen [Wed, 27 Jun 2018 11:42:47 +0000 (13:42 +0200)]
doc: Initial version.

* doc/mes.texi: New file.
* doc/fdl-1.3.texi: New file.
* AUTHORS: Mention it.
* GNUmakefile (doc, info, install-info): New targets.
* install.sh: Install info if available.
* guix: (mes): Add texinfo to native-inputs.
* configure: Check for makeinfo.

21 months agoguix: mescc-tools: Update to 0.5.1.
Jan Nieuwenhuizen [Tue, 26 Jun 2018 21:46:41 +0000 (23:46 +0200)]
guix: mescc-tools: Update to 0.5.1.

* guix.scm (mescc-tools): Update to 0.5.1.

21 months agoguix: Oops, fix nyacc-for-mes checksum. Thanks, pdewacht!
Jan Nieuwenhuizen [Tue, 26 Jun 2018 21:45:59 +0000 (23:45 +0200)]
guix: Oops, fix nyacc-for-mes checksum.  Thanks, pdewacht!

* guix.scm (nyacc-for-mes): Fix checksum.

21 months agoguix: Update mes to 0.16.
Jan Nieuwenhuizen [Tue, 26 Jun 2018 18:04:24 +0000 (20:04 +0200)]
guix: Update mes to 0.16.

* guix.scm (mes): Update to 0.16.
  (mes.git): Likewise.

21 months agoRelease 0.16. v0.16
Jan Nieuwenhuizen [Mon, 25 Jun 2018 17:27:19 +0000 (19:27 +0200)]
Release 0.16.

* configure (VERSION): Bump to 0.16.

21 months agodoc: Release update.
Jan Nieuwenhuizen [Sun, 24 Jun 2018 11:13:13 +0000 (13:13 +0200)]
doc: Release update.

* BOOTSTRAP: Update.
* HACKING: Update.
* INSTALL: Update.
* NEWS: Update.
* README: Update.
* doc/ANNOUNCE-0.16: New file.

21 months agocore: Fix compile warnings.
Jan Nieuwenhuizen [Tue, 26 Jun 2018 04:19:51 +0000 (06:19 +0200)]
core: Fix compile warnings.

* lib/libmes.c: Fix warning.
* src/posix.c (execl_): Fix warning, add debug printing.

21 months agocore: execl_: Allow 1000 arguments.
Jan Nieuwenhuizen [Tue, 26 Jun 2018 04:05:20 +0000 (06:05 +0200)]
core: execl_: Allow 1000 arguments.

* src/posix.c (execl_): Allow 1000 arguments.

21 months agomescc: Support binutils 2.10.1: strrchr: Stop at start of string.
Jan Nieuwenhuizen [Sun, 24 Jun 2018 15:25:46 +0000 (17:25 +0200)]
mescc: Support binutils 2.10.1: strrchr: Stop at start of string.

* lib/libc+tcc.c (strrchr): Stop at start of string.
* scaffold/tests/88-strrchr.c: Test it.
* build-aux/check-mescc.sh (tests): Run it.

21 months agobuild: Support tcc, create tinycc-seed with tcc.
Jan Nieuwenhuizen [Sun, 24 Jun 2018 07:28:23 +0000 (09:28 +0200)]
build: Support tcc, create tinycc-seed with tcc.

* configure: check for tcc.
* build-aux/cc32-mes.sh: Rename from cc-mes-gcc.sh.  Support
  tcc.  Update users.
* build-aux/build-cc32-mes.sh: Rename from build-mes-gcc.sh.  Update users.
* GNUmakefile (mes-tcc): New target.
* .gitignore: Ignore mes-tcc arch output.
* lib/crt1.c (_start): Add "rm" constraint so satisfy tcc.
* lib/linux-gcc.c (_sys_call, _sys_call1 _sys_call2 _sys_call3): Likewise.

21 months agomescc: Support glibc-2.2.5: header tweaks.
Jan Nieuwenhuizen [Wed, 20 Jun 2018 22:27:27 +0000 (00:27 +0200)]
mescc: Support glibc-2.2.5: header tweaks.

* include/sys/types.h [__PTRDIFF_T]: Extra guard for ptrdiff_t.
  [__SIZE_T]: Extra guard for size_t.
* include/stdlib.h: Include alloca; remove alloca prototype,
* include/errno.h: Add E2BIG.

21 months agomescc: Support binutils 2.20.1: vfprint, vsprintf: %llx.
Jan Nieuwenhuizen [Sun, 24 Jun 2018 15:26:53 +0000 (17:26 +0200)]
mescc: Support binutils 2.20.1: vfprint, vsprintf: %llx.

* lib/libc+tcc.c (vfprintf, vsprintf): Handle %%llx.  Print error:
  should we skip another int, va_arg a long long?

21 months agomescc: Support binutils 2.14: vfprint, vsprintf: %12.10d.
Jan Nieuwenhuizen [Wed, 20 Jun 2018 22:27:49 +0000 (00:27 +0200)]
mescc: Support binutils 2.14: vfprint, vsprintf: %12.10d.

* lib/libc+tcc.c (vfprintf, vsprintf): Handle %12.10d.
* scaffold/tests/70-printf.c: Test it.

21 months agomescc: Support gnu toolchain: libtcc1.
Jan Nieuwenhuizen [Tue, 19 Jun 2018 18:29:25 +0000 (20:29 +0200)]
mescc: Support gnu toolchain: libtcc1.

* lib/libtcc1.c: New file.
* lib/libc+tcc-gcc.c: Remove libtcc1 stubs.

21 months agomescc: Support binutils-2.20.1a: header tweaks.
Jan Nieuwenhuizen [Tue, 19 Jun 2018 18:23:38 +0000 (20:23 +0200)]
mescc: Support binutils-2.20.1a: header tweaks.

* include/signal.h: Include sys/types.h; remove type declaration copies.
* include/stdarg.h: Likewise.
* include/stdio.h: Likewise.
* include/stdlib.h: Likewise.
* include/unistd.h: Likewise.

21 months agomescc: Support Tinycc 0.9.27: Drop dlclose, dlopen.
Jan Nieuwenhuizen [Mon, 18 Jun 2018 20:56:06 +0000 (22:56 +0200)]
mescc: Support Tinycc 0.9.27: Drop dlclose, dlopen.

* lib/libc+tcc.c (dlclose, dlopen): Remove.
* include/dlfcn.h (RTLD_DEFAULT): Add.

21 months agocore: Resurrect dump-tiny.
Jan Nieuwenhuizen [Mon, 18 Jun 2018 20:55:23 +0000 (22:55 +0200)]
core: Resurrect dump-tiny.

* src/reader.c (dump): Resurrect dump-tiny.

21 months agocore: Resurrect loading of boot-0.32-mo.
Jan Nieuwenhuizen [Mon, 18 Jun 2018 16:55:59 +0000 (18:55 +0200)]
core: Resurrect loading of boot-0.32-mo.

21 months agomescc: Support binutils 2.25: fseek: Add debug printing.
Jan Nieuwenhuizen [Sun, 17 Jun 2018 12:17:39 +0000 (14:17 +0200)]
mescc: Support binutils 2.25: fseek: Add debug printing.

* lib/libc+tcc.c (fseek): Add debug printing.

21 months agomescc: Tinycc support: bcopy: Do not return void.
Jan Nieuwenhuizen [Sun, 17 Jun 2018 12:16:05 +0000 (14:16 +0200)]
mescc: Tinycc support: bcopy: Do not return void.

* lib/m4.c (bcopy): Do not return void.  Helps tcc.

21 months agomescc: Support binutils 2.25: memcmp: Support size 0.
Jan Nieuwenhuizen [Sun, 17 Jun 2018 08:18:59 +0000 (10:18 +0200)]
mescc: Support binutils 2.25: memcmp: Support size 0.

* lib/libc+tcc.c (memcmp): Support size 0.

21 months agomescc: Support binutils 2.25: vsscanf: Skip `l'.
Jan Nieuwenhuizen [Sun, 17 Jun 2018 07:26:34 +0000 (09:26 +0200)]
mescc: Support binutils 2.25: vsscanf: Skip `l'.

* lib/libc+tcc.c (vsscanf): Skip `l'.

21 months agomescc: Debugging oops.
Jan Nieuwenhuizen [Sun, 17 Jun 2018 06:39:31 +0000 (08:39 +0200)]
mescc: Debugging oops.

* lib/libc.c (__mes_debug): Oops, wrong direction.

21 months agomescc: Support binutils 2.15a: fread: read ungetc'd chars too.
Jan Nieuwenhuizen [Sat, 16 Jun 2018 18:51:16 +0000 (20:51 +0200)]
mescc: Support binutils 2.15a: fread: read ungetc'd chars too.

* lib/libmes.c (_ungetc_fd): New variable.
  (fdgetc): Use it.
  (_fdungetc_p): New function.
* lib/libc+tcc.c (_fungetc_p): New function.
* lib/libc+tcc.c (fread): Use it to read ungetc'd chars too.

21 months agomescc: Add another fopen test.
Jan Nieuwenhuizen [Sat, 16 Jun 2018 14:12:51 +0000 (16:12 +0200)]
mescc: Add another fopen test.

* scaffold/tests/98-fopen.c: New file.
* build-aux/check-mescc.sh (tests): Add it.
* AUTHORS: Mention it.

21 months agomescc: Add fopen test.
Jan Nieuwenhuizen [Sat, 16 Jun 2018 13:18:27 +0000 (15:18 +0200)]
mescc: Add fopen test.

* scaffold/tests/97-fopen.c: New file.
* build-aux/check-mescc.sh (tests): Run it.
* include/unistd.h (link): Declare.

21 months agomescc: Support binutils-2.14: fopen: Return 0 upon failure.
Jan Nieuwenhuizen [Sat, 16 Jun 2018 08:54:59 +0000 (10:54 +0200)]
mescc: Support binutils-2.14: fopen: Return 0 upon failure.

* lib/libc+tcc.c (fopen): Return 0 upon failure.

21 months agomescc: Update elf32-header for linux-4.17.
Jan Nieuwenhuizen [Sat, 16 Jun 2018 06:32:12 +0000 (08:32 +0200)]
mescc: Update elf32-header for linux-4.17.

Previously, our binaries showed this

    $ readelf -s scaffold/main.mes-out
    There are 2 program headers, starting at offset 64

    Program Headers:
      Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
      LOAD           0x000000 0x01000000 0x01000000 0x0557c 0x0557c RWE 0x1
      LOAD           0x000000 0x01000000 0x01000000 0x0557c 0x0557c RWE 0x1

     Section to Segment mapping:
      Segment Sections...
       00     .text .data
       01     .text .data

Linux-4.17 refuses to run this and says

    Uhuuh, elf segment at 0000000001000000 requested but the memory is mapped already
    Segmentation fault

* lib/x86-mes/elf32-header.hex2: Remove unused data program header.

21 months agobuild: make seed: Update mescc-tools-seed too.
Jan Nieuwenhuizen [Sat, 16 Jun 2018 04:37:20 +0000 (06:37 +0200)]
build: make seed: Update mescc-tools-seed too.

21 months agoguix: mescc-tools: Update to 0.5.
Jan Nieuwenhuizen [Sat, 16 Jun 2018 07:44:42 +0000 (09:44 +0200)]
guix: mescc-tools: Update to 0.5.

* guix.scm (mescc-tools): Update to 0.5.

21 months agoUpdate for mescc-tools-0.5.
Jan Nieuwenhuizen [Sat, 16 Jun 2018 04:38:05 +0000 (06:38 +0200)]
Update for mescc-tools-0.5.

* build-aux/build-mes.sh (HEX2FLAGS): Remove = from flags.
* build.sh (HEX2FLAGS): Likewise.
* module/mescc/mescc.scm (hex2->elf): Likewise.

21 months agoguix: Update mes to 0.15.
Jan Nieuwenhuizen [Mon, 11 Jun 2018 17:13:12 +0000 (19:13 +0200)]
guix: Update mes to 0.15.

* guix.scm (mes): Update to 0.15.
  (mes.git): Likewise.