Keeping pg_config.h.win32 up to date with pg_config.h.in is a gratuitous
annoyance. This setup dates back to the minimal client-only Windows
builds using win32.mak files, which has been removed in PG10. The MSVC
build system has the power of Perl available, so we can do better.
My proposal is that we essentially emulate what config.status does in
Perl code. config.status gets a list of defines discovered by configure
and processes pg_config.h.in to pg_config.h by substituting the defines.
The MSVC build system basically has those defines hardcoded, but the
processing we can do in just the same way. It already had code to do a
bit of that anyway, so it's really not a big leap. See attached
patches. (I put the remove of pg_config.h.win32 into a separate patch
so that reviewers can just apply the first patch and then diff the
produced pg_config.h with the existing pg_config.h.win32.)
The only thing that's not quite explainable is that the existing code
wrapped some parts of the pg_config.h it generated into an #ifndef
IGNORE_CONFIGURED_SETTINGS block. I don't see that referenced or used
anywhere else. The original commit (fb8155d0d) claimed this was "to be
used by the installer", but I didn't find any reference in the current
installer's Git repository either. I suspect this is obsolete.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services