移植libjingle v0.5x for IOS(iphone device + iphone simulator)

2023-11-28 22:08

本文主要是介绍移植libjingle v0.5x for IOS(iphone device + iphone simulator),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

gtalk基本上可以算是非常好的聊天工具了,而它是如何工作的呢?我们如何在iphone上面为自己写一个gtalk玩一下呢?这一切都是基于libjingle这个库,这个Google Talk Voice and P2P interoperability Library.libjingle这个库是一个用c++写的跨平台的库,它能很好运行在win/mac os/linux(include android)/prosix 等平台,当然也能运行在iphone平台,毕竟ios也是unix系统,但是前面的几个平台可能并不需要对libjingle库做一些程序改动就可以很好的运行了,但是ios平台却不一样,因为libjingle库中对mac os的支持代码中,有一部分代码仅仅适用于mac os,并不适用于有众多限制的ios平台,所以其实如果想移植libjingle 到ios还是需要一些改动的,在下不才,顺利完成了这次移植,希望本文能够给你带来帮助,在些感谢libjingle project owner and ilibjingle project owner:

 

(转载请保留此文字:本文来源:移植libjingle v0.5x for IOS(iphone device + iphone simulator) http://blog.csdn.net/ipromiseu/archive/2011/01/14/6140115.aspx] write by Gray.Luo guohui.great@gmail.com)

 

一.environment setting:

---------------------------------------------------------------------------

<1> First, install Python 2.4 or later from http://www.python.org/

 

<2> Second ,install the stand alone scons-local package 2.0.0 or later from

    http://www.scons.org/download.php and set an environment variable,

    SCONS_DIR, to point to the directory containing SCons:

 

for example:

$vim /User/gray/.profile

Enter the following content:

[c-sharp]  view plain copy
  1. #set env of SCONS_DIR  
  2. export SCONS_DIR=/Users/anson/Documents/work/scons-local-2.0.1/scons-local-2.0.1/  
 

 

$sourece /User/gray/.profile

 

<3> Third, install swtoolkit from http://code.google.com/p/swtoolkit/.

We just download it into a place(eg:/User/gray/..../swtoolkit), It's  a green tool.

 

<4>Finally, Libjingle depends on 3 open-source projects, expat , srtp and openssl.

    

Download expat from http://sourceforge.net/projects/expat/ to

    talk/third_party/expat-2.0.1/. 

Download srtp from http://libjingle.googlecode.com/files/srtp-cvs.zip to

    talk/third_party/srtp/. 

note:Don't download srtp from it's official website.only one google version can work for libjingle

 

Download openssl source code to

    talk/third_party/openssl-1.0.0.

二. Modify Build Parameters 

---------------------------------------------------------------------------

1.Modify  main.scons

 

 [iphone Simulator]:

 

(1) Change

'-isysroot', '/Developer/SDKs/MacOSX10.5.sdk',

to

'-isysroot', '/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk',

 

(2)Add the following content into # M A C OSX Block

 

mac_env.Replace(CC = '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2')

mac_env.Replace(CXX = '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2')

 

(3)Add 'CoreAudio', 'QuickTime', 'Cocoa', and 'QTKit' to the FRAMEWORKS variable.

 

 [iphone Device]:

 

(1) Change

'-isysroot', '/Developer/SDKs/MacOSX10.5.sdk',

to

    '-isysroot', '/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk',

 

(2)Add the following content into # M A C OSX Block

 

mac_env.Replace(CC='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2')

mac_env.Replace(CXX='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2')

(3)Add 'CoreAudio', 'QuickTime', 'Cocoa', and 'QTKit' to the FRAMEWORKS variable.

 

(4)Change ['-arch','i386'] to  ['-arch', 'armv6'] in mac env setting,

2.Modify libjingle.scons

(1)Comment out some files with "#",because IOS SDK is limited ,So some api is unsupport by IOS:

 

# "base/macutils.cc",

#               "session/phone/devicemanager_mac.mm",

#               "base/proxydetect.cc",

 

(2)Add some Header serach directory in includedirs.

like:

"third_party/openssl-1.0.0/include",

 

三.Building libjingle:

---------------------------------------------------------------------------

》》》How to build libjingle for iphone Simulator

1. 

$ cd libjingle-0.5/talk/third_party/srtp

$ ./configure

2.

$ cd libjingle-0.5/talk/third_party/expat-2.0.1 

$ ./configure

3. 

$ cd libjingle-0.5/talk/third_party/openssl-1.0.0 

$ ./config no-shared no-asm 

4. 

Build or Download openssl lib(libcrypto.a,libssl.a) for iphonesimulator to talk/build/dbg/lib

 

5.$/User/gray/..../swtoolkit/hammer.sh

 

》》》How to build libjingle for iphone

1.

 $cd libjingle-0.5/talk/third_party/srtp 

 $./configure --host=arm CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 CXX=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2

2. 

 $cd libjingle-0.5/talk/third_party/expat-2.0.1

 $./configure --host=arm CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 CXX=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2

3.

 $cd libjingle-0.5/talk/third_party/openssl-1.0.0

 $./config no-shared no-asm 

4. 

Build or Download openssl lib(libcrypto.a,libssl.a) for iphone device to talk/build/dbg/lib

 

5.$/User/gray/..../swtoolkit/hammer.sh

 

 

四.Modify libjingle source code

---------------------------------------------------------------------------

Refrence : http://code.google.com/p/ilibjingle/

 

 

五.XCode setting

You can refrence  http://code.google.com/p/ilibjingle/

 

1.Add libjingle.a path in Library Search Paths

2.Add some Header path in Header Search Paths

like:

/..../talk/third_party/srtp/crypto/include/
/..../talk/third_party/srtp/include/
/..../talk/third_party/expat-2.0.1/
/..../talk/third_party/openssl-1.0.0/include/
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/ /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/ <Multiple values>




这里,我的修改结果为:

 /..../talk/third_party/srtp/crypto/include/ --ok
/..../talk/third_party/srtp/include/  --ok
/..../talk/third_party/expat-2.0.1/  --ok
/..../talk/third_party/openssl-1.0.0/include/  --ok  ----需要重命名
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/ 
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/

--instead--/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers
--instead--/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/
---comment --这里可以是5.0,没有试过,应该可以的


3.GCC_PREPROCESSOR_DEFINITIONS:

 

POSIX xOSX_USE_COCOA HAMMER_TIME=1 LOGGING=1 FEATURE_ENABLE_SSL FEATURE_ENABLE_VOICEMAIL FEATURE_ENABLE_PSTN HASHNAMESPACE=__gnu_cxx DISABLE_DYNAMIC_CAST HAVE_OPENSSL_SSL_H=1 OS_MACOSX=OS_MACOSX OSX _DEBUG FLAVOR_DBG ENABLE_DEBUG FEATURE_ENABLE_VOICEMAIL EXPAT_RELATIVE_PATH SRTP_RELATIVE_PATH XML_STATIC HAVE_EXPAT_CONFIG_H MAC_OS_X_VERSION_MIN_REQUIRED=1040

 

 

(转载请保留此文字:本文来源:移植libjingle v0.5x for IOS(iphone device + iphone simulator) http://blog.csdn.net/ipromiseu/archive/2011/01/14/6140115.aspx] write by Gray.Luo guohui.great@gmail.com

 

 

这篇关于移植libjingle v0.5x for IOS(iphone device + iphone simulator)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/430358

相关文章

安卓链接正常显示,ios#符被转义%23导致链接访问404

原因分析: url中含有特殊字符 中文未编码 都有可能导致URL转换失败,所以需要对url编码处理  如下: guard let allowUrl = webUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {return} 后面发现当url中有#号时,会被误伤转义为%23,导致链接无法访问

【iOS】MVC模式

MVC模式 MVC模式MVC模式demo MVC模式 MVC模式全称为model(模型)view(视图)controller(控制器),他分为三个不同的层分别负责不同的职责。 View:该层用于存放视图,该层中我们可以对页面及控件进行布局。Model:模型一般都拥有很好的可复用性,在该层中,我们可以统一管理一些数据。Controlller:该层充当一个CPU的功能,即该应用程序

FreeRTOS-基本介绍和移植STM32

FreeRTOS-基本介绍和STM32移植 一、裸机开发和操作系统开发介绍二、任务调度和任务状态介绍2.1 任务调度2.1.1 抢占式调度2.1.2 时间片调度 2.2 任务状态 三、FreeRTOS源码和移植STM323.1 FreeRTOS源码3.2 FreeRTOS移植STM323.2.1 代码移植3.2.2 时钟中断配置 一、裸机开发和操作系统开发介绍 裸机:前后台系

Usb Audio Device Descriptor(10) Hid Device

对于 Standard Interface Descriptor, 当 bInterfaceClass=0x03时,即为HID设备。Standard Interface Descriptor如下 struct usb_standard_interface_descriptor{U8 bLength; /*Size of this descriptor in bytes*/U8 bDescrip

src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: 没有那个文件或目录

(venv) shgbitai@shgbitai-C9X299-PGF:~/pythonworkspace/ai-accompany$ pip install pyaudio sounddeviceCollecting pyaudioDownloading PyAudio-0.2.14.tar.gz (47 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

iOS剪贴板同步到Windows剪贴板(无需安装软件的方案)

摘要 剪贴板同步能够提高很多的效率,免去复制、发送、复制、粘贴的步骤,只需要在手机上复制,就可以直接在电脑上 ctrl+v 粘贴,这方面在 Apple 设备中是做的非常好的,Apple 设备之间的剪贴板同步功能(Universal Clipboard)确实非常方便,它可以在 iPhone、iPad 和 Mac 之间无缝传输剪贴板内容,从而大大提高工作效率。 但是,iPhone 如何和 Wind

RT-Thread(Nano版本)的快速移植(基于NUCLEO-F446RE)

目录 概述 1 RT-Thread 1.1 RT-Thread的版本  1.2 认识Nano版本 2 STM32F446U上移植RT-Thread  2.1 STM32Cube创建工程 2.2 移植RT-Thread 2.2.1 安装RT-Thread Packet  2.2.2 加载RT-Thread 2.2.3 匹配相关接口 2.2.3.1 初次编译代码  2.2.3.

iOS项目发布提交出现invalid code signing entitlements错误。

1、进入开发者账号,选择App IDs,找到自己项目对应的AppId,点击进去编辑, 2、看下错误提示出现  --Specifically, value "CVYZ6723728.*" for key "com.apple.developer.ubiquity-container-identifiers" in XX is not supported.-- 这样的错误提示 将ubiquity

我的第一次份实习工作-iOS实习生-第三个月

第三个月 这个月有一个考核项目,是一个电子书阅读器,组长说很重要,是我的实习考核项目。 我的项目XTReader,这是我参考网上的一些代码,和模仿咪咕阅读做的,功能还不完善,数据的部分是用聚合数据做的。要收费的。   还有阅读页面,基本功能实现了一下。使用了autolayout,自适应布局,也是第一次用网络,第一次用数据库,第一次用自动布局。还有很多不足。 做了一周多,有个问题一直没

我的第一次份实习工作-iOS实习生-公司使用过的软件

bittorrentsync 素材,文件同步软件 cornerstone svn 软件开发合作 mark man 测量坐标的软件 SQLLite Manager 数据库操作软件