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

From: Hugh McMaster <hugh(dot)mcmaster(at)outlook(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(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 22:19:35
Message-ID: CAN9BcdtrPG9EBOHNKf5Bmt45FKiNMXd9JZo9zfCv5rPQ8Srxtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 12 Mar 2020 at 03:39, Tom Lane wrote:

> Daniel Gustafsson writes:
> > 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.

Documentation can be added easily. :-)

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.

Unless your system has ICU installed in a non-standard location, there is
no need to set those variables, as PKG_CHECK_MODULES will handle that for
you. `./configure --help` also provides the relevant documentation on
overriding pkg-config’s X_CFLAGS and X_LIBS.

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.

What I said for ICU also applies here (in fact, to all use of
PKG_CHECK_MODULES). For the fallback, a minor rework is required.

The question is really whether we want to maintain a fallback to
xml2-config. To give more context, I gave a more detailed assessment of the
situation in an earlier email to this list. (Personally, I don’t think we
should.)

Do note also that xslt-config will also be a problem at some point.

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.

Yes, that macro needs to be set.

Hugh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-03-11 22:33:42 Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library
Previous Message Tom Lane 2020-03-11 21:56:28 Re: control max length of parameter values logged