btrfs-progs: Add zstd support
[platform/upstream/btrfs-progs.git] / INSTALL
1 Installation instructions
2 =========================
3
4 The Btrfs utility programs require the following libraries/tools to build:
5
6 - libuuid - provided by util-linux, e2fsprogs/e2fslibs or libuuid
7 - libblkid - block device id library
8 - liblzo2 - LZO data compression library
9 - zlib - ZLIB data compression library
10 - libzstd - ZSTD data compression library version >= 1.0.0 (optional)
11
12 For the btrfs-convert utility:
13
14 - e2fsprogs - ext2/ext3/ext4 file system libraries, or called e2fslibs
15
16 Generating documentation:
17
18 - asciidoc - text document format tool
19 - xmlto - text document format tool
20
21 XATTR library should be provided by the standard C library or by
22
23 - libattr - extended attribute library
24
25 Please note that the package names may differ according to the distribution.
26 See https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories#Dependencies .
27
28
29 Building from sources
30 ---------------------
31
32 To build from git sources you need to generate the configure script using the
33 autotools:
34
35     $ ./autogen.sh
36
37 To build from the released tarballs:
38
39     $ ./configure
40     $ make
41     $ make install
42
43 You may disable building some parts like documentation, btrfs-convert or
44 backtrace support. See ./configure --help for more.
45
46 Specific CFLAGS or LDFLAGS should be set like
47
48     $ CFLAGS=... LDFLAGS=... ./configure --prefix=/usr
49
50 and not as arguments to make. You can specify additional flags to build via
51 variables EXTRA_CFLAGS and EXTRA_LDFLAGS that get appended to the predefined
52 values of the respective variables. There are further build tuning options
53 documented in the Makefile.
54
55     $ make EXTRA_CFLAGS=-ggdb3
56
57 The build utilizes autotools, dependencies for generating the configure
58 scripts are:
59
60 * autconf, autoheader
61 * automake, aclocal
62 * pkg-config
63
64
65 Statically built binaries
66 -------------------------
67
68 The makefiles are ready to let you build static binaries of the utilities. This
69 may be handy in rescue environments. Your system has to provide static version
70 of the libraries.
71
72     $ make static
73     $ make btrfs.static
74     $ make btrfs-convert.static
75
76 The resulting binaries have the '.static' suffix, the intermediate object
77 files do not conflict with the normal (dynamic) build.
78
79
80 References:
81 * https://btrfs.wiki.kernel.org