automating pg_config.h.win32 maintenance

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: automating pg_config.h.win32 maintenance
Date: 2019-12-13 12:51:55
Message-ID: 1441b834-f434-e0bf-46ed-9c4d5c29c2d4@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-Generate-pg_config.h-from-pg_config.h.in-on-Windows.patch text/plain 9.9 KB
0002-Remove-pg_config.h.win32.patch text/plain 24.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2019-12-13 13:14:08 Re: automating pg_config.h.win32 maintenance
Previous Message Peter Eisentraut 2019-12-13 12:33:21 Re: Remove configure --disable-float4-byval and --disable-float8-byval