Change dependency from openssl1.1 to openssl3
[platform/upstream/libzip.git] / INSTALL.md
1 libzip uses [cmake](https://cmake.org) to build.
2
3 For running the tests, you need to have [perl](https://www.perl.org).
4
5 You'll need [zlib](http://www.zlib.net/) (at least version 1.1.2). It
6 comes with most operating systems.
7
8 For supporting bzip2-compressed zip archives, you need
9 [bzip2](http://bzip.org/).
10
11 For supporting lzma- and xz-compressed zip archives, you need
12 [liblzma](https://tukaani.org/xz/) which is part of xz, at least version 5.2.
13
14 For supporting zstd-compressed zip archives, you need
15 [zstd](https://github.com/facebook/zstd/).
16
17 For AES (encryption) support, you need one of these cryptographic libraries,
18 listed in order of preference:
19
20 - Apple's CommonCrypto (available on macOS and iOS)
21 - [GnuTLS](https://www.gnutls.org/) and [Nettle](https://www.lysator.liu.se/~nisse/nettle/) (at least nettle 3.0)
22 - [mbed TLS](https://tls.mbed.org/)
23 - [OpenSSL](https://www.openssl.org/) >= 1.0.
24 - Microsoft Windows Cryptography Framework
25
26 If you don't want a library even if it is installed, you can
27 pass `-DENABLE_<LIBRARY>=OFF` to cmake, where `<LIBRARY>` is one of
28 `COMMONCRYPTO`, `GNUTLS`, `MBEDTLS`, or `OPENSSL`.
29
30 The basic usage is
31 ```sh
32 mkdir build
33 cd build
34 cmake ..
35 make
36 make test
37 make install
38 ```
39
40 Some useful parameters you can pass to `cmake` with `-Dparameter=value`:
41
42 - `BUILD_SHARED_LIBS`: set to `ON` or `OFF` to enable/disable building
43   of shared libraries, defaults to `ON`
44 - `CMAKE_INSTALL_PREFIX`: for setting the installation path
45 - `DOCUMENTATION_FORMAT`: choose one of `man`, `mdoc`, and `html` for
46   the installed documentation (default: decided by cmake depending on
47   available tools)
48 - `LIBZIP_DO_INSTALL`: If you include libzip as a subproject, link it
49   statically and do not want to let it install its files, set this
50   variable to `OFF`. Defaults to `ON`.
51   
52 If you want to compile with custom `CFLAGS`, set them in the environment
53 before running `cmake`:
54 ```sh
55 CFLAGS=-DMY_CUSTOM_FLAG cmake ..
56 ```
57
58 If you are compiling on a system with a small stack size, add
59 `-DZIP_ALLOCATE_BUFFER` to `CFLAGS`.
60
61 If you are building on a 32-bit Linux system it might be necessary
62 to define `_FILE_OFFSET_BITS` to `64`. Your distro will need to provide
63 a `fts.h` file that is new enough to support this, or the build
64 will break in `zipcmp`.
65
66 You can get verbose build output with by passing `VERBOSE=1` to
67 `make`.
68
69 You can also check the [cmake FAQ](https://gitlab.kitware.com/cmake/community/-/wikis/FAQ).