Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Hugh McMaster <hugh(dot)mcmaster(at)outlook(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library
Date: 2020-03-11 16:39:10
Message-ID: 9171.1583944750@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
> On 10 Mar 2020, at 18:38, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>> Btw., here is an older thread for the same issue <https://www.postgresql.org/message-id/flat/1358164265.29612.7.camel%40vanquo.pezone.net>. Might be worth reflecting on the issues discussed there.

> Thanks, didn't realize that the subject had been up for discussion earlier as
> well.
> For me, the duplication aspect is the most troubling, since we'd still need the
> xml2-config fallback and thus won't be able to simplify the code.

Yeah, but at least it's concentrated in a few lines in configure.in.

I think that the main objection to this is the documentation/confusion
issues raised by Noah in that old thread. Still, we probably don't
have much choice given that some distros are going to remove xml2-config.
In that connection, Hugh's patch lacks docs which is entirely not OK,
but the doc changes in Peter's old patch look workable.

I wonder whether we ought to try to align this with our documented
procedure for falling back if you have no icu-config but want to
use ICU; that part of the docs suggests setting ICU_CFLAGS and ICU_LIBS
manually. The patch as it stands doesn't seem to support manually
giving XML2_CFLAGS and XML2_LIBS, but it looks like it could easily
be adjusted to allow that.

Also, I see that pkg.m4 says

dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac

which we are not doing. We got away with that as long as there was only
one PKG_CHECK_MODULES call ... but with two, I'd expect that the second
one will fall over if the first one isn't executed.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jürgen Purtz 2020-03-11 16:50:28 Re: Add A Glossary
Previous Message Tobias Stadler 2020-03-11 16:18:24 User and Logical Replication