descriptiona mirror of public git repo of libevent
homepage URLhttp://www.monkey.org/~provos/libevent/
repository URLgit://levent.git.sourceforge.net/gitroot/levent/levent
ownermenghan412@gmail.com
last changeTue, 22 Dec 2015 01:43:00 +0000 (21 17:43 -0800)
last refreshFri, 17 May 2024 12:13:37 +0000 (17 14:13 +0200)
content tags
add:
README.md

libevent logo

Appveyor Win32 Build Status Travis Build Status

0. BUILDING AND INSTALLATION (Briefly)

Autoconf

 $ ./configure
 $ make
 $ make verify   # (optional)
 $ sudo make install

Cmake (General)

The following Libevent specific Cmake variables ar as follows (the values being the default).

# Installation directory for executables
EVENT_INSTALL_BIN_DIR:PATH=bin

# Installation directory for CMake files
EVENT_INSTALL_CMAKE_DIR:PATH=lib/cmake/libevent

## Installation directory for header files
EVENT_INSTALL_INCLUDE_DIR:PATH=include

## Installation directory for libraries
EVENT_INSTALL_LIB_DIR:PATH=lib

## Define if libevent should be built with shared libraries instead of archives
EVENT__BUILD_SHARED_LIBRARIES:BOOL=OFF

# Enable running gcov to get a test coverage report (only works with
# GCC/CLang). Make sure to enable -DCMAKE_BUILD_TYPE=Debug as well.
EVENT__COVERAGE:BOOL=OFF

# Defines if libevent should build without the benchmark exectuables
EVENT__DISABLE_BENCHMARK:BOOL=OFF

# Define if libevent should build without support for a debug mode
EVENT__DISABLE_DEBUG_MODE:BOOL=OFF

# Define if libevent should not allow replacing the mm functions
EVENT__DISABLE_MM_REPLACEMENT:BOOL=OFF

# Define if libevent should build without support for OpenSSL encrpytion
EVENT__DISABLE_OPENSSL:BOOL=ON

# Disable the regress tests
EVENT__DISABLE_REGRESS:BOOL=OFF

# Disable sample files
EVENT__DISABLE_SAMPLES:BOOL=OFF

# If tests should be compiled or not
EVENT__DISABLE_TESTS:BOOL=OFF

# Define if libevent should not be compiled with thread support
EVENT__DISABLE_THREAD_SUPPORT:BOOL=OFF

# Enables verbose debugging
EVENT__ENABLE_VERBOSE_DEBUG:BOOL=OFF

# When crosscompiling forces running a test program that verifies that Kqueue
# works with pipes. Note that this requires you to manually run the test program
# on the the cross compilation target to verify that it works. See cmake
# documentation for try_run for more details
EVENT__FORCE_KQUEUE_CHECK:BOOL=OFF

# set EVENT_STAGE_VERSION
EVENT__STAGE_VERSION:STRING=beta

More variables can be found by running cmake -LAH <sourcedir_path>

CMake (Windows)

Install CMake: <http://www.cmake.org>

 $ md build && cd build
 $ cmake -G "Visual Studio 10" ..   # Or whatever generator you want to use cmake --help for a list.
 $ start libevent.sln

CMake (Unix)

 $ mkdir build && cd build
 $ cmake ..     # Default to Unix Makefiles.
 $ make
 $ make verify  # (optional)

1. BUILDING AND INSTALLATION (In Depth)

Autoconf

To build libevent, type

 $ ./configure && make

(If you got libevent from the git repository, you will first need to run the included "autogen.sh" script in order to generate the configure script.)

You can run the regression tests by running

 $ make verify

Install as root via

 $ make install

Before reporting any problems, please run the regression tests.

To enable the low-level tracing build the library as:

 $ CFLAGS=-DUSE_DEBUG ./configure [...]

Standard configure flags should work. In particular, see:

--disable-shared Only build static libraries --prefix Install all files relative to this directory.

The configure script also supports the following flags:

--enable-gcc-warnings Enable extra compiler checking with GCC. --disable-malloc-replacement Don't let applications replace our memory management functions --disable-openssl Disable support for OpenSSL encryption. --disable-thread-support Don't support multithreaded environments.

CMake (Windows)

(Note that autoconf is currently the most mature and supported build enviroment for libevent; the cmake instructions here are new and experimental, though they should be solid. We hope that cmake will still be supported in future versions of Libevent, and will try to make sure that happens.)

First of all install <http://www.cmake.org>.

To build libevent using Microsoft Visual studio open the "Visual Studio Command prompt" and type:

$ cd <libevent source dir>
$ mkdir build && cd build
$ cmake -G "Visual Studio 10" ..   # Or whatever generator you want to use cmake --help for a list.
$ start libevent.sln

In the above, the ".." refers to the dir containing the Libevent source code. You can build multiple versions (with different compile time settings) from the same source tree by creating other build directories.

It is highly recommended to build "out of source" when using CMake instead of "in source" like the normal behaviour of autoconf for this reason.

The "NMake Makefiles" CMake generator can be used to build entirely via the command line.

To get a list of settings available for the project you can type:

$ cmake -LH ..

GUI

CMake also provides a GUI that lets you specify the source directory and output (binary) directory that the build should be placed in.

OpenSSL support

To build Libevent with OpenSSL support you will need to have OpenSSL binaries available when building, these can be found here: <http://www.openssl.org/related/binaries.html>

2. USEFUL LINKS:

For the latest released version of Libevent, see the official website at <http://libevent.org/> .

There's a pretty good work-in-progress manual up at <http://www.wangafu.net/~nickm/libevent-book/> .

For the latest development versions of Libevent, access our Git repository via

$ git clone git://levent.git.sourceforge.net/gitroot/levent/libevent

You can browse the git repository online at:

<http://levent.git.sourceforge.net/git/gitweb-index.cgi>

<https://github.com/libevent/Libevent>

To report bugs, request features, or submit patches to Libevent, use the Sourceforge trackers at

<https://sourceforge.net/tracker/?group_id=50884>

There's also a libevent-users mailing list for talking about Libevent use and development:

<http://archives.seul.org/libevent/users/>

3. ACKNOWLEDGMENTS

The following people have helped with suggestions, ideas, code or fixing bugs:

If we have forgotten your name, please contact us.

shortlog
2015-12-22 Mark EllzeyFixed issue with cmake version generationmaster
2015-12-21 Mark EllzeyMerge pull request #125 from libevent/master
2015-12-21 Mark EllzeyMerge pull request #305 from libevent/cmake_updates
2015-12-21 Mark EllzeyCmake is now officially working.
2015-12-21 Mark EllzeyMore cmake updates, lot's of missing definitions
2015-12-20 Mark EllzeyMerge pull request #300 from ellzey/cmake_updates
2015-12-20 Mark EllzeyCMake syntax fixes fo .in files
2015-12-20 Mark EllzeyMerge pull request #299 from libevent/revert-297-master
2015-12-20 Mark EllzeyRevert "The Windows socket type is defined as SOCKET."
2015-12-20 Mark EllzeyCMAKE CMAKE CMAKE CLEANUPS
2015-12-19 Mark EllzeyLot's of cmake updates
2015-12-18 Mark EllzeyMerge pull request #297 from billsegall/master
2015-12-17 billsegallProvide a mechanism for building the library on Windows...
2015-12-16 billsegallThe Windows socket type is defined as SOCKET.
2015-12-14 Mark EllzeyMerge pull request #296 from lzmths/master
2015-12-14 Mark EllzeyMerge pull request #289 from mc-server/UnicodeErrMsgFix
...
tags
9 years ago release-2.0.22-stable Release 2.0.22-stable
9 years ago release-2.1.5-beta Libevent 2.1.5-beta
10 years ago release-2.1.4-alpha Libevent 2.1.4-alpha.
11 years ago release-2.1.3-alpha Libevent 2.1.3-alpha release.
11 years ago release-2.1.2-alpha Tagging Libevent release 2.1.2...
11 years ago release-2.0.21-stable Tagging Libevent version 2.0.21...
11 years ago release-2.0.20-stable Libevent release 2.0.20-stable
12 years ago release-2.0.19-stable Libevent version 2.0.19-stable
12 years ago release-2.1.1-alpha Libevent 2.1.1-alpha
12 years ago release-2.0.18-stable Libevent release 2.0.18-stable
12 years ago release-2.0.17-stable Release 2.0.17-stable
12 years ago release-2.0.16-stable Libevent release 2.0.16-stable
12 years ago release-2.0.15-stable Libevent release 2.0.15-stable
12 years ago release-2.0.14-stable Libevent version 2.0.14-stable
12 years ago release-2.0.13-stable Tag release 2.0.13-stable
12 years ago release-2.0.12-stable Libevent 2.0.12-stable
...
heads
8 years ago master
8 years ago patches-2.0
9 years ago patches-1.4