What mean file with extension "h.in"?

Anderson Carniel picture Anderson Carniel · Jan 10, 2013 · Viewed 24.2k times · Source

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?

Answer

Vladimir Kolesnikov picture Vladimir Kolesnikov · Jan 10, 2013

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.