diff -ruw /dev/null gcc-git-devel-modula2/libgm2/ChangeLog
--- /dev/null	2022-08-24 16:22:16.888000070 +0100
+++ gcc-git-devel-modula2/libgm2/ChangeLog	2022-10-07 20:21:18.730097923 +0100
@@ -0,0 +1,506 @@
+2022-05-18  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Corrected dates on all source files.
+	* libm2pim/Selective.c: Reformatted comments.
+	* libm2pim/SysExceptions.c: Reformatted comments.
+	* libm2pim/dtoa.c: Reformatted comments.
+	* libm2pim/ldtoa.c: Reformatted comments.
+	* libm2pim/sckt.c: Reformatted comments.
+	* libm2pim/termios.c: Reformatted comments.
+	* libm2pim/wrapc.c: Reformatted comments.
+	* libm2pim/termios.c: Reformatted comments within enum.
+	* libm2pim/Selective.c: Correct spelling.
+	* libm2pim/termios.c: Use GNU comment formatting.
+
+2022-05-17  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Corrected dates on all source files.
+
+2022-03-02  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2pim/sckt.c (tcpServerEstablishPort): Corrected spelling.
+	(tcpServerEstablish) Corrected spelling.
+
+2021-06-27  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.am: renamed getopt.c to cgetopt.c.
+
+2021-05-29  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.in: (rebuilt).
+	* aclocal.m4: (rebuilt).
+	* configure: (rebuilt).
+	* configure.ac: tidied up messages.  Removed android
+	from the list of supported hosts.  Corrected a comment
+	* libm2pim/Makefile.am: Conditionally build.
+	* libm2cor/Makefile.am: Conditionally build.
+	* libm2log/Makefile.am: Conditionally build.
+	* libm2iso/Makefile.am: Conditionally build.
+	* libm2cor/Makefile.in: (Rebuilt).
+	* libm2iso/Makefile.in: (Rebuilt).
+	* libm2log/Makefile.in: (Rebuilt).
+	* libm2min/Makefile.in: (Rebuilt).
+	* libm2pim/Makefile.in: (Rebuilt).
+
+2021-05-28  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.in: (Rebuilt).
+	* aclocal.m4: (Rebuilt).
+	* configure: (Rebuilt).
+	* configure.ac: Introduce checks for supported host
+	operating system and also known detect target architectures
+	which are currently restricted to minimal runtime libraries.
+	* libm2cor/Makefile.in: (Rebuilt).
+	* libm2iso/Makefile.in: (Rebuilt).
+	* libm2log/Makefile.in: (Rebuilt).
+	* libm2min/Makefile.in: (Rebuilt).
+	* libm2pim/Makefile.in: (Rebuilt).
+
+2021-02-12  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2iso/RTco.c: (threadSem) new declaration
+        and implmentation of thread semaphores used internally by
+        the m2 runtime system.
+
+2021-01-13  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.am: Updated dates.
+	* aclocal.m4: (Rebuilt).
+	* autogen.sh: Updated dates.
+	* configure: (Rebuilt).
+	* configure.ac: Updated dates.
+	* libm2cor/KeyBoardLEDs.c: Updated dates.
+	* libm2cor/Makefile.am: Updated dates.
+	* libm2iso/ChanConsts.h: Updated dates.
+	* libm2iso/ErrnoCategory.c: Updated dates.
+	* libm2iso/Makefile.am: Updated dates.
+	* libm2iso/RTco.c: Updated dates.
+	* libm2iso/wrapsock.c: Updated dates.
+	* libm2iso/wraptime.c: Updated dates.
+	* libm2log/Break.c: Updated dates.
+	* libm2log/Makefile.am: Updated dates.
+	* libm2min/Makefile.am: Updated dates.
+	* libm2min/libc.c: Updated dates.
+	* libm2pim/Makefile.am: Updated dates.
+	* libm2pim/Selective.c: Updated dates.
+	* libm2pim/SysExceptions.c: Updated dates.
+	* libm2pim/UnixArgs.c: Updated dates.
+	* libm2pim/dtoa.c: Updated dates.
+	* libm2pim/errno.c: Updated dates.
+	* libm2pim/getopt.c: Updated dates.
+	* libm2pim/ldtoa.c: Updated dates.
+	* libm2pim/sckt.c: Updated dates.
+	* libm2pim/target.c: Updated dates.
+	* libm2pim/termios.c: Updated dates.
+	* libm2pim/wrapc.c: Updated dates.
+
+2020-11-20  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.in: (Rebuilt).
+	* aclocal.m4: (Rebuilt).
+	* configure: (Rebuilt).
+	* configure.ac: (libtool_VERSION=17.0.0)
+
+2020-06-18  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.in: (Rebuilt).
+	* aclocal.m4: (Rebuilt).
+	* autogen.sh: Execute automake including dependencies.
+	* configure: (Rebuilt).
+	* libm2cor/Makefile.in: (Rebuilt).
+	* libm2iso/Makefile.in: (Rebuilt).
+	* libm2log/Makefile.am: SYSTEM.def is a dependency using
+	  BUILT_SOURCES.
+	* libm2log/Makefile.in: (Rebuilt).
+	* libm2min/Makefile.in: (Rebuilt).
+	* libm2pim/Makefile.in: (Rebuilt).
+
+2020-06-15  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2pim/Makefile.am: Added SYSTEM.def as a dependency.
+	* libm2log/Makefile.am: Added SYSTEM.def as a dependency.
+
+2020-06-11  Matthias Klose  <doko@ubuntu.com>
+
+	* Makefile.am: Reordered libraries.
+	* Makefile.in: (Rebuilt).
+	* libm2pim/Makefile.am: (libm2pim_la_LIBADD) Added
+          definition.
+	* libm2pim/Makefile.in: (Rebuilt).
+
+2020-05-01  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2cor/KeyBoardLEDs.c: Include sys/ioctl.h
+          and stdio.h to fix implicit declarations of ioctl and
+	  perror.
+	* libm2iso/RTco.c: Include <sys/select.h>.
+	* libm2pim/SysExceptions.c: (HAVE_STDIO_H) Checked
+	  and stdio.h included to fix perror implicit declaration.
+
+2020-04-29  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2pim/wrapc.c: (HAVE_SYS_TYPES_H) checked to include
+          sys/types.h.  (HAVE_TIME_H) checked to include time.h.
+          Fixes missing prototype errors.  (HAVE_UNISTD_H) checked
+	  to include unistd.h to fix getuid missing prototype.
+
+2020-01-08  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2min/libc.c: (exit) noreturn added.
+	  (abort) noreturn added.
+
+2019-12-10  Matthias Klose  <doko@ubuntu.com>
+
+	* libm2cor/Makefile.am: (libsubdir) Corrected using
+	  target_alias.
+	* libm2iso/Makefile.am: (libsubdir) Corrected using
+	  target_alias.
+	* libm2log/Makefile.am: (libsubdir) Corrected using
+	  target_alias.
+	* libm2min/Makefile.am: (libsubdir) Corrected using
+	  target_alias.
+	* libm2pim/Makefile.am: (libsubdir) Corrected using
+	  target_alias.
+	* libm2cor/Makefile.in: Regenerated.
+	* libm2iso/Makefile.in: Regenerated.
+	* libm2log/Makefile.in: Regenerated.
+	* libm2min/Makefile.in: Regenerated.
+	* libm2pim/Makefile.in: Regenerated.
+
+2019-12-10  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2iso/RTco.c: Corrected include files
+          for target building.
+
+2019-12-09  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* configure.ac: Remove reference to config dir.
+          (ACX_NONCANONICAL_TARGET) Removed.
+	* libm2cor/Makefile.in: Regenerated.
+	* libm2iso/Makefile.in: Regenerated.
+	* libm2log/Makefile.in: Regenerated.
+	* libm2min/Makefile.in: Regenerated.
+	* libm2pim/Makefile.in: Regenerated.
+	* configure.ac: (LT_INIT) Used instead of AM_PROG_LIBTOOL.
+	* libm2cor/Makefile.in: Regenerated.
+	* libm2iso/Makefile.in: Regenerated.
+	* libm2log/Makefile.in: Regenerated.
+	* libm2min/Makefile.in: Regenerated.
+	* libm2pim/Makefile.in: Regenerated.
+
+2019-12-04  Matthias Klose  <doko@ubuntu.com>
+
+	* Makefile.in: Regenerated.
+	* aclocal.m4: Regenerated from automake-1.15.1.
+	* libm2cor/Makefile.am: Added -version-info.
+	* libm2cor/Makefile.in: Regenerated.
+	* libm2iso/Makefile.am: Added -version-info.
+	* libm2iso/Makefile.in: Regenerated.
+	* libm2log/Makefile.am: Added -version-info.
+	* libm2log/Makefile.in: Regenerated.
+	* libm2min/Makefile.am: Added -version-info.
+	* libm2min/Makefile.in: Regenerated.
+	* libm2pim/Makefile.am: Added -version-info.
+	* libm2pim/Makefile.in: Regenerated.
+
+2019-12-03  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2min/Makefile.am: (M2LIBDIR) Corrected
+          destination directory to m2/m2min.
+
+2019-11-19  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* multilib fixes
+	* Makefile.am: (MULTIBUILDTOP) propagate.
+	* Makefile.in: (Regenerated).
+	* configure: (Regenerated).
+	* configure.ac: (ACX_NONCANONICAL_TARGET) Removed.
+	* libm2cor/Makefile.am: (MULTIBUILDTOP) Propagate.
+	* libm2cor/Makefile.in: (Regenerated).
+	* libm2iso/Makefile.am: (MULTIBUILDTOP) Propagate.
+	* libm2iso/Makefile.in: (Regenerated).
+	* libm2log/Makefile.am: (MULTIBUILDTOP) Propagate.
+	* libm2log/Makefile.in: (Regenerated).
+	* libm2min/Makefile.am: (MULTIBUILDTOP) Propagate.
+	* libm2min/Makefile.in: (Regenerated).
+	* libm2pim/Makefile.am: (MULTIBUILDTOP) Propagate.
+	* libm2pim/Makefile.in: (Regenerated).
+
+2019-11-18  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* configure: (Regenerated).
+	* configure.ac: (libtool_VERSION=15.0.0).
+	Place AM_ENABLE_MULTILIB above GCC_NO_EXECUTABLES.
+
+2019-11-13  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2pim/Selective.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/SysExceptions.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/UnixArgs.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/dtoa.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/errno.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/getopt.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/ldtoa.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/sckt.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/target.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/termios.c: Changed to GPL3+ and fixed
+	  formatting.
+	* libm2pim/wrapc.c: Changed to GPL3+ and fixed
+	  formatting.
+
+2019-11-12  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libm2cor/KeyBoardLEDs.c: GPLv3 and reformatted.
+	* libm2iso/ChanConsts.h: GPLv3 and reformatted.
+	* libm2iso/ErrnoCategory.c: GPLv3 and reformatted.
+	* libm2iso/RTco.c: GPLv3 and reformatted.
+	* libm2iso/wrapsock.c: GPLv3 and reformatted.
+	* libm2iso/wraptime.c: GPLv3 and reformatted.
+	* libm2cor/Makefile.am: GPLv3.
+	* libm2iso/Makefile.am: GPLv3.
+	* libm2log/Makefile.am: GPLv3.
+	* libm2min/Makefile.am: GPLv3.
+	* libm2pim/Makefile.am: GPLv3.
+	* libm2log/Break.c: GPLv3 and reformatted.
+	* libm2min/libc.c: GPLv3 and reformatted.
+
+2019-11-04  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libcor/Makefile.am: (MULTIOSSUBDIR) quote test.
+	* libiso/Makefile.am: (MULTIOSSUBDIR) quote test.
+	* libpim/Makefile.am: (MULTIOSSUBDIR) quote test.
+	* liblog/Makefile.am: (MULTIOSSUBDIR) quote test.
+	* libmin/Makefile.am: (MULTIOSSUBDIR) quote test.
+	* libulm/Makefile.am: (MULTIOSSUBDIR) quote test.
+	* libpth/Makefile.am: (MULTIOSSUBDIR) quote test.
+	* libcor/Makefile.in: Regenerated.
+	* libiso/Makefile.in: Regenerated.
+	* libpim/Makefile.in: Regenerated.
+	* liblog/Makefile.in: Regenerated.
+	* libmin/Makefile.in: Regenerated.
+	* libulm/Makefile.in: Regenerated.
+	* libpth/Makefile.in: Regenerated.
+
+2019-10-25  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libcor/Makefile.am: Added -fm2-g -g.
+	* libiso/Makefile.am: Added -fm2-g -g and include
+          path to include ../
+	* libiso/RTco.c: Call HALT if the thread fails to
+          find itself.  Place initialized inside critical region.
+	* libpim/Makefile.am: Added -fm2-g -g.
+
+2019-09-27  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libulm: Removed.
+	* Makefile.am: Removed Ulm libaraies.
+	* configure.ac: Removed Ulm libaraies.
+
+2019-08-01  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libpim/Makefile.am: (M2MODS) added GetOpt.mod
+          and OptLib.mod.  (M2DEFS) added GetOpt.def,
+          OptLib.def and getopt.def.  (libgm2_la_SOURCES)
+          added wrapc.c and getopt.c.
+
+2019-07-10  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libpth/Makefile.am: Use $(MAKE) rather than make.
+	* libcor/KeyBoardLEDs.c: Reformatted to GNU coding
+          standards.  Also added/corrected empty functions for non
+	  linux targets.  Fixed the GPL comment.
+
+2019-07-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* Makefile.am: (multilib.am) Included.
+
+2019-04-03  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.in: Regenerated.
+	* aclocal.m4: Regenerated.
+	* autogen.sh: Removed version numbers.
+	* config/libtool.m4: New version of the file
+	  taken from libgo/config.
+	* configure: Regenerated.
+	* configure.ac: Updated version numbers.
+	* libcor/Makefile.in: Regenerated.
+	* libiso/Makefile.in: Regenerated.
+	* liblog/Makefile.in: Regenerated.
+	* libmin/Makefile.in: Regenerated.
+	* libpim/Makefile.in: Regenerated.
+	* libulm/Makefile.in: Regenerated.
+
+2019-03-29  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* configure: Regenerated.
+	* configure.ac: Implement --enable-libpth-m2
+	* libpth/Makefile.am: Pass FLAGS_TO_PASS to make.
+          move install rules into pth subdirectory.
+	* libpth/pth/Makefile.am: Added install rules.
+
+2018-11-27  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* libpim/wrapc.c: Reformatted according to GNU
+          coding standards.  Also defended against macro omissions.
+	* libiso/wraptime.c: Fixed function declaration
+	  and erroneous return value.
+
+2018-04-16  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.am: Specify the libtool location.
+	* Makefile.in: Regenerated.
+	* aclocal.m4: Regenerated.
+	* autogen.sh: Corrected script to regenerate
+          using the correct macros and versions of autoconf tools.
+	* configure: Regenerated.
+	* configure.ac: Regenerated.
+	* libcor/Makefile.in: Regenerated.
+	* libiso/Makefile.in: Regenerated.
+	* liblog/Makefile.in: Regenerated.
+	* libmin/Makefile.in: Regenerated.
+	* libpim/Makefile.in: Regenerated.
+	* libulm/Makefile.in: Regenerated.
+
+2018-04-14  Gaius Mulley  <gaius.mulley@southwales.ac.uk>
+
+	* Makefile.am: Changed to reference the config directory.
+	* Makefile.in: Regenerated.
+	* aclocal.m4: Regenerated.
+	* autogen.sh: Added new script.
+	* config.h.in: Regenerated.
+	* configure: Regenerated.
+	* configure.ac: Minor corrections.
+	* libcor/Makefile.am: Use $(LIBTOOL).
+	* libcor/Makefile.in: Regenerated.
+	* libiso/Makefile.am: Use $(LIBTOOL).
+	* libiso/Makefile.in: Regenerated.
+	* liblog/Makefile.am: Use $(LIBTOOL).
+	* liblog/Makefile.in: Regenerated.
+	* libmin/Makefile.am: Use $(LIBTOOL).
+	* libmin/Makefile.in: Regenerated.
+	* libpim/Makefile.am: Use $(LIBTOOL).
+	* libpim/Makefile.in: Regenerated.
+	* libulm/Makefile.am: Use $(LIBTOOL).
+	* libulm/Makefile.in: Regenerated.
+
+2018-04-10  Gaius Mulley  <gaius@gnu.org>
+
+	* configure.ac: Added test to AM_ENABLE_MULTILIB.
+	* Makefile.in: Regenerated.
+	* aclocal.m4: Regenerated.
+	* autogen.sh: Updated.
+	* config.h.in: Regenerated.
+	* configure: Regenerated.
+	* libcor/Makefile.in: Regenerated.
+	* libiso/Makefile.in: Regenerated.
+	* liblog/Makefile.in: Regenerated.
+	* libmin/Makefile.am: Added -fno-m2-plugin
+	* libmin/Makefile.in: Regenerated.
+	* libpim/Makefile.in: Regenerated.
+	* libulm/Makefile.in: Regenerated.
+
+2017-12-27  Gaius Mulley  <gaius@gnu.org>
+
+	* libpim/wrapc.c: (wrapc_isfinite) New function.
+
+2016-06-09  Gaius Mulley  <gaius@gnu.org>
+
+	* libpim/dtoa.c: Use memmove instead of memcpy.
+
+2016-03-14  Gaius Mulley  <gaius@gnu.org>
+
+	* libpim/wrapc.c: Corrected spacing.
+
+2014-12-24  Gaius Mulley  <gaius@gnu.org>
+
+	* sckt.c: Added conditional import of
+	  stdio.h as reported by Christoph Schlegel.
+
+2014-12-23  Gaius Mulley  <gaius@gnu.org>
+
+	* libulm/Makefile.am: Added pim libs to the
+	  path on the createUlmSys command.
+
+2014-12-22  Gaius Mulley  <gaius@gnu.org>
+
+	* libulm/Makefile.am: Added rule to build
+	  SYSTEM.def as a built source.
+
+2014-12-06  Gaius Mulley  <gaius@gnu.org>
+
+	* libcor/Makefile.in: Add .la to list of SUFFIXES.
+	  install .la archive.
+	* libcor/Makefile.am: Install .la archive.
+	* libiso/Makefile.in: Install .la archive.
+	* libiso/Makefile.am: Install .la archive.
+	* liblog/Makefile.am: Install .la archive.
+	* liblog/Makefile.in: Install .la archive.
+	* libmin/Makefile.am: Install .la archive.
+	* libmin/Makefile.in: Install .la archive.
+	* libpim/Makefile.am: Install .la archive.
+	* libpim/Makefile.in: Install .la archive.
+	* libulm/Makefile.am: Install .la archive.
+	* libulm/Makefile.in: Install .la archive.
+
+2014-12-05  Gaius Mulley  <gaius@gnu.org>
+
+	* libmin/Makefile.am: Add .la to the list of SUFFIXES.
+	* libulm/Makefile.am: Add .la to the list of SUFFIXES.
+	* libpim/Makefile.am: Add .la to the list of SUFFIXES.
+	* libcor/Makefile.am: Add .la to the list of SUFFIXES.
+	* liblog/Makefile.am: Add .la to the list of SUFFIXES.
+	* libiso/Makefile.am: Add .la to the list of SUFFIXES.
+
+2014-07-11  Gaius Mulley  <gaius@gnu.org>
+
+	* complete rewrite and restructuring of libgm2.
+	* gcc-versionno/libgm2/aclocal.m4: (Rebuilt)
+	* gcc-versionno/libgm2/autogen.sh: (Rebuilt)
+	* gcc-versionno/libgm2/config.h.in: (New file)
+	* gcc-versionno/libgm2/configure: (Rebuilt)
+	* gcc-versionno/libgm2/configure.ac: (New file)
+	* gcc-versionno/libgm2/libcor: (New directory)
+	* gcc-versionno/libgm2/libiso: (New directory)
+	* gcc-versionno/libgm2/liblog: (New directory)
+	* gcc-versionno/libgm2/libmin: (New directory)
+	* gcc-versionno/libgm2/libpim: (New directory)
+	* gcc-versionno/libgm2/libulm: (New directory)
+	* gcc-versionno/libgm2/Makefile.am: (New file)
+	* gcc-versionno/libgm2/Makefile.in: (rebuilt)
+	* gcc-versionno/libgm2/p2c: (New directory)
+
+2013-12-06  Gaius Mulley  <gaius@gnu.org>
+
+	* gcc-versionno/gcc/gm2/Make-lang.in: Changed flag to -fpim
+	and changed path appropriately.
+
+2013-12-05  Gaius Mulley  <gaius@gnu.org>
+
+	* gm2/libgm2/Makefile.in: Build coroutine version of SYSTEM.def.
+
+2013-10-17  Gaius Mulley  <gaius@gnu.org>
+
+	* gm2/libgm2/Makefile.in: Corrected install of iso SYSTEM.def.
+	Ensure that we copy form the object directory and avoid the
+	template version in the source directory.
+
+2013-09-14  Gaius Mulley  <gaius@gnu.org>
+
+	* gm2/libgm2/Makefile.in: Many changes to allow more libraries
+	to build and also build SYSTEM.def for the pim, iso and min
+	libraries.
+
+2013-07-08  Gaius Mulley  <gaius@gnu.org>
+
+	* gm2/ChangeLog: (New file).
+	* gm2/libgm2/Makefile.in: Added install rules.  Many of which
+	were adapted from gcc/gm2/Make-file.in.
diff -ruw /dev/null gcc-git-devel-modula2/libgm2/config.h.in
--- /dev/null	2022-08-24 16:22:16.888000070 +0100
+++ gcc-git-devel-modula2/libgm2/config.h.in	2022-10-07 20:21:18.734097972 +0100
@@ -0,0 +1,313 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* function access exists */
+#undef HAVE_ACCESS
+
+/* function brk exists */
+#undef HAVE_BRK
+
+/* function cfmakeraw exists */
+#undef HAVE_CFMAKERAW
+
+/* function close exists */
+#undef HAVE_CLOSE
+
+/* function creat exists */
+#undef HAVE_CREAT
+
+/* function ctime exists */
+#undef HAVE_CTIME
+
+/* Define to 1 if you have the <direct.h> header file. */
+#undef HAVE_DIRECT_H
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* function dup exists */
+#undef HAVE_DUP
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* function execve exists */
+#undef HAVE_EXECVE
+
+/* function exit exists */
+#undef HAVE_EXIT
+
+/* function fcntl exists */
+#undef HAVE_FCNTL
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* function fstat exists */
+#undef HAVE_FSTAT
+
+/* function getdents exists */
+#undef HAVE_GETDENTS
+
+/* function getgid exists */
+#undef HAVE_GETGID
+
+/* function getpid exists */
+#undef HAVE_GETPID
+
+/* function gettimeofday exists */
+#undef HAVE_GETTIMEOFD
+
+/* function getuid exists */
+#undef HAVE_GETUID
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* function ioctl exists */
+#undef HAVE_IOCTL
+
+/* function kill exists */
+#undef HAVE_KILL
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#undef HAVE_LANGINFO_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* function link exists */
+#undef HAVE_LINK
+
+/* function lseek exists */
+#undef HAVE_LSEEK
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* have math.h */
+#undef HAVE_MATH_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* function open exists */
+#undef HAVE_OPEN
+
+/* function pause exists */
+#undef HAVE_PAUSE
+
+/* function pipe exists */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* function rand exists */
+#undef HAVE_RAND
+
+/* function read exists */
+#undef HAVE_READ
+
+/* function select exists */
+#undef HAVE_SELECT
+
+/* function setgid exists */
+#undef HAVE_SETGID
+
+/* function setitimer exists */
+#undef HAVE_SETITIMER
+
+/* function setuid exists */
+#undef HAVE_SETUID
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* function signbit exists */
+#undef HAVE_SIGNBIT
+
+/* function signbitf exists */
+#undef HAVE_SIGNBITF
+
+/* function signbitl exists */
+#undef HAVE_SIGNBITL
+
+/* function stat exists */
+#undef HAVE_STAT
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* function strsignal exists */
+#undef HAVE_STRSIGNAL
+
+/* function strtod exists */
+#undef HAVE_STRTOD
+
+/* function strtold exists */
+#undef HAVE_STRTOLD
+
+/* Define to 1 if the system has the type `struct stat'. */
+#undef HAVE_STRUCT_STAT
+
+/* Define to 1 if the system has the type `struct timeval'. */
+#undef HAVE_STRUCT_TIMEVAL
+
+/* Define to 1 if the system has the type `struct timezone'. */
+#undef HAVE_STRUCT_TIMEZONE
+
+/* Define to 1 if you have the <sys/errno.h> header file. */
+#undef HAVE_SYS_ERRNO_H
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* function times exists */
+#undef HAVE_TIMES
+
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* function unlink exists */
+#undef HAVE_UNLINK
+
+/* function wait exists */
+#undef HAVE_WAIT
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* function write exists */
+#undef HAVE_WRITE
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
diff -ruw /dev/null gcc-git-devel-modula2/libgm2/Makefile.am
--- /dev/null	2022-08-24 16:22:16.888000070 +0100
+++ gcc-git-devel-modula2/libgm2/Makefile.am	2022-10-07 20:21:18.730097923 +0100
@@ -0,0 +1,103 @@
+# Makefile for libgm2.
+#   Copyright 2013-2022  Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+#
+#
+# if this file is changed then you need to run
+#
+# autoreconf2.64
+#
+# Modula-2 support.
+AUTOMAKE_OPTIONS = 1.8 foreign
+
+SUFFIXES = .c .mod .def .o .obj .lo .a
+
+ACLOCAL_AMFLAGS = -I . -I .. -I ../config
+
+# Multilib support.
+MAKEOVERRIDES=
+
+AM_CFLAGS = -I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include
+
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+TOP_GCCDIR := $(shell cd $(top_srcdir) && cd .. && pwd)
+
+GCC_DIR = $(TOP_GCCDIR)/gcc
+GM2_SRC = $(GCC_DIR)/m2
+
+toolexeclibdir=@toolexeclibdir@
+toolexecdir=@toolexecdir@
+GM2_FOR_TARGET=@GM2_FOR_TARGET@
+
+SUBDIRS = libm2min libm2log libm2cor libm2iso libm2pim
+GM2_BUILDDIR := $(shell pwd)
+gm2_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+
+# Work around what appears to be a GNU make bug handling MAKEFLAGS
+# values defined in terms of make variables, as is the case for CC and
+# friends when we are called from the top level Makefile.
+AM_MAKEFLAGS = \
+        "GCC_DIR=$(GCC_DIR)" \
+        "GM2_SRC=$(GM2_SRC)" \
+	"AR_FLAGS=$(AR_FLAGS)" \
+	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+	"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
+	"GM2_FOR_TARGET=$(GM2_FOR_TARGET)" \
+	"CFLAGS=$(CFLAGS)" \
+	"CXXFLAGS=$(CXXFLAGS)" \
+	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+	"INSTALL=$(INSTALL)" \
+	"INSTALL_DATA=$(INSTALL_DATA)" \
+	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+	"LDFLAGS=$(LDFLAGS)" \
+	"LIBCFLAGS=$(LIBCFLAGS)" \
+	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+	"MAKE=$(MAKE)" \
+	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+        "MULTIBUILDTOP=$(MULTIBUILDTOP)" \
+        "MULTISUBDIR=$(MULTISUBDIR)" \
+        "MULTIOSDIR=$(MULTIDIR)" \
+        "MULTIFLAGS=$(MULTIFLAGS)" \
+	"PICFLAG=$(PICFLAG)" \
+	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+	"SHELL=$(SHELL)" \
+	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+	"exec_prefix=$(exec_prefix)" \
+	"infodir=$(infodir)" \
+	"libdir=$(libdir)" \
+	"includedir=$(includedir)" \
+	"prefix=$(prefix)" \
+	"tooldir=$(tooldir)" \
+	"gxx_include_dir=$(gxx_include_dir)" \
+	"AR=$(AR)" \
+	"AS=$(AS)" \
+	"LD=$(LD)" \
+	"RANLIB=$(RANLIB)" \
+	"NM=$(NM)" \
+	"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
+	"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
+	"DESTDIR=$(DESTDIR)" \
+	"WERROR=$(WERROR)" \
+        "TARGET_LIB_PATH=$(TARGET_LIB_PATH)" \
+        "TARGET_LIB_PATH_libgm2=$(TARGET_LIB_PATH_libgm2)" \
+	"LIBTOOL=$(GM2_BUILDDIR)/libtool"
+
+# Subdir rules rely on $(FLAGS_TO_PASS)
+FLAGS_TO_PASS = $(AM_MAKEFLAGS)
+
+include $(top_srcdir)/../multilib.am
diff -ruw /dev/null gcc-git-devel-modula2/libgm2/configure.ac
--- /dev/null	2022-08-24 16:22:16.888000070 +0100
+++ gcc-git-devel-modula2/libgm2/configure.ac	2022-10-07 20:21:18.738098020 +0100
@@ -0,0 +1,376 @@
+# Configure script for libgm2.
+# Copyright (C) 2013-2022 Free Software Foundation, Inc.
+
+# This file is part of GCC.
+
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# Configure looks for the existence of this file to auto-config each language.
+# We define several parameters used by configure:
+
+# Process this file with autoreconf to produce a configure script.
+
+AC_INIT(package-unused, version-unused,,libgm2)
+AC_CONFIG_SRCDIR(Makefile.am)
+# AC_CONFIG_MACRO_DIR([config])
+AC_CONFIG_HEADER(config.h)
+
+libtool_VERSION=17:0:0
+AC_SUBST(libtool_VERSION)
+
+AM_ENABLE_MULTILIB(, ..)
+
+GCC_NO_EXECUTABLES
+
+AC_USE_SYSTEM_EXTENSIONS
+
+# Do not delete or change the following two lines.  For why, see
+# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+AC_CANONICAL_SYSTEM
+target_alias=${target_alias-$host_alias}
+AC_SUBST(target_alias)
+
+AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dist -Wall -Wno-portability])
+
+AH_TEMPLATE(PACKAGE, [Name of package])
+AH_TEMPLATE(VERSION, [Version number of package])
+
+AC_ARG_WITH(cross-host,
+[  --with-cross-host=HOST           Configuring with a cross compiler])
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADER([math.h],
+	       [AC_DEFINE([HAVE_MATH_H], [1], [have math.h])])
+
+AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h \
+                 time.h \
+		 fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
+		 sys/resource.h sys/param.h sys/times.h sys/stat.h \
+                 sys/socket.h \
+                 sys/wait.h sys/ioctl.h errno.h sys/errno.h \
+		 pwd.h direct.h dirent.h signal.h malloc.h langinfo.h \
+                 pthread.h stdarg.h stdio.h sys/types.h termios.h \
+                 netinet/in.h netdb.h sys/uio.h sys/stat.h wchar.h)
+
+
+AC_CANONICAL_HOST
+ACX_NONCANONICAL_HOST
+ACX_NONCANONICAL_TARGET
+GCC_TOPLEV_SUBDIRS
+
+AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+AC_ARG_ENABLE(version-specific-runtime-libs,
+[  --enable-version-specific-runtime-libs    Specify that runtime libraries should be installed in a compiler-specific directory ],
+[case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no)  version_specific_libs=no ;;
+ *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+[version_specific_libs=no])
+AC_MSG_RESULT($version_specific_libs)
+
+AC_ARG_WITH(slibdir,
+[  --with-slibdir=DIR      shared libraries in DIR [LIBDIR]],
+slibdir="$with_slibdir",
+if test "${version_specific_libs}" = yes; then
+  slibdir='$(libsubdir)'
+elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
+  slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
+else
+  slibdir='$(libdir)'
+fi)
+AC_SUBST(slibdir)
+
+# Command-line options.
+# Very limited version of AC_MAINTAINER_MODE.
+AC_ARG_ENABLE([maintainer-mode],
+  [AC_HELP_STRING([--enable-maintainer-mode],
+                 [enable make rules and dependencies not useful (and
+                  sometimes confusing) to the casual installer])],
+  [case ${enable_maintainer_mode} in
+     yes) MAINT='' ;;
+     no) MAINT='#' ;;
+     *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
+   esac
+   maintainer_mode=${enableval}],
+  [MAINT='#'])
+AC_SUBST([MAINT])dnl
+
+toolexecdir=no
+toolexeclibdir=no
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${version_specific_libs} in
+  yes)
+    # Need the gcc compiler version to know where to install libraries
+    # and header files if --enable-version-specific-runtime-libs option
+    # is selected.
+    toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
+    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+    ;;
+  no)
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      # Install a library built with a cross compiler in tooldir, not libdir.
+      toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+      toolexeclibdir='$(toolexecdir)/lib'
+    else
+      toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+      toolexeclibdir='$(libdir)'
+    fi
+    multi_os_directory=`$CC -print-multi-os-directory`
+    case $multi_os_directory in
+      .) ;; # Avoid trailing /.
+      *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+    esac
+    ;;
+esac
+
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+
+AH_TEMPLATE(PACKAGE, [Name of package])
+AH_TEMPLATE(VERSION, [Version number of package])
+
+AM_MAINTAINER_MODE
+
+# Check the compiler.
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+AC_PROG_CC
+AC_PROG_CXX
+AM_PROG_AS
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+AC_SUBST(CFLAGS)
+
+# In order to override CFLAGS_FOR_TARGET, all of our special flags go
+# in XCFLAGS.  But we need them in CFLAGS during configury.  So put them
+# in both places for now and restore CFLAGS at the end of config.
+save_CFLAGS="$CFLAGS"
+
+# Find other programs we need.
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(NM, nm)
+AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
+AC_PATH_PROG(PERL, perl, perl-not-found-in-path-error)
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+
+LT_INIT
+AC_LIBTOOL_DLOPEN
+# AM_PROG_LIBTOOL
+AC_SUBST(enable_shared)
+AC_SUBST(enable_static)
+
+AC_CHECK_TYPES([struct timezone, struct stat, struct timeval])
+
+AC_LANG_C
+# Check the compiler.
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+AC_PROG_CC
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+AC_SUBST(CFLAGS)
+
+AC_DEFUN([GM2_UNDEF],[
+  $as_echo "#undef HAVE_$1" >>confdefs.h
+])
+
+AC_DEFUN([GM2_CHECK_LIB],[
+  AC_MSG_CHECKING([m2 front end checking $1 library for $2])
+  if test x$gcc_no_link != xyes; then
+    AC_CHECK_LIB([$1],[$2],[AC_DEFINE([HAVE_$3],[1],[found $2])],[GM2_UNDEF([$3],[$2])])
+  else
+    if test "x$[ac_cv_lib_$1_$2]" = xyes; then
+      AC_DEFINE([HAVE_$3],[1],[lib$1 includes $2])
+    elif test "x$[ac_cv_func_$2]" = xyes; then
+      AC_DEFINE([HAVE_$3],[1],[function $2 exists])
+    else
+      GM2_UNDEF([$3],[$2])
+    fi
+  fi
+])
+
+GM2_CHECK_LIB([c],[access],[ACCESS])
+GM2_CHECK_LIB([c],[brk],[BRK])
+GM2_CHECK_LIB([c],[cfmakeraw],[CFMAKERAW])
+GM2_CHECK_LIB([c],[close],[CLOSE])
+GM2_CHECK_LIB([c],[ctime],[CTIME])
+GM2_CHECK_LIB([c],[creat],[CREAT])
+GM2_CHECK_LIB([c],[dup],[DUP])
+GM2_CHECK_LIB([c],[execve],[EXECVE])
+GM2_CHECK_LIB([c],[exit],[EXIT])
+GM2_CHECK_LIB([c],[fcntl],[FCNTL])
+GM2_CHECK_LIB([c],[fstat],[FSTAT])
+GM2_CHECK_LIB([c],[getdents],[GETDENTS])
+GM2_CHECK_LIB([c],[getgid],[GETGID])
+GM2_CHECK_LIB([c],[getpid],[GETPID])
+GM2_CHECK_LIB([c],[gettimeofday],[GETTIMEOFD])
+GM2_CHECK_LIB([c],[getuid],[GETUID])
+GM2_CHECK_LIB([c],[ioctl],[IOCTL])
+GM2_CHECK_LIB([c],[kill],[KILL])
+GM2_CHECK_LIB([c],[link],[LINK])
+GM2_CHECK_LIB([c],[lseek],[LSEEK])
+GM2_CHECK_LIB([c],[open],[OPEN])
+GM2_CHECK_LIB([c],[pause],[PAUSE])
+GM2_CHECK_LIB([c],[pipe],[PIPE])
+GM2_CHECK_LIB([c],[rand],[RAND])
+GM2_CHECK_LIB([c],[read],[READ])
+GM2_CHECK_LIB([c],[select],[SELECT])
+GM2_CHECK_LIB([c],[setitimer],[SETITIMER])
+GM2_CHECK_LIB([c],[setgid],[SETGID])
+GM2_CHECK_LIB([c],[setuid],[SETUID])
+GM2_CHECK_LIB([c],[stat],[STAT])
+GM2_CHECK_LIB([c],[strsignal],[STRSIGNAL])
+GM2_CHECK_LIB([c],[strtod],[STRTOD])
+GM2_CHECK_LIB([c],[strtold],[STRTOLD])
+GM2_CHECK_LIB([c],[times],[TIMES])
+GM2_CHECK_LIB([c],[unlink],[UNLINK])
+GM2_CHECK_LIB([c],[wait],[WAIT])
+GM2_CHECK_LIB([c],[write],[WRITE])
+
+GM2_CHECK_LIB([m],[signbit],[SIGNBIT])
+GM2_CHECK_LIB([m],[signbitf],[SIGNBITF])
+GM2_CHECK_LIB([m],[signbitl],[SIGNBITL])
+
+AC_MSG_NOTICE([libgm2 has finished checking target libc and libm contents.])
+
+# We test the host here and later on check the target.
+
+# All known M2_HOST_OS values.  This is the union of all host operating systems
+# supported by gm2.
+
+M2_SUPPORTED_HOST_OS="aix freebsd hurd linux netbsd openbsd solaris windows"
+
+M2_HOST_OS=unknown
+
+case ${host} in
+  *-*-darwin*)   M2_HOST_OS=darwin ;;
+  *-*-freebsd*)  M2_HOST_OS=freebsd ;;
+  *-*-linux*)    M2_HOST_OS=linux ;;
+  *-*-netbsd*)	 M2_HOST_OS=netbsd ;;
+  *-*-openbsd*)  M2_HOST_OS=openbsd ;;
+  *-*-solaris2*) M2_HOST_OS=solaris ;;
+  *-*-aix*)      M2_HOST_OS=aix ;;
+  *-*-gnu*)      M2_HOST_OS=hurd ;;
+esac
+
+# M2_HOST_OS=unknown
+if test x${M2_HOST_OS} = xunknown; then
+   AC_MSG_NOTICE([unsupported host, will build a minimal m2 library])
+   BUILD_PIMLIB=false
+   BUILD_ISOLIB=false
+   BUILD_CORLIB=false
+   BUILD_LOGLIB=false
+else
+   AC_MSG_NOTICE([m2 library will be built on ${M2_HOST_OS}])
+   BUILD_PIMLIB=true
+   BUILD_ISOLIB=true
+   BUILD_CORLIB=true
+   BUILD_LOGLIB=true
+fi
+
+CC_FOR_BUILD=${CC_FOR_BUILD:-gcc}
+AC_SUBST(CC_FOR_BUILD)
+
+# Propagate GM2_FOR_TARGET into Makefiles
+GM2_FOR_TARGET=${GM2_FOR_TARGET:-gcc}
+AC_SUBST(GM2_FOR_TARGET)
+
+# Now we check the target as long as it is a supported host.
+# For some embedded targets we choose minimal runtime system which is
+# just enough to satisfy the linker targetting raw metal.
+if test x${M2_HOST_OS} != xunknown; then
+AC_MSG_NOTICE([m2 library building for target ${target}])
+case "$target" in
+
+  avr25*-*-* | avr31*-*-* | avr35*-*-* | avr4*-*-* | avr5*-*-* | avr51*-*-* | avr6*-*-*)
+  BUILD_PIMLIB=false
+  BUILD_ISOLIB=false
+  BUILD_CORLIB=false
+  BUILD_LOGLIB=false
+  ;;
+
+  avrxmega2*-*-* | avrxmega4*-*-* | avrxmega5*-*-* | avrxmega6*-*-* | avrxmega7*-*-*)
+  BUILD_PIMLIB=false
+  BUILD_ISOLIB=false
+  BUILD_CORLIB=false
+  BUILD_LOGLIB=false
+  ;;
+
+  avr3-*-*)
+  BUILD_PIMLIB=true
+  BUILD_ISOLIB=true
+  BUILD_CORLIB=true
+  BUILD_LOGLIB=true
+  ;;
+  esp32-*-*)
+  BUILD_PIMLIB=false
+  BUILD_ISOLIB=false
+  BUILD_CORLIB=false
+  BUILD_LOGLIB=false
+  ;;
+
+esac
+fi
+
+# GM2_MSG_RESULT issue a query message from the first parameter and a boolean result
+# in the second parameter is printed as a "yes" or "no".
+
+AC_DEFUN([GM2_MSG_RESULT],[
+   AC_MSG_CHECKING([$1])
+   if test x${$2} = xtrue; then
+      AC_MSG_RESULT([yes])
+   else
+      AC_MSG_RESULT([no])
+   fi
+])
+
+if test x${M2_HOST_OS} = xunknown; then
+   AC_MSG_NOTICE([m2 front end will only build minimal Modula-2 runtime library on this host])
+else
+   GM2_MSG_RESULT([m2 front end will build PIM libraries:],[BUILD_PIMLIB])
+   GM2_MSG_RESULT([m2 front end will build ISO libraries:],[BUILD_ISOLIB])
+   GM2_MSG_RESULT([m2 front end will build coroutine libraries:],[BUILD_CORLIB])
+   GM2_MSG_RESULT([m2 front end will build Logitech compatability libraries:],[BUILD_LOGLIB])
+fi
+
+AM_CONDITIONAL([BUILD_PIMLIB], [test x$BUILD_PIMLIB = xtrue])
+AM_CONDITIONAL([BUILD_ISOLIB], [test x$BUILD_ISOLIB = xtrue])
+AM_CONDITIONAL([BUILD_CORLIB], [test x$BUILD_CORLIB = xtrue])
+AM_CONDITIONAL([BUILD_LOGLIB], [test x$BUILD_LOGLIB = xtrue])
+
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_FILES([Makefile libm2min/Makefile libm2pim/Makefile libm2iso/Makefile
+                 libm2cor/Makefile libm2log/Makefile])
+
+AC_MSG_NOTICE([libgm2 has been configured.])
+
+AC_OUTPUT
diff -ruw /dev/null gcc-git-devel-modula2/libgm2/autogen.sh
--- /dev/null	2022-08-24 16:22:16.888000070 +0100
+++ gcc-git-devel-modula2/libgm2/autogen.sh	2022-10-07 20:21:18.734097972 +0100
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# autogen.sh regenerate the autoconf files.
+#   Copyright 2013-2022  Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+rm -rf autom4te.cache
+
+# libtoolize
+rm -f aclocal.m4
+# aclocal -I . -I config -I ../config
+aclocal -I . -I ../config
+autoreconf -I . -I ../config
+automake --include-deps
+
+rm -rf autom4te.cache
+
+exit 0
diff -ruw /dev/null gcc-git-devel-modula2/libgm2/libm2cor/Makefile.am
--- /dev/null	2022-08-24 16:22:16.888000070 +0100
+++ gcc-git-devel-modula2/libgm2/libm2cor/Makefile.am	2022-10-07 20:21:18.738098020 +0100
@@ -0,0 +1,156 @@
+# Makefile for libm2cor.
+#   Copyright 2013-2022  Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+SUFFIXES = .c .cc .mod .def .o .obj .lo .a .la
+
+ACLOCAL_AMFLAGS = -I . -I .. -I ../config
+
+VPATH = . @srcdir@ @srcdir@/../../gcc/m2/gm2-libs-coroutines
+
+# Multilib support.
+MAKEOVERRIDES=
+
+version := $(shell $(CC) -dumpversion)
+
+# Directory in which the compiler finds libraries etc.
+libsubdir = $(libdir)/gcc/$(target_alias)/$(version)
+# Used to install the shared libgcc.
+slibdir = @slibdir@
+
+toolexeclibdir=@toolexeclibdir@
+toolexecdir=@toolexecdir@
+GM2_FOR_TARGET=@GM2_FOR_TARGET@
+
+MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
+MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
+
+MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)
+inst_libdir = $(libsubdir)$(MULTISUBDIR)
+inst_slibdir = $(slibdir)$(MULTIOSSUBDIR)
+
+
+# Work around what appears to be a GNU make bug handling MAKEFLAGS
+# values defined in terms of make variables, as is the case for CC and
+# friends when we are called from the top level Makefile.
+AM_MAKEFLAGS = \
+        "GCC_DIR=$(GCC_DIR)" \
+        "GM2_SRC=$(GM2_SRC)" \
+	"AR_FLAGS=$(AR_FLAGS)" \
+	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+	"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
+	"GM2_FOR_TARGET=$(GM2_FOR_TARGET)" \
+	"CFLAGS=$(CFLAGS)" \
+	"CXXFLAGS=$(CXXFLAGS)" \
+	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+	"INSTALL=$(INSTALL)" \
+	"INSTALL_DATA=$(INSTALL_DATA)" \
+	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+	"LDFLAGS=$(LDFLAGS)" \
+	"LIBCFLAGS=$(LIBCFLAGS)" \
+	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+	"MAKE=$(MAKE)" \
+	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+        "MULTIBUILDTOP=$(MULTIBUILDTOP)" \
+        "MULTISUBDIR=$(MULTISUBDIR)" \
+        "MULTIOSDIR=$(MULTIOSDIR)" \
+        "MULTIFLAGS=$(MULTIFLAGS)" \
+	"PICFLAG=$(PICFLAG)" \
+	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+	"SHELL=$(SHELL)" \
+	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+	"exec_prefix=$(exec_prefix)" \
+	"infodir=$(infodir)" \
+	"libdir=$(libdir)" \
+	"includedir=$(includedir)" \
+	"prefix=$(prefix)" \
+	"tooldir=$(tooldir)" \
+	"gxx_include_dir=$(gxx_include_dir)" \
+	"AR=$(AR)" \
+	"AS=$(AS)" \
+	"LD=$(LD)" \
+	"RANLIB=$(RANLIB)" \
+	"NM=$(NM)" \
+	"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
+	"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
+	"DESTDIR=$(DESTDIR)" \
+	"WERROR=$(WERROR)" \
+        "TARGET_LIB_PATH_libgm2=$(TARGET_LIB_PATH_libgm2)"
+
+# Subdir rules rely on $(FLAGS_TO_PASS)
+FLAGS_TO_PASS = $(AM_MAKEFLAGS)
+
+
+if BUILD_CORLIB
+M2DEFS = Debug.def  Executive.def \
+         KeyBoardLEDs.def  SYSTEM.def \
+         TimerHandler.def
+
+M2MODS = Debug.mod  Executive.mod \
+         SYSTEM.mod  TimerHandler.mod
+
+toolexeclib_LTLIBRARIES = libm2cor.la
+
+libm2cor_la_SOURCES = $(M2MODS) KeyBoardLEDs.cc
+
+nodist_EXTRA_libm2cor_la_SOURCES = dummy.c  ## forces automake to generate the LINK definition
+
+libm2cordir = libm2cor
+libm2cor_la_DEPENDENCIES = SYSTEM.def $(addsuffix .lo, $(basename $(libm2cor_la_SOURCES)))
+libm2cor_la_CFLAGS = -I. -I.. -I$(GM2_SRC)/gm2-libs -I$(GM2_SRC)/gm2-libs-iso -DBUILD_GM2_LIBS -I@srcdir@/../  -I@srcdir@/../libm2iso
+libm2cor_la_M2FLAGS = -I. -I$(GM2_SRC)/gm2-libs-coroutines -I$(GM2_SRC)/gm2-libs -I$(GM2_SRC)/gm2-libs-iso -fm2-g -g
+libm2cor_la_LINK = $(LINK) -version-info $(libtool_VERSION)
+BUILT_SOURCES = SYSTEM.def
+CLEANFILES = SYSTEM.def
+
+M2LIBDIR = /m2/m2cor/
+
+SYSTEM.def: Makefile
+	bash $(GM2_SRC)/tools-src/makeSystem -fpim \
+             $(GM2_SRC)/gm2-libs-coroutines/SYSTEM.def \
+             $(GM2_SRC)/gm2-libs-coroutines/SYSTEM.mod \
+             -I$(GM2_SRC)/gm2-libs-coroutines:$(GM2_SRC)/gm2-libs:$(GM2_SRC)/gm2-libs-iso \
+             "$(GM2_FOR_TARGET)" $@
+
+.mod.lo:
+	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(GM2_FOR_TARGET) -c $(CFLAGS_FOR_TARGET) $(LIBCFLAGS) $(libm2cor_la_M2FLAGS) $< -o $@
+
+.cc.lo:
+	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(LIBCFLAGS) $(libm2cor_la_CFLAGS) $< -o $@
+
+install-data-local: force
+	mkdir -p $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
+	$(INSTALL_DATA) .libs/libm2cor.la $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
+	chmod 644 $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)libm2cor.la
+	$(INSTALL_DATA) .libs/libm2cor.a $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
+	chmod 644 $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)libm2cor.a
+	$(RANLIB) $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)libm2cor.a
+	for i in $(M2DEFS) $(M2MODS) ; do \
+           if [ -f $$i ] ; then \
+              $(INSTALL_DATA) $$i '$(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)'; \
+           elif [ -f @srcdir@/../../gcc/m2/gm2-libs-coroutines/$$i ] ; then \
+              $(INSTALL_DATA) @srcdir@/../../gcc/m2/gm2-libs-coroutines/$$i '$(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)'; \
+           else \
+              echo "cannot find $$i" ; exit 1 ; \
+           fi ; \
+           chmod 644 $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)$$i ; \
+	done
+
+force:
+
+endif
diff -ruw /dev/null gcc-git-devel-modula2/libgm2/libm2cor/KeyBoardLEDs.cc
--- /dev/null	2022-08-24 16:22:16.888000070 +0100
+++ gcc-git-devel-modula2/libgm2/libm2cor/KeyBoardLEDs.cc	2022-10-07 20:21:18.738098020 +0100
@@ -0,0 +1,157 @@
+/* KeyBoardLEDs.c provide access to the keyboard LEDs.
+
+Copyright (C) 2005-2022 Free Software Foundation, Inc.
+Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
+
+This file is part of GNU Modula-2.
+
+GNU Modula-2 is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GNU Modula-2 is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+#include <m2rts.h>
+
+#if defined(linux)
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <linux/kd.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+
+#if !defined(TRUE)
+#   define TRUE (1==1)
+#endif
+#if !defined(FALSE)
+#   define FALSE (1==0)
+#endif
+
+#include <stdlib.h>
+
+static int fd;
+static int initialized = FALSE;
+
+
+extern "C" void
+KeyBoardLEDs_SwitchScroll (int scrolllock)
+{
+  unsigned char leds;
+  int r = ioctl (fd, KDGETLED, &leds);
+  if (scrolllock)
+    leds = leds | LED_SCR;
+  else
+    leds = leds & (~ LED_SCR);
+  r = ioctl (fd, KDSETLED, leds);
+}
+
+extern "C" void
+KeyBoardLEDs_SwitchNum (int numlock)
+{
+  unsigned char leds;
+  int r = ioctl (fd, KDGETLED, &leds);
+  if (numlock)
+    leds = leds | LED_NUM;
+  else
+    leds = leds & (~ LED_NUM);
+  r = ioctl (fd, KDSETLED, leds);
+}
+
+extern "C" void
+KeyBoardLEDs_SwitchCaps (int capslock)
+{
+  unsigned char leds;
+  int r = ioctl (fd, KDGETLED, &leds);
+  if (capslock)
+    leds = leds | LED_CAP;
+  else
+    leds = leds & (~ LED_CAP);
+  r = ioctl (fd, KDSETLED, leds);
+}
+
+extern "C" void
+KeyBoardLEDs_SwitchLeds (int numlock, int capslock, int scrolllock)
+{
+  KeyBoardLEDs_SwitchScroll (scrolllock);
+  KeyBoardLEDs_SwitchNum (numlock);
+  KeyBoardLEDs_SwitchCaps (capslock);
+}
+
+extern "C" void
+_M2_KeyBoardLEDs_init (int, char **, char **)
+{
+  if (! initialized)
+    {
+      initialized = TRUE;
+      fd = open ("/dev/tty", O_RDONLY);
+      if (fd == -1)
+	{
+	  perror ("unable to open /dev/tty");
+	  exit (1);
+	}
+    }
+}
+
+#else
+extern "C" void
+KeyBoardLEDs_SwitchLeds (int numlock, int capslock, int scrolllock)
+{
+}
+
+extern "C" void
+KeyBoardLEDs_SwitchScroll (int scrolllock)
+{
+}
+
+extern "C" void
+KeyBoardLEDs_SwitchNum (int numlock)
+{
+}
+
+extern "C" void
+KeyBoardLEDs_SwitchCaps (int capslock)
+{
+}
+
+extern "C" void
+_M2_KeyBoardLEDs_init (int, char **, char **)
+{
+}
+
+#endif
+
+/* GNU Modula-2 linking hooks.  */
+
+extern "C" void
+_M2_KeyBoardLEDs_finish (int, char **, char **)
+{
+}
+
+extern "C" void
+_M2_KeyBoardLEDs_dep (void)
+{
+}
+
+struct _M2_KeyBoardLEDs_ctor { _M2_KeyBoardLEDs_ctor (); } _M2_KeyBoardLEDs_ctor;
+
+_M2_KeyBoardLEDs_ctor::_M2_KeyBoardLEDs_ctor (void)
+{
+  M2RTS_RegisterModule ("KeyBoardLEDs", _M2_KeyBoardLEDs_init, _M2_KeyBoardLEDs_finish,
+			_M2_KeyBoardLEDs_dep);
+}
