22

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?

  • 2
    Extensions are meaningless to the C language – K-ballo Jan 10 '13 at 0:24
  • Hmm weird this link says they might be spyware? – Mike Christensen Jan 10 '13 at 0:26
  • 3
    @MikeChristensen I'm more suspicious of that page than of a normal Makefile.in or config.h.in. – Daniel Fischer Jan 10 '13 at 0:28
  • @DanielFischer - Yea, they might just be trying to sell you virus scanners.. – Mike Christensen Jan 10 '13 at 0:30
24

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.

14

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
    This file extension is also popular among other build tools, e.g.cmake – szx Jan 10 '13 at 0:35
2

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.

protected by Machavity Dec 25 '17 at 2:42

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.