使用自动工具检查预编译头?
如何检查 autoconf 是否支持 gcc 预编译头?有没有像AC_CHECK_GCH这样的宏?我正在从事的项目有很多模板和包含,我尝试用最常用的包含编写一个 .h 并手动编译它。将其与其他自动工具集成可能会很好。
How can I check if gcc precompiled headers are supported with autoconf? Is there a macro like AC_CHECK_GCH? The project I'm working on has a lot of templates and includes, I have tried writing a .h with the most commonly used includes and compiling it manually. It could be nice to integrate it with the rest of autotools.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前尚不清楚您希望实现什么目标。您是否希望在 tarball 中分发预编译标头?这样做几乎完全没有用。 (实际上我认为这完全没用,但我说“几乎”是因为我可能会遗漏一些东西。)
目标机器(正在构建项目的机器)上的系统标头几乎肯定与开发机器上的系统标头不同。如果它们相同,则无需使用 autoconf。
如果你的包的用户碰巧正在使用 gcc 并且想要使用预编译头,那么他们会将 .gch 文件放在适当的位置,gcc 将使用它们。您无需在包中执行任何操作。
It's not clear what you are hoping to accomplish. Are you hoping to distribute a precompiled header in your tarball? doing so would be almost completely useless. (I actually think it would be completely useless, but I say "almost" because I might be missing something.)
The system headers on the target box (the machine on which your project is being built) are almost certainly different than the ones on your development box. If they are the same, then there's no need to be using autoconf.
If the user of your package happens to be using gcc and wants to use precompiled headers, then they will put the .gch files in the appropriate location and gcc will use them. You don't need to do anything in your package.