移植
之前移植过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这个文件,内容可以为空,也可以设置一些个性化的参数,我的设置如下:
- #define PJ_IS_LITTLE_ENDIAN 1
- #define PJ_IS_BIG_ENDIAN 0
- #define PJ_HAS_FLOATING_POINT 0
可以看到我是设置了处理器的大小端,这个必须得设置的,然后关掉浮点运算。
2)移植
- ./configure --prefix=/wo/arm/pjsip --host=arm-linux --disable-floating-point --disable-speex-aec --disable-ilbc-codec --disable-ssl --disable-opencore-amrnb LIBS=-lm
- make dep
- make
- make install
编译
移植完之后可以发现这是个静态库,对于习惯使用动态库的人来说编译还是有点小麻烦,反正我是第一次,呵呵~菜鸟一只!编译程序,首先打开一个终端,
1) 设置配置参数的环境变量
export PKG_CONFIG_PATH=/wo/arm/pjsip/lib/pkgconfig:$PKG_CONFIG_PATH
查看一下,看是否设置正确
echo $PKG_CONFIG_PATH
2)Makefile
- # If your application is in a file named myapp.cpp or myapp.c
- # this is the line you will need to build the binary.
- all: pjsua
- CC = arm-linux-gcc
- pjsua: pjsua.c
- $(CC) -Wall -o $@ $< `pkg-config --cflags --libs libpjproject` -lm -O3
- clean:
- rm -f pjsua
3)make
注:因为我在移植过程中uuid库的问题没有解决,这样编译出来的程序在运行时总是说没有链接到这个共享库,所以我干脆把/wo/arm/pjsip/lib/pkgconfig下的PC文件中-luuid给删掉了。
如果在编译sample目录下的例子时提示没有util.h这个文件,就把sample目录下的util.h拷贝到编译好的库目录下的include目录下面。
阅读(4225) | 评论(0) | 转发(0) |