日期:2014-05-16  浏览次数:20697 次

linux-2.6.32在mini2440开发板上移植(20)之音频解码器madplay移植

音频解码器madplay移植

编者:从这一小节开始,友善官方带的手册就没有介绍了,根据一些参考书籍进行移植。这里移植的是音频解码器madplay.

需要的源码包:(我已经上传到我的资源里面了,可以直接下载

libid3tag-0.15.1b.tar.gz

libmad-0.15.1b.tar.gz

madplay-0.15.2b.tar.gz

zlib-1.2.3.tar.bz2

1、建立madplay源代码目录madplay-source以存放madplay源码

创建源码目录

#mkdir /usr/local/madplay-source

2、然后将上面要求的四个文件拷贝到此文件夹下,然后解压到此文件夹下

tar -zxvf  libid3tag-0.15.1b.tar.gz

tar -zxvf  libmad-0.15.1b.tar.gz

tar -zxvf   madplay-0.15.2b.tar.gz

tar -jxvf    zlib-1.2.3.tar.bz2

3、编译zlib库,为libid3tag提供函数支持

1)  #cd /usr/local/madplay-source/zlib-1.2.3

      #./configure -shared --prefix=/usr/local/mymadplay/zlib-1.2.3

2) 修改Makefile

修改Makefile第19行:

CC=arm-linux-gcc

修改Makefile第28行:

LDSHARED=arm-linux-gcc -shared -W1,-soname,libz.so.1

修改Makefile第29行:

CPP=arm-linux-gcc -E

修改Makefile第36行:

AR=arm-linux-ar rc

修改Makefile第37行:

RANLIB=arm-linux-ranlib

3)编译并安装zlib库

#make

#make install

4、编译libid3tag库

1)  #cd /usr/local/madplay-source/libid3tag

      #./configure -shared --prefix=/usr/local/madplay-source/libid3tag CC=arm-linux-gcc --host arm-linux CPPFLAGS=-I/usr/local/mymadplay/zlib-1.2.3/include/ LDFLAGS=

       -L/usr/local/mymadplay/zlib-1.2.3/lib/

    #make

    #make install

5、编译音频解码库libmad

1)  #cd /usr/local/madplay-source/libmad

      #./configure -shared --prefix=/usr/local/madplay-source/libmad  CC=arm-linux-gcc --host arm-linux CPPFLAGS=-I/usr/local/mymadplay/libid3tag/include/ LDFLAGS=

    &