1This document describes how to configure and build erofs-utils from 2source. 3 4See the [README](../README) file in the top level directory about 5the brief overview of erofs-utils. 6 7## Dependencies & build 8 9LZ4 1.9.3+ for LZ4(HC) enabled [^1]. 10 11[XZ Utils 5.3.2alpha+](https://tukaani.org/xz/xz-5.3.2alpha.tar.gz) for 12LZMA enabled, [XZ Utils 5.4+](https://tukaani.org/xz/xz-5.4.1.tar.gz) 13highly recommended. 14 15libfuse 2.6+ for erofsfuse enabled. 16 17[^1]: It's not recommended to use LZ4 versions under 1.9.3 since 18unexpected crashes could make trouble to end users due to broken 19LZ4_compress_destSize() (fixed in v1.9.2), 20[LZ4_compress_HC_destSize()](https://github.com/lz4/lz4/commit/660d21272e4c8a0f49db5fc1e6853f08713dff82) or 21[LZ4_decompress_safe_partial()](https://github.com/lz4/lz4/issues/783). 22 23## How to build with LZ4 24 25To build, the following commands can be used in order: 26 27``` sh 28$ ./autogen.sh 29$ ./configure 30$ make 31``` 32 33`mkfs.erofs`, `dump.erofs` and `fsck.erofs` binaries will be 34generated under the corresponding folders. 35 36## How to build with liblzma 37 38In order to enable LZMA support, build with the following commands: 39 40``` sh 41$ ./configure --enable-lzma 42$ make 43``` 44 45Additionally, you could specify liblzma target paths with 46`--with-liblzma-incdir` and `--with-liblzma-libdir` manually. 47 48## How to build erofsfuse 49 50It's disabled by default as an experimental feature for now due 51to the extra libfuse dependency, to enable and build it manually: 52 53``` sh 54$ ./configure --enable-fuse 55$ make 56``` 57 58`erofsfuse` binary will be generated under `fuse` folder. 59 60## How to install erofs-utils manually 61 62Use the following command to install erofs-utils binaries: 63 64``` sh 65# make install 66``` 67 68By default, `make install` will install all the files in 69`/usr/local/bin`, `/usr/local/lib` etc. You can specify an 70installation prefix other than `/usr/local` using `--prefix`, 71for instance `--prefix=$HOME`. 72