summaryrefslogtreecommitdiffstats
path: root/third_party/libevent
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 18:26:24 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 18:26:24 +0000
commitc7848cc2522c8057fe0c54a3485a98cd309c551f (patch)
tree7bc96c92ac98bb96cf427059a188ca6685aabcbd /third_party/libevent
parent8c1445388c4f9cdf1f2214d7924935b5891150ca (diff)
downloadchromium_src-c7848cc2522c8057fe0c54a3485a98cd309c551f.zip
chromium_src-c7848cc2522c8057fe0c54a3485a98cd309c551f.tar.gz
chromium_src-c7848cc2522c8057fe0c54a3485a98cd309c551f.tar.bz2
Get libevent building and linking in base_unittests in the Mac SCons build:
* Call the $LIBEVENT_DIR/SConscript file on both Linux and Mac. * Add generation of the config.h file. * Modify the libevent_prebuild.sh script so SCons can pass in the input file name (because SCons executes things from top of tree) but the script still defaults to what XCode wants. * Only build epoll.c and epoll_sub.c on Linux. * Only build kqueue.c on Mac. * Add -framework AppKit to the link lines. * Add -fobjc-gc to Objective C compilation. * Add message_pump_mac.mm to the base input file list on Mac. * Build message_pump_libevent.cc on for base on both Linux and Mac. * Link against -levent on both Linux and Mac. Review URL: http://codereview.chromium.org/4254 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libevent')
-rw-r--r--third_party/libevent/SConscript39
-rwxr-xr-xthird_party/libevent/libevent.xcodeproj/libevent_prebuild.sh7
2 files changed, 37 insertions, 9 deletions
diff --git a/third_party/libevent/SConscript b/third_party/libevent/SConscript
index 34ead9e..3d1eb9b 100644
--- a/third_party/libevent/SConscript
+++ b/third_party/libevent/SConscript
@@ -15,29 +15,41 @@ env.Append(
],
)
+if env['PLATFORM'] == 'darwin':
+ env.Prepend(
+ CPPPATH = [
+ '$LIBEVENT_DIR/generated/',
+ ],
+ )
+ env['ENV']['CONFIGURATION_TEMP_DIR'] = env.Dir('$LIBEVENT_DIR').abspath
+ env.Command('$LIBEVENT_DIR/generated/config.h',
+ ['libevent.xcodeproj/libevent_prebuild.sh', 'config.h.in'],
+ 'sh ${SOURCES[0]} ${SOURCES[1]}')
+
+
+if env['PLATFORM'] == 'posix':
+ env.Prepend(
+ CPPPATH = [
+ '$LIBEVENT_DIR/linux/',
+ ],
+ )
+
env.Prepend(
CPPPATH = [
'$LIBEVENT_DIR',
'$LIBEVENT_DIR/compat/',
- '$LIBEVENT_DIR/linux/',
],
)
-
input_files = [
'buffer.c',
- #'devpoll.c',
- 'epoll.c',
- 'epoll_sub.c',
'evbuffer.c',
'evdns.c',
'event.c',
'event_tagging.c',
- #'evport.c',
'evrpc.c',
'evutil.c',
'http.c',
- #'kqueue.c',
'log.c',
'poll.c',
'select.c',
@@ -45,5 +57,16 @@ input_files = [
'strlcpy.c',
]
+if env['PLATFORM'] == 'posix':
+ input_files.extend([
+ 'epoll.c',
+ 'epoll_sub.c',
+ ])
+
+if env['PLATFORM'] == 'darwin':
+ input_files.extend([
+ 'kqueue.c',
+ ])
+
-env.ChromeStaticLibrary('libevent', input_files)
+env.ChromeStaticLibrary('event', input_files)
diff --git a/third_party/libevent/libevent.xcodeproj/libevent_prebuild.sh b/third_party/libevent/libevent.xcodeproj/libevent_prebuild.sh
index 38c7da3..6e6c48c 100755
--- a/third_party/libevent/libevent.xcodeproj/libevent_prebuild.sh
+++ b/third_party/libevent/libevent.xcodeproj/libevent_prebuild.sh
@@ -11,6 +11,11 @@ GENERATED_DIR="${CONFIGURATION_TEMP_DIR}/generated"
# Generate config.h the same way that "sh configure" would
mkdir -p "${GENERATED_DIR}"
+CONFIG_H_IN="$1"
+if test "X${CONFIG_H_IN}" = "X"; then
+ CONFIG_H_IN="config.h.in"
+fi
+
CONFIG_H="${GENERATED_DIR}/config.h"
sed -e s/'^#undef DNS_USE_GETTIMEOFDAY_FOR_ID$'/'#define DNS_USE_GETTIMEOFDAY_FOR_ID 1'/ \
-e s/'^#undef HAVE_DLFCN_H$'/'#define HAVE_DLFCN_H 1'/ \
@@ -76,7 +81,7 @@ sed -e s/'^#undef DNS_USE_GETTIMEOFDAY_FOR_ID$'/'#define DNS_USE_GETTIMEOFDAY_FO
-e s/'^#undef TIME_WITH_SYS_TIME$'/'#define TIME_WITH_SYS_TIME 1'/ \
-e s/'^#undef VERSION$'/'#define VERSION "1.4.7-stable"'/ \
-e s@'^\(#undef .*\)$'@'/* \1 */'@ \
- < config.h.in \
+ < "${CONFIG_H_IN}" \
> "${CONFIG_H}.new"
if ! diff -q "${CONFIG_H}.new" "${CONFIG_H}" >& /dev/null ; then