Re: Should contrib modules install .h files? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Should contrib modules install .h files?
Date
Msg-id 1e7bb14a-d537-2c46-1150-5c8f9d4f2a13@2ndquadrant.com
Whole thread Raw
In response to Re: Should contrib modules install .h files?  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
On 01/08/2018 06:17, Andrew Gierth wrote:
> Either way, it's a forced change to the PGXS module's file layout if it
> wants to install headers that work for other people using Tom's
> suggested approach. I'm not on board with this unless there's a better
> solution than I've seen so far.

The problem is that the way we've left it now is so that 50% of the
users will do it wrong.

This reminds me vividly of libxml headers.  For example, on my system
there is a file at

/usr/include/libxml2/libxml/parser.h

How do you use that?

-I/usr/include and #include "libxml2/libxml/parser.h"

or

-I/usr/include/libxml2 and #include "libxml/parser.h"

or

-I/usr/include/libxml2/libxml and #include "parser.h"

Obviously, one can find this out with some experimentation or research,
but in our case there won't be much guidance available.

In the libxml case, the best solution is xml2-config or pkg-config.  I
would like to see something similar here, where users don't have to
fiddle with PG_CPPFLAGS directly.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Paul Guo
Date:
Subject: [Patch] Create a new session in postmaster by calling setsid()
Next
From: Peter Eisentraut
Date:
Subject: Re: Alter index rename concurrently to