madplay移植

http://hi.baidu.com/firefly007/blog/item/c57bf65719eb48d5b645ae36.html

1、解压源代码包
# cd madplay
# for f in $(ls *.tar.gz); do tar -zxvf $f ; done

2、编译madplay及其所依赖的库文件

(1)设定编译器环境变量
# export CC=arm-linux-gcc

(2)编译zlib,因为libid3tag依赖于这个库文件
# cd  zlib-1.2.3
# ./configure --prefix=/opt/madplay/madplay
# make
# make install
或者:
打开/opt/madplay/zlib-1.2.3
目录下的Makefile文件,按以下内容修改并保存:
CC=arm-linux-gcc
AR=arm-linux-ar rcs
RANLIB=arm-linux-ranlib
prefix=/opt/madplay/target-arm

然后make,make install,编译好之后就可以在上面prefix指定目录下的lib目录下找到libz.a这个库。

(3)编译libid3tag
# cd ../libid3tag-0.15.1b
# ./configure --host=arm-linux --prefix=/opt/madplay/mad --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/opt/madplay/mad/include LDFLAGS=-L/opt/madplay/mad/lib 
 --host=arm-linux 
# make
# make install

(4)编译libmad
# cd ../libmad-0.15.1b
# ./configure --host=arm-linux --prefix=/opt/madplay/mad --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/opt/madplay/mad/include LDFLAGS=-L/opt/madplay/mad/lib 
 --host=arm-linux 
# make
# make install

(5)编译madplay
# cd ../madplay-0.15.2b
# ./configure --host=arm-linux --prefix=/opt/madplay/mad --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/opt/madplay/mad/include LDFLAGS=-L/opt/madplay/mad/lib --host=arm-linux
# make
# make install

但是,这样得到的是动态链接。其中abxtest是附加生成的测试程序,不必理会。

使用file命令检查一下:
# file /opt/madplay/target-arm/bin/madplay
madplay: ELF 32-bit LSB executable, ARM, version 1, for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not stripped

arm-linux-readelf -d madplay
可以知道需要的动态库
Dynamic section at offset 0x3900c contains 25 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值