可移植地在autoconf/automake中包含GLib头文件 [英] Portably include GLib headers in autoconf/automake

查看:110
本文介绍了可移植地在autoconf/automake中包含GLib头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于使用autoconf-构建的项目,我需要包含 GLib 标头.基于便携式的系统.

I need to include the GLib headers for a project that is built with an autoconf-based system for portability.

如何安全地以可移植方式导入GLib标头?我知道 pkg-config ,但这并不是完全可移植的(因为某些系统没有没有,我宁愿仅依靠autoconf进行配置.

How can I safely import the GLib headers in a portable manner? I know about pkg-config, but that is not entirely portable (since some systems don't have it and I would prefer to only rely on autoconf for configuration).

推荐答案

GLib 2.22 INSTALL文件指出,pkg-config是安装此库的必要条件.我不是GLib(双关语!);该要求的声明是INSTALL文件顶部的第一件事.

The GLib 2.22 INSTALL file states that pkg-config is a requirement for installing this library. I am not being GLib (pun intended!); statement of this requirement is one of the first things on the top of the INSTALL file.

从周围的文字来看,尚不清楚是否需要pkg-config来编译GLib本身,但是很明显GLib 2.22的作者并不打算让任何用户在没有pkg-config的情况下针对GLib进行编译.尤其是GLib的make install将正确安装.pc文件.

From the text surrounding it is unclear whether pkg-config is needed to compile GLib itself, however it is clear that GLib 2.22 authors do not intend for any users to compile against GLib without having pkg-config. In particular, GLib's make install will install .pc files appropriately.

为实现平台可移植性,请指示用户适当设置$PKG_CONFIG_PATH.

For platform portability, instruct the user to set $PKG_CONFIG_PATH appropriately.

这篇关于可移植地在autoconf/automake中包含GLib头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆