分类: LINUX
2010-03-22 08:23:00
madplay移植记录:
一、PC版的madplay
PC版的编译基本同mini2440手册上的一致。
二、版的madplay
1、编译zlib-1.2.3
解压zlib-1.2.3.tar.gz到/opt/FriendlyARM/mini2440/madplay/src-/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/--ar rc"}
b、把RANLIB=${RANLIB-"ranlib"}改为
RANLIB=${RANLIB-"/usr/local/arm/3.4.1/bin/--ranlib"}
c、把cc=${CC-gcc}改为
cc=${CC-/usr/local/arm/3.4.1/bin/-linux-gcc}
其中/usr/local/arm/3.4.1/bin为-linux-gcc编译器的安装路径。保存退出。
执行如下命令:
sudo ./configure --prefix=/opt/FriendlyARM/mini2440/madplay/target-
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-/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- --disabl
e-shared CPPFLAGS=-I/opt/FriendlyARM/mini2440/madplay/target-arm/include LDFLAGS=-L/opt/FriendlyARM/mini2440/madplay/target-/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-/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- --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-/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-/lib
sudo make
sudo make install
5、编译成功后相关文件
编译成功后生成的可执行文件madplay在/opt/FriendlyARM/mini2440/madplay/target-/bin目录下
为了和开发板上自带的madplay区别,将madplay重命名为mymadplay
通过命令sudo mv madplay mymadplay实现
编译成功后生成的madplay的库文件在/opt/FriendlyARM/mini2440/madplay/target-/lib目录下
6、移植
将可执行文件放到开发板的/usr/bin目录下
将madplay的库文件放到开发板的/usr/lib目录下
实现方法:u盘,nfs,ftp等
7、
开发板根目录下有MP3文件:shanghaitan.mp3
直接命令:mymadplay shanghaitan.MP3
开发板播放此音乐。