Linphone 2.0 for Android 编译

新版的Linphone支持SUBSCRIBE/NOTIFY了,当然要把最新代码拿出来集成到我们的客户端里头。

这次编译除了ndk之外还需要Android sdk,其他的前提条件倒是差不多。

上次我是在centos 5.5 64位上编译成功的,结果这次在同一个环境地下居然不行了,编译第一个模块libilbc-rfc3951就碰到了问题:

configure: error: cannot find install-sh, install.sh, or shtool in build-aux “.”/build-aux
make: *** [/root/linphone-android/submodules/libilbc-rfc3951/Makefile] Error 1

搜了一下没搞明白怎么回事儿,装了shtool也没有用,单独把这个模块的源代码clone出来编译也遇到同样的问题。于是转向机器上的另外一个centos 6.3的虚拟机。

准备环境倒也不麻烦,无非就是autoconf, automake, aclocal, libtoolize, pkgconfig这几个,不过aclocal,libtoolize通过yum是找不到的,安装autoconf的时候不要yum,直接用源代码编译安装,这样也就包含了aclocal和libtoolize了。

然后就遇到下载文件按失败:

/usr/bin/wget –no-check-certificate http://www.webrtc.org/ilbc-freeware/ilbc-source-code-and-utili/ilbc-utilities/extract-cfile.awk -O extract-cfile.awk
–2013-04-10 23:17:41– http://www.webrtc.org/ilbc-freeware/ilbc-source-code-and-utili/ilbc-utilities/extract-cfile.awk
正在解析主机 www.webrtc.org… 74.125.31.121, 2404:6800:4008:c01::79
正在连接 www.webrtc.org|74.125.31.121|:80… 失败:拒绝连接。
正在连接 www.webrtc.org|2404:6800:4008:c01::79|:80… 失败:网络不可达。

看了一下,这个www.webrtd.org被盾了,需要用代理访问,windows下载之后上传即可。(PS: 后来又能下载了)

后面就遇到:

ant partial-clean
make: execvp: ant: 权限不够
make: *** [generate-apk] 错误 127

yum install ant错误消失了,但是马上就遇到:
BUILD FAILED
/root/linphone-android/build.xml:91: The following error occurred while executing this line:
/root/adt-bundle-linux-x86_64-20130219/sdk/tools/ant/build.xml:206: No supported regular expression matcher found: java.lang.ClassNotFoundException: org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp

手工安装最新的ant 1.9.0。

然后就遇到:

[aapt] /root/adt-bundle-linux-x86_64-20130219/sdk/platform-tools/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

BUILD FAILED
/root/adt-bundle-linux-x86_64-20130219/sdk/tools/ant/build.xml:647: The following error occurred while executing this line:
/root/adt-bundle-linux-x86_64-20130219/sdk/tools/ant/build.xml:688: null returned: 127

装了几个版本的libz之后都有问题,后来忽然想到README里头有一句:on some 64 bits systems you’ll need the ia32-libs package。

看了一下果然是需要32位的包,因为安卓源代码本来就是32位的。可是找了半天也没有找到这个ia32-libs,ubuntu上倒是有现成的。那就只能见招拆招了,直接http://rpmfind.net/搜 libz.so.1,找32位的下载安装,幸好缺的包也不多,再装了一个libncurses.so.5之后总算成功了。

要是32位系统的可能会更容易些,估计ubuntu会更容易些,yum现在很落后了,好多包也没有,或者就是很老。下次试试。

2 thoughts on “Linphone 2.0 for Android 编译”

  1. 您好,编译linphone遇到了很多问题,想咨询下您,可以发一份您编译通过的源码到我邮箱吗,邮箱是zgwl_zhaoqx@163.com,谢谢!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.