Re: Should contrib modules install .h files?

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Should contrib modules install .h files?
Date: 2018-08-01 06:56:47
Message-ID: 1e7bb14a-d537-2c46-1150-5c8f9d4f2a13@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-08-01 07:04:20 Re: Alter index rename concurrently to
Previous Message Paul Guo 2018-08-01 05:44:35 [Patch] Create a new session in postmaster by calling setsid()