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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hugh McMaster <hugh(dot)mcmaster(at)outlook(dot)com>
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-13 16:06:24
Message-ID: 23572.1584115584@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hugh McMaster <hugh(dot)mcmaster(at)outlook(dot)com> writes:
> On Fri, 13 Mar 2020 at 03:39, Tom Lane wrote:
>> That won't win us any friends, so the attached revision
>> doesn't call PKG_CHECK_MODULES unless we found pkg-config.

> Did you mean to terminate configure if pkg-config cannot find
> libxml-2.0 or the library is too old? Your doc changes don't indicate
> that intent, nor was it prior behaviour, but some projects like that
> behaviour and others don't.

Yeah, a potential edge-case here is that pkg-config is in the PATH
but it has no information about libxml2 (I doubt we need to consider
the risk that it has info about a pre-2.6.23 version). Looking
again at the generated configure code, I realize I shouldn't have
left off the ACTION-IF-NOT-FOUND argument --- the default is to
throw an error, but we'd rather fall through and try to use xml2-config.
The eventual AC_CHECK_LIB(xml2, ...) test will catch the situation
where the library isn't there. Updated patch attached.

> You might consider this an edge case, but you override custom
> XML2_CFLAGS/LIBS if xml2-config is detected.

Yeah, if pkg-config fails and xml2-config is present, that's true.
Since those weren't there before, and we now document them as just
a fallback solution, I think that's fine.

regards, tom lane

Attachment Content-Type Size
0001-pkg-check-modules-libxml2-v3.patch text/x-diff 15.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2020-03-13 16:09:44 Re: PATCH: add support for IN and @> in functional-dependency statistics use
Previous Message Alvaro Herrera 2020-03-13 15:41:03 Re: Optimize crash recovery