summaryrefslogtreecommitdiff
path: root/microkernel/mach/gnumach/building.mdwn
blob: 07dc3341cd56b7381deb2118c7838af761132b00 (plain)
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
114
115
116
117
118
119
120
# Building [[GNU_Mach|gnumach]] from Source

If you want to build the [[GNU_Mach|gnumach]] kernel yourself instead of just using a
pre-built binary, follow these instructions.

The unpacked source tree is around 20 MiB, and the build tree (with all drivers
enabled) is around 50 MiB.

## Getting the Source Code

### Developers's RCS

See <http://savannah.gnu.org/git/?group=hurd>.

    $ git clone git.savannah.gnu.org:/srv/git/hurd/gnumach.git

### What Debian is currently using

See [here](http://packages.debian.net/source/unstable/gnumach).

    $ apt-get source gnumach

Please see the Debian [[running/debian/FAQ]] before using `apt-get source`.

## On Debian Systems:

### Preparing for the Build

Building GNU Mach requires the *build-essential* and *fakeroot* packages, their
dependencies and additional packages that are specified by the source gnumach
package:

    # apt-get install build-essential fakeroot
    # apt-get build-dep gnumach

### Building and Installing ... Debian `.deb` files

Change into the directory with the downloaded / unpacked GNU Mach sources, e.g.

    $ cd gnumach-20050801

Start the build process with

    $ dpkg-buildpackage -us -uc -b -rfakeroot

[[GNU_Mach|gnumach]] is now building.  To use the new kernel, you must install the
resulting `.deb` package which is located one directory above the build
directory and has a similar name as the build directory, e.g.

    # dpkg -i ../gnumach_20050801-4_hurd-i386.deb

You can now reboot your computer and enjoy the new kernel.

## On non-Debian Systems:

### Preparing for the Build

Apart from the case that you only want to install GNU Mach's header files (see
below), building GNU Mach requires you to have the Mach Interface Generator
installed.  See [[building_MIG|mig/gnu_mig/building]] about how to do that, then come
back here.

Additionally, building GNU Mach requires a C compiler, a standard C library and
your favourite flavor of awk (gawk) and GNU make.

### Preparation:

You first have to create the automatically generatable files:

    $ cd gnumach
    $ autoreconf --install

### Installing only the Header Files

GNU Mach and its headers should be built in separate directories:

    $ cd ..
    $ mkdir gnumach-build-h
    $ cd gnumach-build-h

Find the path to your GNU Mach sources (`../gnumach`) and configure
it (the --host flag is needed for 64 bit systems):

    $ ../gnumach/configure --prefix= --host=i686-unknown-linux-gnu

Install the header files into e.g. `~/gnu/include/`:

    $ make DESTDIR=~/gnu install-data

### Building and Installing

GNU Mach should be built in a separate directory:

    $ cd ..
    $ mkdir gnumach-build
    $ cd gnumach-build

Find the path to your GNU Mach sources (`../gnumach`) and configure
it:

    $ ../gnumach/configure

If you are building on a 64 bit system, do the following instead:

    $ CPP='gcc -m32 -E -x c -undef -ansi' CC='gcc -m32' LD='ld -melf_i386'
    $ ../gnumach/configure --host=i686-unknown-linux-gnu

Build the kernel image:

    $ make gnumach.gz

Optionally run the (tiny) test suite:

    $ make check

You can then install and use `gnumach.gz`.

[TODO.]