Chinaunix首页 | 论坛 | 博客
  • 博客访问: 177009
  • 博文数量: 28
  • 博客积分: 430
  • 博客等级: 下士
  • 技术积分: 257
  • 用 户 组: 普通用户
  • 注册时间: 2011-12-30 09:53
文章分类

全部博文(28)

文章存档

2012年(27)

2011年(1)

分类: LINUX

2012-04-27 12:46:35

移植

之前移植过pjproject-2.0beta,因为是测试版心里总是有阴影,所以就移植了这个正式版的,整个移植过程有点曲折,移植得并不完美,到现在也没有解决uuid库的问题,虽然交叉编译后的程序也能够正常运行,如果有知道这个问题的朋友,还望多多指教!另外,由于硬件配置不高,去掉了浮点的特性,但是官方文档说了,有些组件是必须使用浮点运算的,不管你是否设置了浮点参数!

“Floating point availability is controlled by PJ_HAS_FLOATING_POINT macro, which by default is set to 1 in . This can be overriden by declaring PJ_HAS_FLOATING_POINT to zero in your .

PJLIB, PJLIB-UTIL, and PJSIP does not need any floating point support. Even when floating point is disabled, everything should work correctly. However, the PJ_HAS_FLOATING_POINT macro still MUST be set accordingly in order for some fallback code to get activated.

However, the situation is different in PJMEDIA. Some PJMEDIA components (such as tone generator, RTCP calculation, Speex codec, and AEC) do have fallback algorithm implemented in fixed point, which get activated when PJ_HAS_FLOATING_POINT macro is set to zero. However, some other components do not have the alternative fixed point implementation, thus the floating point based code will get used regardless of the floating point setting (examples of such components are the resampling, PLC, and iLBC” codec).

1)创建config_site.h
在/pjproject-1.10/pjlib/include/pj目录下创建config_site.h这个文件,内容可以为空,也可以设置一些个性化的参数,我的设置如下:

点击(此处)折叠或打开

  1. #define PJ_IS_LITTLE_ENDIAN 1
  2. #define PJ_IS_BIG_ENDIAN 0
  3. #define PJ_HAS_FLOATING_POINT 0
可以看到我是设置了处理器的大小端,这个必须得设置的,然后关掉浮点运算。

2)移植

点击(此处)折叠或打开

  1. ./configure --prefix=/wo/arm/pjsip --host=arm-linux --disable-floating-point --disable-speex-aec --disable-ilbc-codec --disable-ssl --disable-opencore-amrnb LIBS=-lm
  2. make dep
  3. make
  4. make install


编译

移植完之后可以发现这是个静态库,对于习惯使用动态库的人来说编译还是有点小麻烦,反正我是第一次,呵呵~菜鸟一只!编译程序,首先打开一个终端,
1) 设置配置参数的环境变量
export PKG_CONFIG_PATH=/wo/arm/pjsip/lib/pkgconfig:$PKG_CONFIG_PATH
查看一下,看是否设置正确
echo $PKG_CONFIG_PATH

2)Makefile

点击(此处)折叠或打开

  1. # If your application is in a file named myapp.cpp or myapp.c
  2. # this is the line you will need to build the binary.
  3. all: pjsua

  4. CC = arm-linux-gcc
  5. pjsua: pjsua.c
  6.     $(CC) -Wall -o $@ $< `pkg-config --cflags --libs libpjproject` -lm -O3

  7. clean:
  8.     rm -f pjsua

3)make

注:因为我在移植过程中uuid库的问题没有解决,这样编译出来的程序在运行时总是说没有链接到这个共享库,所以我干脆把/wo/arm/pjsip/lib/pkgconfig下的PC文件中-luuid给删掉了。
    如果在编译sample目录下的例子时提示没有util.h这个文件,就把sample目录下的util.h拷贝到编译好的库目录下的include目录下面。


阅读(4172) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~