summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.com>2022-08-18 12:32:15 +0200
committerThomas Heijligen <src@posteo.de>2022-09-12 07:15:19 +0000
commit75d327c5509883624e4ef1366c8d1d430666035e (patch)
treea73356157131c24c8fdfc56fa8ea75134fe6f1e9 /Documentation
parent3753d29b97cd10abe98846ec48ff4ec1d20baa80 (diff)
downloadflashrom-75d327c5509883624e4ef1366c8d1d430666035e.tar.gz
flashrom-75d327c5509883624e4ef1366c8d1d430666035e.tar.bz2
flashrom-75d327c5509883624e4ef1366c8d1d430666035e.zip
Documentation: Add build instructions for meson
Change-Id: I3476f17fa274cd71e3e0e84f791d547d08165ecb Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66862 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/building.md127
1 files changed, 127 insertions, 0 deletions
diff --git a/Documentation/building.md b/Documentation/building.md
new file mode 100644
index 000000000..aabb45b18
--- /dev/null
+++ b/Documentation/building.md
@@ -0,0 +1,127 @@
+# Compiling from Source with meson (recommended)
+
+## Dependencies:
+
+ * C compiler (GCC | Clang) *
+ * meson >=0.53.0 *
+ * ninja *
+ * pkg-config *
+ * cmocka **
+ * system-headers ***
+ * libpci ***
+ * libusb1 >=1.0.9 ***
+ * libftdi1 ***
+ * libjaylink ***
+
+\* Compile time dependency
+\** For unit-testing only
+\*** Runtime / Programmer specific
+
+## Build Options:
+ * classic_cli=auto/enabled/disabled
+ * classic_cli_default_programmer=<programmer_name>:<programmer_params>
+ * classic_cli_print_wiki=auto/enabled/disabled
+ * tests=auto/enabled/disabled
+ * ich_descriptors_tool=auto/enabled/disabled
+ * use_internal_dmi=true/false
+ * programmer=...
+
+## Configure
+```
+meson builddir -D<your_options>
+```
+- __builddir__ is the directory in which flashrom will be build
+- for all available options see `meson_options.txt`
+
+## Compile
+```
+ninja -C builddir
+```
+
+## Install
+```
+ninja -C builddir install
+```
+
+## Run unit tests
+```
+ninja -C builddir test
+```
+
+## System specific information
+### Ubuntu / Debian (Linux)
+ * __linux-headers__ are version specific
+```
+apt-get install -y gcc meson ninja-build pkg-config libcmocka-dev \
+ linux-headers-generic libpci-dev libusb-1.0-0-dev libftdi1-dev \
+ libjaylink-dev
+```
+
+### ArchLinux / Manjaro
+ * __libjaylink__ is not available through the package manager
+```
+pacman -S --noconfirm gcc meson ninja pkg-config cmocka \
+ pciutils libusb libftdi
+```
+
+### NixOS / Nixpkgs
+```
+nix-shell <flashrom_source>/util/shell.nix
+```
+or
+```
+nix-shell -p meson ninja pkg-config cmocka pciutils libusb1 libftdi1 libjaylink
+```
+
+### OpenSUSE
+```
+zypper install -y gcc meson ninja pkg-config libcmocka-devel \
+ pciutils-devel libusb-1_0-devel libftdi1-devel \
+ libjaylink-devel
+```
+
+### Alpine
+```
+apk add build-base meson ninja pkgconf cmocka-dev pciutils-dev libusb-dev libftdi1-dev libjaylink-dev linux-headers
+```
+
+
+### Freebsd / DragonFly BSD
+ * Tests are not working yet and must be disabled with `-Dtests=disabled`
+ * __libjaylink__ is not available through the package manager
+ * __libusb1__ is part of the base system
+```
+pkg install pkgconf meson ninja cmocka libpci libftdi1
+```
+
+### OpenBSD
+ * Tests are not working yet and must be disabled with `-Dtests=disabled`
+ * __libjaylink__ is not available through the package manager
+```
+pkg_add install meson ninja pkg-config cmocka pciutils libusb1 libftdi1
+```
+
+### NetBSD
+ * Tests are not working yet and must be disabled with `-Dtests=disabled`
+ * __libjaylink__ is not available through the package manager
+ * note: https://www.cambus.net/installing-ca-certificates-on-netbsd/
+```
+pkgin install meson ninja pkg-config cmocka pciutils libusb1 libftdi1
+```
+
+### OpenIndiana (Illumos, Solaris, SunOS)
+ * Tests are not working yet and must be disabled with `-Dtests=disabled`
+ * __libpci__ missing, pciutils is build without it
+ * __libftdi1__, __libjaylink__ is not available through the package manager
+ * TODO: replace __build-essential__ with the default compiler
+```
+pkg install build-essential meson ninja cmocka libusb-1
+```
+
+### MacOS (Homebrew)
+ * Tests are not working yet and must be disabled with `-Dtests=disabled`
+ * Internal, PCI programmer not supported
+ * __libjaylink__ is not available through the package manager
+```
+brew install meson ninja pkg-config cmocka libusb libftdi
+```