Mac 编译安装libevent 库
打开下面的网页,复制shell 脚本:
https://github.com/mtigas/iOS-OnionBrowser/blob/master/build-libevent.sh
我把build-libevent.sh中下面的验证代码注释掉。
#if out=$(gpg --status-fd 1 --verify "libevent-${VERSION}.tar.gz.asc" "libevent-${VERSION}.tar.gz" 2>/dev/null) &&
#echo "$out" | grep -qs "^\[GNUPG:\] VALIDSIG"; then
#echo "$out" | egrep "GOODSIG|VALIDSIG"
#echo "Verified GPG signature for source..."
#else
#echo "$out" >&2
#echo "COULD NOT VERIFY PACKAGE SIGNATURE..."
#exit 1
#fi
运行脚本./build-libevent.sh 便可以编译libevent
~/Work/Code/Libevent/dependencies
$ ls */*
include/evdns.h include/evhttp.hinclude/evutil.h lib/libevent_core.a lib/libevent_pthreads.a
include/event.h include/evrpc.hlib/libevent.a lib/libevent_extra.a
可知在dependencies目录下面,有已经编译好的库和头文件
接下来在实例中加入该*.h 和*.a 文件即可。
参考网页:
http://blog.csdn.net/sozell/article/details/8926090