libevent 2.0.16-stable移植到android记录 附源码



libevent 2.0.16-stable移植到android记录
#define VERSION "2.0.16-stable"


把需要的文件拷贝到wifi目录


/a33-dvk3/system/wifi




Android.mk文件
LOCAL_PATH:= $(call my-dir)


include $(CLEAR_VARS)
LOCAL_MODULE_TAGS :=optional
#LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
#LOCAL_C_INCLUDES += system/core/include/cutils







#LOCAL_SHARED_LIBRARIES := libcutils liblog ddd


 
LOCAL_SHARED_LIBRARIES := \
    libandroid_runtime \
    libnativehelper \
    libutils \
    libbinder \
    libmedia \
    libskia  \
    libui \
    libcutils \
    libgui \
    libstagefright \
    libcamera_client \
    libsqlite \
    libmtp \
    libusbhost \
    libexif  \
liblog  \



 
#LOCAL_LDLIBS := -lpthread  
LOCAL_MODULE := wifi
#LOCAL_SRC_FILES:=htfsk.c usrlink.c




#LOCAL_PATH := $(call my-dir)/..
#include $(CLEAR_VARS)
#LOCAL_MODULE := libevent


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


LOCAL_C_INCLUDES := \
$(LOCAL_PATH) \
    $(LOCAL_PATH)/include \
    $(LOCAL_PATH)/compat \
$(KERNEL_HEADERS) \
$(TOP)/system2/core/include/cutils  \
$(TOP)/external/openssl/include


   
$(info KERNEL_HEADERS = $(KERNEL_HEADERS) )
$(info TOP = $(TOP) )
$(info LOCAL_PATH = $(LOCAL_PATH) )







LOCAL_CFLAGS := -DHAVE_CONFIG_H --static


#include $(BUILD_SHARED_LIBRARY)










LOCAL_PRELINK_MODULE := false
include $(BUILD_EXECUTABLE)






















运行情况:
# wifi www.baidu.com                                 
in evdns_base_new
INFO: Parsing resolv.conf file /etc/resolv.conf
[debug] event_add: event: 0x416b8848 (fd 9), EV_READ   call 0x400ce4c1
[debug] Epoll ADD(1) on fd 9 okay. [old events were 0; read change was 1; write change was 0]
INFO: Added nameserver 114.114.114.114:53
EVUTIL_AI_CANONNAME in example = 2
debug3
resolving (fwd) www.baidu.com...
INFO: Resolve requested for www.baidu.com
INFO: Setting timeout for request 0x416b8978
[debug] event_add: event: 0x416b89a0 (fd -1),   EV_TIMEOUT call 0x400cc035
[debug] event_add: timeout in 5 seconds, call 0x400cc035
debug4
done 2
done 3
[debug] timeout_next: in 4 seconds
done 4
done 5
done 6
[debug] epoll_dispatch: epoll_wait reports 1
[debug] event_active: 0x416b8848 (fd 9), res 2, callback 0x400ce4c1
done 7
done 8
[debug] event_process_active: event: 0x416b8848, EV_READ  call 0x400ce4c1
before reply_parse
reply_parse.1
reply_parse.2
reply_parse.3
reply_parse.4
reply_parse.5
INFO: Removing timeout for request 0x416b8978
[debug] event_del: 0x416b89a0 (fd -1), callback 0x400cc035
www.baidu.com: 14.215.177.38
www.baidu.com: 14.215.177.37




注意:android是没有/etc/resolv.conf文件的
从linux主机拷一个进来
我的内容是:


shell@astar-dvk3:/etc # cat  resolv.conf                                       
#Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#nameserver 127.0.0.1

nameserver 114.114.114.114






源码下载链接地址:

http://download.csdn.net/detail/dp__mcu/9680967






















  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值