在Ubuntu 8.10 下移植 madplay 到 mini2440过程中同样参考了网上的一篇帖子,由于当时未想到要把过程放到这就没有记录那篇帖子的网址,在此表示感谢!
madplay移植记录:
一、PC版的madplay
PC版的编译基本同mini2440手册上的一致。
二、ARM版的madplay
1、编译zlib-1.2.3
解压zlib-1.2.3.tar.gz到/opt/FriendlyARM/mini2440/madplay/src-arm/zlib-1.2.3
进入zlib-1.2.3目录
配置configure:
sudo gedit configure
a、把AR=${AR-“ar rc”}改为:
AR=${AR-“/usr/local/arm/3.4.1/bin/arm-linux-ar rc”}
b、把RANLIB=${RANLIB-“ranlib”}改为
RANLIB=${RANLIB-“/usr/local/arm/3.4.1/bin/arm-linux-ranlib”}
c、把cc=${CC-gcc}改为
cc=${CC-/usr/local/arm/3.4.1/bin/arm-linux-gcc}
其中/usr/local/arm/3.4.1/bin为arm-linux-gcc编译器的安装路径。保存退出。
执行如下命令:
sudo ./configure –prefix=/opt/FriendlyARM/mini2440/madplay/target-arm
sudo make
sudo make install
zlib-1.2.3安装结束。
2、编译libid3tag-0.15.1b
解压zlib-1.2.3.tar.gz到/opt/FriendlyARM/mini2440/madplay/src-arm/libid3tag-0.15.1b
进入libid3tag-0.15.1b目录
执行如下命令:
sudo ./configure CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc –host=arm-linux –prefix=/opt/FriendlyARM/mini2440/madplay/target-arm –disabl
e-shared CPPFLAGS=-I/opt/FriendlyARM/mini2440/madplay/target-arm/include LDFLAGS=-L/opt/FriendlyARM/mini2440/madplay/target-arm/lib
sudo make
sudo make install
libid3tag-0.15.1b安装结束
3、编译libmad-0.15.1b
解压zlib-1.2.3.tar.gz到/opt/FriendlyARM/mini2440/madplay/src-arm/libmad-0.15.1b
进入libmad-0.15.1b目录
执行如下命令:
sudo ./configure CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc –host=arm-linux –prefix=/opt/FriendlyARM/mini2440/madplay/target-arm –disable-shared
sudo make
sudo make install
libmad-0.15.1b安装结束
4、编译madplay-0.15.2b
解压madplay-0.15.2b.tar.gz到/opt/FriendlyARM/mini2440/madplay/src-arm/madplay-0.15.2b
进入madplay-0.15.2b目录
执行如下命令:
sudo ./configure CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc –host=arm-linux –prefix=/opt/FriendlyARM/mini2440/madplay/target-arm –enable-static –disable-shared CPPFLAGS=-I/opt/FriendlyARM/mini2440/madplay/target-arm/include LDFLAGS=-L/opt/FriendlyARM/mini2440/madplay/target-arm/lib
sudo make
sudo make install
5、编译成功后相关文件
编译成功后生成的可执行文件madplay在/opt/FriendlyARM/mini2440/madplay/target-arm/bin目录下
为了和开发板上自带的madplay区别,将madplay重命名为mymadplay
通过命令sudo mv madplay mymadplay实现
编译成功后生成的madplay的库文件在/opt/FriendlyARM/mini2440/madplay/target-arm/lib目录下
6、移植
将可执行文件放到开发板的/usr/bin目录下
将madplay的库文件放到开发板的/usr/lib目录下
实现方法:u盘,nfs,ftp等
7、测试
开发板根目录下有mp3文件:shanghaitan.mp3
直接命令:mymadplay shanghaitan.mp3
开发板播放此音乐。