您的位置:首页 > 其它

madplay 的移植

2016-05-03 18:36 429 查看
madplay的移植需要以下的几个包:

(1)madplay-0.15.2b.tar.gz,

(2)libmad-0.15.1b.tar.gz,

(3)libid3tag-0.15.1b.tar.gz ,

(4) zlib-1.1.4.tar.gz。

其中前面三个包可以在http://sourceforge.net/project/showfiles.php?group_id=12349下载,后一个包可以在http://www.gzip.org/zlib/zlib-1.1.4.tar.gz中找到。

编译时,打开配置Kernel的选项,在

—Device drivers

–<*>Sound card support—->

–<*>Advanced Linux Sound Architecture—>

中选择OSS Mixer API及OSS PCM (digital audio) API,如下图



在/opt目录下建立了madplayer目录,mkdir /opt/madplayer .然后把上面的四个gz都放到这个目录下,解压所有源码包,同时mkdir /opt/madplayer/_install 建立了一个名为“_install ”的安装目录,存储编译过后的安装库和头文件。如下图:



编译是有顺序的,首先编译zlib-1.1.4(libid3tag需要用到它)

[root@localhost madplayer]# cd zlib-1.1.4/
[root@localhost madplayer]# ./configure --prefix=/opt/madplayer/_install
[root@localhost madplayer]# vim Makefile
修改Makefile文件如下:
15行:CC=arm-linux-gcc
31行:AR=arm-linux-ar rcs
32行:RANLIB=arm-linux-ranlib
[root@localhost zlib-1.1.4]# make distclean
[root@localhost zlib-1.1.4]# make
[root@localhost zlib-1.1.4]# make install


编译完成以后在上面prefix指定的目录下的lib目录下可以找到libz.a这个库

编译libid3tag

[root@localhost madplayer]# cd libid3tag-0.15.1b/
[root@localhost madplayer]# ./configure CC=arm-linux-gcc --prefix=/opt/madplayer/_install --host=arm-linux --disable-shared CPPFLAGS=-I/opt/madplayer/_install/include LDFLAGS=-L/opt/madplayer/_install/lib
[root@localhost madplayer]# make
[root@localhost madplayer]# make install


编译libmad

[root@localhost madplayer]# cd libmad-0.15.1b/
[root@localhost madplayer]# ./configure CC=arm-linux-gcc --prefix=/opt/madplayer/_install --host=arm-linux --disable-shared CPPFLAGS=-I/opt/madplayer/_install/include LDFLAGS=-L/opt/madplayer/_install/lib
[root@localhost madplayer]# make
[root@localhost madplayer]# make install


这里make的时候可能会报错cc1: error: unrecognized command line option “-fforce-mem”如下图:



解决办法是:修改Makefile文件:

[root@localhost libmad-0.15.1b]# vim Makefile
找到"-fforce-mem"它并删除,修改后如下图
[root@localhost madplayer]# make
[root@localhost madplayer]# make install
这些就搞定了。




编译madplay

[root@localhost madplayer]# cd madplay-0.15.2b/
[root@localhost madplayer]# ./configure CC=arm-linux-gcc --prefix=/opt/madplayer/_install --host=arm-linux --disable-shared --enable-static CPPFLAGS=-I/opt/madplayer/_install/include LDFLAGS=-L/opt/madplayer/_install/lib
[root@localhost madplayer]# make


经过以上步骤生成了madplay可执行文件,把madplay可执行文件下载到板子上测试。

执行:madplay /opt/music/TheShow.mp3 成功!!!!!!!!结果如下:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  移植