一,下载最新的libjingle src文件

二,将源码放到android源码的external目录下

三,在libjingle/trunk目录下建立Android.mk与Application.mk文件

Android.mk:

LOCAL_PATH:= $(call my-dir)  

include $(CLEAR_VARS) 

LOCAL_MODULE := libjingle

LOCAL_CPP_EXTENSION := .cc .cpp

 

MY_INCLUDES := \

$(LOCAL_PATH)/talk/third_party/openssl/crypto/asn1 \

$(LOCAL_PATH)/talk/third_party/openssl/crypto/evp \

$(LOCAL_PATH)/talk/third_party/openssl/crypto \

$(LOCAL_PATH)/talk/third_party/expat-2.0.1/lib \

$(LOCAL_PATH)/talk/third_party/expat-2.0.1/vms \

$(LOCAL_PATH)/talk/third_party/include/expat \

$(LOCAL_PATH)/talk/third_party/include \

$(LOCAL_PATH)/talk \

$(LOCAL_PATH)/talk/third_party/libudev \

$(LOCAL_PATH)/talk/third_party/gtest/ \

$(LOCAL_PATH)/talk/third_party/gtest/include \

$(LOCAL_PATH)/ \

$(LOCAL_PATH)/talk/examples/register \

./

 LOCAL_SRC_FILES := \

talk/third_party/expat-2.0.1/lib/xmlparse.c \

talk/third_party/expat-2.0.1/lib/xmlrole.c \

talk/third_party/expat-2.0.1/lib/xmltok.c \

talk/third_party/expat-2.0.1/lib/xmltok_impl.c \

talk/third_party/expat-2.0.1/lib/xmltok_ns.c \

talk/base/asyncfile.cc \

talk/base/asynchttprequest.cc \

talk/base/asyncsocket.cc \

talk/base/asynctcpsocket.cc \

talk/base/asyncudpsocket.cc \

talk/base/autodetectproxy.cc \

talk/base/base64.cc \

talk/base/basicpacketsocketfactory.cc \

talk/base/bytebuffer.cc \

talk/base/checks.cc \

talk/base/common.cc \

talk/base/diskcache.cc \

talk/base/event.cc \

talk/base/fileutils.cc \

talk/base/firewallsocketserver.cc \

talk/base/flags.cc \

talk/base/helpers.cc \

talk/base/host.cc \

talk/base/httpbase.cc \

talk/base/httpclient.cc \

talk/base/httpcommon.cc \

talk/base/httprequest.cc \

talk/base/httpserver.cc \

talk/base/logging.cc \

talk/base/md5c.c \

talk/base/messagehandler.cc \

talk/base/messagequeue.cc \

talk/base/nethelpers.cc \

talk/base/network.cc \

talk/base/openssladapter.cc \

talk/base/pathutils.cc \

talk/base/physicalsocketserver.cc \

talk/base/proxydetect.cc \

talk/base/proxyinfo.cc \

talk/base/ratetracker.cc \

talk/base/signalthread.cc \

talk/base/socketadapters.cc \

talk/base/socketaddress.cc \

talk/base/socketaddresspair.cc \

talk/base/socketpool.cc \

talk/base/socketstream.cc \

talk/base/ssladapter.cc \

talk/base/sslsocketfactory.cc \

talk/base/stream.cc \

talk/base/stringdigest.cc \

talk/base/stringencode.cc \

talk/base/stringutils.cc \

talk/base/task.cc \

talk/base/taskparent.cc \

talk/base/taskrunner.cc \

talk/base/thread.cc \

talk/base/time.cc \

talk/base/urlencode.cc \

talk/base/worker.cc \

talk/p2p/base/constants_p2p.cc \

talk/p2p/base/p2ptransport.cc \

talk/p2p/base/p2ptransportchannel.cc \

talk/p2p/base/parsing.cc \

talk/p2p/base/port.cc \

talk/p2p/base/pseudotcp.cc \

talk/p2p/base/relayport.cc \

talk/p2p/base/relayserver.cc \

talk/p2p/base/rawtransport.cc \

talk/p2p/base/rawtransportchannel.cc \

talk/p2p/base/session.cc \

talk/p2p/base/sessiondescription.cc \

talk/p2p/base/sessionmanager.cc \

talk/p2p/base/sessionmessages.cc \

talk/p2p/base/stun.cc \

talk/p2p/base/stunport.cc \

talk/p2p/base/stunrequest.cc \

talk/p2p/base/stunserver.cc \

talk/p2p/base/tcpport.cc \

talk/p2p/base/transport.cc \

talk/p2p/base/transportchannel.cc \

talk/p2p/base/transportchannelproxy.cc \

talk/p2p/base/udpport.cc \

talk/p2p/client/basicportallocator.cc \

talk/p2p/client/httpportallocator.cc \

talk/p2p/client/socketmonitor.cc \

talk/session/tunnel/pseudotcpchannel.cc \

talk/session/tunnel/tunnelsessionclient.cc \

talk/session/tunnel/securetunnelsessionclient.cc \

talk/session/phone/audiomonitor.cc \

talk/session/phone/call.cc \

talk/session/phone/channel.cc \

talk/session/phone/channelmanager.cc \

talk/session/phone/codec.cc \

talk/session/phone/currentspeakermonitor.cc \

talk/session/phone/devicemanager.cc \

talk/session/phone/filemediaengine.cc \

talk/session/phone/filevideocapturer.cc \

talk/session/phone/mediaengine.cc \

talk/session/phone/mediamessages.cc \

talk/session/phone/mediamonitor.cc \

talk/session/phone/mediasession.cc \

talk/session/phone/mediasessionclient.cc \

talk/session/phone/rtpdump.cc \

talk/session/phone/rtputils.cc \

talk/session/phone/rtcpmuxfilter.cc \

talk/session/phone/soundclip.cc \

talk/session/phone/srtpfilter.cc \

talk/session/phone/videocapturer.cc \

talk/session/phone/videocommon.cc \

talk/sound/nullsoundsystem.cc \

talk/sound/nullsoundsystemfactory.cc \

talk/sound/soundsysteminterface.cc \

talk/sound/soundsystemproxy.cc \

talk/xmllite/qname.cc \

talk/xmllite/xmlbuilder.cc \

talk/xmllite/xmlconstants.cc \

talk/xmllite/xmlelement.cc \

talk/xmllite/xmlnsstack.cc \

talk/xmllite/xmlparser.cc \

talk/xmllite/xmlprinter.cc \

talk/xmpp/constants.cc \

talk/xmpp/hangoutpubsubclient.cc \

talk/xmpp/iqtask.cc \

talk/xmpp/jid.cc \

talk/xmpp/mucroomconfigtask.cc \

talk/xmpp/mucroomlookuptask.cc \

talk/xmpp/pubsubclient.cc \

talk/xmpp/pubsubtasks.cc \

talk/xmpp/receivetask.cc \

talk/xmpp/saslmechanism.cc \

talk/xmpp/xmppclient.cc \

talk/xmpp/xmppengineimpl.cc \

talk/xmpp/xmppengineimpl_iq.cc \

talk/xmpp/xmpplogintask.cc \

talk/xmpp/xmppstanzaparser.cc \

talk/xmpp/xmpptask.cc \

talk/xmpp/ratelimitmanager.cc \

talk/base/latebindingsymboltable.cc \

talk/base/linux.cc \

talk/base/unixfilesystem.cc \

talk/base/opensslidentity.cc \

talk/base/opensslstreamadapter.cc \

talk/base/sslidentity.cc \

talk/base/sslstreamadapter.cc \

talk/session/phone/libudevsymboltable.cc \

talk/session/phone/v4llookup.cc \

talk/examples/register/ftplib.cpp \

talk/examples/register/myEmailHandler.cpp \

talk/examples/register/myMultiUserChatHandler.cpp \

talk/examples/register/mySession.cpp \

talk/examples/register/mySessionHandler.cpp \

talk/examples/register/myXmppHandler.cpp \

talk/examples/register/stringconverter.cpp \

talk/examples/register/xmppaccounttask.cc \

talk/examples/register/xmppauth.cc \

talk/examples/register/xmpppump.cc \

talk/examples/register/xmppregistertask.cc \

talk/examples/register/xmppsocket.cc \

talk/examples/register/xmppthread.cc

 LOCAL_C_INCLUDES += \

$(MY_INCLUDES)

 LOCAL_CPPFLAGS :=-DHAS_OPENSSL_1_0 -DFEATURE_ENABLE_SSL -DHAMMER_TIME=1 -DLOGGING=1 -DNOLFS  -DFEATURE_ENABLE_VOICEMAIL -DFEATURE_ENABLE_PSTN -DHAVE_SRTP -DHASHNAMESPACE=__gnu_cxx -DHASH_NAMESPACE=__gnu_cxx -DPOSIX -DDISABLE_DYNAMIC_CAST -DHAVE_OPENSSL_SSL_H=1 -D_REENTRANT -DOS_LINUX=OS_LINUX -DLINUX -D_DEBUG -DFEATURE_ENABLE_VOICEMAIL -DEXPAT_RELATIVE_PATH -DSRTP_RELATIVE_PATH -DXML_STATIC -DANDROID -DJNI_BASE

 LOCAL_CFLAGS += \

        -DHAVE_MEMMOVE \
-DNOLFS \
-DNO_SOUND_SYSTEM

 LOCAL_LDLIBS := -llog -ldl -lz  -lssl   -lcrypto  -lexpat -lsrtp 

 include $(LOCAL_PATH)/Application.mk

 include $(BUILD_SHARED_LIBRARY)


 Application.mk:

APP_STL := gnustl_static

四,直接ndk-build,注意用android-ndk-r7-crystax-1 版本的,否则许多c++函数编译不过

五、编译ndk-build  APP_PROJECT_PATH=./ APP_BUILD_SCRIPT=Android.mk

Logo

更多推荐