现在的位置: 首页 > 综合 > 正文

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

2013年10月13日 ⁄ 综合 ⁄ 共 965字 ⁄ 字号 评论关闭

 

这是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 make sure that the build machine's .pc files are not found, both the $PKG_CONFIG_PATH and $PKG_CONFIG_PATH environment variables must be set to directories containing only target machine `.pc files.

 

2.

pkgconfig 官方给出将来可能采用的一种方法就是通过auto-config  的参数 --host 来自动判断用户交叉编译环境. 

In order for pkg-config to be smart about picking what .pc files to use, it needs to know the what it is targetting. The proposed solution to this is to add a --host option to the program

关注pkgconfig 此功能的实现.

 

That's all!

Steven.

抱歉!评论已关闭.