File: COMPILE.md

package info (click to toggle)
efibootguard 0.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 796 kB
  • sloc: ansic: 7,805; makefile: 405; python: 326; sh: 84
file content (75 lines) | stat: -rw-r--r-- 1,749 bytes parent folder | download | duplicates (3)
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
# Compilation Instructions #

## Required libraries and headers for compilation ##

If you are building from a git checkout, make sure that you have cloned
the git submodules as well, e.g.

```
git submodule update --init
```

### Arch Linux ###

```
# libs
pacman -S gnu-efi-libs pciutils

# build tools
pacman -S gcc make automake autoconf autoconf-archive libtool pkg-config python

# test dependencies
pacman -S check bash-bats
```

### Debian ###

Debian 8 or newer:

```
# libs
apt-get install gnu-efi libpci-dev

# build tools
apt-get install make automake autoconf autoconf-archive libtool pkg-config python3

# test dependencies
apt-get install check bats
```

## Compilation ##

This project uses autotools. Here you find useful documentations for
[autoconf](https://www.gnu.org/software/autoconf/manual/autoconf.html), and
[automake](https://www.gnu.org/software/automake/manual/automake.html).

To compile `efibootguard`, checkout the sources and run:

```
autoreconf -fi
./configure
make
```

To cross-compile, the environment variables must be set accordingly, i.e.
`CXX=<compiler-to-use>`. The following example shows how to specify needed
paths for an out-of-tree build, where cross-compilation environment variables
have already been set before (i.e. by an embedded SDK from `yocto` or alike):

```
mkdir build
cd build
autoreconf -fi ..
../configure --host=i586 --build=x86_64-unknown-linux-gnu \
 --with-gnuefi-sys-dir=<sys-root-dir> \
 --with-gnuefi-include-dir=<sys-root-dir>/usr/include/efi \
 --with-gnuefi-lib-dir=<sys-root-dir>/usr/lib
make
```

where `<sys-root-dir>` points to the wanted sysroot for cross-compilation.

## Testing ##

* `make check` will run all unit tests.
* `bats tests` will run all integration tests.