逛街回来后,马上在Ubuntu 11.10 下进行madplay 对mini2440的移植,由于有了早上移植madplay的经验之后,晚上的移植工作做得还是比较顺手。
1、解压源代码包
# cd tarball
# for f in $(ls *.tar.gz); do tar -zxvf $f –C ../src-arm; done
2、编译madplay及其所依赖的库文件
(1)设定编译器环境变量
在ubuntu命令行下输入
# export CC=arm-linux-gcc
(2)编译zlib,因为libid3tag依赖于这个库文件
# cd ../src-arm/zlib-1.2.3
#./configure --prefix=/opt/FriendlyARM/mini2440/madplay/target-arm
# make
# make install
编译好之后target-arm的lib目录下libz.a库。
(3)编译libid3tag
# cd ../libid3tag-0.15.1b
# ./configure --host=arm-linux --prefix=/opt/FriendlyARM/mini2440/madplay/target-arm --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/opt/FriendlyARM/mini2440/madplay/target-arm/include LDFLAGS=-L/opt/FriendlyARM/mini2440/madplay/target-arm/lib
# make
# make install
(4)编译libmad
# cd ../libmad-0.15.1b
# ./configure --host=arm-linux --prefix=/opt/FriendlyARM/mini2440/madplay/target-arm --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/opt/FriendlyARM/mini2440/madplay/target-arm/include LDFLAGS=-L/opt/FriendlyARM/mini2440/madplay/target-arm/lib
# make
# make install
(5)编译madplay
# cd ../madplay-0.15.2b
#./configure --host=arm-linux --prefix=/opt/FriendlyARM/mini2440/madplay/target-arm --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/opt/FriendlyARM/mini2440/madplay/target-arm/include LDFLAGS=-L/opt/FriendlyARM/mini2440/madplay/target-arm/lib
# make
# make install
以上都安装成功之后,就得到了
# ls target-arm/bin
abxtest madplay
其中abxtest是附加生成的测试程序,不必理会。
3、下载madplay到开发板运行测试
MP3放进去测试 这时候你就可以听到优美的声音了。
更多Ubuntu相关信息见Ubuntu 专题页面 ?tid=2