From 89a7a2b430c56b2106a736fbeb1d94efea4be40f Mon Sep 17 00:00:00 2001 From: Martin Belanger Date: Wed, 8 Apr 2026 09:58:39 -0400 Subject: [PATCH] doc: document default installation paths and how to override them The meson defaults (prefix=/usr/local, sysconfdir=etc) cause files to be installed under /usr/local rather than the standard system locations, which often confuses users expecting /usr/bin, /usr/lib, /etc. Add an "Installation paths" subsection explaining the defaults and showing how to configure meson for a distro-style install: meson setup .build --prefix /usr --sysconfdir /etc Signed-off-by: Martin Belanger --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 3b852c9ab8..1a587ab57f 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,32 @@ $ meson compile -C .build # meson install -C .build ``` +#### Installation paths + +By default, meson installs everything under `/usr/local` (executables in +`/usr/local/bin`, libraries in `/usr/local/lib`, configuration in +`/usr/local/etc`, etc.). This is controlled by two meson built-in options +whose defaults are set in `meson.build`: + +| Option | Default | +|--------|---------| +| `--prefix` | `/usr/local` | +| `--sysconfdir` | `etc` (relative to prefix → `/usr/local/etc`) | + +To install into the standard system locations that a Linux distribution would +use (`/usr/bin`, `/usr/lib`, `/etc`, …), pass these options at configure time: + +```shell +$ meson setup .build --prefix /usr --sysconfdir /etc +``` + +Optionally add `--buildtype release` to disable debug symbols and enable +optimizations for a production install: + +```shell +$ meson setup .build --prefix /usr --sysconfdir /etc --buildtype release +``` + ### Build with build.sh wrapper The `scripts/build.sh` is used for the CI build but can also be used for