Skip to content

Commit 89a7a2b

Browse files
author
Martin Belanger
committed
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 <[email protected]>
1 parent f8b25d0 commit 89a7a2b

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,32 @@ $ meson compile -C .build
7777
# meson install -C .build
7878
```
7979

80+
#### Installation paths
81+
82+
By default, meson installs everything under `/usr/local` (executables in
83+
`/usr/local/bin`, libraries in `/usr/local/lib`, configuration in
84+
`/usr/local/etc`, etc.). This is controlled by two meson built-in options
85+
whose defaults are set in `meson.build`:
86+
87+
| Option | Default |
88+
|--------|---------|
89+
| `--prefix` | `/usr/local` |
90+
| `--sysconfdir` | `etc` (relative to prefix → `/usr/local/etc`) |
91+
92+
To install into the standard system locations that a Linux distribution would
93+
use (`/usr/bin`, `/usr/lib`, `/etc`, …), pass these options at configure time:
94+
95+
```shell
96+
$ meson setup .build --prefix /usr --sysconfdir /etc
97+
```
98+
99+
Optionally add `--buildtype release` to disable debug symbols and enable
100+
optimizations for a production install:
101+
102+
```shell
103+
$ meson setup .build --prefix /usr --sysconfdir /etc --buildtype release
104+
```
105+
80106
### Build with build.sh wrapper
81107

82108
The `scripts/build.sh` is used for the CI build but can also be used for

0 commit comments

Comments
 (0)