移植glib到arm

本文介绍如何解决跨编译glib过程中遇到的问题,包括配置与安装zlib及libffi等依赖库的方法。


1、配置

./configure --prefix=/home/firephoenix/work/gstreamer/glib-2.26.1/release \
            --enable-shared \
            --host=arm-linux-gnueabi

结果提示:

checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inflate in -lz... no
configure: error: *** Working zlib library and headers not found ***

安装完zlib后再次配置又提示

checking if malloc() and friends prototypes are gmem.h compatible... no
checking for growing stack pointer... configure: error: in `/home/firephoenix/work/gstreamer/glib-2.26.1':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

添加arm-linux.cache文件并在文件中添加以下内容:

glib_cv_stack_grows=no

glib_cv_uscore=no

ac_cv_func_posix_getpwuid_r=yes

ac_cv_func_posix_getgrgid_r=yes

glib_cv_have_qsort_r=no

并修改

./configure --prefix=/home/firephoenix/work/gstreamer/glib-2.26.1/release \
            --enable-shared \
            --host=arm-linux-gnueabi \
        --cache-file=arm-linux.cache

二、 安装zlib库

版本: zlib-1.2.5.tar.bz2

tar  xzvf  zlib-1.2.5.tar.bz2

cd  zlib-1.2.5

mkdir  release

export  CC=arm-linux-gnueabi-gcc   //它的configure不支持CC变量来指定交叉工具链

./configure --prefix=/home/firephoenix/work/gstreamer/zlib-1.2.5/release

make & make install

[firephoenix@lib]$ cp *so* /opt/cross-tools/lichee-toolchain/arm-linux-gnueabi/libc/lib -d
[firephoenix@lib]$ cp libz.a /opt/cross-tools/lichee-toolchain/arm-linux-gnueabi/libc/lib
[firephoenix@include]$ cp * /opt/cross-tools/lichee-toolchain/arm-linux-gnueabi/libc/usr/include

三、 安装libffi

版本: libffi-3.2.1.tar.gz

配置:

./configure --prefix=/home/firephoenix/work/gstreamer/libffi-3.2.1/release \
            --host=arm-linux-gnueabi
make & make intall

[firephoenix@include]$ cp * /opt/cross-tools/lichee-toolchain/arm-linux-gnueabi/libc/usr/include

[firephoenix@lib]$ cp *so* /opt/cross-tools/lichee-toolchain/arm-linux-gnueabi/libc/lib -d
[firephoenix@lib]$ cp libffi.a /opt/cross-tools/lichee-toolchain/arm-linux-gnueabi/libc/lib
[firephoenix@lib]$ cp libffi.la /opt/cross-tools/lichee-toolchain/arm-linux-gnueabi/libc/lib





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值