准备包 madplay-0.15.2b.tar.gz,libmad-0.15.1b.tar.gz,
libid3tag-0.15.1b.tar.gz 和 zlib-1.1.4.tar.gz
编译zlib-1.1.4
首先配置configure 文件
./configure --prefix=/usr/local/mipsel/madplay
修改Makefile.
CC=mipsel-linux-gcc
AR=mipsel-linux-ar rc
RANLIB=mipsel-linux-ranlib
make
make install
///////////////////////////////////////////////////////////////////////////////
编译libid3tag
./configure CC=mipsel-linux-gcc --host=mipsel-linux --prefix=/usr/local/mipsel/madplay --disable-shared CPPFLAGS=-I/usr/local/mipsel/madplay/include LDFLAGS=-L/usr/local/mipsel/madplay/lib
make
make install
////////////////////////////////////////////////////////////////////////////////
编译libmad
./configure CC=mipsel-linux-gcc --host=mipsel-linux --prefix=/usr/local/mipsel/madplay --disable-shared CPPFLAGS=-I/usr/local/mipsel/madplay/include LDFLAGS=-L/usr/local/mipsel/madplay/lib
make
make install
////////////////////////////////////////////////////////////////////////////////
编译madplay
./configure CC=mipsel-linux-gcc --host=mipsel-linux --prefix=/usr/local/mipsel/madplay --disable-shared --enable-static --disable-nls CPPFLAGS=-I/usr/local/mipsel/madplay/include LDFLAGS=-L/usr/local/mipsel/madplay/lib
make
拷贝make的最后一个连接的命令,在最后加上-static,然后运行,得到静态连接的程序,这样就不需要拷贝相应的库了,对于刚开始调试比较方便,等一切都可以Run了后,再使用动态库方式来执行
mipsel-linux-gcc -Wall -O2 -fomit-frame-pointer -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/usr/local/mipsel/madplay/lib /usr/local/mipsel/madplay/lib/libmad.a /usr/local/mipsel/madplay/lib/libid3tag.a -lz -lm -static
__________________________________________________________________________________
在madplay下建立一mp3目录,用于存放编译madplay生成的lib和*.h
编译zlib-1.1.4
首先配置configure 文件
./configure --prefix=/opt/project/uto/madplay/mp3
修改Makefile.
CC=mipsel-linux-gcc
AR=mipsel-linux-ar rc
RANLIB=mipsel-linux-ranlib
make
make install
///////////////////////////////////////////////////////////////////////////////
编译libid3tag
./configure CC=mipsel-linux-gcc --host=mipsel-linux --prefix=/opt/project/uto/madplay/mp3 --disable-shared CPPFLAGS=-I/opt/project/uto/madplay/mp3/include LDFLAGS=-L/opt/project/uto/madplay/mp3/lib
make
make install
////////////////////////////////////////////////////////////////////////////////
编译libmad
./configure CC=mipsel-linux-gcc --host=mipsel-linux --prefix=/opt/project/uto/madplay/mp3 --disable-shared CPPFLAGS=-I/opt/project/uto/madplay/mp3/include LDFLAGS=-L/opt/project/uto/madplay/mp3/lib
make
make install
////////////////////////////////////////////////////////////////////////////////
编译madplay
./configure CC=mipsel-linux-gcc --host=mipsel-linux --prefix=/opt/project/uto/madplay/mp3 --disable-shared --enable-static --disable-nls CPPFLAGS=-I/opt/project/uto/madplay/mp3/include LDFLAGS=-L/opt/project/uto/madplay/mp3/lib
mipsel-linux-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/opt/project/uto/madplay/mp3/lib /opt/project/uto/madplay/mp3/lib/libmad.a /opt/project/uto/madplay/mp3/lib/libid3tag.a -lz -lm -static
阅读(782) | 评论(0) | 转发(0) |