summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzat Khuzhin <azat@libevent.org>2022-11-13 14:05:43 +0100
committerAzat Khuzhin <azat@libevent.org>2022-11-13 14:05:43 +0100
commitcdeb3242264285335e80e5fe7dc16789505ca1fc (patch)
treed35ef5a93b978a10ebd90656fecb67bbce67af18
parent8800b17a3d37a764027874e8f89796e7539b7ae1 (diff)
parent3d82675e37463045fe113c7ebe43adc3bf00af69 (diff)
downloadlibevent-cdeb3242264285335e80e5fe7dc16789505ca1fc.tar.gz
Various documentation improvements (#842)
* doc-pull: doc: add build prerequisites doc: add MSVC and GNUC options Fixes: #843
-rw-r--r--Documentation/Building.md97
1 files changed, 97 insertions, 0 deletions
diff --git a/Documentation/Building.md b/Documentation/Building.md
index d32816cb..c78f99cd 100644
--- a/Documentation/Building.md
+++ b/Documentation/Building.md
@@ -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
```
@@ -76,6 +152,7 @@ $ make verify # Optional
```
## CMake Variables
+General options:
```
# Type of the library to build (SHARED or STATIC)
# Default is: SHARED for MSVC, otherwise BOTH
@@ -124,6 +201,26 @@ EVENT__FORCE_KQUEUE_CHECK:BOOL=OFF
# Build documentation with doxygen
EVENT__DOXYGEN:BOOL=OFF
```
+MSVC specific options:
+```
+# Link static runtime libraries.
+# Defaults to ON if EVENT_LIBRARY_TYPE is equal to "STATIC", otherwise OFF
+EVENT__MSVC_STATIC_RUNTIME:BOOL
+```
+GNUC specific options:
+```
+# Disable verbose warnings with GCC
+EVENT__DISABLE_GCC_WARNINGS:BOOL=OFF
+
+# Enable compiler security checks
+EVENT__ENABLE_GCC_HARDENING:BOOL=OFF
+
+# Enable gcc function sections
+EVENT__ENABLE_GCC_FUNCTION_SECTIONS:BOOL=OFF
+
+# Make all GCC warnings into errors
+EVENT__ENABLE_GCC_WARNINGS:BOOL=OFF
+```
__More variables can be found by running `cmake -LAH <sourcedir_path>`__
[Back to top &uarr;](#jump-to)