Live555/ffmpeg(NEON支持)/boost交叉编译(整理版)

来源:互联网 发布:软件用户手册模板 编辑:程序博客网 时间:2024/05/22 09:11


BOOST

Boost Ver: 1.49.0
Compiler : GNU gcc 4.5.1 for ARM 

1. 确保ARM编译成功安装,并配置好环境变量。 
2. 解压boost压缩包 
3. 进入目录执行./bootstrap.sh, 此时形成bjam文件和project-config.jam 
4. 编辑project-config.jam, 仅修改using gcc这行。因为我使用的是arm-linux-gcc,所以将其改以下即可: 
     using gcc : : arm-linux-gcc ; 
5. 执行./bjam --without-python 
6. 形成的静态和动态库文件就在stage目录下. 




源码 live.2010.03.16.tar.gz ffmpeg-0.5.tar.bz2
交叉编译工具链 由compulab推荐的ati-driver-installer-10-11-x86.x86_64.run,运行后生成
目标平台:armlinux (cm-t3530 linux2.6.32)


*****************************live交叉编译***********************

1)进入源码目录,修改config.armlinux 文件,注意四个地方
CROSS_COMPILE=          arm-none-linux-gnueabi-
C_COMPILER =            $(CROSS_COMPILE)g++  // 此处经验证,应该为C_COMPILER =   $(CROSS_COMPILE)gcc
CPLUSPLUS_COMPILER =    $(CROSS_COMPILE)g++
LINK =                  $(CROSS_COMPILE)g++ -o
2)./genMakefiles armlinux
3)make
4)mkdir live1
  cd live1
  mkdir lib
  mkdir include
  cd include
  mkdir live
  将BasicUsageEnvironment groupsock liveMedia UsageEnvironment 四个目录下的静态库*.a 拷贝到live1/lib/下,将四个目录下的头文件*.hh拷贝到/live1/include/live/下




问题  
1)groupsock/inet.c 中有很多语法错误,这个文件太老了。
例如,将char *
our_inet_ntoa(in)
       struct in_addr in; 
{......}
改为:
char *
our_inet_ntoa(struct in_addr in)
{......}


2)testprog 和mediaserver链接错误,
  ----用超级用户,改makefile,注释掉两行,不进入这两个目录编译。我们要的只是四个静态库,这应该没影响。
#       cd $(TESTPROGS_DIR) ; $(MAKE)
#       cd $(MEDIA_SERVER_DIR) ; $(MAKE)
但是用这个库交叉编译应用程序时,出错。
看来不行。失败!


  -----修改config.armlinux 
C_COMPILER =            $(CROSS_COMPILE)g++ 改为 C_COMPILER =            $(CROSS_COMPILE)gcc
live库成功编译。编译程序时ok
inet.c 文件必须用“*C*”编译器编译,不能用C++。参考http://lists.live555.com/piper mail/live-devel/2005-April/002252.html






****************ffmpeg交叉编译********************



 ./configure --enable-cross-compile --cc=/home/liling/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc   --arch=arm-v5te --prefix=/home/liling/my-crosscompile/arm-cross-software   --disable-stripping
make
make install

./configure --enable-gpl --enable-cross-compile --cc=arm-linux-gcc   --arch=arm-A8 --host-os=linux --target-os=linux



问题:
1 )Symbol mangling check failed.  ???????????
把g++改成 gcc这个错就没了 


2 ) C compiler test failed.  ?????????????
~/my-crosscompile/ffmpeg$ ./configure --cross-compile --cc=/home/liling/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-g++ --cpu=arm-v5te  --arch=arm-v5te --prefix=/home/liling/my-crosscompile/arm-cross-software
/home/liling/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-g++ is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from SVN.  If the latest version fails, report the problem to the
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.


去掉--cpu=arm-v5te 就配置成功了。
*****
http://topic.csdn.net/u/20070514/09/0fba6efe-dd0e-466b-ad2a-b004b92a16f3.html
--cpu=armv4l 是不可以的,只能用--arch=armv4l代替!!!
********


加入neon支持:

关键点:--arch=arm --cpu=armv7-a --extra-cflags='-fPIC -march=armv7-a -mfloat-abi=softfp -mfpu=neon'


./configure --enable-asm --enable-gpl --enable-cross-compile --cc=arm-linux-gcc  --host-os=linux --target-os=linux  --arch=arm  --cpu=armv7-a --extra-cflags='-fPIC -march=armv7-a -mfloat-abi=softfp -mfpu=neon' 


安装后发现 libavcodec/arm文件夹下生成了 “h264cmc_neon.Sh264 dsp_neon.S h264cmc_neon.o h264dsp_neon.o”等文件。这说明FFmpeg已经生成了支持ARMv7 NEON的代码。


libavcodec/arm/ 会有 *neon* 的目标文件被生成


编译为动态库形式:


./configure --prefix=/cross-arm-linux/ffmpeg/  --enable-cross-compile --target-os=linux --cross-prefix=arm-linux- --cc=arm-linux-gcc --enable-shared --disable-static --enable-memalign-hack --arch=arm --cpu=armv7-a --enable-neon --enable-asm --enable-gpl --extra-cflags='-fPIC -march=armv7-a -mfloat-abi=softfp -mfpu=neon' 


参考文章:

ffmpeg neon优化必看!!android下编译ffmpeg with neon的正确方法(已验证)

http://blog.sina.com.cn/s/blog_4868f98601016o4e.html

FFmpeg 无法使用 ARMv7的NEON 指令集


http://www.amobbs.com/archiver/tid-5539798.html

0 0
原创粉丝点击