0

Allow using system libevent instead of the bundled one.

Patch by Bernard Cafarelli <voyageur@gentoo.org>

TEST=none
BUG=22140

Review URL: http://codereview.chromium.org/524061

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35711 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
phajdan.jr@chromium.org
2010-01-07 18:16:58 +00:00
parent 227b543c55
commit e97831dd75
7 changed files with 89 additions and 45 deletions

@ -58,3 +58,4 @@ Dominic Jodoin <dominic.jodoin@gmail.com>
Kaspar Brand <googlecontrib@velox.ch>
Clemens Fruhwirth <clemens@endorphin.org>
Kevin Lee Helpingstine <sig11@reprehensible.net>
Bernard Cafarelli <voyageur@gentoo.org>

@ -13,7 +13,11 @@
#include "base/scoped_nsautorelease_pool.h"
#include "base/scoped_ptr.h"
#include "base/time.h"
#if defined(USE_SYSTEM_LIBEVENT)
#include <event.h>
#else
#include "third_party/libevent/event.h"
#endif
// Lifecycle of struct event
// Libevent uses two main data structures:

@ -18,8 +18,12 @@
#include "base/message_loop.h"
#include "base/message_pump_libevent.h"
#include "net/base/net_errors.h"
#if defined(USE_SYSTEM_LIBEVENT)
#include <event.h>
#else
#include "third_party/libevent/event.h"
#endif
#endif
#include "base/eintr_wrapper.h"
#include "base/platform_thread.h"

@ -13,8 +13,12 @@
#include <sys/socket.h>
#include <arpa/inet.h>
#include "net/base/net_errors.h"
#if defined(USE_SYSTEM_LIBEVENT)
#include <event.h>
#else
#include "third_party/libevent/event.h"
#endif
#endif
#include "base/eintr_wrapper.h"
#include "net/base/net_util.h"

@ -13,7 +13,11 @@
#include <sys/socket.h>
#include "base/message_loop.h"
#include "net/base/net_errors.h"
#if defined(USE_SYSTEM_LIBEVENT)
#include <event.h>
#else
#include "third_party/libevent/event.h"
#endif
#include "base/message_pump_libevent.h"
#endif

@ -16,8 +16,11 @@
#include "net/base/io_buffer.h"
#include "net/base/load_log.h"
#include "net/base/net_errors.h"
#if defined(USE_SYSTEM_LIBEVENT)
#include <event.h>
#else
#include "third_party/libevent/event.h"
#endif
namespace net {

@ -3,54 +3,78 @@
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'libevent',
'product_name': 'event',
'type': '<(library)',
'sources': [
'buffer.c',
'evbuffer.c',
'evdns.c',
'event.c',
'event_tagging.c',
'evrpc.c',
'evutil.c',
'http.c',
'log.c',
'poll.c',
'select.c',
'signal.c',
'strlcpy.c',
'variables': {
'use_system_libevent%': 0,
},
'conditions': [
['use_system_libevent==0', {
'targets': [
{
'target_name': 'libevent',
'product_name': 'event',
'type': '<(library)',
'sources': [
'buffer.c',
'evbuffer.c',
'evdns.c',
'event.c',
'event_tagging.c',
'evrpc.c',
'evutil.c',
'http.c',
'log.c',
'poll.c',
'select.c',
'signal.c',
'strlcpy.c',
],
'defines': [
'HAVE_CONFIG_H',
],
'include_dirs': [
'.', # libevent includes some of its own headers with
# #include <...> instead of #include "..."
],
'conditions': [
# libevent has platform-specific implementation files. Since its
# native build uses autoconf, platform-specific config.h files are
# provided and live in platform-specific directories.
[ 'OS == "linux"', {
'sources': [ 'epoll.c', 'epoll_sub.c' ],
'include_dirs': [ 'linux' ],
'link_settings': {
'libraries': [
# We need rt for clock_gettime().
# TODO(port) Maybe on FreeBSD as well?
'-lrt',
],
},
}],
[ 'OS == "mac" or OS == "freebsd"', {
'sources': [ 'kqueue.c' ],
'include_dirs': [ 'mac' ]
}],
],
},
],
'defines': [
'HAVE_CONFIG_H',
],
'include_dirs': [
'.', # libevent includes some of its own headers with #include <...>
# instead of #include "..."
],
'conditions': [
# libevent has platform-specific implementation files. Since its
# native build uses autoconf, platform-specific config.h files are
# provided and live in platform-specific directories.
[ 'OS == "linux"', {
'sources': [ 'epoll.c', 'epoll_sub.c' ],
'include_dirs': [ 'linux' ],
'link_settings': {
'libraries': [
# We need rt for clock_gettime().
# TODO(port) Maybe on FreeBSD as well?
'-lrt',
}, { # use_system_libevent != 0
'targets': [
{
'target_name': 'libevent',
'type': 'settings',
'direct_dependent_settings': {
'defines': [
'USE_SYSTEM_LIBEVENT',
],
},
}],
[ 'OS == "mac" or OS == "freebsd"', {
'sources': [ 'kqueue.c' ],
'include_dirs': [ 'mac' ]
}],
'link_settings': {
'libraries': [
'-levent',
],
},
}
],
},
}],
],
}