Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: libevent/libevent
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: patches-2.0
Choose a base ref
...
head repository: ventureresearch/libevent
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: patches-2.0
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 1, 2012

  1. Add Android.mk build file and pre-generated config.h to build nativel…

    …y on Android as a static library.
    
    Tested: general event support, socket support, pthread support
    Not tested: openssl
    
    To use in a libevent-powered application, add this to the app's Android.mk:
    
    LOCAL_STATIC_LIBRARIES:= libevent2
    
    Based on the latest stable version 2.0.20.
    Venture Research committed Nov 1, 2012
    Copy the full SHA
    3b780be View commit details
  2. Adding Readme file for Android information.

    Venture Research committed Nov 1, 2012
    Copy the full SHA
    26f38aa View commit details
  3. adding TAILQ_END since it is not defined in Android; adding commented…

    …-out BUILD_SHARED_LIBRARY support
    Venture Research committed Nov 1, 2012
    Copy the full SHA
    408fa9c View commit details
Showing with 983 additions and 0 deletions.
  1. +47 −0 Android.mk
  2. +32 −0 README.Android
  3. +440 −0 android/event2/config.h
  4. +464 −0 android/event2/event-config.h
47 changes: 47 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
####################################
# Build libevent as separate library

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE:= libevent2
LOCAL_MODULE_TAGS:= optional

LOCAL_SRC_FILES := \
buffer.c \
bufferevent.c \
bufferevent_filter.c \
bufferevent_openssl.c \
bufferevent_pair.c \
bufferevent_ratelim.c \
bufferevent_sock.c \
epoll.c \
epoll_sub.c \
evdns.c \
event.c \
event_tagging.c \
evmap.c \
evrpc.c \
evthread.c \
evthread_pthread.c \
evutil.c \
evutil_rand.c \
http.c \
listener.c \
log.c \
poll.c \
select.c \
signal.c \
strlcpy.c

LOCAL_C_INCLUDES := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/android \
$(LOCAL_PATH)/include \
external/openssl/include

LOCAL_CFLAGS := -DHAVE_CONFIG_H -DANDROID -fvisibility=hidden

include $(BUILD_STATIC_LIBRARY)
#include $(BUILD_SHARED_LIBRARY)
32 changes: 32 additions & 0 deletions README.Android
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Android compatibility layer for libevent
========================================
This project builds libevent for Android as a static library. It has been tested with gingerbread and ICS (android rowboat.)

Tested parts:
+ general event support
+ socket support
+ pthread safety (event_use_pthreads)

Not tested/supported yet:
- openssl

It is called libevent2 as ICS's Chromium ships with an old version of libevent resulting in a namespace collision.

How to use
----------
To use this library in a libevent-powered application, add the following to your application's Android.mk:

LOCAL_STATIC_LIBRARIES:= libevent2

LOCAL_C_INCLUDES:= external/libevent/include \
external/libevent/android

LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%)

The default is to link libevent with the application as a static library. It is possible to build it as a shared library as well by changing the Android.mk to `BUILD_SHARED_LIBRARY` and setting the corresponding LDFLAGS as well.

History
-------
This was built by using droid-gcc to do the initial build, then reusing the generated config.h and event-config.h and writing a proper Android.mk file.

The code is based on the latest stable version (at the moment) 2.0.20, and is applied to the 2.0 branch. It may move to 2.1 as soon as it is stable and we use it for our application.
Loading