From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tristan Partin <tristan@partin.io>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: meson's in-tree libpq header search order vs -Dextra_include_dirs
Date: Mon, 03 Nov 2025 01:14:48 -0500
Message-ID: <230128.1762150488@sss.pgh.pa.us> (raw)
In-Reply-To: <DDYTK4ZKMASW.2JD86Q6T77IU1@partin.io>
References: <CA+hUKGKispvxLyrBn3=3mp0BB1N+RBYR5eE2guCOksnwEoOcPQ@mail.gmail.com>
<DDYTK4ZKMASW.2JD86Q6T77IU1@partin.io>
"Tristan Partin" <tristan@partin.io> writes:
> What is the benefit of -Dextra_include_dirs when you could use -Dc_flags
> or CFLAGS to specify extra include directories? If you tried either of
> those as an alternative, would they fix the issue? The existence of the
> option goes all the way back to the initial commit of the meson port, so
> I presume it exists to mirror --with-includes, but why does that exist?
--with-includes, and likewise --with-libs, exist because there are
platforms that require it. For example, on pretty much any
BSD-derived system, the core /usr/include and /usr/lib files are very
limited and you'll need to point at places like /usr/pkg/include or
/opt/local/include or whatever to pull in non-core packages.
I see your point about putting -I flags into CFLAGS, but what you
are missing is that the order of these flags is unbelievably critical,
so "just shove it into CFLAGS" is a recipe for failure, especially
if you haven't even stopped to think about which end to add it at.
We've learned over decades of trial-and-error with the makefile system
that treating -I and -L flags specially is more reliable. (See for
example all the logic in our autoconf scripts to forcibly separate
-I and -L out of sources like pkg-config. Tracing that stuff back to
the originating commits and mail discussions would be a constructive
learning exercise.)
I'm not sure that the meson crew have learned all that yet.
But this does not suggest to me that they know more than we do.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, tristan@partin.io, thomas.munro@gmail.com
Subject: Re: meson's in-tree libpq header search order vs -Dextra_include_dirs
In-Reply-To: <230128.1762150488@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox