织梦CMS - 轻松建站从此开始!

罗索实验室

ushare 交叉编译

落鹤生 发布于 2012-01-02 11:45 点击:次 
差不多编了两个星期的ushare-1.1a ,今天终于完工。现在将个人的安装步骤贴出来,希望自己以后有个参考,也希望能帮到进行交叉编译ushare的人。如果有不足的或者有误的地方,也希望能得到大家的指点。
TAG:

差不多编了两个星期的ushare-1.1a ,今天终于完工。现在将个人的安装步骤贴出来,希望自己以后有个参考,也希望能帮到进行交叉编译ushare的人。如果有不足的或者有误的地方,也希望能得到大家的指点。

环境:arm9

1.支持mp3 (即lame)

# cd lame-*

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#CC=/usr/local/920t_le/bin/arm_920t_le-gcc CPP=/usr/local/920t_le/bin/arm_920t_le-cpp CXX=/usr/local/920t_le/bin/arm_920t_le-g++ AR=/usr/local/920t_le/bin/arm_920t_le-ar ./configure --host=arm-920t_le-linux --prefix=/usr/local/920t_le/sysroot --enable-shared

#make

#make install

2.支持Xvid和x264

# cd x264-*

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

CC=/usr/local/920t_le/bin/arm_920t_le-gcc   CPP=/usr/local/920t_le/bin/arm_920t_le-cpp CXX=/usr/local/920t_le/bin/arm_920t_le-g++ ./configure --host=arm-920t_le-linux --prefix=/usr /local/920t_le/sysroot   --enable-shared

#make

#make install

#cd xvidcore-*/build/generic

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#CC=/usr/local/920t_le/bin/arm_920t_le-gcc CPP=/usr/local/920t_le/bin/arm_920t_le-cpp CXX=/usr/local/920t_le/bin/arm_920t_le-g++ ./configure --host=arm-920t_le-linux --prefix=/usr /local/920t_le/sysroot    --enable-shared

#make

#make install

3.支持支持MPEG4和AAC

#cd libmp4v2-*

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#CC=/usr/local/920t_le/bin/arm_920t_le-gcc CPP=/usr/local/920t_le/bin/arm_920t_le-cpp CXX=/usr/local/920t_le/bin/arm_920t_le-g++ ./configure --host=arm-920t_le-linux --prefix=/usr /local/920t_le/sysroot    --enable-shared

#make

#make install

faac:

在编译faac的时候如果有错误报告:“不能运行./config.sub 或者找不到install.sh”

则要 #ls -l install.sh ,然后将 install.sh链接的真正的文件拷贝到编译环境的对应目录中config.sub跟install. sh一样的操作方法。

#cd faac-*

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#CC=/usr/local/920t_le/bin/arm_920t_le-gcc CPP=/usr/local/920t_le/bin/arm_920t_le-cpp CXX=/usr/local/920t_le/bin/arm_920t_le-g++ AR=/usr/local/920t_le/bin/arm_920t_le-ar ./configure --host=arm-920t_le-linux --prefix=/usr /local/920t_le/sysroot --enable-shared --with-mp4v2

#make

#make install

faad:

先在x86中./bootstrap

然后在arm环境中,

#cd faad-*

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#CC=/usr/local/920t_le/bin/arm_920t_le-gcc CPP=/usr/local/920t_le/bin/arm_920t_le-cpp CXX=/usr/local/920t_le/bin/arm_920t_le-g++ AR=/usr/local/920t_le/bin/arm_920t_le-ar ./configure --host=arm-920t_le-linux --prefix=/usr/local/920t_le/sysroot   --with-mpeg4ip    --enable-shared

#make

#make install

4.编译安装ffmpeg

export LDFLAGS="-L/usr/local/920t_le/lib/gcc/arm-linux/3.4.4/   -L/usr/local/920t_le/sysroot/lib/"

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

ffmepg:

#NM=/usr/local/920t_le/bin/arm_920t_le-nm LD=/usr/local/920t_le/bin/arm_920t_le-ld   CC=/usr/local/920t_le/bin/arm_920t_le-gcc CXX=/usr/local/920t_le/bin/arm_920t_le-g++   RANLIB=/usr/local/920t_le/bin/arm_920t_le-ranlib AR=/usr/local/920t_le/bin/arm_920t_le-ar   ./configure --enable-shared --enable-nonfree --enable-gpl --enable-pthreads   --enable-postproc   --enable-swscale --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libmp3lame --enable-libx264 --enable-libxvid --cross-prefix=arm_920t_le- --enable-cross-compile --cc=/usr/local/920t_le/bin/arm_920t_le-gcc --host-cc=/usr/local/920t_le/bin --host-ldflags=/usr/local/920t_le/lib/gcc/arm-linux/3.4.4/ --host-cflags=/usr/local/920t_le/lib/gcc/arm-linux/3.4.4/include --extra-ldflags=-L/usr/local/920t_le/sysroot/lib   --extra-cflags=-I/usr/local/920t_le/sysroot/include --source-path=/x86/ffmpeg/   --arch=arm-920t_le   --prefix=/usr/local/ffmepg

make的时候的错误信息:

make: *** No rule to make target `libavdevice/libavdevice.so', needed by `all'.   Stop.

解决办法是将X86中对应目录中在每个libav*中的对应文件拷贝过来即可

继续make将会出现的错误信息:

./libavformat/framehook.h:25:2: warning: #warning VHOOK is deprecated. Please help finishing libavfilter instead of wasting your time writing new filters for this crappy filter system.

/usr/local/920t_le/bin/arm_920t_le-gcc -L/usr/local/920t_le/lib/gcc/arm-linux/3.4.4/ -L/usr/local/920t_le/sysroot/lib/ -L/usr/local/920t_le/sysroot/lib -rdynamic -export-dynamic -Wl,--warn-common -Wl,--as-needed -Wl,-rpath-link,"/x86/ffmpeg"/libpostproc -Wl,-rpath-link,"/x86/ffmpeg"/libswscale -Wl,-rpath-link,"/x86/ffmpeg"/libavfilter -Wl,-rpath-link,"/x86/ffmpeg"/libavdevice -Wl,-rpath-link,"/x86/ffmpeg"/libavformat -Wl,-rpath-link,"/x86/ffmpeg"/libavcodec -Wl,-rpath-link,"/x86/ffmpeg"/libavutil -Wl,-Bsymbolic -o vhook/ppm.so -shared -Wl,-soname,$(@F) vhook/ppm.o

/bin/sh: line 1: @F: command not found

bash-2.05b# make install

make: *** No rule to make target `install-libs', needed by `install'.   Stop.

make的版本过低。要>=3.81

此时就要重新安装make-3.81的版本

在编译make-3.81之前,先要更改PATH编译。

export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/920t_le/bin"

#cd make-3.81

#./configure --prefix=/usr

然后要将PATH变量的路径修改成:export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#make

#make install

然后进入ffmpeg目录

#make distclean

重新安装上面步骤安装即可。

5.安装pkg-config-0.2.3(因为pkg-config跟make是一样的,因此做法跟make是一样的。)

#cd pkg-config-0.2.3

export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/920t_le/bin"

#./configre --prefix=/usr

然后要将PATH变量的路径修改成:export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#make

此时就会出现找不到arm环境中的线程的相关文件libpthread.a。

然后就x86中的libpthread.a拷贝都提示出错的对应目录中去,继续make

但是还会有同样的错误信息提示,最后将libpthread_nonshared.a也拷贝到libpthread.a所在的目录。继续make即可。

#make install

6.安装libupnnp-1.6.6:

#cd libupnp-1.6.6

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#CC=/usr/local/920t_le/bin/arm_920t_le-gcc CPP=/usr/local/920t_le/bin/arm_920t_le-cpp CXX=/usr/local/920t_le/bin/arm_920t_le-g++ ./configure --host=arm-920t_le-linux --prefix=/usr/local/libupnp --enable-shared

#make

#make install

7.安装libdlna-0.2.3

#cd libldna-0.2.3

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

# ./configure --cross-compile --cross-prefix=/usr/local/920t_le/bin/arm_920t_le- --enable-shared   --prefix=/usr/local/dlna --with-ffmpeg-dir=/usr/local/ffmpeg

错误信息:/usr/local/920t_le/bin/arm_920t_le-gcc -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O3 -I/usr/local/920t_le/sysroot/ffmpeg -c -o /tmp/libdlna-22550-2999-8346.o /tmp/libdlna-25070-2999-1459.c

/usr/local/920t_le/bin/arm_920t_le-gcc -L/usr/local/920t_le/lib/gcc/arm-linux/3.4.4 -L/usr/local/920t_le/sysroot/lib -L/usr/local/920t_le/sysroot/ffmpeg -o /tmp/libdlna-16273-2999-21050 /tmp/libdlna-22550-2999-8346.o -lavformat

/usr/local/920t_le/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld: cannot find -lavformat

collect2: ld returned 1 exit status

Error, can't find libavformat !

则要export LDFLAGS="-L/usr/local/920t_le/lib/gcc/arm-linux/3.4.4/ -L/usr/local/920t_le/sysroot/lib -L/usr/local/ffmpeg/lib"

export CPPFLAGS=-I/usr/local/ffmepg/include

然后继续 ./configure

如果还有问题,就#pkg-config -lavformat -libs

然后将avformat链接的库文件,添加到confugre中check_lib include/libavformat/avformat.h av_register_all -lavformat 的后面。

还要将configure中的.h文件的路径修改正确。

这样confgiure就可以通过了。

#make

在make的时候如果有这样的错误:

#############################################

#          Linking shared objects             #

#############################################

/usr/local/920t_le/bin/arm_920t_le-gcc -shared -Wl,-soname,libdlna.so. profiles.lo containers.lo image_jpeg.lo image_png.lo audio_aac.lo audio_ac3.lo audio_amr.lo audio_atrac3.lo audio_g726.lo audio_lpcm.lo audio_mp2.lo audio_mp3.lo audio_wma.lo av_mpeg1.lo av_mpeg2.lo av_mpeg4_part2.lo av_mpeg4_part10.lo av_wmv9.lo upnp_dms.lo \

           -L/usr/local/ffmepg -lavformat -lz -pthread -lm -lfaac -lfaad -lmp3lame -lx264 -lxvidcore -ldl -lavcodec -o libdlna.so.

ln -sf libdlna.so. libdlna.so.

ln: `libdlna.so.' and `libdlna.so.' are the same file

make[1]: *** [lib_shared] Error 1

make[1]: Leaving directory `/x86/libdlna-0.2.3.bak/src'

make: *** [lib] Error 2

则进入src目录。运行以下的代码:

/usr/local/920t_le/bin/arm_920t_le-gcc -shared -Wl,-soname,libdlna.so.0 profiles.lo containers.lo image_jpeg.lo image_png.lo audio_aac.lo audio_ac3.lo audio_amr.lo audio_atrac3.lo audio_g726.lo audio_lpcm.lo audio_mp2.lo audio_mp3.lo audio_wma.lo av_mpeg1.lo av_mpeg2.lo av_mpeg4_part2.lo av_mpeg4_part10.lo av_wmv9.lo upnp_dms.lo \

           -L/usr/local/ffmepg -lavformat -lz -pthread -lm -lfaac -lfaad -lmp3lame -lx264 -lxvidcore -ldl -lavcodec -o libdlna.so.0.2.3

ln -sf libdlna.so.2.3   libdlna.so.0

ln -sf libdlna.so.0   libdlna.so

/usr/bin/install -c -d /usr/local/dlna/lib

/usr/bin/install -c libdlna.so.0.2.3 /usr/local/dlna/lib

ln -sf libdlna.so.0.2.3 /usr/local/dlna/lib/libdlna.so.0

ln -sf libdlna.so.0 /usr/local/dlna/lib/libdlna.so

/usr/bin/install -c -d /usr/local/dlna/include

/usr/bin/install -c -m 644 dlna.h /usr/local/dlna/include

/usr/bin/install -c -d /usr/local/libdlna-0.2.3/lib/pkgconfig
      /usr/bin/install -c libdlna.pc /usr/local/libdlna-0.2.3/lib/pkgconfig/

这样dlna就装了好。

8.安装ushare :

export PKG_CONFIG_PATH="/ust/local/dlna/lib/pkgconfig/:/usr/local/ffmpeg/lib/pkgconfig:/usr/local/pkgconfig"

export PATH=/usr/local/920t_le/arm-linux/bin:$PATH

#cd   ushare-*

# ./configure --prefix=/usr/local/920t_le/sysroot/ushare --enable-dlna --with-libupnp-dir=/usr/local/libupnp/   --with-libdlna-dir=/usr/local/dlna --cross-prefix=/usr/local/920t_le/bin/arm_920t_le- --cross-compile

错误信息:

/usr/local/920t_le/bin/arm_920t_le-gcc -I.. -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -O3 -DHAVE_LOCALE_H -DHAVE_SETLOCALE -DHAVE_IFADDRS_H -DHAVE_LANGINFO_H -DHAVE_LANGINFO_CODESET -DHAVE_ICONV -I/usr/local/920t_le/sysroot/libupnp/ -c -o /tmp/ushare-24638-2796-17001.o /tmp/ushare-12524-2796-696.c

/usr/local/920t_le/bin/arm_920t_le-gcc -L/usr/local/920t_le/lib/gcc/arm-linux/3.4.4 -L/usr/local/920t_le/sysroot/lib -L/usr/local/920t_le/sysroot/libupnp/ -o /tmp/ushare-10712-2796-25654 /tmp/ushare-24638-2796-17001.o -lixml

/usr/local/920t_le/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld: cannot find -lixml

collect2: ld returned 1 exit status

Error, can't find libixml !

将/usr/local/libupnp/lib 中所有的文件拷贝到/usr/local/920t_le/arm-linux/lib 中即可。

然后继续configure,将会遇到如下错误:

gcc -I.. -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -O3 -DHAVE_LOCALE_H -DHAVE_SETLOCALE -DHAVE_IFADDRS_H -DHAVE_LANGINFO_H -DHAVE_LANGINFO_CODESET -DHAVE_ICONV -I/usr/local/920t_le/libupnp/ -pthread -I/usr/local/920t_le/libupnp/include/upnp -I/usr/local/920t_le/dlna/ -c -o /tmp/ushare-28560-20314-19126.o /tmp/ushare-3547-20314-9692.c

gcc -L/usr/local/920t_le/libupnp/ -L/usr/local/920t_le/dlna/ -o /tmp/ushare-22-20314-6190 /tmp/ushare-28560-20314-19126.o -lixml -lthreadutil -lpthread -lupnp -L/usr/local/920t_le/libupnp/lib -ldlna

/usr/local/920t_le/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld: warning: libdl.so.2, needed by /usr/local/920t_le/bin/../arm-linux/lib/libavformat.so.52, not found (try using -rpath or -rpath-link)

/usr/local/920t_le/bin/../arm-linux/lib/libavcodec.so.52: undefined reference to `dlclose@GLIBC_2.0'

/usr/local/920t_le/bin/../arm-linux/lib/libavformat.so.52: undefined reference to `dlerror@GLIBC_2.0'

/usr/local/920t_le/bin/../arm-linux/lib/libavformat.so.52: undefined reference to `dlopen@GLIBC_2.1'

/usr/local/920t_le/bin/../arm-linux/lib/libavformat.so.52: undefined reference to `dlsym@GLIBC_2.0'

collect2: ld returned 1 exit status

Error, can't find libdlna (install it or use --disable-dlna) !

解决办法就是将libdl.so.2的文件可以没有在/usr/local/920t_le/arm-linux/lib 目录中。将其拷贝进来就可以。

export PKG_CONFIG_PATH中如果包含了libdlna的时候,但是configure的 时候还是显示Error, libdlna < 0.2.1 !就有可能是libdlna.pc文件 中的Verison:一栏没有标上版本号。要改成Verison: 0.2.3

这样configure就可以通过了

#make

#make install

这样ushare的交叉编译就完成了。

(kivi0806@126)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www1.rosoo.net/a/201201/15576.html]
本文出处:blog.163.com/kivi0806@126 作者:kivi0806@126 原文
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
相关文章
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容