File: INSTALL

package info (click to toggle)
mes 0.24.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 6,908 kB
  • sloc: ansic: 24,104; lisp: 11,490; sh: 6,609; asm: 187; makefile: 36
file content (113 lines) | stat: -rw-r--r-- 2,778 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
                                                              -*- org -*-
#+TITLE: Building and Installing GNU Mes

Copyright © 2016,2017,2018,2019,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>

  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
similar way.

* Get it
   git clone [[git://git.savannah.gnu.org][git://git.savannah.gnu.org/mes.git]]

* Regular build
** Prerequisites
*** Guix
   #+BEGIN_SRC bash
   guix shell #64 bit + 32bit
   guix shell --system=i686-linux #32 bit only
   guix shell --system=armhf-linux #32 bit only
   #+END_SRC

*** Other GNU/Linux
  - [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 1.4.0 is known to work.
  - [[https://github.com/oriansj/m2-planet][M2-Planet]] (optional), 1.9.0 is known to work.
  - [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 1.00.2 is known to work.
  - GNU Gcc, 7.5.0 is known to work.
  - GNU Guile, version 3.0.4 is know to work.
  - SH, /bin/sh, GNU Bash 5.0.16 is known to work.
  - GNU coreutils
  - sed, GNU sed 4.8 is known to work.

** Build it

   #+BEGIN_SRC bash
   ./configure
   make
   #+END_SRC

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

** Check it

   #+BEGIN_SRC bash
   make check
   #+END_SRC

** Install it

   #+BEGIN_SRC bash
   make install
   #+END_SRC

* Guix it

   #+BEGIN_SRC bash
   guix build -f guix.scm
   #+END_SRC

* Bootstrap build

The bootstrap build is part of Guix, see
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm

** Prerequisites
  - [[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.
  - [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 1.00.2 is known to work.

** Build it

   #+BEGIN_SRC bash
   sh configure.sh [--prefix=<prefix>]
   sh bootstrap.sh
   #+END_SRC

** Check it

   #+BEGIN_SRC bash
   sh check.sh
   #+END_SRC

** Install it

   #+BEGIN_SRC bash
   sh install.sh
   #+END_SRC
* 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.