移植madplayer:
1.资源准备
(1)下载madplayer
http://madplay.sourcearchive.com/
wget http://madplay.sourcearchive.com/downloads/0.15.2b/madplay_0.15.2b.orig.tar.gz
(2)下载zlib
http://www.zlib.net/
(3)下载Libid3tag
http://cblfs.cross-lfs.org/index.php/Libid3tag
(4)下载libmad
http://www.linuxfromscratch.org/blfs/view/6.3/multimedia/libmad.html
2.配置编译
公共库目录设为:/home/linux/workdir/mdplay/_install
(1)zlib
#cd zlib-1.2.8
#./configure --prefix=/home/linux/workdir/mdplay/_install
#vim Makfile
CC=arm-none-linux-gnueabi-gcc
AR=/usr/local/toolchain/toolchain-4.6.4/bin/arm-none-linux-gnueabi-ar
RANLIB=/usr/local/toolchain/toolchain-4.6.4/bin/arm-none-linux-gnueabi-ranlib
LDSHARED=arm-none-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
#make
# make install
(2)Libid3tag
#cd libid3tag-0.15.1b
./configure --prefix=/home/linux/workdir/mdplay/_install --host=arm-linux CC=arm-none-linux-gnueabi-gcc --disable-debugging --disable-shared CPPFLAGS=-I/home/linux/workdir/mdplay/_install/include LDFLAGS=-L/home/linux/workdir/mdplay/_install/lib
#make
#make install
(3)libmad
#cd libmad-0.15.1b
./configure --prefix=/home/linux/workdir/mdplay/_install --host=arm-linux CC=arm-none-linux-gnueabi-gcc --disable-debugging --disable-shared CPPFLAGS=-I/home/linux/workdir/mdplay/_install/include LDFLAGS=-L/home/linux/workdir/mdplay/_install/lib
#vim Makefile
将第129行中的 -fforce-mem 删除,重新make && make install 即可
#make && make install
(4)madplayer
#cd madplay-0.15.2b
./configure --prefix=/${PWD}/_install --host=arm-linux CC=arm-none-linux-gnueabi-gcc --enable-static CPPFLAGS=-I/home/linux/workdir/mdplay/_install/include LDFLAGS=-L/home/linux/workdir/mdplay/_install/lib
#make
#rm madplay
拷贝make的最后一个连接的命令,在最后加上-static 和 -lz,然后运行,得到静态连接的程序
arm-none-linux-gnueabi-gcc -Wall -g -O2 -o madplay madplay.o getopt.o getopt1.o version.o resample.o filter.o tag.o crc.o rgain.o player.o audio.o audio_aiff.o audio_cdda.o audio_hex.o audio_null.o audio_raw.o audio_snd.o audio_wave.o audio_oss.o -L/home/linux/workdir/mdplay/_install/lib /home/linux/workdir/mdplay/_install/lib/libmad.a /home/linux/workdir/mdplay/_install/lib/libid3tag.a -lz -lm -static
#make install
fs4412开发板学习笔记(十二)
最新推荐文章于 2023-09-20 10:30:35 发布