Skip to content

Commit f9b0c4f

Browse files
authored
Merge pull request #4489 from facebook/doc_install
Added documentation details for Makefile installation and pkg-config.
2 parents 085cc93 + be072c7 commit f9b0c4f

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,19 @@ When your system allows it, prefer using `make` to build `zstd` and `libzstd`.
127127

128128
### Makefile
129129

130-
If your system is compatible with standard `make` (or `gmake`),
130+
Assuming your system supports standard `make` (or `gmake`),
131131
invoking `make` in root directory will generate `zstd` cli in root directory.
132132
It will also create `libzstd` into `lib/`.
133133

134-
Other available options include:
134+
Other standard targets include:
135135
- `make install` : create and install zstd cli, library and man pages
136136
- `make check` : create and run `zstd`, test its behavior on local platform
137137

138138
The `Makefile` follows the [GNU Standard Makefile conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html),
139-
allowing staged install, standard flags, directory variables and command variables.
139+
allowing staged install, standard compilation flags, directory variables and command variables.
140140

141-
For advanced use cases, specialized compilation flags which control binary generation
142-
are documented in [`lib/README.md`](lib/README.md#modular-build) for the `libzstd` library
141+
For advanced use cases, specialized flags which control binary generation and installation paths are documented
142+
in [`lib/README.md`](lib/README.md#modular-build) for the `libzstd` library
143143
and in [`programs/README.md`](programs/README.md#compilation-variables) for the `zstd` CLI.
144144

145145
### cmake

lib/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,29 @@ in order to make it easier to select or exclude features.
77

88
#### Building
99

10-
`Makefile` script is provided, supporting [Makefile conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html#Makefile-Conventions),
10+
A `Makefile` script is provided, supporting [Makefile conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html#Makefile-Conventions),
1111
including commands variables, staged install, directory variables and standard targets.
1212
- `make` : generates both static and dynamic libraries
13-
- `make install` : install libraries and headers in target system directories
13+
- `make install` : install libraries, headers and pkg-config in local system directories
1414

15-
`libzstd` default scope is pretty large, including compression, decompression, dictionary builder,
16-
and support for decoding legacy formats >= v0.5.0.
15+
`libzstd` default scope is extensive, including compression, decompression, dictionary builder,
16+
and support for decoding legacy formats >= v0.5.0 by default.
1717
The scope can be reduced on demand (see paragraph _modular build_).
1818

19+
#### Multiarch Support
20+
21+
For multiarch systems (like Debian/Ubuntu), libraries should be installed to architecture-specific directories.
22+
When creating packages for such systems, use the `LIBDIR` variable to specify the correct multiarch path:
23+
24+
```bash
25+
# For x86_64 systems on Ubuntu/Debian:
26+
make install PREFIX=/usr LIBDIR=/usr/lib/x86_64-linux-gnu
27+
28+
# For ARM64 systems on Ubuntu/Debian:
29+
make install PREFIX=/usr LIBDIR=/usr/lib/aarch64-linux-gnu
30+
```
31+
32+
This will not only install the files in the correct directories, but also generate the correct paths for `pkg-config`.
1933

2034
#### Multithreading support
2135

0 commit comments

Comments
 (0)