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