Re: pkg-config files for libpq and ecpg

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pkg-config files for libpq and ecpg
Date: 2013-03-31 02:49:16
Message-ID: 1364698156.4626.7.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2013-03-27 at 17:06 -0400, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > On 3/24/13 1:55 PM, Tom Lane wrote:
> >> I experimented a bit with this version of the patch. The hunk that
> >> removes -I$(libpq_srcdir) and $(libpq) from the ecpg/compatlib build
> >> breaks the build for me, so I took it out.
>
> > What was the error message? Probably not important, but curious.
>
> ecpg's #include of libpq-fe.h failed. I speculate that you didn't
> notice because you tested on a machine where libpq-fe.h exists in
> /usr/include.

Right, we need to keep libpq in CPPFLAGS, but we can remove it from
SHLIB_LINK.

> >> At least for the libraries we are currently proposing to pkgconfig-ify,
> >> it seems to me that we only want a -I for where we are installing our
> >> own headers; there is no need for anything else. That is,
> >> echo 'Cflags: -I$(includedir)'
> >> seems like plenty. We aren't exposing any other packages' headers
> >> in the public header files for these libraries, so there's no need
> >> to tell client packages about them.
>
> > libpq exposes at least openssl and gssapi, so we need those at least.
>
> No, it does not. A client might choose to #include those of its own
> accord, but then it's the client's problem. Our exported headers do
> not #include anything more exotic than <stdio.h>, and it's not the
> business of the pkg-config switches to provide for anything beyond
> allowing inclusions of our headers to succeed.

I was actually thinking of PQgetssl(), which is documented to require
OpenSSL, but that was actually changed a long time ago and the
documentation not updated.

So actually you are right, we don't need to provided any extra -I flags
(if we ignore libpq-int.h). We do need that whole logic for
Libs.private however.

So here is my updated patch, with the ecpg business changed as explained
above, and the extra magic removed from the Cflags lines.

Attachment Content-Type Size
pg-pkg-config-v2.patch text/x-patch 6.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-03-31 03:35:24 Re: citext like searches using index
Previous Message Bruce Momjian 2013-03-31 02:21:41 Re: Fix for pg_upgrade and invalid indexes