What mean file with extension “h.in”?

狂风中的少年 提交于 2019-11-28 20:56:23

问题


I am studying the C language, and I saw a new extension that I had not seen before.

What do files with the extension like library.h.in mean?

Is it as the simple header with extension ".h"? What's the difference?


回答1:


These files are usually the input for autoconf which will generate final .h files.

Here's an example from PCRE:

#define PCRE_MAJOR          @PCRE_MAJOR@
#define PCRE_MINOR          @PCRE_MINOR@
#define PCRE_PRERELEASE     @PCRE_PRERELEASE@
#define PCRE_DATE           @PCRE_DATE@

Autoconf will replace all variables (@…@) with the respective values and the result will be a .h file.




回答2:


Typically, a .h.in file is a header template that is filled in to become the actual header by a configure script based on the outcome of several tests for features present on the target platform.




回答3:


Files ending with .in are typically template files used by a program called configure that generates a new file without the extension after substituting for variable expansions. I.e., if you're looking at a source tree that has files called, e.g. Makefile.in in the tree, then ./configure will generate a usable Makefile that can be used to "make" from source.



来源:https://stackoverflow.com/questions/14248848/what-mean-file-with-extension-h-in

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!