2016-10-16 09:24:41 +00:00
|
|
|
-*- org -*-
|
2018-07-23 17:10:34 +00:00
|
|
|
#+TITLE: Building and Installing GNU Mes
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2023-07-08 13:20:40 +00:00
|
|
|
Copyright © 2016,2017,2018,2019,2021,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2018-06-24 11:13:13 +00:00
|
|
|
|
2018-07-23 17:10:34 +00:00
|
|
|
Copying and distribution of this file, with or without modification,
|
|
|
|
are permitted in any medium without royalty provided the copyright
|
|
|
|
notice and this notice are preserved.
|
|
|
|
|
|
|
|
Mes can be built in two modes: as a regulare package build or as a
|
|
|
|
bootstrap package.
|
|
|
|
|
|
|
|
After bootstrapping Mes it can be used to bootstrap TinyCC (tcc) in a
|
2018-06-24 11:13:13 +00:00
|
|
|
similar way.
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
* Get it
|
2018-07-22 12:24:36 +00:00
|
|
|
git clone [[git://git.savannah.gnu.org][git://git.savannah.gnu.org/mes.git]]
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
* Regular build
|
|
|
|
** Prerequisites
|
2017-06-08 18:39:24 +00:00
|
|
|
*** Guix
|
2019-11-04 18:59:13 +00:00
|
|
|
#+BEGIN_SRC bash
|
2022-04-30 07:44:57 +00:00
|
|
|
guix shell #64 bit + 32bit
|
|
|
|
guix shell --system=i686-linux #32 bit only
|
|
|
|
guix shell --system=armhf-linux #32 bit only
|
2019-11-04 18:59:13 +00:00
|
|
|
#+END_SRC
|
2017-04-02 15:01:29 +00:00
|
|
|
|
2017-06-08 18:39:24 +00:00
|
|
|
*** Other GNU/Linux
|
2023-11-05 08:57:11 +00:00
|
|
|
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 1.5.0 is known to work.
|
2023-07-08 13:20:40 +00:00
|
|
|
- [[https://github.com/oriansj/m2-planet][M2-Planet]] (optional), 1.11.0 is known to work.
|
2020-12-31 12:05:41 +00:00
|
|
|
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 1.00.2 is known to work.
|
|
|
|
- GNU Gcc, 7.5.0 is known to work.
|
2023-07-08 13:20:40 +00:00
|
|
|
- GNU Guile, version 3.0.4 is known to work.
|
2020-12-31 12:05:41 +00:00
|
|
|
- SH, /bin/sh, GNU Bash 5.0.16 is known to work.
|
2023-07-08 13:20:40 +00:00
|
|
|
- GNU coreutils.
|
2020-12-31 12:05:41 +00:00
|
|
|
- sed, GNU sed 4.8 is known to work.
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
** Build it
|
2019-11-04 18:59:13 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC bash
|
2018-06-24 11:13:13 +00:00
|
|
|
./configure
|
|
|
|
make
|
2019-11-04 18:59:13 +00:00
|
|
|
#+END_SRC
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2019-12-09 06:26:16 +00:00
|
|
|
If you get something like
|
|
|
|
|
|
|
|
#+BEGIN_SRC bash
|
|
|
|
mes.c:(.text+0x8da0): undefined reference to `__stack_chk_fail'
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
then your compiler inserts stack protection code. The Mes C Library
|
|
|
|
does not support that. Turn it off lik this
|
|
|
|
|
|
|
|
#+BEGIN_SRC bash
|
|
|
|
./configure CFLAGS=-fno-stack-protector
|
|
|
|
#+END_SRC
|
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
** Check it
|
2019-11-04 18:59:13 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC bash
|
2018-06-24 11:13:13 +00:00
|
|
|
make check
|
2019-11-04 18:59:13 +00:00
|
|
|
#+END_SRC
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
** Install it
|
2019-11-04 18:59:13 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC bash
|
2018-06-24 11:13:13 +00:00
|
|
|
make install
|
2019-11-04 18:59:13 +00:00
|
|
|
#+END_SRC
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
* Guix it
|
2019-11-04 18:59:13 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC bash
|
|
|
|
guix build -f guix.scm
|
|
|
|
#+END_SRC
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
* Bootstrap build
|
2017-05-22 21:35:39 +00:00
|
|
|
|
2019-11-04 18:59:13 +00:00
|
|
|
The bootstrap build is part of Guix, see
|
|
|
|
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
** Prerequisites
|
2022-04-30 09:12:48 +00:00
|
|
|
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 1.4.0 is known to work.
|
|
|
|
- [[https://github.com/oriansj/m2-planet][M2-Planet]], 1.9.0 is known to work.
|
2021-10-10 07:06:40 +00:00
|
|
|
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 1.00.2 is known to work.
|
2016-10-16 09:24:41 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
** Build it
|
2019-11-04 18:59:13 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC bash
|
|
|
|
sh configure.sh [--prefix=<prefix>]
|
|
|
|
sh bootstrap.sh
|
|
|
|
#+END_SRC
|
2016-12-10 21:47:13 +00:00
|
|
|
|
2018-06-24 11:13:13 +00:00
|
|
|
** Check it
|
|
|
|
|
2019-11-04 18:59:13 +00:00
|
|
|
#+BEGIN_SRC bash
|
|
|
|
sh check.sh
|
|
|
|
#+END_SRC
|
2018-06-24 11:13:13 +00:00
|
|
|
|
|
|
|
** Install it
|
|
|
|
|
2019-11-04 18:59:13 +00:00
|
|
|
#+BEGIN_SRC bash
|
|
|
|
sh install.sh
|
|
|
|
#+END_SRC
|
2019-12-09 06:26:16 +00:00
|
|
|
* Regular build and bootstrap combine
|
|
|
|
|
|
|
|
To build mes.c using MesCC, configure using --with-bootstrap:
|
|
|
|
|
|
|
|
#+BEGIN_SRC bash
|
|
|
|
./configure --with-bootstrap
|
|
|
|
make
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
This creates bin/mes-gcc and bin/mes-mescc.
|