I would like to suggest to split config.h.in in two files.
The first file is used by autotools as template for the macros emitted at configure time, that can be something like that:
and then there is another file, that we may call common.h for example, which includes the generated config.h file and it does all operations moved outside like doing #include, #ifdef and so on. This is a fix that I made when adding support for CMake in my package for CYGWIN, because the common file would be the same for both autotools and CMake. I could write my config.h.cmake by keeping the same content of current config.h.in, but splitting the template allows to have less duplicated code, which would simplify the maintenance if CMake support will be added in the future.
While I've had a few requests to support cmake, and there is another issue and a PR for this, I do not want to make any changes towards this at this time.
I would like to suggest to split
config.h.in
in two files. The first file is used by autotools as template for the macros emitted at configure time, that can be something like that:and then there is another file, that we may call
common.h
for example, which includes the generatedconfig.h
file and it does all operations moved outside like doing#include
,#ifdef
and so on. This is a fix that I made when adding support for CMake in my package for CYGWIN, because the common file would be the same for both autotools and CMake. I could write myconfig.h.cmake
by keeping the same content of currentconfig.h.in
, but splitting the template allows to have less duplicated code, which would simplify the maintenance if CMake support will be added in the future.What do you think?