diff options
Diffstat (limited to 'third_party/libevent')
-rw-r--r-- | third_party/libevent/SConscript | 39 | ||||
-rwxr-xr-x | third_party/libevent/libevent.xcodeproj/libevent_prebuild.sh | 7 |
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 |