简体   繁体   English

使用自动工具检查预编译的头文件吗?

[英]Check for precompiled headers with autotools?

How can I check if gcc precompiled headers are supported with autoconf? 如何检查autoconf是否支持gcc预编译头? Is there a macro like AC_CHECK_GCH? 是否有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. 我正在处理的项目有很多模板和包含项,我尝试用最常用的包含项编写.h并手动进行编译。 It could be nice to integrate it with the rest of autotools. 最好将它与其他自动工具集成在一起。

It's not clear what you are hoping to accomplish. 目前尚不清楚您希望完成什么。 Are you hoping to distribute a precompiled header in your tarball? 您是否希望在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. 如果它们相同,则无需使用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. 如果您的软件包用户恰好正在使用gcc并希望使用预编译的标头,则他们会将.gch文件放在适当的位置,而gcc将使用它们。 You don't need to do anything in your package. 您无需在包装中做任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM