补充一下关于 pkg-config 在交叉编译中的使用

本文介绍了如何在交叉编译环境中使用pkg-config,强调了不能直接通过--host参数控制包路径,而是需要设置PKG_CONFIG_LIBDIR环境变量。在交叉编译时,必须确保PKG_CONFIG_PATH和PKG_CONFIG_LIBDIR只包含目标机器的.pc文件。pkgconfig官方提议未来可能通过添加--host选项来智能选择适用的.pc文件,目前需关注此功能的实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

这是pkgconfig 官方, 给出的使用pkg-config 配置交叉编译环境的方法.

http://pkgconfig.freedesktop.org/wiki/CrossCompileProposal

 

1.

现阶段还不能直接通过 --host 参数控制交叉编译过程中链接的package路径.

只能通过$PKG_CONFIG_PATH  或 $PKG_CONFIG_LIBDIR.

 

1.1

Note that when specifying PKG_CONFIG_LIBDIR, pkg-config will completely ignore the content in PKG_CONFIG_PATH, even if the documentation states different things.

我的做法是在交叉编译的时候使用

export PKG_CONFIG_LIBDIR=/nfsroot/arm-xscale-linux-gnu/steven_root/pkgconfig

 

1.2.

In a cross compile situation, some .pc files on the system will be for the build machine and some will be for the target machine. In order to

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值