Re: Use "?=" operator for a contrib makefile in documentation

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Maxim Orlov <orlovmg(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use "?=" operator for a contrib makefile in documentation
Date: 2025-09-29 14:19:24
Message-ID: 3409f2f0-6a9a-4848-bbc8-c520714c9446@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29.09.25 16:00, Tom Lane wrote:
> Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
>> On 25.09.25 15:17, Maxim Orlov wrote:
>>> I think that the Makefile should be written so that variable values,
>>> specifically, PG_CONFIG, can be given to it from the environment rather
>>> than the make command line. As a result, using the "?=" operator rather
>>> than "=" to set a default value to the PG_CONFIG variable appears more
>>> acceptable.
>
>> I think the current text is preferable. This allows running
>> make PG_CONFIG=...
>> so that you can pick a different PostgreSQL installation for a
>> particular build.
>
> AFAICT that would still work with ?=. Nonetheless, I agree with
> Peter that we shouldn't change this advice (much less change all our
> Makefiles that do it like that). The reason is that the gmake manual
> advises caution in the use of this feature:

Yes, that's what I meant. The current code allows the "postfix" make
syntax (make PG_CONFIG=...), but it doesn't allow environment variables
to take effect silently (which also prevents the "prefix" syntax
(PG_CONFIG=... make), but that's just the way things work).

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-09-29 14:27:57 Re: plan shape work
Previous Message Robert Haas 2025-09-29 14:17:05 Re: [PATCH] Fix pg_rewind false positives caused by shutdown-only WAL