Skip to content

Commit

Permalink
doc: add build prerequisites
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
yuangongji authored and azat committed Nov 13, 2022
1 parent a3973a5 commit 3d82675
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions Documentation/Building.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,87 @@
# Building and installing Libevent

### Jump to:

- [Prerequisites](#Prerequisites)
- [Autoconf](#autoconf)
- [Flags](#autoconf-flags)
- [Building on Windows](#building-on-windows)
- [Building on Unix (With CMake)](#building-on-unix-cmake)
- [CMake Variables](#cmake-variables)

## Prerequisites

### Linux deb-like (ubuntu/debian/...)

Just install tools using your preferred package manager if you build using autotools:

```sh
sudo apt-get install automake autoconf libtool pkg-config
```

or build using cmake:

```sh
sudo apt-get install cmake
```

Doxygen is a tool for generating documentation. Git is used to fetch the package version.
Install them if needed:

```
sudo apt-get install doxygen git
```

libevent has encryption layer, you need openssl or mbedTLS for it, you can
install one of this using:

```sh
sudo apt-get install libssl-dev libmbedtls-dev
```

To support multithreaded environments, libpthread is a must, and it already exists in the system.

To run the tests, you should install zlib:

```sh
sudo apt-get install zlib1g-dev
```

Finally, python interpreter should be installed if you want to run regression tests.

### MacOS

On MacOS you can use `brew` to manage packages.

The installation process on MacOS is roughly the same as on Linux,
the difference is installation of openssl and zlib:

```sh
brew install openssl zlib
```

### Windows

To install it, there are two choices: installer and zip file.

If using zip file, you should set the PATH variable in the Environment
Variables for your User to include the installation path of cmake.

Install Visual Studio which is the true compiler that will be used.

Install OpenSSL to support for encryption, then add the installation path into the PATH variable in the Environment Variables,
or set OPENSSL_ROOT_DIR in command prompt:

```sh
set "OPENSSL_ROOT_DIR=C:\path\to\OpenSSL"
```

or add `OPENSSL_ROOT_DIR` definition to the cmake command:

```sh
cmake -DOPENSSL_ROOT_DIR=C:/path/to/OpenSSL ...
```

## Autoconf

```
Expand Down

0 comments on commit 3d82675

Please sign in to comment.